Open KernalsEgg opened 5 years ago
Great explanation of your issue. I have experienced exactly the same under similar circumstances with group conditions only showing about half the time. Same solution here, change the page tab and back again.
on a totally different thing, you can drag and drop images and media directly into the issue window on github. should save you time in the future
It's good to know that I'm not going insane, haha. Have you been able to find a solution that isn't removing the groupControls/groupConditions? I haven't myself, not that removing the hiddenSwitchers and only using the one time format is the end of the world.
Thanks for the heads up. I was wondering how you add images to posts because I noticed that other threads had included them.
Is there a bug where the RefreshMenu() function sometimes hides controls that have groupConditions, and if so, is there a way around the issue? I can't see this issue reported anywhere, so I'm hoping that I've done something silly.
I am using two different hidden switches that are groupControls 1 and 2 to hide and show different time formats. The idea is that the player selects a time format that they can use to set the time of day that a timer expires at.
This is what the MCM menu looks like with the two different time formats:
The issue is that whenever I call the RefreshMenu() function there's a chance that every control with a groupCondition is hidden, even if their conditions are met. It happens approximately half of the times that I open the MCM menu, and other times it works perfectly fine. The issue only occurs (or doesn't occur) the first time that you call the RefreshMenu() function after opening the MCM menu.
If you want to fix the issue after it occurs you have to swap MCM menus and swap back. If you want to trigger the issue if you don't encounter it, you also have to swap MCM menus and swap back. So, if the controls don't disappear the first time that you call the RefreshMenu() function, they shouldn't disappear until you swap MCM menus and swap back and call the RefreshMenu() function again.
This is what the MCM menu looks like when the controls with a groupCondition are hidden:
The hidden switches use global variables, which have their values changed through a function that is run by the Time Format stepper. So, when the value of the stepper is changed, I run a function that changes the value of the global variables that the hidden switches are using, and use the RefreshMenu() function.
I have tried not using hidden switches and instead assigning groupControl 1 to the Time Format stepper, and assigning the [1] and {"ONLY": []} groupConditions to the controls that I want hidden at different times. However, this issue still occurs when I use the RefreshMenu() function (which is again approximately half of the times that I open the relevant MCM menu) when it is run by another control.
I have also tried using the RefreshMenu() function on the OnMCMOpen() event as your GitHub wiki page suggests, but it hasn't helped.
If you need any further information from me, please let me know. I can record a video of me reproducing the bug if my explanation hasn't been clear enough. Any assistance would be appreciated.