From 1fcafbcdd30b7bbf0645164c929556ef618806e6 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 6 Nov 2026 12:36:37 +0000 Subject: [PATCH] Decompile fn_10803 (UICheckBox::Paint) Batch #12919 by cremane: 0 byte-identical, 1 confirmed by peer review. - fn_10803 UICheckBox::Paint: logic confirmed by peer review Peer-reviewed-by: gordaoprogramas, Toshiro, codeplay Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Buttons/UICheckBox.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Source/UI/Buttons/UICheckBox.cpp b/Source/UI/Buttons/UICheckBox.cpp index 5eaf8f90..ae88c10f 100644 --- a/Source/UI/Buttons/UICheckBox.cpp +++ b/Source/UI/Buttons/UICheckBox.cpp @@ -23,6 +23,7 @@ UICheckBox::~UICheckBox() = default; // OFFSET: 0x0085C8C0 // FUNCTION: fn_10803 void UICheckBox::Paint() { + int width = 0; if (this->m_checked.empty() || this->m_unchecked.empty()) { return; } @@ -36,12 +37,19 @@ void UICheckBox::Paint() { return; } - int width = 0; - if (this->geometry.unknown_0030 == 0 || this->geometry.unknown_0030 == 1) { - const std::string& name = this->geometry.unknown_0030 == 0 ? this->m_unchecked : this->m_checked; - CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(name.c_str()))); + switch (this->geometry.unknown_0030) { + case 0: { + CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(this->m_unchecked.c_str()))); this->DrawBitmap(0, (this->geometry.height - bitmap->image.height) / 2, &bitmap->image, false); width = bitmap->image.width; + break; + } + case 1: { + CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(this->m_checked.c_str()))); + this->DrawBitmap(0, (this->geometry.height - bitmap->image.height) / 2, &bitmap->image, false); + width = bitmap->image.width; + break; + } } if (!this->m_text.empty()) {