Create account / Log in

Deck related feature requests

Suggestions for additional features for the module editor and Vassal engine.

Moderators: uckelman, Tim M

Re: Deck related feature requests

Postby shilinski » April 7th, 2021, 12:12 am

Cattlesquat wrote:Okay, *another* "feature build" is up -- it is in the "DeeperDeckDooDoo" branch (sorry - I was scolding myself for adding crazy deck features and this one seemed particularly scary to code and I forgot branch names got used as the test build names, haha!)

For this one I need some testing by specifically Stan Shilinski because this is your feature! There's a checkbox at the bottom of the Deck configurer that allows you to turn on a "Sort" command with all the trappings. The property it actually sorts by is the same property you list in that box you list for the "Draw Specific Cards" (if you don't use the Draw Specific Cards option the sort property will still appear, it will just be up there higher than the other stuff).

Everyone else very much welcome to test too. Again I gave it a "once over" -- tried it, it seemed to sort my deck the way I wanted it to, etc. BUT if this is going to make it into 3.6 then I need you guys to download this build and test it substantially. Deck, as some of you know "especially Mark" is a dark and scary place to code -- so I *think* I did this right, but boy does it need testing. And making sure it works when you make vlog files and then play them back, for example.

Again please use "an expendable extra copy of your module" to test -- don't save over top of your main cool module: since this adds fields into the XML, modules that you save with this version will not load in 3.5.x.

Have fun!

Brian


Thank you! Thank you! Thank you! This is one I’m really excited about. I will put it through it paces tomorrow!
shilinski
 
Posts: 261
Joined: December 22nd, 2007, 8:46 am
Location: Laurel, Maryland

Re: Deck related feature requests

Postby shilinski » April 7th, 2021, 2:29 pm

Cattlesquat wrote:Okay, *another* "feature build" is up -- it is in the "DeeperDeckDooDoo" branch (sorry - I was scolding myself for adding crazy deck features and this one seemed particularly scary to code and I forgot branch names got used as the test build names, haha!)

For this one I need some testing by specifically Stan Shilinski because this is your feature! There's a checkbox at the bottom of the Deck configurer that allows you to turn on a "Sort" command with all the trappings. The property it actually sorts by is the same property you list in that box you list for the "Draw Specific Cards" (if you don't use the Draw Specific Cards option the sort property will still appear, it will just be up there higher than the other stuff).

Everyone else very much welcome to test too. Again I gave it a "once over" -- tried it, it seemed to sort my deck the way I wanted it to, etc. BUT if this is going to make it into 3.6 then I need you guys to download this build and test it substantially. Deck, as some of you know "especially Mark" is a dark and scary place to code -- so I *think* I did this right, but boy does it need testing. And making sure it works when you make vlog files and then play them back, for example.

Again please use "an expendable extra copy of your module" to test -- don't save over top of your main cool module: since this adds fields into the XML, modules that you save with this version will not load in 3.5.x.

Have fun!

Brian

Alright, I ran some tests.

1. As a right-click command, sorting worked, but I was surprised the sort was in descending order--not what I thing most would expect. I can live with this, but you would need to document it.

2. You probably should disable "sort" if "re-shuffle" is "always" because sort is pointless then.

3. What I could not get to work is programmatically being able to sort a deck. It is as if the sort function is not exposed as a global hot key. I set up a piece via the hot key trait to sort a deck, but nothing happened. I got a report that the hot key trait executed but not a report from the deck sort function that it had received the hot key command from the piece. I must pause testing at this point.

Again, thanks for this. I think though if this gets involved, then I will move it to its own thread.
shilinski
 
Posts: 261
Joined: December 22nd, 2007, 8:46 am
Location: Laurel, Maryland

Re: Deck related feature requests

Postby Cattlesquat » April 7th, 2021, 4:20 pm

Alright, I ran some tests.


Okay, check it out -- the NEW version from DeeperDeckDooDoo branch has:
(1) Checkbox for whether you want ascending or descending sort (and it will match the one it does for draw-specific-cards, rather than be the opposite)
(2) Sort option is disabled when reshuffle is "always"
(3) Fixed the programmatic side of the hotkey (I think - please test, but I did find a smoking gun)

Brian
User avatar
Cattlesquat
 
Posts: 1121
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: Deck related feature requests

Postby shilinski » April 8th, 2021, 4:41 am

Cattlesquat wrote:
Alright, I ran some tests.


Okay, check it out -- the NEW version from DeeperDeckDooDoo branch has:
(1) Checkbox for whether you want ascending or descending sort (and it will match the one it does for draw-specific-cards, rather than be the opposite)
(2) Sort option is disabled when reshuffle is "always"
(3) Fixed the programmatic side of the hotkey (I think - please test, but I did find a smoking gun)

Brian

This snapshot passed all my tests! It worked in a small test vmod and in a bigger one. Good job. I even tested it across vlogs and via the server. I also did ascending and descending sorts. Thank you.

One thing that caught me though was that it is a "string" sort and not a numeric one, so when I sorted with keys such as 7, 8, 9, 10, 11,12, it produced correctly 10, 11, 12, 7, 8, 9. Oops! I don't expect you to do anything about this, but any docs should warn users because it is an easy thing to overlook.
shilinski
 
Posts: 261
Joined: December 22nd, 2007, 8:46 am
Location: Laurel, Maryland

Re: Deck related feature requests

Postby Brent Easton » April 8th, 2021, 4:49 am

Should be able to include an option to 'Attempt a numeric sort if possible' and fall-back to an alpha sort if any cards contain a non-integer for the sort property.
User avatar
Brent Easton
 
Posts: 3375
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: Deck related feature requests

Postby Cattlesquat » April 8th, 2021, 3:39 pm

Try the "even newer version" -- it will now attempt a numeric sort if every instance of the sort property contains an integer, and fall back on string sort otherwise. The use case of having the property contain an integer value in every case but nonetheless wanting a string sort seems so rare that I don't think it's worth adding a checkbox -- someone who really wants that for some reason can work around by putting an "x" at the end of all of their strings, or whatever.

Brian
User avatar
Cattlesquat
 
Posts: 1121
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: Deck related feature requests

Postby shilinski » April 9th, 2021, 5:16 pm

Cattlesquat wrote:Try the "even newer version" -- it will now attempt a numeric sort if every instance of the sort property contains an integer, and fall back on string sort otherwise. The use case of having the property contain an integer value in every case but nonetheless wanting a string sort seems so rare that I don't think it's worth adding a checkbox -- someone who really wants that for some reason can work around by putting an "x" at the end of all of their strings, or whatever.

Brian

It worked. Thank you.
shilinski
 
Posts: 261
Joined: December 22nd, 2007, 8:46 am
Location: Laurel, Maryland

Previous

Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 4 guests