Title screen timer (#17200)

* Atomization

* cl

---------

Co-authored-by: FluffyGhost <FluffyGhost>
This commit is contained in:
Fluffy
2023-09-01 01:05:41 +00:00
committed by GitHub
co-authored by FluffyGhost <FluffyGhost>
parent 4f36be02df
commit 9c28aec1af
2 changed files with 54 additions and 2 deletions
+13 -2
View File
@@ -66,6 +66,14 @@
name = "Title"
screen_loc = "WEST,SOUTH"
var/lobby_index = 1
var/refresh_timer_id = null
/obj/screen/new_player/title/Destroy(force)
if(refresh_timer_id)
deltimer(refresh_timer_id)
refresh_timer_id = null
. = ..()
/obj/screen/new_player/title/Initialize()
if(SSatlas.current_sector.sector_lobby_art)
@@ -87,7 +95,7 @@
spawn(current_map.lobby_transitions)
Update()
else
addtimer(CALLBACK(src, PROC_REF(Update)), current_map.lobby_transitions, TIMER_UNIQUE | TIMER_CLIENT_TIME | TIMER_OVERRIDE)
refresh_timer_id = addtimer(CALLBACK(src, PROC_REF(Update)), current_map.lobby_transitions, TIMER_UNIQUE | TIMER_CLIENT_TIME | TIMER_OVERRIDE | TIMER_STOPPABLE)
else
icon_state = pick(current_map.lobby_screens)
else //This should basically never happen.
@@ -99,6 +107,9 @@
return
/obj/screen/new_player/title/proc/Update()
if(QDELING(src))
return
if(!current_map.lobby_transitions && SSatlas.current_sector.sector_lobby_transitions)
return
if(!istype(hud) || !isnewplayer(hud.mymob))
@@ -112,7 +123,7 @@
spawn(current_map.lobby_transitions)
Update()
else
addtimer(CALLBACK(src, PROC_REF(Update)), current_map.lobby_transitions, TIMER_UNIQUE | TIMER_CLIENT_TIME | TIMER_OVERRIDE)
refresh_timer_id = addtimer(CALLBACK(src, PROC_REF(Update)), current_map.lobby_transitions, TIMER_UNIQUE | TIMER_CLIENT_TIME | TIMER_OVERRIDE | TIMER_STOPPABLE)
/obj/screen/new_player/selection
var/click_sound = 'sound/effects/menu_click.ogg'