diff --git a/Source/UI/Lists/UIScrollBar.cpp b/Source/UI/Lists/UIScrollBar.cpp index e2c76d0b..4c7ea0b9 100644 --- a/Source/UI/Lists/UIScrollBar.cpp +++ b/Source/UI/Lists/UIScrollBar.cpp @@ -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(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(); diff --git a/Source/UI/Lists/UITabControl.h b/Source/UI/Lists/UITabControl.h index 3c920acc..bd5026d2 100644 --- a/Source/UI/Lists/UITabControl.h +++ b/Source/UI/Lists/UITabControl.h @@ -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 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 flags; private: UIButtonContext* m_controls;