Jeck - Final fix to r1109. It was reloading the old options halfway through saving the new ones.

This commit is contained in:
wagic.jeck
2009-10-20 04:33:43 +00:00
parent 3a4dd403e2
commit 8c4c3f2418
2 changed files with 8 additions and 8 deletions
+6 -5
View File
@@ -116,6 +116,12 @@ void GameStateOptions::Update(float dt)
optionsMenu->Update(dt); optionsMenu->Update(dt);
break; break;
} }
if(mReload){
options.reloadProfile(false);
optionsTabs->Reload();
mReload = false;
}
} }
void GameStateOptions::Render() void GameStateOptions::Render()
@@ -163,11 +169,6 @@ void GameStateOptions::Render()
optionsTabs->Render(); optionsTabs->Render();
if(mReload){
optionsTabs->Reload();
mReload = false;
}
if(mState == SHOW_OPTIONS_MENU) if(mState == SHOW_OPTIONS_MENU)
optionsMenu->Render(); optionsMenu->Render();
+2 -3
View File
@@ -201,6 +201,7 @@ void OptionProfile::Reload(){
populate(); populate();
} }
void OptionProfile::populate(){ void OptionProfile::populate(){
string temp = options[Options::ACTIVE_PROFILE].str; string temp = options[Options::ACTIVE_PROFILE].str;
if (value >= selections.size()){ //TODO fail gracefully. if (value >= selections.size()){ //TODO fail gracefully.
return; return;
@@ -266,14 +267,12 @@ void OptionProfile::confirmChange(bool confirmed){
int result; int result;
if(confirmed) if(confirmed) result = value;
result = value;
else result = initialValue; else result = initialValue;
options[Options::ACTIVE_PROFILE] = selections[result]; options[Options::ACTIVE_PROFILE] = selections[result];
value = result; value = result;
options.reloadProfile(false);
populate(); populate();
if(listener && confirmed) if(listener && confirmed)
listener->ButtonPressed(-102,5); listener->ButtonPressed(-102,5);