Fixed bug #1799454 (help menu bug), and a minor coding style improvements related to it.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1269 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
32b88d2091
commit
d06c13fb36
@ -190,7 +190,7 @@ get stuck or fall too far, use the rescue button to get back on track."),
|
||||
const int LABEL_ID = widgetSet->varray(HS3);
|
||||
widgetSet -> filler(HS3);
|
||||
|
||||
for(int i = KC_LEFT; i <= KC_LAST; i++)
|
||||
for(int i = KC_FIRST; i <= KC_LAST; i++)
|
||||
{
|
||||
// *sigh* widget set stores only pointer to strings, so
|
||||
// to make sure that all key-strings are permanent, they
|
||||
|
@ -30,7 +30,7 @@ class ssgContext;
|
||||
class HelpMenu: public BaseGUI
|
||||
{
|
||||
private:
|
||||
std::string m_all_keys[KC_FIRE+1];
|
||||
std::string m_all_keys[KC_LAST+1];
|
||||
|
||||
ssgContext* m_context;
|
||||
ssgTransform* m_box;
|
||||
|
@ -103,7 +103,7 @@ void RaceGUI::UpdateKeyboardMappings()
|
||||
{
|
||||
PlayerKart* kart = world->getPlayerKart(i);
|
||||
|
||||
for(int ka=(int) KC_LEFT;ka< (int) KC_LAST+1;ka++)
|
||||
for(int ka=(int)KC_FIRST; ka < (int)KC_LAST+1; ka++)
|
||||
putEntry(kart, (KartActions) ka);
|
||||
}
|
||||
|
||||
|
@ -36,9 +36,8 @@ typedef struct
|
||||
}
|
||||
Input;
|
||||
|
||||
// Some part (e.g. gui/PlayerControls) depend on KC_LEFT being the first
|
||||
// entry, and KC_FIRE being the last - so any action added should be
|
||||
// added in between those two values.
|
||||
//When adding any action at the beginning or at the end, remember to update
|
||||
//the KC_FIRST and/or KC_LAST constants.
|
||||
enum KartActions { KC_LEFT,
|
||||
KC_RIGHT,
|
||||
KC_ACCEL,
|
||||
@ -48,7 +47,8 @@ enum KartActions { KC_LEFT,
|
||||
KC_RESCUE,
|
||||
KC_FIRE,
|
||||
KC_LOOK_BACK };
|
||||
#define KC_LAST (KC_LOOK_BACK)
|
||||
const int KC_FIRST = KC_LEFT;
|
||||
const int KC_LAST = KC_LOOK_BACK;
|
||||
|
||||
extern const char *sKartAction2String[KC_LAST+1];
|
||||
/*class for managing player name and control configuration*/
|
||||
|
Loading…
Reference in New Issue
Block a user