Skip to content

Commit

Permalink
Crew hud for ghosts and silicons (#4658)
Browse files Browse the repository at this point in the history
* Hud

* Update data_huds.dm

* Done

* Silicons and not sec get it

* Update hud.dmi

* Gives crew hud to ghosts.
  • Loading branch information
Uristthedorf authored Jan 7, 2025
1 parent 4a9a3a6 commit 3eac5e5
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 3 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/atom_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
#define PERMIT_HUD "25"
// for implants to let you see sensor field
#define SENSOR_HUD "26"
// for silicons to know if you're crew
#define CREW_HUD "27"
//monkestation edit end

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

// Notification action types
#define NOTIFY_JUMP "jump"
Expand Down
1 change: 1 addition & 0 deletions code/datums/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ GLOBAL_LIST_INIT(huds, list(
DATA_HUD_FAN = new/datum/atom_hud/data/human/fan_hud(),
DATA_HUD_PERMIT = new/datum/atom_hud/data/human/permit(), //monkestation edit
DATA_HUD_SENSORS = new/datum/atom_hud/data/human/medical/basic/sensors(), //monkestation edit - CYBERNETICS
DATA_HUD_CREW = new/datum/atom_hud/data/human/crew_hud() //Monkestation edit, crew hud
))

/datum/atom_hud
Expand Down
1 change: 1 addition & 0 deletions code/datums/records/manifest.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ GLOBAL_DATUM_INIT(manifest, /datum/manifest, new)

person.mind.crewfile = crewfile
person.mind.lockfile = lockfile
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.

return

Expand Down
33 changes: 32 additions & 1 deletion code/game/data_huds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,16 @@ Security HUDs! Basic mode shows only the job.
var/image/holder = hud_list[WANTED_HUD]
holder.pixel_y = get_cached_height() - world.icon_size
var/perp_name = get_face_name(get_id_name(""))


crew_hud_set_crew_status()

if(!perp_name || !GLOB.manifest)
holder.icon_state = null
set_hud_image_inactive(WANTED_HUD)
return

var/datum/record/crew/target = find_record(perp_name)

if(!target || target.wanted_status == WANTED_NONE)
holder.icon_state = null
set_hud_image_inactive(WANTED_HUD)
Expand Down Expand Up @@ -571,3 +574,31 @@ Diagnostic HUDs!
return dimensions[CACHED_HEIGHT_INDEX]
#undef CACHED_WIDTH_INDEX
#undef CACHED_HEIGHT_INDEX

/***********************************************
MONKE, crew hud for silicon.
************************************************/

/datum/atom_hud/data/human/crew_hud
hud_icons = list(CREW_HUD)

/mob/living/carbon/human/proc/crew_hud_set_crew_status()
var/image/holder = hud_list[CREW_HUD]
holder.pixel_y = get_cached_height() - world.icon_size
var/crew_name = get_face_name(get_id_name(""))

if(!crew_name || !GLOB.manifest || istype(wear_id?.GetID(), /obj/item/card/id/advanced/chameleon))
holder.icon_state = null
set_hud_image_inactive(CREW_HUD)
return

var/datum/record/crew/target = find_record(crew_name)

if(!target && !(crew_name == "Unknown"))
holder.icon_state = "hudnotcrew"
set_hud_image_active(CREW_HUD)
return
else
holder.icon_state = null
set_hud_image_inactive(CREW_HUD)
return
2 changes: 1 addition & 1 deletion code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ 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/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.
var/ghost_orbit = GHOST_ORBIT_CIRCLE

//These variables store hair data if the ghost originates from a species with head and/or facial hair.
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/human_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
icon = 'icons/mob/species/human/human.dmi'
icon_state = "human_basic"
appearance_flags = KEEP_TOGETHER|TILE_BOUND|PIXEL_SCALE|LONG_GLIDE
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)
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)
hud_type = /datum/hud/human
pressure_resistance = 25
can_buckle = TRUE
Expand Down
5 changes: 5 additions & 0 deletions code/modules/mob/living/silicon/silicon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
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/crew_hud = DATA_HUD_CREW //MONKE, lets silicons tell who is crew.

var/law_change_counter = 0
var/obj/machinery/camera/builtInCamera = null
Expand Down Expand Up @@ -385,17 +386,21 @@
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]
var/datum/atom_hud/crewsensor = GLOB.huds[crew_hud]
secsensor.hide_from(src)
medsensor.hide_from(src)
diagsensor.hide_from(src)
crewsensor.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]
var/datum/atom_hud/crewsensor = GLOB.huds[crew_hud]
secsensor.show_to(src)
medsensor.show_to(src)
diagsensor.show_to(src)
crewsensor.show_to(src)

/mob/living/silicon/proc/toggle_sensors()
if(incapacitated())
Expand Down
Binary file modified icons/mob/huds/hud.dmi
Binary file not shown.

0 comments on commit 3eac5e5

Please sign in to comment.