UI: Avoid pushing a screen on top of itself.
In case someone doesn't realize they're on settings, or etc.
This commit is contained in:
parent
f1bd54148b
commit
5c81c67410
5 changed files with 8 additions and 4 deletions
|
@ -33,6 +33,8 @@ class ControlMappingScreen : public UIDialogScreenWithBackground {
|
||||||
public:
|
public:
|
||||||
ControlMappingScreen() {}
|
ControlMappingScreen() {}
|
||||||
void KeyMapped(int pspkey); // Notification to let us refocus the same one after recreating views.
|
void KeyMapped(int pspkey); // Notification to let us refocus the same one after recreating views.
|
||||||
|
std::string tag() const override { return "control mapping"; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void CreateViews() override;
|
virtual void CreateViews() override;
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -31,6 +31,7 @@ public:
|
||||||
virtual bool touch(const TouchInput &touch) override;
|
virtual bool touch(const TouchInput &touch) override;
|
||||||
virtual void dialogFinished(const Screen *dialog, DialogResult result) override;
|
virtual void dialogFinished(const Screen *dialog, DialogResult result) override;
|
||||||
virtual void onFinish(DialogResult reason) override;
|
virtual void onFinish(DialogResult reason) override;
|
||||||
|
std::string tag() const override { return "display layout screen"; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual UI::EventReturn OnCenter(UI::EventParams &e);
|
virtual UI::EventReturn OnCenter(UI::EventParams &e);
|
||||||
|
|
|
@ -35,7 +35,7 @@ public:
|
||||||
|
|
||||||
virtual void update();
|
virtual void update();
|
||||||
|
|
||||||
virtual std::string tag() const { return "game"; }
|
std::string tag() const override { return "game"; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void CreateViews();
|
virtual void CreateViews();
|
||||||
|
|
|
@ -30,6 +30,7 @@ public:
|
||||||
|
|
||||||
virtual void update();
|
virtual void update();
|
||||||
virtual void onFinish(DialogResult result);
|
virtual void onFinish(DialogResult result);
|
||||||
|
std::string tag() const override { return "settings"; }
|
||||||
|
|
||||||
UI::Event OnRecentChanged;
|
UI::Event OnRecentChanged;
|
||||||
|
|
||||||
|
|
|
@ -165,13 +165,13 @@ void HandleCommonMessages(const char *message, const char *value, ScreenManager
|
||||||
if (PSP_IsInited()) {
|
if (PSP_IsInited()) {
|
||||||
currentMIPS->UpdateCore((CPUCore)g_Config.iCpuCore);
|
currentMIPS->UpdateCore((CPUCore)g_Config.iCpuCore);
|
||||||
}
|
}
|
||||||
} else if (!strcmp(message, "control mapping") && isActiveScreen) {
|
} else if (!strcmp(message, "control mapping") && isActiveScreen && activeScreen->tag() != "control mapping") {
|
||||||
UpdateUIState(UISTATE_MENU);
|
UpdateUIState(UISTATE_MENU);
|
||||||
manager->push(new ControlMappingScreen());
|
manager->push(new ControlMappingScreen());
|
||||||
} else if (!strcmp(message, "display layout editor") && isActiveScreen) {
|
} else if (!strcmp(message, "display layout editor") && isActiveScreen && activeScreen->tag() != "display layout screen") {
|
||||||
UpdateUIState(UISTATE_MENU);
|
UpdateUIState(UISTATE_MENU);
|
||||||
manager->push(new DisplayLayoutScreen());
|
manager->push(new DisplayLayoutScreen());
|
||||||
} else if (!strcmp(message, "settings") && isActiveScreen) {
|
} else if (!strcmp(message, "settings") && isActiveScreen && activeScreen->tag() != "settings") {
|
||||||
UpdateUIState(UISTATE_MENU);
|
UpdateUIState(UISTATE_MENU);
|
||||||
manager->push(new GameSettingsScreen(""));
|
manager->push(new GameSettingsScreen(""));
|
||||||
} else if (!strcmp(message, "language screen") && isActiveScreen) {
|
} else if (!strcmp(message, "language screen") && isActiveScreen) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue