diff --git a/modular_ss220/credits/code/SScredits.dm b/modular_ss220/credits/code/SScredits.dm index d069c772e1af..d8c80be2f631 100644 --- a/modular_ss220/credits/code/SScredits.dm +++ b/modular_ss220/credits/code/SScredits.dm @@ -3,6 +3,8 @@ SUBSYSTEM_DEF(credits) runlevels = RUNLEVEL_POSTGAME flags = SS_NO_FIRE + var/datum/cinematic/credits/current_cinematic + var/datum/credits/end_titles var/title_music = "" @@ -25,7 +27,7 @@ SUBSYSTEM_DEF(credits) title_music = end_titles.soundtrack - play_cinematic(cinematic_type, world) + current_cinematic = play_cinematic(cinematic_type, world) /datum/controller/subsystem/credits/proc/roll_credits_for_clients(list/clients) end_titles.roll_credits_for_clients(clients) @@ -35,4 +37,5 @@ SUBSYSTEM_DEF(credits) return for(var/credit in client.credits) + client.screen -= credit QDEL_NULL(credit) diff --git a/modular_ss220/credits/code/credits.dm b/modular_ss220/credits/code/credits.dm index 9b807a7771f4..91dd23814ba5 100644 --- a/modular_ss220/credits/code/credits.dm +++ b/modular_ss220/credits/code/credits.dm @@ -2,6 +2,7 @@ /datum/credits var/list/credits = list() + var/list/screen_credits = list() var/playing_time var/delay_time = 5 SECONDS @@ -36,21 +37,17 @@ playing_time -= credit_spawn_speed playing_time += credit_roll_speed -/datum/credits/proc/roll_credits_for_clients(list/clients) +/datum/credits/proc/roll_credits_for_clients(list/client/clients) for(var/client/client in clients) - setup_credits_for_client(client) + LAZYINITLIST(client.credits) - addtimer(CALLBACK(src, PROC_REF(start_rolling_credits_for_clients), clients), delay_time) - -/datum/credits/proc/setup_credits_for_client(client/client) - LAZYINITLIST(client.credits) - - var/obj/screen/credit/logo = new /obj/screen/credit/logo(null, "", client) + var/obj/screen/credit/logo = new /obj/screen/credit/logo(null, "", clients) + screen_credits += logo - client.credits += logo + addtimer(CALLBACK(src, PROC_REF(start_rolling_credits_for_clients), clients), delay_time) -/datum/credits/proc/start_rolling_credits_for_clients(list/clients) - addtimer(CALLBACK(src, PROC_REF(start_rolling_logo_for_clients), clients,), SScredits.credit_roll_speed / 2.5) +/datum/credits/proc/start_rolling_credits_for_clients(list/client/clients) + addtimer(CALLBACK(src, PROC_REF(start_rolling_logo)), SScredits.credit_roll_speed / 2.5) for(var/datum/credit/credit in credits) for(var/item in credit.content) @@ -59,30 +56,26 @@ addtimer(CALLBACK(src, PROC_REF(clear_credits_for_clients), clients), SScredits.credit_roll_speed) -/datum/credits/proc/start_rolling_logo_for_clients(list/clients) - for(var/client/client in clients) - if(!client?.credits) - continue - - var/obj/screen/credit/logo/logo = client.credits[1] - logo.rollem() +/datum/credits/proc/start_rolling_logo() + var/obj/screen/credit/logo/logo = screen_credits[1] + logo.rollem() /datum/credits/proc/start_rolling_credit_item(list/clients, credit_item) - for(var/client/client in clients) - if(!client?.credits) - continue + var/obj/screen/credit/title = new(null, credit_item, clients) + screen_credits += title - var/obj/screen/credit/title = new(null, credit_item, client) - client.credits += title - title.rollem() + title.rollem() /datum/credits/proc/clear_credits_for_clients(list/clients) + screen_credits.Cut() + for(var/client/client in clients) if(!client?.credits) continue SScredits.clear_credits(client) + SScredits.current_cinematic = null /datum/credits/default @@ -171,8 +164,13 @@ return var/datum/db_query/ranks_ckey_read = SSdbcore.NewQuery( - "SELECT ckey FROM admin WHERE admin_rank=:rank", - list("rank" = "Банда")) + "SELECT ckey FROM admin WHERE admin_rank=:rank OR admin_rank=:rank1 OR admin_rank=:rank2 OR admin_rank=:rank3", + list( + "rank" = "Банда", + "rank1" = "Братюня", + "rank2" = "Максон", + "rank3" = "Сестрюня" + )) if(!ranks_ckey_read.warn_execute()) qdel(ranks_ckey_read) @@ -216,7 +214,7 @@ for(var/client/client in GLOB.clients) if(!client.donator_level) continue - if(client.holder) + if(client.donator_level > DONATOR_LEVEL_MAX) continue if(!length(donators)) donators += "
" @@ -379,12 +377,21 @@ screen_loc = "CENTER-7,CENTER-7" plane = CREDITS_PLANE - var/client/parent + var/list/client/watchers = list() -/obj/screen/credit/Initialize(mapload, credited, client/client) +/obj/screen/credit/Initialize(mapload, credited, list/client/clients) . = ..() - parent = client + for(var/client/watcher in clients) + if(!watcher) + continue + if(!watcher.credits) + continue + watcher.credits += src + watcher.screen += src + watchers += watcher + + maptext = {"
[credited]
"} maptext_height = world.icon_size * 2 maptext_width = world.icon_size * 14 @@ -396,17 +403,20 @@ matrix.Translate(0, SScredits.credit_animate_height) animate(src, transform = matrix, time = SScredits.credit_roll_speed) addtimer(CALLBACK(src, PROC_REF(delete_credit)), SScredits.credit_roll_speed, TIMER_CLIENT_TIME) - parent.screen += src /obj/screen/credit/proc/delete_credit() if(!QDELETED(src)) qdel(src) /obj/screen/credit/Destroy() - if(parent) - parent.screen -= src - LAZYREMOVE(parent.credits, src) - parent = null + for(var/client/watcher in watchers) + if(!watcher) + continue + watcher.screen -= src + LAZYREMOVE(watcher.credits, src) + + watchers.Cut() + return ..() /obj/screen/credit/logo @@ -416,15 +426,13 @@ alpha = 100 -/obj/screen/credit/logo/Initialize(mapload, credited, client/client) +/obj/screen/credit/logo/Initialize(mapload, credited, list/client/clients) . = ..() animate(src, alpha = 220, time = 3 SECONDS) maptext = "

Playing music - [SScredits.title_music]

" maptext_height = 10 * world.icon_size maptext_x -= 5 * world.icon_size maptext_y += 6 * world.icon_size - parent.screen += src - /obj/screen/credit/logo/rollem() var/matrix/matrix = matrix(transform) diff --git a/modular_ss220/credits/code/halloween_credits.dm b/modular_ss220/credits/code/halloween_credits.dm index f98d80adbbda..1cc414679c89 100644 --- a/modular_ss220/credits/code/halloween_credits.dm +++ b/modular_ss220/credits/code/halloween_credits.dm @@ -13,19 +13,24 @@ credits += new /datum/credit/staff/halloween() credits += new /datum/credit/disclaimer() -/datum/credits/halloween/setup_credits_for_client(client/client) - LAZYINITLIST(client.credits) +/datum/credits/halloween/roll_credits_for_clients(list/client/clients) + for(var/client/client in clients) + LAZYINITLIST(client.credits) - var/obj/screen/credit/logo = new /obj/screen/credit/halloween(null, "", client) - client.credits += logo + var/obj/screen/credit/logo = new /obj/screen/credit/halloween(null, "", clients) + screen_credits += logo -/datum/credits/halloween/start_rolling_logo_for_clients(list/clients) - for(var/client/client in clients) - if(!client?.credits) - continue + addtimer(CALLBACK(src, PROC_REF(start_rolling_credits_for_clients), clients), delay_time) - var/obj/screen/credit/logo/logo = client.credits[1] - logo.rollem() +/datum/credits/halloween/start_rolling_credits_for_clients(list/client/clients) + addtimer(CALLBACK(src, PROC_REF(start_rolling_logo)), SScredits.credit_roll_speed / 2.5) + + for(var/datum/credit/credit in credits) + for(var/item in credit.content) + start_rolling_credit_item(clients, item) + sleep(SScredits.credit_spawn_speed) + + addtimer(CALLBACK(src, PROC_REF(clear_credits_for_clients), clients), SScredits.credit_roll_speed) /datum/credit/episode_title/halloween @@ -176,9 +181,9 @@ appearance_flags = NO_CLIENT_COLOR | TILE_BOUND | PIXEL_SCALE alpha = 255 -/obj/screen/credit/halloween/Initialize(mapload, credited, client/client) +/obj/screen/credit/halloween/Initialize(mapload, credited, list/client/clients) . = ..() - parent.screen += src + plane++ transform = transform.Scale(1.5)