mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 23:58:07 +01:00
Revert "[READY] Easy hosting of roundend sounds (#33618)"
This reverts commit 03e3dee35c.
This commit is contained in:
@@ -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)
|
||||
@@ -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/"
|
||||
|
||||
@@ -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)]"
|
||||
@@ -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
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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"
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
sound/ambience/title1.ogg
|
||||
sound/ambience/title2.ogg
|
||||
sound/ambience/title3.ogg
|
||||
sound/ambience/clown.ogg
|
||||
Reference in New Issue
Block a user