J :
* Partial fix for issue 380. * This remove a bug where a variable was not initialized in profiles. * The impact on this could have ranged all the way to a full trashing of the user configuration files (though it requires some bad luck)
This commit is contained in:
@@ -122,11 +122,12 @@ class OptionProfile:public OptionDirectory{
|
|||||||
virtual void Entering(JButton key);
|
virtual void Entering(JButton key);
|
||||||
virtual void Reload();
|
virtual void Reload();
|
||||||
virtual void Render();
|
virtual void Render();
|
||||||
|
virtual void initSelections();
|
||||||
virtual void confirmChange(bool confirmed);
|
virtual void confirmChange(bool confirmed);
|
||||||
virtual void updateValue();
|
virtual void updateValue();
|
||||||
void populate();
|
void populate();
|
||||||
private:
|
private:
|
||||||
GameApp * app;
|
GameApp * app;
|
||||||
JGuiListener * listener;
|
JGuiListener * listener;
|
||||||
bool canSelect;
|
bool canSelect;
|
||||||
string preview;
|
string preview;
|
||||||
|
|||||||
@@ -56,10 +56,9 @@ void OptionInteger::setData(){
|
|||||||
//Option Select
|
//Option Select
|
||||||
void OptionSelect::initSelections(){
|
void OptionSelect::initSelections(){
|
||||||
//Find currently active bit in the list.
|
//Find currently active bit in the list.
|
||||||
for(size_t i=0;i<selections.size();i++){
|
for (size_t i = 0; i < selections.size(); ++i)
|
||||||
if(selections[i] == options[id].str)
|
if (selections[i] == options[id].str)
|
||||||
value = i;
|
value = i;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionSelect::Entering(JButton key){
|
void OptionSelect::Entering(JButton key){
|
||||||
@@ -107,6 +106,11 @@ OptionProfile::OptionProfile(GameApp * _app, JGuiListener * jgl) : OptionDirecto
|
|||||||
populate();
|
populate();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void OptionProfile::initSelections() {
|
||||||
|
OptionSelect::initSelections();
|
||||||
|
initialValue = value;
|
||||||
|
}
|
||||||
|
|
||||||
void OptionProfile::addSelection(string s){
|
void OptionProfile::addSelection(string s){
|
||||||
OptionDirectory::addSelection(s);
|
OptionDirectory::addSelection(s);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user