Skip to content
Permalink
Browse files

Squash planes (#831)

  • Loading branch information...
MistakeNot4892 authored and Lohikar committed Feb 15, 2019
1 parent 4b1783a commit 210417d1f3cecc640ea2e80ec881055c7e8de094
Showing with 167 additions and 540 deletions.
  1. +85 −237 code/__defines/_planes+layers.dm
  2. +1 −99 code/_helpers/icons.dm
  3. +1 −1 code/_onclick/hud/fullscreen.dm
  4. +5 −1 code/_onclick/hud/skybox.dm
  5. +1 −1 code/controllers/subsystems/open_space.dm
  6. +1 −1 code/controllers/subsystems/skybox.dm
  7. +1 −1 code/game/area/Space Station 13 areas.dm
  8. +0 −1 code/game/atoms_movable.dm
  9. +0 −1 code/game/machinery/camera/camera.dm
  10. +0 −1 code/game/machinery/cryo.dm
  11. +0 −1 code/game/machinery/floor_light.dm
  12. +0 −2 code/game/machinery/hologram.dm
  13. +0 −1 code/game/machinery/lightswitch.dm
  14. +0 −1 code/game/machinery/magnet.dm
  15. +0 −1 code/game/machinery/navbeacon.dm
  16. +1 −2 code/game/objects/auras/blueforge_aura.dm
  17. +0 −1 code/game/objects/auras/radiant_aura.dm
  18. +1 −2 code/game/objects/auras/starlight.dm
  19. +0 −1 code/game/objects/effects/chem/chemsmoke.dm
  20. +0 −1 code/game/objects/effects/decals/Cleanable/fuel.dm
  21. +0 −2 code/game/objects/effects/decals/Cleanable/misc.dm
  22. +2 −1 code/game/objects/effects/decals/cleanable.dm
  23. +0 −2 code/game/objects/effects/decals/decal.dm
  24. +0 −2 code/game/objects/effects/decals/misc.dm
  25. +0 −1 code/game/objects/effects/decals/warning_stripes.dm
  26. +0 −1 code/game/objects/effects/fake_fire.dm
  27. +0 −2 code/game/objects/effects/fluids.dm
  28. +1 −2 code/game/objects/effects/mines.dm
  29. +0 −2 code/game/objects/effects/misc.dm
  30. +0 −3 code/game/objects/effects/overlays.dm
  31. +0 −2 code/game/objects/effects/spiders.dm
  32. +0 −1 code/game/objects/effects/temporary_effect.dm
  33. +0 −1 code/game/objects/items/devices/spy_bug.dm
  34. +0 −1 code/game/objects/items/shooting_range.dm
  35. +0 −1 code/game/objects/items/weapons/policetape.dm
  36. +0 −1 code/game/objects/items/weapons/weaponry.dm
  37. +1 −1 code/game/objects/objs.dm
  38. +0 −1 code/game/objects/structures/bedsheet_bin.dm
  39. +3 −4 code/game/objects/structures/catwalk.dm
  40. +0 −4 code/game/objects/structures/curtains.dm
  41. +1 −1 code/game/objects/structures/drain.dm
  42. +2 −2 code/game/objects/structures/electricchair.dm
  43. +0 −3 code/game/objects/structures/flora.dm
  44. +0 −1 code/game/objects/structures/girders.dm
  45. +0 −1 code/game/objects/structures/lattice.dm
  46. +4 −4 code/game/objects/structures/morgue.dm
  47. +0 −1 code/game/objects/structures/pit.dm
  48. +0 −1 code/game/objects/structures/plasticflaps.dm
  49. +1 −1 code/game/objects/structures/railing.dm
  50. +0 −6 code/game/objects/structures/stool_bed_chair_nest/chairs.dm
  51. +0 −1 code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm
  52. +1 −1 code/game/objects/structures/target_stake.dm
  53. +0 −1 code/game/objects/structures/transit_tubes.dm
  54. +2 −2 code/game/objects/structures/watercloset.dm
  55. +0 −3 code/game/turfs/flooring/flooring_decals.dm
  56. +1 −2 code/game/turfs/flooring/flooring_premade.dm
  57. +0 −6 code/game/turfs/simulated/floor.dm
  58. +3 −3 code/game/turfs/simulated/floor_icon.dm
  59. +0 −1 code/game/turfs/simulated/wall_shuttle.dm
  60. +0 −1 code/game/turfs/simulated/walls.dm
  61. +5 −4 code/game/turfs/space/space.dm
  62. +1 −3 code/game/turfs/turf.dm
  63. +3 −3 code/game/turfs/turf_ao.dm
  64. +1 −1 code/game/turfs/unsimulated/beach.dm
  65. +0 −1 code/modules/ZAS/Fire.dm
  66. +1 −2 code/modules/admin/verbs/debug.dm
  67. +1 −1 code/modules/admin/verbs/mapping.dm
  68. +3 −7 code/modules/assembly/mousetrap.dm
  69. +3 −6 code/modules/atmospherics/atmospherics.dm
  70. +0 −1 code/modules/atmospherics/components/shutoff.dm
  71. +1 −1 code/modules/flora/trees.dm
  72. +1 −1 code/modules/hydroponics/seed_datums.dm
  73. +1 −2 code/modules/hydroponics/spreading/spreading.dm
  74. +0 −1 code/modules/lighting/lighting_overlay.dm
  75. +0 −1 code/modules/mining/drilling/drill.dm
  76. +0 −1 code/modules/mining/mine_items.dm
  77. +3 −3 code/modules/mining/mine_turfs.dm
  78. +2 −2 code/modules/mob/living/bot/bot.dm
  79. +1 −2 code/modules/mob/living/bot/ed209bot.dm
  80. +1 −2 code/modules/mob/living/bot/mulebot.dm
  81. +2 −3 code/modules/mob/living/bot/secbot.dm
  82. +0 −1 code/modules/mob/living/carbon/human/human_defines.dm
  83. +0 −3 code/modules/mob/living/carbon/human/human_helpers.dm
  84. +0 −1 code/modules/mob/living/living.dm
  85. +0 −1 code/modules/mob/living/silicon/robot/robot.dm
  86. +0 −1 code/modules/mob/living/simple_animal/hostile/giant_spider.dm
  87. +0 −1 code/modules/mob/mob.dm
  88. +1 −3 code/modules/mob/mob_defines.dm
  89. +1 −1 code/modules/mob/observer/freelook/chunk.dm
  90. +1 −1 code/modules/mob/observer/observer.dm
  91. +0 −1 code/modules/multiz/structures.dm
  92. +2 −2 code/modules/multiz/turf.dm
  93. +0 −1 code/modules/multiz/zshadow.dm
  94. +0 −1 code/modules/organs/external/head.dm
  95. +1 −1 code/modules/overmap/exoplanets/exoplanet.dm
  96. +0 −1 code/modules/overmap/sectors.dm
  97. +0 −1 code/modules/power/apc.dm
  98. +3 −7 code/modules/power/cable.dm
  99. +0 −1 code/modules/power/fusion/core/_core.dm
  100. +1 −1 code/modules/power/fusion/core/core_field.dm
  101. +0 −1 code/modules/power/fusion/fuel_assembly/fuel_assembly.dm
  102. +0 −1 code/modules/power/fusion/fuel_assembly/fuel_compressor.dm
  103. +0 −3 code/modules/power/lighting.dm
  104. +3 −6 code/modules/power/terminal.dm
  105. +0 −1 code/modules/projectiles/effects.dm
  106. +0 −1 code/modules/projectiles/targeting/targeting_overlay.dm
  107. +0 −1 code/modules/random_map/drop/droppod_doors.dm
  108. +3 −5 code/modules/recycling/disposal.dm
  109. +0 −1 code/modules/shield_generators/shield.dm
  110. +0 −1 code/modules/shieldgen/energy_field.dm
  111. +0 −1 code/modules/smokables/_smokables.dm
  112. +0 −1 code/modules/tables/flipping.dm
  113. +0 −1 code/modules/turbolift/turbolift_console.dm
  114. +1 −1 code/modules/vehicles/bike.dm
  115. +0 −1 code/modules/vehicles/vehicle.dm
  116. +0 −1 code/modules/ventcrawl/ventcrawl.dm
  117. +1 −1 test/check-paths.sh
@@ -1,251 +1,99 @@
/*This file is a list of all preclaimed planes & layers
#define SKYBOX_PLANE -100
#define SPACE_LAYER 0
#define SKYBOX_LAYER 1

All planes & layers should be given a value here instead of using a magic/arbitrary number.
After fiddling with planes and layers for some time, I figured I may as well provide some documentation:
What are planes?
Think of Planes as a sort of layer for a layer - if plane X is a larger number than plane Y, the highest number for a layer in X will be below the lowest
number for a layer in Y.
Planes also have the added bonus of having planesmasters.
What are Planesmasters?
Planesmasters, when in the sight of a player, will have its appearance properties (for example, colour matrices, alpha, transform, etc)
applied to all the other objects in the plane. This is all client sided.
Usually you would want to add the planesmaster as an invisible image in the client's screen.
What can I do with Planesmasters?
You can: Make certain players not see an entire plane,
Make an entire plane have a certain colour matrices,
Make an entire plane transform in a certain way,
Make players see a plane which is hidden to normal players - I intend to implement this with the antag HUDs for example.
Planesmasters can be used as a neater way to deal with client images or potentially to do some neat things
How do planes work?
A plane can be any integer from -100 to 100. (If you want more, bug lummox.)
All planes above 0, the 'base plane', are visible even when your character cannot 'see' them, for example, the HUD.
All planes below 0, the 'base plane', are only visible when a character can see them.
How do I add a plane?
Think of where you want the plane to appear, look through the pre-existing planes and find where it is above and where it is below
Slot it in in that place, and change the pre-existing planes, making sure no plane shares a number.
Add a description with a comment as to what the plane does.
How do I make something a planesmaster?
Add the PLANE_MASTER appearance flag to the appearance_flags variable.
What is the naming convention for planes or layers?
Make sure to use the name of your object before the _LAYER or _PLANE, eg: [NAME_OF_YOUR_OBJECT HERE]_LAYER or [NAME_OF_YOUR_OBJECT HERE]_PLANE
Also, as it's a define, it is standard practice to use capital letters for the variable so people know this.
*/

/*
from stddef.dm, planes & layers built into byond.
FLOAT_LAYER = -1
AREA_LAYER = 1
TURF_LAYER = 2
OBJ_LAYER = 3
MOB_LAYER = 4
FLY_LAYER = 5
EFFECTS_LAYER = 5000
TOPDOWN_LAYER = 10000
BACKGROUND_LAYER = 20000
EFFECTS_LAYER = 5000
TOPDOWN_LAYER = 10000
BACKGROUND_LAYER = 20000
------
FLOAT_PLANE = -32767
*/

#define CLICKCATCHER_PLANE -500

#define SPACE_PLANE -499
#define SKYBOX_PLANE SPACE_PLANE + 1

#define DUST_PLANE SPACE_PLANE + 2
#define DEBRIS_LAYER 1
#define DUST_LAYER 2
#define DUST_PLANE -99
#define DUST_LAYER 0

//Reserve planes for openspace
#define OPENSPACE_PLANE_START -462
#define OPENSPACE_PLANE_END -22
#define OPENSPACE_PLANE -463
#define OVER_OPENSPACE_PLANE -22


#define BELOW_TURF_PLANE -22 // objects that are below turfs. Useful for asteroid smoothing or other such magic.
// TURF_LAYER 2

#define PLATING_PLANE -21

#define ABOVE_PLATING_PLANE -20

#define HOLOMAP_LAYER 1 // NOTE: ENSURE this is equal to the one at ABOVE_TURF_PLANE!
#define DECAL_PLATING_LAYER 2
#define DISPOSALS_PIPE_LAYER 3
#define LATTICE_LAYER 4
#define PIPE_LAYER 5
#define WIRE_LAYER 6
#define WIRE_TERMINAL_LAYER 7
#define ABOVE_WIRE_LAYER 8

#define TURF_PLANE -19

#define BASE_TURF_LAYER -999
#define TURF_DETAIL_LAYER 1

#define ABOVE_TURF_PLANE -18 // For items which should appear above turfs but below other objects and hiding mobs, eg: wires & pipes

// #define HOLOMAP_LAYER 1 // NOTE: ENSURE this is equal to the one at ABOVE_PLATING_PLANE!
#define DECAL_LAYER 2
#define RUNE_LAYER 3
#define ABOVE_TILE_LAYER 4
#define EXPOSED_PIPE_LAYER 5
#define EXPOSED_WIRE_LAYER 6
#define EXPOSED_WIRE_TERMINAL_LAYER 7
#define CATWALK_LAYER 8
#define BLOOD_LAYER 9
#define MOUSETRAP_LAYER 10
#define PLANT_LAYER 11
#define AO_LAYER 12

#define HIDING_MOB_PLANE -16 // for hiding mobs like MoMMIs or spiders or whatever, under most objects but over pipes & such.

#define HIDING_MOB_LAYER 0
#define SHALLOW_FLUID_LAYER 1

#define OBJ_PLANE -15 // For objects which appear below humans.

#define BELOW_DOOR_LAYER 0.25
#define OPEN_DOOR_LAYER 0.5
#define BELOW_TABLE_LAYER 0.75
#define TABLE_LAYER 1
#define BELOW_OBJ_LAYER 2
#define STRUCTURE_LAYER 2.5
// OBJ_LAYER 3
#define ABOVE_OBJ_LAYER 4
#define CLOSED_DOOR_LAYER 5
#define ABOVE_DOOR_LAYER 6
#define SIDE_WINDOW_LAYER 7
#define FULL_WINDOW_LAYER 8
#define ABOVE_WINDOW_LAYER 9

#define LYING_MOB_PLANE -14 // other mobs that are lying down.

#define LYING_MOB_LAYER 0
#define OPENSPACE_PLANE -98
#define OVER_OPENSPACE_PLANE -3
#define CLICKCATCHER_PLANE -2

#define DEFAULT_PLANE 0
#define PLATING_LAYER 1
#define TURF_DETAIL_LAYER 2
#define HOLOMAP_LAYER 3
#define DISPOSALS_PIPE_LAYER 4
#define LATTICE_LAYER 5
#define PIPE_LAYER 6
#define WIRE_LAYER 7
#define TERMINAL_LAYER 8
#define RUNE_LAYER 9
#define BASE_TURF_LAYER 10
#define DECAL_LAYER 11
#define ABOVE_TILE_LAYER 12
#define EXPOSED_PIPE_LAYER 13
#define EXPOSED_WIRE_LAYER 14
#define EXPOSED_TERMINAL_LAYER 15
#define ABOVE_WIRE_LAYER 16
#define CATWALK_LAYER 17
#define BLOOD_LAYER 18
#define MOUSETRAP_LAYER 19
#define PLANT_LAYER 20
#define HIDING_MOB_LAYER 21
#define SHALLOW_FLUID_LAYER 22
#define AO_LAYER 23
#define BELOW_DOOR_LAYER 24
#define OPEN_DOOR_LAYER 25
#define BELOW_TABLE_LAYER 26
#define TABLE_LAYER 27
#define BELOW_OBJ_LAYER 28
#define BASE_OBJECT_LAYER 29
#define STRUCTURE_LAYER 30
#define ABOVE_OBJ_LAYER 31
#define CLOSED_DOOR_LAYER 32
#define ABOVE_DOOR_LAYER 33
#define SIDE_WINDOW_LAYER 34
#define FULL_WINDOW_LAYER 35
#define ABOVE_WINDOW_LAYER 36
#define BASE_MOB_LAYER 37
#define LYING_MOB_LAYER 38
#define LYING_HUMAN_LAYER 39
#define BASE_ABOVE_OBJ_LAYER 40
#define ABOVE_HUMAN_LAYER 41
#define VEHICLE_LOAD_LAYER 42
#define CAMERA_LAYER 43
#define BLOB_SHIELD_LAYER 44
#define BLOB_NODE_LAYER 45
#define BLOB_CORE_LAYER 46
#define BELOW_PROJECTILE_LAYER 47
#define DEEP_FLUID_LAYER 48
#define FIRE_LAYER 49
#define PROJECTILE_LAYER 50
#define ABOVE_PROJECTILE_LAYER 51
#define SINGULARITY_LAYER 52
#define POINTER_LAYER 53
#define OBSERVER_LAYER 54
#define LIGHTBULB_LAYER 55
#define FULLSCREEN_LAYER 56
#define DAMAGE_LAYER 57
#define IMPAIRED_LAYER 58
#define BLIND_LAYER 59
#define CRIT_LAYER 60
#define LIGHTING_LAYER 61
#define ABOVE_LIGHTING_LAYER 62
#define EYE_GLOW_LAYER 63
#define BEAM_PROJECTILE_LAYER 64
#define OBFUSCATION_LAYER 65
#define BASE_AREA_LAYER 66

#define HUD_PLANE 1
#define UNDER_HUD_LAYER 0
#define HUD_BASE_LAYER 1
#define HUD_ITEM_LAYER 2
#define HUD_ABOVE_ITEM_LAYER 3

/atom
plane = DEFAULT_PLANE

#define LYING_HUMAN_PLANE -13 // humans that are lying down

#define LYING_HUMAN_LAYER 0

#define ABOVE_OBJ_PLANE -12 // for objects that are below humans when they are standing but above them when they are not. - eg, blankets.

#define BASE_ABOVE_OBJ_LAYER 0

#define HUMAN_PLANE -11 // For Humans that are standing up.
// MOB_LAYER 4

#define MOB_PLANE -7 // For Mobs.
// MOB_LAYER 4

#define ABOVE_HUMAN_PLANE -6 // For things that should appear above humans.

#define ABOVE_HUMAN_LAYER 0
#define VEHICLE_LOAD_LAYER 1
#define CAMERA_LAYER 2

#define BLOB_PLANE -5 // For Blobs, which are above humans.

#define BLOB_SHIELD_LAYER 1
#define BLOB_NODE_LAYER 2
#define BLOB_CORE_LAYER 3

#define EFFECTS_BELOW_LIGHTING_PLANE -4 // For special effects.

#define BELOW_PROJECTILE_LAYER 1
#define DEEP_FLUID_LAYER 2
#define FIRE_LAYER 3
#define PROJECTILE_LAYER 4
#define ABOVE_PROJECTILE_LAYER 5
#define SINGULARITY_LAYER 6
#define POINTER_LAYER 7

#define OBSERVER_PLANE -3 // For observers and ghosts

#define LIGHTING_PLANE -2 // For Lighting. - The highest plane (ignoring all other even higher planes)

#define LIGHTBULB_LAYER 0
#define LIGHTING_LAYER 1
#define ABOVE_LIGHTING_LAYER 2

#define EFFECTS_ABOVE_LIGHTING_PLANE -1 // For glowy eyes, laser beams, etc. that shouldn't be affected by darkness
#define EYE_GLOW_LAYER 1
#define BEAM_PROJECTILE_LAYER 2

#define BASE_PLANE 0 // Not for anything, but this is the default.
#define BASE_AREA_LAYER 999

#define OBSCURITY_PLANE 2 // For visualnets, such as the AI's static.

#define FULLSCREEN_PLANE 3 // for fullscreen overlays that do not cover the hud.

#define FULLSCREEN_LAYER 0
#define DAMAGE_LAYER 1
#define IMPAIRED_LAYER 2
#define BLIND_LAYER 3
#define CRIT_LAYER 4

#define HUD_PLANE 4 // For the Head-Up Display

#define UNDER_HUD_LAYER 0
#define HUD_BASE_LAYER 1
#define HUD_ITEM_LAYER 2
#define HUD_ABOVE_ITEM_LAYER 3


//This is difference between highest and lowest visible
#define PLANE_DIFFERENCE 22
/image
plane = FLOAT_PLANE // this is defunct, lummox fixed this on recent compilers, but it will bug out if I remove it for coders not on the most recent compile.

/image/proc/plating_decal_layerise()
plane = ABOVE_PLATING_PLANE
layer = DECAL_PLATING_LAYER

/image/proc/turf_decal_layerise()
plane = ABOVE_TURF_PLANE
layer = DECAL_LAYER

/atom/proc/hud_layerise()
plane = HUD_PLANE
layer = HUD_ITEM_LAYER

/atom/proc/reset_plane_and_layer()
plane = initial(plane)
layer = initial(layer)

/*
PLANE MASTERS
*/

/obj/screen/plane_master
appearance_flags = PLANE_MASTER
screen_loc = "CENTER,CENTER"
globalscreen = 1

/obj/screen/plane_master/ghost_master
plane = OBSERVER_PLANE

/obj/screen/plane_master/ghost_dummy
// this avoids a bug which means plane masters which have nothing to control get angry and mess with the other plane masters out of spite
alpha = 0
appearance_flags = 0
plane = OBSERVER_PLANE

GLOBAL_LIST_INIT(ghost_master, list(
new /obj/screen/plane_master/ghost_master(),
new /obj/screen/plane_master/ghost_dummy()
))
Oops, something went wrong.

0 comments on commit 210417d

Please sign in to comment.
You can’t perform that action at this time.