diff --git a/code/__DEFINES/atom_hud.dm b/code/__DEFINES/atom_hud.dm index 067d3487399..a105e119847 100644 --- a/code/__DEFINES/atom_hud.dm +++ b/code/__DEFINES/atom_hud.dm @@ -68,15 +68,14 @@ #define DATA_HUD_SECURITY_ADVANCED 2 #define DATA_HUD_MEDICAL_BASIC 3 #define DATA_HUD_MEDICAL_ADVANCED 4 -#define DATA_HUD_DIAGNOSTIC_BASIC 5 -#define DATA_HUD_DIAGNOSTIC_ADVANCED 6 +#define DATA_HUD_DIAGNOSTIC 5 +#define DATA_HUD_BOT_PATH 6 #define DATA_HUD_ABDUCTOR 7 #define DATA_HUD_SENTIENT_DISEASE 8 #define DATA_HUD_AI_DETECT 9 #define DATA_HUD_FAN 10 #define DATA_HUD_MALF_APC 11 #define DATA_HUD_PERMIT 12 //SKYRAT EDIT -#define DATA_HUD_DNR 13 // SKYRAT EDIT /// cooldown for being shown the images for any particular data hud #define ADD_HUD_TO_COOLDOWN 20 diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index 84c564a3304..428b9b26443 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -336,6 +336,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_SECURITY_HUD "sec_hud" /// for something granting you a diagnostic hud #define TRAIT_DIAGNOSTIC_HUD "diag_hud" +#define TRAIT_BOT_PATH_HUD "bot_path_hud" /// Is a medbot healing you #define TRAIT_MEDIBOTCOMINGTHROUGH "medbot" #define TRAIT_PASSTABLE "passtable" diff --git a/code/__DEFINES/~skyrat_defines/traits.dm b/code/__DEFINES/~skyrat_defines/traits.dm index 3a9a180fbee..116ad7e5fb2 100644 --- a/code/__DEFINES/~skyrat_defines/traits.dm +++ b/code/__DEFINES/~skyrat_defines/traits.dm @@ -3,4 +3,5 @@ #define SLIPPERY_MIN 5 /// The maximum amount of tiles a TRAIT_SLIPPERY haver will slide on slip #define SLIPPERY_MAX 9 - +/// Permit hud clothing trait +#define TRAIT_PERMIT_HUD "permit_hud" diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index 5a6965c03b7..1d442e72cda 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -196,6 +196,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_DETECTIVES_TASTE" = TRAIT_DETECTIVES_TASTE, "TRAIT_DETECT_STORM" = TRAIT_DETECT_STORM, "TRAIT_DIAGNOSTIC_HUD" = TRAIT_DIAGNOSTIC_HUD, + "TRAIT_BOT_PATH_HUD" = TRAIT_BOT_PATH_HUD, "TRAIT_DISCOORDINATED_TOOL_USER" = TRAIT_DISCOORDINATED_TOOL_USER, "TRAIT_DISEASELIKE_SEVERITY_MEDIUM" = TRAIT_DISEASELIKE_SEVERITY_MEDIUM, "TRAIT_DISFIGURED" = TRAIT_DISFIGURED, @@ -703,6 +704,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_PERSONALSPACE" = TRAIT_PERSONALSPACE, "TRAIT_QUICKREFLEXES" = TRAIT_QUICKREFLEXES, "TRAIT_PET_OWNER" = TRAIT_PET_OWNER, + "TRAIT_PERMIT_HUD" = TRAIT_PERMIT_HUD, "TRAIT_R_UNIQUEWRECK" = TRAIT_R_UNIQUEWRECK, "TRAIT_R_UNIQUETIP" = TRAIT_R_UNIQUETIP, "TRAIT_R_WIDE" = TRAIT_R_WIDE, diff --git a/code/_globalvars/traits/admin_tooling.dm b/code/_globalvars/traits/admin_tooling.dm index dcc92e0c935..8be2556d08e 100644 --- a/code/_globalvars/traits/admin_tooling.dm +++ b/code/_globalvars/traits/admin_tooling.dm @@ -60,6 +60,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list( "TRAIT_DEFIB_BLACKLISTED" = TRAIT_DEFIB_BLACKLISTED, "TRAIT_DEPRESSION" = TRAIT_DEPRESSION, "TRAIT_DIAGNOSTIC_HUD" = TRAIT_DIAGNOSTIC_HUD, + "TRAIT_BOT_PATH_HUD" = TRAIT_BOT_PATH_HUD, "TRAIT_DISCOORDINATED_TOOL_USER" = TRAIT_DISCOORDINATED_TOOL_USER, "TRAIT_DISFIGURED" = TRAIT_DISFIGURED, "TRAIT_DISK_VERIFIER" = TRAIT_DISK_VERIFIER, @@ -333,6 +334,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list( "TRAIT_NORUNNING" = TRAIT_NORUNNING, "TRAIT_OVERSIZED" = TRAIT_OVERSIZED, "TRAIT_OXYIMMUNE" = TRAIT_OXYIMMUNE, + "TRAIT_PERMIT_HUD" = TRAIT_PERMIT_HUD, "TRAIT_PERSONALSPACE" = TRAIT_PERSONALSPACE, "TRAIT_QUICKREFLEXES" = TRAIT_QUICKREFLEXES, "TRAIT_PET_OWNER" = TRAIT_PET_OWNER, diff --git a/code/datums/elements/digitalcamo.dm b/code/datums/elements/digitalcamo.dm index 3f4db60de2d..b8a9fa673e3 100644 --- a/code/datums/elements/digitalcamo.dm +++ b/code/datums/elements/digitalcamo.dm @@ -27,17 +27,15 @@ /datum/element/digitalcamo/proc/HideFromAIHuds(mob/living/target) for(var/mob/living/silicon/ai/AI in GLOB.ai_list) - var/datum/atom_hud/M = GLOB.huds[AI.med_hud] - M.hide_single_atomhud_from(AI,target) - var/datum/atom_hud/S = GLOB.huds[AI.sec_hud] - S.hide_single_atomhud_from(AI,target) + for (var/hud_type in AI.silicon_huds) + var/datum/atom_hud/silicon_hud = GLOB.huds[hud_type] + silicon_hud.hide_single_atomhud_from(AI,target) /datum/element/digitalcamo/proc/UnhideFromAIHuds(mob/living/target) for(var/mob/living/silicon/ai/AI in GLOB.ai_list) - var/datum/atom_hud/M = GLOB.huds[AI.med_hud] - M.unhide_single_atomhud_from(AI,target) - var/datum/atom_hud/S = GLOB.huds[AI.sec_hud] - S.unhide_single_atomhud_from(AI,target) + for (var/hud_type in AI.silicon_huds) + var/datum/atom_hud/silicon_hud = GLOB.huds[hud_type] + silicon_hud.unhide_single_atomhud_from(AI,target) /datum/element/digitalcamo/proc/on_examine(datum/source, mob/M) SIGNAL_HANDLER diff --git a/code/datums/hud.dm b/code/datums/hud.dm index b69b9f40015..4537a4ada7e 100644 --- a/code/datums/hud.dm +++ b/code/datums/hud.dm @@ -8,19 +8,26 @@ GLOBAL_LIST_EMPTY(huds_by_category) //GLOBAL HUD LIST GLOBAL_LIST_INIT(huds, list( - DATA_HUD_SECURITY_BASIC = new/datum/atom_hud/data/human/security/basic(), - DATA_HUD_SECURITY_ADVANCED = new/datum/atom_hud/data/human/security/advanced(), - DATA_HUD_MEDICAL_BASIC = new/datum/atom_hud/data/human/medical/basic(), - DATA_HUD_MEDICAL_ADVANCED = new/datum/atom_hud/data/human/medical/advanced(), - DATA_HUD_DIAGNOSTIC_BASIC = new/datum/atom_hud/data/diagnostic/basic(), - DATA_HUD_DIAGNOSTIC_ADVANCED = new/datum/atom_hud/data/diagnostic/advanced(), - DATA_HUD_ABDUCTOR = new/datum/atom_hud/abductor(), - DATA_HUD_SENTIENT_DISEASE = new/datum/atom_hud/sentient_disease(), - DATA_HUD_AI_DETECT = new/datum/atom_hud/ai_detector(), - DATA_HUD_FAN = new/datum/atom_hud/data/human/fan_hud(), - DATA_HUD_MALF_APC = new/datum/atom_hud/data/malf_apc(), + DATA_HUD_SECURITY_BASIC = new /datum/atom_hud/data/human/security/basic(), + DATA_HUD_SECURITY_ADVANCED = new /datum/atom_hud/data/human/security/advanced(), + DATA_HUD_MEDICAL_BASIC = new /datum/atom_hud/data/human/medical/basic(), + DATA_HUD_MEDICAL_ADVANCED = new /datum/atom_hud/data/human/medical/advanced(), + DATA_HUD_DIAGNOSTIC = new /datum/atom_hud/data/diagnostic(), + DATA_HUD_BOT_PATH = new /datum/atom_hud/data/bot_path(), + DATA_HUD_ABDUCTOR = new /datum/atom_hud/abductor(), + DATA_HUD_SENTIENT_DISEASE = new /datum/atom_hud/sentient_disease(), + DATA_HUD_AI_DETECT = new /datum/atom_hud/ai_detector(), + DATA_HUD_FAN = new /datum/atom_hud/data/human/fan_hud(), + DATA_HUD_MALF_APC = new /datum/atom_hud/data/malf_apc(), DATA_HUD_PERMIT = new/datum/atom_hud/data/human/permit(), // SKYRAT EDIT ADDITION - DATA_HUD_DNR = new/datum/atom_hud/data/human/dnr(), // SKYRAT EDIT ADDITION +)) + +GLOBAL_LIST_INIT(trait_to_hud, list( + TRAIT_SECURITY_HUD = DATA_HUD_SECURITY_ADVANCED, + TRAIT_MEDICAL_HUD = DATA_HUD_MEDICAL_ADVANCED, + TRAIT_DIAGNOSTIC_HUD = DATA_HUD_DIAGNOSTIC, + TRAIT_BOT_PATH_HUD = DATA_HUD_BOT_PATH, // SKYRAT EDIT CHANGE + TRAIT_PERMIT_HUD = DATA_HUD_PERMIT, // SKYRAT EDIT ADDITION )) /datum/atom_hud diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index 4a36b89d384..c24f6156a61 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -53,18 +53,14 @@ hud_icons = list(FAN_HUD) /datum/atom_hud/data/diagnostic - -/datum/atom_hud/data/diagnostic/basic hud_icons = list(DIAG_HUD, DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_MECH_HUD, DIAG_BOT_HUD, DIAG_TRACK_HUD, DIAG_CAMERA_HUD, DIAG_AIRLOCK_HUD, DIAG_LAUNCHPAD_HUD) -/datum/atom_hud/data/diagnostic/advanced - hud_icons = list(DIAG_HUD, DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_MECH_HUD, DIAG_BOT_HUD, DIAG_TRACK_HUD, DIAG_CAMERA_HUD, DIAG_AIRLOCK_HUD, DIAG_LAUNCHPAD_HUD, DIAG_PATH_HUD) - /datum/atom_hud/data/bot_path - // This hud exists so the bot can see itself, that's all - uses_global_hud_category = FALSE hud_icons = list(DIAG_PATH_HUD) +/datum/atom_hud/data/bot_path/private + uses_global_hud_category = FALSE + /datum/atom_hud/abductor hud_icons = list(GLAND_HUD) diff --git a/code/game/objects/items/busts_and_figurines.dm b/code/game/objects/items/busts_and_figurines.dm index afc4a58334e..53af3228ffd 100644 --- a/code/game/objects/items/busts_and_figurines.dm +++ b/code/game/objects/items/busts_and_figurines.dm @@ -50,16 +50,12 @@ ..() if(!(slot & ITEM_SLOT_HANDS)) return - var/datum/atom_hud/our_hud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] - our_hud.show_to(user) ADD_TRAIT(user, TRAIT_MEDICAL_HUD, type) /obj/item/statuebust/hippocratic/dropped(mob/living/carbon/human/user) ..() if(HAS_TRAIT_NOT_FROM(user, TRAIT_MEDICAL_HUD, type)) return - var/datum/atom_hud/our_hud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] - our_hud.hide_from(user) REMOVE_TRAIT(user, TRAIT_MEDICAL_HUD, type) /obj/item/statuebust/hippocratic/attack_self(mob/user) diff --git a/code/modules/admin/verbs/admingame.dm b/code/modules/admin/verbs/admingame.dm index fd339a1e098..d537b9ee898 100644 --- a/code/modules/admin/verbs/admingame.dm +++ b/code/modules/admin/verbs/admingame.dm @@ -379,7 +379,7 @@ ADMIN_VERB(combo_hud, R_ADMIN, "Toggle Combo HUD", "Toggles the Admin Combo HUD. combo_hud_enabled = TRUE - for (var/hudtype in list(DATA_HUD_SECURITY_ADVANCED, DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC_ADVANCED)) + for (var/hudtype in list(DATA_HUD_SECURITY_ADVANCED, DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC, DATA_HUD_BOT_PATH)) var/datum/atom_hud/atom_hud = GLOB.huds[hudtype] atom_hud.show_to(mob) @@ -395,7 +395,7 @@ ADMIN_VERB(combo_hud, R_ADMIN, "Toggle Combo HUD", "Toggles the Admin Combo HUD. combo_hud_enabled = FALSE - for (var/hudtype in list(DATA_HUD_SECURITY_ADVANCED, DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC_ADVANCED)) + for (var/hudtype in list(DATA_HUD_SECURITY_ADVANCED, DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC, DATA_HUD_BOT_PATH)) var/datum/atom_hud/atom_hud = GLOB.huds[hudtype] atom_hud.hide_from(mob) diff --git a/code/modules/antagonists/nukeop/equipment/overwatch_tools.dm b/code/modules/antagonists/nukeop/equipment/overwatch_tools.dm index 6c409f06370..94c16d86dbe 100644 --- a/code/modules/antagonists/nukeop/equipment/overwatch_tools.dm +++ b/code/modules/antagonists/nukeop/equipment/overwatch_tools.dm @@ -42,23 +42,4 @@ Happy hunting! icon_state = "sunhudmed" flags_cover = GLASSESCOVERSEYES flash_protect = FLASH_PROTECTION_WELDER - clothing_traits = list(TRAIT_REAGENT_SCANNER) - var/list/hudlist = list(DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC_ADVANCED, DATA_HUD_SECURITY_ADVANCED) - -/obj/item/clothing/glasses/overwatch/equipped(mob/user, slot) - . = ..() - if(!(slot & ITEM_SLOT_EYES) || !ishuman(user)) - return - for(var/hud in hudlist) - var/datum/atom_hud/our_hud = GLOB.huds[hud] - our_hud.show_to(user) - user.add_traits(list(TRAIT_MEDICAL_HUD, TRAIT_SECURITY_HUD, TRAIT_DIAGNOSTIC_HUD), GLASSES_TRAIT) - -/obj/item/clothing/glasses/overwatch/dropped(mob/user) - . = ..() - user.remove_traits(list(TRAIT_MEDICAL_HUD, TRAIT_SECURITY_HUD, TRAIT_DIAGNOSTIC_HUD), GLASSES_TRAIT) - if(!ishuman(user)) - return - for(var/hud in hudlist) - var/datum/atom_hud/our_hud = GLOB.huds[hud] - our_hud.hide_from(user) + clothing_traits = list(TRAIT_REAGENT_SCANNER, TRAIT_SECURITY_HUD, TRAIT_MEDICAL_HUD, TRAIT_DIAGNOSTIC_HUD) diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index 6e4a7274563..1c90176bc9e 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -618,7 +618,7 @@ glass_colour_type = FALSE vision_flags = SEE_TURFS clothing_traits = list(TRAIT_REAGENT_SCANNER, TRAIT_MADNESS_IMMUNE) - var/list/hudlist = list(DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC_ADVANCED, DATA_HUD_SECURITY_ADVANCED) + var/list/hudlist = list(DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC, DATA_HUD_SECURITY_ADVANCED, DATA_HUD_BOT_PATH) var/xray = FALSE /obj/item/clothing/glasses/debug/equipped(mob/user, slot) diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index f82f56a48fb..dc35ab1dbf4 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -2,26 +2,6 @@ name = "HUD" desc = "A heads-up display that provides important info in (almost) real time." flags_1 = null //doesn't protect eyes because it's a monocle, duh - ///A list of atom hud types added to the mob when the glasses are worn on the appropriate slot. - var/list/hud_types - - // NOTE: Just because you have a HUD display doesn't mean you should be able to interact with stuff on examine, that's where the associated trait (TRAIT_MEDICAL_HUD, TRAIT_SECURITY_HUD, etc) is necessary. - -/obj/item/clothing/glasses/hud/equipped(mob/living/carbon/human/user, slot) - ..() - if(!(slot & ITEM_SLOT_EYES)) - return - for(var/hud_type in hud_types) - var/datum/atom_hud/our_hud = GLOB.huds[hud_type] - our_hud.show_to(user) - -/obj/item/clothing/glasses/hud/dropped(mob/living/carbon/human/user) - ..() - if(!istype(user) || user.glasses != src) - return - for(var/hud_type in hud_types) - var/datum/atom_hud/our_hud = GLOB.huds[hud_type] - our_hud.hide_from(user) /obj/item/clothing/glasses/hud/emp_act(severity) . = ..() @@ -56,7 +36,6 @@ name = "health scanner HUD" desc = "A heads-up display that scans the humanoids in view and provides accurate data about their health status." icon_state = "healthhud" - hud_types = list(DATA_HUD_MEDICAL_ADVANCED) clothing_traits = list(TRAIT_MEDICAL_HUD) glass_colour_type = /datum/client_colour/glass_colour/lightblue @@ -64,7 +43,6 @@ name = "health scanner security HUD" desc = "A heads-up display that scans the humanoids in view and provides accurate data about their health status, ID status and security records." icon_state = "medsechud" - hud_types = list(DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_SECURITY_ADVANCED) clothing_traits = list(TRAIT_MEDICAL_HUD, TRAIT_SECURITY_HUD) /obj/item/clothing/glasses/hud/health/night @@ -118,7 +96,6 @@ name = "diagnostic HUD" desc = "A heads-up display capable of analyzing the integrity and status of robotics and exosuits." icon_state = "diagnostichud" - hud_types = list(DATA_HUD_DIAGNOSTIC_BASIC) clothing_traits = list(TRAIT_DIAGNOSTIC_HUD) glass_colour_type = /datum/client_colour/glass_colour/lightorange @@ -161,7 +138,6 @@ name = "security HUD" desc = "A heads-up display that scans the humanoids in view and provides accurate data about their ID status and security records." icon_state = "securityhud" - hud_types = list(DATA_HUD_SECURITY_ADVANCED) clothing_traits = list(TRAIT_SECURITY_HUD) glass_colour_type = /datum/client_colour/glass_colour/red @@ -251,20 +227,18 @@ if (wearer.glasses != src) return - for(var/hud_type in hud_types) - var/datum/atom_hud/our_hud = GLOB.huds[hud_type] - our_hud.hide_from(user) + for(var/trait in clothing_traits) + REMOVE_CLOTHING_TRAIT(user, trait) - if (DATA_HUD_MEDICAL_ADVANCED in hud_types) - hud_types = null - else if (DATA_HUD_SECURITY_ADVANCED in hud_types) - hud_types = list(DATA_HUD_MEDICAL_ADVANCED) + if (TRAIT_MEDICAL_HUD in clothing_traits) + clothing_traits = null + else if (TRAIT_SECURITY_HUD in clothing_traits) + clothing_traits = list(TRAIT_MEDICAL_HUD) else - hud_types = list(DATA_HUD_SECURITY_ADVANCED) + clothing_traits = list(TRAIT_SECURITY_HUD) - for(var/hud_type in hud_types) - var/datum/atom_hud/our_hud = GLOB.huds[hud_type] - our_hud.show_to(user) + for(var/trait in clothing_traits) + ADD_CLOTHING_TRAIT(user, trait) /datum/action/item_action/switch_hud name = "Switch HUD" @@ -273,20 +247,22 @@ name = "thermal HUD scanner" desc = "Thermal imaging HUD in the shape of glasses." icon_state = "thermal" - hud_types = list(DATA_HUD_SECURITY_ADVANCED) vision_flags = SEE_MOBS color_cutoffs = list(25, 8, 5) glass_colour_type = /datum/client_colour/glass_colour/red + clothing_traits = list(TRAIT_SECURITY_HUD) /obj/item/clothing/glasses/hud/toggle/thermal/attack_self(mob/user) ..() - var/hud_type = hud_types[1] + var/hud_type + if (!isnull(clothing_traits) && clothing_traits.len) + hud_type = clothing_traits[1] switch (hud_type) - if (DATA_HUD_MEDICAL_ADVANCED) + if (TRAIT_MEDICAL_HUD) icon_state = "meson" color_cutoffs = list(5, 15, 5) change_glass_color(/datum/client_colour/glass_colour/green) - if (DATA_HUD_SECURITY_ADVANCED) + if (TRAIT_SECURITY_HUD) icon_state = "thermal" color_cutoffs = list(25, 8, 5) change_glass_color(/datum/client_colour/glass_colour/red) diff --git a/code/modules/clothing/suits/ablativecoat.dm b/code/modules/clothing/suits/ablativecoat.dm index 8bc37aaba22..32233f23400 100644 --- a/code/modules/clothing/suits/ablativecoat.dm +++ b/code/modules/clothing/suits/ablativecoat.dm @@ -50,15 +50,11 @@ /obj/item/clothing/suit/hooded/ablative/on_hood_up(obj/item/clothing/head/hooded/hood) . = ..() var/mob/living/carbon/user = loc - var/datum/atom_hud/hud = GLOB.huds[DATA_HUD_SECURITY_ADVANCED] ADD_TRAIT(user, TRAIT_SECURITY_HUD, HELMET_TRAIT) - hud.show_to(user) balloon_alert(user, "hud enabled") /obj/item/clothing/suit/hooded/ablative/on_hood_down(obj/item/clothing/head/hooded/hood) var/mob/living/carbon/user = loc - var/datum/atom_hud/sec_hud = GLOB.huds[DATA_HUD_SECURITY_ADVANCED] REMOVE_TRAIT(user, TRAIT_SECURITY_HUD, HELMET_TRAIT) - sec_hud.hide_from(user) balloon_alert(user, "hud disabled") return ..() diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 7f38332aa7a..b952f107612 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -36,7 +36,6 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) var/health_scan = FALSE //Are health scans currently enabled? var/chem_scan = FALSE //Are chem scans currently enabled? var/gas_scan = FALSE //Are gas scans currently enabled? - var/list/datahuds = list(DATA_HUD_SECURITY_ADVANCED, DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC_ADVANCED) //list of data HUDs shown to ghosts. var/ghost_orbit = GHOST_ORBIT_CIRCLE //These variables store hair data if the ghost originates from a species with head and/or facial hair. @@ -63,6 +62,13 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) /// The POI we're orbiting (orbit menu) var/orbiting_ref + var/static/list/observer_hud_traits = list( + TRAIT_SECURITY_HUD, + TRAIT_MEDICAL_HUD, + TRAIT_DIAGNOSTIC_HUD, + TRAIT_BOT_PATH_HUD + ) + /mob/dead/observer/Initialize(mapload) set_invisibility(GLOB.observer_default_invisibility) @@ -149,7 +155,6 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) SSpoints_of_interest.make_point_of_interest(src) ADD_TRAIT(src, TRAIT_HEAR_THROUGH_DARKNESS, ref(src)) - ADD_TRAIT(src, TRAIT_SECURITY_HUD, ref(src)) /mob/dead/observer/get_photo_description(obj/item/camera/camera) if(!invisibility || camera.see_ghosts) @@ -774,14 +779,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp return /mob/dead/observer/proc/show_data_huds() - for(var/hudtype in datahuds) - var/datum/atom_hud/data_hud = GLOB.huds[hudtype] - data_hud.show_to(src) + add_traits(observer_hud_traits, REF(src)) /mob/dead/observer/proc/remove_data_huds() - for(var/hudtype in datahuds) - var/datum/atom_hud/data_hud = GLOB.huds[hudtype] - data_hud.hide_from(src) + remove_traits(observer_hud_traits, REF(src)) /mob/dead/observer/verb/toggle_data_huds() set name = "Toggle Sec/Med/Diag HUD" diff --git a/code/modules/mob/living/basic/bots/_bots.dm b/code/modules/mob/living/basic/bots/_bots.dm index aad840aa185..9f2b915944b 100644 --- a/code/modules/mob/living/basic/bots/_bots.dm +++ b/code/modules/mob/living/basic/bots/_bots.dm @@ -88,7 +88,7 @@ GLOBAL_LIST_INIT(command_strings, list( var/list/current_pathed_turfs = list() ///The type of data HUD the bot uses. Diagnostic by default. - var/data_hud_type = DATA_HUD_DIAGNOSTIC_BASIC + var/data_hud_type = DATA_HUD_DIAGNOSTIC /// If true we will allow ghosts to control this mob var/can_be_possessed = FALSE /// Message to display upon possession diff --git a/code/modules/mob/living/basic/bots/bot_hud.dm b/code/modules/mob/living/basic/bots/bot_hud.dm index cbadab01360..61aee9f10b1 100644 --- a/code/modules/mob/living/basic/bots/bot_hud.dm +++ b/code/modules/mob/living/basic/bots/bot_hud.dm @@ -52,7 +52,7 @@ var/list/path_images = active_hud_list[DIAG_PATH_HUD] LAZYCLEARLIST(path_images) - var/list/path_huds_watching_me = list(GLOB.huds[DATA_HUD_DIAGNOSTIC_ADVANCED]) + var/list/path_huds_watching_me = list(GLOB.huds[DATA_HUD_DIAGNOSTIC], GLOB.huds[DATA_HUD_BOT_PATH]) var/atom/move_target = ai_controller.current_movement_target if(move_target != ai_controller.blackboard[BB_BEACON_TARGET]) diff --git a/code/modules/mob/living/basic/bots/vibebot/vibebot.dm b/code/modules/mob/living/basic/bots/vibebot/vibebot.dm index c872e1ea595..c8e2d713623 100644 --- a/code/modules/mob/living/basic/bots/vibebot/vibebot.dm +++ b/code/modules/mob/living/basic/bots/vibebot/vibebot.dm @@ -14,7 +14,7 @@ radio_key = /obj/item/encryptionkey/headset_service radio_channel = RADIO_CHANNEL_SERVICE bot_type = VIBE_BOT - data_hud_type = DATA_HUD_DIAGNOSTIC_BASIC + data_hud_type = DATA_HUD_DIAGNOSTIC path_image_color = "#2cac12" possessed_message = "You are a vibebot! Maintain the station's vibes to the best of your ability!" diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 9f8649e1187..d5d4273f1be 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -11,9 +11,7 @@ combat_mode = TRUE //so we always get pushed instead of trying to swap sight = SEE_TURFS | SEE_MOBS | SEE_OBJS hud_type = /datum/hud/ai - med_hud = DATA_HUD_MEDICAL_BASIC - sec_hud = DATA_HUD_SECURITY_BASIC - d_hud = DATA_HUD_DIAGNOSTIC_ADVANCED + silicon_huds = list(DATA_HUD_MEDICAL_BASIC, DATA_HUD_SECURITY_BASIC, DATA_HUD_DIAGNOSTIC, DATA_HUD_BOT_PATH) mob_size = MOB_SIZE_LARGE radio = /obj/item/radio/headset/silicon/ai can_buckle_to = FALSE diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index cde99e84c1f..69703a022d0 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -38,9 +38,7 @@ ///Are our siliconHUDs on? TRUE for yes, FALSE for no. var/sensors_on = TRUE - var/med_hud = DATA_HUD_MEDICAL_ADVANCED //Determines the med hud to use - var/sec_hud = DATA_HUD_SECURITY_ADVANCED //Determines the sec hud to use - var/d_hud = DATA_HUD_DIAGNOSTIC_BASIC //Determines the diag hud to use + var/list/silicon_huds = list(DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_SECURITY_ADVANCED, DATA_HUD_DIAGNOSTIC) var/law_change_counter = 0 var/obj/machinery/camera/builtInCamera = null @@ -392,20 +390,14 @@ return -10 /mob/living/silicon/proc/remove_sensors() - var/datum/atom_hud/secsensor = GLOB.huds[sec_hud] - var/datum/atom_hud/medsensor = GLOB.huds[med_hud] - var/datum/atom_hud/diagsensor = GLOB.huds[d_hud] - secsensor.hide_from(src) - medsensor.hide_from(src) - diagsensor.hide_from(src) + for (var/hud_type in silicon_huds) + var/datum/atom_hud/silicon_hud = GLOB.huds[hud_type] + silicon_hud.hide_from(src) /mob/living/silicon/proc/add_sensors() - var/datum/atom_hud/secsensor = GLOB.huds[sec_hud] - var/datum/atom_hud/medsensor = GLOB.huds[med_hud] - var/datum/atom_hud/diagsensor = GLOB.huds[d_hud] - secsensor.show_to(src) - medsensor.show_to(src) - diagsensor.show_to(src) + for (var/hud_type in silicon_huds) + var/datum/atom_hud/silicon_hud = GLOB.huds[hud_type] + silicon_hud.show_to(src) /mob/living/silicon/proc/toggle_sensors() if(incapacitated()) diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 50b30b09aa8..c483d371e1a 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -95,8 +95,8 @@ var/turf/nearest_beacon_loc ///The type of data HUD the bot uses. Diagnostic by default. - var/data_hud_type = DATA_HUD_DIAGNOSTIC_BASIC - var/datum/atom_hud/data/bot_path/path_hud + var/data_hud_type = DATA_HUD_DIAGNOSTIC + var/datum/atom_hud/data/bot_path/private/path_hud var/path_image_icon = 'icons/mob/silicon/aibots.dmi' var/path_image_icon_state = "path_indicator" var/path_image_color = COLOR_WHITE @@ -165,7 +165,7 @@ . = ..() GLOB.bots_list += src - path_hud = new /datum/atom_hud/data/bot_path() + path_hud = new /datum/atom_hud/data/bot_path/private() for(var/hud in path_hud.hud_icons) // You get to see your own path set_hud_image_active(hud, exclusive_hud = path_hud) @@ -1148,7 +1148,7 @@ Pass a positive integer as an argument to override a bot's default speed. path = newpath ? newpath : list() if(!path_hud) return - var/list/path_huds_watching_me = list(GLOB.huds[DATA_HUD_DIAGNOSTIC_ADVANCED]) + var/list/path_huds_watching_me = list(GLOB.huds[DATA_HUD_DIAGNOSTIC], GLOB.huds[DATA_HUD_BOT_PATH]) if(path_hud) path_huds_watching_me += path_hud for(var/datum/atom_hud/hud as anything in path_huds_watching_me) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index a94f8abeb3d..f2ac24d6ed9 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -92,6 +92,7 @@ AA.onNewMob(src) set_nutrition(rand(NUTRITION_LEVEL_START_MIN, NUTRITION_LEVEL_START_MAX)) . = ..() + setup_hud_traits() update_config_movespeed() initialize_actionspeed() update_movespeed(TRUE) @@ -1650,3 +1651,18 @@ /mob/key_down(key, client/client, full_key) ..() SEND_SIGNAL(src, COMSIG_MOB_KEYDOWN, key, client, full_key) + +/mob/proc/setup_hud_traits() + for(var/hud_trait in GLOB.trait_to_hud) + RegisterSignal(src, SIGNAL_ADDTRAIT(hud_trait), PROC_REF(hud_trait_enabled)) + RegisterSignal(src, SIGNAL_REMOVETRAIT(hud_trait), PROC_REF(hud_trait_disabled)) + +/mob/proc/hud_trait_enabled(datum/source, new_trait) + SIGNAL_HANDLER + var/datum/atom_hud/datahud = GLOB.huds[GLOB.trait_to_hud[new_trait]] + datahud.show_to(src) + +/mob/proc/hud_trait_disabled(datum/source, new_trait) + SIGNAL_HANDLER + var/datum/atom_hud/datahud = GLOB.huds[GLOB.trait_to_hud[new_trait]] + datahud.hide_from(src) diff --git a/code/modules/mod/modules/modules_visor.dm b/code/modules/mod/modules/modules_visor.dm index 4527fa631a6..6a1d61ea7ef 100644 --- a/code/modules/mod/modules/modules_visor.dm +++ b/code/modules/mod/modules/modules_visor.dm @@ -10,23 +10,15 @@ incompatible_modules = list(/obj/item/mod/module/visor) cooldown_time = 0.5 SECONDS required_slots = list(ITEM_SLOT_HEAD|ITEM_SLOT_EYES|ITEM_SLOT_MASK) - /// The HUD type given by the visor. - var/hud_type /// The traits given by the visor. var/list/visor_traits = list() /obj/item/mod/module/visor/on_activation() - if(hud_type) - var/datum/atom_hud/hud = GLOB.huds[hud_type] - hud.show_to(mod.wearer) if(length(visor_traits)) mod.wearer.add_traits(visor_traits, MOD_TRAIT) mod.wearer.update_sight() /obj/item/mod/module/visor/on_deactivation(display_message = TRUE, deleting = FALSE) - if(hud_type) - var/datum/atom_hud/hud = GLOB.huds[hud_type] - hud.hide_from(mod.wearer) if(length(visor_traits)) mod.wearer.remove_traits(visor_traits, MOD_TRAIT) mod.wearer.update_sight() @@ -38,7 +30,6 @@ biological scanning suite, allowing the user to visualize the current health of organic lifeforms, as well as \ access data such as patient files in a convenient readout. They say these also let you see behind you." icon_state = "medhud_visor" - hud_type = DATA_HUD_MEDICAL_ADVANCED visor_traits = list(TRAIT_MEDICAL_HUD) //Diagnostic Visor - Gives you a diagnostic HUD. @@ -48,8 +39,7 @@ from advanced machinery, exosuits, and other devices, allowing the user to visualize current power levels \ and integrity of such. They say these also let you see behind you." icon_state = "diaghud_visor" - hud_type = DATA_HUD_DIAGNOSTIC_ADVANCED - visor_traits = list(TRAIT_DIAGNOSTIC_HUD) + visor_traits = list(TRAIT_DIAGNOSTIC_HUD, TRAIT_BOT_PATH_HUD) //Security Visor - Gives you a security HUD. /obj/item/mod/module/visor/sechud @@ -58,7 +48,6 @@ plugged into various criminal databases to be able to view arrest records, command simple security-oriented robots, \ and generally know who to shoot. They say these also let you see behind you." icon_state = "sechud_visor" - hud_type = DATA_HUD_SECURITY_ADVANCED visor_traits = list(TRAIT_SECURITY_HUD) //Meson Visor - Gives you meson vision. diff --git a/code/modules/pai/software.dm b/code/modules/pai/software.dm index ab69e69388c..59db3716107 100644 --- a/code/modules/pai/software.dm +++ b/code/modules/pai/software.dm @@ -230,11 +230,11 @@ var/datum/atom_hud/hud var/hud_on if(mode == PAI_TOGGLE_MEDICAL_HUD) - hud = GLOB.huds[med_hud] + hud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] medHUD = !medHUD hud_on = medHUD if(mode == PAI_TOGGLE_SECURITY_HUD) - hud = GLOB.huds[sec_hud] + hud = GLOB.huds[DATA_HUD_SECURITY_ADVANCED] secHUD = !secHUD hud_on = secHUD if(hud_on) diff --git a/code/modules/surgery/organs/internal/cyberimp/augments_eyes.dm b/code/modules/surgery/organs/internal/cyberimp/augments_eyes.dm index cd9de70c4e2..401e951a853 100644 --- a/code/modules/surgery/organs/internal/cyberimp/augments_eyes.dm +++ b/code/modules/surgery/organs/internal/cyberimp/augments_eyes.dm @@ -13,62 +13,47 @@ desc = "These cybernetic eyes will display a HUD over everything you see. Maybe." slot = ORGAN_SLOT_HUD actions_types = list(/datum/action/item_action/toggle_hud) - var/HUD_type = 0 - var/HUD_trait = null + var/HUD_traits = list() /// Whether the HUD implant is on or off var/toggled_on = TRUE /obj/item/organ/internal/cyberimp/eyes/hud/proc/toggle_hud(mob/living/carbon/eye_owner) if(toggled_on) - if(HUD_type) - var/datum/atom_hud/hud = GLOB.huds[HUD_type] - hud.hide_from(eye_owner) toggled_on = FALSE + eye_owner.add_traits(HUD_traits, ORGAN_TRAIT) balloon_alert(eye_owner, "hud disabled") - else - if(HUD_type) - var/datum/atom_hud/hud = GLOB.huds[HUD_type] - hud.show_to(eye_owner) - toggled_on = TRUE - balloon_alert(eye_owner, "hud enabled") + return + toggled_on = TRUE + eye_owner.remove_traits(HUD_traits, ORGAN_TRAIT) + balloon_alert(eye_owner, "hud enabled") /obj/item/organ/internal/cyberimp/eyes/hud/Insert(mob/living/carbon/eye_owner, special = FALSE, movement_flags) . = ..() if(!.) return - if(HUD_type) - var/datum/atom_hud/hud = GLOB.huds[HUD_type] - hud.show_to(eye_owner) - if(HUD_trait) - ADD_TRAIT(eye_owner, HUD_trait, ORGAN_TRAIT) + eye_owner.add_traits(HUD_traits, ORGAN_TRAIT) toggled_on = TRUE /obj/item/organ/internal/cyberimp/eyes/hud/Remove(mob/living/carbon/eye_owner, special, movement_flags) . = ..() - if(HUD_type) - var/datum/atom_hud/hud = GLOB.huds[HUD_type] - hud.hide_from(eye_owner) - if(HUD_trait) - REMOVE_TRAIT(eye_owner, HUD_trait, ORGAN_TRAIT) + eye_owner.remove_traits(HUD_traits, ORGAN_TRAIT) toggled_on = FALSE /obj/item/organ/internal/cyberimp/eyes/hud/medical name = "Medical HUD implant" desc = "These cybernetic eye implants will display a medical HUD over everything you see." - HUD_type = DATA_HUD_MEDICAL_ADVANCED - HUD_trait = TRAIT_MEDICAL_HUD + HUD_traits = list(TRAIT_MEDICAL_HUD) /obj/item/organ/internal/cyberimp/eyes/hud/security name = "Security HUD implant" desc = "These cybernetic eye implants will display a security HUD over everything you see." - HUD_type = DATA_HUD_SECURITY_ADVANCED - HUD_trait = TRAIT_SECURITY_HUD + HUD_traits = list(TRAIT_SECURITY_HUD) /obj/item/organ/internal/cyberimp/eyes/hud/diagnostic name = "Diagnostic HUD implant" desc = "These cybernetic eye implants will display a diagnostic HUD over everything you see." - HUD_type = DATA_HUD_DIAGNOSTIC_ADVANCED + HUD_traits = list(TRAIT_DIAGNOSTIC_HUD, TRAIT_BOT_PATH_HUD) /obj/item/organ/internal/cyberimp/eyes/hud/security/syndicate name = "Contraband Security HUD Implant" diff --git a/code/modules/vehicles/mecha/medical/odysseus.dm b/code/modules/vehicles/mecha/medical/odysseus.dm index 90a46f54f58..162858bc310 100644 --- a/code/modules/vehicles/mecha/medical/odysseus.dm +++ b/code/modules/vehicles/mecha/medical/odysseus.dm @@ -15,20 +15,14 @@ /obj/vehicle/sealed/mecha/odysseus/moved_inside(mob/living/carbon/human/H) . = ..() if(. && !HAS_TRAIT(H, TRAIT_MEDICAL_HUD)) - var/datum/atom_hud/hud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] - hud.show_to(H) ADD_TRAIT(H, TRAIT_MEDICAL_HUD, VEHICLE_TRAIT) /obj/vehicle/sealed/mecha/odysseus/remove_occupant(mob/living/carbon/human/H) if(isliving(H) && HAS_TRAIT_FROM(H, TRAIT_MEDICAL_HUD, VEHICLE_TRAIT)) - var/datum/atom_hud/med_hud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] - med_hud.hide_from(H) REMOVE_TRAIT(H, TRAIT_MEDICAL_HUD, VEHICLE_TRAIT) return ..() /obj/vehicle/sealed/mecha/odysseus/mmi_moved_inside(obj/item/mmi/M, mob/user) . = ..() if(. && !HAS_TRAIT(M, TRAIT_MEDICAL_HUD)) - var/datum/atom_hud/hud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] - var/mob/living/brain/B = M.brainmob - hud.show_to(B) + ADD_TRAIT(M, TRAIT_MEDICAL_HUD, VEHICLE_TRAIT) diff --git a/modular_skyrat/modules/company_imports/code/objects/hud_glasses.dm b/modular_skyrat/modules/company_imports/code/objects/hud_glasses.dm index 406c96326b6..cfd50ac9437 100644 --- a/modular_skyrat/modules/company_imports/code/objects/hud_glasses.dm +++ b/modular_skyrat/modules/company_imports/code/objects/hud_glasses.dm @@ -4,7 +4,7 @@ icon = 'modular_skyrat/modules/company_imports/icons/hud_goggles.dmi' worn_icon = 'modular_skyrat/modules/company_imports/icons/hud_goggles_worn.dmi' icon_state = "permithud" - hud_types = list(DATA_HUD_PERMIT) + clothing_traits = list(TRAIT_PERMIT_HUD) /obj/item/clothing/glasses/hud/gun_permit/sunglasses name = "permit HUD sunglasses" diff --git a/modular_skyrat/modules/customization/modules/clothing/glasses/hud.dm b/modular_skyrat/modules/customization/modules/clothing/glasses/hud.dm index d31c443940d..10da40040c0 100644 --- a/modular_skyrat/modules/customization/modules/clothing/glasses/hud.dm +++ b/modular_skyrat/modules/customization/modules/clothing/glasses/hud.dm @@ -20,7 +20,6 @@ /obj/item/clothing/glasses/hud/eyepatch/sec name = "security eyepatch HUD" desc = "Lost your eye beating an innocent clown? Thankfully your corporate overlords have made something to make up for this. May not do well against flashes." - hud_types = list(DATA_HUD_SECURITY_ADVANCED) clothing_traits = list(TRAIT_SECURITY_HUD) glass_colour_type = /datum/client_colour/glass_colour/blue @@ -39,7 +38,6 @@ desc = "Do no harm, maybe harm has befell to you, or your poor eyeball, thankfully there's a way to continue your oath, thankfully it didn't mention sleepdarts or monkey men." icon_state = "medpatch" base_icon_state = "medpatch" - hud_types = list(DATA_HUD_MEDICAL_ADVANCED) clothing_traits = list(TRAIT_MEDICAL_HUD) glass_colour_type = /datum/client_colour/glass_colour/lightblue @@ -81,7 +79,6 @@ desc = "Lost your eyeball to a rogue borg? Dare to tell a Dogborg to do it's job? Got bored? Whatever the reason, this bit of tech will help you still repair borgs, they'll never need it since they usually do it themselves, but its the thought that counts." icon_state = "robopatch" base_icon_state = "robopatch" - hud_types = list(DATA_HUD_DIAGNOSTIC_BASIC) clothing_traits = list(TRAIT_DIAGNOSTIC_HUD) glass_colour_type = /datum/client_colour/glass_colour/lightorange diff --git a/modular_skyrat/modules/modular_implants/code/nifsofts/huds.dm b/modular_skyrat/modules/modular_implants/code/nifsofts/huds.dm index d34131f9a74..1fd07b658ac 100644 --- a/modular_skyrat/modules/modular_implants/code/nifsofts/huds.dm +++ b/modular_skyrat/modules/modular_implants/code/nifsofts/huds.dm @@ -105,7 +105,6 @@ /datum/nifsoft/hud/job/diagnostic name = "Diagnostic Scrying Lens" ui_icon = "robot" - hud_type = DATA_HUD_DIAGNOSTIC_BASIC hud_traits = list(TRAIT_DIAGNOSTIC_HUD) /datum/nifsoft/hud/job/security diff --git a/modular_skyrat/modules/modular_items/code/modular_glasses.dm b/modular_skyrat/modules/modular_items/code/modular_glasses.dm index e39aa32e552..4a5b142084a 100644 --- a/modular_skyrat/modules/modular_items/code/modular_glasses.dm +++ b/modular_skyrat/modules/modular_items/code/modular_glasses.dm @@ -36,6 +36,15 @@ . = ..() STOP_PROCESSING(SSobj, src) +/obj/item/clothing/glasses/hud/ar/equipped(mob/living/carbon/human/user, slot) + if(mode != MODE_OFF || slot != slot_flags) + return ..() + // when off: don't apply any huds or traits. but keep the list as-is so that we can still add them later + var/traits = clothing_traits + clothing_traits = null + . = ..() + clothing_traits = traits + /obj/item/clothing/glasses/hud/ar/proc/toggle_mode(mob/user, voluntary) if(!istype(user) || user.incapacitated()) @@ -85,22 +94,18 @@ return MODE_OFF /obj/item/clothing/glasses/hud/ar/proc/add_hud(mob/user) - if(ishuman(user)) // Make sure they're a human wearing the glasses first - var/mob/living/carbon/human/human = user - if(human.glasses == src) - var/datum/atom_hud/our_hud = GLOB.huds[initial(glasses_type.hud_types)] - our_hud.show_to(human) - for(var/trait in initial(glasses_type.clothing_traits)) - ADD_TRAIT(human, trait, GLASSES_TRAIT) + var/mob/living/carbon/human/human = user + if(!ishuman(user) || human.glasses != src) // Make sure they're a human wearing the glasses first + return + for(var/trait in clothing_traits) + ADD_CLOTHING_TRAIT(human, trait) /obj/item/clothing/glasses/hud/ar/proc/remove_hud(mob/user) - if(ishuman(user)) // Make sure they're a human wearing the glasses first - var/mob/living/carbon/human/human = user - if(human.glasses == src) - var/datum/atom_hud/our_hud = GLOB.huds[initial(glasses_type.hud_types)] - our_hud.hide_from(human) - for(var/trait in initial(glasses_type.clothing_traits)) - REMOVE_TRAIT(human, trait, GLASSES_TRAIT) + var/mob/living/carbon/human/human = user + if(!ishuman(user) || human.glasses != src) // Make sure they're a human wearing the glasses first + return + for(var/trait in clothing_traits) + REMOVE_CLOTHING_TRAIT(human, trait) /obj/item/clothing/glasses/hud/ar/proc/reset_vars() worn_icon = initial(glasses_type.worn_icon) @@ -109,17 +114,10 @@ tint = initial(glasses_type.tint) color_cutoffs = initial(glasses_type.color_cutoffs) vision_flags = initial(glasses_type.vision_flags) - //initial does not currently work on lists so we must do this - var/obj/item/clothing/glasses/hud/ar/glasses_object = new glasses_type // make a temporary glasses obj - clothing_traits = glasses_object.clothing_traits // pull the list from the created obj - hud_types = glasses_object.hud_types // same here - qdel(glasses_object) // delete the object /obj/item/clothing/glasses/hud/ar/proc/disable_vars(mob/user) vision_flags = 0 /// Sets vision_flags to 0 to disable meson view mainly color_cutoffs = null // Resets lighting_alpha to user's default one - clothing_traits = null /// also disables the options for Science functionality - hud_types = null /// Create new icon and worn_icon, with only the first frame of every state and setting that as icon. /// this practically freezes the animation :) @@ -164,7 +162,6 @@ icon_state = "aviator_sec" off_state = "aviator_sec_flash" flash_protect = FLASH_PROTECTION_NONE - hud_types = list(DATA_HUD_SECURITY_ADVANCED) clothing_traits = list(TRAIT_SECURITY_HUD) glass_colour_type = /datum/client_colour/glass_colour/red modes = list(MODE_OFF_FLASH_PROTECTION, MODE_ON) @@ -176,7 +173,6 @@ desc = "A heads-up display that scans the humanoids in view and provides accurate data about their health status. This HUD has been fitted inside of a pair of sunglasses." icon_state = "aviator_med" flash_protect = FLASH_PROTECTION_NONE - hud_types = list(DATA_HUD_MEDICAL_ADVANCED) clothing_traits = list(TRAIT_MEDICAL_HUD) glass_colour_type = /datum/client_colour/glass_colour/lightblue @@ -197,7 +193,6 @@ desc = "A heads-up display capable of analyzing the integrity and status of robotics and exosuits. This HUD has been fitted inside of a pair of sunglasses." icon_state = "aviator_diagnostic" flash_protect = FLASH_PROTECTION_NONE - hud_types = list(DATA_HUD_DIAGNOSTIC_BASIC) clothing_traits = list(TRAIT_DIAGNOSTIC_HUD) glass_colour_type = /datum/client_colour/glass_colour/lightorange @@ -263,19 +258,16 @@ /obj/item/clothing/glasses/hud/ar/projector/health name = "retinal projector health HUD" icon_state = "projector_med" - hud_types = list(DATA_HUD_MEDICAL_ADVANCED) - clothing_traits = list(ID_HUD, TRAIT_MEDICAL_HUD) + clothing_traits = list(TRAIT_MEDICAL_HUD) /obj/item/clothing/glasses/hud/ar/projector/security name = "retinal projector security HUD" icon_state = "projector_sec" - hud_types = list(DATA_HUD_SECURITY_ADVANCED) clothing_traits = list(TRAIT_SECURITY_HUD) /obj/item/clothing/glasses/hud/ar/projector/diagnostic name = "retinal projector diagnostic HUD" icon_state = "projector_diagnostic" - hud_types = list(DATA_HUD_DIAGNOSTIC_BASIC) clothing_traits = list(TRAIT_DIAGNOSTIC_HUD) /obj/item/clothing/glasses/hud/ar/projector/science @@ -283,7 +275,3 @@ icon_state = "projector_sci" clothing_traits = list(TRAIT_REAGENT_SCANNER, TRAIT_RESEARCH_SCANNER) -#undef MODE_OFF -#undef MODE_OFF_FLASH_PROTECTION -#undef MODE_ON -#undef MODE_FREEZE_ANIMATION