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).
This commit is contained in:
ragnarok-clanker 2026-10-31 06:25:26 +00:00
commit 96dd3fa97d
2 changed files with 32 additions and 0 deletions

View file

@ -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<CBitmapRes*>(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<CBitmapRes*>(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);
}
}
}

View file

@ -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;