Skip to content

Commit 3eac5e5

Browse files
authored
Crew hud for ghosts and silicons (#4658)
* Hud * Update data_huds.dm * Done * Silicons and not sec get it * Update hud.dmi * Gives crew hud to ghosts.
1 parent 4a9a3a6 commit 3eac5e5

File tree

8 files changed

+44
-3
lines changed

8 files changed

+44
-3
lines changed

code/__DEFINES/atom_hud.dm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
#define PERMIT_HUD "25"
5454
// for implants to let you see sensor field
5555
#define SENSOR_HUD "26"
56+
// for silicons to know if you're crew
57+
#define CREW_HUD "27"
5658
//monkestation edit end
5759

5860
//by default everything in the hud_list of an atom is an image
@@ -73,6 +75,7 @@
7375
#define DATA_HUD_FAN 10
7476
#define DATA_HUD_PERMIT 11 //monkestation edit
7577
#define DATA_HUD_SENSORS 12 //monkestation edit
78+
#define DATA_HUD_CREW 13 //monkestation edit
7679

7780
// Notification action types
7881
#define NOTIFY_JUMP "jump"

code/datums/hud.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ GLOBAL_LIST_INIT(huds, list(
2020
DATA_HUD_FAN = new/datum/atom_hud/data/human/fan_hud(),
2121
DATA_HUD_PERMIT = new/datum/atom_hud/data/human/permit(), //monkestation edit
2222
DATA_HUD_SENSORS = new/datum/atom_hud/data/human/medical/basic/sensors(), //monkestation edit - CYBERNETICS
23+
DATA_HUD_CREW = new/datum/atom_hud/data/human/crew_hud() //Monkestation edit, crew hud
2324
))
2425

2526
/datum/atom_hud

code/datums/records/manifest.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ GLOBAL_DATUM_INIT(manifest, /datum/manifest, new)
152152

153153
person.mind.crewfile = crewfile
154154
person.mind.lockfile = lockfile
155+
person.crew_hud_set_crew_status() //MONKE, when someone is added to crew, set their crew hud status, to make hud know they're crew.
155156

156157
return
157158

code/game/data_huds.dm

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,16 @@ Security HUDs! Basic mode shows only the job.
337337
var/image/holder = hud_list[WANTED_HUD]
338338
holder.pixel_y = get_cached_height() - world.icon_size
339339
var/perp_name = get_face_name(get_id_name(""))
340-
340+
341+
crew_hud_set_crew_status()
342+
341343
if(!perp_name || !GLOB.manifest)
342344
holder.icon_state = null
343345
set_hud_image_inactive(WANTED_HUD)
344346
return
345347

346348
var/datum/record/crew/target = find_record(perp_name)
349+
347350
if(!target || target.wanted_status == WANTED_NONE)
348351
holder.icon_state = null
349352
set_hud_image_inactive(WANTED_HUD)
@@ -571,3 +574,31 @@ Diagnostic HUDs!
571574
return dimensions[CACHED_HEIGHT_INDEX]
572575
#undef CACHED_WIDTH_INDEX
573576
#undef CACHED_HEIGHT_INDEX
577+
578+
/***********************************************
579+
MONKE, crew hud for silicon.
580+
************************************************/
581+
582+
/datum/atom_hud/data/human/crew_hud
583+
hud_icons = list(CREW_HUD)
584+
585+
/mob/living/carbon/human/proc/crew_hud_set_crew_status()
586+
var/image/holder = hud_list[CREW_HUD]
587+
holder.pixel_y = get_cached_height() - world.icon_size
588+
var/crew_name = get_face_name(get_id_name(""))
589+
590+
if(!crew_name || !GLOB.manifest || istype(wear_id?.GetID(), /obj/item/card/id/advanced/chameleon))
591+
holder.icon_state = null
592+
set_hud_image_inactive(CREW_HUD)
593+
return
594+
595+
var/datum/record/crew/target = find_record(crew_name)
596+
597+
if(!target && !(crew_name == "Unknown"))
598+
holder.icon_state = "hudnotcrew"
599+
set_hud_image_active(CREW_HUD)
600+
return
601+
else
602+
holder.icon_state = null
603+
set_hud_image_inactive(CREW_HUD)
604+
return

code/modules/mob/dead/observer/observer.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
3737
var/health_scan = FALSE //Are health scans currently enabled?
3838
var/chem_scan = FALSE //Are chem scans currently enabled?
3939
var/gas_scan = FALSE //Are gas scans currently enabled?
40-
var/list/datahuds = list(DATA_HUD_SECURITY_ADVANCED, DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC_ADVANCED) //list of data HUDs shown to ghosts.
40+
var/list/datahuds = list(DATA_HUD_SECURITY_ADVANCED, DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC_ADVANCED, DATA_HUD_CREW) //list of data HUDs shown to ghosts.
4141
var/ghost_orbit = GHOST_ORBIT_CIRCLE
4242

4343
//These variables store hair data if the ghost originates from a species with head and/or facial hair.

code/modules/mob/living/carbon/human/human_defines.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
icon = 'icons/mob/species/human/human.dmi'
66
icon_state = "human_basic"
77
appearance_flags = KEEP_TOGETHER|TILE_BOUND|PIXEL_SCALE|LONG_GLIDE
8-
hud_possible = list(HEALTH_HUD,STATUS_HUD,ID_HUD,WANTED_HUD,IMPLOYAL_HUD,IMPCHEM_HUD,IMPTRACK_HUD,ANTAG_HUD,GLAND_HUD,SENTIENT_DISEASE_HUD,FAN_HUD,NANITE_HUD,DIAG_NANITE_FULL_HUD,PERMIT_HUD,SENSOR_HUD)
8+
hud_possible = list(HEALTH_HUD,STATUS_HUD,ID_HUD,WANTED_HUD,IMPLOYAL_HUD,IMPCHEM_HUD,IMPTRACK_HUD,ANTAG_HUD,GLAND_HUD,SENTIENT_DISEASE_HUD,FAN_HUD,NANITE_HUD,DIAG_NANITE_FULL_HUD,PERMIT_HUD,SENSOR_HUD,CREW_HUD)
99
hud_type = /datum/hud/human
1010
pressure_resistance = 25
1111
can_buckle = TRUE

code/modules/mob/living/silicon/silicon.dm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
var/med_hud = DATA_HUD_MEDICAL_ADVANCED //Determines the med hud to use
4242
var/sec_hud = DATA_HUD_SECURITY_ADVANCED //Determines the sec hud to use
4343
var/d_hud = DATA_HUD_DIAGNOSTIC_BASIC //Determines the diag hud to use
44+
var/crew_hud = DATA_HUD_CREW //MONKE, lets silicons tell who is crew.
4445

4546
var/law_change_counter = 0
4647
var/obj/machinery/camera/builtInCamera = null
@@ -385,17 +386,21 @@
385386
var/datum/atom_hud/secsensor = GLOB.huds[sec_hud]
386387
var/datum/atom_hud/medsensor = GLOB.huds[med_hud]
387388
var/datum/atom_hud/diagsensor = GLOB.huds[d_hud]
389+
var/datum/atom_hud/crewsensor = GLOB.huds[crew_hud]
388390
secsensor.hide_from(src)
389391
medsensor.hide_from(src)
390392
diagsensor.hide_from(src)
393+
crewsensor.hide_from(src)
391394

392395
/mob/living/silicon/proc/add_sensors()
393396
var/datum/atom_hud/secsensor = GLOB.huds[sec_hud]
394397
var/datum/atom_hud/medsensor = GLOB.huds[med_hud]
395398
var/datum/atom_hud/diagsensor = GLOB.huds[d_hud]
399+
var/datum/atom_hud/crewsensor = GLOB.huds[crew_hud]
396400
secsensor.show_to(src)
397401
medsensor.show_to(src)
398402
diagsensor.show_to(src)
403+
crewsensor.show_to(src)
399404

400405
/mob/living/silicon/proc/toggle_sensors()
401406
if(incapacitated())

icons/mob/huds/hud.dmi

1.12 KB
Binary file not shown.

0 commit comments

Comments
 (0)