diff --git a/code/__DEFINES/atom_hud.dm b/code/__DEFINES/atom_hud.dm index a229dd3e3c42..f370a3bf63e8 100644 --- a/code/__DEFINES/atom_hud.dm +++ b/code/__DEFINES/atom_hud.dm @@ -53,6 +53,8 @@ #define PERMIT_HUD "25" // for implants to let you see sensor field #define SENSOR_HUD "26" +// for mood change +#define MOOD_HUD "27" //monkestation edit end //by default everything in the hud_list of an atom is an image @@ -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_MOOD 13 //monkestation edit // Notification action types #define NOTIFY_JUMP "jump" diff --git a/code/datums/hud.dm b/code/datums/hud.dm index b7d71cc1760a..6bf2d5fc20ad 100644 --- a/code/datums/hud.dm +++ b/code/datums/hud.dm @@ -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_MOOD = new/datum/atom_hud/mood(), //monkestation edit )) /datum/atom_hud diff --git a/code/datums/mood.dm b/code/datums/mood.dm index 850ab6f3b7d3..98016776eb40 100644 --- a/code/datums/mood.dm +++ b/code/datums/mood.dm @@ -58,6 +58,11 @@ var/datum/hud/hud = mob_to_make_moody.hud_used hud.show_hud(hud.hud_version) +//MONKESTATION ADDITION START + var/datum/atom_hud/mood/hud = GLOB.huds[DATA_HUD_MOOD] + hud.add_atom_to_hud(mob_to_make_moody) +//MONKESTATION ADDITION END + /datum/mood/proc/clear_parent_ref() SIGNAL_HANDLER @@ -65,6 +70,11 @@ mob_parent.lose_area_sensitivity(MOOD_DATUM_TRAIT) UnregisterSignal(mob_parent, list(COMSIG_MOB_HUD_CREATED, COMSIG_ENTER_AREA, COMSIG_LIVING_REVIVE, COMSIG_MOB_STATCHANGE, COMSIG_QDELETING)) +//MONKESTATION ADDITION START + var/datum/atom_hud/mood/hud = GLOB.huds[DATA_HUD_MOOD] + hud.remove_atom_from_hud(mob_parent) +//MONKESTATION ADDITION END + mob_parent = null /datum/mood/Destroy(force) @@ -164,6 +174,7 @@ mood_events[category] = the_event the_event.category = category + update_mood_hud(type) //monkestation addition update_mood() if (the_event.timeout) @@ -492,6 +503,27 @@ return TRUE return FALSE +//MONKESTATION ADDITION START +/// Update the mood change indicator based on the mood_change of the mood_event +/datum/mood/proc/update_mood_hud(datum/mood_event/type) + if (!ispath(type)) + CRASH("A non path ([type]), was used to change a mood hud. This shouldn't be happening.") + if(QDELETED(mob_parent) || !istype(mob_parent.hud_list)) + return + if(initial(type.hidden) || !initial(type.mood_change)) + return + var/image/holder = mob_parent.hud_list[MOOD_HUD] + var/icon/I = icon(mob_parent.icon, mob_parent.icon_state, mob_parent.dir) + holder.pixel_y = I.Height() - world.icon_size + 12 + holder.layer = LOW_MOB_LAYER + holder.icon_state = null + if(initial(type.mood_change) > 0) + holder.icon_state = "hud_good_mood" + else + holder.icon_state = "hud_bad_mood" + addtimer(VARSET_CALLBACK(holder, icon_state, null), 19, (TIMER_UNIQUE|TIMER_OVERRIDE)) +//MONKESTATION ADDITION END + #undef MINOR_INSANITY_PEN #undef MAJOR_INSANITY_PEN #undef MOOD_CATEGORY_NUTRITION diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index 48ddf2749558..fcc7e8faf850 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -90,6 +90,10 @@ for(var/mob/camera/ai_eye/eye as anything in GLOB.aiEyes) eye.update_ai_detect_hud() +//MONKESTATION ADDITION +/datum/atom_hud/mood + hud_icons = list(MOOD_HUD) + /* MED/SEC/DIAG HUD HOOKS */ /* diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 849468a93b4a..862a269ebbfb 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -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_MOOD) //list of data HUDs shown to ghosts. monkestation addition here var/ghost_orbit = GHOST_ORBIT_CIRCLE //These variables store hair data if the ghost originates from a species with head and/or facial hair. @@ -770,9 +770,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/datum/atom_hud/data_hud = GLOB.huds[hudtype] data_hud.hide_from(src) +//MONKESTATION /mob/dead/observer/verb/toggle_data_huds() - set name = "Toggle Sec/Med/Diag HUD" - set desc = "Toggles whether you see medical/security/diagnostic HUDs" + set name = "Toggle Sec/Med/Diag/Mood HUD" + set desc = "Toggles whether you see medical/security/diagnostic/mood HUDs" set category = "Ghost" if(data_huds_on) //remove old huds diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 3e884ae3b476..af129ce55802 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -2,7 +2,7 @@ blood_volume = BLOOD_VOLUME_NORMAL gender = MALE pressure_resistance = 15 - hud_possible = list(HEALTH_HUD,STATUS_HUD,ANTAG_HUD,GLAND_HUD,NANITE_HUD,DIAG_NANITE_FULL_HUD,SENSOR_HUD) + hud_possible = list(HEALTH_HUD,STATUS_HUD,ANTAG_HUD,GLAND_HUD,NANITE_HUD,DIAG_NANITE_FULL_HUD,SENSOR_HUD,MOOD_HUD) has_limbs = TRUE held_items = list(null, null) num_legs = 0 //Populated on init through list/bodyparts diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 9c5a1a90bbb0..13db05913a0e 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -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,MOOD_HUD) hud_type = /datum/hud/human pressure_resistance = 25 can_buckle = TRUE diff --git a/icons/mob/huds/hud.dmi b/icons/mob/huds/hud.dmi index 5473ba0f1390..5d9ab7cdfd19 100644 Binary files a/icons/mob/huds/hud.dmi and b/icons/mob/huds/hud.dmi differ