From e27a083db92ef15a069dbee3f2d9156859ea70b1 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 20:58:46 +0000 Subject: [PATCH] Decompile fn_14482 (CUIGameItem::Slot28) Batch #6161 by System4z: 0 byte-identical, 1 confirmed by peer review. - fn_14482 CUIGameItem::Slot28: logic confirmed by peer review Peer-reviewed-by: eAthena, alisonrag Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Items/UIGameItem.cpp | 42 +++++++++++++++++++++++++++ Source/UI/Items/UIGameItem.h | 2 ++ Source/UI/Window/UINewSelectCharWnd.h | 2 ++ 3 files changed, 46 insertions(+) diff --git a/Source/UI/Items/UIGameItem.cpp b/Source/UI/Items/UIGameItem.cpp index 82c94986..c213050d 100644 --- a/Source/UI/Items/UIGameItem.cpp +++ b/Source/UI/Items/UIGameItem.cpp @@ -1,11 +1,19 @@ #include "UI/Items/UIGameItem.h" #include "UI/Text/ColoredText.h" #include "Client/Input/InputCharset.h" +#include "Client/Mode/ModeTooltip.h" +#include "Client/Mode/ModeMgr.h" +#include "Client/Session.h" #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/Items/ItemDescription.h" #include "Contents/Items/ItemNaming.h" +#include "Contents/MessageTable.h" #include "Contents/PlayerNameDictionary.h" #include "Resource/ResourceMgr.h" +#include "UI/Window/UIWindowMgr.h" +#include "UI/Window/UINewSelectCharWnd.h" +#include "UI/Window/WindowManagerWindows.h" +#include "Utility/Text/FormatString.h" #include #include @@ -83,6 +91,40 @@ void CUIGameItem::Slot25(int x, int y) { CUIControl::Slot25(x, y); } +// OFFSET: 0x009E7610 +// FUNCTION: fn_14482 +void CUIGameItem::Slot28(int x, int y) { + if (this->unknown_0084 == 0 || this->name.empty()) { + return; + } + + int screenX = x; + int screenY = y - 20; + this->ToScreen(screenX, screenY); + const std::uint32_t color = g_session.GetItemNameColor(this->itemInfo); + ModeTooltip* tooltip = reinterpret_cast(g_charViewMode); + if (this->itemInfo.unknown_0098 > 0) { + const std::string text = FormatOwnedString(LookupMessage(0xA28), this->name.c_str(), this->itemInfo.unknown_0098); + tooltip->Show(text.c_str(), screenX, screenY, color, 0, 1); + } else { + tooltip->Show(this->name.c_str(), screenX, screenY, color, 0, 1); + } +} + +// OFFSET: 0x009E7750 +// FUNCTION: fn_14483 +void CUIGameItem::Slot26(int, int) { + if (this->unknown_0085 == 0 || std::atoi(this->itemInfo.itemId.c_str()) <= 0) { + return; + } + + WindowManagerWindows& windows = reinterpret_cast(g_windowMgr); + UIWindow* window = windows.EnsureWindow(12); + if (window != nullptr) { + window->SendMsg(nullptr, 24, reinterpret_cast(&this->itemInfo), 0, 0, 0); + } +} + // OFFSET: 0x009E79D0 // FUNCTION: fn_14484 void CUIGameItem::SetItem(const ITEM_INFO& item) { diff --git a/Source/UI/Items/UIGameItem.h b/Source/UI/Items/UIGameItem.h index 8b99e4c9..d43be700 100644 --- a/Source/UI/Items/UIGameItem.h +++ b/Source/UI/Items/UIGameItem.h @@ -25,6 +25,8 @@ public: void Paint() override; void Slot25(int x, int y) override; + void Slot26(int x, int y) override; + void Slot28(int x, int y) override; virtual void SetMode(int mode); ITEM_INFO* GetItemInfo(); diff --git a/Source/UI/Window/UINewSelectCharWnd.h b/Source/UI/Window/UINewSelectCharWnd.h index 4144819a..0416703e 100644 --- a/Source/UI/Window/UINewSelectCharWnd.h +++ b/Source/UI/Window/UINewSelectCharWnd.h @@ -12,6 +12,8 @@ class UIBmpTextButton; class UIStaticText; class CUIControl; +extern void* g_charViewMode; + struct CharSlotInfo { CharSlotInfo(); ~CharSlotInfo();