forked from ParadiseSS13/Paradise
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
80 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#define COMSIG_GLOB_CINEMATIC_WAITING_TO_PLAY "!cinematic_waiting_to_play" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,33 @@ | ||
/datum/cinematic/credits | ||
cleanup_time = 20 SECONDS | ||
is_global = TRUE | ||
|
||
/datum/cinematic/New(watcher, datum/callback/special_callback) | ||
/datum/cinematic/credits/New(watcher, datum/callback/special_callback) | ||
. = ..() | ||
screen = new/obj/screen/cinematic/credits(src) | ||
|
||
/datum/cinematic/credits/play_cinematic() | ||
if(!SScredits.end_titles || SScredits.end_titles.len == 0) | ||
SScredits.end_titles = SScredits.generate_titles() | ||
|
||
var/list/credits = list() | ||
/datum/cinematic/credits/start_cinematic(list/watchers) | ||
|
||
play_cinematic_sound(SScredits.title_music) | ||
watching = watchers | ||
if(SEND_GLOBAL_SIGNAL(COMSIG_GLOB_PLAY_CINEMATIC, src) & COMPONENT_GLOB_BLOCK_CINEMATIC) | ||
RegisterSignal(SSdcs, COMSIG_GLOB_CINEMATIC_WAITING_TO_PLAY, PROC_REF(queue_gone)) | ||
return | ||
. = ..() | ||
|
||
play_credits_for_all_watchers(credits) | ||
/datum/cinematic/credits/proc/queue_gone(datum/source, datum/cinematic/other) | ||
SIGNAL_HANDLER | ||
|
||
stoplag(SScredits.credit_roll_speed) | ||
start_cinematic(src.watching) | ||
|
||
QDEL_NULL(credits) | ||
/datum/cinematic/credits/play_cinematic() | ||
play_cinematic_sound(sound(SScredits.title_music)) | ||
SScredits.roll_credits_for_clients(watching) | ||
|
||
special_callback?.Invoke() | ||
|
||
stop_cinematic() | ||
|
||
/datum/cinematic/credits/proc/play_credits_for_all_watchers(list/credits) | ||
for(var/client/client in watching) | ||
play_credits_for_watcher(credits,client) | ||
|
||
/datum/cinematic/credits/proc/play_credits_for_watcher(list/credits, client/client) | ||
for(var/end_title in SScredits.end_titles) | ||
if(!client) | ||
return | ||
var/obj/screen/credit/title = new(null, end_title, client) | ||
title.rollem() | ||
credits += title | ||
stoplag(SScredits.credit_spawn_speed) | ||
|
||
stoplag(SScredits.credit_roll_speed) | ||
|
||
/obj/screen/cinematic/credits | ||
icon = 'icons/mob/screen_gen.dmi' | ||
icon_state = "black" | ||
screen_loc = "WEST,SOUTH to EAST,NORTH" | ||
plane = 30 | ||
|
||
/obj/screen/credit | ||
icon_state = "blank" | ||
mouse_opacity = 0 | ||
alpha = 0 | ||
screen_loc = "CENTER-7,CENTER-7" | ||
plane = 21 | ||
|
||
var/matrix/target | ||
var/client/parent | ||
|
||
/obj/screen/credit/Initialize(mapload, credited, client/client) | ||
. = ..() | ||
|
||
parent = client | ||
maptext = {"<div style="font:'Small Fonts'">[credited]</div>"} | ||
maptext_height = world.icon_size * 2 | ||
maptext_width = world.icon_size * 14 | ||
|
||
/obj/screen/credit/proc/rollem() | ||
var/matrix/M = matrix(transform) | ||
M.Translate(0, SScredits.credit_animate_height) | ||
animate(src, transform = M, time = SScredits.credit_roll_speed) | ||
target = M | ||
animate(src, alpha = 255, time = SScredits.credit_ease_duration, flags = ANIMATION_PARALLEL) | ||
spawn(SScredits.credit_roll_speed - SScredits.credit_ease_duration) | ||
if(!QDELETED(src)) | ||
animate(src, alpha = 0, transform = target, time = SScredits.credit_ease_duration) | ||
sleep(SScredits.credit_ease_duration) | ||
qdel(src) | ||
parent.screen += src | ||
plane = SPLASHSCREEN_PLANE | ||
|
||
/obj/screen/credit/Destroy() | ||
if(parent) | ||
parent.screen -= src | ||
LAZYREMOVE(parent.credits, src) | ||
parent = null | ||
return ..() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters