From 4e581c45059bf3f2005fccaaf58ec174da81f4a6 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 00:50:34 +0000 Subject: [PATCH] Decompile 4 functions in Source/UI/Window/UIControl.cpp Batch #11494 by Yommy: 3 byte-identical, 1 confirmed by peer review. - fn_14565 CUITextButton::Slot28: logic confirmed by peer review - fn_14631 CUIButton::Slot28: byte-identical - fn_14633 CUIButton::ResetCursor: byte-identical - fn_14712 CUIThumb::Slot28: byte-identical Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Window/UIControl.cpp | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/Source/UI/Window/UIControl.cpp b/Source/UI/Window/UIControl.cpp index 0f6f6b54..52b79956 100644 --- a/Source/UI/Window/UIControl.cpp +++ b/Source/UI/Window/UIControl.cpp @@ -546,10 +546,7 @@ void CUIThumb::Slot28(int, int) { if (!this->tooltip.empty()) { int screenX = 0; int screenY = -20; - for (const UIWindow* node = this; node; node = node->parent) { - screenX += node->geometry.x; - screenY += node->geometry.y; - } + this->ToScreen(screenX, screenY); g_modeMgr.gameMode->ShowTooltip(this->tooltip.c_str(), screenX, screenY, 0xFFFFFFFFu, 0, 1); } } @@ -842,10 +839,7 @@ void CUIButton::Slot28(int, int) { int screenX = 0; int screenY = -20; - for (const UIWindow* node = this; node; node = node->parent) { - screenX = (screenX + node->geometry.x); - screenY = (screenY + node->geometry.y); - } + this->ToScreen(screenX, screenY); g_modeMgr.gameMode->ShowTooltip(this->tooltip.c_str(), screenX, screenY, 0xFFFFFFFFu, 0, 1); } @@ -859,7 +853,11 @@ void CUIButton::Slot48() { // OFFSET: 0x009EEAA0 // FUNCTION: fn_14633 void CUIButton::ResetCursor(int, int) { - g_modeMgr.gameMode->SetCursorAction(this->disabled ? 0 : 2); + if (this->disabled) { + g_modeMgr.gameMode->SetCursorAction(0); + } else { + g_modeMgr.gameMode->SetCursorAction(2); + } } // OFFSET: 0x009ECCD0 @@ -910,20 +908,14 @@ void CUITextButton::Slot28(int, int) { if (!this->tooltipText.empty()) { int screenX = 0; int screenY = -20; - for (const UIWindow* node = this; node; node = node->parent) { - screenX += node->geometry.x; - screenY += node->geometry.y; - } + this->ToScreen(screenX, screenY); g_modeMgr.gameMode->ShowTooltip(this->tooltipText.c_str(), screenX, screenY, 0xFFFFFFFFu, 0, 1); return; } int screenX = -6; int screenY = -4; - for (const UIWindow* node = this; node; node = node->parent) { - screenX += node->geometry.x; - screenY += node->geometry.y; - } + this->ToScreen(screenX, screenY); g_modeMgr.gameMode->ShowTooltip(this->fullText.c_str(), screenX, screenY, 0xFFFFFFFFu, 0, 1); }