mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
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
@ -33,6 +33,8 @@ class ControlMappingScreen : public UIDialogScreenWithBackground {
|
||||
public:
|
||||
ControlMappingScreen() {}
|
||||
void KeyMapped(int pspkey); // Notification to let us refocus the same one after recreating views.
|
||||
std::string tag() const override { return "control mapping"; }
|
||||
|
||||
protected:
|
||||
virtual void CreateViews() override;
|
||||
private:
|
||||
|
@ -31,6 +31,7 @@ public:
|
||||
virtual bool touch(const TouchInput &touch) override;
|
||||
virtual void dialogFinished(const Screen *dialog, DialogResult result) override;
|
||||
virtual void onFinish(DialogResult reason) override;
|
||||
std::string tag() const override { return "display layout screen"; }
|
||||
|
||||
protected:
|
||||
virtual UI::EventReturn OnCenter(UI::EventParams &e);
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
|
||||
virtual void update();
|
||||
|
||||
virtual std::string tag() const { return "game"; }
|
||||
std::string tag() const override { return "game"; }
|
||||
|
||||
protected:
|
||||
virtual void CreateViews();
|
||||
|
@ -30,6 +30,7 @@ public:
|
||||
|
||||
virtual void update();
|
||||
virtual void onFinish(DialogResult result);
|
||||
std::string tag() const override { return "settings"; }
|
||||
|
||||
UI::Event OnRecentChanged;
|
||||
|
||||
|
@ -165,13 +165,13 @@ void HandleCommonMessages(const char *message, const char *value, ScreenManager
|
||||
if (PSP_IsInited()) {
|
||||
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);
|
||||
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);
|
||||
manager->push(new DisplayLayoutScreen());
|
||||
} else if (!strcmp(message, "settings") && isActiveScreen) {
|
||||
} else if (!strcmp(message, "settings") && isActiveScreen && activeScreen->tag() != "settings") {
|
||||
UpdateUIState(UISTATE_MENU);
|
||||
manager->push(new GameSettingsScreen(""));
|
||||
} else if (!strcmp(message, "language screen") && isActiveScreen) {
|
||||
|
Loading…
Reference in New Issue
Block a user