Skip to content

Commit

Permalink
Добавил логотип перед титрами (#454)
Browse files Browse the repository at this point in the history
## Changelog

:cl:
add: Логотип для титров
/:cl:

<!-- Оба :cl:'а должны быть на месте, что-бы чейнджлог работал! Вы
можете написать свой ник справа от первого :cl:, если хотите. Иначе
будет использован ваш ник на ГитХабе. -->
<!-- Вы можете использовать несколько записей с одинаковым префиксом
(Они используются только для иконки в игре) и удалить ненужные. Помните,
что чейнджлог должен быть понятен обычным игроком. -->
<!-- Если чейнджлог не влияет на игроков(например, это рефактор), вы
можете исключить всю секцию. -->
  • Loading branch information
Legendaxe authored Oct 16, 2023
1 parent 42ac8ee commit 572e1e1
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 16 deletions.
2 changes: 1 addition & 1 deletion config/credits/titles/random_titles_plural_2_1.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ПАДЕНИЕ
ВОСТАНИЕ
ВОССТАНИЕ
ПРОБЛЕМЫ
ПОСЛЕДНЯЯ БИТВА
ТЕМНАЯ СТОРОНА
Expand Down
4 changes: 3 additions & 1 deletion modular_ss220/cinematics/code/_cinematics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
var/cleanup_time = 30 SECONDS
/// Whether the cinematic turns off ooc when played globally.
var/stop_ooc = TRUE
// screen type for cinematic backdrop
var/backdrop_type = /obj/screen/fullscreen/cinematic_backdrop

/datum/cinematic/New(watcher, datum/callback/special_callback)
screen = new(src)
Expand Down Expand Up @@ -118,7 +120,7 @@
return

watching += watching_client
watching_mob.overlay_fullscreen("cinematic", /obj/screen/fullscreen/cinematic_backdrop)
watching_mob.overlay_fullscreen("cinematic", backdrop_type)
watching_client.screen += screen
RegisterSignal(watching_client, COMSIG_PARENT_QDELETING, PROC_REF(remove_watcher))

Expand Down
15 changes: 10 additions & 5 deletions modular_ss220/cinematics/code/cinematics/credits.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/datum/cinematic/credits
cleanup_time = 20 SECONDS
cleanup_time = 40 SECONDS
is_global = TRUE
backdrop_type = /obj/screen/fullscreen/cinematic_backdrop/credits

/datum/cinematic/credits/New(watcher, datum/callback/special_callback)
. = ..()
Expand All @@ -25,8 +26,12 @@
special_callback?.Invoke()

/obj/screen/cinematic/credits
icon = 'icons/mob/screen_gen.dmi'
icon_state = "black"
screen_loc = "WEST,SOUTH to EAST,NORTH"
plane = SPLASHSCREEN_PLANE
icon_state = "blank"

/obj/screen/fullscreen/cinematic_backdrop/credits
alpha = 0

/obj/screen/fullscreen/cinematic_backdrop/credits/Initialize(mapload)
. = ..()

animate(src, alpha = 220, time = 3 SECONDS)
51 changes: 42 additions & 9 deletions modular_ss220/credits/code/SScredits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,30 @@ SUBSYSTEM_DEF(credits)
end_titles = generate_titles()

for(var/client/client in clients)
SScredits.roll_credits(client)
SScredits.roll_credits_for_client(client)

/datum/controller/subsystem/credits/proc/roll_credits(client/client)
/datum/controller/subsystem/credits/proc/roll_credits_for_client(client/client)
LAZYINITLIST(client.credits)

var/list/_credits = client.credits

var/obj/screen/credit/logo = new /obj/screen/credit/logo(null, "", client)

addtimer(CALLBACK(src, PROC_REF(roll_credits), _credits, logo, client), 5 SECONDS, TIMER_CLIENT_TIME)

/datum/controller/subsystem/credits/proc/roll_credits(list/credits, obj/screen/credit/logo/logo, client/client)
credits += logo
logo.rollem()

for(var/item in end_titles)
if(!client?.credits)
return
var/obj/screen/credit/title = new(null, item, client)
_credits += title
credits += title
title.rollem()
sleep(credit_spawn_speed)

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

/datum/controller/subsystem/credits/proc/clear_credits(client/client)
if(!client)
return
Expand Down Expand Up @@ -169,22 +176,48 @@ SUBSYSTEM_DEF(credits)
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)
addtimer(CALLBACK(src, PROC_REF(delete_credit)), SScredits.credit_roll_speed - SScredits.credit_ease_duration, TIMER_CLIENT_TIME)
parent.screen += src

/obj/screen/credit/proc/delete_credit()
if(!QDELETED(src))
animate(src, alpha = 0, transform = target, time = SScredits.credit_ease_duration)
sleep(SScredits.credit_ease_duration)
qdel(src)

/obj/screen/credit/Destroy()
if(parent)
parent.screen -= src
LAZYREMOVE(parent.credits, src)
parent = null
return ..()

/obj/screen/credit/logo
icon = 'modular_ss220/credits/icons/logo.dmi'
icon_state = "ss220"
screen_loc = "CENTER - 2,CENTER - 3"
alpha = 100


/obj/screen/credit/logo/Initialize(mapload, credited, client/client)
. = ..()
animate(src, alpha = 220, time = 3 SECONDS)
parent.screen += src

/obj/screen/credit/logo/rollem()
var/matrix/M = matrix(transform)
M.Translate(0, SScredits.credit_animate_height / 2)
animate(src, transform = M, time = SScredits.credit_roll_speed / 2)
target = M
animate(src, alpha = 255, time = SScredits.credit_ease_duration / 2, flags = ANIMATION_PARALLEL)
addtimer(CALLBACK(src, PROC_REF(delete_credit)),(SScredits.credit_roll_speed - SScredits.credit_ease_duration) / 2, TIMER_CLIENT_TIME)


/obj/screen/credit/logo/delete_credit()
if(!QDELETED(src))
animate(src, alpha = 0, transform = target, time = SScredits.credit_ease_duration / 2)
sleep(SScredits.credit_ease_duration / 2)
qdel(src)

/client/var/list/credits

Expand Down
Binary file added modular_ss220/credits/icons/logo.dmi
Binary file not shown.

0 comments on commit 572e1e1

Please sign in to comment.