Create account / Log in

Key Command issued after focus?

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

Key Command issued after focus?

Postby Rhett » August 11th, 2019, 3:19 pm

I am making a module with artillery units. They may combine into fire groups. In order to keep track of which artillery unit is in which fire group I have made an Artillery Group Table (a Map Window).

An artillery unit has two representations, one on the Main Map, one in the Artillery Group Table.

Is it possible to click on a group (a stack of artillery units) in the Artillery Group Table and at the same time highlight the corresponding artillery units on the Main Map?

In other words: is there a Key Command applied to all pieces after a focus (a selection) just like there is a Key Command applied to all pieces ending movement?

How does a piece know it has focus?
Rhett
 
Posts: 15
Joined: March 18th, 2014, 9:32 am

Re: Key Command issued after focus?

Postby BigAl737 » August 12th, 2019, 4:27 pm

I think you could use the selected property and a piece layer to do what you want.

From the user guide: Selected returns true when the piece has been selected with the mouse

Since A GKC can affect pieces on all maps, restrict the GKC to units where selected = true. The GKC then activates a piece layer with an outline image of some sort.

Al
BigAl737
 
Posts: 47
Joined: July 10th, 2009, 6:47 am
Location: Eagle River, AK

Re: Key Command issued after focus?

Postby Rhett » August 12th, 2019, 6:26 pm

What page in the User Guide are you referring to? I guess you mean the Designer's Guide.

On page 44 in the Designer's Guide there is mention of the Basic Piece System Property Selected.

Selected Boolean. Has a value of true when the piece has been selected with the mouse.


This is what I need. Thank you.
Rhett
 
Posts: 15
Joined: March 18th, 2014, 9:32 am

Re: Key Command issued after focus?

Postby Rhett » August 12th, 2019, 6:57 pm

..... and I guess I have to make a button in Artillery Group Table window, that when clicked by the user selects the artillery units in the Main Map that are selcted in the Artillery Group Table map window ... if you follow me .... because the change of value from false to true in the Select property will not by itself generate a GKC.

Is there a way to avoid this? To update the Main Map map directly without the user having to click a button?

Thanks anyway.
Rhett
 
Posts: 15
Joined: March 18th, 2014, 9:32 am

Re: Key Command issued after focus?

Postby Rhett » August 13th, 2019, 3:05 pm

Problem solved.

Global Key Command button in Artillery Group Table -> Trigger Action with {Selected} -> Set Highlight with {ID==$ID$} ->Trigger Action Highlight -> Layer with Highlight toggled


The nice thing now is that I can clear the selection on Main Map by simply pushing the Global Key Command button in the Artillery Group Table again.
Rhett
 
Posts: 15
Joined: March 18th, 2014, 9:32 am


Return to Module Design

Who is online

Users browsing this forum: MSN [Bot] and 1 guest