From 5903e7603e7973da9c9cba76f442339ec9be1fca Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 3 Nov 2026 21:51:45 +0000 Subject: [PATCH] Maintenance: Fold alias global gl_24769 g_navigationWindow (0x14a67f4) into its evidenced owner member g_windowMgr.window_4F174. 0x14 Batch #10400 by ragnarok-clanker: no function's compiled code changes; checked with 13 compiled unit(s), including every includer of Source/UI/Window/UINavigationWnd.h. --- Source/Client/Mode/GameMode.cpp | 8 ++++---- Source/Contents/NavigationRoute.cpp | 10 +++++----- Source/Contents/NavigationSource.cpp | 4 ++-- Source/UI/AdventureGuide/UIAdventureGuide.cpp | 2 +- Source/UI/Menu/UIMenuIconWnd.cpp | 4 ++-- Source/UI/Shortcuts/UIShortCutWnd.cpp | 6 +++--- Source/UI/Window/UINavigationWnd.cpp | 5 +---- Source/UI/Window/UINavigationWnd.h | 1 - Source/UI/Window/UIRoMapWnd.cpp | 10 +++++----- 9 files changed, 23 insertions(+), 27 deletions(-) diff --git a/Source/Client/Mode/GameMode.cpp b/Source/Client/Mode/GameMode.cpp index f87221c2..742c270b 100644 --- a/Source/Client/Mode/GameMode.cpp +++ b/Source/Client/Mode/GameMode.cpp @@ -2245,8 +2245,8 @@ void CGameMode::ProcessUiMessage(unsigned char* message) { break; } case 908: - if (values->values[0] == 0xCB && g_navigationWindow != nullptr) { - g_navigationWindow->SendMsg(nullptr, values->values[1], values->values[2], reinterpret_cast(&values->values[3]), 0, 0); + if (values->values[0] == 0xCB && g_windowMgr.window_4F174 != nullptr) { + g_windowMgr.window_4F174->SendMsg(nullptr, values->values[1], values->values[2], reinterpret_cast(&values->values[3]), 0, 0); } break; case 909: @@ -2264,8 +2264,8 @@ void CGameMode::ProcessUiMessage(unsigned char* message) { std::memcpy(&states[0], values->values, states.size()); g_windowMgr.CloseWindow(0x1A); g_navigationManager.LoadStates(states); - if (g_navigationWindow != nullptr) { - static_cast(g_navigationWindow)->FillRouteGroups(); + if (g_windowMgr.window_4F174 != nullptr) { + static_cast(g_windowMgr.window_4F174)->FillRouteGroups(); } break; } diff --git a/Source/Contents/NavigationRoute.cpp b/Source/Contents/NavigationRoute.cpp index 4ced1bfc..9c2e3382 100644 --- a/Source/Contents/NavigationRoute.cpp +++ b/Source/Contents/NavigationRoute.cpp @@ -720,16 +720,16 @@ bool CNavigationManager::sub_B995D0(std::string name, int type, bool flag) { g_navigationManager.UpdateSearchResults(); if (!this->unknown_1248) { - if (g_navigationWindow == nullptr) { + if (g_windowMgr.window_4F174 == nullptr) { g_windowMgr.EnsureWindow(203); } else { - g_navigationWindow->SendMsg(nullptr, 6, 200, 0, 0, 0); + g_windowMgr.window_4F174->SendMsg(nullptr, 6, 200, 0, 0, 0); if (g_windowMgr.modal != nullptr) { static_cast(g_windowMgr.modal)->RefreshWorldMapLevels(); } } - g_windowMgr.Promote(g_navigationWindow); + g_windowMgr.Promote(g_windowMgr.window_4F174); } return true; @@ -1687,8 +1687,8 @@ void CNavigationManager::CancelRoute() { this->unknown_125C = 0; if (!this->unknown_1248) { this->unknown_1258 = 1; - if (g_navigationWindow != nullptr) { - static_cast(g_navigationWindow)->RefreshLayout(); + if (g_windowMgr.window_4F174 != nullptr) { + static_cast(g_windowMgr.window_4F174)->RefreshLayout(); } } g_windowMgr.SendNotice(1, reinterpret_cast(LookupMessage(2309)), 0x62B0FF, 0, 0, 0); diff --git a/Source/Contents/NavigationSource.cpp b/Source/Contents/NavigationSource.cpp index fb7ce0e4..5439193f 100644 --- a/Source/Contents/NavigationSource.cpp +++ b/Source/Contents/NavigationSource.cpp @@ -963,8 +963,8 @@ void CNavigationManager::ResetCurrentTarget() { // FUNCTION: fn_19570 void CNavigationManager::CheckArrival(int cellX, int cellY) { if (this->unknown_1258 == 2) { - if (g_navigationWindow != nullptr) { - g_navigationWindow->Invalidate(); + if (g_windowMgr.window_4F174 != nullptr) { + g_windowMgr.window_4F174->Invalidate(); } if (this->unknown_115C) { NaviCell cell; diff --git a/Source/UI/AdventureGuide/UIAdventureGuide.cpp b/Source/UI/AdventureGuide/UIAdventureGuide.cpp index e36068a2..1cb5b53d 100644 --- a/Source/UI/AdventureGuide/UIAdventureGuide.cpp +++ b/Source/UI/AdventureGuide/UIAdventureGuide.cpp @@ -2686,7 +2686,7 @@ void CUIMonster::SearchNavigation() { g_navigationManager.SetViewMode(1); g_navigationManager.ClearSavedTarget(); g_windowMgr.CloseWindow(314); - static_cast(g_navigationWindow)->RefreshLayout(); + static_cast(g_windowMgr.window_4F174)->RefreshLayout(); g_windowMgr.Promote(g_windowMgr.LookupWindow(203)); } else { g_windowMgr.EnsureWindow(203); diff --git a/Source/UI/Menu/UIMenuIconWnd.cpp b/Source/UI/Menu/UIMenuIconWnd.cpp index 14ad6931..1b54ff8a 100644 --- a/Source/UI/Menu/UIMenuIconWnd.cpp +++ b/Source/UI/Menu/UIMenuIconWnd.cpp @@ -407,8 +407,8 @@ int UIMenuIconWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument this->ToggleWindow(140); break; case 430: - if (g_navigationWindow) { - g_navigationWindow->SendMsg(nullptr, 6, 201, 0, 0, 0); + if (g_windowMgr.window_4F174) { + g_windowMgr.window_4F174->SendMsg(nullptr, 6, 201, 0, 0, 0); } else { g_windowMgr.EnsureWindow(203); } diff --git a/Source/UI/Shortcuts/UIShortCutWnd.cpp b/Source/UI/Shortcuts/UIShortCutWnd.cpp index ac1f08a9..58a75d67 100644 --- a/Source/UI/Shortcuts/UIShortCutWnd.cpp +++ b/Source/UI/Shortcuts/UIShortCutWnd.cpp @@ -654,9 +654,9 @@ void UIRoMapWnd::Slot31(int x, int y) { g_navigationMinimized = false; g_navigationManager.sub_B995D0(name, 0, false); - if (g_navigationWindow) { - static_cast(g_navigationWindow)->SelectRoute(0); - static_cast(g_navigationWindow)->SelectRouteNode(0); + if (g_windowMgr.window_4F174) { + static_cast(g_windowMgr.window_4F174)->SelectRoute(0); + static_cast(g_windowMgr.window_4F174)->SelectRouteNode(0); } this->UpdateNavigationButtons(); } diff --git a/Source/UI/Window/UINavigationWnd.cpp b/Source/UI/Window/UINavigationWnd.cpp index 58c98469..977f678d 100644 --- a/Source/UI/Window/UINavigationWnd.cpp +++ b/Source/UI/Window/UINavigationWnd.cpp @@ -35,9 +35,6 @@ bool g_navigationMinimized; // GLOBAL: gl_24610 int g_navigationMode; -// GLOBAL: gl_24769 -UIWindow* g_navigationWindow; - // GLOBAL: gl_24608 bool g_navigationHidden; @@ -765,7 +762,7 @@ int UINavigationWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argume return 0; } g_windowMgr.Schedule(this); - g_navigationWindow = nullptr; + g_windowMgr.window_4F174 = nullptr; return 0; case 0xCA: g_navigationMinimized = !g_navigationMinimized; diff --git a/Source/UI/Window/UINavigationWnd.h b/Source/UI/Window/UINavigationWnd.h index 65fee8b4..4108a6f1 100644 --- a/Source/UI/Window/UINavigationWnd.h +++ b/Source/UI/Window/UINavigationWnd.h @@ -29,7 +29,6 @@ struct NavigationWndInfo { extern bool g_navigationMinimized; extern int g_navigationMode; -extern UIWindow* g_navigationWindow; extern bool g_navigationHidden; extern CActRes* g_navigationActions; extern CSprRes* g_navigationSprites; diff --git a/Source/UI/Window/UIRoMapWnd.cpp b/Source/UI/Window/UIRoMapWnd.cpp index 6a17761f..56f16fa6 100644 --- a/Source/UI/Window/UIRoMapWnd.cpp +++ b/Source/UI/Window/UIRoMapWnd.cpp @@ -81,7 +81,7 @@ void UIRoMapWnd::ResetKafraBounds() { // FUNCTION: fn_12634 void UIRoMapWnd::UpdateNavigationButtons() { UIWindow** buttons = reinterpret_cast(reinterpret_cast(this) + 0x20C); - if (g_navigationWindow != nullptr && !g_navigationMinimized) { + if (g_windowMgr.window_4F174 != nullptr && !g_navigationMinimized) { buttons[0]->Move(-100, -100); buttons[1]->Move(-100, -100); buttons[2]->Move(-100, -100); @@ -763,8 +763,8 @@ int UIRoMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, return 0; case 200: g_windowMgr.EnsureWindow(203); - if (g_navigationWindow) { - g_navigationWindow->SendMsg(nullptr, 6, 200, 0, 0, 0); + if (g_windowMgr.window_4F174) { + g_windowMgr.window_4F174->SendMsg(nullptr, 6, 200, 0, 0, 0); } this->UpdateNavigationButtons(); return 0; @@ -796,8 +796,8 @@ int UIRoMapWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argument1, g_navigationMinimized = false; g_navigationManager.sub_B995D0(name, 0, false); if (g_windowMgr.LookupWindow(203)) { - static_cast(g_navigationWindow)->SelectRoute(0); - static_cast(g_navigationWindow)->SelectRouteNode(0); + static_cast(g_windowMgr.window_4F174)->SelectRoute(0); + static_cast(g_windowMgr.window_4F174)->SelectRouteNode(0); } this->UpdateNavigationButtons(); }