Hide Game Piece Layer Control button according to player side

Disabling a button causes it to grey-out, not disappear.

As I understand it, not in this case. There is an option to “Hide button when disabled”.

It seems that Brent’s new version has removed the option to hide the button, but the button is not greyed out, and I also checked that the button function works.

Hide button was a v3.7beta change that had to be reverted as it caused other button problems that couldn’t be resolved. Seems like GPL still had that half implemented.

Yes, Hiding buttons is not implemented in current Vassal, only disabling.

Given that, does the proposed fix resolve the problem?

Thanks.

No, unfortunately not. As I wrote in my previous post, the button was not grey, and i specifically checked that it still worked, i.e. it was not disabled.

I had given the Global Property an initial value of true, and had not changed it. However, I have no way of knowing if it actually has the value of true. If not, this could also be the root of the problem.

I wonder if there is a minimal module that could be used to demonstrate such bugs in a way where we can be sure that nothing else in the module affects the behaviour of a bug.

Let me offer a suggestion for displaying the value of a global property. I use an Action Button component of a map to display a global property in that map’s tool bar. I just include the property in the button text and maybe give the button a description.

I’m currently developing an 18xx module where players sometimes act as investors and other times as companies which they direct. To help keep tabs on this my module has a Global Property named “ActiveEntity” and the value is the name of the player or company that is currently acting. To help make the display a bit more noticeable I added some html formatting: "<html><span style=background-color:#a5f3f3ff;font-size:22;font-weight:bold;> "+ActiveEntity+" </span></html>"

Other than the description and the button text, everything else is blank:
image

There are other ways to display property values, but this seems pretty quick and easy to me, especially if you don’t add any html formatting.

I did create a minimal module that both reproduced the problem in current Vassal and resolved the issue in the new version.

If you use changeable text labels in any counter, then just add $GPname$ to the text. Or create a dummy counter with a text label and add it to your game.

Thanks to you both for the suggestions.

I created a blank counter with the label text <$HideFromRAF$>, and I gave the GPL an alternative button image for when the button is disabled.

The button was not disabled, The counter label showed , so the GP should have resulted in the button being disabled.

Interestingly, in the official 3.7.8, the counter shows <{true}>, so either the value is different, or the display representation of is altered in the beta.

By the way, is there a possibility that the GP is defined after the GPL, so that the value was undefined when the GPL was evaluated? The order of the definitions is so that the GP comes before the GPL.

The counter label showed what exactly?

In your beta build it showed

true

In 3.7.8 it showed

{true}

STOP PRESS! I have solved this problem with the beta version!

I wondered why there was no effect from the Global Property, and then I thought that perhaps the Game Piece Layer Control could not find the GP. I then moved the GP from map level to module level, and then it works!

I thought of this solution when I had another problem with a GP that could not be located even though I specifically indicated that the GP was in the main map. It seems that GPs should always be located on the module level.

Thanks, Brent for the beta version. I look forward to the final version!

2 Likes