From 2d67a8dfe90599c449e73be7143a042e61ebad82 Mon Sep 17 00:00:00 2001 From: Fernando-A-Rocha Date: Wed, 16 Oct 2024 10:00:04 +0100 Subject: [PATCH] . --- Client/core/CGUI.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Client/core/CGUI.cpp b/Client/core/CGUI.cpp index c4a2729d7a..27d73511a2 100644 --- a/Client/core/CGUI.cpp +++ b/Client/core/CGUI.cpp @@ -56,9 +56,15 @@ CLocalGUI::~CLocalGUI() void CLocalGUI::SetSkin(const char* szName) { + CVector2D consolePos, consoleSize; + bool guiWasLoaded = m_pMainMenu != NULL; if (guiWasLoaded) + { + consolePos = m_pConsole->GetPosition(); + consoleSize = m_pConsole->GetSize(); DestroyWindows(); + } std::string error; @@ -93,7 +99,11 @@ void CLocalGUI::SetSkin(const char* szName) m_LastSettingsRevision = cvars->GetRevision(); if (guiWasLoaded) + { CreateWindows(guiWasLoaded); + m_pConsole->SetPosition(consolePos); + m_pConsole->SetSize(consoleSize); + } if (CCore::GetSingleton().GetConsole() && !error.empty()) CCore::GetSingleton().GetConsole()->Echo(error.c_str()); @@ -104,8 +114,8 @@ void CLocalGUI::ChangeLocale(const char* szName) bool guiWasLoaded = m_pMainMenu != NULL; assert(guiWasLoaded); - CVector2D vPos = m_pConsole->GetPosition(); - CVector2D vSize = m_pConsole->GetSize(); + CVector2D consolePos = m_pConsole->GetPosition(); + CVector2D consoleSize = m_pConsole->GetSize(); if (guiWasLoaded) DestroyWindows(); @@ -122,8 +132,8 @@ void CLocalGUI::ChangeLocale(const char* szName) if (m_pConsole != nullptr) { - m_pConsole->SetPosition(vPos); - m_pConsole->SetSize(vSize); + m_pConsole->SetPosition(consolePos); + m_pConsole->SetSize(consoleSize); } } }