Allow training mission instructions be taken from keymap file.

A place to post suggestions for new features, new bugs, and comments about the existing code.
Post Reply
Bunnywabbit
Posts: 965
Joined: Sun May 15, 2005 7:00 am
Location: Amsterdam, the Netherlands

Post by Bunnywabbit »

Hi,

If we're going to change the keymap, the instructions also need to be changed. Furthermore, if we're going to point players at the possibility to use their own custom keyboard layout, then the instructions need to adapt based on the players inputmap file.

So, as mentioned in this ticket, please code us something, a function or whatever, that will let us do this:

Make it so that the instructor voice can say "push the 'fire weapon button' to continue", rather than "Press the spacebar to continue", the training script can wait for the event

Code: Select all

Goal*   pGoal = new Goal (new GetKeyCondition (TK_FireWeapon))
and rather than the chat code saying:

Code: Select all

pGoal->AddStartAction (new MessageAction ("Press the SPACEBAR when you are ready to proceed."));
it would be:

Code: Select all

pGoal->AddStartAction (new MessageAction ("Press " & GetKeyName(TK_FireWeapon) & " when you are ready to proceed."));
where getKeyName retrieves the corresponding name for the key that is mapped to TK_FireWeapon.

There is a lot of stuff waiting in the stalls for this, so please make this a priority.
Last edited by Bunnywabbit on Mon Jan 16, 2012 10:23 am, edited 1 time in total.
ImageImage current version r158 new beta as of jan 23 2012
ThePhantom032
Posts: 836
Joined: Sat May 09, 2009 11:00 am
Location: Germany

Post by ThePhantom032 »

I will take a look at this.

But I can promise nothing else, not before I take that look :ninja:
Still ready to teach anyone who asks nicely whatever they want to know about playing alleg. Contrary to popular opinion I do not eat newbies. Voobs taste much better.
ThePhantom032
Posts: 836
Joined: Sat May 09, 2009 11:00 am
Location: Germany

Post by ThePhantom032 »

We probably want to access the function
GetString of class InputMapPopup::CommandMap around line 1756 of trekinput.cpp
It is the one that is used to print the key names in the ESC-G-C window .

Training missions do not have access to that function as it is implemented in a way that requires a CommandMap currently only created and maintained by the ESC-G-C window (InputMapPopup)-> so that has to be open.

Now working on how to create a CommandMap without that window around.
Still ready to teach anyone who asks nicely whatever they want to know about playing alleg. Contrary to popular opinion I do not eat newbies. Voobs taste much better.
Bunnywabbit
Posts: 965
Joined: Sun May 15, 2005 7:00 am
Location: Amsterdam, the Netherlands

Post by Bunnywabbit »

ImageImage current version r158 new beta as of jan 23 2012
Post Reply