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: 139
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: 987
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: 139
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: 987
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: 139
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: 232
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: 139
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: 232
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: 139
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.
Still working on : Terraforming Mars Fr
kerkael
 
Posts: 197
Joined: December 1st, 2017, 3:03 pm

Re: Game Piece Inventory Window

Postby panther 2010 » January 19th, 2021, 9:32 am

Hello kerkael,

sorry to be so late in reply to your answer to my problem, but I have been very busy in this last period of time.

Unfortunately, I wasn't able to understand what you have done. How can I hide the GPIW button in a Toolbar Menu?

Thank you for your help on that matter.

Be well.

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

Re: Game Piece Inventory Window

Postby Benkyo » January 29th, 2021, 7:24 am

In the editor, right-click the module, "Add Toolbar Menu" call it Hidden Buttons or whatever. Do not assign a button text or icon to it. Add any buttons you want to hide to this menu as Menu Entries.

Using this method you can hide any toolbar buttons.
Benkyo
 
Posts: 326
Joined: March 13th, 2013, 11:02 pm

Re: Game Piece Inventory Window

Postby panther 2010 » February 1st, 2021, 6:05 pm

Hello Benkyo,

What I want to do is not hide a button in the toolbar, I know how to do it and it works. I'm interested in hiding a map window, in particular a GPIW and I don't know if that's possible or not.

So far, all attempts in this direction have failed.

Be well.

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

Re: Game Piece Inventory Window

Postby Benkyo » February 1st, 2021, 9:24 pm

Earlier you wrote:

"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."

"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."

"Well, it's a pity. I hoped to finally be able to eliminate that damn white square... "

I was resolving this issue for you. Apparently, between then and now you figured out the answer yourself?

Hotkeys to make windows open and close is trivial, so I'm guessing that's not what you are asking about.

Earlier you spoke about expanding a hex into a window, but if that means what I think it means, I don't think there's any practical way to do that, except through use of a GPIW... but you already seem to know this.
Benkyo
 
Posts: 326
Joined: March 13th, 2013, 11:02 pm

Re: Game Piece Inventory Window

Postby panther 2010 » February 2nd, 2021, 9:28 am

Hello Benkyo,

I am currently using an action button that opens a GPIW to be able to interact more easily with a stack of units. Everything works perfectly.
The problem, which is only aesthetic, is that a GPIW must be defined at the editor level and it is not possible to make the related button disappear from the toolbar in any way.
The button in the toolbar is useless, since the GPIW is activated only by an action button present on any counter.

In practice, a white square appears in the toolbar; if one clicks on it, an empty GPIW opens, since no hex has been defined.

I intended to replace the GPIW with a public window where to copy all the units present in a given hex, in order to then interact individually with each of them, but then the problem arises of deleting them before closing the window itself. Better to keep using the GPIW and keep the useless white square in the toolbar!

Cheers.

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

Next

Return to Module Design

Who is online

Users browsing this forum: Google [Bot] and 4 guests