Skip to content

Commit

Permalink
KOTOR: Make option menus' adoptChanges() private
Browse files Browse the repository at this point in the history
Each menu should call its own adoptChanges().
  • Loading branch information
DrMcCoy committed Jul 8, 2018
1 parent ae3dfde commit ba57eb7
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
7 changes: 0 additions & 7 deletions src/engines/kotor/gui/main/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,11 @@ void OptionsMenu::callbackActive(Widget &widget) {
}

if (widget.getTag() == "BTN_BACK") {
adoptChanges();
_returnCode = 1;
return;
}
}

void OptionsMenu::adoptChanges() {
dynamic_cast<OptionsGameplayMenu &>(*_gameplay).adoptChanges();
dynamic_cast<OptionsAutoPauseMenu &>(*_autopause).adoptChanges();
}


} // End of namespace KotOR

} // End of namespace Engines
2 changes: 0 additions & 2 deletions src/engines/kotor/gui/main/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class OptionsMenu : public GUI {
void callbackActive(Widget &widget);

private:
void adoptChanges();

Common::ScopedPtr<GUI> _gameplay;
Common::ScopedPtr<GUI> _feedback;
Common::ScopedPtr<GUI> _autopause;
Expand Down
4 changes: 2 additions & 2 deletions src/engines/kotor/gui/options/autopause.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ class OptionsAutoPauseMenu : public GUI {

virtual void show();

void adoptChanges();

protected:
void callbackActive(Widget &widget);

Expand All @@ -54,6 +52,8 @@ class OptionsAutoPauseMenu : public GUI {
void setDefault();
void readConfig();
void displayConfig();

void adoptChanges();
};

} // End of namespace KotOR
Expand Down
1 change: 1 addition & 0 deletions src/engines/kotor/gui/options/gameplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ void OptionsGameplayMenu::callbackActive(Widget &widget) {
}

if (widget.getTag() == "BTN_BACK") {
adoptChanges();
_returnCode = 1;
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/engines/kotor/gui/options/gameplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ class OptionsGameplayMenu : public GUI {

virtual void show();

void adoptChanges();

protected:
void callbackActive(Widget &widget);

Expand All @@ -61,6 +59,8 @@ class OptionsGameplayMenu : public GUI {
void displayConfig();

void updateDifficulty(int difficulty);

void adoptChanges();
};

} // End of namespace KotOR
Expand Down

0 comments on commit ba57eb7

Please sign in to comment.