Decompile fn_11234 (UITabControl::ClearTabs)
Batch #5125 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_11234 UITabControl::ClearTabs: logic confirmed by peer review Peer-reviewed-by: youko, SapitoSucio 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
f32c25471d
commit
b2baffe7da
2 changed files with 28 additions and 7 deletions
|
|
@ -364,7 +364,7 @@ int UIImgMenu::ItemAt(int x, int y) {
|
|||
// OFFSET: 0x0086ECF0
|
||||
// FUNCTION: fn_11083
|
||||
UITabControl::UITabControl(UIWindowContext& windows, UIButtonContext& controls)
|
||||
: UIWindow(windows, 0), unknown_00E8(12), unknown_00EC(0), unknown_00F0(0), unknown_00F4(0), unknown_00F8(0), m_controls(&controls) {
|
||||
: UIWindow(windows, 0), unknown_00E8(12), flags(), m_controls(&controls) {
|
||||
this->unknown_007C = -1;
|
||||
this->dragX = 0;
|
||||
this->dragY = 0;
|
||||
|
|
@ -388,14 +388,37 @@ void UITabControl::SelectTab(int index) {
|
|||
this->Invalidate();
|
||||
}
|
||||
|
||||
// OFFSET: 0x0087A3C0
|
||||
void UITabControl::RemoveTab(int index) {
|
||||
this->edit->SetText("");
|
||||
this->edit->Move(-100, -100);
|
||||
|
||||
if (g_windowMgr.GetHoverWindow() == this->edit) {
|
||||
g_windowMgr.NotifyHoverWindow();
|
||||
}
|
||||
|
||||
const int count = static_cast<int>(this->labels.size());
|
||||
|
||||
for (int tab = 0; tab < count; ++tab) {
|
||||
if (tab == index) {
|
||||
this->colors.erase(this->colors.begin() + tab);
|
||||
this->labels.erase(this->labels.begin() + tab);
|
||||
this->widths.erase(this->widths.begin() + tab);
|
||||
this->flags.erase(this->flags.begin() + tab);
|
||||
this->unknown_007C = 0;
|
||||
this->FitToTabs();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x0087A520
|
||||
// FUNCTION: fn_11234
|
||||
void UITabControl::ClearTabs() {
|
||||
this->labels.clear();
|
||||
this->colors.clear();
|
||||
this->widths.clear();
|
||||
this->unknown_00F0 = this->unknown_00EC;
|
||||
this->unknown_00F8 = 0;
|
||||
this->flags.clear();
|
||||
this->unknown_007C = 0;
|
||||
this->unknown_00E8 = 12;
|
||||
this->FitToTabs();
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ public:
|
|||
void RecalculateWidths();
|
||||
void FitToTabs();
|
||||
void SelectTab(int index);
|
||||
void RemoveTab(int index);
|
||||
void ClearTabs();
|
||||
void Slot10(int argument1, int argument2, std::intptr_t argument3) override;
|
||||
void Slot25(int x, int y) override;
|
||||
|
|
@ -50,10 +51,7 @@ public:
|
|||
/* 00DC */ std::vector<std::string> tooltips;
|
||||
/* 007C */ int unknown_007C;
|
||||
/* 00E8 */ int unknown_00E8;
|
||||
/* 00EC */ int unknown_00EC;
|
||||
/* 00F0 */ int unknown_00F0;
|
||||
/* 00F4 */ int unknown_00F4;
|
||||
/* 00F8 */ int unknown_00F8;
|
||||
/* 00EC */ std::vector<bool> flags;
|
||||
|
||||
private:
|
||||
UIButtonContext* m_controls;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue