Yoyo_Dodo Posted May 3, 2022 Share Posted May 3, 2022 Hello Everyone. Well, I've been thinking of a mod that changes the music of the Chorusbox Circuit. I've already made some progress, but I'm stuck on the idea of the menu, so what I plan to do is alternate between 3 songs (default and 2 added songs) I was able to add two options to the menu, but I need a third one. Spoiler but it seems to be poorly implemented because it doesn't recognize the options if I change it to the second song of the mod. This is what I have in the modinfo Quote local options_enable = { {description = "Ragtime", data = true}, {description = "Hoedown", data = false}, } configuration_options = { { name = "music_mod", label = "Chorusbox Tune", -- hover = "", options = options_enable, default = true, }, } And this is what is in the modmain Quote Assets = { Asset("SOUNDPACKAGE", "sound/musicbox_mod.fev"), Asset("SOUND", "sound/musicbox_mod.fsb"), } local soundswaps = {} local _PlaySound = GLOBAL.SoundEmitter.PlaySound function GLOBAL.SoundEmitter:PlaySound(soundname, ...) return _PlaySound(self, soundswaps[soundname] or soundname, ...) end local _PlaySoundWithParams = GLOBAL.SoundEmitter.PlaySoundWithParams function GLOBAL.SoundEmitter:PlaySoundWithParams(soundname, ...) return _PlaySoundWithParams(self, soundswaps[soundname] or soundname, ...) end local function SetSoundAlias(name, alias) soundswaps[name] = alias end if GetModConfigData("music_mod") then RemapSoundEvent("WX_rework/module/musicmodule_lp", "musicbox_mod/module/musicmodule_lp") end Finally, when I try individually without a menu, the mod songs work correctly, but they continue to play when the game is paused. In summary: I need to implement a third option for the menu. By changing the menu options, change the music ingame. The music stops when the game is paused. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now