Create account / Log in

Hide pieces (mark moved) functionality

Topics related to the main Vassal engine.

Moderators: Tim M, uckelman

Hide pieces (mark moved) functionality

Postby msward1 » December 6th, 2016, 9:58 pm

Anyone understand how the Mark All Unmoved and Hide All Pieces functionalities were implemented and if something similar can be done with standard Vassal functionality.

Specifically I'd like the double button (image) functionality (On and Off) of the hide pieces buttons.
And the all piece command functionality (Mark All Unmoved) of that feature.

So I have a piece trait (on many pieces) which turns the range shading on and off (circular). I also have a global button which turns all the piece's range shading on or off (circular). But problem is if you select a specific piece and turn the shading off on that particular piece when the all piece range shading is on then the global shading no longer works as all on or off due to the circular (on / off) nature. Turn all off that one piece now turns on.

What i'd like is the ability to turn all on globally (those that are already on don't change) or all off (those that are already off don't change).

Any gurus out there have any suggestions?
msward1
 
Posts: 23
Joined: July 23rd, 2015, 4:03 pm

Re: Hide pieces (mark moved) functionality

Postby scs » December 7th, 2016, 10:11 am

I'd like to hear about this too--in my case it's just to get more general background about VASSAL modules--I'm not currently
facing this issue.
Thanks.
Stewart
scs
 
Posts: 52
Joined: August 3rd, 2010, 10:01 am
Location: San Diego, CA

Re: Hide pieces (mark moved) functionality

Postby rrvs » December 9th, 2016, 1:03 pm

No guru, and the two-imaged toggle effect I don't know about, but you should be able to run a workaround using a Multi-action button acting as a single on/off toggle. It'd use a matching property tied to the trait in order to sync 'em all after individual use. And you'd probably need a new global property added too I think, or you could use trigger actions maybe... but I'll try with a global property below:

First, if the Area of Effect trait doesn't have its own property (I don't know it, but didn't see one with it), then use a Dynamic Property as a substitute (which would use the same key command as the trait, mirroring the trait's action, with no menu command of its own and looping between 0 and 1). So effectively the DP is tracking whether that individual trait is on [1] or off [0].

The new global property you'd add would also loop between those two numbers.

The multi-action button would run three actions each time: a GKC triggering the trait (if global property is 0 and dynamic property is 0); a GKC triggering the trait (if global property is 1 and dynamic property is 1); and lastly a GKC to a set piece (one that won't get removed from the game) that would then toggle the global property.

I'm not sure if I got all those details right, but I think something along those lines should work to re-sync them all, then toggle them all on/off. Hope that helps.
rrvs
 
Posts: 175
Joined: May 20th, 2016, 1:17 pm

Re: Hide pieces (mark moved) functionality

Postby Arcuate » December 10th, 2016, 3:33 am

Custom code could probably fix the issue. I am new to Vassal myself, but learning my way around the coding... If you can't solve it through the usual module editor functions, let me know, and I can try to write a class for you that turns everything on or off.

If you do go via the custom code route, then having different hotkeys for on and off would be much easier to code than a hotkey that toggles, because the code could just go through every relevant piece and activate the appropriate hotkey.
Arcuate
 
Posts: 26
Joined: November 13th, 2016, 8:51 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests