diff --git a/projects/mtg/include/OptionItem.h b/projects/mtg/include/OptionItem.h index 3abd6367e..6b598abfd 100644 --- a/projects/mtg/include/OptionItem.h +++ b/projects/mtg/include/OptionItem.h @@ -168,6 +168,7 @@ private: class OptionsMenu { public: + JLBFont * mFont; OptionsList * tabs[MAX_OPTION_TABS]; int nbitems; int current; diff --git a/projects/mtg/include/WResourceManager.h b/projects/mtg/include/WResourceManager.h index 38aeaba06..adeda6db4 100644 --- a/projects/mtg/include/WResourceManager.h +++ b/projects/mtg/include/WResourceManager.h @@ -44,13 +44,14 @@ public: JSample * ssLoadSample(const char *fileName); //Our new redirect system. - string graphicsFile(const string filename, const string specific = ""); + string graphicsFile(const string filename, const string specific = "", bool bFont = false); string musicFile(const string filename, const string specific = ""); string sfxFile(const string filename, const string specific = ""); int fileOK(string filename, bool relative = false); private: JResourceManager * jrm; + map stopgap; }; #endif \ No newline at end of file diff --git a/projects/mtg/src/GameOptions.cpp b/projects/mtg/src/GameOptions.cpp index aa5704778..37303f411 100644 --- a/projects/mtg/src/GameOptions.cpp +++ b/projects/mtg/src/GameOptions.cpp @@ -196,7 +196,7 @@ GameSettings::~GameSettings(){ SAFE_DELETE(globalOptions); SAFE_DELETE(profileOptions); - SAFE_DELETE(themeOptions); + SAFE_DELETE(themeOptions); } GameOption& GameSettings::operator[](string option_name){ diff --git a/projects/mtg/src/GameStateOptions.cpp b/projects/mtg/src/GameStateOptions.cpp index 469d475a9..05524bfab 100644 --- a/projects/mtg/src/GameStateOptions.cpp +++ b/projects/mtg/src/GameStateOptions.cpp @@ -29,6 +29,7 @@ void GameStateOptions::Start() OptionsList * optionsList; optionsList = NEW OptionsList("Settings"); + optionsList->Add(NEW OptionHeader("General Options")); if (GameApp::HasMusic) optionsList->Add(NEW OptionInteger(Options::MUSICVOLUME, "Music volume", 100, 10)); optionsList->Add(NEW OptionInteger(Options::SFXVOLUME, "SFX volume", 100, 10)); optionsList->Add(NEW OptionInteger(Options::OSD, "Display InGame extra information")); @@ -86,11 +87,11 @@ void GameStateOptions::Update(float dt) else if (mState == SHOW_OPTIONS){ switch(optionsTabs->Submode()){ - case OPTIONS_SUBMODE_RELOAD: - optionsTabs->acceptSubmode(); - optionsTabs->reloadValues(); - mState = SHOW_OPTIONS; - break; + // case OPTIONS_SUBMODE_RELOAD: + // optionsTabs->acceptSubmode(); + // optionsTabs->reloadValues(); + // mState = SHOW_OPTIONS; + // break; case OPTIONS_SUBMODE_PROFILE: mState = SHOW_OPTIONS_PROFILE; break; @@ -107,8 +108,6 @@ void GameStateOptions::Update(float dt) }else if(mState == SHOW_OPTIONS_PROFILE){ confirmMenu->Update(dt); } - - } void GameStateOptions::Render() @@ -189,13 +188,13 @@ void GameStateOptions::ButtonPressed(int controllerId, int controlId) switch (controlId){ case 1: //Load the new profile. - optionsTabs->acceptSubmode(); - optionsTabs->reloadValues(); + //optionsTabs->acceptSubmode(); + //optionsTabs->reloadValues(); //Reset the current settings to those of the profile... mState = SHOW_OPTIONS; break; case 2: - optionsTabs->cancelSubmode(); + //optionsTabs->cancelSubmode(); mState = SHOW_OPTIONS; break; } diff --git a/projects/mtg/src/OptionItem.cpp b/projects/mtg/src/OptionItem.cpp index af46dda30..0acd7de4e 100644 --- a/projects/mtg/src/OptionItem.cpp +++ b/projects/mtg/src/OptionItem.cpp @@ -214,7 +214,6 @@ void OptionProfile::updateValue(){ } void OptionProfile::populate(){ - JRenderer * renderer = JRenderer::GetInstance(); string temp = options[Options::ACTIVE_PROFILE].str; if(value < 0 || value >= selections.size()){ //TODO fail gracefully. @@ -226,8 +225,10 @@ void OptionProfile::populate(){ SAFE_DELETE(mAvatar); SAFE_DELETE(mAvatarTex); mAvatarTex = JRenderer::GetInstance()->LoadTexture(options.profileFile("avatar.jpg","",true,true).c_str(), false); - if (mAvatarTex) + if (mAvatarTex){ mAvatar = NEW JQuad(mAvatarTex, 0, 0, 35, 50); + renderer->BindTexture(mAvatarTex); + } options.checkProfile(); PlayerData * pdata = NEW PlayerData(app->collection); @@ -453,8 +454,6 @@ void OptionsList::Render(){ } } - - //Always fill screen if(listHeight > SCREEN_HEIGHT) { @@ -564,15 +563,13 @@ void OptionsMenu::Add(OptionsList * tab){ } void OptionsMenu::Render(){ - JLBFont * mFont = GameApp::CommonRes->GetJLBFont("f3"); - - if (!nbitems){ + if (nbitems == 0){ mFont->DrawString("NO OPTIONS AVAILABLE",SCREEN_WIDTH/2, 5, JGETEXT_RIGHT); return; } JRenderer * renderer = JRenderer::GetInstance(); - + int offset = 0; for(int i=0;iGetStringWidth(tabs[i]->sectionName.c_str()); @@ -589,7 +586,7 @@ void OptionsMenu::Render(){ } if(current > -1 && current < nbitems && tabs[current]) - tabs[current]->Render(); + tabs[current]->Render(); } void OptionsMenu::Update(float dt){ @@ -625,6 +622,7 @@ void OptionsMenu::Update(float dt){ OptionsMenu::OptionsMenu(){ nbitems=0; current=0; + mFont = GameApp::CommonRes->GetJLBFont("f3"); for(int x=0;xLoadJLBFont(graphicsFile(fontName), height); } JLBFont* WResourceManager::GetJLBFont(const string &fontName){ - return jrm->GetJLBFont(graphicsFile(fontName)); + return jrm->GetJLBFont(graphicsFile(fontName, "", true)); } JLBFont* WResourceManager::GetJLBFont(int id){