Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: credits #436

Merged
merged 2 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/controllers/subsystem/SSticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,6 @@ SUBSYSTEM_DEF(ticker)
ending_station_state.count()
var/station_integrity = min(round( 100.0 * GLOB.start_state.score(ending_station_state), 0.1), 100.0)

SScredits.roll_credits_for_all_clients()

to_chat(world, "<BR>[TAB]Shift Duration: <B>[round(ROUND_TIME / 36000)]:[add_zero("[ROUND_TIME / 600 % 60]", 2)]:[ROUND_TIME / 100 % 6][ROUND_TIME / 100 % 10]</B>")
to_chat(world, "<BR>[TAB]Station Integrity: <B>[mode.station_was_nuked ? "<font color='red'>Destroyed</font>" : "[station_integrity]%"]</B>")
to_chat(world, "<BR>")
Expand Down Expand Up @@ -594,6 +592,8 @@ SUBSYSTEM_DEF(ticker)
for(var/datum/team/team in GLOB.antagonist_teams)
team.on_round_end()

SScredits.roll_credits_for_all_clients() // SS220 ADDITION

// Display the scoreboard window
score.scoreboard()

Expand Down
24 changes: 15 additions & 9 deletions modular_ss220/credits/code/SScredits.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#define CREDITS_BACKGROUND_PLANE 25
#define CREDITS_PLANE 26

SUBSYSTEM_DEF(credits)
name = "Credits"
runlevels = RUNLEVEL_POSTGAME
Expand All @@ -24,15 +27,15 @@ SUBSYSTEM_DEF(credits)
if(end_titles)
end_titles = generate_titles()

if(client.mob)
client.mob.overlay_fullscreen("black",/obj/screen/fullscreen/black)
SEND_SOUND(client, sound(title_music, repeat = 0, wait = 0, volume = 85 * client.prefs.get_channel_volume(CHANNEL_LOBBYMUSIC), channel = CHANNEL_LOBBYMUSIC))

addtimer(CALLBACK(src, PROC_REF(roll_credits_for_client), client), 5 SECONDS)
addtimer(CALLBACK(src, PROC_REF(roll_credits_for_client), client), 30 SECONDS, TIMER_CLIENT_TIME)

/datum/controller/subsystem/credits/proc/roll_credits_for_client(client/client)
var/list/_credits = client.credits

if(client.mob)
client.mob.overlay_fullscreen("black",/obj/screen/fullscreen/black)
SEND_SOUND(client, sound(title_music, repeat = FALSE, wait = FALSE, volume = 85 * client.prefs.get_channel_volume(CHANNEL_LOBBYMUSIC), channel = CHANNEL_LOBBYMUSIC))

for(var/item in end_titles)
if(!client.credits)
return
Expand All @@ -41,7 +44,7 @@ SUBSYSTEM_DEF(credits)
title.rollem()
sleep(credit_spawn_speed)

addtimer(CALLBACK(src, PROC_REF(clear_credits), client), (credit_roll_speed))
addtimer(CALLBACK(src, PROC_REF(clear_credits), client), (credit_roll_speed), TIMER_CLIENT_TIME)

/datum/controller/subsystem/credits/proc/clear_credits(client/client)
QDEL_NULL(client.credits)
Expand Down Expand Up @@ -153,16 +156,16 @@ SUBSYSTEM_DEF(credits)
icon = 'icons/mob/screen_gen.dmi'
icon_state = "black"
screen_loc = "WEST,SOUTH to EAST,NORTH"
layer = ABOVE_HUD_LAYER
plane = CREDITS_BACKGROUND_PLANE
show_when_dead = TRUE


/obj/screen/credit
icon_state = "blank"
mouse_opacity = 0
alpha = 0
screen_loc = "CENTER-7,CENTER-7"
plane = HUD_PLANE
layer = HUD_LAYER
plane = CREDITS_PLANE
var/client/parent
var/matrix/target

Expand Down Expand Up @@ -194,3 +197,6 @@ SUBSYSTEM_DEF(credits)
return ..()

/client/var/list/credits

#undef CREDITS_PLANE
#undef CREDITS_BACKGROUND_PLANE
Loading