Create account / Log in

Hotkey to refresh Game Piece Inventory Windows

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

Moderators: uckelman, Tim M

Hotkey to refresh Game Piece Inventory Windows

Postby barbanera » December 24th, 2020, 9:59 am

Currently to refresh a Game Piece Inventory Window a user has to explicitly click "Refresh".

It could be useful to be able to refresh it programmatically, with a global hotkey. (Similar to the global hotkeys to shuffle decks or send a deck to another deck.)

P.S. Just noticed that if you use "Save" on a GPIW the report in chat is simply "Wrote" in light blue (at least on my screen/default preferences), and nothing else. Tried this with 3.4.11. No info of what was written, just "wrote".
barbanera
 
Posts: 502
Joined: January 12th, 2012, 2:27 pm

Re: Hotkey to refresh Game Piece Inventory Windows

Postby Cattlesquat » April 12th, 2021, 1:18 am

I've made a trial version of this which you can try in the build for branch 14376.

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

Re: Hotkey to refresh Game Piece Inventory Windows

Postby barbanera » April 12th, 2021, 10:16 pm

You are the man! Will try that asap, thanks.
barbanera
 
Posts: 502
Joined: January 12th, 2012, 2:27 pm

Re: Hotkey to refresh Game Piece Inventory Windows

Postby barbanera » April 14th, 2021, 1:33 pm

Cattlesquat wrote:I've made a trial version of this which you can try in the build for branch 14376.

Brian


Help me out here: whats the "Toolbar button when showing" entry about? It's currently set at "Hide" on my GPIWs.

Anyway, I tried leaving it at "Hide" and changing it to "Refresh" and in both cases the hotkey entered on the line below seemed to be working all right. Thanks!

However, this now raises a side issue for me, possibly GPIW specific, or possibly more general in scope. I am using GPIWs in one module of mine, to keep track of pieces on the screen and calculate current VPs for players and other things. This has been working all right before your fix, but the players had to specifically hit the "Refresh" button to get them to update. With your fix, the idea was now to invoke those hotkeys whenever a piece moved anywhere (through the "command to apply to pieces ending movement on this map" entry).

This now works all right, too, now. But there is an issue with the UNDO button: if somebody moves a piece, any of those GPIWs updates automatically now, but then if UNDO is pressed - and the piece returned back - the "command to apply to pieces ending movement on this map" is not triggering and the GPIWs are now out of sync.

Anything that could be done about that? Perhaps a checkbox on GPIWs to autorefresh whenever a piece is moved/placed on any map (as an alternative to only run when a hotkey is issued or the "refresh" button is pressed)?
barbanera
 
Posts: 502
Joined: January 12th, 2012, 2:27 pm

Re: Hotkey to refresh Game Piece Inventory Windows

Postby Cattlesquat » April 14th, 2021, 6:51 pm

Toolbar-button-when-showing -- if your Inventory is presently showing on the screen and the player clicks the toolbar button (or presses its hotkey), you have a choice between either (a) It "Hide"s the Inventory window, or (b) it "Refresh"es the inventory window.

MOST toolbar buttons (e.g. map windows, player hands, charts, etc) just ALWAYS work as show/hide toggles. Inventory windows I guess appeared before that convention was established and ended up with slightly weirder options, but we let you choose the conventional way if you want.

Meanwhile... getting into UNDO takes us pretty far out over the abyss in terms of code complexity and "potential consequences of meddling". I'm not sure I'd feel too confident voyaging into that territory.

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

Re: Hotkey to refresh Game Piece Inventory Windows

Postby barbanera » April 14th, 2021, 6:59 pm

Cattlesquat wrote:Toolbar-button-when-showing -- if your Inventory is presently showing on the screen and the player clicks the toolbar button (or presses its hotkey), you have a choice between either (a) It "Hide"s the Inventory window, or (b) it "Refresh"es the inventory window.

MOST toolbar buttons (e.g. map windows, player hands, charts, etc) just ALWAYS work as show/hide toggles. Inventory windows I guess appeared before that convention was established and ended up with slightly weirder options, but we let you choose the conventional way if you want.

Meanwhile... getting into UNDO takes us pretty far out over the abyss in terms of code complexity and "potential consequences of meddling". I'm not sure I'd feel too confident voyaging into that territory.

Brian


Ok, but, wait, shouldn't UNDO undo everything that the last move/action did? If I move a piece and that movement (through the "command to execute for all pieces that end movement on this map" etc) fires the hotkey to refresh the inventory window... shouldn't UNDOing that move/action undo also the global hotkey from firing and revert the GPIWs due whatever was the state before the move/action was done?
barbanera
 
Posts: 502
Joined: January 12th, 2012, 2:27 pm

Re: Hotkey to refresh Game Piece Inventory Windows

Postby Cattlesquat » April 15th, 2021, 3:23 am

UNDO does undo every change to "the game state". But user interface updates aren't part of the game state and so aren't tracked in the same way.
User avatar
Cattlesquat
 
Posts: 1127
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 2 guests