I have action button that does the initial setup of the game state. I want to make it so that can only be clicked once. Is there a way to “disable” the button once it has been clicked? (accidentally clicking on it after the game starts will create havoc).
Easy way is to have a state variable that gets set to true after initial click, so that all future click will fail, but checking to see if there is a way to “grey out” the button so people knows not to click?
This bit is fairly easy I think. You have the button execute a trigger. Within that trigger you can have steps for setting and checking the variable. Getting it to work in practice can be harder, but if you approach it step by step it’s not too bad. Just use the report action trait to figure out what’s going on. Another thing is this the button may have to simply send a command to a piece that has the trigger as I am not sure if you can do all that from a tool bar menu button.
A problem with the above is that the button does not go away which is confusing. So I would prefer to have the button be an actual piece with an action button trait. So the button still initiates a trigger, which is a series of actions. You just make the last action be something that removes the button. That way you don’t need to bother with a state variable and you have an obvious piece to host the trigger.
I did something like this in the 3.X version of T&E,
I put an on-map setup button that deletes itself after one press for my own customized 1960: Making of the President module to properly do game setup and still work in PBEM form. The module that exists for download uses a Startup Global Key Command, which runs every time you open the module, not just at the start of a game, so it overwrites influence in a few states and really mucks up non-live play.
As I implied, in T&E I moved from the on-map button to a start-up global key command. In 4.1 I screwed up but fixed it in 4.2. I fixed it by changing a marker to a dynamic property so that the GKC can only be fired once for every piece.