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 bool HasMusic;
|
||||
static string systemError;
|
||||
static char mynbcardsStr[512];
|
||||
static JMusic* music;
|
||||
static string currentMusicFile;
|
||||
static void playMusic(string filename = "", bool loop = true);
|
||||
|
||||
@@ -24,7 +24,6 @@ private:
|
||||
float mCreditsYPos;
|
||||
int currentState;
|
||||
int mVolume;
|
||||
char nbcardsStr[400];
|
||||
vector<string> langs;
|
||||
vector<string> primitives;
|
||||
|
||||
@@ -46,7 +45,6 @@ private:
|
||||
bool langChoices;
|
||||
void runTest(); //!!
|
||||
void listPrimitives();
|
||||
void genNbCardsStr(); //computes the contents of nbCardsStr
|
||||
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
|
||||
|
||||
@@ -66,6 +64,7 @@ public:
|
||||
|
||||
int nextSetFolder(const string & root, const string & file); // Retrieves the next directory to have matching file
|
||||
void createUsersFirstDeck(int setId);
|
||||
static void genNbCardsStr(); //computes the contents of nbCardsStr
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
|
||||
enum
|
||||
|
||||
@@ -39,6 +39,7 @@ bool GameApp::HasMusic = true;
|
||||
JMusic * GameApp::music = NULL;
|
||||
string GameApp::currentMusicFile = "";
|
||||
string GameApp::systemError = "";
|
||||
char GameApp::mynbcardsStr[512] = {0};
|
||||
|
||||
vector<JQuadPtr > manaIcons;
|
||||
|
||||
|
||||
@@ -164,22 +164,22 @@ void GameStateMenu::genNbCardsStr()
|
||||
PlayerData * playerdata = NEW PlayerData(MTGCollection());
|
||||
size_t totalUnique = MTGCollection()->primitives.size();
|
||||
size_t totalPrints = MTGCollection()->totalCards();
|
||||
|
||||
|
||||
if (totalUnique != totalPrints)
|
||||
{
|
||||
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);
|
||||
else
|
||||
sprintf(nbcardsStr, _("%i cards (%i unique)").c_str(),totalPrints,totalUnique);
|
||||
sprintf(GameApp::mynbcardsStr, _("%i cards (%i unique)").c_str(),totalPrints,totalUnique);
|
||||
}
|
||||
else
|
||||
{
|
||||
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);
|
||||
else
|
||||
sprintf(nbcardsStr, _("%i cards").c_str(),totalPrints);
|
||||
sprintf(GameApp::mynbcardsStr, _("%i cards").c_str(),totalPrints);
|
||||
}
|
||||
|
||||
SAFE_DELETE(playerdata);
|
||||
@@ -730,7 +730,7 @@ void GameStateMenu::RenderTopMenu()
|
||||
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
|
||||
mFont->SetColor(ARGB(128,255,255,255));
|
||||
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 + 2, 28, (float)(gamePercentComplete()), 4, ARGB(255,220,200, 125));
|
||||
char buf[512];
|
||||
@@ -964,7 +964,6 @@ ostream& GameStateMenu::toString(ostream& out) const
|
||||
<< " ; mCreditsYPos : " << mCreditsYPos
|
||||
<< " ; currentState : " << currentState
|
||||
<< " ; mVolume : " << mVolume
|
||||
<< " ; nbcardsStr : " << nbcardsStr
|
||||
<< " ; mCurrentSetName : " << mCurrentSetName
|
||||
<< " ; mCurrentSetFileName : " << mCurrentSetFileName
|
||||
<< " ; mReadConf : " << mReadConf
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "PrecompiledHeader.h"
|
||||
|
||||
#include "GameStateOptions.h"
|
||||
#include "GameStateMenu.h"
|
||||
#include "GameApp.h"
|
||||
#include "OptionItem.h"
|
||||
#include "SimpleMenu.h"
|
||||
@@ -167,6 +168,7 @@ void GameStateOptions::Update(float dt)
|
||||
JSoundSystem::GetInstance()->SetMusicVolume(options[Options::MUSICVOLUME].number);
|
||||
mParent->DoTransition(TRANSITION_FADE, GAME_STATE_MENU);
|
||||
mState = SHOW_OPTIONS;
|
||||
GameStateMenu::genNbCardsStr();
|
||||
break;
|
||||
case WGuiBase::CONFIRM_NEED:
|
||||
optionsTabs->yieldFocus();
|
||||
|
||||
Reference in New Issue
Block a user