mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 20:16:55 +01:00
Converts Nutrition alert to hud element (#25616)
* hud * convert nutrition from alert to hud * return alert5 and remove some unused ui defines * reorganize top-to-bottom
This commit is contained in:
@@ -83,30 +83,11 @@
|
||||
#define ui_alert4 "EAST-1:28,CENTER+2:21"
|
||||
#define ui_alert5 "EAST-1:28,CENTER+1:19"
|
||||
|
||||
|
||||
//Gun buttons
|
||||
#define ui_gun1 "EAST-2:26,SOUTH+2:7"
|
||||
#define ui_gun2 "EAST-1:28,SOUTH+3:7"
|
||||
#define ui_gun3 "EAST-2:26,SOUTH+3:7"
|
||||
#define ui_gun_select "EAST-1:28,SOUTH+2:7"
|
||||
|
||||
//Upper-middle right (damage indicators)
|
||||
#define ui_toxin "EAST-1:28,CENTER+5:27"
|
||||
#define ui_fire "EAST-1:28,CENTER+4:25"
|
||||
#define ui_oxygen "EAST-1:28,CENTER+3:23"
|
||||
#define ui_pressure "EAST-1:28,CENTER+2:21"
|
||||
|
||||
#define ui_alien_toxin "EAST-1:28,CENTER+5:25"
|
||||
#define ui_alien_fire "EAST-1:28,CENTER+4:25"
|
||||
#define ui_alien_oxygen "EAST-1:28,CENTER+3:25"
|
||||
#define ui_alien_nightvision "EAST-1:28,CENTER+2:25"
|
||||
|
||||
//Middle right (status indicators)
|
||||
#define ui_nutrition "EAST-1:28,CENTER-3:11"
|
||||
#define ui_temp "EAST-1:28,CENTER-2:13"
|
||||
#define ui_healthdoll "EAST-1:28,CENTER-1:15"
|
||||
#define ui_health "EAST-1:28,CENTER:17"
|
||||
#define ui_internal "EAST-1:28,CENTER+1:19"
|
||||
#define ui_health "EAST-1:28,CENTER:17"
|
||||
#define ui_healthdoll "EAST-1:28,CENTER-1:15"
|
||||
#define ui_nutrition "EAST-2:32,CENTER-1:13"
|
||||
#define ui_stamina "EAST-1:28,CENTER-2:15"
|
||||
|
||||
//borgs
|
||||
|
||||
@@ -131,6 +131,7 @@
|
||||
mymob.healths = null
|
||||
mymob.healthdoll = null
|
||||
mymob.pullin = null
|
||||
mymob.nutrition_display = null
|
||||
|
||||
//clear the rest of our reload_fullscreen
|
||||
lingchemdisplay = null
|
||||
|
||||
@@ -345,6 +345,9 @@
|
||||
mymob.healthdoll = new()
|
||||
infodisplay += mymob.healthdoll
|
||||
|
||||
mymob.nutrition_display = new()
|
||||
infodisplay += mymob.nutrition_display
|
||||
|
||||
mymob.pullin = new /atom/movable/screen/pull()
|
||||
mymob.pullin.icon = ui_style
|
||||
mymob.pullin.hud = src
|
||||
|
||||
@@ -556,6 +556,12 @@
|
||||
var/mob/living/carbon/H = usr
|
||||
H.check_self_for_injuries()
|
||||
|
||||
/atom/movable/screen/nutrition
|
||||
name = "nutrition"
|
||||
icon = 'icons/mob/screen_hunger.dmi'
|
||||
icon_state = null
|
||||
screen_loc = ui_nutrition
|
||||
|
||||
/atom/movable/screen/component_button
|
||||
var/atom/movable/screen/parent
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ RESTRICT_TYPE(/datum/antagonist/vampire)
|
||||
var/datum/hud/hud = mob_override.hud_used
|
||||
if(hud?.vampire_blood_display)
|
||||
hud.remove_vampire_hud()
|
||||
mob_override.dna?.species.hunger_type = initial(mob_override.dna.species.hunger_type)
|
||||
mob_override.dna?.species.hunger_icon = initial(mob_override.dna.species.hunger_icon)
|
||||
owner.current.alpha = 255
|
||||
REMOVE_TRAITS_IN(owner.current, "vampire")
|
||||
@@ -354,7 +353,6 @@ RESTRICT_TYPE(/datum/antagonist/vampire)
|
||||
owner.som = new()
|
||||
owner.som.masters += owner
|
||||
|
||||
mob_override.dna?.species.hunger_type = "vampire"
|
||||
mob_override.dna?.species.hunger_icon = 'icons/mob/screen_hunger_vampire.dmi'
|
||||
check_vampire_upgrade(FALSE)
|
||||
|
||||
|
||||
@@ -668,28 +668,26 @@
|
||||
|
||||
#undef BODYPART_PAIN_REDUCTION
|
||||
|
||||
/mob/living/carbon/human/proc/handle_nutrition_alerts() //This is a terrible abuse of the alert system; something like this should be a HUD element
|
||||
if(HAS_TRAIT(src, TRAIT_NOHUNGER))
|
||||
/mob/living/carbon/human/proc/handle_nutrition_alerts()
|
||||
if(!nutrition_display)
|
||||
return
|
||||
var/new_hunger
|
||||
if(HAS_TRAIT(src, TRAIT_NOHUNGER))
|
||||
nutrition_display.icon_state = null
|
||||
return
|
||||
nutrition_display.icon = dna.species.hunger_icon
|
||||
switch(nutrition)
|
||||
if(NUTRITION_LEVEL_FULL to INFINITY)
|
||||
new_hunger = "fat"
|
||||
nutrition_display.icon_state = "fat"
|
||||
if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FULL)
|
||||
new_hunger = "full"
|
||||
nutrition_display.icon_state = "full"
|
||||
if(NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED)
|
||||
new_hunger = "well_fed"
|
||||
nutrition_display.icon_state = "well_fed"
|
||||
if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED)
|
||||
new_hunger = "fed"
|
||||
nutrition_display.icon_state = "fed"
|
||||
if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY)
|
||||
new_hunger = "hungry"
|
||||
nutrition_display.icon_state = "hungry"
|
||||
else
|
||||
new_hunger = "starving"
|
||||
if(dna.species.hunger_type)
|
||||
new_hunger += "/[dna.species.hunger_type]"
|
||||
if(dna.species.hunger_level != new_hunger)
|
||||
dna.species.hunger_level = new_hunger
|
||||
throw_alert("nutrition", "/atom/movable/screen/alert/hunger/[new_hunger]", icon_override = dna.species.hunger_icon)
|
||||
nutrition_display.icon_state = "starving"
|
||||
|
||||
/mob/living/carbon/human/handle_random_events()
|
||||
// Puke if toxloss is too high
|
||||
|
||||
@@ -48,8 +48,6 @@
|
||||
var/hunger_drain = HUNGER_FACTOR
|
||||
var/taste_sensitivity = TASTE_SENSITIVITY_NORMAL //the most widely used factor; humans use a different one
|
||||
var/hunger_icon = 'icons/mob/screen_hunger.dmi'
|
||||
var/hunger_type
|
||||
var/hunger_level
|
||||
|
||||
var/siemens_coeff = 1 //base electrocution coefficient
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
butt_sprite = "machine"
|
||||
|
||||
hunger_icon = 'icons/mob/screen_hunger_machine.dmi'
|
||||
hunger_type = "machine"
|
||||
|
||||
has_organ = list(
|
||||
"brain" = /obj/item/organ/internal/brain/mmi_holder/posibrain,
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
*/
|
||||
var/atom/movable/screen/leap_icon = null
|
||||
var/atom/movable/screen/healthdoll/healthdoll = null
|
||||
var/atom/movable/screen/nutrition/nutrition_display = null
|
||||
|
||||
var/use_me = TRUE //Allows all mobs to use the me verb by default, will have to manually specify they cannot
|
||||
var/damageoverlaytemp = 0
|
||||
|
||||
Reference in New Issue
Block a user