diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index aa1445df3b7..0bfeaf5beaf 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1518,7 +1518,7 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) usr = M . = CB.Invoke() usr = temp - + //Returns a list of all servants of Ratvar and observers. /proc/servants_and_ghosts() . = list() @@ -1542,10 +1542,3 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) D.vv_edit_var(var_name, var_value) //same result generally, unless badmemes else D.vars[var_name] = var_value - -/proc/load_rsc_on_all_clients(thingy) - for(var/thing in GLOB.clients) - var/client/C = thing - if (!C) - continue - C.Export("##action=load_rsc", thingy) \ No newline at end of file diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm index 5ab39580fe8..637e65c46fd 100644 --- a/code/controllers/configuration/entries/general.dm +++ b/code/controllers/configuration/entries/general.dm @@ -386,11 +386,3 @@ /datum/config_entry/string/default_view value = "15x15" - - -/datum/config_entry/string/roundend_sound_folder - value = "config/sounds/roundend/" - - -/datum/config_entry/string/lobby_music_folder - value = "config/sounds/title/" diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 8aaba37b985..b919af09228 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -21,7 +21,7 @@ SUBSYSTEM_DEF(ticker) var/login_music //music played in pregame lobby var/round_end_sound //music/jingle played when the world reboots - var/round_end_sound_sent = FALSE //If all clients have loaded it + var/round_end_sound_sent = TRUE //If all clients have loaded it var/list/datum/mind/minds = list() //The characters in the game. Used for objective tracking. @@ -67,7 +67,58 @@ SUBSYSTEM_DEF(ticker) /datum/controller/subsystem/ticker/Initialize(timeofday) load_mode() - login_music = choose_sound(CONFIG_GET(string/lobby_music_folder), trim(file2text("data/last_round_lobby_music.txt"))) + var/list/byond_sound_formats = list( + "mid" = TRUE, + "midi" = TRUE, + "mod" = TRUE, + "it" = TRUE, + "s3m" = TRUE, + "xm" = TRUE, + "oxm" = TRUE, + "wav" = TRUE, + "ogg" = TRUE, + "raw" = TRUE, + "wma" = TRUE, + "aiff" = TRUE + ) + + var/list/provisional_title_music = flist("config/title_music/sounds/") + var/list/music = list() + var/use_rare_music = prob(1) + + for(var/S in provisional_title_music) + var/lower = lowertext(S) + var/list/L = splittext(lower,"+") + switch(L.len) + if(3) //rare+MAP+sound.ogg or MAP+rare.sound.ogg -- Rare Map-specific sounds + if(use_rare_music) + if(L[1] == "rare" && L[2] == SSmapping.config.map_name) + music += S + else if(L[2] == "rare" && L[1] == SSmapping.config.map_name) + music += S + if(2) //rare+sound.ogg or MAP+sound.ogg -- Rare sounds or Map-specific sounds + if((use_rare_music && L[1] == "rare") || (L[1] == SSmapping.config.map_name)) + music += S + if(1) //sound.ogg -- common sound + music += S + + var/old_login_music = trim(file2text("data/last_round_lobby_music.txt")) + if(music.len > 1) + music -= old_login_music + + for(var/S in music) + var/list/L = splittext(S,".") + if(L.len >= 2) + var/ext = lowertext(L[L.len]) //pick the real extension, no 'honk.ogg.exe' nonsense here + if(byond_sound_formats[ext]) + continue + music -= S + + if(isemptylist(music)) + music = world.file2list(ROUND_START_MUSIC_LIST, "\n") + login_music = pick(music) + else + login_music = "config/title_music/sounds/[pick(music)]" if(!GLOB.syndicate_code_phrase) @@ -509,7 +560,11 @@ SUBSYSTEM_DEF(ticker) set waitfor = FALSE round_end_sound_sent = FALSE round_end_sound = fcopy_rsc(the_sound) - load_rsc_on_all_clients(round_end_sound) + for(var/thing in GLOB.clients) + var/client/C = thing + if (!C) + continue + C.Export("##action=load_rsc", round_end_sound) round_end_sound_sent = TRUE /datum/controller/subsystem/ticker/proc/Reboot(reason, end_string, delay) @@ -517,11 +572,6 @@ SUBSYSTEM_DEF(ticker) if(usr && !check_rights(R_SERVER, TRUE)) return - if(!round_end_sound) - round_end_sound_sent = FALSE - round_end_sound = fcopy_rsc(choose_sound(CONFIG_GET(string/roundend_sound_folder))) - load_rsc_on_all_clients(round_end_sound) - round_end_sound_sent = TRUE if(!delay) delay = CONFIG_GET(number/round_end_countdown) * 10 @@ -548,55 +598,16 @@ SUBSYSTEM_DEF(ticker) /datum/controller/subsystem/ticker/Shutdown() gather_newscaster() //called here so we ensure the log is created even upon admin reboot + 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'\ + ) - SEND_SOUND(world, round_end_sound) + SEND_SOUND(world, sound(round_end_sound)) text2file(login_music, "data/last_round_lobby_music.txt") - -/datum/controller/subsystem/ticker/proc/choose_sound(folder, dont_use = "", sound_prob = 1) - var/list/sound_list = flist(folder) - var/list/sounds = list() - var/use_rare_sound = prob(sound_prob) - - var/list/byond_sound_formats = list( - "mid" = TRUE, - "midi" = TRUE, - "mod" = TRUE, - "it" = TRUE, - "s3m" = TRUE, - "xm" = TRUE, - "oxm" = TRUE, - "wav" = TRUE, - "ogg" = TRUE, - "raw" = TRUE, - "wma" = TRUE, - "aiff" = TRUE - ) - - for(var/S in sound_list) - var/lower = lowertext(S) - var/list/L = splittext(lower,"+") - switch(L.len) - if(3) //rare+MAP+sound.ogg or MAP+rare.sound.ogg -- Rare Map-specific sounds - if(use_rare_sound) - if(L[1] == "rare" && L[2] == SSmapping.config.map_name) - sounds += S - else if(L[2] == "rare" && L[1] == SSmapping.config.map_name) - sounds += S - if(2) //rare+sound.ogg or MAP+sound.ogg -- Rare sounds or Map-specific sounds - if((use_rare_sound && L[1] == "rare") || (L[1] == SSmapping.config.map_name)) - sounds += S - if(1) //sound.ogg -- common sound - sounds += S - - if(dont_use && lentext(dont_use) > 1) - sounds -= dont_use - - for(var/S in sounds) - var/list/L = splittext(S,".") - if(L.len >= 2) - var/ext = lowertext(L[L.len]) //pick the real extension, no 'honk.ogg.exe' nonsense here - if(byond_sound_formats[ext]) - continue - sounds -= S - - return "[folder][pick(sounds)]" \ No newline at end of file diff --git a/config/config.txt b/config/config.txt index 699d0a1e6f9..a94d900fa57 100644 --- a/config/config.txt +++ b/config/config.txt @@ -409,11 +409,3 @@ DISABLE_HIGH_POP_MC_MODE_AMOUNT 60 ## For reference, Goonstation uses a resolution of 21x15 for it's widescreen mode. ## Do note that changing this value will affect the title screen. The title screen will have to be updated manually if this is changed. DEFAULT_VIEW 15x15 - -## Where roundend sounds are located. MUST HAVE A TRAILING SLASH! -## Uncomment to change it from the default of 'config/sounds/roundend/'. -#ROUNDEND_SOUND_FOLDER - -## Where lobby music is located. MUST HAVE A TRAILING SLASH! -## Uncomment to change it from the default of 'config/sounds/title/'. -#LOBBY_MUSIC_FOLDER \ No newline at end of file diff --git a/config/sounds/title/clown.ogg b/config/sounds/title/clown.ogg deleted file mode 100644 index 3214da56fa2..00000000000 Binary files a/config/sounds/title/clown.ogg and /dev/null differ diff --git a/config/sounds/title/title1.ogg b/config/sounds/title/title1.ogg deleted file mode 100644 index 560fb6342f4..00000000000 Binary files a/config/sounds/title/title1.ogg and /dev/null differ diff --git a/config/sounds/title/title2.ogg b/config/sounds/title/title2.ogg deleted file mode 100644 index 94e78f83c19..00000000000 Binary files a/config/sounds/title/title2.ogg and /dev/null differ diff --git a/config/sounds/LICENSE.txt b/config/title_music/LICENSE.txt similarity index 100% rename from config/sounds/LICENSE.txt rename to config/title_music/LICENSE.txt diff --git a/config/sounds/README.txt b/config/title_music/README.txt similarity index 93% rename from config/sounds/README.txt rename to config/title_music/README.txt index efd4e75de0d..6734508a68f 100644 --- a/config/sounds/README.txt +++ b/config/title_music/README.txt @@ -1,4 +1,4 @@ -The enclosed sound folders holds the sound files used as the title music for the game. OGG and WAV are supported. +The enclosed sounds folder holds the sound files used as the title music for the game. OGG and WAV are supported. Using unnecessarily huge sounds can cause client side lag and should be avoided. @@ -6,11 +6,6 @@ You may add as many title sounds as you like, if there is more than one a random --- -roundend/ -- Roundend Sounds -title/ -- Title Music - ---- - Naming Conventions: Every title sound you add must have a unique name. It is allowed to name two things the same if they have different file types, but this should be discouraged. @@ -42,4 +37,3 @@ Rare title sounds are a just for fun feature where they will only have a 1% chan Add the phrase "rare+" to the beginning of the name. Again note there are no spaces. An example of a rare sound name is "rare+explosion" - diff --git a/config/sounds/roundend/apcdestroyed.ogg b/sound/roundend/apcdestroyed.ogg similarity index 100% rename from config/sounds/roundend/apcdestroyed.ogg rename to sound/roundend/apcdestroyed.ogg diff --git a/config/sounds/roundend/bangindonk.ogg b/sound/roundend/bangindonk.ogg similarity index 100% rename from config/sounds/roundend/bangindonk.ogg rename to sound/roundend/bangindonk.ogg diff --git a/config/sounds/roundend/disappointed.ogg b/sound/roundend/disappointed.ogg similarity index 100% rename from config/sounds/roundend/disappointed.ogg rename to sound/roundend/disappointed.ogg diff --git a/config/sounds/roundend/its_only_game.ogg b/sound/roundend/its_only_game.ogg similarity index 100% rename from config/sounds/roundend/its_only_game.ogg rename to sound/roundend/its_only_game.ogg diff --git a/config/sounds/roundend/leavingtg.ogg b/sound/roundend/leavingtg.ogg similarity index 100% rename from config/sounds/roundend/leavingtg.ogg rename to sound/roundend/leavingtg.ogg diff --git a/config/sounds/roundend/newroundsexy.ogg b/sound/roundend/newroundsexy.ogg similarity index 100% rename from config/sounds/roundend/newroundsexy.ogg rename to sound/roundend/newroundsexy.ogg diff --git a/config/sounds/roundend/yeehaw.ogg b/sound/roundend/yeehaw.ogg similarity index 100% rename from config/sounds/roundend/yeehaw.ogg rename to sound/roundend/yeehaw.ogg diff --git a/strings/round_start_sounds.txt b/strings/round_start_sounds.txt new file mode 100644 index 00000000000..0788672367e --- /dev/null +++ b/strings/round_start_sounds.txt @@ -0,0 +1,4 @@ +sound/ambience/title1.ogg +sound/ambience/title2.ogg +sound/ambience/title3.ogg +sound/ambience/clown.ogg