From 952fa2a0f2ae1e4862ad1327757e098b0d5c4a16 Mon Sep 17 00:00:00 2001 From: oranges Date: Fri, 17 Nov 2017 10:38:44 +1300 Subject: [PATCH 1/2] Fix conflicts between helmet/mech HUDs and HUD glasses --- code/datums/hud.dm | 18 +++++++------ code/game/mecha/medical/odysseus.dm | 27 ++++++++++++++++++++ code/modules/clothing/spacesuits/hardsuit.dm | 8 ++---- code/modules/mob/mob_defines.dm | 2 -- code/modules/surgery/organs/augments_eyes.dm | 2 -- 5 files changed, 39 insertions(+), 18 deletions(-) diff --git a/code/datums/hud.dm b/code/datums/hud.dm index 98d2c9258a..3a4a732744 100644 --- a/code/datums/hud.dm +++ b/code/datums/hud.dm @@ -31,11 +31,10 @@ GLOBAL_LIST_INIT(huds, list( /datum/atom_hud/proc/remove_hud_from(mob/M) if(!M) return - if(src in M.permanent_huds) - return - for(var/atom/A in hudatoms) - remove_from_single_hud(M, A) - hudusers -= M + if (!--hudusers[M]) + hudusers -= M + for(var/atom/A in hudatoms) + remove_from_single_hud(M, A) /datum/atom_hud/proc/remove_from_hud(atom/A) if(!A) @@ -54,9 +53,12 @@ GLOBAL_LIST_INIT(huds, list( /datum/atom_hud/proc/add_hud_to(mob/M) if(!M) return - hudusers[M] = TRUE - for(var/atom/A in hudatoms) - add_to_single_hud(M, A) + if (!hudusers[M]) + hudusers[M] = 1 + for(var/atom/A in hudatoms) + add_to_single_hud(M, A) + else + hudusers[M]++ /datum/atom_hud/proc/add_to_hud(atom/A) if(!A) diff --git a/code/game/mecha/medical/odysseus.dm b/code/game/mecha/medical/odysseus.dm index c6493c8581..638705d245 100644 --- a/code/game/mecha/medical/odysseus.dm +++ b/code/game/mecha/medical/odysseus.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /obj/mecha/medical/odysseus desc = "These exosuits are developed and produced by Vey-Med. (© All rights reserved)." name = "\improper Odysseus" @@ -31,3 +32,29 @@ ..() return +======= +/obj/mecha/medical/odysseus + desc = "These exosuits are developed and produced by Vey-Med. (© All rights reserved)." + name = "\improper Odysseus" + icon_state = "odysseus" + step_in = 3 + max_temperature = 15000 + max_integrity = 120 + wreckage = /obj/structure/mecha_wreckage/odysseus + internal_damage_threshold = 35 + deflect_chance = 15 + step_energy_drain = 6 + +/obj/mecha/medical/odysseus/moved_inside(mob/living/carbon/human/H) + . = ..() + if(.) + var/datum/atom_hud/hud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] + hud.add_hud_to(H) + +/obj/mecha/medical/odysseus/go_out() + if(ishuman(occupant)) + var/mob/living/carbon/human/H = occupant + var/datum/atom_hud/hud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] + hud.remove_hud_from(H) + ..() +>>>>>>> f533391... Merge pull request #32622 from AutomaticFrenzy/patch/odysseus diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index 6cc5756658..c371973506 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -444,7 +444,6 @@ icon_state = "hardsuit0-rd" item_color = "rd" resistance_flags = ACID_PROOF | FIRE_PROOF - var/onboard_hud_enabled = 0 //stops conflicts with another diag HUD max_heat_protection_temperature = FIRE_SUIT_MAX_TEMP_PROTECT armor = list(melee = 30, bullet = 5, laser = 10, energy = 5, bomb = 100, bio = 100, rad = 60, fire = 60, acid = 80) var/obj/machinery/doppler_array/integrated/bomb_radar @@ -457,16 +456,13 @@ /obj/item/clothing/head/helmet/space/hardsuit/rd/equipped(mob/living/carbon/human/user, slot) ..() - if(user.glasses && istype(user.glasses, /obj/item/clothing/glasses/hud/diagnostic)) - to_chat(user, ("Your [user.glasses] prevents you using [src]'s diagnostic visor HUD.")) - else - onboard_hud_enabled = 1 + if (slot == slot_head) var/datum/atom_hud/DHUD = GLOB.huds[DATA_HUD_DIAGNOSTIC] DHUD.add_hud_to(user) /obj/item/clothing/head/helmet/space/hardsuit/rd/dropped(mob/living/carbon/human/user) ..() - if(onboard_hud_enabled && !(user.glasses && istype(user.glasses, /obj/item/clothing/glasses/hud/diagnostic))) + if (user.head == src) var/datum/atom_hud/DHUD = GLOB.huds[DATA_HUD_DIAGNOSTIC] DHUD.remove_hud_from(user) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 497f0536a0..525e6ecb2c 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -135,8 +135,6 @@ var/turf/listed_turf = null //the current turf being examined in the stat panel - var/list/permanent_huds = list() - var/resize = 1 //Badminnery resize var/list/observers = null //The list of people observing this mob. diff --git a/code/modules/surgery/organs/augments_eyes.dm b/code/modules/surgery/organs/augments_eyes.dm index f928db5dd6..29fc6f1ac2 100644 --- a/code/modules/surgery/organs/augments_eyes.dm +++ b/code/modules/surgery/organs/augments_eyes.dm @@ -19,12 +19,10 @@ if(HUD_type) var/datum/atom_hud/H = GLOB.huds[HUD_type] H.add_hud_to(M) - M.permanent_huds |= H /obj/item/organ/cyberimp/eyes/hud/Remove(var/mob/living/carbon/M, var/special = 0) if(HUD_type) var/datum/atom_hud/H = GLOB.huds[HUD_type] - M.permanent_huds ^= H H.remove_hud_from(M) ..() From 9057436da3f2572e58ce779b2a54aaa35bc7a4e7 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Thu, 16 Nov 2017 23:32:17 -0500 Subject: [PATCH 2/2] Update odysseus.dm --- code/game/mecha/medical/odysseus.dm | 36 ----------------------------- 1 file changed, 36 deletions(-) diff --git a/code/game/mecha/medical/odysseus.dm b/code/game/mecha/medical/odysseus.dm index 638705d245..7725d3c6e5 100644 --- a/code/game/mecha/medical/odysseus.dm +++ b/code/game/mecha/medical/odysseus.dm @@ -1,38 +1,3 @@ -<<<<<<< HEAD -/obj/mecha/medical/odysseus - desc = "These exosuits are developed and produced by Vey-Med. (© All rights reserved)." - name = "\improper Odysseus" - icon_state = "odysseus" - step_in = 3 - max_temperature = 15000 - max_integrity = 120 - wreckage = /obj/structure/mecha_wreckage/odysseus - internal_damage_threshold = 35 - deflect_chance = 15 - step_energy_drain = 6 - var/builtin_hud_user = 0 - -/obj/mecha/medical/odysseus/moved_inside(mob/living/carbon/human/H) - if(..()) - if(H.glasses && istype(H.glasses, /obj/item/clothing/glasses/hud)) - occupant_message("Your [H.glasses] prevent you from using the built-in medical hud.") - else - var/datum/atom_hud/data/human/medical/advanced/A = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] - A.add_hud_to(H) - builtin_hud_user = 1 - return 1 - else - return 0 - -/obj/mecha/medical/odysseus/go_out() - if(ishuman(occupant) && builtin_hud_user) - var/mob/living/carbon/human/H = occupant - var/datum/atom_hud/data/human/medical/advanced/A = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] - A.remove_hud_from(H) - ..() - return - -======= /obj/mecha/medical/odysseus desc = "These exosuits are developed and produced by Vey-Med. (© All rights reserved)." name = "\improper Odysseus" @@ -57,4 +22,3 @@ var/datum/atom_hud/hud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] hud.remove_hud_from(H) ..() ->>>>>>> f533391... Merge pull request #32622 from AutomaticFrenzy/patch/odysseus