Better Screen Tints (#12155)

This commit is contained in:
Geeves
2021-07-31 12:49:24 +02:00
committed by GitHub
parent a6b4229591
commit 15099384da
13 changed files with 39 additions and 8 deletions
+5 -1
View File
@@ -5,7 +5,7 @@
/mob/proc/set_fullscreen(condition, screen_name, screen_type, arg)
condition ? overlay_fullscreen(screen_name, screen_type, arg) : clear_fullscreen(screen_name)
/mob/proc/overlay_fullscreen(category, type, severity)
/mob/proc/overlay_fullscreen(category, type, severity, animated = 0)
var/obj/screen/fullscreen/screen = screens[category]
if(screen)
@@ -17,6 +17,8 @@
if(!screen)
screen = new type()
if(animated)
screen.alpha = 0
screen.icon_state = "[initial(screen.icon_state)][severity]"
screen.severity = severity
@@ -24,6 +26,8 @@
screens[category] = screen
if(client && (stat != DEAD || screen.allstate))
client.screen += screen
if(animated)
animate(screen, alpha = initial(screen.alpha), time = animated)
return screen
/mob/proc/clear_fullscreen(category, animated = 10)
+1 -1
View File
@@ -57,7 +57,7 @@
if(!wax)
new /obj/item/trash/candle(src.loc)
if(istype(src.loc, /mob))
src.dropped()
src.dropped(user)
to_chat(user, SPAN_NOTICE("The candle burns out."))
playsound(src.loc, 'sound/items/cigs_lighters/cig_snuff.ogg', 50, 1)
STOP_PROCESSING(SSprocessing, src)
+12
View File
@@ -90,6 +90,18 @@
return 0
return 1
// putting on to a slot
/obj/item/clothing/equipped(mob/user, slot, assisted_equip)
. = ..()
if(tint)
user.handle_vision()
// taking off
/obj/item/clothing/dropped(mob/user)
. = ..()
if(tint)
user.handle_vision()
/obj/item/clothing/proc/return_own_image()
var/image/our_image
if(icon_override)
+1
View File
@@ -519,6 +519,7 @@ BLIND // can't see anything
to_chat(usr, "You push \the [src] up out of your face.")
update_clothing_icon()
usr.update_action_buttons()
usr.handle_vision()
/obj/item/clothing/glasses/aug/welding
name = "glare dampeners"
+2 -1
View File
@@ -76,6 +76,7 @@
to_chat(usr, "You push the [src] up out of your face.")
update_clothing_icon() //so our mob-overlays
usr.update_action_buttons()
usr.handle_vision()
/*
@@ -224,7 +225,7 @@
new /obj/item/clothing/head/pumpkin(src.loc)
new /obj/item/trash/candle(src.loc)
if(istype(src.loc, /mob))
src.dropped()
src.dropped(user)
to_chat(user, SPAN_NOTICE("The candle burns out."))
playsound(src.loc, 'sound/items/cigs_lighters/cig_snuff.ogg', 50, 1)
STOP_PROCESSING(SSprocessing, src)
+1 -1
View File
@@ -700,7 +700,7 @@
playsound(src, 'sound/machines/rig/rig_retract.ogg', 20, FALSE)
use_obj.canremove = 1
holder.drop_from_inventory(use_obj,get_turf(src)) //TODO: TEST THIS CODE!
use_obj.dropped()
use_obj.dropped(wearer)
use_obj.canremove = 0
use_obj.forceMove(src)
+1 -1
View File
@@ -170,7 +170,7 @@ var/list/slot_equipment_priority = list( \
else
W.forceMove(get_turf(W))
W.layer = initial(W.layer)
W.dropped()
W.dropped(src)
return 0
// Removes an item from inventory and places it in the target atom.
@@ -521,7 +521,10 @@
H.set_fullscreen(H.stat == UNCONSCIOUS, "blackout", /obj/screen/fullscreen/blackout)
if(config.welder_vision)
H.set_fullscreen(H.equipment_tint_total, "welder", /obj/screen/fullscreen/impaired, H.equipment_tint_total)
if(H.equipment_tint_total)
H.overlay_fullscreen("welder", /obj/screen/fullscreen/impaired, H.equipment_tint_total, 0.5 SECONDS)
else
H.clear_fullscreen("welder")
var/how_nearsighted = get_how_nearsighted(H)
H.set_fullscreen(how_nearsighted, "nearsighted", /obj/screen/fullscreen/oxy, how_nearsighted)
H.set_fullscreen(H.eye_blurry, "blurry", /obj/screen/fullscreen/blurry)
+1 -1
View File
@@ -126,7 +126,7 @@
return FALSE
return TRUE
/mob/living/proc/handle_vision()
/mob/living/handle_vision()
update_sight()
if(stat == DEAD)
+4 -1
View File
@@ -1246,4 +1246,7 @@ proc/is_blind(A)
if(r_grab.wielded)
. = max(MOB_GRAB_FIREMAN, .)
else
. = max(MOB_GRAB_NORMAL, .)
. = max(MOB_GRAB_NORMAL, .)
/mob/proc/handle_vision()
return
@@ -0,0 +1,7 @@
author: Geeves
delete-after: True
changes:
- rscadd: "Improved the sprites for impaired vision, most commonly from wearing welding gear or unactivated hardsuits."
- rscadd: "Putting on or removing vision impairing equipment will now update it immediately, flipping welding mask/goggles will do the same. This also updates flash and welding protection."
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 MiB

After

Width:  |  Height:  |  Size: 3.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB