diff --git a/Source/Contents/UserData/CharacterConfigLoad.cpp b/Source/Contents/UserData/CharacterConfigLoad.cpp index a371f20f..da193928 100644 --- a/Source/Contents/UserData/CharacterConfigLoad.cpp +++ b/Source/Contents/UserData/CharacterConfigLoad.cpp @@ -46,7 +46,7 @@ void CCharacterLinkedUserDataMgr::CompleteLoad( const Json::Value sorting = data["SortPrivateTab"]; context.sortPrivate = sorting.isNull() ? false : sorting.asBool(); - LoadNormalItemSlots(data, context.items, context.saved, context.itemSlotActive, context.windows, context.visibility); + LoadNormalItemSlots(data, context.items, context.saved, context.itemSlotActive, context.windows); this->m_loaded = true; } diff --git a/Source/Contents/UserData/CharacterConfigLoad.h b/Source/Contents/UserData/CharacterConfigLoad.h index f42d25f1..0e369ea0 100644 --- a/Source/Contents/UserData/CharacterConfigLoad.h +++ b/Source/Contents/UserData/CharacterConfigLoad.h @@ -3,7 +3,6 @@ struct NormalItemSlot; struct NormalItemSlotWindow; -struct ShortcutVisibility; struct ServiceOptions; struct SkillLevelRegistry; #include "UI/Window/WindowManagerWindows.h" @@ -18,7 +17,6 @@ struct CharacterConfigLoad { NormalItemSlotWindow& saved; bool& itemSlotActive; WindowManagerWindows& windows; - ShortcutVisibility& visibility; }; #endif diff --git a/Source/UI/Shortcuts/NormalItemSlotLoad.cpp b/Source/UI/Shortcuts/NormalItemSlotLoad.cpp index fba906d4..e8ac913b 100644 --- a/Source/UI/Shortcuts/NormalItemSlotLoad.cpp +++ b/Source/UI/Shortcuts/NormalItemSlotLoad.cpp @@ -9,7 +9,7 @@ // OFFSET: 0x005E65E0 // FUNCTION: fn_03929 void LoadNormalItemSlots( - Json::Value& data, NormalItemSlot* slots, NormalItemSlotWindow& saved, bool& itemSlotActive, WindowManagerWindows& windows, ShortcutVisibility& visibility + Json::Value& data, NormalItemSlot* slots, NormalItemSlotWindow& saved, bool& itemSlotActive, WindowManagerWindows& windows ) { Json::Value& values = data["NormalItemSlot"]; @@ -63,7 +63,7 @@ void LoadNormalItemSlots( window->geometry.width = saved.width; window->geometry.height = saved.height; - visibility.Show(saved.show); + g_windowMgr.ShowShortcutWindow(saved.show); window->SendMsg(nullptr, 34, reinterpret_cast(&saved), 0, 0, 0); window->SendMsg(nullptr, 6, itemSlotActive ? 588 : 589, 0, 0, 0); } diff --git a/Source/UI/Shortcuts/NormalItemSlotLoad.h b/Source/UI/Shortcuts/NormalItemSlotLoad.h index 021f9790..28f4b9d2 100644 --- a/Source/UI/Shortcuts/NormalItemSlotLoad.h +++ b/Source/UI/Shortcuts/NormalItemSlotLoad.h @@ -4,10 +4,9 @@ #include "Contents/UserData/NormalItemSlots.h" #include "UI/Window/WindowManagerWindows.h" -struct ShortcutVisibility; void LoadNormalItemSlots( - Json::Value& data, NormalItemSlot* slots, NormalItemSlotWindow& saved, bool& itemSlotActive, WindowManagerWindows& windows, ShortcutVisibility& visibility + Json::Value& data, NormalItemSlot* slots, NormalItemSlotWindow& saved, bool& itemSlotActive, WindowManagerWindows& windows ); #endif diff --git a/Source/UI/Shortcuts/ShortcutControlEvents.h b/Source/UI/Shortcuts/ShortcutControlEvents.h index 0a5f6c46..1d35d8ec 100644 --- a/Source/UI/Shortcuts/ShortcutControlEvents.h +++ b/Source/UI/Shortcuts/ShortcutControlEvents.h @@ -5,14 +5,12 @@ #include "UI/Shortcuts/ShortcutGrid.h" class UIWindow; -struct ShortcutVisibility; struct ShortcutCooldowns; struct ShortcutControlEvents { UIWindow& window; ShortcutGrid& grid; ShortcutControls& controls; - ShortcutVisibility& visibility; ShortcutCooldowns& cooldowns; bool& itemSlotActive; diff --git a/Source/UI/Shortcuts/ShortcutVisibility.h b/Source/UI/Shortcuts/ShortcutVisibility.h index 005ec003..732e900d 100644 --- a/Source/UI/Shortcuts/ShortcutVisibility.h +++ b/Source/UI/Shortcuts/ShortcutVisibility.h @@ -38,47 +38,4 @@ inline bool UIWindowMgr::ShowShortcutWindow(int value) { return true; } -struct ShortcutVisibility { - WindowManagerWindows& windows; - WindowOrdering& ordering; - UIWindow*& shortcut; - int& visible; - const bool& restricted; - const bool& replayAllowsShortcut; - const bool& showCompanion; - - bool Show(int value); -}; - -// INLINED -inline bool ShortcutVisibility::Show(int value) { - if (this->restricted && !this->replayAllowsShortcut) { - return false; - } - - this->visible = value; - this->windows.EnsureWindow(36); - this->shortcut->Show(value); - - if (value != 0) { - this->ordering.Promote(this->shortcut); - } - - if (this->showCompanion) { - this->windows.EnsureWindow(159); - } - - UIWindow* companion = this->windows.LookupWindow(159); - - if (companion) { - companion->Show(value); - - if (value != 0) { - this->ordering.Promote(companion); - } - } - - return true; -} - #endif diff --git a/Source/UI/Shortcuts/UIShortCutWnd.cpp b/Source/UI/Shortcuts/UIShortCutWnd.cpp index a55d21ac..a6f75b5d 100644 --- a/Source/UI/Shortcuts/UIShortCutWnd.cpp +++ b/Source/UI/Shortcuts/UIShortCutWnd.cpp @@ -208,12 +208,12 @@ void UIShortCutWnd::Slot32(int x, int y) { inline void ShortcutControlEvents::Click(int id) { switch (id) { case 201: - this->visibility.Show(0); + g_windowMgr.ShowShortcutWindow(0); return; case 216: if (this->window.geometry.visible == 0) { - this->visibility.Show(1); + g_windowMgr.ShowShortcutWindow(1); return; } @@ -221,7 +221,7 @@ inline void ShortcutControlEvents::Click(int id) { if (this->grid.rows > 4) { this->grid.rows = 1; - this->visibility.Show(0); + g_windowMgr.ShowShortcutWindow(0); } this->window.SendMsg(nullptr, 14, 0, 0, 0, 0); @@ -416,7 +416,7 @@ int UIShortCutWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std:: switch (message) { case 6: { - ShortcutControlEvents events{*this, this->m_grid, this->m_controls, owner.visibility, owner.bindings.cooldowns, owner.itemSlotActive}; + ShortcutControlEvents events{*this, this->m_grid, this->m_controls, owner.bindings.cooldowns, owner.itemSlotActive}; events.Click(static_cast(a)); return 0; } diff --git a/Source/UI/Shortcuts/UIShortCutWnd.h b/Source/UI/Shortcuts/UIShortCutWnd.h index f183337c..79e4c4ce 100644 --- a/Source/UI/Shortcuts/UIShortCutWnd.h +++ b/Source/UI/Shortcuts/UIShortCutWnd.h @@ -12,7 +12,6 @@ struct ShortcutDrop; struct ShortcutTooltip; struct ShortcutDetails; struct ShortcutUse; -struct ShortcutVisibility; struct CooldownClock; struct ModeDragState; struct NormalItemSlot; @@ -27,7 +26,6 @@ struct ShortcutWindowContext { ShortcutTooltip& tooltip; ShortcutDetails& details; ShortcutUse& use; - ShortcutVisibility& visibility; AutomaticSkills& automatic; const CooldownClock& clock; bool& itemSlotActive;