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).
This commit is contained in:
ragnarok-clanker 2026-10-30 20:58:46 +00:00
commit e27a083db9
3 changed files with 46 additions and 0 deletions

View file

@ -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 <cstdlib>
#include <format>
@ -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<ModeTooltip*>(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<WindowManagerWindows&>(g_windowMgr);
UIWindow* window = windows.EnsureWindow(12);
if (window != nullptr) {
window->SendMsg(nullptr, 24, reinterpret_cast<std::intptr_t>(&this->itemInfo), 0, 0, 0);
}
}
// OFFSET: 0x009E79D0
// FUNCTION: fn_14484
void CUIGameItem::SetItem(const ITEM_INFO& item) {

View file

@ -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();

View file

@ -12,6 +12,8 @@ class UIBmpTextButton;
class UIStaticText;
class CUIControl;
extern void* g_charViewMode;
struct CharSlotInfo {
CharSlotInfo();
~CharSlotInfo();