Vassal 3.6.1 WIN64
The “Toolbar button can be disabled by a property” is not working correctly.
Specifically, when defining a Map level Global Property and initial value is “true”, the toolbar button does not disable and is not grayed out.
When the initial value is “true” AND you try to change it to “true”, the button does not disable.
When changing the value from something other than “true” to “true” during module execution, the toolbar button does disable correctly
Is your global property defined after (lower in the module structure) than the button you are disabling it? Try moving the definition of the global property up above the definition of the button – so that it will “exist” when the button is created and checks whether it should start disabled.
Map Level Global Properties was defined BEFORE the toolbar GKC (also within a Map folder).
I tried moving it after to see if it changed anything - it didn’t…
Can you pop your module up somewhere that I could look at it? (and let me know which button I’m looking for)
Europe_Engulfed_v3.1_e.vmod (uploaded at 713pm EST)
The Global Properties and GKC toolbar buttons can be found:
Editor: ItalyFP [Map Window] folder
- New Game/New Scenario
- Click Force Pools (drop down)
2a) Click Italy FP to see buttons
Okay, thanks – have found the problem. If you want to try the build for DisabledButtonsOnMapWindows when it comes up at vassalengine.org/builds (in about 15-20 minutes) you could verify that it’s working for you? (In which case fix will be in 3.6.2)
That appears to be working correctly… Thanks!
The fix is merged and will appear in 3.6.2 in a few days. Thanks for testing.
Happy to help… Thanks for fixing!
@Cattlesquat I’ve found another bug with this…
When using predefined setups, the GKC disable isn’t working correctly - even after running the refresh predefined setups tool.
To see this, check Europe_Engulfed_v3.1 g.vmod (uploaded in last few minutes).
a) open module, select New Scenario - the Force Pools/Italy FP toolbar buttons work correctly
b) open module, select a predefined setup (e.g., 1939 Playbook) - the Force Pools/Italy FP toolbar buttons do NOT work (I ran the refresh tool).
I ran the module you posted, and I’m not sure if I’m reproducing your problem or not:
(a) New Scenario => the Force Pools / Italy toolbar buttons were disabled/greyed-out
(b) Predefined Setup (1939 Playbook) => The Force Pools / Italy toolbar buttons were disabled/greyed-out
In other words I’m getting the same behavior for both. Is that the correct behavior for both or the incorrect behavior?
Sorry for not being more explicit…
- click DOW button. Result - DOW button grey out and Morale-Collapse/Surrender Buttons become active (this is correct behavior)
- click DOW button. Result - DOW button remains active and other buttons remain inactive (this is not correct behavior).
So the initial state appears correct for both, but for the predefined scenario, the state isn’t changing correctly…
I put a Text Label into your Italy Status thing to show the value of the three Global Properties that do the disabling.
When I’m running the Predefined Setup version of that, and I click the DOW button, the values of the Global Properties don’t change (they remain false, true, true). So it appears that the behavior of the button-disabling part is correct – but something in your module isn’t changing the Global Properties as you were expecting?
Screenshot is when I’ve just clicked DOW, and the button flags are still set to false,true,true.
Right - however it works correctly on the “New Scenario” load… Which indicates to me, that the logic is correct…
So my best guess is, is that the “Refresh predefined setups” tool, isn’t updating something correctly…
I replicated what you did (display global properties of the GKC variables) and the buttons worked correctly in the “New Scenario”
Initial State: false true true (DOW active, Morale Inactive, Surrender Inactive)
Push DOW: true false false
Push Morale: true true false
Push Surrender: true true true
However, when I load the 1939 Playbook Predefined setup, the new GKC global variables don’t display at all. Instead it displays another Italy Status…
So I don’t think this is a bug in the GKC Disable feature, but a bug in the Update Predefined Setup Tool…
When you add the display for global properties to the Italy Status, you have to refresh counters on the predefined setup again to pick up the new changes (otherwise it just displays the old Italy Status as you describe). Once I’d refreshed it, I was able to see the false/true/true on the predefined setup.
Global properties and the logic for them can be tricky w/ predefined setups. Since I was pushing the DOW button and it was not updating the DisableGKC properties, I surmised that some kind of logic with the DOW button was not finding whatever it wanted, and wasn’t running whatever it would otherwise do to change the DisableGKC.
We haven’t had any complaints about the Refresh Counters lately as far as anything like this.
You could verify the DisableGKC functions by making a direct way to flip them true/false without going through the DOW button. And/or follow the logic of your DOW button and figure out at what point it is failing to update the Global Properties. (For example in your status prototype you have a RestrictCommands on the ItalyDOW command depending on what ItalyStatus is set to – so if it received the GKC when the command was Restricted, the GKC would not proceed. There may be more steps involved - I recommend tracing them one by one - or else remove almost all the steps/restrictions and put them back in one by one. Obviously at each time you make a change to prototypes you’ll need to refresh counters before you run with your Predefined Setup.
It’s also possible your “disable GKC” piece does not exist in your Predefined Setup – just adding a piece to an At Start Stack does not add it to any Predefined Setups that already exist – those are just saved games of some earlier position. If you need to add a new piece to a Predefined Setup, you will need to provide a way for yourself to add it (e.g. drag it from a palette, or some such).
Alternatively, you may want to just combine those traits that you put in the “DisableGKC” piece into the Italy Status piece that you already have and already exists – that way when you refresh the predefined setup, since that piece (Italy Status) already exists it will update the traits with the new ones, effectively adding the DisableGKC logic into the game.
That’s my guess – that your DisableGKC piece doesn’t even exist in your predefined setup.
Ok, that would be the problem then…
I added the extra GKCDisable piece to have better logical separation and thought that Refresh Setup would add it in…
That might be a good feature enhancement for the Refresh Predefined setups…
Appreciate your help!