Create account / Log in

Game Piece Inventory Window

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Game Piece Inventory Window

Postby panther 2010 » April 29th, 2020, 5:58 pm

Hello,

there is a way to show/hide a Game Piece Inventory Window?

Thanks

Panther 2010 :?:
panther 2010
 
Posts: 119
Joined: July 18th, 2010, 3:04 pm

Re: Game Piece Inventory Window

Postby Cattlesquat » April 29th, 2020, 10:38 pm

Only the "Close" button inside it. The Inventory Window is a bit "Old School" :)
User avatar
Cattlesquat
 
Posts: 953
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: Game Piece Inventory Window

Postby panther 2010 » April 30th, 2020, 4:56 pm

Mmm, It was what I feared!

Well, maybe there is another way to get what I want anyway.

I see to explain myself in more detail.

In this module it is possible to create stacks in a given hex that contain numerous counters; now, the way you can handle stacks in Vassal is anything but simple and easy.

To try to solve this problem, I added an action button on the counters that opens a Game Piece Inventory Window, called Hex Inventory, that allows me to view all the pieces that are in a given hex and to easily interact with them with the right-click commands. Everything works perfectly.

The only problem, however purely aesthetic, is the presence on the toolbar of the Game Piece Inventory Window button, (completely useless, because if a hexagon is not yet selected, it does not display anything) that it is not possible in any way to make it disappear and I will not like to have an object that serves no purpose in the tollbar.

Any suggestion?

Thank you again.

Panther 2010 :)
panther 2010
 
Posts: 119
Joined: July 18th, 2010, 3:04 pm

Re: Game Piece Inventory Window

Postby Cattlesquat » April 30th, 2020, 6:23 pm

If you JUST want the button to be invisible on the toolbar, then you could un-assign the image from it -- then it wouldn't appear on the toolbar at all, and only when its Global Hotkey was pressed. Of course the player could still close it with button that's on it, and then it could only be re-opened with the hotkey. BUT you could conceivably fire that hotkey at startup (with a Startup Global Key Command which told some invisible piece on the map to execute a Global Hotkey trait), and/or you could provide a button somewhere that had a Global Hotkey trait to turn it (back) on.

To make it actually hide itself w/ the hotkey would unfortunately require writing a java custom class (which is a very heavy lift if you haven't done that kind of thing).

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

Re: Game Piece Inventory Window

Postby panther 2010 » May 3rd, 2020, 6:29 pm

Hello Brian,

I have already tried to hide the Game Piece Inventory Window button, un-assigning the image from it and leaving empty the button text, but the only result was the appearance of a white square in the toolbar.

I have already used the Startup Global Key Command which told some invisible piece on the map to execute a Global Hotkey trait successfully in other contexts, but in this case it is completely useless.

What I want to do is open a window (not necessarily a Game Piece Inventory Window ) using a action button on a counter that is in a given hex, so that I can interact via right-click with all the pieces that are in that hex using this window.

Basically what I want to do is a sort of enhanced Mouse Over Stack Viewer. A long time ago I asked to add the possibility to interact with the pieces displayed in the Mouse Over Stack Viewer and I hope this will happen at least in the "phantom" version 4 of Vassal.

I am not a programmer and I am not able to use the Java Language to write a java custom class, but only the commands currently available in Vassal

Be well.

John.
:?
panther 2010
 
Posts: 119
Joined: July 18th, 2010, 3:04 pm

Re: Game Piece Inventory Window

Postby m3tan » June 24th, 2020, 12:52 pm

The workaround I came up with for those annoying white squares was to create a single generic Game Piece Inventory Window "prototype". Basically, the "Show only pieces matching these properties" field for my GPIW has an expression with a bunch of Global Properties:

{Power==Active_Power&&Trait1==Active_Trait1&&Trait2==Active_Trait2} etc...

This allows me to show any game pieces I want in a single window in a context-sensitive manner by constantly updating those Global Properties. I wish the GPIW wasn't so "old-school", because it's actually incredibly powerful and just needs a little "polish" to be even better...
User avatar
m3tan
 
Posts: 210
Joined: August 12th, 2018, 11:49 pm

Re: Game Piece Inventory Window

Postby panther 2010 » October 9th, 2020, 5:52 pm

Hello m3tan,

I apologize for the delay, but I have only just now noticed your reply dated June 24th.
I didn't understand how you make the white square disappear using a protoype.
I use an action button to activate the GPIW, but in any case, the GPIW, before being activated, must first be defined at the editor level and this creates the white square that I cannot eliminate in any way. Any information in this regard will be very welcome.

Cheers!

:)
panther 2010
 
Posts: 119
Joined: July 18th, 2010, 3:04 pm

Re: Game Piece Inventory Window

Postby m3tan » October 9th, 2020, 7:10 pm

I didn't eliminate the white sqaure. What I did was combine about 10 GPIWs into a single window with a generic image and text "Active Window". I used expressions to dynamically update what appears in that GPIW. It's not ideal, but it was better than 10 little white sqaures...
User avatar
m3tan
 
Posts: 210
Joined: August 12th, 2018, 11:49 pm

Re: Game Piece Inventory Window

Postby panther 2010 » October 10th, 2020, 11:23 am

Well, it's a pity. I hoped to finally be able to eliminate that damn white square... I will try another way to simulate the GPIW with a window that can be hiden, if possible.

Be well.

Panther 2010.
:(
panther 2010
 
Posts: 119
Joined: July 18th, 2010, 3:04 pm

Re: Game Piece Inventory Window

Postby kerkael » October 13th, 2020, 8:14 pm

You can always name the button, and hide it under a Toolbar Menu.
I use a dented gear as icon for settings menu. It contains important 2ry options.
And an additional settings menu .... made of things I want to hide from the main toolbar.
I was bothered by the white square too before I did that.
Module I developed: Terraforming Mars
Module I'm working on: Trismegistus
kerkael
 
Posts: 178
Joined: December 1st, 2017, 3:03 pm


Return to Module Design

Who is online

Users browsing this forum: No registered users and 5 guests