diff --git a/code/__DEFINES/layers_planes.dm b/code/__DEFINES/layers_planes.dm
deleted file mode 100644
index 8773c58e163..00000000000
--- a/code/__DEFINES/layers_planes.dm
+++ /dev/null
@@ -1,18 +0,0 @@
-//Contains all our layer and plane defines
-
-//If you want more information on how byond renders things, look here http://www.byond.com/forum/?post=2042210
-
-#define PLANE_CLICKCATCHER -99
-
-#define PLANE_GAME 0 //This might need splitting into different planes later, but for now it will do
-
-#define PLANE_LIGHTING 15
-#define PLANE_EFFECTS_UNLIT 16
-
-#define PLANE_FULLSCREEN 18
-#define LAYER_DAMAGE 18.1
-#define LAYER_BLIND 18.2
-#define LAYER_CRIT 18.3
-
-#define PLANE_UI_BASE 19 //All the screen objects go here
-#define PLANE_UI_OBJECTS 20 //Your actual equipment being displayed
\ No newline at end of file
diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm
index 194e77a1d02..4b531f503c8 100644
--- a/code/__HELPERS/icons.dm
+++ b/code/__HELPERS/icons.dm
@@ -688,7 +688,6 @@ The _flatIcons list is a cache for generated icon files.
curblend = A.blend_mode
// Layers will be a sorted list of icons/overlays, based on the order in which they are displayed
- // TODO: Needs to support overlays/underlays on different planes from parent
var/list/layers = list()
var/image/copy
// Add the atom's icon itself, without pixel_x/y offsets.
diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm
index ffefa455b8a..ce70339a466 100644
--- a/code/__HELPERS/unsorted.dm
+++ b/code/__HELPERS/unsorted.dm
@@ -495,15 +495,14 @@ Turf and target are seperate in case you want to teleport some distance from a t
return y
-/proc/anim(turf/location, atom/movable/target, a_icon, a_icon_state as text, flick_anim as text, sleeptime = 0, direction as num)
+/proc/anim(turf/location,target as mob|obj,a_icon,a_icon_state as text,flick_anim as text,sleeptime = 0,direction as num)
//This proc throws up either an icon or an animation for a specified amount of time.
//The variables should be apparent enough.
var/atom/movable/overlay/animation = new(location)
if(direction)
animation.dir = direction
animation.icon = a_icon
- animation.layer = target.layer+1
- animation.plane = target.plane
+ animation.layer = target:layer+1
if(a_icon_state)
animation.icon_state = a_icon_state
else
diff --git a/code/_onclick/_defines.dm b/code/_onclick/_defines.dm
new file mode 100644
index 00000000000..3c76c35e807
--- /dev/null
+++ b/code/_onclick/_defines.dm
@@ -0,0 +1 @@
+#define CLICKCATCHER_PLANE -99
\ No newline at end of file
diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm
index 2837f152faa..26838de68c3 100644
--- a/code/_onclick/click.dm
+++ b/code/_onclick/click.dm
@@ -325,7 +325,7 @@
/obj/screen/click_catcher
icon = 'icons/mob/screen_gen.dmi'
icon_state = "click_catcher"
- plane = PLANE_CLICKCATCHER
+ plane = CLICKCATCHER_PLANE
mouse_opacity = 2
screen_loc = "CENTER-7,CENTER-7"
diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm
index 6344fc927a1..f8974e1b31c 100644
--- a/code/_onclick/hud/alert.dm
+++ b/code/_onclick/hud/alert.dm
@@ -37,12 +37,9 @@
if(new_master)
var/old_layer = new_master.layer
- var/old_plane = new_master.plane
new_master.layer = FLOAT_LAYER
- new_master.plane = PLANE_UI_OBJECTS
alert.overlays += new_master
new_master.layer = old_layer
- new_master.plane = old_plane
alert.icon_state = "template" // We'll set the icon to the client's ui pref in reorganize_alerts()
alert.master = new_master
else
diff --git a/code/_onclick/hud/blob_overmind.dm b/code/_onclick/hud/blob_overmind.dm
index 36eb5b2f247..8e3dcd2aa39 100644
--- a/code/_onclick/hud/blob_overmind.dm
+++ b/code/_onclick/hud/blob_overmind.dm
@@ -125,7 +125,7 @@
blobpwrdisplay.icon_state = "block"
blobpwrdisplay.screen_loc = ui_health
blobpwrdisplay.mouse_opacity = 0
- blobpwrdisplay.plane = PLANE_UI_BASE
+ blobpwrdisplay.layer = 20
infodisplay += blobpwrdisplay
healths = new /obj/screen/healths/blob()
diff --git a/code/_onclick/hud/fullscreen.dm b/code/_onclick/hud/fullscreen.dm
index 391d72f8561..a0a74545db8 100644
--- a/code/_onclick/hud/fullscreen.dm
+++ b/code/_onclick/hud/fullscreen.dm
@@ -1,3 +1,8 @@
+#define FULLSCREEN_LAYER 18
+#define DAMAGE_LAYER FULLSCREEN_LAYER + 0.1
+#define BLIND_LAYER DAMAGE_LAYER + 0.1
+#define CRIT_LAYER BLIND_LAYER + 0.1
+
/mob
var/list/screens = list()
@@ -58,7 +63,7 @@
icon = 'icons/mob/screen_full.dmi'
icon_state = "default"
screen_loc = "CENTER-7,CENTER-7"
- plane = PLANE_FULLSCREEN
+ layer = FULLSCREEN_LAYER
mouse_opacity = 0
var/severity = 0
@@ -69,19 +74,19 @@
/obj/screen/fullscreen/brute
icon_state = "brutedamageoverlay"
- layer = LAYER_DAMAGE
+ layer = DAMAGE_LAYER
/obj/screen/fullscreen/oxy
icon_state = "oxydamageoverlay"
- layer = LAYER_DAMAGE
+ layer = DAMAGE_LAYER
/obj/screen/fullscreen/crit
icon_state = "passage"
- layer = LAYER_CRIT
+ layer = CRIT_LAYER
/obj/screen/fullscreen/blind
icon_state = "blackimageoverlay"
- layer = LAYER_BLIND
+ layer = BLIND_LAYER
/obj/screen/fullscreen/impaired
icon_state = "impairedoverlay"
@@ -104,4 +109,9 @@
/obj/screen/fullscreen/high
icon = 'icons/mob/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
- icon_state = "druggy"
\ No newline at end of file
+ icon_state = "druggy"
+
+#undef FULLSCREEN_LAYER
+#undef BLIND_LAYER
+#undef DAMAGE_LAYER
+#undef CRIT_LAYER
diff --git a/code/_onclick/hud/other_mobs.dm b/code/_onclick/hud/other_mobs.dm
index 482ed7e8df7..e1bacf6922d 100644
--- a/code/_onclick/hud/other_mobs.dm
+++ b/code/_onclick/hud/other_mobs.dm
@@ -31,8 +31,11 @@
name = "Faith"
icon_state = "deity_power"
screen_loc = ui_deitypower
+ layer = 20
/obj/screen/deity_follower_display
name = "Followers"
icon_state = "deity_followers"
- screen_loc = ui_deityfollowers
\ No newline at end of file
+ screen_loc = ui_deityfollowers
+ layer = 20
+
diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm
index 77064c1a79a..b13623a9bfd 100644
--- a/code/_onclick/hud/robot.dm
+++ b/code/_onclick/hud/robot.dm
@@ -197,7 +197,7 @@
A.screen_loc = "CENTER[x]:16,SOUTH+[y]:7"
else
A.screen_loc = "CENTER+[x]:16,SOUTH+[y]:7"
- A.plane = PLANE_UI_OBJECTS //need to move this to module init eventually
+ A.layer = 20
x++
if(x == 4)
diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm
index fc9868b4d4e..2fc47ab95be 100644
--- a/code/_onclick/hud/screen_objects.dm
+++ b/code/_onclick/hud/screen_objects.dm
@@ -9,7 +9,7 @@
/obj/screen
name = ""
icon = 'icons/mob/screen_gen.dmi'
- plane = PLANE_UI_BASE
+ layer = 20
unacidable = 1
appearance_flags = APPEARANCE_UI
var/obj/master = null //A reference to the object in the slot. Grabs or items, generally.
@@ -29,6 +29,7 @@
maptext_width = 480
/obj/screen/swap_hand
+ layer = 19
name = "swap hand"
/obj/screen/swap_hand/Click()
@@ -50,6 +51,7 @@
var/slot_id // The indentifier for the slot. It has nothing to do with ID cards.
var/icon_empty // Icon when empty. For now used only by humans.
var/icon_full // Icon when contains an item. For now used only by humans.
+ layer = 19
/obj/screen/inventory/Click()
// At this point in client Click() code we have passed the 1/10 sec check and little else
@@ -84,11 +86,9 @@
..()
if(!active_overlay)
active_overlay = image("icon"=icon, "icon_state"="hand_active")
- active_overlay.plane = PLANE_UI_BASE
if(!handcuff_overlay)
var/state = (slot_id == slot_r_hand) ? "markus" : "gabrielle"
handcuff_overlay = image("icon"='icons/mob/screen_gen.dmi', "icon_state"=state)
- handcuff_overlay.plane = PLANE_UI_OBJECTS
overlays.Cut()
@@ -136,6 +136,7 @@
name = "drop"
icon = 'icons/mob/screen_midnight.dmi'
icon_state = "act_drop"
+ layer = 19
/obj/screen/drop/Click()
usr.drop_item_v()
@@ -284,6 +285,7 @@
name = "resist"
icon = 'icons/mob/screen_midnight.dmi'
icon_state = "act_resist"
+ layer = 19
/obj/screen/resist/Click()
if(isliving(usr))
@@ -377,9 +379,7 @@
/obj/screen/zone_sel/update_icon(mob/user)
overlays.Cut()
- var/image/overlay = image('icons/mob/screen_gen.dmi', "[selecting]")
- overlay.plane = PLANE_UI_BASE
- overlays += overlay
+ overlays += image('icons/mob/screen_gen.dmi', "[selecting]")
user.zone_selected = selecting
/obj/screen/zone_sel/alien
@@ -393,6 +393,23 @@
/obj/screen/zone_sel/robot
icon = 'icons/mob/screen_cyborg.dmi'
+
+/obj/screen/flash
+ name = "flash"
+ icon_state = "blank"
+ blend_mode = BLEND_ADD
+ screen_loc = "WEST,SOUTH to EAST,NORTH"
+ layer = 17
+
+/obj/screen/damageoverlay
+ icon = 'icons/mob/screen_full.dmi'
+ icon_state = "oxydamageoverlay0"
+ name = "dmg"
+ blend_mode = BLEND_MULTIPLY
+ screen_loc = "CENTER-7,CENTER-7"
+ mouse_opacity = 0
+ layer = 18.1 //The black screen overlay sets layer to 18 to display it, this one has to be just on top.
+
/obj/screen/healths
name = "health"
icon_state = "health0"
diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm
index 9562c708a03..1fb7b369327 100644
--- a/code/_onclick/telekinesis.dm
+++ b/code/_onclick/telekinesis.dm
@@ -71,7 +71,7 @@ var/const/tk_maxrange = 15
flags = NOBLUDGEON | ABSTRACT
//item_state = null
w_class = 10
- plane = PLANE_UI_OBJECTS
+ layer = 20
var/last_throw = 0
var/atom/movable/focus = null
@@ -173,7 +173,6 @@ var/const/tk_maxrange = 15
O.anchored = 1
O.density = 0
O.layer = FLY_LAYER
- O.plane = PLANE_EFFECTS_UNLIT
O.dir = pick(cardinal)
O.icon = 'icons/effects/effects.dmi'
O.icon_state = "nothing"
@@ -184,10 +183,9 @@ var/const/tk_maxrange = 15
/obj/item/tk_grab/update_icon()
overlays.Cut()
- if(focus)
- var/image/I = image(focus.icon, focus.icon_state)
- I.plane = PLANE_UI_OBJECTS
- overlays += I
+ if(focus && focus.icon && focus.icon_state)
+ overlays += icon(focus.icon,focus.icon_state)
+ return
/obj/item/tk_grab/suicide_act(mob/user)
user.visible_message("[user] is using \his telekinesis to choke \himself! It looks like \he's trying to commit suicide.")
diff --git a/code/datums/action.dm b/code/datums/action.dm
index 6d883261029..59976843017 100644
--- a/code/datums/action.dm
+++ b/code/datums/action.dm
@@ -89,8 +89,8 @@
/datum/action/proc/ApplyIcon(obj/screen/movable/action_button/current_button)
current_button.overlays.Cut()
if(button_icon && button_icon_state)
- var/image/img = image(button_icon, current_button, button_icon_state)
- img.plane = current_button.plane
+ var/image/img
+ img = image(button_icon, current_button, button_icon_state)
img.pixel_x = 0
img.pixel_y = 0
current_button.overlays += img
@@ -131,10 +131,10 @@
..(current_button)
else if(target)
var/obj/item/I = target
- var/old = I.plane
- I.plane = current_button.plane
+ var/old = I.layer
+ I.layer = FLOAT_LAYER //AAAH
current_button.overlays += I
- I.plane = old
+ I.layer = old
/datum/action/item_action/toggle_light
name = "Toggle Light"
diff --git a/code/datums/diseases/transformation.dm b/code/datums/diseases/transformation.dm
index c1b1c3a3d46..b814687318a 100644
--- a/code/datums/diseases/transformation.dm
+++ b/code/datums/diseases/transformation.dm
@@ -53,6 +53,7 @@
if(istype(W, /obj/item/weapon/implant))
qdel(W)
continue
+ W.layer = initial(W.layer)
W.loc = affected_mob.loc
W.dropped(affected_mob)
var/mob/living/new_mob = new new_form(affected_mob.loc)
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index e77151bf38b..e6727a1f781 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -1,6 +1,5 @@
/atom
layer = 2
- plane = PLANE_GAME
var/level = 2
var/flags = 0
var/list/fingerprints
diff --git a/code/game/objects/effects/decals/misc.dm b/code/game/objects/effects/decals/misc.dm
index 45847a3019a..0a627518e15 100644
--- a/code/game/objects/effects/decals/misc.dm
+++ b/code/game/objects/effects/decals/misc.dm
@@ -2,7 +2,7 @@
name = "pointer"
icon = 'icons/mob/screen_gen.dmi'
icon_state = "arrow"
- plane = PLANE_EFFECTS_UNLIT
+ layer = 16
duration = 25
/obj/effect/overlay/temp/point/New(loc, set_invis = 0)
diff --git a/code/game/objects/effects/misc.dm b/code/game/objects/effects/misc.dm
index 1d48966e85e..4d621cf0fdd 100644
--- a/code/game/objects/effects/misc.dm
+++ b/code/game/objects/effects/misc.dm
@@ -13,7 +13,6 @@
icon_state = "blank"
anchored = 1
layer = 99
- plane = PLANE_EFFECTS_UNLIT
mouse_opacity = 0
unacidable = 1//Just to be sure.
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index 4af7e0f7769..bd0425a9239 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -359,21 +359,22 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s
return
/obj/item/proc/dropped(mob/user)
- plane = initial(plane)
for(var/X in actions)
var/datum/action/A = X
A.Remove(user)
// called just as an item is picked up (loc is not yet changed)
/obj/item/proc/pickup(mob/user)
+ return
+
// called when this item is removed from a storage item, which is passed on as S. The loc variable is already set to the new destination before this is called.
/obj/item/proc/on_exit_storage(obj/item/weapon/storage/S)
- plane = initial(plane)
+ return
// called when this item is added into a storage item, which is passed on as S. The loc variable is already set to the storage item.
/obj/item/proc/on_enter_storage(obj/item/weapon/storage/S)
- plane = PLANE_UI_OBJECTS
+ return
// called when "found" in pockets and storage items. Returns 1 if the search should end.
/obj/item/proc/on_found(mob/finder)
@@ -383,8 +384,8 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s
// user is mob that equipped it
// slot uses the slot_X defines found in setup.dm
// for items that can be placed in multiple slots
+// note this isn't called during the initial dressing of a player
/obj/item/proc/equipped(mob/user, slot)
- plane = PLANE_UI_OBJECTS
for(var/X in actions)
var/datum/action/A = X
if(item_action_slot_check(slot, user)) //some items only give their actions buttons when in a specific slot.
diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm
index ca2046dd05d..6e89ab267a0 100644
--- a/code/game/objects/items/devices/chameleonproj.dm
+++ b/code/game/objects/items/devices/chameleonproj.dm
@@ -36,7 +36,7 @@
user << "Scanned [target]."
var/obj/temp = new/obj()
temp.appearance = target.appearance
- temp.plane = initial(target.plane) // scanning things in your inventory
+ temp.layer = initial(target.layer) // scanning things in your inventory
saved_appearance = temp.appearance
/obj/item/device/chameleon/proc/toggle()
diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm
index 0a0b96b736c..88b479e8591 100644
--- a/code/game/objects/items/weapons/storage/storage.dm
+++ b/code/game/objects/items/weapons/storage/storage.dm
@@ -157,6 +157,7 @@
boxes.screen_loc = "[tx]:,[ty] to [mx],[my]"
for(var/obj/O in contents)
O.screen_loc = "[cx],[cy]"
+ O.layer = 20
cx++
if(cx > mx)
cx = tx
@@ -175,7 +176,7 @@
ND.sample_object.mouse_opacity = 2
ND.sample_object.screen_loc = "[cx]:16,[cy]:16"
ND.sample_object.maptext = "[(ND.number > 1)? "[ND.number]" : ""]"
- ND.sample_object.plane = PLANE_UI_OBJECTS
+ ND.sample_object.layer = 20
cx++
if(cx > (4+cols))
cx = 4
@@ -185,7 +186,7 @@
O.mouse_opacity = 2 //This is here so storage items that spawn with contents correctly have the "click around item to equip"
O.screen_loc = "[cx]:16,[cy]:16"
O.maptext = ""
- O.plane = PLANE_UI_OBJECTS
+ O.layer = 20
cx++
if(cx > (4+cols))
cx = 4
@@ -341,6 +342,7 @@
if(ismob(loc))
var/mob/M = loc
W.dropped(M)
+ W.layer = initial(W.layer)
W.loc = new_location
if(usr)
@@ -460,11 +462,11 @@
boxes.master = src
boxes.icon_state = "block"
boxes.screen_loc = "7,7 to 10,8"
- boxes.plane = PLANE_UI_BASE
+ boxes.layer = 19
closer = new /obj/screen/close()
closer.master = src
closer.icon_state = "backpack_close"
- closer.plane = PLANE_UI_BASE
+ closer.layer = 20
orient2hud()
diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm
index 59ead4befdf..012c704f2c3 100644
--- a/code/modules/admin/topic.dm
+++ b/code/modules/admin/topic.dm
@@ -1386,6 +1386,7 @@
M.unEquip(I)
if(I)
I.loc = M.loc
+ I.layer = initial(I.layer)
I.dropped(M)
M.Paralyse(5)
@@ -1415,6 +1416,7 @@
M.unEquip(I)
if(I)
I.loc = M.loc
+ I.layer = initial(I.layer)
I.dropped(M)
M.Paralyse(5)
@@ -1467,6 +1469,7 @@
M.unEquip(I)
if(I)
I.loc = M.loc
+ I.layer = initial(I.layer)
I.dropped(M)
if(istype(M, /mob/living/carbon/human))
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm
index 47049225a61..55ac2266861 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm
@@ -259,9 +259,7 @@
user.visible_message("[user] unwelds the vent.", "You unweld the vent.", "You hear welding.")
welded = 0
update_icon()
- var/image/I = image(src, loc, dir = dir)
- I.plane = PLANE_UI_OBJECTS
- pipe_vision_img = I
+ pipe_vision_img = image(src, loc, layer = 20, dir = dir)
return 0
else
return ..()
@@ -291,9 +289,7 @@
user.visible_message("[user] furiously claws at [src]!", "You manage to clear away the stuff blocking the vent", "You hear loud scraping noises.")
welded = 0
update_icon()
- var/image/I = image(src, loc, dir = dir)
- I.plane = PLANE_UI_OBJECTS
- pipe_vision_img = I
+ pipe_vision_img = image(src, loc, layer = 20, dir = dir)
playsound(loc, 'sound/weapons/bladeslice.ogg', 100, 1)
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm
index c71bb06edc7..b9c727da0a6 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm
@@ -308,9 +308,7 @@
user.visible_message("[user] unwelds the scrubber.", "You unweld the scrubber.", "You hear welding.")
welded = 0
update_icon()
- var/image/I = image(src, loc, dir = dir)
- I.plane = PLANE_UI_OBJECTS
- pipe_vision_img = I
+ pipe_vision_img = image(src, loc, layer = 20, dir = dir)
return 0
else
return ..()
@@ -331,9 +329,7 @@
user.visible_message("[user] furiously claws at [src]!", "You manage to clear away the stuff blocking the scrubber.", "You hear loud scraping noises.")
welded = 0
update_icon()
- var/image/I = image(src, loc, dir = dir)
- I.plane = PLANE_UI_OBJECTS
- pipe_vision_img = I
+ pipe_vision_img = image(src, loc, layer = 20, dir = dir)
playsound(loc, 'sound/weapons/bladeslice.ogg', 100, 1)
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index 6505244ff74..6f8f9f0b464 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -355,10 +355,8 @@ BLIND // can't see anything
I.transform *= 0.5 //halve the size so it doesn't overpower the under
I.pixel_x += 8
I.pixel_y -= 8
- var/oldlayer = I.layer
I.layer = FLOAT_LAYER
overlays += I
- I.layer = oldlayer
if(istype(loc, /mob/living/carbon/human))
@@ -492,6 +490,7 @@ BLIND // can't see anything
hastie.transform *= 2
hastie.pixel_x -= 8
hastie.pixel_y += 8
+ hastie.layer = initial(hastie.layer)
overlays = null
usr.put_in_hands(hastie)
hastie = null
diff --git a/code/modules/events/anomaly_bluespace.dm b/code/modules/events/anomaly_bluespace.dm
index b4d9705223b..bfb574706cc 100644
--- a/code/modules/events/anomaly_bluespace.dm
+++ b/code/modules/events/anomaly_bluespace.dm
@@ -65,7 +65,7 @@
blueeffect.screen_loc = "WEST,SOUTH to EAST,NORTH"
blueeffect.icon = 'icons/effects/effects.dmi'
blueeffect.icon_state = "shieldsparkles"
- blueeffect.plane = PLANE_EFFECTS_UNLIT
+ blueeffect.layer = 17
blueeffect.mouse_opacity = 0
M.client.screen += blueeffect
sleep(20)
diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm
index 4dc75290766..70c2a6f2870 100644
--- a/code/modules/flufftext/Hallucination.dm
+++ b/code/modules/flufftext/Hallucination.dm
@@ -635,7 +635,7 @@ var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/projectile, /obj/ite
if(!H.r_store) slots_free += ui_storage2
if(slots_free.len)
halitem.screen_loc = pick(slots_free)
- halitem.plane = PLANE_UI_OBJECTS
+ halitem.layer = 50
switch(rand(1,6))
if(1) //revolver
halitem.icon = 'icons/obj/guns/projectile.dmi'
diff --git a/code/modules/lighting/lighting_system.dm b/code/modules/lighting/lighting_system.dm
index 4df36030f91..e797c182abc 100644
--- a/code/modules/lighting/lighting_system.dm
+++ b/code/modules/lighting/lighting_system.dm
@@ -27,6 +27,7 @@
*/
#define LIGHTING_CIRCULAR 1 //Comment this out to use old square lighting effects.
+#define LIGHTING_LAYER 15 //Drawing layer for lighting
#define LIGHTING_CAP 10 //The lumcount level at which alpha is 0 and we're fully lit.
#define LIGHTING_CAP_FRAC (255/LIGHTING_CAP) //A precal'd variable we'll use in turf/redraw_lighting()
#define LIGHTING_ICON 'icons/effects/alphacolors.dmi'
@@ -235,7 +236,7 @@
/atom/movable/light
icon = LIGHTING_ICON
icon_state = LIGHTING_ICON_STATE
- plane = PLANE_LIGHTING
+ layer = LIGHTING_LAYER
mouse_opacity = 0
blend_mode = BLEND_OVERLAY
invisibility = INVISIBILITY_LIGHTING
@@ -361,6 +362,7 @@
T.init_lighting()
T.update_lumcount(0)
+#undef LIGHTING_LAYER
#undef LIGHTING_CIRCULAR
#undef LIGHTING_ICON
#undef LIGHTING_ICON_STATE
diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm
index 881eced9a21..1e9afbc17ad 100644
--- a/code/modules/mining/equipment_locker.dm
+++ b/code/modules/mining/equipment_locker.dm
@@ -253,6 +253,7 @@
new s.type(loc,s.max_amount)
s.use(s.max_amount)
s.loc = loc
+ s.layer = initial(s.layer)
/obj/machinery/mineral/ore_redemption/power_change()
..()
@@ -993,8 +994,7 @@
var/client/C = user.client
for(var/turf/closed/mineral/M in minerals)
var/turf/F = get_turf(M)
- var/image/I = image('icons/turf/smoothrocks.dmi', loc = F, icon_state = M.scan_state)
- I.plane = PLANE_EFFECTS_UNLIT
+ var/image/I = image('icons/turf/smoothrocks.dmi', loc = F, icon_state = M.scan_state, layer = 18)
C.images += I
spawn(30)
if(C)
@@ -1012,7 +1012,7 @@
C.icon_state = M.scan_state
/obj/effect/overlay/temp/mining_overlay
- plane = PLANE_EFFECTS_UNLIT
+ layer = 20
icon = 'icons/turf/smoothrocks.dmi'
anchored = 1
mouse_opacity = 0
diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm
index 0beb14f8186..3a8e0dcaaa6 100644
--- a/code/modules/mob/inventory.dm
+++ b/code/modules/mob/inventory.dm
@@ -29,6 +29,7 @@
if(!l_hand)
W.loc = src //TODO: move to equipped?
l_hand = W
+ W.layer = 20 //TODO: move to equipped?
W.equipped(src,slot_l_hand)
if(pulling == W)
stop_pulling()
@@ -46,6 +47,7 @@
if(!r_hand)
W.loc = src
r_hand = W
+ W.layer = 20
W.equipped(src,slot_r_hand)
if(pulling == W)
stop_pulling()
@@ -90,6 +92,7 @@
return 1
else
W.loc = get_turf(src)
+ W.layer = initial(W.layer)
W.dropped(src)
return 0
@@ -151,6 +154,8 @@
client.screen -= I
I.loc = loc
I.dropped(src)
+ if(I)
+ I.layer = initial(I.layer)
return 1
diff --git a/code/modules/mob/living/carbon/inventory.dm b/code/modules/mob/living/carbon/inventory.dm
index 3dd183b486c..00efe469b81 100644
--- a/code/modules/mob/living/carbon/inventory.dm
+++ b/code/modules/mob/living/carbon/inventory.dm
@@ -32,6 +32,7 @@
I.screen_loc = null // will get moved if inventory is visible
I.loc = src
I.equipped(src, slot)
+ I.layer = 20
switch(slot)
if(slot_back)
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index e332ffd19ba..e33323c786a 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -833,7 +833,6 @@ Sorry Giacom. Please don't be mad :(
I = image(r_hand.icon, A, r_hand.icon_state, A.layer + 1)
else // Attacked with a fist?
return
- I.plane = PLANE_EFFECTS_UNLIT
// Who can see the attack?
var/list/viewing = list()
diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm
index 01f753c3545..91413e2e1ad 100644
--- a/code/modules/mob/living/silicon/robot/inventory.dm
+++ b/code/modules/mob/living/silicon/robot/inventory.dm
@@ -48,7 +48,7 @@
if(!module_state_1)
O.mouse_opacity = initial(O.mouse_opacity)
module_state_1 = O
- O.plane = PLANE_UI_OBJECTS
+ O.layer = 20
O.screen_loc = inv1.screen_loc
contents += O
if(istype(module_state_1,/obj/item/borg/sight))
@@ -58,7 +58,7 @@
else if(!module_state_2)
O.mouse_opacity = initial(O.mouse_opacity)
module_state_2 = O
- O.plane = PLANE_UI_OBJECTS
+ O.layer = 20
O.screen_loc = inv2.screen_loc
contents += O
if(istype(module_state_2,/obj/item/borg/sight))
@@ -68,7 +68,7 @@
else if(!module_state_3)
O.mouse_opacity = initial(O.mouse_opacity)
module_state_3 = O
- O.plane = PLANE_UI_OBJECTS
+ O.layer = 20
O.screen_loc = inv3.screen_loc
contents += O
if(istype(module_state_3,/obj/item/borg/sight))
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index b89d21228af..5128a13958e 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -84,6 +84,7 @@
robot_modules_background = new()
robot_modules_background.icon_state = "block"
+ robot_modules_background.layer = 19 //Objects that appear on screen are on layer 20, UI should be just below it.
ident = rand(1, 999)
update_icons()
diff --git a/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm b/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm
index a354e355ae9..cc56e9382a9 100644
--- a/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm
+++ b/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm
@@ -94,6 +94,7 @@
I.screen_loc = null // will get moved if inventory is visible
I.loc = src
I.equipped(src, slot)
+ I.layer = 20
switch(slot)
if(slot_head)
diff --git a/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm b/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm
index 399b64b1401..4b3e79d22f3 100644
--- a/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm
+++ b/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm
@@ -37,6 +37,7 @@
hands_overlays += r_hand_image
if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD)
+ r_hand.layer = 20
r_hand.screen_loc = ui_rhand
client.screen |= r_hand
@@ -53,6 +54,7 @@
hands_overlays += l_hand_image
if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD)
+ l_hand.layer = 20
l_hand.screen_loc = ui_lhand
client.screen |= l_hand
diff --git a/code/modules/mob/living/ventcrawling.dm b/code/modules/mob/living/ventcrawling.dm
index 6e07ba5cd28..d01b00ceaeb 100644
--- a/code/modules/mob/living/ventcrawling.dm
+++ b/code/modules/mob/living/ventcrawling.dm
@@ -92,8 +92,8 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/components/unary
for(var/X in totalMembers)
var/obj/machinery/atmospherics/A = X //all elements in totalMembers are necessarily of this type.
if(!A.pipe_vision_img)
- A.pipe_vision_img = image(A, A.loc, dir = A.dir)
- A.pipe_vision_img.plane = PLANE_EFFECTS_UNLIT
+ A.pipe_vision_img = image(A, A.loc, layer = 20, dir = A.dir)
+ //20 for being above darkness
pipes_shown += A.pipe_vision_img
if(client)
client.images += A.pipe_vision_img
diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm
index e9cbe67732b..c89cf9ac1a8 100644
--- a/code/modules/mob/mob_grab.dm
+++ b/code/modules/mob/mob_grab.dm
@@ -12,7 +12,7 @@
var/allow_upgrade = 1
var/last_upgrade = 0
- plane = PLANE_UI_OBJECTS
+ layer = 21
item_state = "nothing"
w_class = 5
diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm
index b1d1f59cb68..9a5aae78ea7 100644
--- a/code/modules/mob/transform_procs.dm
+++ b/code/modules/mob/transform_procs.dm
@@ -132,6 +132,7 @@
if (W)
W.loc = loc
W.dropped(src)
+ W.layer = initial(W.layer)
//Make mob invisible and spawn animation
notransform = 1
diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm
index 9c1042aeb9d..c93db65fd7e 100644
--- a/code/modules/paperwork/photography.dm
+++ b/code/modules/paperwork/photography.dm
@@ -201,7 +201,7 @@
var/atom/c = atoms[i]
for(j = sorted.len, j > 0, --j)
var/atom/c2 = sorted[j]
- if(c2.layer <= c.layer)//needs updating to account for plane
+ if(c2.layer <= c.layer)
break
sorted.Insert(j+1, c)
diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm
index 380efe7b88c..60a44a6f8bc 100644
--- a/code/modules/power/singularity/collector.dm
+++ b/code/modules/power/singularity/collector.dm
@@ -118,6 +118,7 @@ var/global/list/rad_collectors = list()
if (!Z)
return
Z.loc = get_turf(src)
+ Z.layer = initial(Z.layer)
src.loaded_tank = null
if(active)
toggle_power()
diff --git a/tgstation.dme b/tgstation.dme
index 51878b33da4..803eefaaf0b 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -31,7 +31,6 @@
#include "code\__DEFINES\genetics.dm"
#include "code\__DEFINES\hud.dm"
#include "code\__DEFINES\is_helpers.dm"
-#include "code\__DEFINES\layers_planes.dm"
#include "code\__DEFINES\machines.dm"
#include "code\__DEFINES\math.dm"
#include "code\__DEFINES\misc.dm"
@@ -85,6 +84,7 @@
#include "code\_globalvars\lists\mobs.dm"
#include "code\_globalvars\lists\names.dm"
#include "code\_globalvars\lists\objects.dm"
+#include "code\_onclick\_defines.dm"
#include "code\_onclick\adjacent.dm"
#include "code\_onclick\ai.dm"
#include "code\_onclick\autoclick.dm"