mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Fix issue with chat button / DevMenu button becoming focusable
This made gameplay a bit difficult when these buttons were enabled.
This commit is contained in:
1 parent
e009d182ff
commit
e4b90c0471
6 files changed
+18
-5
No files matched your search
+5
-3
@@ -124,6 +124,8 @@ void EnableFocusMovement(bool enable) {
|
||||
focusMoves.clear();
|
||||
heldKeys.clear();
|
||||
focusedView = nullptr;
|
||||
} else {
|
||||
enable = enable;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -361,7 +363,7 @@ restart:
|
||||
}
|
||||
}
|
||||
|
||||
DialogResult UpdateViewHierarchy(ViewGroup *root) {
|
||||
DialogResult UpdateViewHierarchy(ViewGroup *root, bool canEnableFocusMovement) {
|
||||
ProcessHeldKeys(root);
|
||||
frameCount++;
|
||||
|
||||
@@ -370,7 +372,7 @@ DialogResult UpdateViewHierarchy(ViewGroup *root) {
|
||||
return DR_NONE;
|
||||
}
|
||||
|
||||
if (focusMoves.size()) {
|
||||
if (focusMoves.size() && canEnableFocusMovement) {
|
||||
EnableFocusMovement(true);
|
||||
if (!GetFocusedView()) {
|
||||
// Find a view to focus.
|
||||
@@ -397,8 +399,8 @@ DialogResult UpdateViewHierarchy(ViewGroup *root) {
|
||||
}
|
||||
}
|
||||
}
|
||||
focusMoves.clear();
|
||||
}
|
||||
focusMoves.clear();
|
||||
|
||||
root->Update();
|
||||
return DispatchEvents();
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ DialogResult DispatchEvents();
|
||||
class ViewGroup;
|
||||
|
||||
void LayoutViewHierarchy(const UIContext &dc, const UI::Margins &rootMargins, UI::ViewGroup *root, ViewLayoutMode layoutMode, bool immersiveMode);
|
||||
DialogResult UpdateViewHierarchy(ViewGroup *root);
|
||||
DialogResult UpdateViewHierarchy(ViewGroup *root, bool canEnableFocusMovement = true);
|
||||
|
||||
enum class KeyEventResult {
|
||||
IGNORE_KEY, // Don't let it be processed.
|
||||
|
||||
@@ -104,7 +104,7 @@ void UIScreen::update() {
|
||||
DoRecreateViews();
|
||||
|
||||
if (root_) {
|
||||
DialogResult result = UpdateViewHierarchy(root_);
|
||||
DialogResult result = UpdateViewHierarchy(root_, AllowFocusMovement());
|
||||
if (result != DR_NONE) {
|
||||
TriggerFinish(result);
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void CreateViews() = 0;
|
||||
virtual bool AllowFocusMovement() const { return true; }
|
||||
|
||||
Bounds GetLayoutBounds(UIContext &dc) const;
|
||||
|
||||
|
||||
Reference in new issue
Block a user