mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
74 lines
2.3 KiB
Plaintext
74 lines
2.3 KiB
Plaintext
/* #define CREDIT_ROLL_SPEED (12.5 SECONDS) // BUBBER EDIT
|
|
#define CREDIT_SPAWN_SPEED (1 SECONDS)
|
|
#define CREDIT_ANIMATE_HEIGHT (14 * ICON_SIZE_Y)
|
|
#define CREDIT_EASE_DURATION (2.2 SECONDS)
|
|
#define CREDITS_PATH "[global.config.directory]/contributors.dmi"
|
|
|
|
/client/proc/RollCredits()
|
|
set waitfor = FALSE
|
|
if(!fexists(CREDITS_PATH))
|
|
return
|
|
var/icon/credits_icon = new(CREDITS_PATH)
|
|
LAZYINITLIST(credits)
|
|
var/list/_credits = credits
|
|
ASSIGN_GAME_VERB(src, /client, ClearCredits)
|
|
var/static/list/credit_order_for_this_round
|
|
if(isnull(credit_order_for_this_round))
|
|
credit_order_for_this_round = list("Thanks for playing!") + (shuffle(icon_states(credits_icon)) - "Thanks for playing!")
|
|
for(var/I in credit_order_for_this_round)
|
|
if(!credits)
|
|
return
|
|
_credits += new /atom/movable/screen/credit(null, null, I, src, credits_icon)
|
|
sleep(CREDIT_SPAWN_SPEED)
|
|
sleep(CREDIT_ROLL_SPEED - CREDIT_SPAWN_SPEED)
|
|
UNASSIGN_GAME_VERB(src, /client, ClearCredits)
|
|
qdel(credits_icon)
|
|
|
|
GAME_VERB_PROC(/client, ClearCredits, "Hide Credits", "OOC")
|
|
UNASSIGN_GAME_VERB(src, /client, ClearCredits)
|
|
QDEL_LIST(credits)
|
|
credits = null
|
|
|
|
/atom/movable/screen/credit
|
|
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
|
alpha = 0
|
|
screen_loc = "12,1"
|
|
plane = SPLASHSCREEN_PLANE
|
|
var/client/parent
|
|
|
|
/atom/movable/screen/credit/Initialize(mapload, datum/hud/hud_owner, credited, client/P, icon/I)
|
|
. = ..()
|
|
icon = I
|
|
parent = P
|
|
icon_state = credited
|
|
maptext = MAPTEXT_PIXELLARI(credited)
|
|
maptext_x = ICON_SIZE_X + 8
|
|
maptext_y = (ICON_SIZE_Y / 2) - 4
|
|
maptext_width = ICON_SIZE_X * 6
|
|
var/matrix/M = matrix(transform)
|
|
M.Translate(0, CREDIT_ANIMATE_HEIGHT)
|
|
animate(src, transform = M, time = CREDIT_ROLL_SPEED)
|
|
animate(src, alpha = 255, time = CREDIT_EASE_DURATION, flags = ANIMATION_PARALLEL)
|
|
addtimer(CALLBACK(src, PROC_REF(FadeOut)), CREDIT_ROLL_SPEED - CREDIT_EASE_DURATION)
|
|
QDEL_IN(src, CREDIT_ROLL_SPEED)
|
|
if(parent)
|
|
parent.screen += src
|
|
|
|
/atom/movable/screen/credit/Destroy()
|
|
icon = null
|
|
if(parent)
|
|
parent.screen -= src
|
|
LAZYREMOVE(parent.credits, src)
|
|
parent = null
|
|
return ..()
|
|
|
|
/atom/movable/screen/credit/proc/FadeOut()
|
|
animate(src, alpha = 0, time = CREDIT_EASE_DURATION, flags = ANIMATION_PARALLEL)
|
|
|
|
#undef CREDIT_ANIMATE_HEIGHT
|
|
#undef CREDIT_EASE_DURATION
|
|
#undef CREDIT_ROLL_SPEED
|
|
#undef CREDIT_SPAWN_SPEED
|
|
#undef CREDITS_PATH
|
|
*/ // BUBBER EDIT
|