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;