Decompile 7 functions in Source/UI/Buttons/UITextButton.cpp, Source/UI/Lists/UIComboBoxDefWnd.cpp, ...
Batch #4921 by youko: 0 byte-identical, 7 confirmed by peer review. - fn_11526 UIChatHisBox3::Resize: logic confirmed by peer review - fn_11536 UITVTextButton::ResizeToText: logic confirmed by peer review - fn_11537 UITextButton::ResizeToText: logic confirmed by peer review - fn_11539 UITabControl::FitToTabs: logic confirmed by peer review - fn_11540 TableBox::SendMsg: logic confirmed by peer review - fn_11547 UIComboBoxV2Wnd::SendMsg: logic confirmed by peer review - fn_11551 UIItemStoreComboBoxWnd::SendMsg: logic confirmed by peer review Peer-reviewed-by: eAthena, alisonrag, willerthal 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
21a1081797
commit
0052c1f56b
10 changed files with 191 additions and 4 deletions
|
|
@ -16,6 +16,7 @@ public:
|
|||
void Slot31(int x, int y) override;
|
||||
void Slot32(int x, int y) override;
|
||||
void Slot33(int x, int y) override;
|
||||
void ResizeToText();
|
||||
|
||||
protected:
|
||||
/* 00B4 */ unsigned char unknown_00B4;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@
|
|||
#include "UI/Lists/UIListBoxEx.h"
|
||||
#include "UI/Lists/UIListBoxID.h"
|
||||
#include "UI/Lists/UIScrollBar.h"
|
||||
#include "UI/Lists/TableBox.h"
|
||||
#include "UI/Window/WindowPolicy.h"
|
||||
#include "UI/Text/UITransBalloonText.h"
|
||||
#include "UI/Shortcuts/ShortcutVisibility.h"
|
||||
#include "UI/Text/UIString.h"
|
||||
|
|
@ -49,7 +51,6 @@
|
|||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
// GLOBAL: gl_24606
|
||||
int g_screenHeight;
|
||||
|
|
@ -149,7 +150,6 @@ void UITextButton::Slot28(int x, int y) {
|
|||
// OFFSET: 0x00891140
|
||||
// FUNCTION: fn_11445
|
||||
void UITextButton::Slot31(int x, int y) {
|
||||
|
||||
if (this->m_disabled != 0 || g_windowMgr.Capture() != this) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -626,6 +626,114 @@ void UIComboBox::Refresh() {
|
|||
this->verticalBar->Invalidate();
|
||||
}
|
||||
|
||||
// OFFSET: 0x00896FA0
|
||||
|
||||
// OFFSET: 0x00897370
|
||||
// FUNCTION: fn_11526
|
||||
void UIChatHisBox3::Resize(int width, int height) {
|
||||
UIWindow::Resize(width, height);
|
||||
this->verticalBar->Resize(9, height);
|
||||
this->verticalBar->Move(width - 10, 0);
|
||||
this->horizontalBar->Resize(width - 10, 9);
|
||||
this->horizontalBar->Move(0, height - 10);
|
||||
this->Refresh();
|
||||
}
|
||||
|
||||
// OFFSET: 0x008978A0
|
||||
// FUNCTION: fn_11536
|
||||
void UITVTextButton::ResizeToText() {
|
||||
if (std::strcmp(this->label.c_str(), "") == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->unknown_00DC = this->label;
|
||||
const int width =
|
||||
this->TextWidth(this->m_buttonContext->fonts, this->m_buttonContext->locale, this->label.c_str(), 0, this->m_fontFamily, this->m_fontHeight, this->m_outlined, 0);
|
||||
const int border = this->m_border ? 2 : 0;
|
||||
UIWindow::Resize(width + 2 + border, this->m_fontHeight + 2 + border);
|
||||
}
|
||||
|
||||
// OFFSET: 0x00897960
|
||||
// FUNCTION: fn_11537
|
||||
void UITextButton::ResizeToText() {
|
||||
if (std::strcmp(this->label.c_str(), "") == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->m_text = this->label;
|
||||
const int width = this->TextWidth(this->m_buttonContext->fonts, this->m_buttonContext->locale, this->label.c_str(), 0, this->m_family, this->m_height, this->m_outline, 0);
|
||||
UIWindow::Resize(width + 2, this->m_height + 2);
|
||||
}
|
||||
|
||||
// OFFSET: 0x00897A50
|
||||
// FUNCTION: fn_11539
|
||||
void UITabControl::FitToTabs() {
|
||||
int length = 0;
|
||||
|
||||
for (int index = 0; index < static_cast<int>(this->labels.size()); ++index) {
|
||||
length += this->widths[index] - 1;
|
||||
}
|
||||
|
||||
if (this->layout == 0 || this->layout == 2) {
|
||||
this->Resize(this->tabHeight + 1, length + 1);
|
||||
} else {
|
||||
this->Resize(length + 1, this->tabHeight + 1);
|
||||
}
|
||||
|
||||
this->Invalidate();
|
||||
}
|
||||
|
||||
// OFFSET: 0x00897BE0
|
||||
// FUNCTION: fn_11540
|
||||
int TableBox::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) {
|
||||
return UIWindow::SendMsg(sender, message, argument1, argument2, argument3, argument4);
|
||||
}
|
||||
|
||||
// OFFSET: 0x008984E0
|
||||
// FUNCTION: fn_11547
|
||||
int UIComboBoxV2Wnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) {
|
||||
if (message == 6) {
|
||||
if (argument1 != 273) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int height = this->unknown_0098->geometry.height;
|
||||
|
||||
if (this->geometry.height <= height) {
|
||||
height += this->list->geometry.height;
|
||||
}
|
||||
|
||||
this->Resize(this->geometry.width, height);
|
||||
|
||||
if (this->parent) {
|
||||
this->parent->Invalidate();
|
||||
}
|
||||
|
||||
this->Invalidate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (message != 39) {
|
||||
return UIWindow::SendMsg(sender, message, argument1, argument2, argument3, argument4);
|
||||
}
|
||||
|
||||
if (WindowPolicy(g_windowMgr.policy[0].actions, g_replayAnimationScaling != 0, 3, this->parent->geometry.id) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
this->SendMsg(nullptr, 6, 273, 0, 0, 0);
|
||||
this->selected = argument1;
|
||||
|
||||
if (this->parent) {
|
||||
this->parent->SendMsg(this, 39, argument1, 0, 0, 0);
|
||||
}
|
||||
|
||||
this->Invalidate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// OFFSET: 0x00898730
|
||||
|
||||
// OFFSET: 0x00897BF0
|
||||
// FUNCTION: fn_11541
|
||||
int UIBmpRadioBtn::SendMsg(UIWindow*, int message, std::intptr_t argument1, std::intptr_t, std::intptr_t, std::intptr_t) {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ public:
|
|||
void Slot33(int x, int y) override;
|
||||
void Slot35(int value) override;
|
||||
void Configure(const char* text, std::uint32_t color, int family, int height, unsigned char outline, unsigned char underline);
|
||||
void ResizeToText();
|
||||
|
||||
protected:
|
||||
/* 00B4 */ std::uint32_t m_color;
|
||||
|
|
|
|||
11
Source/UI/Lists/TableBox.h
Normal file
11
Source/UI/Lists/TableBox.h
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef RAGNAROK_SOURCE_UI_LISTS_TABLEBOX_H
|
||||
#define RAGNAROK_SOURCE_UI_LISTS_TABLEBOX_H
|
||||
|
||||
#include "UI/Window/UIWindow.h"
|
||||
|
||||
class TableBox : public UIWindow {
|
||||
public:
|
||||
int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
#include "Render/DeviceContext/DeviceContext.h"
|
||||
#include "UI/Buttons/UIBitmapButton.h"
|
||||
#include "UI/Lists/UIComboBoxDefWnd.h"
|
||||
#include "UI/Lists/UIItemStoreComboBox.h"
|
||||
#include "UI/Lists/UIListBox.h"
|
||||
#include "UI/Text/UIStaticText.h"
|
||||
#include "UI/Window/WindowPolicy.h"
|
||||
|
|
@ -141,6 +142,50 @@ int UIComboBoxDefWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, st
|
|||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x00898940
|
||||
// FUNCTION: fn_11551
|
||||
int UIItemStoreComboBoxWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
|
||||
const int value = static_cast<int>(a);
|
||||
|
||||
switch (message) {
|
||||
case 6:
|
||||
if (value == 273) {
|
||||
this->expanded = this->expanded == 0;
|
||||
|
||||
if (this->expanded) {
|
||||
this->list->Show(1);
|
||||
this->Resize(this->geometry.width, this->list->geometry.height + this->geometry.height);
|
||||
this->Move(214, this->geometry.y - this->list->geometry.height);
|
||||
this->button->Move(this->geometry.width - this->button->BitmapWidth(), this->geometry.height - this->button->BitmapHeight());
|
||||
this->label->Move(2, this->list->geometry.height + 3);
|
||||
} else {
|
||||
this->list->Show(0);
|
||||
this->Resize(this->geometry.width, this->geometry.height - this->list->geometry.height);
|
||||
this->Move(214, this->list->geometry.height + this->geometry.y);
|
||||
this->button->Move(this->geometry.width - this->button->BitmapWidth(), 0);
|
||||
this->label->Move(2, 3);
|
||||
}
|
||||
|
||||
this->parent->Invalidate();
|
||||
this->list->Invalidate();
|
||||
this->Invalidate();
|
||||
}
|
||||
|
||||
return 0;
|
||||
case 39:
|
||||
if (value < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
this->label->SetText(this->list->lines[value].text.c_str(), 0);
|
||||
this->SendMsg(nullptr, 6, 273, 0, 0, 0);
|
||||
this->parent->SendMsg(this, 39, value, 0, 0, 0);
|
||||
return 0;
|
||||
default:
|
||||
return this->UIWindow::SendMsg(sender, message, a, b, c, d);
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x0086CBA0
|
||||
// FUNCTION: fn_11034
|
||||
UIComboBoxDef2Wnd::UIComboBoxDef2Wnd(UIWindowContext& windows, UIComboBoxHeaderContext& controls)
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class UIComboBoxV2Wnd : public UIWindow {
|
|||
public:
|
||||
void Slot31(int x, int y) override;
|
||||
void Slot35(int value) override;
|
||||
int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override;
|
||||
|
||||
/* 007C */ std::string text;
|
||||
/* 0094 */ int selected;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include "UI/Window/UIWindow.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
class UIImgMenu : public UIWindow {
|
||||
public:
|
||||
int ItemAt(int x, int y);
|
||||
|
|
@ -10,11 +12,17 @@ public:
|
|||
void Slot27(int x, int y) override;
|
||||
void Slot28(int x, int y) override;
|
||||
void ResetCursor(int x, int y) override;
|
||||
int SendMsg(UIWindow* sender, int message, std::intptr_t argument1, std::intptr_t argument2, std::intptr_t argument3, std::intptr_t argument4) override;
|
||||
|
||||
/* 0080 */ int count;
|
||||
/* 0084 */ int itemWidth;
|
||||
/* 0088 */ int itemHeight;
|
||||
/* 008C */ int horizontal;
|
||||
/* 0090 */ bool* unknown_0090;
|
||||
/* 0094 */ bool* unknown_0094;
|
||||
/* 0098 */ std::string bitmapName;
|
||||
/* 00B0 */ std::string baseName;
|
||||
/* 00C8 */ int unknown_00C8;
|
||||
/* 007C */ int hovered;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef RAGNAROK_SOURCE_UI_LISTS_UIITEMSTORECOMBOBOX_H
|
||||
#define RAGNAROK_SOURCE_UI_LISTS_UIITEMSTORECOMBOBOX_H
|
||||
|
||||
#include "UI/Lists/UIComboBoxDefWnd.h"
|
||||
#include "UI/Lists/UIComboBoxEx.h"
|
||||
|
||||
class UIItemStoreComboBox : public UIComboBoxEx {
|
||||
|
|
@ -10,9 +11,10 @@ public:
|
|||
void Slot31(int x, int y) override;
|
||||
};
|
||||
|
||||
class UIItemStoreComboBoxWnd : public UIWindow {
|
||||
class UIItemStoreComboBoxWnd : public UIComboBoxDefWnd {
|
||||
public:
|
||||
void Paint() override;
|
||||
int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -13,6 +13,11 @@ public:
|
|||
void Slot33(int x, int y) override;
|
||||
};
|
||||
|
||||
class UIChatHisBox3 : public UIChatHisBox2 {
|
||||
public:
|
||||
void Resize(int width, int height) override;
|
||||
};
|
||||
|
||||
class UIMemberListBox : public UIChatHisBox2 {
|
||||
public:
|
||||
void Slot25(int x, int y) override;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ public:
|
|||
void DrawVerticalTab(int index);
|
||||
void DrawHorizontalTab(int index);
|
||||
void DrawTabBorder(int x, int y, int width, int height, std::uint32_t color);
|
||||
void RecalculateWidths();
|
||||
void FitToTabs();
|
||||
void Slot10(int argument1, int argument2, std::intptr_t argument3) override;
|
||||
void Slot25(int x, int y) override;
|
||||
void Slot27(int x, int y) override;
|
||||
|
|
@ -25,7 +27,10 @@ public:
|
|||
void Slot31(int x, int y) override;
|
||||
|
||||
/* 0080 */ int layout;
|
||||
/* 0084 */ unsigned char unknown_0084[0xC];
|
||||
/* 0084 */ int tabHeight;
|
||||
/* 0088 */ int tabPadding;
|
||||
/* 008C */ unsigned char uniformWidths;
|
||||
/* 008D */ unsigned char unknown_008D[0x3];
|
||||
/* 0090 */ std::uint32_t activeFillColor;
|
||||
/* 0094 */ std::uint32_t inactiveFillColor;
|
||||
/* 0098 */ std::uint32_t activeBorderColor;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue