From b79407bc491a98568992cf3f74922b528b892bea Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 20:58:52 +0000 Subject: [PATCH] Decompile 2 functions in Source/UI/Window/UIRPImageWnd2.cpp, Source/UI/Window/UIRPImageWnd2.h, ... Batch #6184 by eAthena: 0 byte-identical, 2 confirmed by peer review. - fn_12951 UIRPImageWnd2::SetImage: logic confirmed by peer review - fn_12966 UIStaticText_LF::SetText: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, alisonrag, System4z Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Text/UIStaticText_LF.cpp | 20 ++++++++++++++++++++ Source/UI/Text/UIStaticText_LF.h | 3 +++ Source/UI/Window/UIRPImageWnd2.cpp | 8 ++++++++ Source/UI/Window/UIRPImageWnd2.h | 1 + 4 files changed, 32 insertions(+) diff --git a/Source/UI/Text/UIStaticText_LF.cpp b/Source/UI/Text/UIStaticText_LF.cpp index a452d24c..326e2fc8 100644 --- a/Source/UI/Text/UIStaticText_LF.cpp +++ b/Source/UI/Text/UIStaticText_LF.cpp @@ -43,3 +43,23 @@ void UIStaticText_LF::Slot35(int delta) { this->parent->Slot35(delta); } } + +// OFFSET: 0x00951BF0 +// FUNCTION: fn_12966 +void UIStaticText_LF::SetText(std::string text) { + *reinterpret_cast(reinterpret_cast(this) + 0x7C) = text; + std::list lines; + this->WrapFormattedText( + text, &lines, this->geometry.width, + *reinterpret_cast(reinterpret_cast(this) + 0x9C), + *reinterpret_cast(reinterpret_cast(this) + 0xA0), + *reinterpret_cast(reinterpret_cast(this) + 0xA8) + ); + const int count = static_cast(lines.size()); + this->Resize( + this->geometry.width, + (count - 1) * *reinterpret_cast(reinterpret_cast(this) + 0x94) + + *reinterpret_cast(reinterpret_cast(this) + 0xA0) * count + ); + this->Invalidate(); +} diff --git a/Source/UI/Text/UIStaticText_LF.h b/Source/UI/Text/UIStaticText_LF.h index 0700312d..64ce2bb2 100644 --- a/Source/UI/Text/UIStaticText_LF.h +++ b/Source/UI/Text/UIStaticText_LF.h @@ -3,12 +3,15 @@ #include "UI/Window/UIWindow.h" +#include + class UIStaticText_LF : public UIWindow { public: void Paint() override; void Slot25(int x, int y) override; void Slot31(int x, int y) override; void Slot35(int delta) override; + void SetText(std::string text); }; #endif diff --git a/Source/UI/Window/UIRPImageWnd2.cpp b/Source/UI/Window/UIRPImageWnd2.cpp index 9106909e..267c4ce9 100644 --- a/Source/UI/Window/UIRPImageWnd2.cpp +++ b/Source/UI/Window/UIRPImageWnd2.cpp @@ -12,3 +12,11 @@ void UIRPImageWnd2::Paint() { this->DrawNamed(this->m_context->primitives, 0, 0, this->m_imageName, 0xFFFFFFFF, 0, 0); } } + +// OFFSET: 0x00951470 +// FUNCTION: fn_12951 +void UIRPImageWnd2::SetImage(std::string imageName, int imageCount) { + this->m_imageName = imageName; + this->m_imageCount = imageCount; + this->m_drawImage = 1; +} diff --git a/Source/UI/Window/UIRPImageWnd2.h b/Source/UI/Window/UIRPImageWnd2.h index ad4ace61..66f3a45f 100644 --- a/Source/UI/Window/UIRPImageWnd2.h +++ b/Source/UI/Window/UIRPImageWnd2.h @@ -8,6 +8,7 @@ class UIRPImageWnd2 : public UIFrameWnd { public: void Paint() override; + void SetImage(std::string imageName, int imageCount); protected: /* 00B4 */ std::string m_imageName;