Toolbar Button "Disabled" via PlayerSide

Is there a way to use the “Toolbar button is disabled” option based on the Player Side trying to use that button. I have two Symbolic Dice buttons, one for the Entente player, the other for the German player and I’d like to restrict their use to the appropriate side.

Yes but it’s a bit involved and there might be a simpler method that doesn’t disable the button but just intercepts it and refuses to roll for any but the correct side. I say might, because I’m not sure about symbolic dice. Certainly with a standard GKC, you could use the GKC criteria to filter out invalid sides and even put up a popup error message.

To stick with your idea, you need to use a Global Option Preference property to control the button. This way, you can have a property that has different value for each player. The method is a bit involved, because you have to account for changes of side.

The details are :-

  1. Define a Global Option Checkbox preference. Leave its tab name blank - then it won’t show as a user preference. Define one for each side. Let’s call these “Side Control Properties”. Here’s an example:

  1. On some convenient control piece, define a Set Global Property trait - one per each Side Control property. This set of traits will be invoked from two places:
  • From a “run always” Startup GKC
  • From a GKC that is part of a side-switching intercept button (more on that below).
    Here’s the an example of one of these Set GP traits, for the property I defined earlier:

I could equally define a GP called “isNotSolitaire”. This might be more useful, if the property is required to disable a button.

  1. Hooking the Side Control property into side switching… to do this, you need put the standard retire function into an action that will modify your user control property. One way to do this is to put a Key Command into the hotkey field of the Player Sides retire function and top and tail this with GKCs that cause the GP traits (step 2 above) to be re-invoked.

In this example, I’ve removed the normal Retire button text and icon, and given the button an internal key command:

Next, I created and Action Button that provides the user with a new retire function - one that does various side switch routines, such as the one you need here:

The key is the ghkSetName hotkey, which triggers a GKC that actions the Set GP traits again, so that the player’s properties are set correct for the new side that they have just joined (or for observer, if they in fact retired).

This method works ok, I find. However, it can be compromised by an undo at the point where the user switches side. You might be able to make it more robust, or the player who does this might end up having to retire and rejoin again.

Mark. I realized I asked this similar question about Toolbar Menus and never heard anything, so thanks. I bit over my head with all the moving parts, and not vital. The game runs on 1d6 but giving each side their own custom die seems “du jours.” Still, I’ll look this over with time & test it out. CC