From ecdb364faa6b7c9b69ab8df76791444e40a2a2b2 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 28 Oct 2026 21:57:43 +0000 Subject: [PATCH] Decompile 2 functions in Source/UI/Buttons/UITextButton.cpp, Source/UI/Buttons/UIBmpRadioBtn.h, ... Batch #1737 by ragnarok-clanker: 0 byte-identical, 2 confirmed by peer review. - fn_11447 UIBarGraph4::Slot28: logic confirmed by peer review - fn_11452 UIINT64BarGraph::Slot28: logic confirmed by peer review Reviewed-by: ragnarok-clanker --- Source/UI/Buttons/UIBmpRadioBtn.h | 33 +++++++++++++ Source/UI/Buttons/UITextButton.cpp | 76 ++++++++++++++++++++++++++++++ Source/UI/UIBarGraph.h | 34 +++++++++++++ 3 files changed, 143 insertions(+) create mode 100644 Source/UI/Buttons/UIBmpRadioBtn.h create mode 100644 Source/UI/UIBarGraph.h diff --git a/Source/UI/Buttons/UIBmpRadioBtn.h b/Source/UI/Buttons/UIBmpRadioBtn.h new file mode 100644 index 0000000..4a8fb75 --- /dev/null +++ b/Source/UI/Buttons/UIBmpRadioBtn.h @@ -0,0 +1,33 @@ +#ifndef RAGNAROK_SOURCE_UI_BUTTONS_UIBMPRADIOBTN_H +#define RAGNAROK_SOURCE_UI_BUTTONS_UIBMPRADIOBTN_H + +#include "UI/Window/UIWindow.h" + +#include + +struct UIButtonContext; + +class UIBmpRadioBtn : public UIWindow { +public: + void Slot28(int x, int y) override; + +protected: + /* 007C */ unsigned char unknown_007C[0x64]; + /* 00E0 */ std::string m_tooltip; + UIButtonContext* m_controls; +}; + +class UIBmpRadioBtn2 : public UIBmpRadioBtn { +}; + +class UICaptchaImage : public UIWindow { +public: + void Slot28(int x, int y) override; + +protected: + /* 007C */ unsigned char unknown_007C[0x124]; + /* 01A0 */ std::string m_tooltip; + UIButtonContext* m_controls; +}; + +#endif diff --git a/Source/UI/Buttons/UITextButton.cpp b/Source/UI/Buttons/UITextButton.cpp index 69720a5..c6146e1 100644 --- a/Source/UI/Buttons/UITextButton.cpp +++ b/Source/UI/Buttons/UITextButton.cpp @@ -1,4 +1,6 @@ #include "Render/DeviceContext/DeviceContext.h" +#include "UI/UIBarGraph.h" +#include "UI/Buttons/UIBmpRadioBtn.h" #include "Render/Text/TextContext.h" #include "UI/Window/UIWindowMgr.h" #include "UI/Buttons/UIItemTagButton.h" @@ -6,6 +8,7 @@ #include "UI/Lists/UITreeView.h" #include "UI/UIStaticItem.h" +#include #include #include @@ -200,3 +203,76 @@ void UIItemTagButton::Slot28(int x, int y) { // FUNCTION: fn_11459 void UIStaticItem_Illust::Slot28(int, int) { } + +// OFFSET: 0x00891810 +// FUNCTION: fn_11450 +void UIBmpRadioBtn::Slot28(int, int) { + if (!this->m_tooltip.empty()) { + int screenX = 0, screenY = -20; + + for (const UIWindow* window = this; window; window = window->parent) { + screenX = (screenX + window->geometry.x); + screenY = (screenY + window->geometry.y); + } + + this->m_controls->services.Tooltip(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); + } +} + +// OFFSET: 0x00891870 +// FUNCTION: fn_11451 +void UICaptchaImage::Slot28(int, int) { + if (!this->m_tooltip.empty()) { + int screenX = 0, screenY = -20; + + for (const UIWindow* window = this; window; window = window->parent) { + screenX = (screenX + window->geometry.x); + screenY = (screenY + window->geometry.y); + } + + this->m_controls->services.Tooltip(this->m_tooltip.c_str(), screenX, screenY, -1, false, true); + } +} + +// OFFSET: 0x00891240 +// FUNCTION: fn_11447 +void UIBarGraph4::Slot28(int, int) { + if (!this->m_current || !this->m_maximum || *this->m_maximum < *this->m_current || *this->m_maximum == 0) { + return; + } + + int screenX = 0, screenY = -16; + + for (const UIWindow* window = this; window; window = window->parent) { + screenX = (screenX + window->geometry.x); + screenY = (screenY + window->geometry.y); + } + + char text[260]; + std::memset(text, 0, sizeof(text)); + const int permille = static_cast(static_cast(*this->m_current) / static_cast(*this->m_maximum) * 1000.0f); + std::sprintf(text, "%.1f %%", static_cast(permille) * 0.1f); + this->m_controls->services.Tooltip(text, screenX, screenY, -1, false, true); +} + +// OFFSET: 0x008918D0 +// FUNCTION: fn_11452 +void UIINT64BarGraph::Slot28(int, int) { + if (this->m_maximum < this->m_current || this->m_maximum == 0 || this->m_maximum == 99999999) { + return; + } + + int screenX = 0, screenY = -16; + + for (const UIWindow* window = this; window; window = window->parent) { + screenX = (screenX + window->geometry.x); + screenY = (screenY + window->geometry.y); + } + + char text[260]; + std::memset(text, 0, sizeof(text)); + const int permille = static_cast(static_cast(this->m_current) / static_cast(this->m_maximum) * 1000.0); + std::sprintf(text, "%.1f %%", static_cast(permille) * 0.1f); + this->m_controls->services.Tooltip(text, screenX, screenY, -1, false, true); +} + diff --git a/Source/UI/UIBarGraph.h b/Source/UI/UIBarGraph.h new file mode 100644 index 0000000..031d098 --- /dev/null +++ b/Source/UI/UIBarGraph.h @@ -0,0 +1,34 @@ +#ifndef RAGNAROK_SOURCE_UI_UIBARGRAPH_H +#define RAGNAROK_SOURCE_UI_UIBARGRAPH_H + +#include "UI/Window/UIWindow.h" + +#include + +struct UIButtonContext; + +class UIBarGraph3 : public UIWindow { +}; + +class UIBarGraph4 : public UIBarGraph3 { +public: + void Slot28(int x, int y) override; + +protected: + /* 007C */ const int* m_current; + /* 0080 */ const int* m_maximum; + UIButtonContext* m_controls; +}; + +class UIINT64BarGraph : public UIWindow { +public: + void Slot28(int x, int y) override; + +protected: + /* 007C */ int unknown_007C; + /* 0080 */ std::int64_t m_current; + /* 0088 */ std::int64_t m_maximum; + UIButtonContext* m_controls; +}; + +#endif