You can no longer see hud / screen when asleep. DOESN'T AFFECT BLINDNESS (#24360)

* You can no longer see hud / screen when asleep

* oh fuck the huds

* Update code/_onclick/hud/robot_hud.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* storing when looking into a bug

* more tweaks

* Initial screen object fixes

* fix for old screen types

* animation my dear watson

---------

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>
This commit is contained in:
Qwertytoforty
2024-05-05 09:42:12 +00:00
committed by GitHub
co-authored by Contrabang S34N
parent 1823eff1b5
commit 9ae66dd496
32 changed files with 156 additions and 96 deletions
@@ -72,7 +72,7 @@
inv.update_icon()
if(wear_suit)
if(client && hud_used && hud_used.hud_shown)
if(client && hud_used && hud_used.hud_version == HUD_STYLE_STANDARD)
if(hud_used.inventory_shown) //if the inventory is open ...
wear_suit.screen_loc = ui_oclothing //TODO //...draw the item in the inventory screen
client.screen += wear_suit //Either way, add the item to the HUD
@@ -319,7 +319,7 @@
severity = 9
if(-INFINITY to -95)
severity = 10
overlay_fullscreen("crit", /atom/movable/screen/fullscreen/crit, severity)
overlay_fullscreen("crit", /atom/movable/screen/fullscreen/stretch/crit, severity)
else if(stat == CONSCIOUS)
if(check_death_method())
clear_fullscreen("crit")
@@ -340,7 +340,7 @@
severity = 6
if(45 to INFINITY)
severity = 7
overlay_fullscreen("oxy", /atom/movable/screen/fullscreen/oxy, severity)
overlay_fullscreen("oxy", /atom/movable/screen/fullscreen/stretch/oxy, severity)
else
clear_fullscreen("oxy")
@@ -356,7 +356,7 @@
if(45 to 70) severity = 4
if(70 to 85) severity = 5
if(85 to INFINITY) severity = 6
overlay_fullscreen("brute", /atom/movable/screen/fullscreen/brute, severity)
overlay_fullscreen("brute", /atom/movable/screen/fullscreen/stretch/brute, severity)
else
clear_fullscreen("brute")
@@ -353,7 +353,7 @@
if((E && (E.status & ORGAN_DEAD)) || !.)
return FALSE
/mob/living/carbon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, laser_pointer = FALSE, type = /atom/movable/screen/fullscreen/flash)
/mob/living/carbon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, laser_pointer = FALSE, type = /atom/movable/screen/fullscreen/stretch/flash)
//Parent proc checks if a mob can_be_flashed()
. = ..()
@@ -1201,9 +1201,9 @@ so that different stomachs can handle things in different ways VB*/
/mob/living/carbon/proc/update_tint()
var/tinttotal = get_total_tint()
if(tinttotal >= TINT_BLIND)
overlay_fullscreen("tint", /atom/movable/screen/fullscreen/blind)
overlay_fullscreen("tint", /atom/movable/screen/fullscreen/stretch/blind)
else if(tinttotal >= TINT_IMPAIR)
overlay_fullscreen("tint", /atom/movable/screen/fullscreen/impaired, 2)
overlay_fullscreen("tint", /atom/movable/screen/fullscreen/stretch/impaired, 2)
else
clear_fullscreen("tint", 0)
@@ -567,7 +567,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
inv.update_icon()
if(w_uniform && istype(w_uniform, /obj/item/clothing/under))
if(client && hud_used && hud_used.hud_shown)
if(client && hud_used && hud_used.hud_version == HUD_STYLE_STANDARD)
if(hud_used.inventory_shown) //if the inventory is open ...
w_uniform.screen_loc = ui_iclothing //...draw the item in the inventory screen
client.screen += w_uniform //Either way, add the item to the HUD
@@ -644,7 +644,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
inv.update_icon()
if(wear_id)
if(client && hud_used && hud_used.hud_shown)
if(client && hud_used && hud_used.hud_version == HUD_STYLE_STANDARD)
wear_id.screen_loc = ui_id
client.screen += wear_id
@@ -660,7 +660,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
inv.update_icon()
if(gloves)
if(client && hud_used && hud_used.hud_shown)
if(client && hud_used && hud_used.hud_version == HUD_STYLE_STANDARD)
if(hud_used.inventory_shown) //if the inventory is open ...
gloves.screen_loc = ui_gloves //...draw the item in the inventory screen
client.screen += gloves //Either way, add the item to the HUD
@@ -702,7 +702,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
if(glasses)
var/mutable_appearance/new_glasses
var/obj/item/organ/external/head/head_organ = get_organ("head")
if(client && hud_used && hud_used.hud_shown)
if(client && hud_used && hud_used.hud_version == HUD_STYLE_STANDARD)
if(hud_used.inventory_shown) //if the inventory is open ...
glasses.screen_loc = ui_glasses //...draw the item in the inventory screen
client.screen += glasses //Either way, add the item to the HUD
@@ -744,7 +744,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
if(l_ear || r_ear)
if(l_ear)
if(client && hud_used && hud_used.hud_shown)
if(client && hud_used && hud_used.hud_version == HUD_STYLE_STANDARD)
if(hud_used.inventory_shown) //if the inventory is open ...
l_ear.screen_loc = ui_l_ear //...draw the item in the inventory screen
client.screen += l_ear //Either way, add the item to the HUD
@@ -761,7 +761,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
overlays_standing[EARS_LAYER] = mutable_appearance('icons/mob/clothing/ears.dmi', "[t_type]", layer = -EARS_LAYER)
if(r_ear)
if(client && hud_used && hud_used.hud_shown)
if(client && hud_used && hud_used.hud_version == HUD_STYLE_STANDARD)
if(hud_used.inventory_shown) //if the inventory is open ...
r_ear.screen_loc = ui_r_ear //...draw the item in the inventory screen
client.screen += r_ear //Either way, add the item to the HUD
@@ -786,7 +786,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
inv.update_icon()
if(shoes)
if(client && hud_used && hud_used.hud_shown)
if(client && hud_used && hud_used.hud_version == HUD_STYLE_STANDARD)
if(hud_used.inventory_shown) //if the inventory is open ...
shoes.screen_loc = ui_shoes //...draw the item in the inventory screen
client.screen += shoes //Either way, add the item to the HUD
@@ -822,7 +822,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
inv.update_icon()
if(s_store)
if(client && hud_used && hud_used.hud_shown)
if(client && hud_used && hud_used.hud_version == HUD_STYLE_STANDARD)
s_store.screen_loc = ui_sstore1
client.screen += s_store
@@ -872,7 +872,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
if(inv)
inv.update_icon()
if(hud_used.hud_shown && belt)
if(hud_used.hud_version == HUD_STYLE_STANDARD && belt)
client.screen += belt
belt.screen_loc = ui_belt
@@ -899,7 +899,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
inv.update_icon()
if(wear_suit && istype(wear_suit, /obj/item/clothing/suit))
if(client && hud_used && hud_used.hud_shown)
if(client && hud_used && hud_used.hud_version == HUD_STYLE_STANDARD)
if(hud_used.inventory_shown) //if the inventory is open ...
wear_suit.screen_loc = ui_oclothing //TODO //...draw the item in the inventory screen
client.screen += wear_suit //Either way, add the item to the HUD
@@ -948,7 +948,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
if(inv)
inv.update_icon()
if(hud_used.hud_shown)
if(hud_used.hud_version == HUD_STYLE_STANDARD)
if(l_store)
client.screen += l_store
l_store.screen_loc = ui_storage1
@@ -1082,21 +1082,21 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
//update whether our head item appears on our hud.
/mob/living/carbon/human/update_hud_head(obj/item/I)
if(client && hud_used && hud_used.hud_shown)
if(client && hud_used && hud_used.hud_version == HUD_STYLE_STANDARD)
if(hud_used.inventory_shown)
I.screen_loc = ui_head
client.screen += I
//update whether our mask item appears on our hud.
/mob/living/carbon/human/update_hud_wear_mask(obj/item/I)
if(client && hud_used && hud_used.hud_shown)
if(client && hud_used && hud_used.hud_version == HUD_STYLE_STANDARD)
if(hud_used.inventory_shown)
I.screen_loc = ui_mask
client.screen += I
//update whether our back item appears on our hud.
/mob/living/carbon/human/update_hud_back(obj/item/I)
if(client && hud_used && hud_used.hud_shown)
if(client && hud_used && hud_used.hud_version == HUD_STYLE_STANDARD)
I.screen_loc = ui_back
client.screen += I
@@ -13,7 +13,7 @@
/mob/living/carbon/human/update_nearsighted_effects()
var/obj/item/clothing/glasses/G = glasses
if(HAS_TRAIT(src, TRAIT_NEARSIGHT) && (!istype(G) || !G.prescription))
overlay_fullscreen("nearsighted", /atom/movable/screen/fullscreen/impaired, 1)
overlay_fullscreen("nearsighted", /atom/movable/screen/fullscreen/stretch/impaired, 1)
else
clear_fullscreen("nearsighted")
+1 -1
View File
@@ -828,7 +828,7 @@
return TRUE
//called when the mob receives a bright flash
/mob/living/proc/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, laser_pointer = FALSE, type = /atom/movable/screen/fullscreen/flash)
/mob/living/proc/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, laser_pointer = FALSE, type = /atom/movable/screen/fullscreen/stretch/flash)
if(can_be_flashed(intensity, override_blindness_check))
overlay_fullscreen("flash", type)
addtimer(CALLBACK(src, PROC_REF(clear_fullscreen), "flash", 25), 25)
+1 -1
View File
@@ -173,7 +173,7 @@
healths.icon_state = "health7"
severity = 6
if(severity > 0)
overlay_fullscreen("brute", /atom/movable/screen/fullscreen/brute, severity)
overlay_fullscreen("brute", /atom/movable/screen/fullscreen/stretch/brute, severity)
else
clear_fullscreen("brute")
if(health <= HEALTH_THRESHOLD_CRIT)
@@ -1,12 +1,19 @@
/mob/living/update_blind_effects()
/mob/living/update_blind_effects(sleeping = FALSE)
if(!has_vision(information_only=TRUE))
overlay_fullscreen("blind", /atom/movable/screen/fullscreen/blind)
if(sleeping)
overlay_fullscreen("sleepblind", /atom/movable/screen/fullscreen/center/blind/sleeping, animated = 2 SECONDS)
overlay_fullscreen("disky", /atom/movable/screen/fullscreen/center/blind/disky, animated = 7 SECONDS)
throw_alert("blind", /atom/movable/screen/alert/blind)
return TRUE
overlay_fullscreen("blind", /atom/movable/screen/fullscreen/stretch/blind)
throw_alert("blind", /atom/movable/screen/alert/blind)
return TRUE
else
clear_fullscreen("blind")
clear_fullscreen("sleepblind")
clear_fullscreen("disky")
clear_alert("blind")
return 0
return FALSE
/mob/living/update_blurry_effects()
var/atom/movable/plane_master_controller/game_plane_master_controller = hud_used?.plane_master_controllers[PLANE_MASTERS_GAME]
@@ -19,7 +26,7 @@
/mob/living/update_druggy_effects()
if(AmountDruggy())
overlay_fullscreen("high", /atom/movable/screen/fullscreen/high)
overlay_fullscreen("high", /atom/movable/screen/fullscreen/stretch/high)
throw_alert("high", /atom/movable/screen/alert/high)
sound_environment_override = SOUND_ENVIRONMENT_DRUGGED
else
@@ -29,7 +36,7 @@
/mob/living/update_nearsighted_effects()
if(HAS_TRAIT(src, TRAIT_NEARSIGHT))
overlay_fullscreen("nearsighted", /atom/movable/screen/fullscreen/impaired, 1)
overlay_fullscreen("nearsighted", /atom/movable/screen/fullscreen/stretch/impaired, 1)
else
clear_fullscreen("nearsighted")
@@ -447,7 +447,7 @@
/mob/living/silicon/get_access()
return IGNORE_ACCESS //silicons always have access
/mob/living/silicon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /atom/movable/screen/fullscreen/flash/noise)
/mob/living/silicon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /atom/movable/screen/fullscreen/stretch/flash/noise)
if(affect_silicon)
return ..()
@@ -141,7 +141,7 @@ Difficulty: Hard
H.apply_status_effect(STATUS_EFFECT_BUBBLEGUM_CURSE, src)
if(second_life)
H.clear_fullscreen("Bubblegum")
H.overlay_fullscreen("Bubblegum", /atom/movable/screen/fullscreen/fog, 2)
H.overlay_fullscreen("Bubblegum", /atom/movable/screen/fullscreen/stretch/fog, 2)
/mob/living/simple_animal/hostile/megafauna/bubblegum/death(gibbed)
@@ -194,7 +194,7 @@
healths.icon_state = "slime_health7"
severity = 6
if(severity > 0)
overlay_fullscreen("brute", /atom/movable/screen/fullscreen/brute, severity)
overlay_fullscreen("brute", /atom/movable/screen/fullscreen/stretch/brute, severity)
else
clear_fullscreen("brute")
+5 -1
View File
@@ -19,8 +19,10 @@
if(updating)
update_sight()
update_blind_effects()
update_blind_effects(TRUE)
set_typing_indicator(FALSE)
if(hud_used && client)
hud_used.show_hud(HUD_STYLE_ACTIONHUD)
return TRUE
@@ -41,6 +43,8 @@
if(updating)
update_sight()
update_blind_effects()
if(hud_used && client)
hud_used.show_hud(HUD_STYLE_STANDARD)
return TRUE
+1 -1
View File
@@ -1254,7 +1254,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
sync_nightvision_screen() //Sync up the overlay used for nightvision to the amount of see_in_dark a mob has. This needs to be called everywhere sync_lighting_plane_alpha() is.
/mob/proc/sync_nightvision_screen()
var/atom/movable/screen/fullscreen/see_through_darkness/S = screens["see_through_darkness"]
var/atom/movable/screen/fullscreen/stretch/see_through_darkness/S = screens["see_through_darkness"]
if(S)
var/suffix = ""
switch(see_in_dark)