diff --git a/Core/GameEngine/CMakeLists.txt b/Core/GameEngine/CMakeLists.txt index d6255c09dee..0f36ff63383 100644 --- a/Core/GameEngine/CMakeLists.txt +++ b/Core/GameEngine/CMakeLists.txt @@ -162,7 +162,7 @@ set(GAMEENGINE_SRC # Include/GameClient/Drawable.h # Include/GameClient/DrawableInfo.h Include/GameClient/DrawGroupInfo.h -# Include/GameClient/EstablishConnectionsMenu.h + Include/GameClient/EstablishConnectionsMenu.h # Include/GameClient/Eva.h Include/GameClient/ExtendedMessageBox.h # Include/GameClient/FontDesc.h @@ -725,7 +725,7 @@ set(GAMEENGINE_SRC Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp # Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp -# Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp + Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp Source/GameClient/GUI/Gadget/GadgetComboBox.cpp Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h b/Core/GameEngine/Include/GameClient/EstablishConnectionsMenu.h similarity index 100% rename from GeneralsMD/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h rename to Core/GameEngine/Include/GameClient/EstablishConnectionsMenu.h diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp b/Core/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp similarity index 100% rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp rename to Core/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp diff --git a/Generals/Code/GameEngine/CMakeLists.txt b/Generals/Code/GameEngine/CMakeLists.txt index c1174f349ff..138424cf0d3 100644 --- a/Generals/Code/GameEngine/CMakeLists.txt +++ b/Generals/Code/GameEngine/CMakeLists.txt @@ -149,7 +149,7 @@ set(GAMEENGINE_SRC Include/GameClient/Drawable.h Include/GameClient/DrawableInfo.h # Include/GameClient/DrawGroupInfo.h - Include/GameClient/EstablishConnectionsMenu.h +# Include/GameClient/EstablishConnectionsMenu.h Include/GameClient/Eva.h # Include/GameClient/ExtendedMessageBox.h Include/GameClient/FontDesc.h @@ -668,7 +668,7 @@ set(GAMEENGINE_SRC # Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp # Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp - Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp +# Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp # Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp # Source/GameClient/GUI/Gadget/GadgetComboBox.cpp # Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp diff --git a/Generals/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h b/Generals/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h deleted file mode 100644 index 50351552e09..00000000000 --- a/Generals/Code/GameEngine/Include/GameClient/EstablishConnectionsMenu.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -//// EstablishConnectionsMenu.h ///////////////////////// - -#include "GameNetwork/NetworkDefs.h" -#include "GameNetwork/NAT.h" - -enum EstablishConnectionsMenuStateType CPP_11(: Int) { - ESTABLISHCONNECTIONSMENUSTATETYPE_SCREENON, - ESTABLISHCONNECTIONSMENUSTATETYPE_SCREENOFF -}; - -class EstablishConnectionsMenu { -public: - EstablishConnectionsMenu(); - virtual ~EstablishConnectionsMenu(); - - void initMenu(); - void endMenu(); - void abortGame(); - - void setPlayerName(Int slot, UnicodeString name); - void setPlayerStatus(Int slot, NATConnectionState state); - -protected: - EstablishConnectionsMenuStateType m_menuState; - - static const char *const m_playerReadyControlNames[MAX_SLOTS]; - static const char *const m_playerNameControlNames[MAX_SLOTS]; - static const char *const m_playerStatusControlNames[MAX_SLOTS]; -}; - -extern EstablishConnectionsMenu *TheEstablishConnectionsMenu; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp deleted file mode 100644 index d981cf37db0..00000000000 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/* -** Command & Conquer Generals(tm) -** Copyright 2025 Electronic Arts Inc. -** -** This program is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program. If not, see . -*/ - -//////////////////////////////////////////////////////////////////////////////// -// // -// (c) 2001-2003 Electronic Arts Inc. // -// // -//////////////////////////////////////////////////////////////////////////////// - -//// EstablishConnectionsMenu.cpp ///////////////////////////////////// - -#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine - -#include "GameClient/GUICallbacks.h" -#include "GameClient/EstablishConnectionsMenu.h" -#include "Common/NameKeyGenerator.h" -#include "GameClient/GameWindow.h" -#include "GameClient/GameWindowManager.h" -#include "GameClient/GadgetStaticText.h" -#include "GameClient/GameText.h" - -EstablishConnectionsMenu *TheEstablishConnectionsMenu = nullptr; - -const char *const EstablishConnectionsMenu::m_playerReadyControlNames[] = { - "EstablishConnectionsScreen.wnd:ButtonAccept1", - "EstablishConnectionsScreen.wnd:ButtonAccept2", - "EstablishConnectionsScreen.wnd:ButtonAccept3", - "EstablishConnectionsScreen.wnd:ButtonAccept4", - "EstablishConnectionsScreen.wnd:ButtonAccept5", - "EstablishConnectionsScreen.wnd:ButtonAccept6", - "EstablishConnectionsScreen.wnd:ButtonAccept7", - nullptr}; - -const char *const EstablishConnectionsMenu::m_playerNameControlNames[] = { - "EstablishConnectionsScreen.wnd:StaticPlayer1Name", - "EstablishConnectionsScreen.wnd:StaticPlayer2Name", - "EstablishConnectionsScreen.wnd:StaticPlayer3Name", - "EstablishConnectionsScreen.wnd:StaticPlayer4Name", - "EstablishConnectionsScreen.wnd:StaticPlayer5Name", - "EstablishConnectionsScreen.wnd:StaticPlayer6Name", - "EstablishConnectionsScreen.wnd:StaticPlayer7Name", - nullptr -}; - -const char *const EstablishConnectionsMenu::m_playerStatusControlNames[] = { - "EstablishConnectionsScreen.wnd:StaticPlayer1Status", - "EstablishConnectionsScreen.wnd:StaticPlayer2Status", - "EstablishConnectionsScreen.wnd:StaticPlayer3Status", - "EstablishConnectionsScreen.wnd:StaticPlayer4Status", - "EstablishConnectionsScreen.wnd:StaticPlayer5Status", - "EstablishConnectionsScreen.wnd:StaticPlayer6Status", - "EstablishConnectionsScreen.wnd:StaticPlayer7Status", - nullptr -}; - -/** - Constructor - */ -EstablishConnectionsMenu::EstablishConnectionsMenu() { -} - -/** - Destructor - */ -EstablishConnectionsMenu::~EstablishConnectionsMenu() { -} - -/** - Initialize the menu - */ -void EstablishConnectionsMenu::initMenu() { - ShowEstablishConnectionsWindow(); -} - -/** - Close down the menu - */ -void EstablishConnectionsMenu::endMenu() { - HideEstablishConnectionsWindow(); -} - -/** - Abort the game gracefully...ok, as gracefully as possible considering - the game was supposed to be started and now for some reason we have to - stop it. Its really sad that this game isn't going to be played - considering how difficult it is to even get a game going in the first - place, especially one with more than two players. - */ -void EstablishConnectionsMenu::abortGame() { -} - -// the slot number passed in is the index we are to use for the menu. -void EstablishConnectionsMenu::setPlayerName(Int slot, UnicodeString name) { - NameKeyType controlID = TheNameKeyGenerator->nameToKey(m_playerNameControlNames[slot]); - GameWindow *control = TheWindowManager->winGetWindowFromId(nullptr, controlID); - - if (control == nullptr) { - DEBUG_ASSERTCRASH(control != nullptr, ("player name control for slot %d is null", slot)); - return; - } - GadgetStaticTextSetText(control, name); -} - -void EstablishConnectionsMenu::setPlayerStatus(Int slot, NATConnectionState state) { - NameKeyType controlID = TheNameKeyGenerator->nameToKey(m_playerStatusControlNames[slot]); - GameWindow *control = TheWindowManager->winGetWindowFromId(nullptr, controlID); - - if (control == nullptr) { - DEBUG_ASSERTCRASH(control != nullptr, ("player status control for slot %d is null", slot)); - return; - } - if (state == NATCONNECTIONSTATE_WAITINGFORMANGLERRESPONSE) { - GadgetStaticTextSetText(control, TheGameText->fetch("GUI:WaitingForManglerResponse")); - } else if (state == NATCONNECTIONSTATE_WAITINGFORMANGLEDPORT) { - GadgetStaticTextSetText(control, TheGameText->fetch("GUI:WaitingForMangledPort")); - } else if (state == NATCONNECTIONSTATE_WAITINGFORRESPONSE) { - GadgetStaticTextSetText(control, TheGameText->fetch("GUI:WaitingForResponse")); - } else if (state == NATCONNECTIONSTATE_DONE) { - GadgetStaticTextSetText(control, TheGameText->fetch("GUI:ConnectionDone")); - } else if (state == NATCONNECTIONSTATE_FAILED) { - GadgetStaticTextSetText(control, TheGameText->fetch("GUI:ConnectionFailed")); - } else if (state == NATCONNECTIONSTATE_WAITINGTOBEGIN) { - GadgetStaticTextSetText(control, TheGameText->fetch("GUI:WaitingToBeginConnection")); - } else { - GadgetStaticTextSetText(control, TheGameText->fetch("GUI:UnknownConnectionState")); - } -} diff --git a/GeneralsMD/Code/GameEngine/CMakeLists.txt b/GeneralsMD/Code/GameEngine/CMakeLists.txt index 4ee63238a57..e5b82e2db38 100644 --- a/GeneralsMD/Code/GameEngine/CMakeLists.txt +++ b/GeneralsMD/Code/GameEngine/CMakeLists.txt @@ -155,7 +155,7 @@ set(GAMEENGINE_SRC Include/GameClient/Drawable.h Include/GameClient/DrawableInfo.h # Include/GameClient/DrawGroupInfo.h - Include/GameClient/EstablishConnectionsMenu.h +# Include/GameClient/EstablishConnectionsMenu.h Include/GameClient/Eva.h # Include/GameClient/ExtendedMessageBox.h Include/GameClient/FontDesc.h @@ -709,7 +709,7 @@ set(GAMEENGINE_SRC # Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp # Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.cpp - Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp +# Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp # Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp # Source/GameClient/GUI/Gadget/GadgetComboBox.cpp # Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp diff --git a/scripts/cpp/unify_move_files.py b/scripts/cpp/unify_move_files.py index 9e45615c370..53fa50a2737 100644 --- a/scripts/cpp/unify_move_files.py +++ b/scripts/cpp/unify_move_files.py @@ -666,6 +666,9 @@ def main(): #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/MessageBox.h", Game.CORE, "GameEngine/Include/GameClient/MessageBox.h") #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp") #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp") + + #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/EstablishConnectionsMenu.h", Game.CORE, "GameEngine/Include/GameClient/EstablishConnectionsMenu.h") + #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp") return