diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm index 948c07ef0ae..3e092948dce 100644 --- a/code/_onclick/hud/_defines.dm +++ b/code/_onclick/hud/_defines.dm @@ -80,8 +80,8 @@ #define ui_alien_oxygen "EAST-1:28,NORTH-4:25" //Middle right (status indicators) -#define ui_nutrition "EAST-0:4,CENTER-2:11" -#define ui_hydration "EAST-1:20,CENTER-2:11" +#define ui_nutrition "EAST-1:28,CENTER-2:11" +#define ui_nutrition_small "EAST:4,CENTER-2:24" #define ui_temp "EAST-1:28,CENTER-1:13" #define ui_health "EAST-1:28,CENTER:15" #define ui_internal "EAST-1:28,CENTER+1:17" diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 913eaccfc86..5be75f85710 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -254,18 +254,18 @@ mymob.internals.icon_state = "internal1" if(hud_data.has_warnings) - mymob.oxygen = new /obj/screen() - mymob.oxygen.icon = ui_style + mymob.oxygen = new /obj/screen/oxygen() + mymob.oxygen.icon = 'icons/mob/status_indicators.dmi' mymob.oxygen.icon_state = "oxy0" mymob.oxygen.name = "oxygen" - mymob.oxygen.screen_loc = ui_oxygen + mymob.oxygen.screen_loc = ui_temp hud_elements |= mymob.oxygen - mymob.toxin = new /obj/screen() - mymob.toxin.icon = ui_style + mymob.toxin = new /obj/screen/toxins() + mymob.toxin.icon = 'icons/mob/status_indicators.dmi' mymob.toxin.icon_state = "tox0" mymob.toxin.name = "toxin" - mymob.toxin.screen_loc = ui_toxin + mymob.toxin.screen_loc = ui_temp hud_elements |= mymob.toxin mymob.fire = new /obj/screen() @@ -283,35 +283,36 @@ hud_elements |= mymob.healths if(hud_data.has_pressure) - mymob.pressure = new /obj/screen() - mymob.pressure.icon = ui_style + mymob.pressure = new /obj/screen/pressure() + mymob.pressure.icon = 'icons/mob/status_indicators.dmi' mymob.pressure.icon_state = "pressure0" mymob.pressure.name = "pressure" - mymob.pressure.screen_loc = ui_pressure + mymob.pressure.screen_loc = ui_temp hud_elements |= mymob.pressure if(hud_data.has_bodytemp) - mymob.bodytemp = new /obj/screen() - mymob.bodytemp.icon = ui_style + mymob.bodytemp = new /obj/screen/bodytemp() + mymob.bodytemp.icon = 'icons/mob/status_indicators.dmi' mymob.bodytemp.icon_state = "temp1" mymob.bodytemp.name = "body temperature" mymob.bodytemp.screen_loc = ui_temp hud_elements |= mymob.bodytemp if(hud_data.has_nutrition) - mymob.nutrition_icon = new /obj/screen() - mymob.nutrition_icon.icon = ui_style + mymob.nutrition_icon = new /obj/screen/food() + mymob.nutrition_icon.icon = 'icons/mob/status_hunger.dmi' + mymob.nutrition_icon.pixel_w = 8 mymob.nutrition_icon.icon_state = "nutrition0" mymob.nutrition_icon.name = "nutrition" mymob.nutrition_icon.screen_loc = ui_nutrition hud_elements |= mymob.nutrition_icon if(hud_data.has_hydration) - mymob.hydration_icon = new /obj/screen() - mymob.hydration_icon.icon = ui_style + mymob.hydration_icon = new /obj/screen/thirst() + mymob.hydration_icon.icon = 'icons/mob/status_hunger.dmi' mymob.hydration_icon.icon_state = "thirst0" mymob.hydration_icon.name = "thirst" - mymob.hydration_icon.screen_loc = ui_hydration + mymob.hydration_icon.screen_loc = ui_nutrition hud_elements |= mymob.hydration_icon if(hud_data.has_up_hint) @@ -415,3 +416,84 @@ h_style = pick("Bedhead", "Bedhead 2", "Bedhead 3") all_underwear.Cut() regenerate_icons() + +// Yes, these use icon state. Yes, these are terrible. The alternative is duplicating +// a bunch of fairly blobby logic for every click override on these objects. + +/obj/screen/food/Click(var/location, var/control, var/params) + if(istype(usr) && usr.nutrition_icon == src) + switch(icon_state) + if("nutrition0") + to_chat(usr, SPAN_WARNING("You are completely stuffed.")) + if("nutrition1") + to_chat(usr, SPAN_NOTICE("You are not hungry.")) + if("nutrition2") + to_chat(usr, SPAN_NOTICE("You are a bit peckish.")) + if("nutrition3") + to_chat(usr, SPAN_WARNING("You are quite hungry.")) + if("nutrition4") + to_chat(usr, SPAN_DANGER("You are starving!")) + +/obj/screen/thirst/Click(var/location, var/control, var/params) + if(istype(usr) && usr.hydration_icon == src) + switch(icon_state) + if("thirst0") + to_chat(usr, SPAN_WARNING("You are completely hydrated.")) + if("thirst1") + to_chat(usr, SPAN_NOTICE("You are not thirsty")) + if("thirst2") + to_chat(usr, SPAN_NOTICE("You are a bit thirsty.")) + if("thirst3") + to_chat(usr, SPAN_WARNING("You are quite thirsty.")) + if("thirst4") + to_chat(usr, SPAN_DANGER("Your are entirely dehydrated!")) + +/obj/screen/bodytemp/Click(var/location, var/control, var/params) + if(istype(usr) && usr.bodytemp == src) + switch(icon_state) + if("temp4") + to_chat(usr, SPAN_DANGER("You are being cooked alive!")) + if("temp3") + to_chat(usr, SPAN_DANGER("Your body is burning up!")) + if("temp2") + to_chat(usr, SPAN_DANGER("You are overheating.")) + if("temp1") + to_chat(usr, SPAN_WARNING("You are uncomfortably hot.")) + if("temp-4") + to_chat(usr, SPAN_DANGER("You are being frozen solid!")) + if("temp-3") + to_chat(usr, SPAN_DANGER("You are freezing cold!")) + if("temp-2") + to_chat(usr, SPAN_WARNING("You are dangerously chilled")) + if("temp-1") + to_chat(usr, SPAN_NOTICE("You are uncomfortably cold.")) + else + to_chat(usr, SPAN_NOTICE("Your body is at a comfortable temperature.")) + +/obj/screen/pressure/Click(var/location, var/control, var/params) + if(istype(usr) && usr.pressure == src) + switch(icon_state) + if("pressure2") + to_chat(usr, SPAN_DANGER("The air pressure here is crushing!")) + if("pressure1") + to_chat(usr, SPAN_WARNING("The air pressure here is dangerously high.")) + if("pressure-1") + to_chat(usr, SPAN_WARNING("The air pressure here is dangerously low.")) + if("pressure-2") + to_chat(usr, SPAN_DANGER("There is nearly no air pressure here!")) + else + to_chat(usr, SPAN_NOTICE("The local air pressure is comfortable.")) + +/obj/screen/toxins/Click(var/location, var/control, var/params) + if(istype(usr) && usr.toxin == src) + if(icon_state == "tox0") + to_chat(usr, SPAN_NOTICE("The air is clear of toxins.")) + else + to_chat(usr, SPAN_DANGER("The air is eating away at your skin!")) + +/obj/screen/oxygen/Click(var/location, var/control, var/params) + if(istype(usr) && usr.oxygen == src) + if(icon_state == "oxy0") + to_chat(usr, SPAN_NOTICE("You are breathing easy.")) + else + to_chat(usr, SPAN_DANGER("You cannot breathe!")) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 48dfda63836..ba8d95a0a4d 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -905,7 +905,7 @@ if (nutrition_icon.icon_state != new_val) nutrition_icon.icon_state = new_val if(hydration_icon) - var/hyd_factor = max(0,min(hydration / max_hydration,1)) + var/hyd_factor = max_hydration ? Clamp(hydration / max_hydration, 0, 1) : 1 var/hyd_icon = 5 if(hyd_factor >= CREW_HYDRATION_OVERHYDRATED) hyd_icon = 0 diff --git a/html/changelogs/geeves-human_ui_makeover.yml b/html/changelogs/geeves-human_ui_makeover.yml new file mode 100644 index 00000000000..2e051c56c20 --- /dev/null +++ b/html/changelogs/geeves-human_ui_makeover.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "Ported a modified human UI from Bay/Europa with minor edits." \ No newline at end of file diff --git a/icons/mob/status_hunger.dmi b/icons/mob/status_hunger.dmi new file mode 100644 index 00000000000..04e97852b01 Binary files /dev/null and b/icons/mob/status_hunger.dmi differ diff --git a/icons/mob/status_indicators.dmi b/icons/mob/status_indicators.dmi new file mode 100644 index 00000000000..f6df1604482 Binary files /dev/null and b/icons/mob/status_indicators.dmi differ