From 9693fb456a3f8f63e73e6e504fe75de1d148d271 Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Tue, 5 Oct 2021 19:51:08 -0400 Subject: [PATCH] Makes the roundend theme a config (#61573) --- code/controllers/subsystem/ticker.dm | 22 ++++++++---------- .../reboot_themes}/apcdestroyed.ogg | Bin .../reboot_themes}/bangindonk.ogg | Bin .../reboot_themes}/bully2.ogg | Bin .../reboot_themes}/disappointed.ogg | Bin .../reboot_themes}/its_only_game.ogg | Bin .../reboot_themes}/leavingtg.ogg | Bin .../reboot_themes}/newroundsexy.ogg | Bin .../reboot_themes}/petersondisappointed.ogg | Bin .../reboot_themes}/scrunglartiy.ogg | Bin .../reboot_themes}/yeehaw.ogg | Bin 11 files changed, 10 insertions(+), 12 deletions(-) rename {sound/roundend => config/reboot_themes}/apcdestroyed.ogg (100%) rename {sound/roundend => config/reboot_themes}/bangindonk.ogg (100%) rename {sound/roundend => config/reboot_themes}/bully2.ogg (100%) rename {sound/roundend => config/reboot_themes}/disappointed.ogg (100%) rename {sound/roundend => config/reboot_themes}/its_only_game.ogg (100%) rename {sound/roundend => config/reboot_themes}/leavingtg.ogg (100%) rename {sound/roundend => config/reboot_themes}/newroundsexy.ogg (100%) rename {sound/roundend => config/reboot_themes}/petersondisappointed.ogg (100%) rename {sound/roundend => config/reboot_themes}/scrunglartiy.ogg (100%) rename {sound/roundend => config/reboot_themes}/yeehaw.ogg (100%) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 1240fca786d..3237555a3d6 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -662,18 +662,7 @@ SUBSYSTEM_DEF(ticker) save_admin_data() update_everything_flag_in_db() if(!round_end_sound) - round_end_sound = pick(\ - 'sound/roundend/newroundsexy.ogg', - 'sound/roundend/apcdestroyed.ogg', - 'sound/roundend/bangindonk.ogg', - 'sound/roundend/leavingtg.ogg', - 'sound/roundend/its_only_game.ogg', - 'sound/roundend/yeehaw.ogg', - 'sound/roundend/disappointed.ogg', - 'sound/roundend/scrunglartiy.ogg', - 'sound/roundend/petersondisappointed.ogg', - 'sound/roundend/bully2.ogg'\ - ) + round_end_sound = choose_round_end_song() ///The reference to the end of round sound that we have chosen. var/sound/end_of_round_sound_ref = sound(round_end_sound) for(var/mob/M in GLOB.player_list) @@ -681,3 +670,12 @@ SUBSYSTEM_DEF(ticker) SEND_SOUND(M.client, end_of_round_sound_ref) text2file(login_music, "data/last_round_lobby_music.txt") + +/datum/controller/subsystem/ticker/proc/choose_round_end_song() + var/list/reboot_sounds = flist("[global.config.directory]/reboot_themes/") + var/list/possible_themes = list() + + for(var/themes in reboot_sounds) + possible_themes += themes + if(possible_themes.len) + return "[global.config.directory]/reboot_themes/[pick(possible_themes)]" diff --git a/sound/roundend/apcdestroyed.ogg b/config/reboot_themes/apcdestroyed.ogg similarity index 100% rename from sound/roundend/apcdestroyed.ogg rename to config/reboot_themes/apcdestroyed.ogg diff --git a/sound/roundend/bangindonk.ogg b/config/reboot_themes/bangindonk.ogg similarity index 100% rename from sound/roundend/bangindonk.ogg rename to config/reboot_themes/bangindonk.ogg diff --git a/sound/roundend/bully2.ogg b/config/reboot_themes/bully2.ogg similarity index 100% rename from sound/roundend/bully2.ogg rename to config/reboot_themes/bully2.ogg diff --git a/sound/roundend/disappointed.ogg b/config/reboot_themes/disappointed.ogg similarity index 100% rename from sound/roundend/disappointed.ogg rename to config/reboot_themes/disappointed.ogg diff --git a/sound/roundend/its_only_game.ogg b/config/reboot_themes/its_only_game.ogg similarity index 100% rename from sound/roundend/its_only_game.ogg rename to config/reboot_themes/its_only_game.ogg diff --git a/sound/roundend/leavingtg.ogg b/config/reboot_themes/leavingtg.ogg similarity index 100% rename from sound/roundend/leavingtg.ogg rename to config/reboot_themes/leavingtg.ogg diff --git a/sound/roundend/newroundsexy.ogg b/config/reboot_themes/newroundsexy.ogg similarity index 100% rename from sound/roundend/newroundsexy.ogg rename to config/reboot_themes/newroundsexy.ogg diff --git a/sound/roundend/petersondisappointed.ogg b/config/reboot_themes/petersondisappointed.ogg similarity index 100% rename from sound/roundend/petersondisappointed.ogg rename to config/reboot_themes/petersondisappointed.ogg diff --git a/sound/roundend/scrunglartiy.ogg b/config/reboot_themes/scrunglartiy.ogg similarity index 100% rename from sound/roundend/scrunglartiy.ogg rename to config/reboot_themes/scrunglartiy.ogg diff --git a/sound/roundend/yeehaw.ogg b/config/reboot_themes/yeehaw.ogg similarity index 100% rename from sound/roundend/yeehaw.ogg rename to config/reboot_themes/yeehaw.ogg