Put constans into extra namespace as kBackToMainMenuID...
collides with itself. GameStateAwards::kBackToMainMenuID and GameStateOptions::kBackToMainMenuID define those with different values.
This commit is contained in:
@@ -21,7 +21,7 @@ enum ENUM_AWARDS_STATE
|
||||
|
||||
};
|
||||
|
||||
namespace
|
||||
namespace GameStateAwardsConstants
|
||||
{
|
||||
const int kBackToTrophiesID = 2;
|
||||
const int kBackToMainMenuID = 1;
|
||||
@@ -186,8 +186,8 @@ void GameStateAwards::Update(float dt)
|
||||
SAFE_DELETE(menu);
|
||||
menu = NEW SimpleMenu(JGE::GetInstance(), WResourceManager::Instance(), EXIT_AWARDS_MENU, this, Fonts::MENU_FONT, 50, 170);
|
||||
if (mState == STATE_DETAILS)
|
||||
menu->Add(kBackToTrophiesID, "Back to Trophies");
|
||||
menu->Add(kBackToMainMenuID, "Back to Main Menu");
|
||||
menu->Add(GameStateAwardsConstants::kBackToTrophiesID, "Back to Trophies");
|
||||
menu->Add(GameStateAwardsConstants::kBackToMainMenuID, "Back to Main Menu");
|
||||
menu->Add(kCancelMenuID, "Cancel");
|
||||
break;
|
||||
case JGE_BTN_PREV:
|
||||
@@ -359,11 +359,11 @@ void GameStateAwards::ButtonPressed(int controllerId, int controlId)
|
||||
if (controllerId == EXIT_AWARDS_MENU)
|
||||
switch (controlId)
|
||||
{
|
||||
case kBackToMainMenuID:
|
||||
case GameStateAwardsConstants::kBackToMainMenuID:
|
||||
mParent->DoTransition(TRANSITION_FADE, GAME_STATE_MENU);
|
||||
showMenu = false;
|
||||
break;
|
||||
case kBackToTrophiesID:
|
||||
case GameStateAwardsConstants::kBackToTrophiesID:
|
||||
mState = STATE_LISTVIEW;
|
||||
SAFE_DELETE(detailview);
|
||||
showMenu = false;
|
||||
|
||||
@@ -7,13 +7,12 @@
|
||||
#include "SimplePad.h"
|
||||
#include "Translate.h"
|
||||
|
||||
namespace
|
||||
namespace GameStateOptionsConstants
|
||||
{
|
||||
const int kSaveAndBackToMainMenuID = 1;
|
||||
const int kBackToMainMenuID = 2;
|
||||
const int kNewProfileID = 4;
|
||||
const int kReloadID = 5;
|
||||
|
||||
}
|
||||
|
||||
GameStateOptions::GameStateOptions(GameApp* parent) :
|
||||
@@ -78,7 +77,7 @@ void GameStateOptions::Start()
|
||||
|
||||
optionsList->Add(NEW WGuiSplit(cPrf, cThm));
|
||||
optionsList->Add(cStyle);
|
||||
optionsList->Add(NEW WGuiButton(NEW WGuiHeader("New Profile"), -102, kNewProfileID, this));
|
||||
optionsList->Add(NEW WGuiButton(NEW WGuiHeader("New Profile"), -102, GameStateOptionsConstants::kNewProfileID, this));
|
||||
|
||||
optionsList->Add(NEW WDecoCheat(NEW OptionInteger(Options::CHEATMODE, "Enable Cheat Mode")));
|
||||
optionsList->Add(NEW WDecoCheat(NEW OptionInteger(Options::OPTIMIZE_HAND, "Optimize Starting Hand")));
|
||||
@@ -118,8 +117,8 @@ void GameStateOptions::Start()
|
||||
optionsTabs->Add(optionsList);
|
||||
|
||||
optionsMenu = NEW SimpleMenu(JGE::GetInstance(), WResourceManager::Instance(), -102, this, Fonts::MAIN_FONT, 50, 170);
|
||||
optionsMenu->Add(kBackToMainMenuID, "Back to Main Menu");
|
||||
optionsMenu->Add(kSaveAndBackToMainMenuID, "Save And Exit");
|
||||
optionsMenu->Add(GameStateOptionsConstants::kBackToMainMenuID, "Back to Main Menu");
|
||||
optionsMenu->Add(GameStateOptionsConstants::kSaveAndBackToMainMenuID, "Save And Exit");
|
||||
optionsMenu->Add(kCancelMenuID, "Cancel");
|
||||
|
||||
optionsTabs->Entering(JGE_BTN_NONE);
|
||||
@@ -285,21 +284,21 @@ void GameStateOptions::ButtonPressed(int controllerId, int controlId)
|
||||
if (controllerId == -102)
|
||||
switch (controlId)
|
||||
{
|
||||
case kSaveAndBackToMainMenuID:
|
||||
case GameStateOptionsConstants::kSaveAndBackToMainMenuID:
|
||||
mState = SAVE;
|
||||
break;
|
||||
//Set Audio volume
|
||||
case kBackToMainMenuID:
|
||||
case GameStateOptionsConstants::kBackToMainMenuID:
|
||||
mParent->DoTransition(TRANSITION_FADE, GAME_STATE_MENU);
|
||||
break;
|
||||
case kCancelMenuID:
|
||||
mState = SHOW_OPTIONS;
|
||||
break;
|
||||
case kNewProfileID:
|
||||
case GameStateOptionsConstants::kNewProfileID:
|
||||
options.keypadStart("", &newProfile);
|
||||
options.keypadTitle("New Profile");
|
||||
break;
|
||||
case kReloadID:
|
||||
case GameStateOptionsConstants::kReloadID:
|
||||
mReload = true;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user