Batch #4429 by eAthena: 0 byte-identical, 9 confirmed by peer review. - fn_10915 UIEditCtrlVarId::SendMsg: logic confirmed by peer review - fn_10916 UIEditCtrl_OldList::SendMsg: logic confirmed by peer review - fn_10917 UIEmblemWnd::SendMsg: logic confirmed by peer review - fn_10919 UIRadioBtn::SendMsg: logic confirmed by peer review - fn_10920 UISlotBitmap::SendMsg: logic confirmed by peer review - fn_10921 UITab::SendMsg: logic confirmed by peer review - fn_10923 UIWordDisplayWnd::SendMsg: logic confirmed by peer review - fn_10935 UIBalloonText::SetFontHeight: logic confirmed by peer review - fn_10936 UIStaticText::SetFont: logic confirmed by peer review Peer-reviewed-by: alisonrag, willerthal Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
67 lines
2.5 KiB
C++
67 lines
2.5 KiB
C++
#include "Resource/Bitmap/BitmapResource.h"
|
|
#include "Resource/ResourceMgr.h"
|
|
#include "Resource/TextureNames.h"
|
|
#include "UI/Buttons/UIButton.h"
|
|
#include "UI/Buttons/UIRadioBtn.h"
|
|
|
|
// OFFSET: 0x00851B00
|
|
// FUNCTION: fn_10696
|
|
UIRadioBtn::~UIRadioBtn() = default;
|
|
|
|
// OFFSET: 0x0085D470
|
|
// FUNCTION: fn_10814
|
|
void UIRadioBtn::Paint() {
|
|
UIButtonContext& controls = *this->m_controls;
|
|
|
|
if (!this->checkedBitmap.empty() && !this->uncheckedBitmap.empty()) {
|
|
this->ClearSurface(0xFFFF00FF);
|
|
CBitmapRes* bitmap = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve(this->checkedBitmap.c_str())));
|
|
if (this->geometry.unknown_0030 == 0) {
|
|
bitmap = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve(this->uncheckedBitmap.c_str())));
|
|
}
|
|
|
|
if (bitmap) {
|
|
this->DrawBitmap(0, static_cast<int>((this->geometry.height - bitmap->image.height) * 0.5f), &bitmap->image, true);
|
|
}
|
|
|
|
const int textHeight = this->TextHeight(controls.fonts, controls.locale, this->text.c_str(), 0, 0, this->fontHeight, 0, 0);
|
|
const std::uint32_t color = this->enabled == 1 ? this->textColor : 0xB5B5B5;
|
|
this->DrawTextAt(
|
|
controls.fonts, controls.locale, bitmap->image.width + 3, static_cast<int>((this->geometry.height - textHeight) * 0.5f), this->text.c_str(), 0, 0,
|
|
this->fontHeight, color, 0, 0
|
|
);
|
|
return;
|
|
}
|
|
|
|
this->ClearSurface(0xFFFF00FF);
|
|
const char* name;
|
|
if (this->geometry.unknown_0030 == 0) {
|
|
name = "유저인터페이스\\radiobtn_off.bmp";
|
|
} else {
|
|
name = this->highlighted != 0 ? "유저인터페이스\\radiobtn_on1.bmp" : "유저인터페이스\\radiobtn_on.bmp";
|
|
}
|
|
|
|
CBitmapRes* bitmap = static_cast<CBitmapRes*>(ResourceMgr::Instance().Load(Resolve(name)));
|
|
this->DrawBitmap(0, 0, bitmap ? &bitmap->image : nullptr, false);
|
|
const std::uint32_t color = this->enabled != 0 ? this->textColor : 0xB5B5B5;
|
|
this->DrawTextAt(controls.fonts, controls.locale, 13, 0, this->text.c_str(), 0, 0, this->fontHeight, color, 0, 0);
|
|
}
|
|
|
|
// OFFSET: 0x0085ECB0
|
|
// FUNCTION: fn_10844
|
|
void UIRadioBtn::Slot25(int, int) {
|
|
if (this->parent && this->enabled != 0) {
|
|
this->parent->SendMsg(this, 6, this->geometry.id, this->value, 0, 0);
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x00865180
|
|
// FUNCTION: fn_10919
|
|
int UIRadioBtn::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) {
|
|
if (message == 13) {
|
|
this->geometry.unknown_0030 = argument1;
|
|
this->Invalidate();
|
|
}
|
|
|
|
return 0;
|
|
}
|