From f2fef6f410ded44079fc20c505a84ce90111c297 Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Wed, 17 Jan 2018 14:45:54 -0500 Subject: [PATCH] Planes Framework (#4545) * Polaris initial plane upstream merge * POLARIS: Fix RIG visors with new plane system, and material scanner VIS_FULLBRIGHT * POLARIS: Fix GetFlatIcon so that cameras and id pictures don't show the HUD overlays. * POLARIS: Adds a 'alter values' proc for plane master ease of tweaking Setting stuff like colorblindness variety and things. * Remove NIF reference, fix lighting layer define * Handle effects above lighting plane * Moved all layer defines to planes+layers.dm * Fixed overlays that are supposed to be above lighting to use the PLANE_LIGHTING_ABOVE * Merge: 3000% human/update_icons() speed improvement * Merge: Avoid ghosts pointing at things --- code/__defines/_planes+layers.dm | 92 ++++++-- code/__defines/mobs.dm | 27 ++- code/_helpers/icons.dm | 14 +- code/_helpers/mobs.dm | 2 +- code/_onclick/hud/fullscreen.dm | 6 +- code/_onclick/hud/hud.dm | 31 +-- code/_onclick/hud/human.dm | 22 +- code/_onclick/hud/robot.dm | 2 +- code/_onclick/hud/screen_objects.dm | 3 +- code/defines/procs/hud.dm | 82 -------- code/game/antagonist/outsider/mercenary.dm | 2 +- code/game/antagonist/outsider/technomancer.dm | 2 +- code/game/antagonist/outsider/wizard.dm | 2 +- code/game/area/Space Station 13 areas.dm | 4 +- code/game/atoms.dm | 2 +- .../changeling/generic_equip_procs.dm | 22 +- .../changeling/powers/fabricate_clothing.dm | 20 +- .../gamemodes/changeling/powers/revive.dm | 2 +- .../endgame/supermatter_cascade/blob.dm | 2 +- code/game/gamemodes/gameticker.dm | 3 +- code/game/gamemodes/sandbox/h_sandbox.dm | 16 +- .../computer3/computers/HolodeckControl.dm | 2 +- code/game/machinery/lightswitch.dm | 3 +- code/game/mecha/medical/odysseus.dm | 8 +- code/game/objects/items.dm | 9 +- code/game/objects/items/weapons/cosmetics.dm | 4 +- .../items/weapons/grenades/flashbang.dm | 2 +- .../objects/items/weapons/storage/storage.dm | 25 +-- code/game/objects/structures/curtains.dm | 3 - code/game/objects/structures/flora/trees.dm | 5 +- code/game/objects/structures/morgue.dm | 2 +- code/global.dm | 8 +- code/modules/admin/admin_verbs.dm | 25 ++- code/modules/admin/topic.dm | 6 +- code/modules/admin/verbs/buildmode.dm | 3 +- code/modules/admin/verbs/randomverbs.dm | 2 +- code/modules/client/preferences.dm | 3 +- code/modules/clothing/clothing.dm | 12 ++ code/modules/clothing/glasses/glasses.dm | 49 ++--- code/modules/clothing/glasses/hud.dm | 13 +- .../clothing/spacesuits/rig/modules/vision.dm | 8 + code/modules/holodeck/HolodeckControl.dm | 2 +- code/modules/lighting/lighting_overlay.dm | 3 +- code/modules/mob/dead/observer/login.dm | 10 +- code/modules/mob/dead/observer/observer.dm | 149 ++++--------- code/modules/mob/freelook/eye.dm | 17 +- code/modules/mob/inventory.dm | 6 +- code/modules/mob/living/bot/medbot.dm | 2 +- code/modules/mob/living/bot/secbot.dm | 6 +- code/modules/mob/living/carbon/carbon.dm | 3 +- .../mob/living/carbon/human/appearance.dm | 12 +- code/modules/mob/living/carbon/human/death.dm | 4 +- code/modules/mob/living/carbon/human/human.dm | 27 +-- .../mob/living/carbon/human/human_defines.dm | 5 +- .../mob/living/carbon/human/human_helpers.dm | 55 +++++ .../mob/living/carbon/human/human_powers.dm | 2 +- .../mob/living/carbon/human/human_species.dm | 1 + .../mob/living/carbon/human/inventory.dm | 6 +- code/modules/mob/living/carbon/human/life.dm | 23 +- .../mob/living/carbon/human/update_icons.dm | 171 +++++++++------ code/modules/mob/living/silicon/ai/ai.dm | 10 - code/modules/mob/living/silicon/ai/life.dm | 5 - code/modules/mob/living/silicon/pai/life.dm | 8 +- .../mob/living/silicon/robot/inventory.dm | 6 +- code/modules/mob/living/silicon/robot/life.dm | 10 - .../modules/mob/living/silicon/robot/robot.dm | 25 ++- code/modules/mob/living/silicon/silicon.dm | 48 ++++- .../simple_animal/animals/giant_spider.dm | 4 +- .../simple_animal/constructs/constructs.dm | 9 +- code/modules/mob/login.dm | 7 + code/modules/mob/mob.dm | 4 +- code/modules/mob/mob_defines.dm | 4 + code/modules/mob/mob_helpers.dm | 32 +-- code/modules/mob/mob_planes.dm | 196 ++++++++++++++++++ .../mob/new_player/preferences_setup.dm | 2 +- code/modules/mob/update_icons.dm | 19 ++ code/modules/organs/blood.dm | 8 +- code/modules/organs/organ_external.dm | 8 +- code/modules/paperwork/paper.dm | 8 +- code/modules/paperwork/photography.dm | 4 +- code/modules/projectiles/projectile/energy.dm | 2 +- code/modules/surgery/limb_reattach.dm | 6 +- code/modules/surgery/other.dm | 2 +- code/modules/virus2/effect.dm | 4 +- icons/misc/win32.dmi | Bin 0 -> 196 bytes polaris.dme | 3 +- 86 files changed, 874 insertions(+), 614 deletions(-) delete mode 100644 code/defines/procs/hud.dm create mode 100644 code/modules/mob/mob_planes.dm create mode 100644 icons/misc/win32.dmi diff --git a/code/__defines/_planes+layers.dm b/code/__defines/_planes+layers.dm index b58a50c05ad..baff5ad5773 100644 --- a/code/__defines/_planes+layers.dm +++ b/code/__defines/_planes+layers.dm @@ -40,33 +40,83 @@ What is the naming convention for planes or layers? */ -#define DEFAULT_PLANE 0 // BYOND's default value for plane, the "base plane" +#define PLANE_ADMIN1 -92 //Purely for shenanigans +#define PLANE_ADMIN2 -91 //And adminbuse +#define PLANE_ADMIN3 -90 //And generating salt -#define SPACE_PLANE -32 // Reserved for use in space/parallax - -#define PARALLAX_PLANE -30 // Reserved for use in space/parallax +#define SPACE_PLANE -32 // Reserved for use in space/parallax +#define PARALLAX_PLANE -30 // Reserved for use in space/parallax // OPENSPACE_PLANE reserves all planes between OPENSPACE_PLANE_START and OPENSPACE_PLANE_END inclusive -#define OPENSPACE_PLANE_START -23 -#define OPENSPACE_PLANE_END -8 -#define OPENSPACE_PLANE -25 // /turf/simulated/open will use OPENSPACE_PLANE + z (Valid z's being 2 thru 17) +#define OPENSPACE_PLANE -55 // /turf/simulated/open will use OPENSPACE_PLANE + z (Valid z's being 2 thru 17) +#define OPENSPACE_PLANE_START -53 +#define OPENSPACE_PLANE_END -38 +#define OVER_OPENSPACE_PLANE -37 -#define OVER_OPENSPACE_PLANE -7 +//////////////////////////////////////////////////////////////////////////////////////// +#define PLANE_WORLD 0 // BYOND's default value for plane, the "base plane" +//////////////////////////////////////////////////////////////////////////////////////// + + //#define TURF_LAYER 2 //For easy recordkeeping; this is a byond define + #define DOOR_OPEN_LAYER 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6 + //#define OBJ_LAYER 3 //For easy recordkeeping; this is a byond define + #define DOOR_CLOSED_LAYER 3.1 //Above most items if closed + #define SHOWER_OPEN_LAYER 3.4 + #define BELOW_MOB_LAYER 3.9 + //#define MOB_LAYER 4 //For easy recordkeeping; this is a byond define + #define ABOVE_MOB_LAYER 4.1 + #define SHOWER_CLOSED_LAYER 4.2 + + //#define FLY_LAYER 5 //For easy recordkeeping; this is a byond define + #define LIGHTING_LAYER 11 //Layer that lighting used to be on (now it's on a plane) + #define HUD_LAYER 20 //Above lighting, but below obfuscation. For in-game HUD effects (whereas SCREEN_LAYER is for abstract/OOC things like inventory slots) + #define OBFUSCATION_LAYER 21 //Where images covering the view for eyes are put + #define SCREEN_LAYER 22 //Mob HUD/effects layer + +#define PLANE_LIGHTING 5 //Where the lighting (and darkness) lives +#define PLANE_LIGHTING_ABOVE 6 //For glowy eyes etc. that shouldn't be affected by darkness + +#define PLANE_GHOSTS 10 //Spooooooooky ghooooooosts +#define PLANE_AI_EYE 11 //The AI eye lives here + +// "Character HUDs", aka HUDs, but not the game's UI. Things like medhuds. I know Planes say they must be intergers, but it's lies. +#define PLANE_CH_STATUS 15 //Status icon +#define PLANE_CH_HEALTH 16 //Health icon +#define PLANE_CH_LIFE 17 //Health bar +#define PLANE_CH_ID 18 //Job icon +#define PLANE_CH_WANTED 19 //Arrest icon +#define PLANE_CH_IMPLOYAL 20 //Loyalty implant icon +#define PLANE_CH_IMPTRACK 21 //Tracking implant icon +#define PLANE_CH_IMPCHEM 22 //Chemical implant icon +#define PLANE_CH_SPECIAL 23 //Special role icon (revhead or w/e) +#define PLANE_CH_STATUS_OOC 24 //OOC status hud for spooks -// Now for the regular layers. Try to keep these in order, from lowest to highest numbers, please. +//Fullscreen overlays under inventory +#define PLANE_FULLSCREEN 90 //Blindness, mesons, druggy, etc + #define FULLSCREEN_LAYER 18 + #define DAMAGE_LAYER 18.1 + #define BLIND_LAYER 18.2 + #define CRIT_LAYER 18.3 -//#define TURF_LAYER 2 //For easy recordkeeping; this is a byond define -#define DOOR_OPEN_LAYER 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6 -//#define OBJ_LAYER 3 //For easy recordkeeping; this is a byond define -#define DOOR_CLOSED_LAYER 3.1 //Above most items if closed +//Client UI HUD stuff +#define PLANE_PLAYER_HUD 95 //The character's UI is on this plane + #define LAYER_HUD_UNDER 1 //Under the HUD items + #define LAYER_HUD_BASE 2 //The HUD items themselves + #define LAYER_HUD_ITEM 3 //Things sitting on HUD items (largely irrelevant because PLANE_PLAYER_HUD_ITEMS) + #define LAYER_HUD_ABOVE 4 //Things that reside above items (highlights) +#define PLANE_PLAYER_HUD_ITEMS 96 //Separate layer with which to apply colorblindness -#define BELOW_MOB_LAYER 3.9 -//#define MOB_LAYER 4 //For easy recordkeeping; this is a byond define -#define ABOVE_MOB_LAYER 4.1 -//#define FLY_LAYER 5 //For easy recordkeeping; this is a byond define -#define LIGHTING_LAYER 11 -#define HUD_LAYER 20 //Above lighting, but below obfuscation. For in-game HUD effects (whereas SCREEN_LAYER is for abstract/OOC things like inventory slots) -#define OBFUSCATION_LAYER 21 //Where images covering the view for eyes are put -#define SCREEN_LAYER 22 //Mob HUD/effects layer \ No newline at end of file +////////////////////////// +/atom/proc/hud_layerise() + plane = PLANE_PLAYER_HUD_ITEMS + layer = LAYER_HUD_ITEM + +/atom/proc/reset_plane_and_layer() + plane = initial(plane) + layer = initial(layer) + + +// Check if a mob can "logically" see an atom plane +#define MOB_CAN_SEE_PLANE(M, P) (P == PLANE_WORLD || (P >= OPENSPACE_PLANE_START && P <= OPENSPACE_PLANE_END) || (P in M.planes_visible)) diff --git a/code/__defines/mobs.dm b/code/__defines/mobs.dm index 95ed996f241..cb0ecc37f52 100644 --- a/code/__defines/mobs.dm +++ b/code/__defines/mobs.dm @@ -227,4 +227,29 @@ // For slime commanding. Higher numbers allow for more actions. #define SLIME_COMMAND_OBEY 1 // When disciplined. #define SLIME_COMMAND_FACTION 2 // When in the same 'faction'. -#define SLIME_COMMAND_FRIEND 3 // When befriended with a slime friendship agent. \ No newline at end of file +#define SLIME_COMMAND_FRIEND 3 // When befriended with a slime friendship agent. + +//Vision flags, for dealing with plane visibility +#define VIS_FULLBRIGHT 1 +#define VIS_GHOSTS 2 +#define VIS_AI_EYE 3 + +#define VIS_CH_STATUS 4 +#define VIS_CH_HEALTH 5 +#define VIS_CH_LIFE 6 +#define VIS_CH_ID 7 +#define VIS_CH_WANTED 8 +#define VIS_CH_IMPLOYAL 9 +#define VIS_CH_IMPTRACK 10 +#define VIS_CH_IMPCHEM 11 +#define VIS_CH_SPECIAL 12 +#define VIS_CH_STATUS_OOC 13 + +#define VIS_D_COLORBLIND 14 +#define VIS_D_COLORBLINDI 15 + +#define VIS_ADMIN1 16 +#define VIS_ADMIN2 17 +#define VIS_ADMIN3 18 + +#define VIS_COUNT 18 //Must be highest number from above. \ No newline at end of file diff --git a/code/_helpers/icons.dm b/code/_helpers/icons.dm index c971b22dace..8440d3688c7 100644 --- a/code/_helpers/icons.dm +++ b/code/_helpers/icons.dm @@ -635,7 +635,7 @@ The _flatIcons list is a cache for generated icon files. */ proc // Creates a single icon from a given /atom or /image. Only the first argument is required. - getFlatIcon(image/A, defdir=2, deficon=null, defstate="", defblend=BLEND_DEFAULT, always_use_defdir = 0) + getFlatIcon(image/A, defdir=2, deficon=null, defstate="", defblend=BLEND_DEFAULT, always_use_defdir = 0, picture_planes = list(PLANE_WORLD)) // We start with a blank canvas, otherwise some icon procs crash silently var/icon/flat = icon('icons/effects/effects.dmi', "icon_state"="nothing") // Final flattened icon if(!A) @@ -700,6 +700,10 @@ proc // Creates a single icon from a given /atom or /image. Only the first argu if(curIndex<=process.len) current = process[curIndex] if(current) + var/currentPlane = current:plane + if (currentPlane != FLOAT_PLANE && !(currentPlane in picture_planes)) + curIndex++ + continue; currentLayer = current:layer if(currentLayer<0) // Special case for FLY_LAYER if(currentLayer <= -1000) return flat @@ -760,7 +764,7 @@ proc // Creates a single icon from a given /atom or /image. Only the first argu // Pull the default direction. add = icon(I:icon, I:icon_state) else // 'I' is an appearance object. - add = getFlatIcon(new/image(I), curdir, curicon, curstate, curblend) + add = getFlatIcon(new/image(I), curdir, curicon, curstate, curblend, picture_planes = picture_planes) // Find the new dimensions of the flat icon to fit the added overlay addX1 = min(flatX1, I:pixel_x+1) @@ -873,3 +877,9 @@ proc/sort_atoms_by_layer(var/list/atoms) result.Swap(i, gap + i) swapped = 1 return result + +/proc/gen_hud_image(var/file, var/person, var/state, var/plane) + var/image/img = image(file, person, state) + img.plane = plane //Thanks Byond. + img.appearance_flags = APPEARANCE_UI|KEEP_APART + return img diff --git a/code/_helpers/mobs.dm b/code/_helpers/mobs.dm index a9939b0ecb0..4bd85ac182b 100644 --- a/code/_helpers/mobs.dm +++ b/code/_helpers/mobs.dm @@ -129,7 +129,7 @@ proc/age2agedescription(age) else return "unknown" /proc/RoundHealth(health) - var/list/icon_states = icon_states('icons/mob/hud_med.dmi') + var/list/icon_states = icon_states(ingame_hud_med) for(var/icon_state in icon_states) if(health >= text2num(icon_state)) return icon_state diff --git a/code/_onclick/hud/fullscreen.dm b/code/_onclick/hud/fullscreen.dm index a00fa6e10dc..94a067200a9 100644 --- a/code/_onclick/hud/fullscreen.dm +++ b/code/_onclick/hud/fullscreen.dm @@ -1,8 +1,3 @@ -#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() @@ -68,6 +63,7 @@ icon_state = "default" screen_loc = "CENTER-7,CENTER-7" layer = FULLSCREEN_LAYER + plane = PLANE_FULLSCREEN mouse_opacity = 0 var/severity = 0 diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 0f6990f6812..9aad6671119 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -37,32 +37,30 @@ var/list/global_huds = list( screen.icon = 'icons/obj/hud_full.dmi' screen.icon_state = icon_state screen.layer = SCREEN_LAYER + screen.plane = PLANE_FULLSCREEN screen.mouse_opacity = 0 return screen +/obj/screen/global_screen + screen_loc = ui_entire_screen + layer = 17 + plane = PLANE_FULLSCREEN + mouse_opacity = 0 + /datum/global_hud/New() //420erryday psychedellic colours screen overlay for when you are high - druggy = new /obj/screen() - druggy.screen_loc = ui_entire_screen + druggy = new /obj/screen/global_screen() druggy.icon_state = "druggy" - druggy.layer = 17 - druggy.mouse_opacity = 0 //that white blurry effect you get when you eyes are damaged - blurry = new /obj/screen() - blurry.screen_loc = ui_entire_screen + blurry = new /obj/screen/global_screen() blurry.icon_state = "blurry" - blurry.layer = 17 - blurry.mouse_opacity = 0 //static overlay effect for cameras and the like - whitense = new /obj/screen() - whitense.screen_loc = ui_entire_screen + whitense = new /obj/screen/global_screen() whitense.icon = 'icons/effects/static.dmi' whitense.icon_state = "1 light" - whitense.layer = 17 - whitense.mouse_opacity = 0 nvg = setup_overlay("nvg_hud") thermal = setup_overlay("thermal_hud") @@ -75,12 +73,16 @@ var/list/global_huds = list( vimpaired = newlist(/obj/screen,/obj/screen,/obj/screen,/obj/screen) O = vimpaired[1] O.screen_loc = "1,1 to 5,15" + O.plane = PLANE_FULLSCREEN O = vimpaired[2] O.screen_loc = "5,1 to 10,5" + O.plane = PLANE_FULLSCREEN O = vimpaired[3] O.screen_loc = "6,11 to 10,15" + O.plane = PLANE_FULLSCREEN O = vimpaired[4] O.screen_loc = "11,1 to 15,15" + O.plane = PLANE_FULLSCREEN //welding mask overlay black/dither darkMask = newlist(/obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen) @@ -105,18 +107,21 @@ var/list/global_huds = list( O = vimpaired[i] O.icon_state = "dither50" O.layer = 17 + O.plane = PLANE_FULLSCREEN O.mouse_opacity = 0 O = darkMask[i] O.icon_state = "dither50" O.layer = 17 + O.plane = PLANE_FULLSCREEN O.mouse_opacity = 0 for(i = 5, i <= 8, i++) O = darkMask[i] O.icon_state = "black" O.layer = 17 - O.mouse_opacity = 0 + O.plane = PLANE_FULLSCREEN + O.mouse_opacity = 2 /* The hud datum diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 57e1e4bb6ad..83f23930dde 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -13,7 +13,7 @@ src.adding = list() src.other = list() - src.hotkeybuttons = list() //These can be disabled for hotkey usersx + src.hotkeybuttons = list() //These can be disabled for hotkey users var/list/hud_elements = list() var/obj/screen/using @@ -25,7 +25,6 @@ inv_box = new /obj/screen/inventory() inv_box.icon = ui_style - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha @@ -50,7 +49,7 @@ using.icon = ui_style using.icon_state = "other" using.screen_loc = ui_inventory - using.layer = 20 + using.hud_layerise() using.color = ui_color using.alpha = ui_alpha src.adding += using @@ -65,7 +64,6 @@ using.screen_loc = ui_acti using.color = ui_color using.alpha = ui_alpha - using.layer = 20 src.adding += using action_intent = using @@ -82,7 +80,7 @@ using.icon = ico using.screen_loc = ui_acti using.alpha = ui_alpha - using.layer = 21 + using.layer = LAYER_HUD_ITEM //These sit on the intent box src.adding += using help_intent = using @@ -94,7 +92,7 @@ using.icon = ico using.screen_loc = ui_acti using.alpha = ui_alpha - using.layer = 21 + using.layer = LAYER_HUD_ITEM src.adding += using disarm_intent = using @@ -106,7 +104,7 @@ using.icon = ico using.screen_loc = ui_acti using.alpha = ui_alpha - using.layer = 21 + using.layer = LAYER_HUD_ITEM src.adding += using grab_intent = using @@ -118,7 +116,7 @@ using.icon = ico using.screen_loc = ui_acti using.alpha = ui_alpha - using.layer = 21 + using.layer = LAYER_HUD_ITEM src.adding += using hurt_intent = using //end intent small hud objects @@ -129,7 +127,6 @@ using.icon = ui_style using.icon_state = (mymob.m_intent == "run" ? "running" : "walking") using.screen_loc = ui_movi - using.layer = 20 using.color = ui_color using.alpha = ui_alpha src.adding += using @@ -141,7 +138,6 @@ using.icon = ui_style using.icon_state = "act_drop" using.screen_loc = ui_drop_throw - using.layer = 19 using.color = ui_color using.alpha = ui_alpha src.hotkeybuttons += using @@ -153,7 +149,6 @@ using.icon = ui_style using.icon_state = "act_equip" using.screen_loc = ui_equip - using.layer = 20 using.color = ui_color using.alpha = ui_alpha src.adding += using @@ -167,7 +162,6 @@ inv_box.icon_state = "r_hand_active" inv_box.screen_loc = ui_rhand inv_box.slot_id = slot_r_hand - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha @@ -183,7 +177,6 @@ inv_box.icon_state = "l_hand_active" inv_box.screen_loc = ui_lhand inv_box.slot_id = slot_l_hand - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha src.l_hand_hud_object = inv_box @@ -194,7 +187,6 @@ using.icon = ui_style using.icon_state = "hand1" using.screen_loc = ui_swaphand1 - using.layer = 19 using.color = ui_color using.alpha = ui_alpha src.adding += using @@ -204,7 +196,6 @@ using.icon = ui_style using.icon_state = "hand2" using.screen_loc = ui_swaphand2 - using.layer = 19 using.color = ui_color using.alpha = ui_alpha src.adding += using @@ -215,7 +206,6 @@ using.icon = ui_style using.icon_state = "act_resist" using.screen_loc = ui_pull_resist - using.layer = 19 using.color = ui_color using.alpha = ui_alpha src.hotkeybuttons += using diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 52aa248431a..daaa52e827e 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -258,7 +258,7 @@ var/obj/screen/robot_inventory A.screen_loc = "CENTER[x]:16,SOUTH+[y]:7" else A.screen_loc = "CENTER+[x]:16,SOUTH+[y]:7" - A.layer = 20 + A.hud_layerise() x++ if(x == 4) diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 015bff56722..79e7beb87c2 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -9,8 +9,9 @@ /obj/screen name = "" icon = 'icons/mob/screen1.dmi' - layer = 20.0 appearance_flags = TILE_BOUND|PIXEL_SCALE|NO_CLIENT_COLOR + layer = LAYER_HUD_BASE + plane = PLANE_PLAYER_HUD unacidable = 1 var/obj/master = null //A reference to the object in the slot. Grabs or items, generally. var/datum/hud/hud = null // A reference to the owner HUD, if any. diff --git a/code/defines/procs/hud.dm b/code/defines/procs/hud.dm deleted file mode 100644 index 4f0aed0d356..00000000000 --- a/code/defines/procs/hud.dm +++ /dev/null @@ -1,82 +0,0 @@ -/* Using the HUD procs is simple. Call these procs in the life.dm of the intended mob. -Use the regular_hud_updates() proc before process_med_hud(mob) or process_sec_hud(mob) so -the HUD updates properly! */ - -// hud overlay image type, used for clearing client.images precisely -/image/hud_overlay - -//Medical HUD outputs. Called by the Life() proc of the mob using it, usually. -proc/process_med_hud(var/mob/M, var/local_scanner, var/mob/Alt) - if(!can_process_hud(M)) - return - - var/datum/arranged_hud_process/P = arrange_hud_process(M, Alt, med_hud_users) - for(var/mob/living/carbon/human/patient in P.Mob.in_view(P.Turf)) - if(P.Mob.see_invisible < patient.invisibility) - continue - - if(local_scanner) - P.Client.images += patient.hud_list[HEALTH_HUD] - P.Client.images += patient.hud_list[STATUS_HUD] - else - var/sensor_level = getsensorlevel(patient) - if(sensor_level >= SUIT_SENSOR_VITAL) - P.Client.images += patient.hud_list[HEALTH_HUD] - if(sensor_level >= SUIT_SENSOR_BINARY) - P.Client.images += patient.hud_list[LIFE_HUD] - -//Security HUDs. Pass a value for the second argument to enable implant viewing or other special features. -proc/process_sec_hud(var/mob/M, var/advanced_mode, var/mob/Alt) - if(!can_process_hud(M)) - return - var/datum/arranged_hud_process/P = arrange_hud_process(M, Alt, sec_hud_users) - for(var/mob/living/carbon/human/perp in P.Mob.in_view(P.Turf)) - if(P.Mob.see_invisible < perp.invisibility) - continue - - P.Client.images += perp.hud_list[ID_HUD] - if(advanced_mode) - P.Client.images += perp.hud_list[WANTED_HUD] - P.Client.images += perp.hud_list[IMPTRACK_HUD] - P.Client.images += perp.hud_list[IMPLOYAL_HUD] - P.Client.images += perp.hud_list[IMPCHEM_HUD] - -datum/arranged_hud_process - var/client/Client - var/mob/Mob - var/turf/Turf - -proc/arrange_hud_process(var/mob/M, var/mob/Alt, var/list/hud_list) - hud_list |= M - var/datum/arranged_hud_process/P = new - P.Client = M.client - P.Mob = Alt ? Alt : M - P.Turf = get_turf(P.Mob) - return P - -proc/can_process_hud(var/mob/M) - if(!M) - return 0 - if(!M.client) - return 0 - if(M.stat != CONSCIOUS) - return 0 - return 1 - -//Deletes the current HUD images so they can be refreshed with new ones. -mob/proc/handle_regular_hud_updates() //Used in the life.dm of mobs that can use HUDs. - if(client) - for(var/image/hud_overlay/hud in client.images) - client.images -= hud - med_hud_users -= src - sec_hud_users -= src - -mob/proc/in_view(var/turf/T) - return view(T) - -/mob/observer/eye/in_view(var/turf/T) - var/list/viewed = new - for(var/mob/living/carbon/human/H in mob_list) - if(get_dist(H, T) <= 7) - viewed += H - return viewed diff --git a/code/game/antagonist/outsider/mercenary.dm b/code/game/antagonist/outsider/mercenary.dm index 8e4b8826b47..ed2964cfad5 100644 --- a/code/game/antagonist/outsider/mercenary.dm +++ b/code/game/antagonist/outsider/mercenary.dm @@ -50,7 +50,7 @@ var/datum/antagonist/mercenary/mercs var/obj/item/device/radio/uplink/U = new(player.loc, player.mind, DEFAULT_TELECRYSTAL_AMOUNT) player.put_in_hands(U) - player.update_icons() + player.update_icons_layers() create_id("Mercenary", player) create_radio(SYND_FREQ, player) diff --git a/code/game/antagonist/outsider/technomancer.dm b/code/game/antagonist/outsider/technomancer.dm index 4ec49230fd2..33dc33b5e87 100644 --- a/code/game/antagonist/outsider/technomancer.dm +++ b/code/game/antagonist/outsider/technomancer.dm @@ -47,7 +47,7 @@ var/datum/antagonist/technomancer/technomancers technomancer_mob.equip_to_slot_or_del(new /obj/item/device/flashlight(technomancer_mob), slot_belt) technomancer_mob.equip_to_slot_or_del(new /obj/item/clothing/shoes/laceup(technomancer_mob), slot_shoes) technomancer_mob.equip_to_slot_or_del(new /obj/item/clothing/head/technomancer/master(technomancer_mob), slot_head) - technomancer_mob.update_icons() + technomancer_mob.update_icons_layers() return 1 /datum/antagonist/technomancer/proc/equip_apprentice(var/mob/living/carbon/human/technomancer_mob) diff --git a/code/game/antagonist/outsider/wizard.dm b/code/game/antagonist/outsider/wizard.dm index b88af1b1b98..ad5cc104798 100644 --- a/code/game/antagonist/outsider/wizard.dm +++ b/code/game/antagonist/outsider/wizard.dm @@ -87,7 +87,7 @@ var/datum/antagonist/wizard/wizards wizard_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/box(wizard_mob), slot_in_backpack) wizard_mob.equip_to_slot_or_del(new /obj/item/weapon/teleportation_scroll(wizard_mob), slot_r_store) wizard_mob.equip_to_slot_or_del(new /obj/item/weapon/spellbook(wizard_mob), slot_r_hand) - wizard_mob.update_icons() + wizard_mob.update_icons_layers() return 1 /datum/antagonist/wizard/check_victory() diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm index 588120328ff..49d87ed1a66 100755 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -2734,7 +2734,7 @@ area/space/atmosalert() for(var/mob/living/carbon/human/H in src) if(H.s_tone > -55) H.s_tone-- - H.update_body() + H.update_icons_body() if(H.client) mysound.status = SOUND_UPDATE H << mysound @@ -2855,7 +2855,7 @@ var/list/the_station_areas = list ( for(var/mob/living/carbon/human/H in src) // if(H.s_tone > -55) //ugh...nice/novel idea but please no. // H.s_tone-- -// H.update_body() +// H.update_icons_body() if(H.client) mysound.status = SOUND_UPDATE H << mysound diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 46da7ae2ba7..a1435d0a003 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -404,7 +404,7 @@ O.show_message(message, 1, blind_message, 2) else if(ismob(I)) var/mob/M = I - if(M.see_invisible >= invisibility) // Cannot view the invisible + if(M.see_invisible >= invisibility && MOB_CAN_SEE_PLANE(M, plane)) // Cannot view the invisible M.show_message(message, 1, blind_message, 2) else if (blind_message) M.show_message(blind_message, 2) diff --git a/code/game/gamemodes/changeling/generic_equip_procs.dm b/code/game/gamemodes/changeling/generic_equip_procs.dm index 9c73a4e3d22..7ff76ff9f62 100644 --- a/code/game/gamemodes/changeling/generic_equip_procs.dm +++ b/code/game/gamemodes/changeling/generic_equip_procs.dm @@ -122,7 +122,7 @@ playsound(src, 'sound/effects/splat.ogg', 30, 1) visible_message("[src] pulls on their clothes, peeling it off along with parts of their skin attached!", "We remove and deform our equipment.") - M.update_icons() + M.update_icons_layers() M.mind.changeling.armor_deployed = 0 return success @@ -138,7 +138,7 @@ M.equip_to_slot_or_del(I, slot_head) grown_items_list.Add("a helmet") playsound(src, 'sound/effects/blobattack.ogg', 30, 1) - M.update_icons() + M.update_icons_layers() success = 1 sleep(1 SECOND) @@ -148,7 +148,7 @@ M.equip_to_slot_or_del(I, slot_w_uniform) grown_items_list.Add("a uniform") playsound(src, 'sound/effects/blobattack.ogg', 30, 1) - M.update_icons() + M.update_icons_layers() success = 1 sleep(1 SECOND) @@ -158,7 +158,7 @@ M.equip_to_slot_or_del(I, slot_gloves) grown_items_list.Add("some gloves") playsound(src, 'sound/effects/splat.ogg', 30, 1) - M.update_icons() + M.update_icons_layers() success = 1 sleep(1 SECOND) @@ -168,7 +168,7 @@ M.equip_to_slot_or_del(I, slot_shoes) grown_items_list.Add("shoes") playsound(src, 'sound/effects/splat.ogg', 30, 1) - M.update_icons() + M.update_icons_layers() success = 1 sleep(1 SECOND) @@ -178,7 +178,7 @@ M.equip_to_slot_or_del(I, slot_belt) grown_items_list.Add("a belt") playsound(src, 'sound/effects/splat.ogg', 30, 1) - M.update_icons() + M.update_icons_layers() success = 1 sleep(1 SECOND) @@ -188,7 +188,7 @@ M.equip_to_slot_or_del(I, slot_glasses) grown_items_list.Add("some glasses") playsound(src, 'sound/effects/splat.ogg', 30, 1) - M.update_icons() + M.update_icons_layers() success = 1 sleep(1 SECOND) @@ -198,7 +198,7 @@ M.equip_to_slot_or_del(I, slot_wear_mask) grown_items_list.Add("a mask") playsound(src, 'sound/effects/splat.ogg', 30, 1) - M.update_icons() + M.update_icons_layers() success = 1 sleep(1 SECOND) @@ -208,7 +208,7 @@ M.equip_to_slot_or_del(I, slot_back) grown_items_list.Add("a backpack") playsound(src, 'sound/effects/blobattack.ogg', 30, 1) - M.update_icons() + M.update_icons_layers() success = 1 sleep(1 SECOND) @@ -218,7 +218,7 @@ M.equip_to_slot_or_del(I, slot_wear_suit) grown_items_list.Add("an exosuit") playsound(src, 'sound/effects/blobattack.ogg', 30, 1) - M.update_icons() + M.update_icons_layers() success = 1 sleep(1 SECOND) @@ -228,7 +228,7 @@ M.equip_to_slot_or_del(I, slot_wear_id) grown_items_list.Add("an ID card") playsound(src, 'sound/effects/splat.ogg', 30, 1) - M.update_icons() + M.update_icons_layers() success = 1 sleep(1 SECOND) diff --git a/code/game/gamemodes/changeling/powers/fabricate_clothing.dm b/code/game/gamemodes/changeling/powers/fabricate_clothing.dm index 138cd156e38..bc37afc1ea7 100644 --- a/code/game/gamemodes/changeling/powers/fabricate_clothing.dm +++ b/code/game/gamemodes/changeling/powers/fabricate_clothing.dm @@ -56,7 +56,7 @@ var/global/list/changeling_fabricated_clothing = list( visible_message("[H] tears off [src]!", "We remove [src].") qdel(src) - H.update_icons() + H.update_icons_layers() /obj/item/clothing/head/chameleon/changeling name = "malformed head" @@ -78,7 +78,7 @@ var/global/list/changeling_fabricated_clothing = list( visible_message("[H] tears off [src]!", "We remove [src].") qdel(src) - H.update_icons() + H.update_icons_layers() /obj/item/clothing/suit/chameleon/changeling name = "chitinous chest" @@ -104,7 +104,7 @@ var/global/list/changeling_fabricated_clothing = list( visible_message("[H] tears off [src]!", "We remove [src].") qdel(src) - H.update_icons() + H.update_icons_layers() /obj/item/clothing/shoes/chameleon/changeling name = "malformed feet" @@ -130,7 +130,7 @@ var/global/list/changeling_fabricated_clothing = list( visible_message("[H] tears off [src]!", "We remove [src].") qdel(src) - H.update_icons() + H.update_icons_layers() /obj/item/weapon/storage/backpack/chameleon/changeling name = "backpack" @@ -158,7 +158,7 @@ var/global/list/changeling_fabricated_clothing = list( for(var/atom/movable/AM in src.contents) //Dump whatever's in the bag before deleting. AM.forceMove(get_turf(loc)) qdel(src) - H.update_icons() + H.update_icons_layers() /obj/item/clothing/gloves/chameleon/changeling name = "malformed hands" @@ -185,7 +185,7 @@ var/global/list/changeling_fabricated_clothing = list( visible_message("[H] tears off [src]!", "We remove [src].") qdel(src) - H.update_icons() + H.update_icons_layers() /obj/item/clothing/mask/chameleon/changeling @@ -213,7 +213,7 @@ var/global/list/changeling_fabricated_clothing = list( visible_message("[H] tears off [src]!", "We remove [src].") qdel(src) - H.update_icons() + H.update_icons_layers() /obj/item/clothing/glasses/chameleon/changeling name = "chitin goggles" @@ -235,7 +235,7 @@ var/global/list/changeling_fabricated_clothing = list( visible_message("[H] tears off [src]!", "We remove [src].") qdel(src) - H.update_icons() + H.update_icons_layers() /obj/item/weapon/storage/belt/chameleon/changeling name = "waist pouch" @@ -261,7 +261,7 @@ var/global/list/changeling_fabricated_clothing = list( visible_message("[H] tears off [src]!", "We remove [src].") qdel(src) - H.update_icons() + H.update_icons_layers() /obj/item/weapon/card/id/syndicate/changeling name = "chitinous card" @@ -288,7 +288,7 @@ var/global/list/changeling_fabricated_clothing = list( visible_message("[H] tears off [src]!", "We remove [src].") qdel(src) - H.update_icons() + H.update_icons_layers() /obj/item/weapon/card/id/syndicate/changeling/Click() //Since we can't hold it in our hands, and attack_hand() doesn't work if it in inventory... diff --git a/code/game/gamemodes/changeling/powers/revive.dm b/code/game/gamemodes/changeling/powers/revive.dm index c640e353925..98b091abaa6 100644 --- a/code/game/gamemodes/changeling/powers/revive.dm +++ b/code/game/gamemodes/changeling/powers/revive.dm @@ -34,7 +34,7 @@ H.restore_blood() H.mutations.Remove(HUSK) H.status_flags -= DISFIGURED - H.update_body(1) + H.update_icons_body() for(var/limb in H.organs_by_name) var/obj/item/organ/external/current_limb = H.organs_by_name[limb] if(current_limb) diff --git a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm index c25e3c55674..81a6148e2c8 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm @@ -8,7 +8,7 @@ //luminosity = 5 //l_color="#0066FF" - layer = LIGHTING_LAYER+1 + plane = PLANE_LIGHTING_ABOVE var/spawned=0 // DIR mask var/next_check=0 diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 0885cdef60f..85ae7329892 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -183,7 +183,8 @@ var/global/datum/controller/gameticker/ticker cinematic = new(src) cinematic.icon = 'icons/effects/station_explosion.dmi' cinematic.icon_state = "station_intact" - cinematic.layer = 20 + cinematic.layer = 100 + cinematic.plane = PLANE_PLAYER_HUD cinematic.mouse_opacity = 0 cinematic.screen_loc = "1,0" diff --git a/code/game/gamemodes/sandbox/h_sandbox.dm b/code/game/gamemodes/sandbox/h_sandbox.dm index bd54164aa08..6e9f040f5c3 100644 --- a/code/game/gamemodes/sandbox/h_sandbox.dm +++ b/code/game/gamemodes/sandbox/h_sandbox.dm @@ -63,28 +63,28 @@ datum/hSB var/mob/living/carbon/human/P = usr if(P.wear_suit) P.wear_suit.loc = P.loc - P.wear_suit.layer = initial(P.wear_suit.layer) + P.wear_suit.reset_plane_and_layer() P.wear_suit = null P.wear_suit = new/obj/item/clothing/suit/space(P) - P.wear_suit.layer = 20 + P.wear_suit.hud_layerise() if(P.head) P.head.loc = P.loc - P.head.layer = initial(P.head.layer) + P.head.reset_plane_and_layer() P.head = null P.head = new/obj/item/clothing/head/helmet/space(P) - P.head.layer = 20 + P.head.hud_layerise() if(P.wear_mask) P.wear_mask.loc = P.loc - P.wear_mask.layer = initial(P.wear_mask.layer) + P.wear_mask.reset_plane_and_layer() P.wear_mask = null P.wear_mask = new/obj/item/clothing/mask/gas(P) - P.wear_mask.layer = 20 + P.wear_mask.hud_layerise() if(P.back) P.back.loc = P.loc - P.back.layer = initial(P.back.layer) + P.back.reset_plane_and_layer() P.back = null P.back = new/obj/item/weapon/tank/jetpack(P) - P.back.layer = 20 + P.back.hud_layerise() P.internal = P.back if("hsbmetal") var/obj/item/stack/sheet/hsb = new/obj/item/stack/sheet/metal diff --git a/code/game/machinery/computer3/computers/HolodeckControl.dm b/code/game/machinery/computer3/computers/HolodeckControl.dm index fc781430c40..4d63b956736 100644 --- a/code/game/machinery/computer3/computers/HolodeckControl.dm +++ b/code/game/machinery/computer3/computers/HolodeckControl.dm @@ -155,7 +155,7 @@ var/mob/M = obj.loc if(ismob(M)) M.remove_from_mob(obj) - M.update_icons() //so their overlays update + M.update_icons_layers() //so their overlays update if(!silent) var/obj/oldobj = obj diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm index 180471f0705..ab5fcbdf646 100644 --- a/code/game/machinery/lightswitch.dm +++ b/code/game/machinery/lightswitch.dm @@ -31,7 +31,8 @@ /obj/machinery/light_switch/proc/updateicon() if(!overlay) - overlay = image(icon, "light1-overlay", LIGHTING_LAYER+0.1) + overlay = image(icon, "light1-overlay") + overlay.plane = PLANE_LIGHTING_ABOVE overlays.Cut() if(stat & NOPOWER) diff --git a/code/game/mecha/medical/odysseus.dm b/code/game/mecha/medical/odysseus.dm index 38c3cffb308..90577eaf648 100644 --- a/code/game/mecha/medical/odysseus.dm +++ b/code/game/mecha/medical/odysseus.dm @@ -23,6 +23,7 @@ occupant_message("[H.glasses] prevent you from using [src] [hud]") else H.glasses = hud + H.recalculate_vis() return 1 else return 0 @@ -32,6 +33,7 @@ var/mob/living/carbon/human/H = occupant if(H.glasses == hud) H.glasses = null + H.recalculate_vis() ..() return /* @@ -63,7 +65,7 @@ name = "Integrated Medical Hud" - process_hud(var/mob/M) +// process_hud(var/mob/M) //TODO VIS /* world<< "view(M)" for(var/mob/mob in view(M)) @@ -74,7 +76,7 @@ world<< "view(M.loc)" for(var/mob/mob in view(M.loc)) world << "[mob]" -*/ + if(!M || M.stat || !(M in view(M))) return if(!M.client) return @@ -115,7 +117,7 @@ holder.icon_state = "hudhealthy" C.images += holder - +*/ /obj/mecha/medical/odysseus/loaded/New() ..() var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/tool/sleeper diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 6500a4ba60c..bf091e1180f 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -260,12 +260,9 @@ // 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(var/mob/user, var/slot) - layer = 20 - if(user.client) - user.client.screen |= src - if(user.pulling == src) - user.stop_pulling() - appearance_flags |= NO_CLIENT_COLOR + hud_layerise() + if(user.client) user.client.screen |= src + if(user.pulling == src) user.stop_pulling() return //Defines which slots correspond to which slot flags diff --git a/code/game/objects/items/weapons/cosmetics.dm b/code/game/objects/items/weapons/cosmetics.dm index 9d3a9cb0a4f..3d142b223a3 100644 --- a/code/game/objects/items/weapons/cosmetics.dm +++ b/code/game/objects/items/weapons/cosmetics.dm @@ -50,7 +50,7 @@ user.visible_message("[user] does their lips with \the [src].", \ "You take a moment to apply \the [src]. Perfect!") H.lip_style = colour - H.update_body() + H.update_icons_body() else user.visible_message("[user] begins to do [H]'s lips with \the [src].", \ "You begin to apply \the [src].") @@ -58,7 +58,7 @@ user.visible_message("[user] does [H]'s lips with \the [src].", \ "You apply \the [src].") H.lip_style = colour - H.update_body() + H.update_icons_body() else user << "Where are the lips on that?" diff --git a/code/game/objects/items/weapons/grenades/flashbang.dm b/code/game/objects/items/weapons/grenades/flashbang.dm index 04a7b3e100f..5588089cefa 100644 --- a/code/game/objects/items/weapons/grenades/flashbang.dm +++ b/code/game/objects/items/weapons/grenades/flashbang.dm @@ -90,7 +90,7 @@ else if (M.ear_damage >= 5) M << "Your ears start to ring!" - M.update_icons() + M.update_icons() //Forces matrix transform to proc if they are now laying, I guess? /obj/item/weapon/grenade/flashbang/Destroy() walk(src, 0) // Because we might have called walk_away, we must stop the walk loop or BYOND keeps an internal reference to us forever. diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 078548ed3ff..eb29aaff41b 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -174,7 +174,7 @@ src.boxes.screen_loc = "[tx]:,[ty] to [mx],[my]" for(var/obj/O in src.contents) O.screen_loc = "[cx],[cy]" - O.layer = 20 + O.hud_layerise() cx++ if (cx > mx) cx = tx @@ -192,7 +192,7 @@ for(var/datum/numbered_display/ND in display_contents) ND.sample_object.screen_loc = "[cx]:16,[cy]:16" ND.sample_object.maptext = "[(ND.number > 1)? "[ND.number]" : ""]" - ND.sample_object.layer = 20 + ND.sample_object.hud_layerise() cx++ if (cx > (4+cols)) cx = 4 @@ -201,7 +201,7 @@ for(var/obj/O in contents) O.screen_loc = "[cx]:16,[cy]:16" O.maptext = "" - O.layer = 20 + O.hud_layerise() cx++ if (cx > (4+cols)) cx = 4 @@ -252,7 +252,7 @@ O.screen_loc = "4:[round((startpoint+endpoint)/2)+2],2:16" O.maptext = "" - O.layer = 20 + O.hud_layerise() src.closer.screen_loc = "4:[storage_width+19],2:16" return @@ -395,9 +395,9 @@ if(ismob(loc)) W.dropped(usr) if(ismob(new_location)) - W.layer = 20 + W.hud_layerise() else - W.layer = initial(W.layer) + W.reset_plane_and_layer() W.forceMove(new_location) else W.forceMove(get_turf(src)) @@ -546,41 +546,38 @@ src.boxes.master = src src.boxes.icon_state = "block" src.boxes.screen_loc = "7,7 to 10,8" - src.boxes.layer = 19 src.storage_start = new /obj/screen/storage( ) src.storage_start.name = "storage" src.storage_start.master = src src.storage_start.icon_state = "storage_start" src.storage_start.screen_loc = "7,7 to 10,8" - src.storage_start.layer = 19 + src.storage_continue = new /obj/screen/storage( ) src.storage_continue.name = "storage" src.storage_continue.master = src src.storage_continue.icon_state = "storage_continue" src.storage_continue.screen_loc = "7,7 to 10,8" - src.storage_continue.layer = 19 + src.storage_end = new /obj/screen/storage( ) src.storage_end.name = "storage" src.storage_end.master = src src.storage_end.icon_state = "storage_end" src.storage_end.screen_loc = "7,7 to 10,8" - src.storage_end.layer = 19 src.stored_start = new /obj //we just need these to hold the icon src.stored_start.icon_state = "stored_start" - src.stored_start.layer = 19 + src.stored_continue = new /obj src.stored_continue.icon_state = "stored_continue" - src.stored_continue.layer = 19 + src.stored_end = new /obj src.stored_end.icon_state = "stored_end" - src.stored_end.layer = 19 src.closer = new /obj/screen/close( ) src.closer.master = src src.closer.icon_state = "storage_close" - src.closer.layer = 20 + src.closer.hud_layerise() orient2hud() return diff --git a/code/game/objects/structures/curtains.dm b/code/game/objects/structures/curtains.dm index 88ff8968742..af129800b7e 100644 --- a/code/game/objects/structures/curtains.dm +++ b/code/game/objects/structures/curtains.dm @@ -1,6 +1,3 @@ -#define SHOWER_OPEN_LAYER OBJ_LAYER + 0.4 -#define SHOWER_CLOSED_LAYER MOB_LAYER + 0.2 - /obj/structure/curtain name = "curtain" icon = 'icons/obj/curtain.dmi' diff --git a/code/game/objects/structures/flora/trees.dm b/code/game/objects/structures/flora/trees.dm index 1b5322cfa7e..b01c3ace965 100644 --- a/code/game/objects/structures/flora/trees.dm +++ b/code/game/objects/structures/flora/trees.dm @@ -198,5 +198,6 @@ /obj/structure/flora/tree/sif/update_icon() set_light(5, 1, "#33ccff") - overlays.Cut() - overlays.Add(image(icon = 'icons/obj/flora/deadtrees.dmi', icon_state = "[icon_state]_glow", layer = LIGHTING_LAYER + 0.1)) \ No newline at end of file + var/image/glow = image(icon = 'icons/obj/flora/deadtrees.dmi', icon_state = "[icon_state]_glow") + glow.plane = PLANE_LIGHTING_ABOVE + overlays = list(glow) diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index c457e3ae2cc..d795d53e3d6 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -48,7 +48,7 @@ else src.icon_state = "morgue3" if(broadcast) - broadcast_medical_hud_message("[src] was able to establish a mental interface with occupant.", src) + global_announcer.autosay("[src] was able to establish a mental interface with occupant.", "[src]", "Medical") else src.icon_state = "morgue1" return diff --git a/code/global.dm b/code/global.dm index 3ce2395d1ca..69d5642f10a 100644 --- a/code/global.dm +++ b/code/global.dm @@ -10,8 +10,6 @@ var/global/list/machines = list() // TODO - Move into SSmachines var/global/list/processing_objects = list() var/global/list/processing_power_items = list() // TODO - Move into SSmachines var/global/list/active_diseases = list() -var/global/list/med_hud_users = list() // List of all entities using a medical HUD. -var/global/list/sec_hud_users = list() // List of all entities using a security HUD. var/global/list/hud_icon_reference = list() @@ -199,4 +197,8 @@ var/max_explosion_range = 14 // Announcer intercom, because too much stuff creates an intercom for one message then hard del()s it. var/global/obj/item/device/radio/intercom/global_announcer = new /obj/item/device/radio/intercom{channels=list("Engineering")}(null) -var/list/station_departments = list("Command", "Medical", "Engineering", "Science", "Security", "Cargo", "Civilian") \ No newline at end of file +var/list/station_departments = list("Command", "Medical", "Engineering", "Science", "Security", "Cargo", "Civilian") + +//Icons for in-game HUD glasses. Why don't we just share these a little bit? +var/static/icon/ingame_hud = icon('icons/mob/hud.dmi') +var/static/icon/ingame_hud_med = icon('icons/mob/hud_med.dmi') diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index b5c405288e8..297ebbab23a 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -59,6 +59,7 @@ var/list/admin_verbs_admin = list( /client/proc/check_antagonists, /client/proc/admin_memo, //admin memo system. show/delete/write. +SERVER needed to delete admin memos of others, /client/proc/dsay, //talk in deadchat using our ckey/fakekey, + /client/proc/ghost_view, //let us see ghosts WHENEVERRRR // /client/proc/toggle_hear_deadcast, //toggles whether we hear deadchat, /client/proc/investigate_show, //various admintools for investigation. Such as a singulo grief-log, /client/proc/secrets, @@ -211,6 +212,7 @@ var/list/admin_verbs_debug = list( /client/proc/jumptomob, /client/proc/jumptocoord, /client/proc/dsay, + /client/proc/ghost_view, /client/proc/toggle_debug_logs, /client/proc/admin_ghost, //allows us to ghost/reenter body at will, /datum/admins/proc/view_runtimes, @@ -323,6 +325,7 @@ var/list/admin_verbs_mod = list( /datum/admins/proc/show_player_info, /client/proc/player_panel_new, /client/proc/dsay, + /client/proc/ghost_view, /datum/admins/proc/show_skills, /datum/admins/proc/show_player_panel, /client/proc/check_antagonists, @@ -347,6 +350,7 @@ var/list/admin_verbs_event_manager = list( /client/proc/admin_ghost, /datum/admins/proc/show_player_info, /client/proc/dsay, + /client/proc/ghost_view, /client/proc/cmd_admin_subtle_message, /client/proc/debug_variables, /client/proc/check_antagonists, @@ -486,6 +490,23 @@ var/list/admin_verbs_event_manager = list( body.key = "@[key]" //Haaaaaaaack. But the people have spoken. If it breaks; blame adminbus feedback_add_details("admin_verb","O") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! +/client/proc/ghost_view() + set category = "Admin" + set name = "Ghost View" + set desc = "Toggles ability to see ghosts, even while in a mob." + if(!holder) return + if(!mob.plane_holder) return + + var/choice = alert(src,"Do you want to see ghosts, or not?","Ghost viewing","Show 'em!","Cancel","Hide 'em!") + if(choice == "Cancel") + return + + if(choice == "Show 'em!" && mob.plane_holder) + mob.plane_holder.set_vis(VIS_GHOSTS,TRUE) + to_chat(src,"Ghosts are now visible (while in this mob).") + else if(mob.plane_holder) + mob.plane_holder.set_vis(VIS_GHOSTS,FALSE) + to_chat(src,"Ghosts are now hidden (while in this mob).") /client/proc/invisimin() set name = "Invisimin" @@ -962,8 +983,8 @@ var/list/admin_verbs_event_manager = list( else M.gender = NEUTER - M.update_hair() - M.update_body() + M.update_hair(FALSE) + M.update_icons_body() M.check_dna(M) /client/proc/playernotes() diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 71069be22e3..c2cf55ab00e 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1001,7 +1001,11 @@ //strip their stuff and stick it in the crate for(var/obj/item/I in M) M.drop_from_inventory(I, locker) - M.update_icons() + if(ishuman(M)) + var/mob/living/carbon/human/H = M + H.update_icons_layers() //Cheaper + else + M.update_icons() //so they black out before warping M.Paralyse(5) diff --git a/code/modules/admin/verbs/buildmode.dm b/code/modules/admin/verbs/buildmode.dm index 9239f6385f0..a57b17d15fe 100644 --- a/code/modules/admin/verbs/buildmode.dm +++ b/code/modules/admin/verbs/buildmode.dm @@ -37,7 +37,8 @@ /obj/effect/bmode//Cleaning up the tree a bit density = 1 anchored = 1 - layer = 20 + layer = LAYER_HUD_BASE + plane = PLANE_PLAYER_HUD dir = NORTH icon = 'icons/misc/buildmode.dmi' var/obj/effect/bmode/buildholder/master = null diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 55dd383cf9f..961dbdcdfb0 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -482,7 +482,7 @@ Traitors and the like can also be revived with the previous role mostly intact. data_core.manifest_inject(new_character) //A redraw for good measure - new_character.update_icons() + new_character.update_icons_all() //If we're announcing their arrival if(announce) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 72cfedad765..915ea1758de 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -288,10 +288,9 @@ datum/preferences if(icon_updates) character.force_update_limbs() character.update_mutations(0) - character.update_body(0) character.update_underwear(0) character.update_hair(0) - character.update_icons() + character.update_icons_all() /datum/preferences/proc/open_load_dialog(mob/user) var/dat = "" diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 1c2e30a9b75..62a6e675c43 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -11,6 +11,8 @@ var/flash_protection = FLASH_PROTECTION_NONE var/tint = TINT_NONE + var/list/enables_planes //Enables these planes in the wearing mob's plane_holder + var/list/plane_slots //But only if it's equipped into this specific slot /* Sprites used when the clothing item is refit. This is done by setting icon_override. @@ -37,6 +39,16 @@ var/obj/item/clothing/accessory/tie = new T(src) src.attach_accessory(null, tie) +/obj/item/clothing/equipped(var/mob/user,var/slot) + ..() + if(enables_planes) + user.recalculate_vis() + +/obj/item/clothing/dropped(var/mob/user) + ..() + if(enables_planes) + user.recalculate_vis() + //BS12: Species-restricted clothing check. /obj/item/clothing/mob_can_equip(M as mob, slot) diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index d0a90a86b52..c6528a109e7 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -16,6 +16,7 @@ BLIND // can't see anything icon = 'icons/obj/clothing/glasses.dmi' w_class = ITEMSIZE_SMALL slot_flags = SLOT_EYES + plane_slots = list(slot_glasses) var/vision_flags = 0 var/darkness_view = 0//Base human is 2 var/see_invisible = -1 @@ -25,6 +26,7 @@ BLIND // can't see anything var/active = 1 var/activation_sound = 'sound/items/goggles_charge.ogg' var/obj/screen/overlay = null + var/list/away_planes //Holder for disabled planes sprite_sheets = list( "Teshari" = 'icons/mob/species/seromi/eyes.dmi', @@ -44,6 +46,8 @@ BLIND // can't see anything user.update_inv_glasses() flash_protection = FLASH_PROTECTION_NONE tint = TINT_NONE + away_planes = enables_planes + enables_planes = null to_chat(usr, "You deactivate the optical matrix on the [src].") else active = 1 @@ -51,8 +55,11 @@ BLIND // can't see anything user.update_inv_glasses() flash_protection = initial(flash_protection) tint = initial(tint) + enables_planes = away_planes + away_planes = null to_chat(usr, "You activate the optical matrix on the [src].") user.update_action_buttons() + user.recalculate_vis() /obj/item/clothing/glasses/meson name = "optical meson scanner" @@ -63,6 +70,7 @@ BLIND // can't see anything origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) toggleable = 1 vision_flags = SEE_TURFS + enables_planes = (VIS_FULLBRIGHT) /obj/item/clothing/glasses/meson/New() ..() @@ -130,9 +138,9 @@ BLIND // can't see anything darkness_view = 7 toggleable = 1 action_button_name = "Toggle Goggles" - see_invisible = SEE_INVISIBLE_NOLIGHTING off_state = "denight" flash_protection = FLASH_PROTECTION_REDUCED + enables_planes = list(VIS_FULLBRIGHT) /obj/item/clothing/glasses/night/vox name = "Alien Optics" @@ -181,6 +189,8 @@ BLIND // can't see anything toggleable = 1 action_button_name = "Toggle Goggles" vision_flags = SEE_OBJS + enables_planes = list(VIS_FULLBRIGHT) + /obj/item/clothing/glasses/material/prescription name = "prescription optical material scanner" @@ -316,12 +326,7 @@ BLIND // can't see anything name = "\improper HUD sunglasses" desc = "Sunglasses with a HUD." icon_state = "sunSecHud" - var/obj/item/clothing/glasses/hud/security/hud = null - - New() - ..() - src.hud = new/obj/item/clothing/glasses/hud/security(src) - return + enables_planes = list(VIS_CH_ID,VIS_CH_WANTED,VIS_CH_IMPTRACK,VIS_CH_IMPLOYAL,VIS_CH_IMPCHEM) /obj/item/clothing/glasses/sunglasses/sechud/tactical name = "tactical HUD" @@ -338,31 +343,22 @@ BLIND // can't see anything toggleable = 1 activation_sound = 'sound/effects/pop.ogg' - var/hud_holder - -/obj/item/clothing/glasses/sunglasses/sechud/aviator/New() - ..() - hud_holder = hud - -/obj/item/clothing/glasses/sunglasses/sechud/aviator/Destroy() - qdel(hud_holder) - hud_holder = null - hud = null - . = ..() - /obj/item/clothing/glasses/sunglasses/sechud/aviator/attack_self(mob/user) if(toggleable && !user.incapacitated()) on = !on if(on) flash_protection = FLASH_PROTECTION_NONE - src.hud = hud_holder + enables_planes = away_planes + away_planes = null to_chat(usr, "You switch the [src] to HUD mode.") else flash_protection = initial(flash_protection) - src.hud = null + away_planes = enables_planes + enables_planes = null to_chat(usr, "You switch \the [src] to flash protection mode.") update_icon() user << activation_sound + user.recalculate_vis() user.update_inv_glasses() user.update_action_buttons() @@ -381,12 +377,7 @@ BLIND // can't see anything name = "\improper HUD sunglasses" desc = "Sunglasses with a HUD." icon_state = "sunMedHud" - var/obj/item/clothing/glasses/hud/health/hud = null - -/obj/item/clothing/glasses/sunglasses/medhud/New() - ..() - src.hud = new/obj/item/clothing/glasses/hud/health(src) - return + enables_planes = list(VIS_CH_STATUS,VIS_CH_HEALTH) /obj/item/clothing/glasses/thermal name = "optical thermal scanner" @@ -397,7 +388,7 @@ BLIND // can't see anything toggleable = 1 action_button_name = "Toggle Goggles" vision_flags = SEE_MOBS - see_invisible = SEE_INVISIBLE_NOLIGHTING + enables_planes = list(VIS_FULLBRIGHT) flash_protection = FLASH_PROTECTION_REDUCED emp_act(severity) @@ -454,4 +445,4 @@ BLIND // can't see anything name = "optical thermal implants" desc = "A set of implantable lenses designed to augment your vision" icon_state = "thermalimplants" - item_state_slots = list(slot_r_hand_str = "sunglasses", slot_l_hand_str = "sunglasses") \ No newline at end of file + item_state_slots = list(slot_r_hand_str = "sunglasses", slot_l_hand_str = "sunglasses") diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index edd2db21685..fb4f491076b 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -3,10 +3,6 @@ desc = "A heads-up display that provides important info in (almost) real time." flags = 0 //doesn't protect eyes because it's a monocle, duh origin_tech = list(TECH_MAGNET = 3, TECH_BIO = 2) - var/list/icon/current = list() //the current hud icons - - proc - process_hud(var/mob/M) return /obj/item/clothing/glasses/hud/health name = "Health Scanner HUD" @@ -14,6 +10,7 @@ icon_state = "healthhud" item_state_slots = list(slot_r_hand_str = "headset", slot_l_hand_str = "headset") body_parts_covered = 0 + enables_planes = list(VIS_CH_STATUS,VIS_CH_HEALTH) /obj/item/clothing/glasses/hud/health/prescription name = "Prescription Health Scanner HUD" @@ -22,16 +19,13 @@ icon_state = "healthhudpresc" item_state_slots = list(slot_r_hand_str = "glasses", slot_l_hand_str = "glasses") -/obj/item/clothing/glasses/hud/health/process_hud(var/mob/M) - process_med_hud(M, 1) - /obj/item/clothing/glasses/hud/security name = "Security HUD" desc = "A heads-up display that scans the humans in view and provides accurate data about their ID status and security records." icon_state = "securityhud" item_state_slots = list(slot_r_hand_str = "headset", slot_l_hand_str = "headset") body_parts_covered = 0 - var/global/list/jobs[0] + enables_planes = list(VIS_CH_ID,VIS_CH_WANTED,VIS_CH_IMPTRACK,VIS_CH_IMPLOYAL,VIS_CH_IMPCHEM) /obj/item/clothing/glasses/hud/security/prescription name = "Prescription Security HUD" @@ -47,6 +41,3 @@ item_state_slots = list(slot_r_hand_str = "sunglasses", slot_l_hand_str = "sunglasses") vision_flags = SEE_MOBS see_invisible = SEE_INVISIBLE_NOLIGHTING - -/obj/item/clothing/glasses/hud/security/process_hud(var/mob/M) - process_sec_hud(M, 1) diff --git a/code/modules/clothing/spacesuits/rig/modules/vision.dm b/code/modules/clothing/spacesuits/rig/modules/vision.dm index ddff6aefe00..572f861d5a4 100644 --- a/code/modules/clothing/spacesuits/rig/modules/vision.dm +++ b/code/modules/clothing/spacesuits/rig/modules/vision.dm @@ -175,6 +175,14 @@ holder.wearer << "Your sensors only have one mode." return 1 +/obj/item/rig_module/vision/activate() + if((. = ..()) && holder.wearer) + holder.wearer.recalculate_vis() + +/obj/item/rig_module/vision/deactivate() + if((. = ..()) && holder.wearer) + holder.wearer.recalculate_vis() + /obj/item/rig_module/vision/New() ..() diff --git a/code/modules/holodeck/HolodeckControl.dm b/code/modules/holodeck/HolodeckControl.dm index cfffe2282fb..8560e71f345 100644 --- a/code/modules/holodeck/HolodeckControl.dm +++ b/code/modules/holodeck/HolodeckControl.dm @@ -247,7 +247,7 @@ var/mob/M = obj.loc if(ismob(M)) M.remove_from_mob(obj) - M.update_icons() //so their overlays update + M.update_icons_layers() //so their overlays update if(!silent) var/obj/oldobj = obj diff --git a/code/modules/lighting/lighting_overlay.dm b/code/modules/lighting/lighting_overlay.dm index e02f9762810..3fd160ee5a0 100644 --- a/code/modules/lighting/lighting_overlay.dm +++ b/code/modules/lighting/lighting_overlay.dm @@ -6,7 +6,8 @@ anchored = 1 icon = LIGHTING_ICON layer = LIGHTING_LAYER - invisibility = INVISIBILITY_LIGHTING + plane = PLANE_LIGHTING + //invisibility = INVISIBILITY_LIGHTING color = LIGHTING_BASE_MATRIX icon_state = "light1" auto_init = 0 // doesn't need special init diff --git a/code/modules/mob/dead/observer/login.dm b/code/modules/mob/dead/observer/login.dm index 73605d1328d..d3d65faa316 100644 --- a/code/modules/mob/dead/observer/login.dm +++ b/code/modules/mob/dead/observer/login.dm @@ -1,5 +1,7 @@ +//Nobody here anymore. /mob/observer/dead/Login() - ..() - if (ghostimage) - ghostimage.icon_state = src.icon_state - updateghostimages() + ..() //Creates the plane_holder lazily + plane_holder.set_vis(VIS_GHOSTS, ghostvision) + plane_holder.set_vis(VIS_FULLBRIGHT, !seedarkness) + plane_holder.set_vis(VIS_AI_EYE, TRUE) + plane = PLANE_GHOSTS diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 03cec12f5e0..15168cf568c 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -1,6 +1,3 @@ -var/global/list/image/ghost_darkness_images = list() //this is a list of images for things ghosts should still be able to see when they toggle darkness -var/global/list/image/ghost_sightless_images = list() //this is a list of images for things ghosts should still be able to see even without ghost sight - /mob/observer name = "observer" desc = "This shouldn't appear" @@ -12,11 +9,12 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images icon = 'icons/mob/ghost.dmi' icon_state = "ghost" layer = 3.9 //Just below normal mobs + plane = PLANE_GHOSTS + alpha = 127 stat = DEAD canmove = 0 blinded = 0 anchored = 1 // don't get pushed around - invisibility = INVISIBILITY_OBSERVER var/can_reenter_corpse var/datum/hud/living/carbon/hud = null // hud var/bootime = 0 @@ -30,9 +28,7 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images var/atom/movable/following = null var/admin_ghosted = 0 var/anonsay = 0 - var/image/ghostimage = null //this mobs ghost image, for deleting and stuff var/ghostvision = 1 //is the ghost able to see things humans can't? -// var/seedarkness = 1 incorporeal_move = 1 var/is_manifest = 0 //If set to 1, the ghost is able to whisper. Usually only set if a cultist drags them through the veil. @@ -92,15 +88,12 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images /mob/observer/dead/New(mob/body) sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF see_invisible = SEE_INVISIBLE_OBSERVER - see_in_dark = 100 + see_in_dark = world.view //I mean. I don't even know if byond has occlusion culling... but... + plane = PLANE_GHOSTS //Why doesn't the var above work...??? verbs += /mob/observer/dead/proc/dead_tele stat = DEAD - ghostimage = image(src.icon,src,src.icon_state) - ghost_darkness_images |= ghostimage - updateallghostimages() - var/turf/T if(ismob(body)) T = get_turf(body) //Where is the body located? @@ -108,15 +101,13 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images if (ishuman(body)) var/mob/living/carbon/human/H = body - icon = H.stand_icon - overlays = H.overlays_standing + icon = H.icon + overlays = H.overlays else icon = body.icon icon_state = body.icon_state overlays = body.overlays - alpha = 127 - gender = body.gender if(body.mind && body.mind.name) name = body.mind.name @@ -139,22 +130,12 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images real_name = name ..() -/mob/observer/dead/Destroy() - if (ghostimage) - ghost_darkness_images -= ghostimage - qdel(ghostimage) - ghostimage = null - updateallghostimages() - return ..() - /mob/observer/dead/Topic(href, href_list) if (href_list["track"]) var/mob/target = locate(href_list["track"]) in mob_list if(target) ManualFollow(target) - - /mob/observer/dead/attackby(obj/item/W, mob/user) if(istype(W,/obj/item/weapon/book/tome)) var/mob/observer/dead/M = src @@ -174,31 +155,6 @@ Works together with spawning an observer, noted above. handle_regular_hud_updates() - if(antagHUD) - var/list/target_list = list() - for(var/mob/living/target in oview(src, 14)) - if(target.mind && target.mind.special_role) - target_list += target - if(target_list.len) - assess_targets(target_list, src) - if(medHUD) - process_medHUD(src) - - -/mob/observer/dead/proc/process_medHUD(var/mob/M) - var/client/C = M.client - for(var/mob/living/carbon/human/patient in oview(M, 14)) - C.images += patient.hud_list[HEALTH_HUD] - C.images += patient.hud_list[STATUS_HUD_OOC] - -/mob/observer/dead/proc/assess_targets(list/target_list, mob/observer/dead/U) - var/client/C = U.client - for(var/mob/living/carbon/human/target in target_list) - C.images += target.hud_list[SPECIALROLE_HUD] - for(var/mob/living/silicon/target in target_list) - C.images += target.hud_list[SPECIALROLE_HUD] - return 1 - /mob/proc/ghostize(var/can_reenter_corpse = 1) if(key) if(ishuman(src)) @@ -300,41 +256,33 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set category = "Ghost" set name = "Toggle MedicHUD" set desc = "Toggles Medical HUD allowing you to see how everyone is doing" - if(!client) - return - if(medHUD) - medHUD = 0 - src << "Medical HUD Disabled" - else - medHUD = 1 - src << "Medical HUD Enabled" + + medHUD = !medHUD + plane_holder.set_vis(VIS_CH_HEALTH, medHUD) + plane_holder.set_vis(VIS_CH_STATUS_OOC, medHUD) + to_chat(src,"Medical HUD [medHUD ? "Enabled" : "Disabled"]") /mob/observer/dead/verb/toggle_antagHUD() set category = "Ghost" set name = "Toggle AntagHUD" set desc = "Toggles AntagHUD allowing you to see who is the antagonist" - if(!client) - return if(!config.antag_hud_allowed && !client.holder) src << "Admins have disabled this for this round." return - var/mob/observer/dead/M = src - if(jobban_isbanned(M, "AntagHUD")) + if(jobban_isbanned(src, "AntagHUD")) src << "You have been banned from using this feature" return - if(config.antag_hud_restricted && !M.has_enabled_antagHUD && !client.holder) + if(config.antag_hud_restricted && !has_enabled_antagHUD && !client.holder) var/response = alert(src, "If you turn this on, you will not be able to take any part in the round.","Are you sure you want to turn this feature on?","Yes","No") if(response == "No") return - M.can_reenter_corpse = 0 - if(!M.has_enabled_antagHUD && !client.holder) - M.has_enabled_antagHUD = 1 - if(M.antagHUD) - M.antagHUD = 0 - src << "AntagHUD Disabled" - else - M.antagHUD = 1 - src << "AntagHUD Enabled" + can_reenter_corpse = FALSE + if(!has_enabled_antagHUD && !client.holder) + has_enabled_antagHUD = TRUE + + antagHUD = !antagHUD + plane_holder.set_vis(VIS_CH_SPECIAL, antagHUD) + to_chat(src,"AntagHUD [antagHUD ? "Enabled" : "Disabled"]") /mob/observer/dead/proc/dead_tele(var/area/A in return_sorted_areas()) set category = "Ghost" @@ -428,7 +376,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(check_rights(R_ADMIN|R_FUN, 0, src)) return 0 - return (T && T.holy) && (invisibility <= SEE_INVISIBLE_LIVING || (mind in cult.current_antagonists)) + return (T && T.holy) && (is_manifest || (mind in cult.current_antagonists)) /mob/observer/dead/verb/jumptomob(target in getmobs()) //Moves the ghost instead of just changing the ghosts's eye -Nodrak set category = "Ghost" @@ -660,18 +608,16 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp return 1 /mob/observer/dead/proc/manifest(mob/user) - is_manifest = 0 - if(!is_manifest) - is_manifest = 1 - verbs += /mob/observer/dead/proc/toggle_visibility - verbs += /mob/observer/dead/proc/ghost_whisper - src << "As you are now in the realm of the living, you can whisper to the living with the Spectral Whisper verb, inside the IC tab." - if(src.invisibility != 0) + is_manifest = TRUE + verbs |= /mob/observer/dead/proc/toggle_visibility + verbs |= /mob/observer/dead/proc/ghost_whisper + to_chat(src,"As you are now in the realm of the living, you can whisper to the living with the Spectral Whisper verb, inside the IC tab.") + if(plane != PLANE_WORLD) user.visible_message( \ "\The [user] drags ghost, [src], to our plane of reality!", \ "You drag [src] to our plane of reality!" \ ) - toggle_visibility(1) + toggle_visibility(TRUE) else user.visible_message ( \ "\The [user] just tried to smash \his book into that ghost! It's not very effective.", \ @@ -698,17 +644,18 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set desc = "Allows you to turn (in)visible (almost) at will." var/toggled_invisible - if(!forced && invisibility && world.time < toggled_invisible + 600) + if(!forced && plane == PLANE_GHOSTS && world.time < toggled_invisible + 600) src << "You must gather strength before you can turn visible again..." return - if(invisibility == 0) + if(plane == PLANE_WORLD) toggled_invisible = world.time visible_message("It fades from sight...", "You are now invisible.") else src << "You are now visible!" - invisibility = invisibility == INVISIBILITY_OBSERVER ? 0 : INVISIBILITY_OBSERVER + plane = PLANE_GHOSTS ? PLANE_WORLD : PLANE_GHOSTS + // Give the ghost a cult icon which should be visible only to itself toggle_icon("cult") @@ -733,41 +680,21 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set name = "Toggle Ghost Vision" set desc = "Toggles your ability to see things only ghosts can see, like other ghosts" set category = "Ghost" - ghostvision = !(ghostvision) + ghostvision = !ghostvision updateghostsight() - usr << "You [(ghostvision?"now":"no longer")] have ghost vision." + to_chat(src,"You [ghostvision ? "now" : "no longer"] have ghost vision.") /mob/observer/dead/verb/toggle_darkness() set name = "Toggle Darkness" + set desc = "Toggles your ability to see lighting overlays, and the darkness they create." set category = "Ghost" - seedarkness = !(seedarkness) + seedarkness = !seedarkness updateghostsight() + to_chat(src,"You [seedarkness ? "now" : "no longer"] see darkness.") /mob/observer/dead/proc/updateghostsight() - if (!seedarkness) - see_invisible = SEE_INVISIBLE_NOLIGHTING - else - see_invisible = SEE_INVISIBLE_OBSERVER - if (!ghostvision) - see_invisible = SEE_INVISIBLE_LIVING; - updateghostimages() - -/proc/updateallghostimages() - for (var/mob/observer/dead/O in player_list) - O.updateghostimages() - -/mob/observer/dead/proc/updateghostimages() - if (!client) - return - if (seedarkness || !ghostvision) - client.images -= ghost_darkness_images - client.images |= ghost_sightless_images - else - //add images for the 60inv things ghosts can normally see when darkness is enabled so they can see them now - client.images -= ghost_sightless_images - client.images |= ghost_darkness_images - if (ghostimage) - client.images -= ghostimage //remove ourself + plane_holder.set_vis(VIS_FULLBRIGHT, !seedarkness) //Inversion, because "not seeing" the darkness is "seeing" the lighting plane master. + plane_holder.set_vis(VIS_GHOSTS, ghostvision) mob/observer/dead/MayRespawn(var/feedback = 0) if(!client) diff --git a/code/modules/mob/freelook/eye.dm b/code/modules/mob/freelook/eye.dm index ff8681d128a..85cfc736c94 100644 --- a/code/modules/mob/freelook/eye.dm +++ b/code/modules/mob/freelook/eye.dm @@ -16,7 +16,7 @@ see_in_dark = 7 status_flags = GODMODE - invisibility = INVISIBILITY_EYE + plane = PLANE_AI_EYE var/mob/owner = null var/list/visibleChunks = list() @@ -24,20 +24,7 @@ var/ghostimage = null var/datum/visualnet/visualnet -/mob/observer/eye/New() - ghostimage = image(src.icon,src,src.icon_state) - ghost_darkness_images |= ghostimage //so ghosts can see the eye when they disable darkness - ghost_sightless_images |= ghostimage //so ghosts can see the eye when they disable ghost sight - updateallghostimages() - ..() - -mob/observer/eye/Destroy() - if (ghostimage) - ghost_darkness_images -= ghostimage - ghost_sightless_images -= ghostimage - qdel(ghostimage) - ghostimage = null - updateallghostimages() +/mob/observer/eye/Destroy() if(owner) if(owner.eyeobj == src) owner.eyeobj = null diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index b6c0376aef3..439aed4ec72 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -126,7 +126,7 @@ var/list/slot_equipment_priority = list( \ if(!W) return 0 W.forceMove(get_turf(src)) - W.layer = initial(W.layer) + W.reset_plane_and_layer() W.dropped() return 0 @@ -138,7 +138,7 @@ var/list/slot_equipment_priority = list( \ remove_from_mob(W, target) if(!(W && W.loc)) return 1 // self destroying objects (tk, grabs) - update_icons() + update_icons_layers() return 1 return 0 @@ -202,7 +202,7 @@ var/list/slot_equipment_priority = list( \ src.u_equip(O) if (src.client) src.client.screen -= O - O.layer = initial(O.layer) + O.reset_plane_and_layer() O.screen_loc = null if(istype(O, /obj/item)) var/obj/item/I = O diff --git a/code/modules/mob/living/bot/medbot.dm b/code/modules/mob/living/bot/medbot.dm index 7812115e76b..29e9cd0a9b1 100644 --- a/code/modules/mob/living/bot/medbot.dm +++ b/code/modules/mob/living/bot/medbot.dm @@ -87,7 +87,7 @@ visible_message("[src] is trying to inject [H]!") if(declare_treatment) var/area/location = get_area(src) - broadcast_medical_hud_message("[src] is treating [H] in [location]", src) + global_announcer.autosay("[src] is treating [H] in [location]", "[src]", "Medical") busy = 1 update_icons() if(do_mob(src, H, 30)) diff --git a/code/modules/mob/living/bot/secbot.dm b/code/modules/mob/living/bot/secbot.dm index 9e3a266a649..15026a83ba4 100644 --- a/code/modules/mob/living/bot/secbot.dm +++ b/code/modules/mob/living/bot/secbot.dm @@ -144,7 +144,7 @@ /mob/living/bot/secbot/proc/react_to_attack(mob/attacker) if(!target) playsound(src.loc, pick(threat_found_sounds), 50) - broadcast_security_hud_message("[src] was attacked by a hostile [target_name(attacker)] in [get_area(src)].", src) + global_announcer.autosay("[src] was attacked by a hostile [target_name(attacker)] in [get_area(src)].", "[src]", "Security") target = attacker awaiting_surrender = INFINITY // Don't try and wait for surrender @@ -152,7 +152,7 @@ /mob/living/bot/secbot/proc/demand_surrender(mob/target, var/threat) var/suspect_name = target_name(target) if(declare_arrests) - broadcast_security_hud_message("[src] is [arrest_type ? "detaining" : "arresting"] a level [threat] suspect [suspect_name] in [get_area(src)].", src) + global_announcer.autosay("[src] is [arrest_type ? "detaining" : "arresting"] a level [threat] suspect [suspect_name] in [get_area(src)].", "[src]", "Security") say("Down on the floor, [suspect_name]! You have [SECBOT_WAIT_TIME] seconds to comply.") playsound(src.loc, pick(preparing_arrest_sounds), 50) // Register to be told when the target moves @@ -205,7 +205,7 @@ var/action = arrest_type ? "detaining" : "arresting" if(istype(target, /mob/living/simple_animal)) action = "fighting" - broadcast_security_hud_message("[src] is [action] a level [threat] [action != "fighting" ? "suspect" : "threat"] [target_name(target)] in [get_area(src)].", src) + global_announcer.autosay("[src] is [action] a level [threat] [action != "fighting" ? "suspect" : "threat"] [target_name(target)] in [get_area(src)].", "[src]", "Security") UnarmedAttack(target) // So Beepsky talks while beating up simple mobs. diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 233f0f020fb..dd4d6a8d0a0 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -319,7 +319,8 @@ H.bloody_hands = 0 H.update_inv_gloves(0) H.germ_level = 0 - update_icons() //apply the now updated overlays to the mob + update_icons_layers(FALSE) //apply the now updated overlays to the mob + update_icons_body() //Throwing stuff /mob/proc/throw_item(atom/target) diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm index 3b83f1e8c2e..12af8bb168b 100644 --- a/code/modules/mob/living/carbon/human/appearance.dm +++ b/code/modules/mob/living/carbon/human/appearance.dm @@ -23,7 +23,7 @@ src.gender = gender reset_hair() - update_body() + update_icons_body() update_dna() return 1 @@ -91,7 +91,7 @@ b_eyes = blue update_eyes() - update_body() + update_icons_body() return 1 /mob/living/carbon/human/proc/change_hair_color(var/red, var/green, var/blue) @@ -102,8 +102,6 @@ g_hair = green b_hair = blue - force_update_limbs() - update_body() update_hair() return 1 @@ -127,7 +125,7 @@ b_skin = blue force_update_limbs() - update_body() + update_icons_body() return 1 /mob/living/carbon/human/proc/change_skin_tone(var/tone) @@ -137,7 +135,7 @@ s_tone = tone force_update_limbs() - update_body() + update_icons_body() return 1 /mob/living/carbon/human/proc/update_dna() @@ -211,4 +209,4 @@ /mob/living/carbon/human/proc/force_update_limbs() for(var/obj/item/organ/external/O in organs) O.sync_colour_to_human(src) - update_body(0) + update_icons_body(FALSE) diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 8df0bd16052..13be7e6c1bb 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -117,7 +117,7 @@ mutations.Add(HUSK) status_flags |= DISFIGURED //makes them unknown without fucking up other stuff like admintools - update_body(1) + update_icons_body() return /mob/living/carbon/human/proc/Drain() @@ -136,5 +136,5 @@ mutations.Add(SKELETON) status_flags |= DISFIGURED - update_body(1) + update_icons_body() return \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index da715fbe96f..480ce3cc804 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -2,8 +2,8 @@ name = "unknown" real_name = "unknown" voice_name = "unknown" - icon = 'icons/mob/human.dmi' - icon_state = "body_m_s" + icon = 'icons/effects/effects.dmi' //We have an ultra-complex update icons that overlays everything, don't load some stupid random male human + icon_state = "nothing" var/list/hud_list[TOTAL_HUDS] var/embedded_flag //To check if we've need to roll for damage on movement while an item is imbedded in us. @@ -37,20 +37,7 @@ nutrition = rand(200,400) - hud_list[HEALTH_HUD] = new /image/hud_overlay('icons/mob/hud_med.dmi', src, "100") - if(isSynthetic()) - hud_list[STATUS_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudrobo") - hud_list[LIFE_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudrobo") - else - hud_list[STATUS_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudhealthy") - hud_list[LIFE_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudhealthy") - hud_list[ID_HUD] = new /image/hud_overlay(using_map.id_hud_icons, src, "hudunknown") - hud_list[WANTED_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[IMPLOYAL_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[IMPCHEM_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[IMPTRACK_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[SPECIALROLE_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[STATUS_HUD_OOC] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudhealthy") + make_hud_overlays() human_mob_list |= src ..() @@ -69,6 +56,14 @@ human_mob_list -= src for(var/organ in organs) qdel(organ) + + list_layers.Cut() + list_layers = null //Be free! + list_body.Cut() + list_body = null + list_huds.Cut() + list_huds = null + return ..() /mob/living/carbon/human/Stat() diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 8d81a9ce95d..8439df53989 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -73,9 +73,6 @@ var/skill_specialization = null var/list/skills = list() - var/icon/stand_icon = null - var/icon/lying_icon = null - var/voice = "" //Instead of new say code calling GetVoice() over and over and over, we're just going to ask this variable, which gets updated in Life() var/miming = null //Toggle for the mime's abilities. @@ -105,6 +102,8 @@ can_be_antagged = TRUE + var/has_huds = TRUE //Do they have all the fancy life huds? Not for mannequins. + // Used by mobs in virtual reality to point back to the "real" mob the client belongs to. var/mob/living/carbon/human/vr_holder = null // Used by "real" mobs after they leave a VR session diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index cb49001d3c9..13fd03ed420 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -108,6 +108,61 @@ return FBP_NONE +/mob/living/carbon/human/proc/make_hud_overlays() + hud_list[HEALTH_HUD] = gen_hud_image(ingame_hud_med, src, "100", plane = PLANE_CH_HEALTH) + if(isSynthetic()) + hud_list[STATUS_HUD] = gen_hud_image(ingame_hud, src, "hudrobo", plane = PLANE_CH_STATUS) + hud_list[LIFE_HUD] = gen_hud_image(ingame_hud, src, "hudrobo", plane = PLANE_CH_LIFE) + else + hud_list[STATUS_HUD] = gen_hud_image(ingame_hud, src, "hudhealthy", plane = PLANE_CH_STATUS) + hud_list[LIFE_HUD] = gen_hud_image(ingame_hud, src, "hudhealthy", plane = PLANE_CH_LIFE) + hud_list[ID_HUD] = gen_hud_image(using_map.id_hud_icons, src, "hudunknown", plane = PLANE_CH_ID) + hud_list[WANTED_HUD] = gen_hud_image(ingame_hud, src, "hudblank", plane = PLANE_CH_WANTED) + hud_list[IMPLOYAL_HUD] = gen_hud_image(ingame_hud, src, "hudblank", plane = PLANE_CH_IMPLOYAL) + hud_list[IMPCHEM_HUD] = gen_hud_image(ingame_hud, src, "hudblank", plane = PLANE_CH_IMPCHEM) + hud_list[IMPTRACK_HUD] = gen_hud_image(ingame_hud, src, "hudblank", plane = PLANE_CH_IMPTRACK) + hud_list[SPECIALROLE_HUD] = gen_hud_image(ingame_hud, src, "hudblank", plane = PLANE_CH_SPECIAL) + hud_list[STATUS_HUD_OOC] = gen_hud_image(ingame_hud, src, "hudhealthy", plane = PLANE_CH_STATUS_OOC) + +/mob/living/carbon/human/recalculate_vis() + if(!vis_enabled || !plane_holder) + return + + //These things are allowed to add vision flags. + //If you code some crazy item that goes on your feet that lets you see ghosts, you need to add a slot here. + var/tmp/list/slots = list(slot_glasses,slot_head) + var/tmp/list/compiled_vis = list() + + for(var/slot in slots) + var/obj/item/clothing/O = get_equipped_item(slot) //Change this type if you move the vision stuff to item or something. + if(O && O.enables_planes && (slot in O.plane_slots)) + compiled_vis |= O.enables_planes + + //Check to see if we have a rig (ugh, blame rigs, desnowflake this) + var/obj/item/weapon/rig/rig = back + if(istype(rig) && rig.visor) + if(!rig.helmet || (head && rig.helmet == head)) + if(rig.visor && rig.visor.vision && rig.visor.active && rig.visor.vision.glasses) + var/obj/item/clothing/glasses/V = rig.visor.vision.glasses + compiled_vis |= V.enables_planes + + if(!compiled_vis.len && !vis_enabled.len) + return //Nothin' doin'. + + var/tmp/list/oddities = vis_enabled ^ compiled_vis + if(!oddities.len) + return //Same thing in both lists! + + var/tmp/list/to_enable = oddities - vis_enabled + var/tmp/list/to_disable = oddities - compiled_vis + + for(var/vis in to_enable) + plane_holder.set_vis(vis,TRUE) + vis_enabled += vis + for(var/vis in to_disable) + plane_holder.set_vis(vis,FALSE) + vis_enabled -= vis + #undef HUMAN_EATING_NO_ISSUE #undef HUMAN_EATING_NO_MOUTH #undef HUMAN_EATING_BLOCKED_MOUTH diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index a187436af89..909b2776d7e 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -264,4 +264,4 @@ var/obj/item/organ/O = new limb_path(src) organ_data["descriptor"] = O.name to_chat(src, "You feel a slithering sensation as your [O.name] reform.") - src.update_body() + update_icons_all() diff --git a/code/modules/mob/living/carbon/human/human_species.dm b/code/modules/mob/living/carbon/human/human_species.dm index 34a864bf27a..8b828900d1f 100644 --- a/code/modules/mob/living/carbon/human/human_species.dm +++ b/code/modules/mob/living/carbon/human/human_species.dm @@ -1,6 +1,7 @@ /mob/living/carbon/human/dummy real_name = "Test Dummy" status_flags = GODMODE|CANPUSH + has_huds = FALSE /mob/living/carbon/human/dummy/mannequin/New() ..() diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 3f4a66476b7..187ddcac7e4 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -231,7 +231,7 @@ This saves us from having to call add_fingerprint() any time something is put in var/obj/item/clothing/ears/offear/O = new(W) O.loc = src src.r_ear = O - O.layer = 20 + O.hud_layerise() W.equipped(src, slot) update_inv_ears(redraw_mob) if(slot_r_ear) @@ -240,7 +240,7 @@ This saves us from having to call add_fingerprint() any time something is put in var/obj/item/clothing/ears/offear/O = new(W) O.loc = src src.l_ear = O - O.layer = 20 + O.hud_layerise() W.equipped(src, slot) update_inv_ears(redraw_mob) if(slot_glasses) @@ -303,7 +303,7 @@ This saves us from having to call add_fingerprint() any time something is put in src.r_hand = null update_inv_r_hand() - W.layer = 20 + W.hud_layerise() if(W.action_button_name) update_action_buttons() diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index c8c8c185db1..9aa425ebe76 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1214,6 +1214,7 @@ var/mutable_appearance/healths_ma = new(healths) healths_ma.icon_state = "blank" healths_ma.overlays = null + healths_ma.plane = PLANE_PLAYER_HUD var/no_damage = 1 var/trauma_val = 0 // Used in calculating softcrit/hardcrit indicators. @@ -1377,24 +1378,13 @@ client.screen |= G.overlay if(G.vision_flags) sight |= G.vision_flags - if(!druggy && !seer) - see_invisible = SEE_INVISIBLE_MINIMUM - if(G.see_invisible >= 0) - see_invisible = G.see_invisible if(istype(G,/obj/item/clothing/glasses/night) && !seer) see_invisible = SEE_INVISIBLE_MINIMUM -/* HUD shit goes here, as long as it doesn't modify sight flags */ -// The purpose of this is to stop xray and w/e from preventing you from using huds -- Love, Doohl - var/obj/item/clothing/glasses/hud/O = G - if(istype(G, /obj/item/clothing/glasses/sunglasses/sechud)) - var/obj/item/clothing/glasses/sunglasses/sechud/S = G - O = S.hud - if(istype(G, /obj/item/clothing/glasses/sunglasses/medhud)) - var/obj/item/clothing/glasses/sunglasses/medhud/M = G - O = M.hud - if(istype(O)) - O.process_hud(src) - if(!druggy && !seer) see_invisible = SEE_INVISIBLE_LIVING + + if(G.see_invisible >= 0) + see_invisible = G.see_invisible + else if(!druggy && !seer) + see_invisible = SEE_INVISIBLE_LIVING /mob/living/carbon/human/handle_random_events() if(inStasisNow()) @@ -1722,6 +1712,7 @@ holder.icon_state = "hudsyndicate" hud_list[SPECIALROLE_HUD] = holder hud_updateflag = 0 + update_icons_huds() /mob/living/carbon/human/handle_stunned() if(!can_feel_pain()) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 6bc3136a738..256350b3810 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -70,7 +70,7 @@ There are several things that need to be remembered: > There are also these special cases: update_mutations() //handles updating your appearance for certain mutations. e.g TK head-glows UpdateDamageIcon() //handles damage overlays for brute/burn damage //(will rename this when I geta round to it) - update_body() //Handles updating your mob's icon to reflect their gender/race/complexion etc + update_icons_body() //Handles updating your mob's icon to reflect their gender/race/complexion etc update_hair() //Handles updating your hair overlay (used to be update_face, but mouth and ...eyes were merged into update_body) update_targeted() // Updates the target overlay when someone points a gun at you @@ -140,31 +140,41 @@ Please contact me on #coderbus IRC. ~Carn x ////////////////////////////////// /mob/living/carbon/human + var/list/list_huds = list() + var/list/list_body = list() + var/list/list_layers = list() + var/list/overlays_standing[TOTAL_LAYERS] var/previous_damage_appearance // store what the body last looked like, so we only have to update it if something changed //UPDATES OVERLAYS FROM OVERLAYS_LYING/OVERLAYS_STANDING -//this proc is messy as I was forced to include some old laggy cloaking code to it so that I don't break cloakers //I'll work on removing that stuff by rewriting some of the cloaking stuff at a later date. /mob/living/carbon/human/update_icons() lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again update_hud() //TODO: remove the need for this - overlays.Cut() - if (icon_update) - icon = stand_icon - for(var/entry in overlays_standing) - if(istype(entry, /image)) - overlays += entry - else if(istype(entry, /list)) - for(var/inner_entry in entry) - overlays += inner_entry - if(species && species.has_floating_eyes) - overlays |= species.get_eyes(src) + //0: We start with their existing appearance (this contains their verbs, important to keep those!) + var/mutable_appearance/ma_compiled = new(src) - update_transform() + //1: HUDs because these are hidden behind a backplane. See update_icons_huds() + ma_compiled.overlays = list_huds //The first one can set instead of add -/mob/living/carbon/human/update_transform() + //2: The body itself, all the organs and whatnot + ma_compiled.overlays += list_body + + //3: The 'layers' list (overlays_standing), from the defines above + ma_compiled.overlays += list_layers + + //4: Apply transforms based on situation + update_transform(ma_compiled, FALSE) + + //4.5 Set layer to PLANE_WORLD to make sure its not magically FLOAT_PLANE due to byond madness + ma_compiled.plane = PLANE_WORLD + + //5: Set appearance once + appearance = ma_compiled + +/mob/living/carbon/human/update_transform(var/mutable_appearance/ma) // First, get the correct size. var/desired_scale = icon_scale @@ -180,15 +190,54 @@ Please contact me on #coderbus IRC. ~Carn x M.Turn(90) M.Scale(desired_scale) M.Translate(1,-6) - src.transform = M + ma.transform = M + ma.layer = MOB_LAYER // Fix for a byond bug where turf entry order no longer matters else var/matrix/M = matrix() M.Scale(desired_scale) M.Translate(0, 16*(desired_scale-1)) - src.transform = M + ma.transform = M + ma.layer = MOB_LAYER -0.1 // Fix for a byond bug where turf entry order no longer matters + +//Update the layers from the defines above +/mob/living/carbon/human/update_icons_layers(var/update_icons = 1) + list_layers.Cut() + + for(var/entry in overlays_standing) + if(istype(entry, /image)) + list_layers += entry + else if(istype(entry, /list)) //Is this necessary? What adds a list to this? + for(var/inner_entry in entry) + list_layers += inner_entry + + if(species && species.has_floating_eyes) + list_layers += species.get_eyes(src) + + if(update_icons) + update_icons() + +//HUD Icons (ingame huds, not the user interface) +//Update things like med/sec hud icons +/mob/living/carbon/human/update_icons_huds(var/update_icons = 1) + list_huds.Cut() + + if(has_huds) + list_huds = hud_list.Copy() + list_huds += backplane // Required to mask HUDs in context menus: http://www.byond.com/forum/?post=2336679 + + if(update_icons) + update_icons() + +//A full, crunchy reprocess of all three cached lists +/mob/living/carbon/human/update_icons_all(var/update_icons = 1) + update_icons_huds(FALSE) + update_icons_body(FALSE) + update_icons_layers(FALSE) + + if(update_icons) + update_icons() var/global/list/damage_icon_parts = list() - //DAMAGE OVERLAYS //constructs damage icon for each organ from mask * damage field and saves it in our overlays_ lists /mob/living/carbon/human/UpdateDamageIcon(var/update_icons=1) @@ -231,10 +280,11 @@ var/global/list/damage_icon_parts = list() overlays_standing[DAMAGE_LAYER] = standing_image - if(update_icons) update_icons() + if(update_icons) + update_icons_layers() //BASE MOB SPRITE -/mob/living/carbon/human/proc/update_body(var/update_icons=1) +/mob/living/carbon/human/update_icons_body(var/update_icons=1) var/husk_color_mod = rgb(96,88,80) var/hulk_color_mod = rgb(48,224,40) @@ -251,9 +301,10 @@ var/global/list/damage_icon_parts = list() //0 = destroyed, 1 = normal, 2 = robotic, 3 = necrotic. //Create a new, blank icon for our mob to use. - if(stand_icon) - qdel(stand_icon) - stand_icon = new(species.icon_template ? species.icon_template : 'icons/mob/human.dmi',"blank") + var/icon/stand_icon = new(species.icon_template ? species.icon_template : 'icons/mob/human.dmi',"blank") + + //Clean old list_body + list_body.Cut() var/g = "male" if(gender == FEMALE) @@ -353,6 +404,7 @@ var/global/list/damage_icon_parts = list() //END CACHED ICON GENERATION. stand_icon.Blend(base_icon,ICON_OVERLAY) + list_body += stand_icon //A little silly, almost pointless to use a list for this, but can come back later and make this proc itself better if(update_icons) update_icons() @@ -362,7 +414,7 @@ var/global/list/damage_icon_parts = list() /mob/living/carbon/human/proc/update_skin(var/update_icons=1) overlays_standing[SKIN_LAYER] = species.update_skin(src) - if(update_icons) update_icons() + if(update_icons) update_icons_layers() //UNDERWEAR OVERLAY /mob/living/carbon/human/proc/update_underwear(var/update_icons=1) @@ -376,7 +428,7 @@ var/global/list/damage_icon_parts = list() var/datum/category_item/underwear/UWI = all_underwear[category] overlays_standing[UNDERWEAR_LAYER] += UWI.generate_image(all_underwear_metadata[category]) - if(update_icons) update_icons() + if(update_icons) update_icons_layers() //HAIR OVERLAY /mob/living/carbon/human/proc/update_hair(var/update_icons=1) @@ -385,12 +437,12 @@ var/global/list/damage_icon_parts = list() var/obj/item/organ/external/head/head_organ = get_organ(BP_HEAD) if(!head_organ || head_organ.is_stump() ) - if(update_icons) update_icons() + if(update_icons) update_icons_layers() return //masks and helmets can obscure our hair. if( (head && (head.flags_inv & BLOCKHAIR)) || (wear_mask && (wear_mask.flags_inv & BLOCKHAIR))) - if(update_icons) update_icons() + if(update_icons) update_icons_layers() return //base icons @@ -421,7 +473,7 @@ var/global/list/damage_icon_parts = list() overlays_standing[HAIR_LAYER] = image(face_standing) - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /mob/living/carbon/human/update_mutations(var/update_icons=1) var/fat @@ -464,7 +516,7 @@ var/global/list/damage_icon_parts = list() overlays_standing[MUTATIONS_LAYER] = standing else overlays_standing[MUTATIONS_LAYER] = null - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /* --------------------------------------- */ //For legacy support. @@ -474,7 +526,7 @@ var/global/list/damage_icon_parts = list() update_mutations(0) update_skin(0) - update_body(0) + update_icons_body(0) update_underwear(0) update_hair(0) update_inv_w_uniform(0) @@ -498,6 +550,8 @@ var/global/list/damage_icon_parts = list() update_water(0) update_surgery(0) UpdateDamageIcon() + update_icons_layers(0) + update_icons_huds(0) update_icons() //Hud Stuff update_hud() @@ -562,7 +616,7 @@ var/global/list/damage_icon_parts = list() update_inv_shoes(1) if(update_icons) - update_icons() + update_icons_layers() /mob/living/carbon/human/update_inv_wear_id(var/update_icons=1) if(wear_id) @@ -584,7 +638,7 @@ var/global/list/damage_icon_parts = list() BITSET(hud_updateflag, ID_HUD) BITSET(hud_updateflag, WANTED_HUD) - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /mob/living/carbon/human/update_inv_gloves(var/update_icons=1) if(gloves) @@ -621,7 +675,7 @@ var/global/list/damage_icon_parts = list() overlays_standing[GLOVES_LAYER] = bloodsies else overlays_standing[GLOVES_LAYER] = null - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /mob/living/carbon/human/update_inv_glasses(var/update_icons=1) @@ -646,12 +700,12 @@ var/global/list/damage_icon_parts = list() else overlays_standing[GLASSES_LAYER] = null - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /mob/living/carbon/human/update_inv_ears(var/update_icons=1) overlays_standing[EARS_LAYER] = null if( (head && (head.flags_inv & (BLOCKHAIR | BLOCKHEADHAIR))) || (wear_mask && (wear_mask.flags_inv & (BLOCKHAIR | BLOCKHEADHAIR)))) - if(update_icons) update_icons() + if(update_icons) update_icons_layers() return if(l_ear || r_ear) @@ -706,7 +760,7 @@ var/global/list/damage_icon_parts = list() else overlays_standing[EARS_LAYER] = null - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /mob/living/carbon/human/update_inv_shoes(var/update_icons=1) if(shoes && !((wear_suit && wear_suit.flags_inv & HIDESHOES) || (w_uniform && w_uniform.flags_inv & HIDESHOES))) @@ -763,7 +817,7 @@ var/global/list/damage_icon_parts = list() s_store.screen_loc = ui_sstore1 //TODO else overlays_standing[SUIT_STORE_LAYER] = null - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /mob/living/carbon/human/update_inv_head(var/update_icons=1) @@ -823,7 +877,7 @@ var/global/list/damage_icon_parts = list() else overlays_standing[HEAD_LAYER] = null - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /mob/living/carbon/human/update_inv_belt(var/update_icons=1) if(belt) @@ -867,7 +921,7 @@ var/global/list/damage_icon_parts = list() else overlays_standing[BELT_LAYER] = null overlays_standing[BELT_LAYER_ALT] = null - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /mob/living/carbon/human/update_inv_wear_suit(var/update_icons=1) @@ -926,12 +980,12 @@ var/global/list/damage_icon_parts = list() update_inv_shoes(0) update_tail_showing(0) - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /mob/living/carbon/human/update_inv_pockets(var/update_icons=1) if(l_store) l_store.screen_loc = ui_storage1 //TODO if(r_store) r_store.screen_loc = ui_storage2 //TODO - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /mob/living/carbon/human/update_inv_wear_mask(var/update_icons=1) @@ -962,7 +1016,7 @@ var/global/list/damage_icon_parts = list() overlays_standing[FACEMASK_LAYER] = standing else overlays_standing[FACEMASK_LAYER] = null - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /mob/living/carbon/human/update_inv_back(var/update_icons=1) @@ -1011,8 +1065,7 @@ var/global/list/damage_icon_parts = list() overlays_standing[BACK_LAYER] = null if(update_icons) - update_icons() - + update_icons_layers() /mob/living/carbon/human/update_hud() //TODO: do away with this if possible if(client) @@ -1045,7 +1098,7 @@ var/global/list/damage_icon_parts = list() overlays_standing[HANDCUFF_LAYER] = null update_hud_handcuffed() - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /mob/living/carbon/human/update_inv_legcuffed(var/update_icons=1) if(legcuffed) @@ -1066,7 +1119,7 @@ var/global/list/damage_icon_parts = list() else overlays_standing[LEGCUFF_LAYER] = null - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /mob/living/carbon/human/update_inv_r_hand(var/update_icons=1) @@ -1102,7 +1155,7 @@ var/global/list/damage_icon_parts = list() else overlays_standing[R_HAND_LAYER] = null - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /mob/living/carbon/human/update_inv_l_hand(var/update_icons=1) @@ -1138,7 +1191,7 @@ var/global/list/damage_icon_parts = list() else overlays_standing[L_HAND_LAYER] = null - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /mob/living/carbon/human/proc/update_tail_showing(var/update_icons=1) overlays_standing[TAIL_LAYER] = null @@ -1151,7 +1204,7 @@ var/global/list/damage_icon_parts = list() animate_tail_reset(0) if(update_icons) - update_icons() + update_icons_layers() /mob/living/carbon/human/proc/get_tail_icon() var/icon_key = "[species.get_race_key(src)][r_skin][g_skin][b_skin][r_hair][g_hair][b_hair]" @@ -1198,19 +1251,19 @@ var/global/list/damage_icon_parts = list() animate_tail_stop() if(update_icons) - update_icons() + update_icons_layers() /mob/living/carbon/human/proc/animate_tail_start(var/update_icons=1) set_tail_state("[species.get_tail(src)]_slow[rand(0,9)]") if(update_icons) - update_icons() + update_icons_layers() /mob/living/carbon/human/proc/animate_tail_fast(var/update_icons=1) set_tail_state("[species.get_tail(src)]_loop[rand(0,9)]") if(update_icons) - update_icons() + update_icons_layers() /mob/living/carbon/human/proc/animate_tail_reset(var/update_icons=1) if(stat != DEAD) @@ -1219,13 +1272,13 @@ var/global/list/damage_icon_parts = list() set_tail_state("[species.get_tail(src)]_static") if(update_icons) - update_icons() + update_icons_layers() /mob/living/carbon/human/proc/animate_tail_stop(var/update_icons=1) set_tail_state("[species.get_tail(src)]_static") if(update_icons) - update_icons() + update_icons_layers() //Adds a collar overlay above the helmet layer if the suit has one @@ -1240,7 +1293,7 @@ var/global/list/damage_icon_parts = list() overlays_standing[COLLAR_LAYER] = standing - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /mob/living/carbon/human/update_modifier_visuals(var/update_icons=1) overlays_standing[MODIFIER_EFFECTS_LAYER] = null @@ -1253,14 +1306,14 @@ var/global/list/damage_icon_parts = list() overlays_standing[MODIFIER_EFFECTS_LAYER] = effects if(update_icons) - update_icons() + update_icons_layers() /mob/living/carbon/human/update_fire(var/update_icons=1) overlays_standing[FIRE_LAYER] = null if(on_fire) overlays_standing[FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state" = get_fire_icon_state()) - if(update_icons) update_icons() + if(update_icons) update_icons_layers() /mob/living/carbon/human/update_water(var/update_icons=1) overlays_standing[WATER_LAYER] = null @@ -1271,7 +1324,7 @@ var/global/list/damage_icon_parts = list() // Lying sideways with the overlay looked strange. Another overlay will be needed in the future. if(update_icons) - update_icons() + update_icons_layers() /mob/living/carbon/human/proc/update_surgery(var/update_icons=1) overlays_standing[SURGERY_LEVEL] = null @@ -1281,7 +1334,7 @@ var/global/list/damage_icon_parts = list() var/image/I = image("icon"='icons/mob/surgery.dmi', "icon_state"="[E.icon_name][round(E.open)]", "layer"=-SURGERY_LEVEL) total.overlays += I overlays_standing[SURGERY_LEVEL] = total - if(update_icons) update_icons() + if(update_icons) update_icons_layers() //Human Overlays Indexes///////// #undef MUTATIONS_LAYER diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index c8afb9b0d1a..a735db5f163 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -172,16 +172,6 @@ var/list/ai_verbs_default = list( spawn(5) new /obj/machinery/ai_powersupply(src) - hud_list[HEALTH_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[STATUS_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[LIFE_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[ID_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[WANTED_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[IMPLOYAL_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[IMPCHEM_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[IMPTRACK_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[SPECIALROLE_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - ai_list += src ..() return diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index 5c6b617a7bd..413cf492509 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -150,11 +150,6 @@ process_queued_alarms() handle_regular_hud_updates() - switch(src.sensor_mode) - if (SEC_HUD) - process_sec_hud(src,0,src.eyeobj) - if (MED_HUD) - process_med_hud(src,0,src.eyeobj) /mob/living/silicon/ai/proc/lacks_power() if(APU_power) diff --git a/code/modules/mob/living/silicon/pai/life.dm b/code/modules/mob/living/silicon/pai/life.dm index e33a487a61f..f483921b816 100644 --- a/code/modules/mob/living/silicon/pai/life.dm +++ b/code/modules/mob/living/silicon/pai/life.dm @@ -15,12 +15,6 @@ handle_regular_hud_updates() - if(src.secHUD == 1) - process_sec_hud(src, 1) - - if(src.medHUD == 1) - process_med_hud(src, 1) - if(silence_time) if(world.timeofday >= silence_time) silence_time = null @@ -30,7 +24,7 @@ if(health <= 0) death(null,"gives one shrill beep before falling lifeless.") - + /mob/living/silicon/pai/updatehealth() if(status_flags & GODMODE) diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm index d8298e605f0..fd8164b01c8 100644 --- a/code/modules/mob/living/silicon/robot/inventory.dm +++ b/code/modules/mob/living/silicon/robot/inventory.dm @@ -231,21 +231,21 @@ return if(!module_state_1) module_state_1 = O - O.layer = 20 + O.hud_layerise() O.screen_loc = inv1.screen_loc contents += O if(istype(module_state_1,/obj/item/borg/sight)) sight_mode |= module_state_1:sight_mode else if(!module_state_2) module_state_2 = O - O.layer = 20 + O.hud_layerise() O.screen_loc = inv2.screen_loc contents += O if(istype(module_state_2,/obj/item/borg/sight)) sight_mode |= module_state_2:sight_mode else if(!module_state_3) module_state_3 = O - O.layer = 20 + O.hud_layerise() 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/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 6d44a4907a2..82992581846 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -191,16 +191,6 @@ ..() - var/obj/item/borg/sight/hud/hud = (locate(/obj/item/borg/sight/hud) in src) - if(hud && hud.hud) - hud.hud.process_hud(src) - else - switch(src.sensor_mode) - if (SEC_HUD) - process_sec_hud(src,0) - if (MED_HUD) - process_med_hud(src,0) - if (src.healths) if (src.stat != 2) if(istype(src,/mob/living/silicon/robot/drone)) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 5eac71276fb..2eea0f41df4 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -109,7 +109,6 @@ 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) module_sprites["Basic"] = "robot" icontype = "Basic" @@ -151,15 +150,15 @@ add_robot_verbs() - hud_list[HEALTH_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[STATUS_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudhealth100") - hud_list[LIFE_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudhealth100") - hud_list[ID_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[WANTED_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[IMPLOYAL_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[IMPCHEM_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[IMPTRACK_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") - hud_list[SPECIALROLE_HUD] = new /image/hud_overlay('icons/mob/hud.dmi', src, "hudblank") + hud_list[HEALTH_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudblank", plane = PLANE_CH_HEALTH) + hud_list[STATUS_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudhealth100", plane = PLANE_CH_STATUS) + hud_list[LIFE_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudhealth100", plane = PLANE_CH_LIFE) + hud_list[ID_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudblank", plane = PLANE_CH_ID) + hud_list[WANTED_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudblank", plane = PLANE_CH_WANTED) + hud_list[IMPLOYAL_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudblank", plane = PLANE_CH_IMPLOYAL) + hud_list[IMPCHEM_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudblank", plane = PLANE_CH_IMPCHEM) + hud_list[IMPTRACK_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudblank", plane = PLANE_CH_IMPTRACK) + hud_list[SPECIALROLE_HUD] = gen_hud_image('icons/mob/hud.dmi', src, "hudblank", plane = PLANE_CH_SPECIAL) /mob/living/silicon/robot/proc/init() aiCamera = new/obj/item/device/camera/siliconcam/robot_camera(src) @@ -805,19 +804,19 @@ return 1 if(!module_state_1) module_state_1 = O - O.layer = 20 + O.hud_layerise() contents += O if(istype(module_state_1,/obj/item/borg/sight)) sight_mode |= module_state_1:sight_mode else if(!module_state_2) module_state_2 = O - O.layer = 20 + O.hud_layerise() contents += O if(istype(module_state_2,/obj/item/borg/sight)) sight_mode |= module_state_2:sight_mode else if(!module_state_3) module_state_3 = O - O.layer = 20 + O.hud_layerise() contents += O if(istype(module_state_3,/obj/item/borg/sight)) sight_mode |= module_state_3:sight_mode diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 84aa81af69a..f1554b59a73 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -18,8 +18,6 @@ var/obj/item/device/camera/siliconcam/aiCamera = null //photography var/local_transmit //If set, can only speak to others of the same type within a short range. - var/sensor_mode = 0 //Determines the current HUD. - var/next_alarm_notice var/list/datum/alarm/queued_alarms = new() @@ -238,17 +236,49 @@ return /mob/living/silicon/proc/toggle_sensor_mode() - var/sensor_type = input("Please select sensor type.", "Sensor Integration", null) in list("Security", "Medical","Disable") + var/sensor_type = input("Please select sensor type.", "Sensor Integration", null) in list("Security","Medical","Disable") switch(sensor_type) if ("Security") - sensor_mode = SEC_HUD - src << "Security records overlay enabled." + if(plane_holder) + //Enable Security planes + plane_holder.set_vis(VIS_CH_ID,TRUE) + plane_holder.set_vis(VIS_CH_WANTED,TRUE) + plane_holder.set_vis(VIS_CH_IMPLOYAL,TRUE) + plane_holder.set_vis(VIS_CH_IMPTRACK,TRUE) + plane_holder.set_vis(VIS_CH_IMPCHEM,TRUE) + + //Disable Medical planes + plane_holder.set_vis(VIS_CH_STATUS,FALSE) + plane_holder.set_vis(VIS_CH_HEALTH,FALSE) + + to_chat(src,"Security records overlay enabled.") if ("Medical") - sensor_mode = MED_HUD - src << "Life signs monitor overlay enabled." + if(plane_holder) + //Disable Security planes + plane_holder.set_vis(VIS_CH_ID,FALSE) + plane_holder.set_vis(VIS_CH_WANTED,FALSE) + plane_holder.set_vis(VIS_CH_IMPLOYAL,FALSE) + plane_holder.set_vis(VIS_CH_IMPTRACK,FALSE) + plane_holder.set_vis(VIS_CH_IMPCHEM,FALSE) + + //Enable Medical planes + plane_holder.set_vis(VIS_CH_STATUS,TRUE) + plane_holder.set_vis(VIS_CH_HEALTH,TRUE) + + to_chat(src,"Life signs monitor overlay enabled.") if ("Disable") - sensor_mode = 0 - src << "Sensor augmentations disabled." + if(plane_holder) + //Disable Security planes + plane_holder.set_vis(VIS_CH_ID,FALSE) + plane_holder.set_vis(VIS_CH_WANTED,FALSE) + plane_holder.set_vis(VIS_CH_IMPLOYAL,FALSE) + plane_holder.set_vis(VIS_CH_IMPTRACK,FALSE) + plane_holder.set_vis(VIS_CH_IMPCHEM,FALSE) + + //Disable Medical planes + plane_holder.set_vis(VIS_CH_STATUS,FALSE) + plane_holder.set_vis(VIS_CH_HEALTH,FALSE) + to_chat(src,"Sensor augmentations disabled.") /mob/living/silicon/verb/pose() set name = "Set Pose" diff --git a/code/modules/mob/living/simple_animal/animals/giant_spider.dm b/code/modules/mob/living/simple_animal/animals/giant_spider.dm index cc655908e9b..79cad633178 100644 --- a/code/modules/mob/living/simple_animal/animals/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/animals/giant_spider.dm @@ -47,8 +47,8 @@ /mob/living/simple_animal/hostile/giant_spider/proc/add_eyes() if(!eye_layer) - var/overlay_layer = LIGHTING_LAYER+0.1 - eye_layer = image(icon, "[icon_state]-eyes", overlay_layer) + eye_layer = image(icon, "[icon_state]-eyes") + eye_layer.plane = PLANE_LIGHTING_ABOVE overlays += eye_layer diff --git a/code/modules/mob/living/simple_animal/constructs/constructs.dm b/code/modules/mob/living/simple_animal/constructs/constructs.dm index f386016c176..412f37f1727 100644 --- a/code/modules/mob/living/simple_animal/constructs/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs/constructs.dm @@ -244,12 +244,9 @@ ////////////////Glow////////////////// /mob/living/simple_animal/construct/proc/add_glow() - overlays = 0 - var/overlay_layer = LIGHTING_LAYER+0.1 - if(layer != MOB_LAYER) - overlay_layer=TURF_LAYER+0.2 - - overlays += image(icon,"glow-[icon_state]",overlay_layer) + var/image/eye_glow = image(icon,"glow-[icon_state]") + eye_glow.plane = PLANE_LIGHTING_ABOVE + overlays += eye_glow set_light(2, -2, l_color = "#FFFFFF") ////////////////HUD////////////////////// diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 51f3e4f22a2..39f2fe24516 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -47,5 +47,12 @@ reload_fullscreen() // Reload any fullscreen overlays this mob has. add_click_catcher() update_client_color() + + if(!plane_holder) //Lazy + plane_holder = new(src) //Not a location, it takes it and saves it. + vis_enabled = list() + client.screen += plane_holder.plane_masters + recalculate_vis() + //set macro to normal incase it was overriden (like cyborg currently does) winset(src, null, "mainwindow.macro=macro hotkey_toggle.is-checked=false input.focus=true input.background-color=#D3B5B5") diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index a40d71af834..d472e3bce7b 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -13,6 +13,7 @@ if(mind && mind.current == src) spellremove(src) ghostize() + qdel_null(plane_holder) ..() return QDEL_HINT_HARDDEL_NOW @@ -92,7 +93,7 @@ var/mob/M = I if(self_message && M==src) M.show_message( self_message, 1, blind_message, 2) - else if(M.see_invisible >= invisibility) // Cannot view the invisible + else if(M.see_invisible >= invisibility && MOB_CAN_SEE_PLANE(M, plane)) // Cannot view the invisible M.show_message( message, 1, blind_message, 2) else if (blind_message) M.show_message(blind_message, 2) @@ -242,6 +243,7 @@ var/obj/P = new /obj/effect/decal/point(tile) P.invisibility = invisibility + P.plane = plane spawn (20) if(P) qdel(P) // qdel diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 9e9ca371ff9..2195384e577 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -34,6 +34,10 @@ var/obj/screen/wizard/energy/wiz_energy_display = null var/obj/screen/wizard/instability/wiz_instability_display = null + var/datum/plane_holder/plane_holder = null + var/list/vis_enabled = null // List of vision planes that should be graphically visible (list of their VIS_ indexes). + var/list/planes_visible = null // List of atom planes that are logically visible/interactable (list of actual plane numbers). + //spells hud icons - this interacts with add_spell and remove_spell var/list/obj/screen/movable/spell_master/spell_masters = null var/obj/screen/movable/ability_master/ability_master = null diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 8694b06a638..0a623059eb8 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -355,19 +355,6 @@ proc/is_blind(A) return 1 return 0 -/proc/broadcast_security_hud_message(var/message, var/broadcast_source) - broadcast_hud_message(message, broadcast_source, sec_hud_users, /obj/item/clothing/glasses/hud/security) - -/proc/broadcast_medical_hud_message(var/message, var/broadcast_source) - broadcast_hud_message(message, broadcast_source, med_hud_users, /obj/item/clothing/glasses/hud/health) - -/proc/broadcast_hud_message(var/message, var/broadcast_source, var/list/targets, var/icon) - var/turf/sourceturf = get_turf(broadcast_source) - for(var/mob/M in targets) - var/turf/targetturf = get_turf(M) - if((targetturf.z == sourceturf.z)) - M.show_message("\icon[icon] [message]", 1) - /proc/mobs_in_area(var/area/A) var/list/mobs = new for(var/mob/living/M in mob_list) @@ -616,3 +603,22 @@ var/list/global/organ_rel_size = list( /mob/proc/flash_eyes(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, visual = FALSE, type = /obj/screen/fullscreen/flash) return + +//Recalculates what planes this mob can see using their plane_holder, for humans this is checking slots, for others, could be whatever. +/mob/proc/recalculate_vis() + return + +//General HUD updates done regularly (health puppet things, etc) +/mob/proc/handle_regular_hud_updates() + return + +//Icon is used to occlude things like huds from the faulty byond context menu. +// http://www.byond.com/forum/?post=2336679 +var/global/image/backplane +/hook/startup/proc/generate_backplane() + backplane = image('icons/misc/win32.dmi') + backplane.alpha = 0 + backplane.plane = -100 + backplane.mouse_opacity = 0 + + return TRUE diff --git a/code/modules/mob/mob_planes.dm b/code/modules/mob/mob_planes.dm new file mode 100644 index 00000000000..947619a2b28 --- /dev/null +++ b/code/modules/mob/mob_planes.dm @@ -0,0 +1,196 @@ +////////////////////////////////////////////// +// These planemaster objects are created on mobs when a client logs into them (lazy). We'll use them to adjust the visibility of objects, among other things. +// + +/datum/plane_holder + var/mob/my_mob + var/list/plane_masters[VIS_COUNT] + +/datum/plane_holder/New(mob/this_guy) + my_mob = this_guy + + //It'd be nice to lazy init these but some of them are important to just EXIST. Like without ghost planemaster, you can see ghosts. Go figure. + plane_masters[VIS_FULLBRIGHT] = new /obj/screen/plane_master/fullbright //Lighting system (lighting_overlay objects) + plane_masters[VIS_GHOSTS] = new /obj/screen/plane_master/ghosts //Ghosts! + plane_masters[VIS_AI_EYE] = new /obj/screen/plane_master{plane = PLANE_AI_EYE} //AI Eye! + + plane_masters[VIS_CH_STATUS] = new /obj/screen/plane_master{plane = PLANE_CH_STATUS} //Status is the synth/human icon left side of medhuds + plane_masters[VIS_CH_HEALTH] = new /obj/screen/plane_master{plane = PLANE_CH_HEALTH} //Health bar + plane_masters[VIS_CH_LIFE] = new /obj/screen/plane_master{plane = PLANE_CH_LIFE} //Alive-or-not icon + plane_masters[VIS_CH_ID] = new /obj/screen/plane_master{plane = PLANE_CH_ID} //Job ID icon + plane_masters[VIS_CH_WANTED] = new /obj/screen/plane_master{plane = PLANE_CH_WANTED} //Wanted status + plane_masters[VIS_CH_IMPLOYAL] = new /obj/screen/plane_master{plane = PLANE_CH_IMPLOYAL} //Loyalty implants + plane_masters[VIS_CH_IMPTRACK] = new /obj/screen/plane_master{plane = PLANE_CH_IMPTRACK} //Tracking implants + plane_masters[VIS_CH_IMPCHEM] = new /obj/screen/plane_master{plane = PLANE_CH_IMPCHEM} //Chemical implants + plane_masters[VIS_CH_SPECIAL] = new /obj/screen/plane_master{plane = PLANE_CH_SPECIAL} //"Special" role stuff + plane_masters[VIS_CH_STATUS_OOC]= new /obj/screen/plane_master{plane = PLANE_CH_STATUS_OOC} //OOC status HUD + + plane_masters[VIS_ADMIN1] = new /obj/screen/plane_master{plane = PLANE_ADMIN1} //For admin use + plane_masters[VIS_ADMIN2] = new /obj/screen/plane_master{plane = PLANE_ADMIN2} //For admin use + plane_masters[VIS_ADMIN3] = new /obj/screen/plane_master{plane = PLANE_ADMIN3} //For admin use + + plane_masters[VIS_D_COLORBLIND] = new /obj/screen/plane_master/colorblindness //Colorblindness (affects world) + plane_masters[VIS_D_COLORBLINDI]= new /obj/screen/plane_master/colorblindness/items //Colorblindness (items in HUD, subplane of above, don't toggle) + + ..() + +/datum/plane_holder/Destroy() + if(my_mob) + my_mob.plane_holder = null + my_mob = null + plane_masters.Cut() //Goodbye my children, be free + ..() //We will get qdel'd, as there will not be references to us, then our planelets will disappear on their own. + +/datum/plane_holder/proc/set_vis(var/which = null, var/state = FALSE) + ASSERT(which) + var/obj/screen/plane_master/PM = plane_masters[which] + if(!PM) + crash_with("Tried to alter [which] in plane_holder on [my_mob]!") + PM.set_visibility(state) + if(PM.sub_planes) + var/list/subplanes = PM.sub_planes + for(var/SP in subplanes) + set_vis(which = SP, state = state) + var/plane = PM.plane + if(state && !(plane in my_mob.planes_visible)) + LAZYADD(my_mob.planes_visible, plane) + else if(!state && (plane in my_mob.planes_visible)) + LAZYREMOVE(my_mob.planes_visible, plane) + +/datum/plane_holder/proc/set_desired_alpha(var/which = null, var/new_alpha) + ASSERT(which) + var/obj/screen/plane_master/PM = plane_masters[which] + if(!PM) + crash_with("Tried to alter [which] in plane_holder on [my_mob]!") + PM.set_desired_alpha(new_alpha) + if(PM.sub_planes) + var/list/subplanes = PM.sub_planes + for(var/SP in subplanes) + set_vis(which = SP, new_alpha = new_alpha) + +/datum/plane_holder/proc/alter_values(var/which = null, var/list/values = null) + ASSERT(which) + var/obj/screen/plane_master/PM = plane_masters[which] + if(!PM) + crash_with("Tried to alter [which] in plane_holder on [my_mob]!") + PM.alter_plane_values(arglist(values)) + if(PM.sub_planes) + var/list/subplanes = PM.sub_planes + for(var/SP in subplanes) + alter_values(SP, values) + +//////////////////// +// The Plane Master +//////////////////// +/obj/screen/plane_master + screen_loc = "1,1" + plane = -100 //Dodge just in case someone instantiates one of these accidentally, don't end up on 0 with plane_master + appearance_flags = PLANE_MASTER + mouse_opacity = 0 //Normally unclickable + alpha = 0 //Hidden from view + var/desired_alpha = 255 //What we go to when we're enabled + var/invis_toggle = FALSE + var/list/sub_planes + +/obj/screen/plane_master/proc/set_desired_alpha(var/new_alpha) + if(new_alpha != alpha && new_alpha > 0 && new_alpha <= 255) + desired_alpha = new_alpha + if(alpha) //If we're already visible, update it now. + alpha = new_alpha + +/obj/screen/plane_master/proc/set_visibility(var/want = FALSE) + //Invisibility-managed + if(invis_toggle) + if(want && invisibility) + invisibility = 0 //Does not need a mouse_opacity toggle because these are for effects + else if(!want && !invisibility) + invisibility = 101 + //Alpha-managed + else + if(want && !alpha) + alpha = desired_alpha + mouse_opacity = 1 //Not bool, don't replace with true/false + else if(!want && alpha) + alpha = 0 + mouse_opacity = 0 + +/obj/screen/plane_master/proc/set_alpha(var/new_alpha = 255) + if(new_alpha != alpha) + new_alpha = sanitize_integer(new_alpha, 0, 255, 255) + alpha = new_alpha + +/obj/screen/plane_master/proc/alter_plane_values() + return //Stub + +//////////////////// +// Special masters +//////////////////// + +///////////////// +//Lighting is weird and has matrix shenanigans. Think of this as turning on/off darkness. +/obj/screen/plane_master/fullbright + plane = PLANE_LIGHTING + layer = LIGHTING_LAYER + color = null //To break lighting when visible (this is sorta backwards) + alpha = 255 //Starts full opaque + invisibility = 101 //But invisible + invis_toggle = TRUE + +///////////////// +//Ghosts has a special alpha level +/obj/screen/plane_master/ghosts + plane = PLANE_GHOSTS + desired_alpha = 127 //When enabled, they're like half-transparent + +//'Normal'ness v v v +//Various types of colorblindness R2R R2G R2B G2R G2G G2B B2R B2G B2B +#define MATRIX_Monochromia list(0.33, 0.33, 0.33, 0.59, 0.59, 0.59, 0.11, 0.11, 0.11) +#define MATRIX_Protanopia list(0.57, 0.43, 0, 0.56, 0.44, 0, 0, 0.24, 0.76) +#define MATRIX_Protanomaly list(0.82, 0.18, 0, 0.33, 0.67, 0, 0, 0.13, 0.88) +#define MATRIX_Deuteranopia list(0.63, 0.38, 0, 0.70, 0.30, 0, 0, 0.30, 0.70) +#define MATRIX_Deuteranomaly list(0.80, 0.20, 0, 0.26, 0.74, 0, 0, 0.14, 0.86) +#define MATRIX_Tritanopia list(0.95, 0.05, 0, 0, 0.43, 0.57, 0, 0.48, 0.53) +#define MATRIX_Tritanomaly list(0.97, 0.03, 0, 0, 0.73, 0.27, 0, 0.18, 0.82) +#define MATRIX_Achromatopsia list(0.30, 0.59, 0.11, 0.30, 0.59, 0.11, 0.30, 0.59, 0.11) +#define MATRIX_Achromatomaly list(0.62, 0.32, 0.06, 0.16, 0.78, 0.06, 0.16, 0.32, 0.52) +#define MATRIX_Vulp_Colorblind list(0.50, 0.40, 0.10, 0.50, 0.40, 0.10, 0, 0.20, 0.80) +#define MATRIX_Taj_Colorblind list(0.40, 0.20, 0.40, 0.40, 0.60, 0, 0.20, 0.20, 0.60) + +///////////////// +//Colorblindness uses special color shenanigans +/obj/screen/plane_master/colorblindness + plane = PLANE_WORLD //Affects the main game world + color = MATRIX_Monochromia + alpha = 255 //Starts out nice and opaque + invisibility = 101 //Can't see it usually + mouse_opacity = 1 //Don't make entire world not visible pls + invis_toggle = TRUE + sub_planes = list(VIS_D_COLORBLINDI) + var/list/varieties = list( + "Monochromia" = MATRIX_Monochromia, + "Protanopia" = MATRIX_Protanopia, + "Protanomaly" = MATRIX_Protanomaly, + "Deuteranopia" = MATRIX_Deuteranopia, + "Deuteranomaly" = MATRIX_Deuteranomaly, + "Tritanopia" = MATRIX_Tritanopia, + "Tritanomaly" = MATRIX_Tritanomaly, + "Achromatopsia" = MATRIX_Achromatopsia, + "Achromatomaly" = MATRIX_Achromatomaly, + "Paradise Vulp" = MATRIX_Vulp_Colorblind, + "Paradise Taj" = MATRIX_Taj_Colorblind + ) + +/obj/screen/plane_master/colorblindness/alter_plane_values(var/variety = null) + var/new_matrix = varieties[variety] + if(!new_matrix) return + + color = new_matrix + +/obj/screen/plane_master/colorblindness/proc/debug_variety() + var/choice = input(usr,"Pick a type of colorblindness","Which?") as null|anything in varieties + if(choice) + color = varieties[choice] + +/obj/screen/plane_master/colorblindness/items + plane = PLANE_PLAYER_HUD_ITEMS + sub_planes = null diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index a96524f1f1b..1852d3ef617 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -251,7 +251,7 @@ update_icon = TRUE if(update_icon) - mannequin.update_icons() + mannequin.update_icons_all() /datum/preferences/proc/update_preview_icon() var/mob/living/carbon/human/dummy/mannequin/mannequin = get_mannequin(client_ckey) diff --git a/code/modules/mob/update_icons.dm b/code/modules/mob/update_icons.dm index ceca667c39c..3eab4b967fb 100644 --- a/code/modules/mob/update_icons.dm +++ b/code/modules/mob/update_icons.dm @@ -7,6 +7,25 @@ /mob/proc/update_icons() return +/mob/proc/update_icons_layers(var/update_icons = TRUE) + if(update_icons) + update_icons() + +/mob/proc/update_icons_huds(var/update_icons = TRUE) + if(update_icons) + update_icons() + +/mob/proc/update_icons_body(var/update_icons = TRUE) + if(update_icons) + update_icons() + +/mob/proc/update_icons_all() + update_icons_huds(FALSE) + update_icons_body(FALSE) + update_icons_layers(FALSE) + + update_icons() + /mob/proc/update_hud() return diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index 230ac334772..a3f0d4bba87 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -93,11 +93,11 @@ var/const/CE_STABLE_THRESHOLD = 0.5 if(blood_volume >= BLOOD_VOLUME_SAFE) if(pale) pale = 0 - update_body() + update_icons_body() else if(blood_volume >= BLOOD_VOLUME_OKAY) if(!pale) pale = 1 - update_body() + update_icons_body() var/word = pick("dizzy","woosey","faint") src << "You feel [word]" if(prob(1)) @@ -108,7 +108,7 @@ var/const/CE_STABLE_THRESHOLD = 0.5 else if(blood_volume >= BLOOD_VOLUME_BAD) if(!pale) pale = 1 - update_body() + update_icons_body() eye_blurry = max(eye_blurry,6) if(getOxyLoss() < 50 * threshold_coef) adjustOxyLoss(10 * dmg_coef) @@ -126,7 +126,7 @@ var/const/CE_STABLE_THRESHOLD = 0.5 else //Not enough blood to survive (usually) if(!pale) pale = 1 - update_body() + update_icons_body() eye_blurry = max(eye_blurry,6) Paralyse(3) adjustToxLoss(3 * dmg_coef) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 17d1025fdea..3b7c31e512c 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -673,7 +673,7 @@ Note that amputating the affected organ does in fact remove the infection from t if (!(status & ORGAN_DEAD)) status |= ORGAN_DEAD owner << "You can't feel your [name] anymore..." - owner.update_body(1) + owner.update_icons_body() for (var/obj/item/organ/external/child in children) child.germ_level += 110 //Burst of infection from a parent organ becoming necrotic @@ -1110,11 +1110,11 @@ Note that amputating the affected organ does in fact remove the infection from t if(src.robotic >= ORGAN_ROBOT) return src.status |= ORGAN_MUTATED - if(owner) owner.update_body() + if(owner) owner.update_icons_body() /obj/item/organ/external/proc/unmutate() src.status &= ~ORGAN_MUTATED - if(owner) owner.update_body() + if(owner) owner.update_icons_body() /obj/item/organ/external/proc/get_damage() //returns total damage return (brute_dam+burn_dam) //could use max_damage? @@ -1201,7 +1201,7 @@ Note that amputating the affected organ does in fact remove the infection from t qdel(spark_system) qdel(src) - victim.update_body() + victim.update_icons_body() /obj/item/organ/external/proc/disfigure(var/type = "brute") if (disfigured) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index bdea8fed709..172d9698b17 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -169,7 +169,7 @@ if(H == user) user << "You wipe off the lipstick with [src]." H.lip_style = null - H.update_body() + H.update_icons_body() else user.visible_message("[user] begins to wipe [H]'s lipstick off with \the [src].", \ "You begin to wipe off [H]'s lipstick.") @@ -177,7 +177,7 @@ user.visible_message("[user] wipes [H]'s lipstick off with \the [src].", \ "You wipe off [H]'s lipstick.") H.lip_style = null - H.update_body() + H.update_icons_body() /obj/item/weapon/paper/proc/addtofield(var/id, var/text, var/links = 0) var/locid = 0 @@ -448,13 +448,13 @@ else if (h_user.l_store == src) h_user.drop_from_inventory(src) B.loc = h_user - B.layer = 20 + B.hud_layerise() h_user.l_store = B h_user.update_inv_pockets() else if (h_user.r_store == src) h_user.drop_from_inventory(src) B.loc = h_user - B.layer = 20 + B.hud_layerise() h_user.r_store = B h_user.update_inv_pockets() else if (h_user.head == src) diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 19a7e0498d0..c8b78cfd654 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -131,6 +131,7 @@ var/global/photo_count = 0 var/icon_on = "camera" var/icon_off = "camera_off" var/size = 3 + var/picture_planes = list(PLANE_WORLD) /obj/item/device/camera/verb/change_size() set name = "Set Photo Focus" @@ -181,6 +182,7 @@ var/global/photo_count = 0 // As well as anything that isn't invisible. for(var/atom/A in the_turf) if(A.invisibility) continue + if(!(A.plane in picture_planes)) continue atoms.Add(A) // Sort the atoms into their layers @@ -189,7 +191,7 @@ var/global/photo_count = 0 for(var/i; i <= sorted.len; i++) var/atom/A = sorted[i] if(A) - var/icon/img = getFlatIcon(A)//build_composite_icon(A) + var/icon/img = getFlatIcon(A, picture_planes = picture_planes)//build_composite_icon(A) // If what we got back is actually a picture, draw it. if(istype(img, /icon)) diff --git a/code/modules/projectiles/projectile/energy.dm b/code/modules/projectiles/projectile/energy.dm index dbc54fc4325..d3bc093cacb 100644 --- a/code/modules/projectiles/projectile/energy.dm +++ b/code/modules/projectiles/projectile/energy.dm @@ -178,7 +178,7 @@ else if (M.ear_damage >= 5) to_chat(M, "Your ears start to ring!") - M.update_icons() + M.update_icons() //Just to apply matrix transform for laying asap /obj/item/projectile/energy/plasmastun/on_hit(var/atom/target) bang(target) diff --git a/code/modules/surgery/limb_reattach.dm b/code/modules/surgery/limb_reattach.dm index c57248da0fc..df1f24eec2f 100644 --- a/code/modules/surgery/limb_reattach.dm +++ b/code/modules/surgery/limb_reattach.dm @@ -57,7 +57,7 @@ "You have attached [target]'s [E.name] to the [E.amputation_point].") user.drop_from_inventory(E) E.replaced(target) - target.update_body() + target.update_icons_body(FALSE) target.updatehealth() target.UpdateDamageIcon() @@ -99,7 +99,7 @@ if(E.children) for(var/obj/item/organ/external/C in E.children) C.status &= ~ORGAN_DESTROYED - target.update_body() + target.update_icons_body(FALSE) target.updatehealth() target.UpdateDamageIcon() @@ -149,7 +149,7 @@ if(L.sabotaged) new_limb.sabotaged = 1 - target.update_body() + target.update_icons_body(FALSE) target.updatehealth() target.UpdateDamageIcon() diff --git a/code/modules/surgery/other.dm b/code/modules/surgery/other.dm index ab18e302c34..ef9357168cf 100644 --- a/code/modules/surgery/other.dm +++ b/code/modules/surgery/other.dm @@ -110,7 +110,7 @@ var/trans = container.reagents.trans_to_mob(target, container.amount_per_transfer_from_this, CHEM_BLOOD) //technically it's contact, but the reagents are being applied to internal tissue if (trans > 0) affected.status &= ~ORGAN_DEAD - affected.owner.update_body(1) + affected.owner.update_icons_body() user.visible_message("[user] applies [trans] units of the solution to affected tissue in [target]'s [affected.name].", \ "You apply [trans] units of the solution to affected tissue in [target]'s [affected.name] with \the [tool].") diff --git a/code/modules/virus2/effect.dm b/code/modules/virus2/effect.dm index b0947e94a60..d24069ca5fa 100644 --- a/code/modules/virus2/effect.dm +++ b/code/modules/virus2/effect.dm @@ -157,7 +157,7 @@ H << "You can't feel your [E.name] anymore..." for (var/obj/item/organ/external/C in E.children) C.status |= ORGAN_DEAD - H.update_body(1) + H.update_icons_body() mob.adjustToxLoss(15*multiplier) deactivate(var/mob/living/carbon/mob,var/multiplier) @@ -167,7 +167,7 @@ E.status &= ~ORGAN_DEAD for (var/obj/item/organ/external/C in E.children) C.status &= ~ORGAN_DEAD - H.update_body(1) + H.update_icons_body() /datum/disease2/effect/immortal name = "Longevity Syndrome" diff --git a/icons/misc/win32.dmi b/icons/misc/win32.dmi new file mode 100644 index 0000000000000000000000000000000000000000..bae0df09ee48bf755b64cca338b6b655918f828a GIT binary patch literal 196 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnL3?x0byx0z;m;-!5Tt9sHuzP>(Y9KeIDkP%B zCAB!YD6^m>Ge3`kp<+&OSV2+g_b^4^2yh7rH$&*Ju+FoaTTQ^JK(+T^vI=W+o>{+yU|yFfcxq_Fo5NF?hQAxvX