From 96dd3fa97d6ca96f05916ae6cc2dfc9ae0a65c0d Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 06:25:26 +0000 Subject: [PATCH] Decompile fn_03879 (UIChangeMaterialWnd_CheckBox::Paint) Batch #7320 by aDw: 0 byte-identical, 1 confirmed by peer review. - fn_03879 UIChangeMaterialWnd_CheckBox::Paint: logic confirmed by peer review Peer-reviewed-by: eAthena, gordaoprogramas Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/UIChangeMaterialWnd.cpp | 31 +++++++++++++++++++++++++++++++ Source/UI/UIChangeMaterialWnd.h | 1 + 2 files changed, 32 insertions(+) diff --git a/Source/UI/UIChangeMaterialWnd.cpp b/Source/UI/UIChangeMaterialWnd.cpp index e3e0f575..c98a8f4d 100644 --- a/Source/UI/UIChangeMaterialWnd.cpp +++ b/Source/UI/UIChangeMaterialWnd.cpp @@ -740,3 +740,34 @@ void UIChangeMaterialWnd::Slot15(int width, int height) { this->AddChild(list); list->SendMsg(nullptr, 23, 0, 0, 0, 0); } + +// OFFSET: 0x005E1E20 +// FUNCTION: fn_03879 +void UIChangeMaterialWnd_CheckBox::Paint() { + if (this->m_checked.empty() || this->m_unchecked.empty()) { + return; + } + + if (this->m_disabled == 1) { + this->ClearSurface(0xFFFF00FFu); + return; + } + + if (this->m_hidden == 1) { + return; + } + + if (this->geometry.unknown_0030 == 0) { + auto* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(this->m_unchecked.c_str()))); + this->DrawBitmap(0, 0, bitmap ? &bitmap->image : nullptr, false); + if (!this->ascendingText.empty()) { + this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 0xc, 1, this->ascendingText.c_str(), 0, 0, 0xc, 0, 0, 0); + } + } else if (this->geometry.unknown_0030 == 1) { + auto* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(this->m_checked.c_str()))); + this->DrawBitmap(0, 0, bitmap ? &bitmap->image : nullptr, false); + if (!this->descendingText.empty()) { + this->DrawTextAt(this->m_context->fonts, this->m_context->locale, 0xc, 1, this->descendingText.c_str(), 0, 0, 0xc, 0, 0, 0); + } + } +} diff --git a/Source/UI/UIChangeMaterialWnd.h b/Source/UI/UIChangeMaterialWnd.h index 5bca191f..04d04a20 100644 --- a/Source/UI/UIChangeMaterialWnd.h +++ b/Source/UI/UIChangeMaterialWnd.h @@ -49,6 +49,7 @@ class UIChangeMaterialWnd_CheckBox : public UICheckBox { public: // INLINED UIChangeMaterialWnd_CheckBox(UIWindowContext& windows, UIButtonContext& controls) : UICheckBox(windows, controls) {} + void Paint() override; /* 010C */ std::string ascendingText; /* 0124 */ std::string descendingText;