Main Menu Music Still Plays in Other guis
NullSector76 opened this issue ยท 14 comments
Version is TheBetweenlands-3.3.7
Steps to reproduce: simply click another gui like options or select world and music still plays. fix this plzz. I suggest you check what gui your in before saying it's ok to keep playing em music?
Examples of how to fix it https://www.programcreek.com/java-api-examples/index.php?api=net.minecraftforge.client.event.sound.PlaySoundEvent17
It still is playing with custom main menu when your betweenlands isn't even suppose to be playing
use this as an example for sound main menu handling:
https://www.programcreek.com/java-api-examples/index.php?api=net.minecraftforge.client.event.sound.PlaySoundEvent17
For it to work as intended (as it does now, to play in all menus when not in the game) there is no good way of checking if our gui have been overridden and still is showing.
To disable the music, disable the BL main menu in the config file.
If you're using a different main menu anyways, why wouldn't you disable the BL one?
That's intentional. The world select GUI is still considered part of the main menu, as is the options.
that's not a proper way of doing it look at the code I sent you it checks to see if the current menu is your gui before playing the music.
the proper way of doing things is to check which gui your in from Minecraft.getMinecraft().currentGui or something like that. You can do that in the sound event. That is the proper way of doing things.
@SubscribeEvent
public void onPlaySound(PlaySoundEvent17 event)
{
if (mc.currentScreen instanceof YourGUI)
{
//play music
}
}
As it stands now, I still don't understand what problem you're talking about. The music is supposed to be played in the BL main menu and any sub menu of the main menu.
Also, your code is incorrect and PlaySoundEvent17
doesn't even exist.
well Use a event handler no other mod that added a main menu played music if it wasn't their gui
or check the gui before playing the music
I don't really understand that first phrase, but if a gui instanceof GuiBLMainMenu
is all you want, we can add that. Though I don't quite see any use for that because the main menu can be disabled in the config in case there is a conflict
"gui instanceof GuiBLMainMenu" yes that's what I would like you to do thank you
I don't want to constantly be toggling your menu config when making a modpack
How many mod packs are you making that this is such a major inconvenience?!!
If you are making a lot of packs, just keep a master copy of the config file that you want.
All the modders I talked to today said that's what you should do check which gui "instance" it is before playing music hope that helped.
Thanks