From 11a52a4818cf9f7f92b63e9e4ffc9c0dbf9ffe49 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 15:31:59 +0000 Subject: [PATCH] Decompile 2 functions in Source/UI/UIBarGraph.cpp, Source/UI/UIBarGraph.h, ... Batch #5770 by Yommy: 0 byte-identical, 2 confirmed by peer review. - fn_11342 UIBarGraphPlayerAP::Paint: logic confirmed by peer review - fn_11345 UIBmpRadioBtn::Paint: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, Snow, SapitoSucio, willerthal, kyoshi Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Buttons/UITextButton.cpp | 90 ++++++++++++++++++++++++++++++ Source/UI/UIBarGraph.cpp | 38 +++++++++++++ 2 files changed, 128 insertions(+) diff --git a/Source/UI/Buttons/UITextButton.cpp b/Source/UI/Buttons/UITextButton.cpp index 676b083f..76fe11d1 100644 --- a/Source/UI/Buttons/UITextButton.cpp +++ b/Source/UI/Buttons/UITextButton.cpp @@ -2154,6 +2154,96 @@ void UIBasicSkillCtrl::Paint() { } // OFFSET: 0x00888EA0 +// FUNCTION: fn_11345 +void UIBmpRadioBtn::Paint() { + this->ClearSurface(0xFFFF00FF); + const std::string* name; + if (this->m_disabled == true) { + name = &this->m_names[3]; + } else if (this->geometry.unknown_0030 == 1) { + name = &this->m_names[2]; + } else if (this->m_hovered == true) { + name = &this->m_names[1]; + } else { + name = &this->m_names[0]; + } + + this->DrawBitmap(0, 0, &static_cast(ResourceMgr::Instance().Load(Resolve(name->c_str())))->image, false); + if (this->m_label.size() == 0) { + return; + } + + FontCache& fonts = this->m_controls->fonts; + const TextLocale& locale = this->m_controls->locale; + if (this->m_disabled == true) { + for (auto it = this->m_texts.begin(); it != this->m_texts.end(); ++it) { + if (it->id == 3) { + if (it->unknown_0018 == true) { + this->DrawTextAt(fonts, locale, it->x, it->y, this->m_label.c_str(), 0, 0, it->height, 0xE2E2E2, 0, 0); + } + this->DrawTextAt(fonts, locale, it->x + 1, it->y + 1, this->m_label.c_str(), 0, 0, it->height, it->color, it->bold, 0); + return; + } + } + + const int x = static_cast((this->geometry.width - this->TextWidth(fonts, locale, this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); + const int y = static_cast((this->geometry.height - this->TextHeight(fonts, locale, this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); + this->DrawTextAt(fonts, locale, x, y, this->m_label.c_str(), 0, 0, 12, 0xE2E2E2, 0, 0); + this->DrawTextAt(fonts, locale, x + 1, y + 1, this->m_label.c_str(), 0, 0, 12, 0x6F6F6F, 0, 0); + return; + } + + if (this->geometry.unknown_0030 == 1) { + for (auto it = this->m_texts.begin(); it != this->m_texts.end(); ++it) { + if (it->id == 2) { + if (it->unknown_0018 == true) { + this->DrawTextAt(fonts, locale, it->x, it->y, this->m_label.c_str(), 0, 0, it->height, 0xFFFFFF, it->bold, 0); + } + this->DrawTextAt(fonts, locale, it->x + 1, it->y + 1, this->m_label.c_str(), 0, 0, it->height, it->color, it->bold, 0); + return; + } + } + + const int x = static_cast((this->geometry.width - this->TextWidth(fonts, locale, this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); + const int y = static_cast((this->geometry.height - this->TextHeight(fonts, locale, this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); + this->DrawTextAt(fonts, locale, x, y, this->m_label.c_str(), 0, 0, 12, 0xFFFFFF, 0, 0); + this->DrawTextAt(fonts, locale, x + 1, y + 1, this->m_label.c_str(), 0, 0, 12, 0, 0, 0); + return; + } + + if (this->m_hovered == true) { + for (auto it = this->m_texts.begin(); it != this->m_texts.end(); ++it) { + if (it->id == 1) { + if (it->unknown_0018 == true) { + this->DrawTextAt(fonts, locale, it->x + 1, it->y + 1, this->m_label.c_str(), 0, 0, it->height, 0xC7A796, it->bold, 0); + } + this->DrawTextAt(fonts, locale, it->x, it->y, this->m_label.c_str(), 0, 0, it->height, it->color, it->bold, 0); + return; + } + } + + const int x = static_cast((this->geometry.width - this->TextWidth(fonts, locale, this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); + const int y = static_cast((this->geometry.height - this->TextHeight(fonts, locale, this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); + this->DrawTextAt(fonts, locale, x + 1, y + 1, this->m_label.c_str(), 0, 0, 12, 0xC7A796, 0, 0); + this->DrawTextAt(fonts, locale, x, y, this->m_label.c_str(), 0, 0, 12, 0, 0, 0); + return; + } + + for (auto it = this->m_texts.begin(); it != this->m_texts.end(); ++it) { + if (it->id == 0) { + if (it->unknown_0018 == true) { + this->DrawTextAt(fonts, locale, it->x + 1, it->y + 1, this->m_label.c_str(), 0, 0, it->height, 0xD7D7D7, it->bold, 0); + } + this->DrawTextAt(fonts, locale, it->x, it->y, this->m_label.c_str(), 0, 0, it->height, it->color, it->bold, 0); + return; + } + } + + const int x = static_cast((this->geometry.width - this->TextWidth(fonts, locale, this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); + const int y = static_cast((this->geometry.height - this->TextHeight(fonts, locale, this->m_label.c_str(), 0, 0, 12, 0, 0)) * 0.5); + this->DrawTextAt(fonts, locale, x + 1, y + 1, this->m_label.c_str(), 0, 0, 12, 0xD7D7D7, 0, 0); + this->DrawTextAt(fonts, locale, x, y, this->m_label.c_str(), 0, 0, 12, 0, 0, 0); +} // OFFSET: 0x008894A0 // FUNCTION: fn_11346 diff --git a/Source/UI/UIBarGraph.cpp b/Source/UI/UIBarGraph.cpp index 6b72aacc..63ed8a8e 100644 --- a/Source/UI/UIBarGraph.cpp +++ b/Source/UI/UIBarGraph.cpp @@ -168,6 +168,44 @@ void UIBarGraphPlayer::Paint() { } // OFFSET: 0x008887A0 +// FUNCTION: fn_11342 +void UIBarGraphPlayerAP::Paint() { + if (!this->m_current || !this->m_maximum) { + return; + } + + const std::int64_t current = this->m_current(); + const std::int64_t maximum = this->m_maximum(); + if (current > maximum) { + return; + } + + this->DrawBitmap(0, 0, &static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\gze_bg1.bmp")))->image, false); + if (maximum > 0) { + const double ratio = static_cast(current) / static_cast(maximum); + if (ratio > 0.0) { + std::string color = "blue"; + if (ratio == 1.0) { + color = "red"; + } + + const int fill = static_cast(static_cast(this->geometry.width - 8) * ratio); + + const auto* left = static_cast(ResourceMgr::Instance().Load(Resolve(("유저인터페이스\\basic_interface\\gze" + color + "_left.bmp").c_str()))); + this->DrawBitmap(0, 0, &left->image, true); + + const auto* middle = static_cast(ResourceMgr::Instance().Load(Resolve(("유저인터페이스\\basic_interface\\gze" + color + "_mid.bmp").c_str()))); + for (int x = 0; x < fill; ++x) { + this->DrawBitmap(x + 4, 0, &middle->image, true); + } + + const auto* right = static_cast(ResourceMgr::Instance().Load(Resolve(("유저인터페이스\\basic_interface\\gze" + color + "_right.bmp").c_str()))); + this->DrawBitmap(fill + 4, 0, &right->image, true); + } + } + + this->DrawCenteredText(0, -2, FormatOwnedString("%3I64d / %3I64d", current, maximum).c_str(), this->geometry.width, 1, 13, 0, 0); +} // OFFSET: 0x0089CDB0 // FUNCTION: fn_11593