From 08c336e5cd9f4e7b4d43149334230d5b2da5b8ab Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 04:18:57 +0000 Subject: [PATCH] Decompile 6 functions in Source/UI/Buttons/UITextButton.cpp, Source/UI/Gauges/UIPetInfoBarGraph.cpp, ... Batch #4534 by eAthena: 0 byte-identical, 6 confirmed by peer review. - fn_11359 UIINT64BarGraph::Paint: logic confirmed by peer review - fn_11361 UIItemMoveInfo::Paint: logic confirmed by peer review - fn_11363 UIItemStoreComboBoxWnd::Paint: logic confirmed by peer review - fn_11364 UIItemTagButton::Paint: logic confirmed by peer review - fn_11369 UIListBoxNavi::Paint: logic confirmed by peer review - fn_11375 UIPetInfoBarGraph::Paint: logic confirmed by peer review Peer-reviewed-by: youko, Lumen Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Buttons/UIItemMoveInfo.h | 1 + Source/UI/Buttons/UIItemTagButton.h | 3 + Source/UI/Buttons/UITextButton.cpp | 124 ++++++++++++++++++++++++- Source/UI/Gauges/UIPetInfoBarGraph.cpp | 37 ++++++++ Source/UI/Lists/UIItemStoreComboBox.h | 5 + Source/UI/Lists/UIListBoxNavi.h | 1 + Source/UI/UIBarGraph.h | 4 +- 7 files changed, 173 insertions(+), 2 deletions(-) diff --git a/Source/UI/Buttons/UIItemMoveInfo.h b/Source/UI/Buttons/UIItemMoveInfo.h index 7b24d499..a7c4c5a5 100644 --- a/Source/UI/Buttons/UIItemMoveInfo.h +++ b/Source/UI/Buttons/UIItemMoveInfo.h @@ -8,6 +8,7 @@ struct WindowVisibility; class UIItemMoveInfo : public UITextButton { public: + void Paint() override; void Slot28(int x, int y) override; void Slot48() override; diff --git a/Source/UI/Buttons/UIItemTagButton.h b/Source/UI/Buttons/UIItemTagButton.h index ef36d7c3..ab15c55c 100644 --- a/Source/UI/Buttons/UIItemTagButton.h +++ b/Source/UI/Buttons/UIItemTagButton.h @@ -7,11 +7,14 @@ class UIItemTagButton : public UITextButton { public: + void Paint() override; void Slot28(int x, int y) override; /* 00F8 */ unsigned char unknown_00F8[0xF0]; /* 01F0 */ int column; /* 01F4 */ int line; + /* 01F8 */ int unknown_01F8; + /* 01FC */ int textY; }; #if defined(_WIN32) && !defined(_WIN64) diff --git a/Source/UI/Buttons/UITextButton.cpp b/Source/UI/Buttons/UITextButton.cpp index 01daec1d..ab206cf4 100644 --- a/Source/UI/Buttons/UITextButton.cpp +++ b/Source/UI/Buttons/UITextButton.cpp @@ -45,7 +45,7 @@ #include "UI/Lists/UIListBoxNavi.h" #include "UI/Text/ColoredText.h" #include "UI/Window/WindowBorder.h" - +#include "Resource/SkinPalette.h" #include #include #include @@ -1314,3 +1314,125 @@ void UITVTextButton::Slot31(int x, int y) { void UITabControl::Slot31(int, int) { g_windowMgr.ReleaseCapture(); } + +// OFFSET: 0x0088AD00 +// FUNCTION: fn_11359 +void UIINT64BarGraph::Paint() { + if (this->m_maximum < this->m_current || this->m_maximum == 99999999) { + return; + } + + unsigned red, green, blue; + SkinPaletteChannels(ResourceMgr::Instance(), 26, 2, red, green, blue); + this->ClearSurface((green & 255) << 16 | (green & 255) << 8 | (red & 255)); + SkinPaletteChannels(ResourceMgr::Instance(), 30, 2, red, green, blue); + this->FillRegion(1, 1, this->geometry.width - 2, this->geometry.height - 2, (blue & 255) << 16 | (green & 255) << 8 | (red & 255)); + + if (this->m_maximum == 0) { + return; + } + + const double ratio = static_cast(this->m_current) / static_cast(this->m_maximum); + + if (ratio == 0.0) { + return; + } + + SkinPaletteChannels(ResourceMgr::Instance(), 2, 6, red, green, blue); + + if (this->m_plainColor == 0 && 25.0 > ratio * 100.0) { + red = 255; + green = 0; + blue = 0; + } + + this->FillRegion( + 1, 1, static_cast((this->geometry.width - 2) * ratio), this->geometry.height - 2, (blue & 255) << 16 | (green & 255) << 8 | (red & 255) + ); +} + +// OFFSET: 0x0088B070 +// FUNCTION: fn_11361 +void UIItemMoveInfo::Paint() { + this->ClearSurface(0xFFFF00FF); + + if (this->parent) { + this->parent->Invalidate(); + } + + if (this->m_outline != 0) { + DrawOutlinedText(*this, 1, 1, this->m_text.c_str(), 0, this->m_color, this->m_outlineColor, this->m_family, this->m_height, 1, 0); + } else { + auto& controls = *this->m_buttonContext; + this->DrawTextAt(controls.fonts, controls.locale, 1, 1, this->m_text.c_str(), 0, this->m_family, this->m_height, this->m_color, 0, 0); + } + + if (this->m_underline != 0) { + this->FillRegion(0, this->geometry.height - 1, this->geometry.width, 1, this->m_color); + } +} + +// OFFSET: 0x0088B4E0 +// FUNCTION: fn_11364 +void UIItemTagButton::Paint() { + this->ClearSurface(0xFFFF00FF); + + if (this->parent) { + this->parent->Invalidate(); + } + + if (this->m_outline != 0) { + DrawOutlinedText(*this, 1, this->textY, this->m_text.c_str(), 0, this->m_color, this->m_outlineColor, this->m_family, this->m_height, 1, 0); + } else { + auto& controls = *this->m_buttonContext; + this->DrawTextAt(controls.fonts, controls.locale, 1, this->textY, this->m_text.c_str(), 0, this->m_family, this->m_height, this->m_color, 0, 0); + } + + if (this->m_underline != 0) { + this->FillRegion(0, this->geometry.height - 1, this->geometry.width, 1, this->m_color); + } +} + +// OFFSET: 0x0088BFB0 +// FUNCTION: fn_11369 +void UIListBoxNavi::Paint() { + if (this->transparent != 0) { + this->ClearSurface(0xFFFF00FF); + + if (this->parent) { + this->parent->Invalidate(); + } + } else { + this->ClearSurface((this->backgroundRed & 255) | ((this->backgroundGreen & 255) << 8) | ((this->backgroundBlue & 255) << 16)); + } + + const int first = this->topLine; + const int limit = this->geometry.height / this->lineHeight - this->bottomMargin + first; + const int end = static_cast(std::min(static_cast(this->lines.size()), static_cast(limit))); + std::uint32_t color = 0; + auto& owner = *this->m_listContext; + + for (int index = first, row = 0; index < end; ++index, ++row) { + if (this->lineColors[index] == 1) { + color = this->defaultLineColor; + } + + if (index == this->selected) { + this->FillRegion(0, row * this->lineHeight, this->geometry.width, this->lineHeight - 1, this->selectionColor); + } + + const auto& line = this->lines[index]; + DrawColoredText(*this, owner.codePage, 3 - this->horizontalOffset, this->lineHeight * row, line.c_str(), static_cast(line.size()), color, 0, 12, false); + + if (this->lineColors[index] == 1) { + color = 0; + } + } +} + +// OFFSET: 0x0088B4A0 +// FUNCTION: fn_11363 +void UIItemStoreComboBoxWnd::Paint() { + const auto* background = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\bg_setting.bmp"))); + this->DrawBitmap(0, this->geometry.height - background->image.height, &background->image, false); +} diff --git a/Source/UI/Gauges/UIPetInfoBarGraph.cpp b/Source/UI/Gauges/UIPetInfoBarGraph.cpp index d4e0199a..3df3af92 100644 --- a/Source/UI/Gauges/UIPetInfoBarGraph.cpp +++ b/Source/UI/Gauges/UIPetInfoBarGraph.cpp @@ -1,4 +1,7 @@ #include "UI/UIBarGraph.h" +#include "Resource/Bitmap/BitmapResource.h" +#include "Resource/ResourceMgr.h" +#include "Resource/TextureNames.h" // OFFSET: 0x0089B4D0 // FUNCTION: fn_11564 @@ -27,3 +30,37 @@ void UIPetInfoBarGraph::SetValue(int value) { this->unknown_007C = value; this->Invalidate(); } + +// OFFSET: 0x0088C970 +// FUNCTION: fn_11375 +void UIPetInfoBarGraph::Paint() { + const auto* left = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gze_bg_left.bmp"))); + const auto* middle = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gze_bg_mid.bmp"))); + const auto* right = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gze_bg_right.bmp"))); + const int span = this->geometry.width - left->image.width - right->image.width; + this->DrawBitmap(0, 0, &left->image, false); + + for (int x = 0; x < span; ++x) { + this->DrawBitmap(left->image.width + x, 0, &middle->image, false); + } + + this->DrawBitmap(this->geometry.width - right->image.width, 0, &right->image, false); + + if (this->unknown_007C != 0) { + const auto* barLeft = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gzeblue_left.bmp"))); + const auto* barMiddle = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gzeblue_mid.bmp"))); + const auto* barRight = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gzeblue_right.bmp"))); + const int fill = static_cast( + static_cast(this->geometry.width - barRight->image.width - barLeft->image.width) * + (static_cast(static_cast(this->unknown_007C)) / 100.0f) + ); + this->DrawBitmap(0, 0, &barLeft->image, true); + int x = 0; + + for (; x < fill; ++x) { + this->DrawBitmap(barLeft->image.width + x, 0, &barMiddle->image, true); + } + + this->DrawBitmap(barMiddle->image.width * x + barLeft->image.width, 0, &barRight->image, true); + } +} diff --git a/Source/UI/Lists/UIItemStoreComboBox.h b/Source/UI/Lists/UIItemStoreComboBox.h index dbefac80..badb5983 100644 --- a/Source/UI/Lists/UIItemStoreComboBox.h +++ b/Source/UI/Lists/UIItemStoreComboBox.h @@ -9,4 +9,9 @@ public: void Slot31(int x, int y) override; }; +class UIItemStoreComboBoxWnd : public UIWindow { +public: + void Paint() override; +}; + #endif diff --git a/Source/UI/Lists/UIListBoxNavi.h b/Source/UI/Lists/UIListBoxNavi.h index 5c7247b5..31d73407 100644 --- a/Source/UI/Lists/UIListBoxNavi.h +++ b/Source/UI/Lists/UIListBoxNavi.h @@ -8,6 +8,7 @@ class UIListBoxNavi : public UIListBox { public: + void Paint() override; void Slot25(int x, int y) override; /* 00D4 */ std::uint32_t defaultLineColor; /* 00D8 */ std::vector lineColors; diff --git a/Source/UI/UIBarGraph.h b/Source/UI/UIBarGraph.h index 71759df1..900a6d21 100644 --- a/Source/UI/UIBarGraph.h +++ b/Source/UI/UIBarGraph.h @@ -34,12 +34,13 @@ protected: class UIINT64BarGraph : public UIWindow { public: + void Paint() override; void Slot28(int x, int y) override; void SetValues(std::int64_t current, std::int64_t maximum); protected: - /* 007C */ int unknown_007C; + /* 007C */ unsigned char m_plainColor; /* 0080 */ std::int64_t m_current; /* 0088 */ std::int64_t m_maximum; UIButtonContext* m_controls; @@ -47,6 +48,7 @@ protected: class UIPetInfoBarGraph : public UIWindow { public: + void Paint() override; void SetValue(int value); /* 007C */ int unknown_007C;