Merge pull request #18141 from hrydgard/chat-window-close-fix

Fix the chat window closing on pressing the X key.
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2023-09-12 10:56:01 +02:00
commit 47099ea8dc
2 files changed
+19 -10

No files matched your search

+16 -10
View File
@@ -844,21 +844,27 @@ bool EmuScreen::UnsyncKey(const KeyInput &key) {
System_Notify(SystemNotification::ACTIVITY);
if (UI::IsFocusMovementEnabled()) {
bool retval = UIScreen::UnsyncKey(key);
if ((key.flags & KEY_DOWN) != 0 && UI::IsEscapeKey(key)) {
if (chatMenu_)
chatMenu_->Close();
if (chatButton_)
chatButton_->SetVisibility(UI::V_VISIBLE);
UI::EnableFocusMovement(false);
retval = true;
}
return retval;
return UIScreen::UnsyncKey(key);
}
return controlMapper_.Key(key, &pauseTrigger_);
}
bool EmuScreen::key(const KeyInput &key) {
bool retval = UIScreen::key(key);
if (!retval && (key.flags & KEY_DOWN) != 0 && UI::IsEscapeKey(key)) {
if (chatMenu_)
chatMenu_->Close();
if (chatButton_)
chatButton_->SetVisibility(UI::V_VISIBLE);
UI::EnableFocusMovement(false);
return true;
}
return retval;
}
void EmuScreen::UnsyncAxis(const AxisInput &axis) {
System_Notify(SystemNotification::ACTIVITY);
return controlMapper_.Axis(axis);
+3
View File
@@ -55,6 +55,9 @@ public:
bool UnsyncKey(const KeyInput &key) override;
void UnsyncAxis(const AxisInput &axis) override;
// We also need to do some special handling of queued UI events to handle closing the chat window.
bool key(const KeyInput &key) override;
private:
void CreateViews() override;
UI::EventReturn OnDevTools(UI::EventParams &params);