I recently added a button to mask all unmasked pieces at end turn, regardless of side, but when the other side uses this button, this has the effect of making the pictured French pieces obscured to the France PlayerSide. Because France still has access to the Mask commands, the France PlayerSide can then unmask, and mask the pieces to regain the “MaskFrame” display style instead of the “view when masked”, but this is obviously not ideal.
Is there any way of making an end-of-turn one-click gkc that can achieve the desired effect of masking all unmasked pieces on both sides while not transferring kinda-sorta-ownership of opposing pieces to the side that clicked the button? Or some hack or workaround if this is the Mask trait “working as intended”? The only thing I can think of is a second button to unmask+mask all your own pieces as a “start turn” step, but that’s not a great solution.
The Mask trait works by giving ownership to which ever side is current. So if side A masks counter a, then only side A can see that piece. It does not matter where the command to mask game from - the current side becomes the owner. If, for example, the command game from a Turn Counter Global Hotkey, it does not mean that the ownership is decoupled from the current side. If side A is the current side, then side A will be the owner.
This is somewhat counter-intuitive to how one may want to use the Mask to mask pieces one turn or phase changes, or similar.
As you rightly observer, when a side masks a piece that it cannot really mask, it has the effect of “transferring kinda-sorta-ownership of opposing pieces to the side that clicked the button”.
I believe what we really want, is a way for the Mask trait to be executed outside the context of a side - sort of an arbitrator or module context, where ownership is given to a specific side - not necessarily the current side. This will require code changes to the VASSAL.counter.Obscurable class, or perhaps a derived class.
It’s not really solved though, is it? The desired effect is currently impossible. But I have done as you requested, as the best possible workaround has been identified.
In a way, it is: In the context of Module Design where we discuss what can be done, there’s nothing more that can be done than the work-around you did.
In another way, it isn’t: It would be desirable to have a feature in Vassal that would allow for what you desire, but that context is better addressed in Feature Requests or as an issue on GitHub.