Create account / Log in

Prevent drag and drop?

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

Prevent drag and drop?

Postby harm » June 2nd, 2016, 7:17 am

Is it possible to prevent units being dragged to another – non-private – map window? I would like to allow the movement between map windows by context menu command only.

The reason: I have unit strengths/steps counted in different zones of a map window (a forces display). Moving units between zones works as nicely as deleting and adding units to that window. Transferring units by Key Command to another map window is also working but not to deduct their values when units are merely dragged out of the "forces" map window.

Any direct help is as much appreciated as any workaround suggestions.

Matthias
harm
 
Posts: 47
Joined: March 24th, 2011, 1:12 pm

Re: Prevent drag and drop?

Postby Dulgin » June 2nd, 2016, 9:33 am

Hi Matthias,

try the "Does not Stack"-Trait.
Set "Move piece" to never and "Select piece" to normal.
Then you can use then "Send to"-Traitt.

Ingo
Dulgin
 
Posts: 32
Joined: February 6th, 2012, 8:47 pm
Location: Bielefeld/Germany

Re: Prevent drag and drop?

Postby harm » June 2nd, 2016, 9:45 am

try the "Does not Stack"-Trait.


That, unfortunately, would prevent moving the pieces within a map window which is needed.

Many thanks!
harm
 
Posts: 47
Joined: March 24th, 2011, 1:12 pm

Re: Prevent drag and drop? Update

Postby harm » June 2nd, 2016, 1:32 pm

Actually, the units are changing the Dynamic Property named counted properly to "no" when dragged out of the window, nevertheless the Global Property which does the counting remains idle.
harm
 
Posts: 47
Joined: March 24th, 2011, 1:12 pm

Re: Prevent drag and drop?

Postby Tim M » June 9th, 2016, 2:31 pm

You cant physically prevent drag and drop between maps except by setting DNS to 'move never' but as you note you cant move within a map.

You can however circumvent drag n drop between maps by using the STL trait's Send Back Keyboard Command in conjunction with a trigger that listens for the map field key command 'apply to all units ending movement on this map' to have the piece immediately return to its old location.

It will frustrate players used to drag n drop however and they will probably think something is wrong when they cant move pieces this way and it keeps snapping back to its previous map :)
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1778
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Prevent drag and drop?

Postby harm » June 9th, 2016, 3:57 pm

Excellent! I've no problem with frustrating players when it eases my personal module design frustration somewhat.
harm
 
Posts: 47
Joined: March 24th, 2011, 1:12 pm

Re: Prevent drag and drop?

Postby Dulgin » June 11th, 2016, 3:26 pm

If you will not frustrate players you can report a message like "movment isn't allowed" if the "Send back" ist triggert.
Dulgin
 
Posts: 32
Joined: February 6th, 2012, 8:47 pm
Location: Bielefeld/Germany


Return to Module Design

Who is online

Users browsing this forum: No registered users and 1 guest