Merge pull request #3969 from Citadel-Station-13/upstream-merge-32622

[MIRROR] Fix conflicts between helmet/mech HUDs and HUD glasses
This commit is contained in:
deathride58
2017-11-17 04:49:10 +00:00
committed by GitHub
5 changed files with 36 additions and 51 deletions
+10 -8
View File
@@ -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)
+24 -33
View File
@@ -1,33 +1,24 @@
/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("<span class='warning'>Your [H.glasses] prevent you from using the built-in medical hud.</span>")
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. (&copy; 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)
..()
+2 -6
View File
@@ -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, ("<span class='warning'>Your [user.glasses] prevents you using [src]'s diagnostic visor HUD.</span>"))
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)
-2
View File
@@ -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.
@@ -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)
..()