mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Fading titlescreen from /tg/
This commit is contained in:
@@ -633,3 +633,43 @@
|
||||
/obj/screen/setup_preview/bg/Click(params)
|
||||
pref?.bgstate = next_in_list(pref.bgstate, pref.bgstate_options)
|
||||
pref?.update_preview_icon()
|
||||
|
||||
/obj/screen/splash
|
||||
screen_loc = "1,1"
|
||||
layer = LAYER_HUD_ABOVE
|
||||
plane = PLANE_PLAYER_HUD_ABOVE
|
||||
var/client/holder
|
||||
|
||||
/obj/screen/splash/New(client/C, visible)
|
||||
. = ..()
|
||||
|
||||
holder = C
|
||||
|
||||
if(!visible)
|
||||
alpha = 0
|
||||
|
||||
if(!lobby_image)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
icon = lobby_image.icon
|
||||
icon_state = lobby_image.icon_state
|
||||
|
||||
holder.screen += src
|
||||
|
||||
/obj/screen/splash/proc/Fade(out, qdel_after = TRUE)
|
||||
if(QDELETED(src))
|
||||
return
|
||||
if(out)
|
||||
animate(src, alpha = 0, time = 30)
|
||||
else
|
||||
alpha = 0
|
||||
animate(src, alpha = 255, time = 30)
|
||||
if(qdel_after)
|
||||
QDEL_IN(src, 30)
|
||||
|
||||
/obj/screen/splash/Destroy()
|
||||
if(holder)
|
||||
holder.screen -= src
|
||||
holder = null
|
||||
return ..()
|
||||
|
||||
Reference in New Issue
Block a user