Decompile 3 functions in Source/UI/Window/UIControl.cpp, Source/UI/Window/UIControl.h, ...
Batch #6477 by eAthena: 0 byte-identical, 3 confirmed by peer review. - fn_14403 CUIBasicButton::Create: logic confirmed by peer review - fn_14543 CUIRadioButton::Slot25: logic confirmed by peer review - fn_14571 CUITextButton::SetTextColors: logic confirmed by peer review Peer-reviewed-by: willerthal, superintelligence Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
4903b97775
commit
c0eaee9f6c
3 changed files with 57 additions and 3 deletions
|
|
@ -24,6 +24,7 @@ public:
|
|||
/* 0150 */ std::function<void(CUIRadioButton*)> onSelect;
|
||||
|
||||
void SetOnSelect(std::function<void(CUIRadioButton*)> callback);
|
||||
void Slot25(int x, int y) override;
|
||||
};
|
||||
|
||||
class CUIRadioItem : public CUIControl {
|
||||
|
|
|
|||
|
|
@ -689,6 +689,16 @@ void CUITextButton::Slot28(int, int) {
|
|||
reinterpret_cast<ModeTooltip*>(g_modeMgr.gameMode)->Show(this->fullText.c_str(), screenX, screenY, 0xFFFFFFFFu, 0, 1);
|
||||
}
|
||||
|
||||
// OFFSET: 0x009ED360
|
||||
// FUNCTION: fn_14571
|
||||
void CUITextButton::SetTextColors(std::uint32_t normal, std::uint32_t hover, std::uint32_t pressed, std::uint32_t disabled) {
|
||||
this->textColors[0] = normal;
|
||||
this->textColors[1] = hover;
|
||||
this->textColors[2] = pressed;
|
||||
this->disabledTextColor = disabled;
|
||||
this->Invalidate();
|
||||
}
|
||||
|
||||
// OFFSET: 0x009ED430
|
||||
// FUNCTION: fn_14574
|
||||
void CUITextButton::SetOutline(bool enabled, std::uint32_t color) {
|
||||
|
|
@ -710,6 +720,16 @@ void CUIBasicButton::Resize(int width, int height) {
|
|||
this->Slot53(0);
|
||||
}
|
||||
|
||||
// OFFSET: 0x009E1DE0
|
||||
// FUNCTION: fn_14403
|
||||
void CUIBasicButton::Create(int width, int height) {
|
||||
this->defaultWidth = width;
|
||||
this->SetAlign(6, 6);
|
||||
this->Resize(width, height);
|
||||
this->Slot15(width, height);
|
||||
this->Slot16();
|
||||
}
|
||||
|
||||
// OFFSET: 0x009E1F90
|
||||
// FUNCTION: fn_14405
|
||||
void CUIBasicButton::Paint() {
|
||||
|
|
@ -1595,6 +1615,34 @@ bool CUIPadding::CanHitTest() {
|
|||
return false;
|
||||
}
|
||||
|
||||
// OFFSET: 0x009EAE20
|
||||
// FUNCTION: fn_14543
|
||||
void CUIRadioButton::Slot25(int, int) {
|
||||
if (this->disabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_windowMgr.SetCapture(this);
|
||||
if (this->checked) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->parent) {
|
||||
std::list<UIWindow*> UIWindow::*const children = &CUIRadioButton::m_children;
|
||||
for (UIWindow* child : this->parent->*children) {
|
||||
CUIRadioButton* button = dynamic_cast<CUIRadioButton*>(child);
|
||||
if (button) {
|
||||
button->checked = this == button;
|
||||
button->Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this->onSelect) {
|
||||
this->onSelect(this);
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x009EA1B0
|
||||
// FUNCTION: fn_14514
|
||||
void CUIPadding::Paint() {
|
||||
|
|
|
|||
|
|
@ -135,13 +135,14 @@ public:
|
|||
void SetShadow(bool enabled, std::uint32_t color);
|
||||
void SetOutline(bool enabled, std::uint32_t color);
|
||||
void UpdateText();
|
||||
void SetAlign(int horizontal, int vertical);
|
||||
__declspec(noinline) void SetAlign(int horizontal, int vertical);
|
||||
void SetOrientation(int value);
|
||||
void SetFitText(bool enabled);
|
||||
void SetBold(unsigned char enabled);
|
||||
void SetFontHeight(int height);
|
||||
void SetFont(const std::string& name);
|
||||
void SetText(const std::string& value);
|
||||
void SetTextColors(std::uint32_t normal, std::uint32_t hover, std::uint32_t pressed, std::uint32_t disabled);
|
||||
|
||||
/* 00F0 */ std::string text;
|
||||
/* 0108 */ std::string displayText;
|
||||
|
|
@ -153,7 +154,9 @@ public:
|
|||
/* 0148 */ int fontIndex;
|
||||
/* 014C */ int fontHeight;
|
||||
/* 0150 */ unsigned char bold;
|
||||
/* 0151 */ unsigned char unknown_0151[0x0F];
|
||||
/* 0151 */ unsigned char unknown_0151[0x03];
|
||||
/* 0154 */ std::map<int, std::uint32_t> textColors;
|
||||
/* 015C */ std::uint32_t disabledTextColor;
|
||||
/* 0160 */ unsigned char shadow;
|
||||
/* 0164 */ std::uint32_t shadowColor;
|
||||
/* 0168 */ unsigned char outline;
|
||||
|
|
@ -185,8 +188,10 @@ public:
|
|||
void Paint() override;
|
||||
void Slot53(int resolveSkin) override;
|
||||
|
||||
void Create(int width, int height);
|
||||
|
||||
/* 0190 */ unsigned char unknown_0190;
|
||||
/* 0194 */ int unknown_0194;
|
||||
/* 0194 */ int defaultWidth;
|
||||
/* 0198 */ std::map<int, CResPtr<CBitmapRes>> leftImages;
|
||||
/* 01A0 */ CResPtr<CBitmapRes> disabledLeft;
|
||||
/* 01A4 */ std::map<int, CResPtr<CBitmapRes>> middleImages;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue