Fading titlescreen from /tg/

This commit is contained in:
ShadowLarkens
2020-08-25 16:50:23 -07:00
parent a69e94f948
commit 264793b36a
3 changed files with 46 additions and 0 deletions

View File

@@ -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 ..()

View File

@@ -416,6 +416,9 @@ var/global/datum/controller/subsystem/ticker/ticker
// Created their playable character, delete their /mob/new_player
if(new_char)
qdel(player)
if(new_char.client)
var/obj/screen/splash/S = new(new_char.client, TRUE)
S.Fade(TRUE)
// If they're a carbon, they can get manifested
if(J?.mob_type & JOB_CARBON)

View File

@@ -418,6 +418,9 @@
var/mob/living/character = create_character(T) //creates the human and transfers vars and mind
character = job_master.EquipRank(character, rank, 1) //equips the human
UpdateFactionList(character)
if(character && character.client)
var/obj/screen/splash/Spl = new(character.client, TRUE)
Spl.Fade(TRUE)
var/datum/job/J = SSjob.get_job(rank)