Fix profile status on upper left of main menu
The profile status on the upper left of main menu should update now when changing user profiles...:)
This commit is contained in:
@@ -73,6 +73,7 @@ public:
|
|||||||
static hgeParticleSystem * Particles[6];
|
static hgeParticleSystem * Particles[6];
|
||||||
static bool HasMusic;
|
static bool HasMusic;
|
||||||
static string systemError;
|
static string systemError;
|
||||||
|
static char mynbcardsStr[512];
|
||||||
static JMusic* music;
|
static JMusic* music;
|
||||||
static string currentMusicFile;
|
static string currentMusicFile;
|
||||||
static void playMusic(string filename = "", bool loop = true);
|
static void playMusic(string filename = "", bool loop = true);
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ private:
|
|||||||
float mCreditsYPos;
|
float mCreditsYPos;
|
||||||
int currentState;
|
int currentState;
|
||||||
int mVolume;
|
int mVolume;
|
||||||
char nbcardsStr[400];
|
|
||||||
vector<string> langs;
|
vector<string> langs;
|
||||||
vector<string> primitives;
|
vector<string> primitives;
|
||||||
|
|
||||||
@@ -46,7 +45,6 @@ private:
|
|||||||
bool langChoices;
|
bool langChoices;
|
||||||
void runTest(); //!!
|
void runTest(); //!!
|
||||||
void listPrimitives();
|
void listPrimitives();
|
||||||
void genNbCardsStr(); //computes the contents of nbCardsStr
|
|
||||||
void ensureMGuiController(); //creates the MGuiController if it doesn't exist
|
void ensureMGuiController(); //creates the MGuiController if it doesn't exist
|
||||||
string loadRandomWallpaper(); //loads a list of string of textures that can be randolmy shown on the loading screen
|
string loadRandomWallpaper(); //loads a list of string of textures that can be randolmy shown on the loading screen
|
||||||
|
|
||||||
@@ -66,6 +64,7 @@ public:
|
|||||||
|
|
||||||
int nextSetFolder(const string & root, const string & file); // Retrieves the next directory to have matching file
|
int nextSetFolder(const string & root, const string & file); // Retrieves the next directory to have matching file
|
||||||
void createUsersFirstDeck(int setId);
|
void createUsersFirstDeck(int setId);
|
||||||
|
static void genNbCardsStr(); //computes the contents of nbCardsStr
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ bool GameApp::HasMusic = true;
|
|||||||
JMusic * GameApp::music = NULL;
|
JMusic * GameApp::music = NULL;
|
||||||
string GameApp::currentMusicFile = "";
|
string GameApp::currentMusicFile = "";
|
||||||
string GameApp::systemError = "";
|
string GameApp::systemError = "";
|
||||||
|
char GameApp::mynbcardsStr[512] = {0};
|
||||||
|
|
||||||
vector<JQuadPtr > manaIcons;
|
vector<JQuadPtr > manaIcons;
|
||||||
|
|
||||||
|
|||||||
@@ -164,22 +164,22 @@ void GameStateMenu::genNbCardsStr()
|
|||||||
PlayerData * playerdata = NEW PlayerData(MTGCollection());
|
PlayerData * playerdata = NEW PlayerData(MTGCollection());
|
||||||
size_t totalUnique = MTGCollection()->primitives.size();
|
size_t totalUnique = MTGCollection()->primitives.size();
|
||||||
size_t totalPrints = MTGCollection()->totalCards();
|
size_t totalPrints = MTGCollection()->totalCards();
|
||||||
|
|
||||||
if (totalUnique != totalPrints)
|
if (totalUnique != totalPrints)
|
||||||
{
|
{
|
||||||
if (playerdata && !options[Options::ACTIVE_PROFILE].isDefault())
|
if (playerdata && !options[Options::ACTIVE_PROFILE].isDefault())
|
||||||
sprintf(nbcardsStr, _("%s: %i cards (%i) (%i unique)").c_str(), options[Options::ACTIVE_PROFILE].str.c_str(),
|
sprintf(GameApp::mynbcardsStr, _("%s: %i cards (%i) (%i unique)").c_str(), options[Options::ACTIVE_PROFILE].str.c_str(),
|
||||||
playerdata->collection->totalCards(), totalPrints,totalUnique);
|
playerdata->collection->totalCards(), totalPrints,totalUnique);
|
||||||
else
|
else
|
||||||
sprintf(nbcardsStr, _("%i cards (%i unique)").c_str(),totalPrints,totalUnique);
|
sprintf(GameApp::mynbcardsStr, _("%i cards (%i unique)").c_str(),totalPrints,totalUnique);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (playerdata && !options[Options::ACTIVE_PROFILE].isDefault())
|
if (playerdata && !options[Options::ACTIVE_PROFILE].isDefault())
|
||||||
sprintf(nbcardsStr, _("%s: %i cards (%i)").c_str(), options[Options::ACTIVE_PROFILE].str.c_str(),
|
sprintf(GameApp::mynbcardsStr, _("%s: %i cards (%i)").c_str(), options[Options::ACTIVE_PROFILE].str.c_str(),
|
||||||
playerdata->collection->totalCards(), totalPrints);
|
playerdata->collection->totalCards(), totalPrints);
|
||||||
else
|
else
|
||||||
sprintf(nbcardsStr, _("%i cards").c_str(),totalPrints);
|
sprintf(GameApp::mynbcardsStr, _("%i cards").c_str(),totalPrints);
|
||||||
}
|
}
|
||||||
|
|
||||||
SAFE_DELETE(playerdata);
|
SAFE_DELETE(playerdata);
|
||||||
@@ -730,7 +730,7 @@ void GameStateMenu::RenderTopMenu()
|
|||||||
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
|
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
|
||||||
mFont->SetColor(ARGB(128,255,255,255));
|
mFont->SetColor(ARGB(128,255,255,255));
|
||||||
mFont->DrawString(GAME_VERSION, rightTextPos, 5, JGETEXT_RIGHT);
|
mFont->DrawString(GAME_VERSION, rightTextPos, 5, JGETEXT_RIGHT);
|
||||||
mFont->DrawString(nbcardsStr, leftTextPos, 5);
|
mFont->DrawString(GameApp::mynbcardsStr, leftTextPos, 5);
|
||||||
renderer->FillRect(leftTextPos, 26, 104, 8, ARGB(255, 100, 90, 60));
|
renderer->FillRect(leftTextPos, 26, 104, 8, ARGB(255, 100, 90, 60));
|
||||||
renderer->FillRect(leftTextPos + 2, 28, (float)(gamePercentComplete()), 4, ARGB(255,220,200, 125));
|
renderer->FillRect(leftTextPos + 2, 28, (float)(gamePercentComplete()), 4, ARGB(255,220,200, 125));
|
||||||
char buf[512];
|
char buf[512];
|
||||||
@@ -964,7 +964,6 @@ ostream& GameStateMenu::toString(ostream& out) const
|
|||||||
<< " ; mCreditsYPos : " << mCreditsYPos
|
<< " ; mCreditsYPos : " << mCreditsYPos
|
||||||
<< " ; currentState : " << currentState
|
<< " ; currentState : " << currentState
|
||||||
<< " ; mVolume : " << mVolume
|
<< " ; mVolume : " << mVolume
|
||||||
<< " ; nbcardsStr : " << nbcardsStr
|
|
||||||
<< " ; mCurrentSetName : " << mCurrentSetName
|
<< " ; mCurrentSetName : " << mCurrentSetName
|
||||||
<< " ; mCurrentSetFileName : " << mCurrentSetFileName
|
<< " ; mCurrentSetFileName : " << mCurrentSetFileName
|
||||||
<< " ; mReadConf : " << mReadConf
|
<< " ; mReadConf : " << mReadConf
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "PrecompiledHeader.h"
|
#include "PrecompiledHeader.h"
|
||||||
|
|
||||||
#include "GameStateOptions.h"
|
#include "GameStateOptions.h"
|
||||||
|
#include "GameStateMenu.h"
|
||||||
#include "GameApp.h"
|
#include "GameApp.h"
|
||||||
#include "OptionItem.h"
|
#include "OptionItem.h"
|
||||||
#include "SimpleMenu.h"
|
#include "SimpleMenu.h"
|
||||||
@@ -167,6 +168,7 @@ void GameStateOptions::Update(float dt)
|
|||||||
JSoundSystem::GetInstance()->SetMusicVolume(options[Options::MUSICVOLUME].number);
|
JSoundSystem::GetInstance()->SetMusicVolume(options[Options::MUSICVOLUME].number);
|
||||||
mParent->DoTransition(TRANSITION_FADE, GAME_STATE_MENU);
|
mParent->DoTransition(TRANSITION_FADE, GAME_STATE_MENU);
|
||||||
mState = SHOW_OPTIONS;
|
mState = SHOW_OPTIONS;
|
||||||
|
GameStateMenu::genNbCardsStr();
|
||||||
break;
|
break;
|
||||||
case WGuiBase::CONFIRM_NEED:
|
case WGuiBase::CONFIRM_NEED:
|
||||||
optionsTabs->yieldFocus();
|
optionsTabs->yieldFocus();
|
||||||
|
|||||||
Reference in New Issue
Block a user