Jeck - Hopefully fixes issue 114.
* Options before the desired optionID were not using the correct option class. * Enums were expected to be lower-case.
This commit is contained in:
@@ -327,6 +327,7 @@ public:
|
||||
virtual void Update(float dt);
|
||||
virtual void ButtonPressed(int controllerId, int controlId);
|
||||
virtual void Add(WGuiBase* item);
|
||||
virtual void confirmChange(bool confirmed);
|
||||
|
||||
WGuiBase * Current();
|
||||
void nextItem();
|
||||
|
||||
@@ -325,7 +325,7 @@ GameOption * GameOptions::get(int optionID) {
|
||||
values.reserve(optionID);
|
||||
|
||||
while(x <= optionID){
|
||||
switch(optionID){
|
||||
switch(x){
|
||||
case Options::HANDDIRECTION:
|
||||
goEnum = NEW GameOptionEnum();
|
||||
goEnum->def = OptionHandDirection::getInstance();
|
||||
@@ -633,7 +633,9 @@ bool GameOptionEnum::read(string input){
|
||||
|
||||
vector<EnumDefinition::assoc>::iterator it;
|
||||
for(it=def->values.begin();it != def->values.end();it++){
|
||||
if(it->second == input){
|
||||
string v = it->second;
|
||||
std::transform(v.begin(),v.end(),v.begin(),::tolower);
|
||||
if(v == input){
|
||||
number = it->first;
|
||||
return true;
|
||||
}
|
||||
@@ -654,8 +656,8 @@ OptionHandDirection::OptionHandDirection(){
|
||||
};
|
||||
OptionManaDisplay OptionManaDisplay::mDef;
|
||||
OptionManaDisplay::OptionManaDisplay(){
|
||||
mDef.values.push_back(EnumDefinition::assoc(STATIC, "Simple"));
|
||||
mDef.values.push_back(EnumDefinition::assoc(DYNAMIC, "Eye candy"));
|
||||
mDef.values.push_back(EnumDefinition::assoc(STATIC, "Simple"));
|
||||
mDef.values.push_back(EnumDefinition::assoc(BOTH, "Both"));
|
||||
};
|
||||
OptionVolume OptionVolume::mDef;
|
||||
@@ -666,7 +668,7 @@ OptionVolume::OptionVolume(){
|
||||
OptionDifficulty OptionDifficulty::mDef;
|
||||
OptionDifficulty::OptionDifficulty(){
|
||||
mDef.values.push_back(EnumDefinition::assoc(NORMAL, "Normal"));
|
||||
mDef.values.push_back(EnumDefinition::assoc(HARDER, "Harder"));
|
||||
mDef.values.push_back(EnumDefinition::assoc(HARD, "Hard"));
|
||||
mDef.values.push_back(EnumDefinition::assoc(HARDER, "Harder"));
|
||||
mDef.values.push_back(EnumDefinition::assoc(EVIL, "Evil"));
|
||||
};
|
||||
@@ -767,7 +767,6 @@ void WDecoConfirm::setData(){
|
||||
if(!it)
|
||||
return;
|
||||
|
||||
it->confirmChange(true);
|
||||
it->setData();
|
||||
}
|
||||
|
||||
@@ -1064,6 +1063,10 @@ void WGuiMenu::Render(){
|
||||
for(vector<WGuiBase*>::iterator it = items.begin();it!=items.end();it++)
|
||||
(*it)->Render();
|
||||
}
|
||||
void WGuiMenu::confirmChange(bool confirmed){
|
||||
for(vector<WGuiBase*>::iterator it = items.begin();it!=items.end();it++)
|
||||
(*it)->confirmChange(confirmed);
|
||||
}
|
||||
|
||||
void WGuiMenu::ButtonPressed(int controllerId, int controlId){
|
||||
WGuiBase * it = Current();
|
||||
@@ -1137,6 +1140,7 @@ void WGuiTabMenu::Render(){
|
||||
}
|
||||
|
||||
void WGuiTabMenu::save(){
|
||||
confirmChange(true);
|
||||
setData();
|
||||
::options.save();
|
||||
}
|
||||
Reference in New Issue
Block a user