Decompile 2 functions in Source/UI/Window/InputFocus.cpp, Source/UI/Window/UIWindowMgr.h, ...

Batch #14868 by SapitoSucio: 1 byte-identical, 1 confirmed by peer review.

- fn_17261 UIWindowMgr::SetPressedWindowRoot: logic confirmed by peer review
- fn_12582 UINewChatWnd::ToggleInput: byte-identical

Peer-reviewed-by: ragnarok-clanker, codeplay, NYD
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-08 00:16:25 +00:00
commit ce7abf8a81
4 changed files with 17 additions and 5 deletions

View file

@ -189,7 +189,7 @@ void UINewChatWnd::ToggleInput() {
if (strlen(this->m_chatEdit->Text()) == 0) {
g_windowMgr.inputSuggestionsEnabled = false;
this->ApplyInputLayout();
SetPressedWindowRoot(g_windowMgr.window_4F1D4, nullptr);
g_windowMgr.SetPressedWindowRoot(nullptr);
}
} else {
g_windowMgr.inputSuggestionsEnabled = true;
@ -201,7 +201,7 @@ void UINewChatWnd::ToggleInput() {
this->ResizeRows(static_cast<int>(this->geometry.unknown_0030));
}
SetPressedWindowRoot(g_windowMgr.window_4F1D4, this->m_inputEdit);
g_windowMgr.SetPressedWindowRoot(this->m_inputEdit);
}
if (UIItemTagOnChat* tags = static_cast<UIChatEditCtrl*>(this->m_chatEdit)->unknown_0144) {

View file

@ -115,8 +115,19 @@ void UIWindowMgr::RefreshFocus(UIWindow* const& excludedRoot) {
}
}
// OFFSET: 0x00AA9E60
// FUNCTION: fn_17261
// INLINED
void SetPressedWindowRoot(UIWindow*& pressedRoot, UIWindow* window) {
pressedRoot = window ? window->Root() : nullptr;
}
// OFFSET: 0x00AA9E60
// FUNCTION: fn_17261
void UIWindowMgr::SetPressedWindowRoot(UIWindow* window) {
UIWindow* root = window;
if (root != nullptr) {
while (root->parent != nullptr) {
root = root->parent;
}
}
this->window_4F1D4 = root;
}

View file

@ -564,6 +564,7 @@ public:
bool IsLastFocus(UIWindow* value);
void FocusPrevious();
void RefreshFocus(UIWindow* const& excludedRoot);
void SetPressedWindowRoot(UIWindow* window);
bool IsHoverOnWindow01C8Button();
void SelectWhisperName(const char* name);
void AddWhisperName(const char* name);

View file

@ -262,7 +262,7 @@ int UIWindowMgr::ProcessMouse() {
}
if (g_mouse.buttons[0] == 1) {
SetPressedWindowRoot(this->window_4F1D4, window);
::SetPressedWindowRoot(this->window_4F1D4, window);
}
if (window) {