mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 03:26:31 +01:00
Fix April Fools and Roundend title music (#89741)
## About The Pull Request 1. April Fools set the lobby music, but order of operations says holidays might be initialized before ticker. So we need to ensure it won't get overridden. 2. Lobby music pref was changed from a toggle to a number, but the proc already passed the number as an argument, so the arg did nothing. Now it'll (properly) play at half volume during end-of-round. 3. When using default repo lobby music, it will not play the same music after two rounds (as it does with configured lobby music) ## Changelog 🆑 Melbert fix: Roundend title music will play at half volume again fix: April Fools lobby music will correctly always be clown music fix: Lobby Music will repeat across sequential rounds less often /🆑
This commit is contained in:
@@ -224,7 +224,7 @@ GLOBAL_LIST_INIT(achievements_unlocked, list())
|
||||
for(var/client/C in GLOB.clients)
|
||||
if(!C?.credits)
|
||||
C?.RollCredits()
|
||||
C?.playtitlemusic(40)
|
||||
C?.playtitlemusic(volume_multiplier = 0.5)
|
||||
if(speed_round && was_forced != ADMIN_FORCE_END_ROUND)
|
||||
C?.give_award(/datum/award/achievement/misc/speed_round, C?.mob)
|
||||
HandleRandomHardcoreScore(C)
|
||||
|
||||
@@ -109,7 +109,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
music += S
|
||||
|
||||
var/old_login_music = trim(file2text("data/last_round_lobby_music.txt"))
|
||||
if(music.len > 1)
|
||||
if(length(music) > 1)
|
||||
music -= old_login_music
|
||||
|
||||
for(var/S in music)
|
||||
@@ -122,10 +122,11 @@ SUBSYSTEM_DEF(ticker)
|
||||
|
||||
if(!length(music))
|
||||
music = world.file2list(ROUND_START_MUSIC_LIST, "\n")
|
||||
login_music = pick(music)
|
||||
if(length(music) > 1)
|
||||
music -= old_login_music
|
||||
set_lobby_music(pick(music))
|
||||
else
|
||||
login_music = "[global.config.directory]/title_music/sounds/[pick(music)]"
|
||||
|
||||
set_lobby_music("[global.config.directory]/title_music/sounds/[pick(music)]")
|
||||
|
||||
if(!GLOB.syndicate_code_phrase)
|
||||
GLOB.syndicate_code_phrase = generate_code_phrase(return_list=TRUE)
|
||||
@@ -748,5 +749,13 @@ SUBSYSTEM_DEF(ticker)
|
||||
if(possible_themes.len)
|
||||
return "[global.config.directory]/reboot_themes/[pick(possible_themes)]"
|
||||
|
||||
/// Updates the lobby music
|
||||
/// Does not update if override is FALSE and login_music is already set
|
||||
/datum/controller/subsystem/ticker/proc/set_lobby_music(new_music, override = FALSE)
|
||||
if(!override && login_music)
|
||||
return
|
||||
|
||||
login_music = new_music
|
||||
|
||||
#undef ROUND_START_MUSIC_LIST
|
||||
#undef SS_TICKER_TRAIT
|
||||
|
||||
+4
-4
@@ -202,13 +202,13 @@
|
||||
S.status = SOUND_UPDATE
|
||||
SEND_SOUND(src, S)
|
||||
|
||||
/client/proc/playtitlemusic(vol = 85)
|
||||
/client/proc/playtitlemusic(volume_multiplier = 1)
|
||||
set waitfor = FALSE
|
||||
UNTIL(SSticker.login_music) //wait for SSticker init to set the login music
|
||||
|
||||
var/volume_modifier = prefs.read_preference(/datum/preference/numeric/volume/sound_lobby_volume)
|
||||
if((prefs && volume_modifier) && !CONFIG_GET(flag/disallow_title_music))
|
||||
SEND_SOUND(src, sound(SSticker.login_music, repeat = 0, wait = 0, volume = volume_modifier, channel = CHANNEL_LOBBYMUSIC)) // MAD JAMS
|
||||
var/music_volume = prefs.read_preference(/datum/preference/numeric/volume/sound_lobby_volume) * volume_multiplier
|
||||
if((prefs && music_volume) && !CONFIG_GET(flag/disallow_title_music))
|
||||
SEND_SOUND(src, sound(SSticker.login_music, repeat = 0, wait = 0, volume = music_volume, channel = CHANNEL_LOBBYMUSIC)) // MAD JAMS
|
||||
|
||||
///get a random frequency.
|
||||
/proc/get_rand_frequency()
|
||||
|
||||
@@ -257,7 +257,7 @@
|
||||
/datum/holiday/april_fools/celebrate()
|
||||
. = ..()
|
||||
SSjob.set_overflow_role(/datum/job/clown)
|
||||
SSticker.login_music = 'sound/music/lobby_music/clown.ogg'
|
||||
SSticker.set_lobby_music('sound/music/lobby_music/clown.ogg', override = TRUE)
|
||||
for(var/i in GLOB.new_player_list)
|
||||
var/mob/dead/new_player/P = i
|
||||
if(P.client)
|
||||
|
||||
Reference in New Issue
Block a user