mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-21 04:57:57 +01:00
More things use trait huds over raw hud management (#93084)
This commit is contained in:
@@ -59,12 +59,8 @@
|
||||
var/master_name
|
||||
/// DNA string for owner verification
|
||||
var/master_dna
|
||||
/// Toggles whether the Medical HUD is active or not
|
||||
var/medHUD = FALSE
|
||||
/// Used as currency to purchase different abilities
|
||||
var/ram = 100
|
||||
/// Toggles whether the Security HUD is active or not
|
||||
var/secHUD = FALSE
|
||||
/// The current leash to the owner
|
||||
var/datum/component/leash/leash
|
||||
|
||||
|
||||
@@ -219,6 +219,9 @@
|
||||
stack_trace("Invalid mode passed to host scan: [mode || "null"]")
|
||||
return FALSE
|
||||
|
||||
/// Huds from PAI software
|
||||
#define PAI_HUD_TRAIT "pai_hud"
|
||||
|
||||
/**
|
||||
* Proc that toggles any active huds based on the option.
|
||||
*
|
||||
@@ -227,18 +230,16 @@
|
||||
/mob/living/silicon/pai/proc/toggle_hud(mode)
|
||||
if(isnull(mode))
|
||||
return FALSE
|
||||
var/datum/atom_hud/hud
|
||||
var/hud_on
|
||||
if(mode == PAI_TOGGLE_MEDICAL_HUD)
|
||||
hud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
|
||||
medHUD = !medHUD
|
||||
hud_on = medHUD
|
||||
if(HAS_TRAIT_FROM(src, TRAIT_MEDICAL_HUD, PAI_HUD_TRAIT))
|
||||
REMOVE_TRAIT(src, TRAIT_MEDICAL_HUD, PAI_HUD_TRAIT)
|
||||
else
|
||||
ADD_TRAIT(src, TRAIT_MEDICAL_HUD, PAI_HUD_TRAIT)
|
||||
if(mode == PAI_TOGGLE_SECURITY_HUD)
|
||||
hud = GLOB.huds[DATA_HUD_SECURITY_ADVANCED]
|
||||
secHUD = !secHUD
|
||||
hud_on = secHUD
|
||||
if(hud_on)
|
||||
hud.show_to(src)
|
||||
else
|
||||
hud.hide_from(src)
|
||||
if(HAS_TRAIT_FROM(src, TRAIT_SECURITY_HUD, PAI_HUD_TRAIT))
|
||||
REMOVE_TRAIT(src, TRAIT_SECURITY_HUD, PAI_HUD_TRAIT)
|
||||
else
|
||||
ADD_TRAIT(src, TRAIT_SECURITY_HUD, PAI_HUD_TRAIT)
|
||||
return TRUE
|
||||
|
||||
#undef PAI_HUD_TRAIT
|
||||
|
||||
Reference in New Issue
Block a user