Create account / Log in

Reverse Option in a Deck

Issues with the Vassal engine.

Moderators: uckelman, Tim M

Reverse Option in a Deck

Postby shilinski » December 21st, 2020, 7:12 am

3.4.11
The Deck component has a check box called "Reversible?". If checked, it reverses the order of the cards in the deck. The check box is accompanied by the fields "Reverse Command Menu Text" and "Reverse Hot Key." I want to be able to define the hot key (as a string) so I can reverse the deck programmically, but I don't want to expose the command to the user. So I set the command menu text blank, and I inserted a string (e.g. reverseRedCards) in the hot key field.

It works mostly as I want, but there is a glitch here. When I right-click the deck, a blank line appears in the command list, and if I click the blank line, it reverses the deck. Apparently it's not skipping over the blank command menu text when it composes the deck's command list. It's treating an empty command text field as a valid, choose-able field. Not desirable in any scenario.

(I'm working on a personal module for "Lost Ruins of Arnak," and in it you have to shuffle a bunch of discards and put them at the bottom of an unshuffled main deck. Rather that moving them there one at a time and pushing them to the bottom, I thought I might reverse the deck, throw the discards on top, and then reverse it once again so they end up at the bottom.)
shilinski
 
Posts: 223
Joined: December 22nd, 2007, 8:46 am
Location: Laurel, Maryland

Re: Reverse Option in a Deck

Postby uckelman » December 21st, 2020, 11:59 pm

Thus spake shilinski:
> 3.4.11
> The Deck component has a check box called "Reversible?". If checked, it
> reverses the order of the cards in the deck. The check box is
> accompanied by the fields "Reverse Command Menu Text" and "Reverse Hot
> Key." I want to be able to define the hot key (as a string) so I can
> reverse the deck programmically, but I don't want to expose the command
> to the user. So I set the command menu text blank, and I inserted a
> string (e.g. reverseRedCards) in the hot key field.
>
> It works mostly as I want, but there is a glitch here. When I
> right-click the deck, a blank line appears in the command list, and if I
> click the blank line, it reverses the deck. Apparently it's not skipping
> over the blank command menu text when it composes the deck's command
> list. It's treating an empty command text field as a valid, choose-able
> field. Not desirable in any scenario.

That's a bug. We removed some empty menu entries earlier in the year,
but not systematically.

Try VASSAL-3.4.12-SNAPSHOT-5961bb471, available here:

http://www.vassalengine.org/~uckelman/tmp/

Does that solve the problem for you?

--
J.
User avatar
uckelman
Site Admin
 
Posts: 9227
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Reverse Option in a Deck

Postby shilinski » December 22nd, 2020, 6:48 am

I will try it tomorrow night. It's not the only bug, by the way. If I blank the "shuffle" command but add a key to shuffle, it also produces a blank line in the right-click list.
shilinski
 
Posts: 223
Joined: December 22nd, 2007, 8:46 am
Location: Laurel, Maryland

Re: Reverse Option in a Deck

Postby shilinski » December 23rd, 2020, 6:11 am

I tried it tonight. It didn't work. Adding a shuffle hot key without a menu command still produces a blank line (with shuffle action) in the right-click menu. It appears though that the reverse hot key without a menu command does work because I didn't see a blank line for it.
shilinski
 
Posts: 223
Joined: December 22nd, 2007, 8:46 am
Location: Laurel, Maryland

Re: Reverse Option in a Deck

Postby uckelman » December 24th, 2020, 12:12 am

The original fix correctly removed empty entries from menus, but couldn't work as intended because some entries that should have been empty were not. Try VASSAL-3.4.12-SNAPSHOT-no_empty_menu_items-f3bcac0b3, available from the same place. Does that solve the problem for you?
User avatar
uckelman
Site Admin
 
Posts: 9227
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Reverse Option in a Deck

Postby shilinski » December 24th, 2020, 3:13 am

No.
shilinski
 
Posts: 223
Joined: December 22nd, 2007, 8:46 am
Location: Laurel, Maryland

Re: Reverse Option in a Deck

Postby uckelman » December 24th, 2020, 11:03 am

Ok, in that case, I need to see the module where this happens, as I can't replicate the problem after the change in VASSAL-3.4.12-SNAPSHOT-no_empty_menu_items-f3bcac0b3. Where can I get the module?
User avatar
uckelman
Site Admin
 
Posts: 9227
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Reverse Option in a Deck

Postby shilinski » December 24th, 2020, 1:34 pm

I will post a slimmed-down demo module on Dropbox in a few hours—after double checking so I don’t look stupid. I’ll get back to you.
shilinski
 
Posts: 223
Joined: December 22nd, 2007, 8:46 am
Location: Laurel, Maryland

Re: Reverse Option in a Deck

Postby barbanera » December 24th, 2020, 3:33 pm

I just ran into this same bug, tried also with the latest snapshot mentioned above (as well as 3.2.17 and 3.4.11).

More precisely, I was not looking at the Reverse command but at the Re-Shuffle one: an empty Re-Shuffle text will show as an empty line when right clicking on the deck, and the reshuffle command key will be executed.

For comparison, the include command to send entire deck to another deck instead works all right (nothing showing if the text is empty), in all versions of the engine tested (see above).

PTHreportbug1.jpg
PTHreportbug1.jpg (96.03 KiB) Viewed 2307 times
barbanera
 
Posts: 467
Joined: January 12th, 2012, 2:27 pm

Re: Reverse Option in a Deck

Postby barbanera » December 24th, 2020, 3:44 pm

I tried turning on reversible and clearing the text and there is no empty right-click menu with the latest snapshot mentioned above.

I think perhaps only the re-shuffle needs to be fixed now.
barbanera
 
Posts: 467
Joined: January 12th, 2012, 2:27 pm

Re: Reverse Option in a Deck

Postby uckelman » December 26th, 2020, 2:00 pm

Try VASSAL-3.4.12-SNAPSHOT-no_empty_menu_items-5999fb1b3, from the same location. The code for producing menu text was duplicated in two places, which I hadn't known before. I fixed only one of them on the first try. Now the duplication is gone. Does this work for you?
User avatar
uckelman
Site Admin
 
Posts: 9227
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Reverse Option in a Deck

Postby barbanera » December 26th, 2020, 4:20 pm

I can confirm that I don't see the empty line for re-shuffle anymore with that latest build.
barbanera
 
Posts: 467
Joined: January 12th, 2012, 2:27 pm

Re: Reverse Option in a Deck

Postby barbanera » December 26th, 2020, 4:45 pm

While you are at it..

It would be nice to be able to assign a command to flip a deck face up or face down. At present, contents can be set to be face down on a right click command (as opposed to "always", or "never") but there is no way to set a command key for it or to change/wipe out the command text (always showing as "Face up" in the right click menu).
barbanera
 
Posts: 467
Joined: January 12th, 2012, 2:27 pm

Re: Reverse Option in a Deck

Postby uckelman » December 31st, 2020, 8:12 pm

barbanera wrote:I can confirm that I don't see the empty line for re-shuffle anymore with that latest build.

Great. This fix went out in 3.4.12 on Sunday.
User avatar
uckelman
Site Admin
 
Posts: 9227
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Reverse Option in a Deck

Postby uckelman » December 31st, 2020, 8:13 pm

barbanera wrote:While you are at it..

It would be nice to be able to assign a command to flip a deck face up or face down. At present, contents can be set to be face down on a right click command (as opposed to "always", or "never") but there is no way to set a command key for it or to change/wipe out the command text (always showing as "Face up" in the right click menu).

If you want to make sure this request doesn't get lost, file an issue for it in the tracker.
User avatar
uckelman
Site Admin
 
Posts: 9227
Joined: December 10th, 2007, 9:48 am
Location: Durham, England


Return to Technical Support & Bugs

Who is online

Users browsing this forum: No registered users and 7 guests