From 537369e3fe9ed68d861f6812bdaa74f9bb675955 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 15:22:52 +0000 Subject: [PATCH] Decompile 2 functions in Source/UI/Window/InputFocus.cpp Batch #12428 by cremane: 0 byte-identical, 2 confirmed by peer review. - fn_17259 UIWindowMgr::FocusNext: logic confirmed by peer review - fn_17257 UIWindowMgr::FocusFirst: logic confirmed by peer review Peer-reviewed-by: Yommy, gordaoprogramas, dori Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Window/InputFocus.cpp | 48 +++++++++++---------------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/Source/UI/Window/InputFocus.cpp b/Source/UI/Window/InputFocus.cpp index bd814b27..35c9fe23 100644 --- a/Source/UI/Window/InputFocus.cpp +++ b/Source/UI/Window/InputFocus.cpp @@ -26,22 +26,17 @@ void UIWindowMgr::FocusFirst() { if (this->hoverWindow) { UIWindow* parent = this->hoverWindow->parent; - for (UIWindow* child : parent->m_children) { - if (!child->Slot05()) { - continue; + for (auto it = parent->m_children.begin(); it != parent->m_children.end(); ++it) { + UIWindow* child = *it; + if (child->Slot05()) { + this->SetFocus(child); + return; } - - this->hoverWindow->Slot24(child->Slot06() == this->hoverWindow); - this->hoverWindow = child->Slot06(); - - if (this->hoverWindow) { - this->hoverWindow->Slot23(); - } - - return; } - this->hoverWindow->Slot24(0); + if (this->hoverWindow) { + this->hoverWindow->Slot24(0); + } } this->hoverWindow = nullptr; @@ -76,28 +71,15 @@ void UIWindowMgr::FocusNext() { return; } - UIWindow* parent = this->hoverWindow->parent; - bool found = false; - - for (UIWindow* child : parent->m_children) { - if (found && child->Slot05()) { - this->hoverWindow->Slot24(child->Slot06() == this->hoverWindow); - this->hoverWindow = child->Slot06(); - - if (this->hoverWindow) { - this->hoverWindow->Slot23(); - } - - return; - } - - if (child == this->hoverWindow && child->Slot05()) { - found = true; - } + UIWindow* next = this->hoverWindow->parent->NextFocusable(this->hoverWindow); + if (!next) { + this->SetFocus(nullptr); + return; } - this->hoverWindow->Slot24(0); - this->hoverWindow = nullptr; + if (next->Slot05()) { + this->SetFocus(next); + } } // OFFSET: 0x00A96F60