diff --git a/Core/GameEngine/CMakeLists.txt b/Core/GameEngine/CMakeLists.txt
index 5b119043772..3b1adeec1c9 100644
--- a/Core/GameEngine/CMakeLists.txt
+++ b/Core/GameEngine/CMakeLists.txt
@@ -142,7 +142,7 @@ set(GAMEENGINE_SRC
Include/Common/XferLoad.h
Include/Common/XferSave.h
Include/GameClient/Anim2D.h
-# Include/GameClient/AnimateWindowManager.h
+ Include/GameClient/AnimateWindowManager.h
# Include/GameClient/CampaignManager.h
Include/GameClient/ChallengeGenerals.h
Include/GameClient/ClientInstance.h
@@ -150,11 +150,11 @@ set(GAMEENGINE_SRC
Include/GameClient/Color.h
# Include/GameClient/CommandXlat.h
# Include/GameClient/ControlBar.h
-# Include/GameClient/ControlBarResizer.h
+ Include/GameClient/ControlBarResizer.h
# Include/GameClient/ControlBarScheme.h
Include/GameClient/Credits.h
Include/GameClient/DebugDisplay.h
-# Include/GameClient/Diplomacy.h
+ Include/GameClient/Diplomacy.h
# Include/GameClient/DisconnectMenu.h
Include/GameClient/Display.h
Include/GameClient/DisplayString.h
@@ -162,30 +162,30 @@ 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/ExtendedMessageBox.h
# Include/GameClient/FontDesc.h
Include/GameClient/FXList.h
# Include/GameClient/Gadget.h
-# Include/GameClient/GadgetCheckBox.h
-# Include/GameClient/GadgetComboBox.h
-# Include/GameClient/GadgetListBox.h
-# Include/GameClient/GadgetProgressBar.h
-# Include/GameClient/GadgetPushButton.h
-# Include/GameClient/GadgetRadioButton.h
-# Include/GameClient/GadgetSlider.h
-# Include/GameClient/GadgetStaticText.h
-# Include/GameClient/GadgetTabControl.h
-# Include/GameClient/GadgetTextEntry.h
+ Include/GameClient/GadgetCheckBox.h
+ Include/GameClient/GadgetComboBox.h
+ Include/GameClient/GadgetListBox.h
+ Include/GameClient/GadgetProgressBar.h
+ Include/GameClient/GadgetPushButton.h
+ Include/GameClient/GadgetRadioButton.h
+ Include/GameClient/GadgetSlider.h
+ Include/GameClient/GadgetStaticText.h
+ Include/GameClient/GadgetTabControl.h
+ Include/GameClient/GadgetTextEntry.h
# Include/GameClient/GameClient.h
Include/GameClient/GameFont.h
# Include/GameClient/GameInfoWindow.h
Include/GameClient/GameText.h
Include/GameClient/GameWindow.h
Include/GameClient/GameWindowGlobal.h
-# Include/GameClient/GameWindowID.h
-# Include/GameClient/GameWindowManager.h
+ Include/GameClient/GameWindowID.h
+ Include/GameClient/GameWindowManager.h
Include/GameClient/GameWindowTransitions.h
Include/GameClient/GlobalLanguage.h
Include/GameClient/GraphDraw.h
@@ -193,7 +193,7 @@ set(GAMEENGINE_SRC
# Include/GameClient/GUICommandTranslator.h
Include/GameClient/HeaderTemplate.h
# Include/GameClient/HintSpy.h
-# Include/GameClient/HotKey.h
+ Include/GameClient/HotKey.h
Include/GameClient/Image.h
Include/GameClient/IMEManager.h
# Include/GameClient/InGameUI.h
@@ -204,7 +204,7 @@ set(GAMEENGINE_SRC
Include/GameClient/LoadScreen.h
# Include/GameClient/LookAtXlat.h
Include/GameClient/MapUtil.h
-# Include/GameClient/MessageBox.h
+ Include/GameClient/MessageBox.h
# Include/GameClient/MetaEvent.h
Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h
Include/GameClient/Module/BeaconClientUpdate.h
@@ -219,9 +219,9 @@ set(GAMEENGINE_SRC
Include/GameClient/SelectionInfo.h
# Include/GameClient/SelectionXlat.h
# Include/GameClient/Shadow.h
-# Include/GameClient/Shell.h
-# Include/GameClient/ShellHooks.h
-# Include/GameClient/ShellMenuScheme.h
+ Include/GameClient/Shell.h
+ Include/GameClient/ShellHooks.h
+ Include/GameClient/ShellMenuScheme.h
Include/GameClient/Smudge.h
Include/GameClient/Snow.h
Include/GameClient/Statistics.h
@@ -705,101 +705,101 @@ set(GAMEENGINE_SRC
# Source/GameClient/Eva.cpp
Source/GameClient/FXList.cpp
# Source/GameClient/GameClient.cpp
-# Source/GameClient/GameClientDispatch.cpp
+ Source/GameClient/GameClientDispatch.cpp
Source/GameClient/GameText.cpp
Source/GameClient/GlobalLanguage.cpp
Source/GameClient/GraphDraw.cpp
-# Source/GameClient/GUI/AnimateWindowManager.cpp
+ Source/GameClient/GUI/AnimateWindowManager.cpp
Source/GameClient/GUI/ChallengeGenerals.cpp
# Source/GameClient/GUI/ControlBar/ControlBar.cpp
# Source/GameClient/GUI/ControlBar/ControlBarBeacon.cpp
# Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp
# Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp
-# Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp
-# Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp
+ Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp
+ Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp
# Source/GameClient/GUI/ControlBar/ControlBarOCLTimer.cpp
-# Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp
-# Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp
+ Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp
+ Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp
# Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp
# Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp
-# Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp
+ Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp
# Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.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
-# Source/GameClient/GUI/Gadget/GadgetListBox.cpp
-# Source/GameClient/GUI/Gadget/GadgetProgressBar.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
+ Source/GameClient/GUI/Gadget/GadgetListBox.cpp
+ Source/GameClient/GUI/Gadget/GadgetProgressBar.cpp
# Source/GameClient/GUI/Gadget/GadgetPushButton.cpp
-# Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp
-# Source/GameClient/GUI/Gadget/GadgetStaticText.cpp
-# Source/GameClient/GUI/Gadget/GadgetTabControl.cpp
-# Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp
-# Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp
+ Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp
+ Source/GameClient/GUI/Gadget/GadgetStaticText.cpp
+ Source/GameClient/GUI/Gadget/GadgetTabControl.cpp
+ Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp
+ Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp
Source/GameClient/GUI/GameFont.cpp
Source/GameClient/GUI/GameWindow.cpp
Source/GameClient/GUI/GameWindowGlobal.cpp
-# Source/GameClient/GUI/GameWindowManager.cpp
+ Source/GameClient/GUI/GameWindowManager.cpp
# Source/GameClient/GUI/GameWindowManagerScript.cpp
Source/GameClient/GUI/GameWindowTransitions.cpp
# Source/GameClient/GUI/GameWindowTransitionsStyles.cpp
# Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp
# Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp
-# Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp
-# Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp
+ Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp
+ Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp
# Source/GameClient/GUI/GUICallbacks/GeneralsExpPoints.cpp
# Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp
-# Source/GameClient/GUI/GUICallbacks/InGameChat.cpp
-# Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp
+ Source/GameClient/GUI/GUICallbacks/InGameChat.cpp
+ Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/ChallengeMenu.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/DisconnectWindow.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/EstablishConnectionsWindow.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/EstablishConnectionsWindow.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/MapSelectMenu.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/PopupHostGame.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/SkirmishMapSelectMenu.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/WOLLocaleSelectPopup.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/WOLLocaleSelectPopup.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/WOLMapSelectMenu.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp
-# Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp
+ Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp
# Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp
-# Source/GameClient/GUI/GUICallbacks/MessageBox.cpp
-# Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp
+ Source/GameClient/GUI/GUICallbacks/MessageBox.cpp
+ Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp
Source/GameClient/GUI/HeaderTemplate.cpp
Source/GameClient/GUI/IMEManager.cpp
Source/GameClient/GUI/LoadScreen.cpp
Source/GameClient/GUI/ProcessAnimateWindow.cpp
# Source/GameClient/GUI/Shell/Shell.cpp
-# Source/GameClient/GUI/Shell/ShellMenuScheme.cpp
+ Source/GameClient/GUI/Shell/ShellMenuScheme.cpp
Source/GameClient/GUI/WindowLayout.cpp
Source/GameClient/GUI/WindowVideoManager.cpp
Source/GameClient/GUI/WinInstanceData.cpp
@@ -812,7 +812,7 @@ set(GAMEENGINE_SRC
# Source/GameClient/MessageStream/CommandXlat.cpp
# Source/GameClient/MessageStream/GUICommandTranslator.cpp
# Source/GameClient/MessageStream/HintSpy.cpp
-# Source/GameClient/MessageStream/HotKey.cpp
+ Source/GameClient/MessageStream/HotKey.cpp
# Source/GameClient/MessageStream/LookAtXlat.cpp
# Source/GameClient/MessageStream/MetaEvent.cpp
# Source/GameClient/MessageStream/PlaceEventTranslator.cpp
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/AnimateWindowManager.h b/Core/GameEngine/Include/GameClient/AnimateWindowManager.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/AnimateWindowManager.h
rename to Core/GameEngine/Include/GameClient/AnimateWindowManager.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBarResizer.h b/Core/GameEngine/Include/GameClient/ControlBarResizer.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/ControlBarResizer.h
rename to Core/GameEngine/Include/GameClient/ControlBarResizer.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Diplomacy.h b/Core/GameEngine/Include/GameClient/Diplomacy.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/Diplomacy.h
rename to Core/GameEngine/Include/GameClient/Diplomacy.h
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/Include/GameClient/ExtendedMessageBox.h b/Core/GameEngine/Include/GameClient/ExtendedMessageBox.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/ExtendedMessageBox.h
rename to Core/GameEngine/Include/GameClient/ExtendedMessageBox.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GadgetCheckBox.h b/Core/GameEngine/Include/GameClient/GadgetCheckBox.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/GadgetCheckBox.h
rename to Core/GameEngine/Include/GameClient/GadgetCheckBox.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GadgetComboBox.h b/Core/GameEngine/Include/GameClient/GadgetComboBox.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/GadgetComboBox.h
rename to Core/GameEngine/Include/GameClient/GadgetComboBox.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GadgetListBox.h b/Core/GameEngine/Include/GameClient/GadgetListBox.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/GadgetListBox.h
rename to Core/GameEngine/Include/GameClient/GadgetListBox.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GadgetProgressBar.h b/Core/GameEngine/Include/GameClient/GadgetProgressBar.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/GadgetProgressBar.h
rename to Core/GameEngine/Include/GameClient/GadgetProgressBar.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GadgetPushButton.h b/Core/GameEngine/Include/GameClient/GadgetPushButton.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/GadgetPushButton.h
rename to Core/GameEngine/Include/GameClient/GadgetPushButton.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GadgetRadioButton.h b/Core/GameEngine/Include/GameClient/GadgetRadioButton.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/GadgetRadioButton.h
rename to Core/GameEngine/Include/GameClient/GadgetRadioButton.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GadgetSlider.h b/Core/GameEngine/Include/GameClient/GadgetSlider.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/GadgetSlider.h
rename to Core/GameEngine/Include/GameClient/GadgetSlider.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GadgetStaticText.h b/Core/GameEngine/Include/GameClient/GadgetStaticText.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/GadgetStaticText.h
rename to Core/GameEngine/Include/GameClient/GadgetStaticText.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GadgetTabControl.h b/Core/GameEngine/Include/GameClient/GadgetTabControl.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/GadgetTabControl.h
rename to Core/GameEngine/Include/GameClient/GadgetTabControl.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GadgetTextEntry.h b/Core/GameEngine/Include/GameClient/GadgetTextEntry.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/GadgetTextEntry.h
rename to Core/GameEngine/Include/GameClient/GadgetTextEntry.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GameWindowID.h b/Core/GameEngine/Include/GameClient/GameWindowID.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/GameWindowID.h
rename to Core/GameEngine/Include/GameClient/GameWindowID.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GameWindowManager.h b/Core/GameEngine/Include/GameClient/GameWindowManager.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/GameWindowManager.h
rename to Core/GameEngine/Include/GameClient/GameWindowManager.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/HotKey.h b/Core/GameEngine/Include/GameClient/HotKey.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/HotKey.h
rename to Core/GameEngine/Include/GameClient/HotKey.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/MessageBox.h b/Core/GameEngine/Include/GameClient/MessageBox.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/MessageBox.h
rename to Core/GameEngine/Include/GameClient/MessageBox.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Shell.h b/Core/GameEngine/Include/GameClient/Shell.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/Shell.h
rename to Core/GameEngine/Include/GameClient/Shell.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ShellHooks.h b/Core/GameEngine/Include/GameClient/ShellHooks.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/ShellHooks.h
rename to Core/GameEngine/Include/GameClient/ShellHooks.h
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ShellMenuScheme.h b/Core/GameEngine/Include/GameClient/ShellMenuScheme.h
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Include/GameClient/ShellMenuScheme.h
rename to Core/GameEngine/Include/GameClient/ShellMenuScheme.h
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/AnimateWindowManager.cpp b/Core/GameEngine/Source/GameClient/GUI/AnimateWindowManager.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/AnimateWindowManager.cpp
rename to Core/GameEngine/Source/GameClient/GUI/AnimateWindowManager.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp b/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp
rename to Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp b/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp
rename to Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp b/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp
rename to Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp b/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp
rename to Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp b/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp
rename to Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp
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/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGameChat.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/InGameChat.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGameChat.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/InGameChat.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/EstablishConnectionsWindow.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/EstablishConnectionsWindow.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/EstablishConnectionsWindow.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/EstablishConnectionsWindow.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLocaleSelectPopup.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLocaleSelectPopup.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLocaleSelectPopup.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLocaleSelectPopup.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp b/Core/GameEngine/Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp b/Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp
rename to Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetComboBox.cpp b/Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetComboBox.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetComboBox.cpp
rename to Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetComboBox.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp b/Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp
rename to Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp b/Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp
rename to Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetProgressBar.cpp b/Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetProgressBar.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetProgressBar.cpp
rename to Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetProgressBar.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp b/Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp
rename to Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetStaticText.cpp b/Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetStaticText.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetStaticText.cpp
rename to Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetStaticText.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTabControl.cpp b/Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetTabControl.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTabControl.cpp
rename to Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetTabControl.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp b/Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp
rename to Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp b/Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp
rename to Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp b/Core/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp
rename to Core/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp b/Core/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp
rename to Core/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GameClientDispatch.cpp b/Core/GameEngine/Source/GameClient/GameClientDispatch.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/GameClientDispatch.cpp
rename to Core/GameEngine/Source/GameClient/GameClientDispatch.cpp
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp b/Core/GameEngine/Source/GameClient/MessageStream/HotKey.cpp
similarity index 100%
rename from GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp
rename to Core/GameEngine/Source/GameClient/MessageStream/HotKey.cpp
diff --git a/Generals/Code/GameEngine/CMakeLists.txt b/Generals/Code/GameEngine/CMakeLists.txt
index 539e7711fa1..5d2443370d9 100644
--- a/Generals/Code/GameEngine/CMakeLists.txt
+++ b/Generals/Code/GameEngine/CMakeLists.txt
@@ -129,7 +129,7 @@ set(GAMEENGINE_SRC
# Include/Common/XferLoad.h
# Include/Common/XferSave.h
# Include/GameClient/Anim2D.h
- Include/GameClient/AnimateWindowManager.h
+# Include/GameClient/AnimateWindowManager.h
# Include/GameClient/ChallengeGenerals.h
Include/GameClient/CampaignManager.h
# Include/GameClient/ClientInstance.h
@@ -137,11 +137,11 @@ set(GAMEENGINE_SRC
# Include/GameClient/Color.h
Include/GameClient/CommandXlat.h
Include/GameClient/ControlBar.h
- Include/GameClient/ControlBarResizer.h
+# Include/GameClient/ControlBarResizer.h
Include/GameClient/ControlBarScheme.h
# Include/GameClient/Credits.h
# Include/GameClient/DebugDisplay.h
- Include/GameClient/Diplomacy.h
+# Include/GameClient/Diplomacy.h
Include/GameClient/DisconnectMenu.h
# Include/GameClient/Display.h
# Include/GameClient/DisplayString.h
@@ -149,30 +149,30 @@ 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/ExtendedMessageBox.h
Include/GameClient/FontDesc.h
# Include/GameClient/FXList.h
Include/GameClient/Gadget.h
- Include/GameClient/GadgetCheckBox.h
- Include/GameClient/GadgetComboBox.h
- Include/GameClient/GadgetListBox.h
- Include/GameClient/GadgetProgressBar.h
- Include/GameClient/GadgetPushButton.h
- Include/GameClient/GadgetRadioButton.h
- Include/GameClient/GadgetSlider.h
- Include/GameClient/GadgetStaticText.h
- Include/GameClient/GadgetTabControl.h
- Include/GameClient/GadgetTextEntry.h
+# Include/GameClient/GadgetCheckBox.h
+# Include/GameClient/GadgetComboBox.h
+# Include/GameClient/GadgetListBox.h
+# Include/GameClient/GadgetProgressBar.h
+# Include/GameClient/GadgetPushButton.h
+# Include/GameClient/GadgetRadioButton.h
+# Include/GameClient/GadgetSlider.h
+# Include/GameClient/GadgetStaticText.h
+# Include/GameClient/GadgetTabControl.h
+# Include/GameClient/GadgetTextEntry.h
Include/GameClient/GameClient.h
# Include/GameClient/GameFont.h
Include/GameClient/GameInfoWindow.h
# Include/GameClient/GameText.h
# Include/GameClient/GameWindow.h
# Include/GameClient/GameWindowGlobal.h
- Include/GameClient/GameWindowID.h
- Include/GameClient/GameWindowManager.h
+# Include/GameClient/GameWindowID.h
+# Include/GameClient/GameWindowManager.h
# Include/GameClient/GameWindowTransitions.h
# Include/GameClient/GlobalLanguage.h
# Include/GameClient/GraphDraw.h
@@ -180,7 +180,7 @@ set(GAMEENGINE_SRC
Include/GameClient/GUICommandTranslator.h
# Include/GameClient/HeaderTemplate.h
Include/GameClient/HintSpy.h
- Include/GameClient/HotKey.h
+# Include/GameClient/HotKey.h
# Include/GameClient/Image.h
# Include/GameClient/IMEManager.h
Include/GameClient/InGameUI.h
@@ -191,7 +191,7 @@ set(GAMEENGINE_SRC
# Include/GameClient/LoadScreen.h
Include/GameClient/LookAtXlat.h
# Include/GameClient/MapUtil.h
- Include/GameClient/MessageBox.h
+# Include/GameClient/MessageBox.h
Include/GameClient/MetaEvent.h
# Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h
# Include/GameClient/Module/BeaconClientUpdate.h
@@ -205,9 +205,9 @@ set(GAMEENGINE_SRC
# Include/GameClient/SelectionInfo.h
Include/GameClient/SelectionXlat.h
Include/GameClient/Shadow.h
- Include/GameClient/Shell.h
- Include/GameClient/ShellHooks.h
- Include/GameClient/ShellMenuScheme.h
+# Include/GameClient/Shell.h
+# Include/GameClient/ShellHooks.h
+# Include/GameClient/ShellMenuScheme.h
# Include/GameClient/Statistics.h
# Include/GameClient/TerrainRoads.h
# Include/GameClient/TerrainVisual.h
@@ -649,100 +649,100 @@ set(GAMEENGINE_SRC
Source/GameClient/Eva.cpp
# Source/GameClient/FXList.cpp
Source/GameClient/GameClient.cpp
- Source/GameClient/GameClientDispatch.cpp
+# Source/GameClient/GameClientDispatch.cpp
# Source/GameClient/GameText.cpp
# Source/GameClient/GlobalLanguage.cpp
# Source/GameClient/GraphDraw.cpp
- Source/GameClient/GUI/AnimateWindowManager.cpp
+# Source/GameClient/GUI/AnimateWindowManager.cpp
# Source/GameClient/GUI/ChallengeGenerals.cpp
Source/GameClient/GUI/ControlBar/ControlBar.cpp
Source/GameClient/GUI/ControlBar/ControlBarBeacon.cpp
Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp
Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp
- Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp
- Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp
+# Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp
+# Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp
Source/GameClient/GUI/ControlBar/ControlBarOCLTimer.cpp
- Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp
- Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp
+# Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp
+# Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp
Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp
Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp
- Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp
+# Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp
Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.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
- Source/GameClient/GUI/Gadget/GadgetListBox.cpp
- Source/GameClient/GUI/Gadget/GadgetProgressBar.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
+# Source/GameClient/GUI/Gadget/GadgetListBox.cpp
+# Source/GameClient/GUI/Gadget/GadgetProgressBar.cpp
Source/GameClient/GUI/Gadget/GadgetPushButton.cpp
- Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp
- Source/GameClient/GUI/Gadget/GadgetStaticText.cpp
- Source/GameClient/GUI/Gadget/GadgetTabControl.cpp
- Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp
- Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp
+# Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp
+# Source/GameClient/GUI/Gadget/GadgetStaticText.cpp
+# Source/GameClient/GUI/Gadget/GadgetTabControl.cpp
+# Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp
+# Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp
# Source/GameClient/GUI/GameFont.cpp
# Source/GameClient/GUI/GameWindow.cpp
# Source/GameClient/GUI/GameWindowGlobal.cpp
- Source/GameClient/GUI/GameWindowManager.cpp
+# Source/GameClient/GUI/GameWindowManager.cpp
Source/GameClient/GUI/GameWindowManagerScript.cpp
# Source/GameClient/GUI/GameWindowTransitions.cpp
Source/GameClient/GUI/GameWindowTransitionsStyles.cpp
Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp
Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp
- Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp
- Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp
+# Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp
+# Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp
Source/GameClient/GUI/GUICallbacks/GeneralsExpPoints.cpp
Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp
- Source/GameClient/GUI/GUICallbacks/InGameChat.cpp
- Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp
+# Source/GameClient/GUI/GUICallbacks/InGameChat.cpp
+# Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp
Source/GameClient/GUI/GUICallbacks/Menus/DisconnectWindow.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/EstablishConnectionsWindow.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/EstablishConnectionsWindow.cpp
Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp
Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp
Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp
Source/GameClient/GUI/GUICallbacks/Menus/MapSelectMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp
Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp
Source/GameClient/GUI/GUICallbacks/Menus/PopupHostGame.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp
Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp
Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp
Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp
Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp
Source/GameClient/GUI/GUICallbacks/Menus/SkirmishMapSelectMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp
Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp
Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/WOLLocaleSelectPopup.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/WOLLocaleSelectPopup.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp
Source/GameClient/GUI/GUICallbacks/Menus/WOLMapSelectMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp
Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp
Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp
- Source/GameClient/GUI/GUICallbacks/MessageBox.cpp
- Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp
+# Source/GameClient/GUI/GUICallbacks/MessageBox.cpp
+# Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp
# Source/GameClient/GUI/HeaderTemplate.cpp
# Source/GameClient/GUI/IMEManager.cpp
# Source/GameClient/GUI/LoadScreen.cpp
# Source/GameClient/GUI/ProcessAnimateWindow.cpp
Source/GameClient/GUI/Shell/Shell.cpp
- Source/GameClient/GUI/Shell/ShellMenuScheme.cpp
+# Source/GameClient/GUI/Shell/ShellMenuScheme.cpp
# Source/GameClient/GUI/WindowLayout.cpp
# Source/GameClient/GUI/WindowVideoManager.cpp
# Source/GameClient/GUI/WinInstanceData.cpp
@@ -755,7 +755,7 @@ set(GAMEENGINE_SRC
Source/GameClient/MessageStream/CommandXlat.cpp
Source/GameClient/MessageStream/GUICommandTranslator.cpp
Source/GameClient/MessageStream/HintSpy.cpp
- Source/GameClient/MessageStream/HotKey.cpp
+# Source/GameClient/MessageStream/HotKey.cpp
Source/GameClient/MessageStream/LookAtXlat.cpp
Source/GameClient/MessageStream/MetaEvent.cpp
Source/GameClient/MessageStream/PlaceEventTranslator.cpp
diff --git a/Generals/Code/GameEngine/Include/GameClient/AnimateWindowManager.h b/Generals/Code/GameEngine/Include/GameClient/AnimateWindowManager.h
deleted file mode 100644
index aad9e80b7a2..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/AnimateWindowManager.h
+++ /dev/null
@@ -1,235 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: AnimateWindowManager.h /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Mar 2002
-//
-// Filename: AnimateWindowManager.h
-//
-// author: Chris Huybregts
-//
-// purpose: The Animate Window class will be used by registering a window with
-// the manager with stating what kind of animation to do. Then on every
-// update, we'll move the windows.
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "Lib/BaseType.h"
-#include "Common/SubsystemInterface.h"
-#include "Common/GameMemory.h"
-
-//-----------------------------------------------------------------------------
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-class GameWindow;
-class ProcessAnimateWindowSlideFromBottom;
-class ProcessAnimateWindowSlideFromBottomTimed;
-class ProcessAnimateWindowSlideFromTop;
-class ProcessAnimateWindowSlideFromLeft;
-class ProcessAnimateWindowSlideFromRight;
-class ProcessAnimateWindowSlideFromRightFast;
-class ProcessAnimateWindowSpiral;
-class ProcessAnimateWindowSlideFromTopFast;
-class ProcessAnimateWindowSideSelect;
-class ProcessAnimateWindow;
-
-//-----------------------------------------------------------------------------
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-enum AnimTypes CPP_11(: Int)
-{
- WIN_ANIMATION_NONE = 0,
- WIN_ANIMATION_SLIDE_RIGHT,
- WIN_ANIMATION_SLIDE_RIGHT_FAST,
- WIN_ANIMATION_SLIDE_LEFT,
- WIN_ANIMATION_SLIDE_TOP,
- WIN_ANIMATION_SLIDE_BOTTOM,
- WIN_ANIMATION_SPIRAL,
- WIN_ANIMATION_SLIDE_BOTTOM_TIMED,
- WIN_ANIMATION_SLIDE_TOP_FAST,
- WIN_ANIMATION_COUNT
-} ;
-
-//-----------------------------------------------------------------------------
-// TheSuperHackers @build xezon 14/03/2025 Puts class into namespace to avoid name collision with AnimateWindow function in WinUser.h
-namespace wnd
-{
-class AnimateWindow : public MemoryPoolObject
-{
- MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(AnimateWindow, "AnimateWindow")
-public:
- AnimateWindow();
- //~AnimateWindow();
-
- static AnimateWindow* createNewInstance()
- {
- return newInstance(AnimateWindow);
- }
-
- void setAnimData( ICoord2D startPos, ICoord2D endPos, ICoord2D curPos, ICoord2D restPos, Coord2D vel, UnsignedInt startTime, UnsignedInt endTime);
-
- ICoord2D getStartPos(); ///< Get the Start Position 2D coord
- ICoord2D getCurPos(); ///< Get the Current Position 2D coord
- ICoord2D getEndPos(); ///< Get the End Position 2D coord
- ICoord2D getRestPos(); ///< Get the Rest Position 2D coord
- GameWindow *getGameWindow(); ///< Get the GameWindow that will be animating
- AnimTypes getAnimType(); ///< Get the Animation type
- UnsignedInt getDelay(); ///< Get the Time Delay
- Coord2D getVel(); ///< Get the Velocity Position 2D coord
- UnsignedInt getStartTime(); ///< Get the start time of the time-based anim
- UnsignedInt getEndTime(); ///< Get the end time of the time-based anim
-
- void setStartPos( ICoord2D starPos); ///< Set the Start Position 2D coord
- void setCurPos( ICoord2D curPos); ///< Set the Current Position 2D coord
- void setEndPos( ICoord2D endPos); ///< Set the End Position 2D coord
- void setRestPos( ICoord2D restPos); ///< Set the Rest Position 2D coord
- void setGameWindow( GameWindow *win); ///< Set the GameWindow that will be animating
- void setAnimType( AnimTypes animType); ///< Set the Animation type
- void setDelay( UnsignedInt delay); ///< Set the Time Delay
- void setVel( Coord2D vel); ///< Set the Velocity Position 2D coord
- void setStartTime( UnsignedInt t); ///< Set the start time of the time-based anim
- void setEndTime( UnsignedInt t); ///< Set the end time of the time-based anim
-
- void setFinished(Bool finished); ///< Set if the animation has finished
- Bool isFinished(); ///< Return if the animation has finished or not.
- void setNeedsToFinish( Bool needsToFinish); ///< set if we need this animation to finish for the manager to return true
- Bool needsToFinish(); ///< set if the animation has finished
-
-private:
- UnsignedInt m_delay; ///< Holds the delay time in which the animation will start (in milliseconds)
- ICoord2D m_startPos; ///< Holds the starting position of the animation
- ///<(usually is also the end position of the animation when the animation is reversed)
- ICoord2D m_endPos; ///< Holds the target End Position (usually is the same as the rest position)
- ICoord2D m_curPos; ///< It's Current Position
- ICoord2D m_restPos; ///< When the Manager Resets, It sets the window's position to this position
- GameWindow *m_win; ///< the window that this animation is happening on
- Coord2D m_vel; ///< the Velocity of the animation
- UnsignedInt m_startTime; ///< time we started the time-based anim
- UnsignedInt m_endTime; ///< time we should end the time-based anim
- AnimTypes m_animType; ///< The type of animation that will happen
- Bool m_needsToFinish; ///< Flag to tell the manager if we need to finish before it's done with it's animation
- Bool m_isFinished; ///< We're finished
-};
-} // namespace wnd
-
-
-
-//-----------------------------------------------------------------------------
-typedef std::list AnimateWindowList;
-
-//-----------------------------------------------------------------------------
-class AnimateWindowManager : public SubsystemInterface
-{
-public:
- AnimateWindowManager();
- virtual ~AnimateWindowManager() override;
-
- // Inhertited from subsystem ====================================================================
- virtual void init() override;
- virtual void reset() override;
- virtual void update() override;
- //===============================================================================================
-
- void registerGameWindow(GameWindow *win, AnimTypes animType, Bool needsToFinish, UnsignedInt ms = 0, UnsignedInt delayMs = 0); // Registers a new window to animate.
- Bool isFinished(); ///< Are all the animations that need to be finished, finished?
- void reverseAnimateWindow(); ///< tell each animation type to setup the windows to run in reverse
- void resetToRestPosition(); ///< Reset all windows to their rest position
- Bool isReversed(); ///< Returns whether or not we're in our reversed state.
- Bool isEmpty();
-private:
- AnimateWindowList m_winList; ///< A list of AnimationWindows that we don't care if their finished animating
- AnimateWindowList m_winMustFinishList; ///< A list of AnimationWindows that we do care about
- Bool m_needsUpdate; ///< If we're done animating all our monitored windows, then this will be false
- Bool m_reverse; ///< Are we in a reverse state?
- ProcessAnimateWindowSlideFromRight *m_slideFromRight; ///< Holds the process in which the windows slide from the right
- ProcessAnimateWindowSlideFromRightFast *m_slideFromRightFast;
- ProcessAnimateWindowSlideFromTop *m_slideFromTop; ///< Holds the process in which the windows slide from the Top
- ProcessAnimateWindowSlideFromLeft *m_slideFromLeft; ///< Holds the process in which the windows slide from the Left
- ProcessAnimateWindowSlideFromBottom *m_slideFromBottom; ///< Holds the process in which the windows slide from the Bottom
- ProcessAnimateWindowSpiral *m_spiral; ///< Holds the process in which the windows Spiral onto the screen
- ProcessAnimateWindowSlideFromBottomTimed *m_slideFromBottomTimed; ///< Holds the process in which the windows slide from the Bottom in a time-based fashion
- ProcessAnimateWindowSlideFromTopFast *m_slideFromTopFast; ///< holds the process in wich the windows slide from the top,fast
- ProcessAnimateWindow *getProcessAnimate( AnimTypes animType); ///< returns the process for the kind of animation we need.
-
-};
-
-//-----------------------------------------------------------------------------
-// INLINING ///////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-namespace wnd
-{
- inline ICoord2D AnimateWindow::getStartPos() { return m_startPos; };
- inline ICoord2D AnimateWindow::getCurPos() { return m_curPos; };
- inline ICoord2D AnimateWindow::getEndPos() { return m_endPos; };
- inline ICoord2D AnimateWindow::getRestPos() { return m_restPos; };
- inline GameWindow *AnimateWindow::getGameWindow(){ return m_win; };
- inline AnimTypes AnimateWindow::getAnimType() { return m_animType; };
- inline UnsignedInt AnimateWindow::getDelay() { return m_delay; };
- inline Coord2D AnimateWindow::getVel() { return m_vel; };
- inline UnsignedInt AnimateWindow::getStartTime() { return m_startTime; };
- inline UnsignedInt AnimateWindow::getEndTime() { return m_endTime; };
-
- inline void AnimateWindow::setStartPos( ICoord2D startPos) { m_startPos = startPos; };
- inline void AnimateWindow::setCurPos( ICoord2D curPos) { m_curPos = curPos; };
- inline void AnimateWindow::setEndPos( ICoord2D endPos) { m_endPos = endPos; };
- inline void AnimateWindow::setRestPos( ICoord2D restPos) { m_restPos = restPos; };
- inline void AnimateWindow::setGameWindow( GameWindow *win) { m_win = win; };
- inline void AnimateWindow::setAnimType( AnimTypes animType) { m_animType = animType; };
- inline void AnimateWindow::setDelay( UnsignedInt delay) { m_delay = delay; };
- inline void AnimateWindow::setVel( Coord2D vel) { m_vel = vel; };
- inline void AnimateWindow::setStartTime( UnsignedInt t ) { m_startTime = t; }
- inline void AnimateWindow::setEndTime( UnsignedInt t ) { m_endTime = t; }
-
- inline void AnimateWindow::setFinished( Bool finished) { m_isFinished = finished; };
- inline Bool AnimateWindow::isFinished() { return m_isFinished; };
- inline void AnimateWindow::setNeedsToFinish( Bool needsToFinish) { m_needsToFinish = needsToFinish; };
- inline Bool AnimateWindow::needsToFinish() { return m_needsToFinish; };
-} // namespace wnd
-
- inline Bool AnimateWindowManager::isFinished() { return !m_needsUpdate; };
- inline Bool AnimateWindowManager::isReversed() { return m_reverse; };
- inline Bool AnimateWindowManager::isEmpty(){return (m_winList.empty() && m_winMustFinishList.empty()); }
-//-----------------------------------------------------------------------------
-// EXTERNALS //////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
diff --git a/Generals/Code/GameEngine/Include/GameClient/ControlBarResizer.h b/Generals/Code/GameEngine/Include/GameClient/ControlBarResizer.h
deleted file mode 100644
index 8617d7da0e8..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/ControlBarResizer.h
+++ /dev/null
@@ -1,102 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: ControlBarResizer.h /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Sep 2002
-//
-// Filename: ControlBarResizer.h
-//
-// author: Chris Huybregts
-//
-// purpose:
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-class ResizerWindow
-{
-public:
-ResizerWindow();
- AsciiString m_name;
- ICoord2D m_defaultSize;
- ICoord2D m_defaultPos;
- ICoord2D m_altSize;
- ICoord2D m_altPos;
-};
-
-class ControlBarResizer
-{
-public:
- ControlBarResizer();
- ~ControlBarResizer();
-
- void init();
-
- // parse Functions for the INI file
- const FieldParse *getFieldParse() const { return m_controlBarResizerParseTable; } ///< returns the parsing fields
- static const FieldParse m_controlBarResizerParseTable[]; ///< the parse table
-
- ResizerWindow *findResizerWindow( AsciiString name ); ///< attempt to find the control bar scheme by it's name
- ResizerWindow *newResizerWindow( AsciiString name ); ///< create a new control bar scheme and return it.
-
- void sizeWindowsDefault();
- void sizeWindowsAlt();
-
- typedef std::list< ResizerWindow *> ResizerWindowList;
- ResizerWindowList m_resizerWindowsList;
-
-};
-//-----------------------------------------------------------------------------
-// INLINING ///////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// EXTERNALS //////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
diff --git a/Generals/Code/GameEngine/Include/GameClient/Diplomacy.h b/Generals/Code/GameEngine/Include/GameClient/Diplomacy.h
deleted file mode 100644
index 7f2aa04f987..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/Diplomacy.h
+++ /dev/null
@@ -1,35 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: Diplomacy.h /////////////////////////////////////////////////////////////////////////////
-// Author: Matthew D. Campbell, Sept 2002
-//////////////////////////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-void PopulateInGameDiplomacyPopup();
-void UpdateDiplomacyBriefingText(AsciiString newText, Bool clear);
-
-typedef std::list BriefingList;
-BriefingList* GetBriefingTextList();
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/Include/GameClient/ExtendedMessageBox.h b/Generals/Code/GameEngine/Include/GameClient/ExtendedMessageBox.h
deleted file mode 100644
index 25c13a718f8..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/ExtendedMessageBox.h
+++ /dev/null
@@ -1,69 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: ExtendedMessageBox.h /////////////////////////////////////////////////////////////////////
-// Author: Matt Campbell, January 2003
-// Description: We go quiet in 1 day, gold in 15. Poor time to rewrite message boxes, so
-// we get this file instead. Phooey.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-#include "GameClient/GameWindowManager.h"
-
-// return codes for message box callbacks
-enum MessageBoxReturnType CPP_11(: Int) {
- MB_RETURN_CLOSE,
- MB_RETURN_KEEPOPEN
-};
-
-typedef MessageBoxReturnType (* MessageBoxFunc)( void *userData );
-
-// WindowExMessageBoxData ---------------------------------------------------------
-/** Data attached to each extended Message box window */
-//-----------------------------------------------------------------------------
-struct WindowExMessageBoxData
-{
- MessageBoxFunc yesCallback; ///.
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (c) 2001-2003 Electronic Arts Inc. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GadgetCheckBox.h /////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: GadgetCheckBox.h
-//
-// Created: Colin Day, June 2001
-//
-// Desc: Helpful interface for checkboxes
-//
-// CheckBox IMAGE/COLOR organization
-// When control is enabled:
-// enabledDrawData[ 0 ] is the background image for the whole enabled control
-// enabledDrawData[ 1 ] is the enabled, unselected check box
-// enabledDrawData[ 2 ] is the enabled, selected check box
-//
-// When control is disabled:
-// disabledDrawData[ 0 ] is the background image for the whole disabled control
-// disabledDrawData[ 1 ] is the disabled, unselected check box
-// disabledDrawData[ 2 ] si the disabled, selected check box
-//
-// When control is hilited (mouse over it and enabled)
-// hiliteDrawData[ 0 ] is the background image for the whole hilited control
-// hiliteDrawData[ 1 ] is the hilited, unselected check box
-// hiliteDrawData[ 2 ] is the hilited, selected check box
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "GameClient/GameWindow.h"
-
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// INLINING ///////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-extern void GadgetCheckBoxSetText( GameWindow *g, UnicodeString text );
-extern Bool GadgetCheckBoxIsChecked( GameWindow *g );
-extern void GadgetCheckBoxSetChecked( GameWindow *g, Bool isChecked);
-extern void GadgetCheckBoxToggle( GameWindow *g);
-
-inline void GadgetCheckBoxSetEnabledImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 0, image ); }
-inline void GadgetCheckBoxSetEnabledColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 0, color ); }
-inline void GadgetCheckBoxSetEnabledBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 0, color ); }
-inline void GadgetCheckBoxSetEnabledUncheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 1, image ); }
-inline void GadgetCheckBoxSetEnabledUncheckedBoxColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 1, color ); }
-inline void GadgetCheckBoxSetEnabledUncheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 1, color ); }
-inline void GadgetCheckBoxSetEnabledCheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 2, image ); }
-inline void GadgetCheckBoxSetEnabledCheckedBoxColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 2, color ); }
-inline void GadgetCheckBoxSetEnabledCheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 2, color ); }
-inline const Image *GadgetCheckBoxGetEnabledImage( GameWindow *g ) { return g->winGetEnabledImage( 0 ); }
-inline Color GadgetCheckBoxGetEnabledColor( GameWindow *g ) { return g->winGetEnabledColor( 0 ); }
-inline Color GadgetCheckBoxGetEnabledBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 0 ); }
-inline const Image *GadgetCheckBoxGetEnabledUncheckedBoxImage( GameWindow *g ) { return g->winGetEnabledImage( 1 ); }
-inline Color GadgetCheckBoxGetEnabledUncheckedBoxColor( GameWindow *g ) { return g->winGetEnabledColor( 1 ); }
-inline Color GadgetCheckBoxGetEnabledUncheckedBoxBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 1 ); }
-inline const Image *GadgetCheckBoxGetEnabledCheckedBoxImage( GameWindow *g ) { return g->winGetEnabledImage( 2 ); }
-inline Color GadgetCheckBoxGetEnabledCheckedBoxColor( GameWindow *g ) { return g->winGetEnabledColor( 2 ); }
-inline Color GadgetCheckBoxGetEnabledCheckedBoxBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 2 ); }
-
-inline void GadgetCheckBoxSetDisabledImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 0, image ); }
-inline void GadgetCheckBoxSetDisabledColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 0, color ); }
-inline void GadgetCheckBoxSetDisabledBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 0, color ); }
-inline void GadgetCheckBoxSetDisabledUncheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 1, image ); }
-inline void GadgetCheckBoxSetDisabledUncheckedBoxColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 1, color ); }
-inline void GadgetCheckBoxSetDisabledUncheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 1, color ); }
-inline void GadgetCheckBoxSetDisabledCheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 2, image ); }
-inline void GadgetCheckBoxSetDisabledCheckedBoxColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 2, color ); }
-inline void GadgetCheckBoxSetDisabledCheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 2, color ); }
-inline const Image *GadgetCheckBoxGetDisabledImage( GameWindow *g ) { return g->winGetDisabledImage( 0 ); }
-inline Color GadgetCheckBoxGetDisabledColor( GameWindow *g ) { return g->winGetDisabledColor( 0 ); }
-inline Color GadgetCheckBoxGetDisabledBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 0 ); }
-inline const Image *GadgetCheckBoxGetDisabledUncheckedBoxImage( GameWindow *g ) { return g->winGetDisabledImage( 1 ); }
-inline Color GadgetCheckBoxGetDisabledUncheckedBoxColor( GameWindow *g ) { return g->winGetDisabledColor( 1 ); }
-inline Color GadgetCheckBoxGetDisabledUncheckedBoxBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 1 ); }
-inline const Image *GadgetCheckBoxGetDisabledCheckedBoxImage( GameWindow *g ) { return g->winGetDisabledImage( 2 ); }
-inline Color GadgetCheckBoxGetDisabledCheckedBoxColor( GameWindow *g ) { return g->winGetDisabledColor( 2 ); }
-inline Color GadgetCheckBoxGetDisabledCheckedBoxBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 2 ); }
-
-inline void GadgetCheckBoxSetHiliteImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 0, image ); }
-inline void GadgetCheckBoxSetHiliteColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 0, color ); }
-inline void GadgetCheckBoxSetHiliteBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 0, color ); }
-inline void GadgetCheckBoxSetHiliteUncheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 1, image ); }
-inline void GadgetCheckBoxSetHiliteUncheckedBoxColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 1, color ); }
-inline void GadgetCheckBoxSetHiliteUncheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 1, color ); }
-inline void GadgetCheckBoxSetHiliteCheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 2, image ); }
-inline void GadgetCheckBoxSetHiliteCheckedBoxColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 2, color ); }
-inline void GadgetCheckBoxSetHiliteCheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 2, color ); }
-inline const Image *GadgetCheckBoxGetHiliteImage( GameWindow *g ) { return g->winGetHiliteImage( 0 ); }
-inline Color GadgetCheckBoxGetHiliteColor( GameWindow *g ) { return g->winGetHiliteColor( 0 ); }
-inline Color GadgetCheckBoxGetHiliteBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 0 ); }
-inline const Image *GadgetCheckBoxGetHiliteUncheckedBoxImage( GameWindow *g ) { return g->winGetHiliteImage( 1 ); }
-inline Color GadgetCheckBoxGetHiliteUncheckedBoxColor( GameWindow *g ) { return g->winGetHiliteColor( 1 ); }
-inline Color GadgetCheckBoxGetHiliteUncheckedBoxBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 1 ); }
-inline const Image *GadgetCheckBoxGetHiliteCheckedBoxImage( GameWindow *g ) { return g->winGetHiliteImage( 2 ); }
-inline Color GadgetCheckBoxGetHiliteCheckedBoxColor( GameWindow *g ) { return g->winGetHiliteColor( 2 ); }
-inline Color GadgetCheckBoxGetHiliteCheckedBoxBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 2 ); }
-
-// EXTERNALS //////////////////////////////////////////////////////////////////
diff --git a/Generals/Code/GameEngine/Include/GameClient/GadgetComboBox.h b/Generals/Code/GameEngine/Include/GameClient/GadgetComboBox.h
deleted file mode 100644
index 51589981437..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/GadgetComboBox.h
+++ /dev/null
@@ -1,192 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GadgetComboBox.h //////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: GadgetComboBox.h
-//
-// Created: Chris Huybregts, November 2001
-//
-// Desc: Helpful interface for ComboBoxes
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "GameClient/Gadget.h"
-#include "GameClient/GameWindow.h"
-
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// INLINING ///////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-extern void GadgetComboBoxSetFont( GameWindow *comboBox, GameFont *font );
-extern UnicodeString GadgetComboBoxGetText( GameWindow *comboBox );
-extern void GadgetComboBoxSetText( GameWindow *comboBox, UnicodeString text );
-extern Int GadgetComboBoxAddEntry( GameWindow *comboBox, UnicodeString text, Color color );
-extern void GadgetComboBoxReset( GameWindow *comboBox );
-
-extern void GadgetComboBoxSetSelectedPos( GameWindow *comboBox, Int selectedIndex, Bool dontHide = FALSE );
-extern void GadgetComboBoxGetSelectedPos( GameWindow *comboBox, Int *selectedIndex );
-extern void GadgetComboBoxSetItemData( GameWindow *comboBox, Int index, void *data );
-extern void *GadgetComboBoxGetItemData( GameWindow *comboBox, Int index );
-extern Int GadgetComboBoxGetLength( GameWindow *comboBox );
-
-extern void GadgetComboBoxHideList( GameWindow *comboBox );
-// Functions that set the ComboBoxData Parameters
-extern void GadgetComboBoxSetAsciiOnly(GameWindow *comboBox, Bool isAsciiOnly );
-extern void GadgetComboBoxSetLettersAndNumbersOnly(GameWindow *comboBox, Bool isLettersAndNumbersOnly );
-extern void GadgetComboBoxSetMaxChars( GameWindow *comboBox, Int maxChars );
-extern void GadgetComboBoxSetMaxDisplay( GameWindow *comboBox, Int maxDisplay );
-extern void GadgetComboBoxSetIsEditable(GameWindow *comboBox, Bool isEditable );
-
-//setup all the Font Colors
-extern void GadgetComboBoxSetEnabledTextColors( GameWindow *comboBox,Color color, Color borderColor );
-extern void GadgetComboBoxSetDisabledTextColors( GameWindow *comboBox,Color color, Color borderColor );
-extern void GadgetComboBoxSetHiliteTextColors( GameWindow *comboBox,Color color, Color borderColor );
-extern void GadgetComboBoxSetIMECompositeTextColors( GameWindow *comboBox, Color color, Color borderColor );
-
-//
-// you can use this to set the colors for the list box all at once, note that
-// it will also automatically change the colors for any attached slider
-// and those slider buttons and thumb as well as the drop down button and edit box.
-//
-extern void GadgetComboBoxSetColors( GameWindow *comboBox,
- Color enabledColor,
- Color enabledBorderColor,
- Color enabledSelectedItemColor,
- Color enabledSelectedItemBorderColor,
- Color disabledColor,
- Color disabledBorderColor,
- Color disabledSelectedItemColor,
- Color disabledSelectedItemBorderColor,
- Color hiliteColor,
- Color hiliteBorderColor,
- Color hiliteSelectedItemColor,
- Color hiliteSelectedItemBorderColor );
-
-inline void GadgetComboBoxSetEnabledImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 0, image ); }
-inline void GadgetComboBoxSetEnabledColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 0, color ); }
-inline void GadgetComboBoxSetEnabledBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 0, color ); }
-inline void GadgetComboBoxSetEnabledSelectedItemImageLeft( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 1, image ); }
-inline void GadgetComboBoxSetEnabledSelectedItemImageRight( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 2, image ); }
-inline void GadgetComboBoxSetEnabledSelectedItemImageCenter( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 3, image ); }
-inline void GadgetComboBoxSetEnabledSelectedItemImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 4, image ); }
-inline void GadgetComboBoxSetEnabledSelectedItemColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 1, color ); }
-inline void GadgetComboBoxSetEnabledSelectedItemBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 1, color ); }
-inline const Image *GadgetComboBoxGetEnabledImage( GameWindow *g ) { return g->winGetEnabledImage( 0 ); }
-inline Color GadgetComboBoxGetEnabledColor( GameWindow *g ) { return g->winGetEnabledColor( 0 ); }
-inline Color GadgetComboBoxGetEnabledBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 0 ); }
-inline const Image *GadgetComboBoxGetEnabledSelectedItemImageLeft( GameWindow *g ) { return g->winGetEnabledImage( 1 ); }
-inline const Image *GadgetComboBoxGetEnabledSelectedItemImageRight( GameWindow *g ) { return g->winGetEnabledImage( 2 ); }
-inline const Image *GadgetComboBoxGetEnabledSelectedItemImageCenter( GameWindow *g ) { return g->winGetEnabledImage( 3 ); }
-inline const Image *GadgetComboBoxGetEnabledSelectedItemImageSmallCenter( GameWindow *g ){ return g->winGetEnabledImage( 4 ); }
-inline Color GadgetComboBoxGetEnabledSelectedItemColor( GameWindow *g ) { return g->winGetEnabledColor( 1 ); }
-inline Color GadgetComboBoxGetEnabledSelectedItemBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 1 ); }
-
-inline void GadgetComboBoxSetDisabledImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 0, image ); }
-inline void GadgetComboBoxSetDisabledColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 0, color ); }
-inline void GadgetComboBoxSetDisabledBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 0, color ); }
-inline void GadgetComboBoxSetDisabledSelectedItemImageLeft( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 1, image ); }
-inline void GadgetComboBoxSetDisabledSelectedItemImageRight( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 2, image ); }
-inline void GadgetComboBoxSetDisabledSelectedItemImageCenter( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 3, image ); }
-inline void GadgetComboBoxSetDisabledSelectedItemImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 4, image ); }
-inline void GadgetComboBoxSetDisabledSelectedItemColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 1, color ); }
-inline void GadgetComboBoxSetDisabledSelectedItemBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 1, color ); }
-inline const Image *GadgetComboBoxGetDisabledImage( GameWindow *g ) { return g->winGetDisabledImage( 0 ); }
-inline Color GadgetComboBoxGetDisabledColor( GameWindow *g ) { return g->winGetDisabledColor( 0 ); }
-inline Color GadgetComboBoxGetDisabledBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 0 ); }
-inline const Image *GadgetComboBoxGetDisabledSelectedItemImageLeft( GameWindow *g ) { return g->winGetDisabledImage( 1 ); }
-inline const Image *GadgetComboBoxGetDisabledSelectedItemImageRight( GameWindow *g ) { return g->winGetDisabledImage( 2 ); }
-inline const Image *GadgetComboBoxGetDisabledSelectedItemImageCenter( GameWindow *g ) { return g->winGetDisabledImage( 3 ); }
-inline const Image *GadgetComboBoxGetDisabledSelectedItemImageSmallCenter( GameWindow *g ) { return g->winGetDisabledImage( 4 ); }
-inline Color GadgetComboBoxGetDisabledSelectedItemColor( GameWindow *g ) { return g->winGetDisabledColor( 1 ); }
-inline Color GadgetComboBoxGetDisabledSelectedItemBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 1 ); }
-
-inline void GadgetComboBoxSetHiliteImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 0, image ); }
-inline void GadgetComboBoxSetHiliteColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 0, color ); }
-inline void GadgetComboBoxSetHiliteBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 0, color ); }
-inline void GadgetComboBoxSetHiliteSelectedItemImageLeft( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 1, image ); }
-inline void GadgetComboBoxSetHiliteSelectedItemImageRight( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 2, image ); }
-inline void GadgetComboBoxSetHiliteSelectedItemImageCenter( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 3, image ); }
-inline void GadgetComboBoxSetHiliteSelectedItemImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 4, image ); }
-inline void GadgetComboBoxSetHiliteSelectedItemColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 1, color ); }
-inline void GadgetComboBoxSetHiliteSelectedItemBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 1, color ); }
-inline const Image *GadgetComboBoxGetHiliteImage( GameWindow *g ) { return g->winGetHiliteImage( 0 ); }
-inline Color GadgetComboBoxGetHiliteColor( GameWindow *g ) { return g->winGetHiliteColor( 0 ); }
-inline Color GadgetComboBoxGetHiliteBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 0 ); }
-inline const Image *GadgetComboBoxGetHiliteSelectedItemImageLeft( GameWindow *g ) { return g->winGetHiliteImage( 1 ); }
-inline const Image *GadgetComboBoxGetHiliteSelectedItemImageRight( GameWindow *g ) { return g->winGetHiliteImage( 2 ); }
-inline const Image *GadgetComboBoxGetHiliteSelectedItemImageCenter( GameWindow *g ) { return g->winGetHiliteImage( 3 ); }
-inline const Image *GadgetComboBoxGetHiliteSelectedItemImageSmallCenter( GameWindow *g ) { return g->winGetHiliteImage( 4 ); }
-inline Color GadgetComboBoxGetHiliteSelectedItemColor( GameWindow *g ) { return g->winGetHiliteColor( 1 ); }
-inline Color GadgetComboBoxGetHiliteSelectedItemBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 1 ); }
-
-inline GameWindow *GadgetComboBoxGetDropDownButton( GameWindow *g )
-{
- ComboBoxData *comboBoxData = (ComboBoxData *)g->winGetUserData();
-
- if( comboBoxData && comboBoxData->dropDownButton )
- return comboBoxData->dropDownButton;
- return nullptr;
-}
-inline GameWindow *GadgetComboBoxGetListBox( GameWindow *g )
-{
- ComboBoxData *comboBoxData = (ComboBoxData *)g->winGetUserData();
-
- if( comboBoxData && comboBoxData->listBox)
- return comboBoxData->listBox;
- return nullptr;
-
-}
-
-inline GameWindow *GadgetComboBoxGetEditBox( GameWindow *g )
-{
- ComboBoxData *comboBoxData = (ComboBoxData *)g->winGetUserData();
-
- if( comboBoxData && comboBoxData->editBox)
- return comboBoxData->editBox;
- return nullptr;
-
-}
-
-// EXTERNALS //////////////////////////////////////////////////////////////////
diff --git a/Generals/Code/GameEngine/Include/GameClient/GadgetListBox.h b/Generals/Code/GameEngine/Include/GameClient/GadgetListBox.h
deleted file mode 100644
index d6349031d8b..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/GadgetListBox.h
+++ /dev/null
@@ -1,208 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GadgetListBox.h //////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: GadgetListBox.h
-//
-// Created: Colin Day, June 2001
-//
-// Desc: Helpful interface for ListBoxes
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "GameClient/Gadget.h"
-#include "GameClient/GameWindow.h"
-
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-typedef struct _RightClickStruct
-{
- Int mouseX;
- Int mouseY;
- Int pos;
-} RightClickStruct;
-
-///////////////////////////////////////////////////////////////////////////////
-// INLINING ///////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-extern Int GadgetListBoxGetEntryBasedOnXY( GameWindow *listbox, Int x, Int y, Int &row, Int &column);
-extern void GadgetListboxCreateScrollbar( GameWindow *listbox );
-extern void GadgetListBoxAddMultiSelect( GameWindow *listbox );
-extern void GadgetListBoxRemoveMultiSelect( GameWindow *listbox );
-extern void GadgetListBoxSetListLength( GameWindow *listbox, Int newLength );
-extern Int GadgetListBoxGetListLength( GameWindow *listbox ); ///< Returns the maximum possible number of list entries. Length is synonymous to rows
-extern Int GadgetListBoxGetMaxSelectedLength( GameWindow *listbox ); ///< Returns the maximum possible number of list entries that can be selected
-extern Int GadgetListBoxGetNumEntries( GameWindow *listbox );
-extern Int GadgetListBoxGetNumColumns( GameWindow *listbox );
-extern Int GadgetListBoxGetColumnWidth( GameWindow *listbox, Int column );
-
-extern void GadgetListBoxSetFont( GameWindow *listbox, GameFont *font );
-extern UnicodeString GadgetListBoxGetText( GameWindow *listbox, Int row, Int column = 0);
-extern UnicodeString GadgetListBoxGetTextAndColor( GameWindow *listbox, Color *color, Int row, Int column = 0);
-extern Int GadgetListBoxAddEntryText( GameWindow *listbox, UnicodeString text, Color color, Int row, Int column = -1, Bool overwrite = TRUE);
-extern Int GadgetListBoxAddEntryImage( GameWindow *listbox, const Image *image,
- Int row, Int column = -1,
- Bool overwrite = TRUE, Color color = 0xFFFFFFFF );
-extern Int GadgetListBoxAddEntryImage( GameWindow *listbox, const Image *image,
- Int row, Int column,
- Int hight, Int width,
- Bool overwrite = TRUE, Color color = 0xFFFFFFFF );
-extern void GadgetListBoxSetSelected( GameWindow *listbox, Int selectIndex );
-extern void GadgetListBoxSetSelected( GameWindow *listbox, const Int *selectList, Int selectCount = 1 );
-extern void GadgetListBoxGetSelected( GameWindow *listbox, Int *selectList );
-extern void GadgetListBoxReset( GameWindow *listbox );
-extern void GadgetListBoxSetItemData( GameWindow *listbox, void *data, Int row, Int column = 0);
-extern void *GadgetListBoxGetItemData( GameWindow *listbox, Int row, Int column = 0);
-
-extern bool GadgetListBoxIsFull(GameWindow *window);
-
-extern Int GadgetListBoxGetBottomVisibleEntry( GameWindow *window );
-extern void GadgetListBoxSetBottomVisibleEntry( GameWindow *window, Int newPos );
-
-extern Int GadgetListBoxGetTopVisibleEntry( GameWindow *window );
-extern void GadgetListBoxSetTopVisibleEntry( GameWindow *window, Int newPos );
-
-extern void GadgetListBoxSetAudioFeedback( GameWindow *listbox, Bool enable );
-
-//
-// you can use this to set the colors for the list box all at once, note that
-// it will also automatically change the colors for any attached slider
-// and those slider buttons and thumb
-//
-extern void GadgetListBoxSetColors( GameWindow *listbox,
- Color enabledColor,
- Color enabledBorderColor,
- Color enabledSelectedItemColor,
- Color enabledSelectedItemBorderColor,
- Color disabledColor,
- Color disabledBorderColor,
- Color disabledSelectedItemColor,
- Color disabledSelectedItemBorderColor,
- Color hiliteColor,
- Color hiliteBorderColor,
- Color hiliteSelectedItemColor,
- Color hiliteSelectedItemBorderColor );
-
-inline void GadgetListBoxSetEnabledImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 0, image ); }
-inline void GadgetListBoxSetEnabledColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 0, color ); }
-inline void GadgetListBoxSetEnabledBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 0, color ); }
-inline void GadgetListBoxSetEnabledSelectedItemImageLeft( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 1, image ); }
-inline void GadgetListBoxSetEnabledSelectedItemImageRight( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 2, image ); }
-inline void GadgetListBoxSetEnabledSelectedItemImageCenter( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 3, image ); }
-inline void GadgetListBoxSetEnabledSelectedItemImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 4, image ); }
-inline void GadgetListBoxSetEnabledSelectedItemColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 1, color ); }
-inline void GadgetListBoxSetEnabledSelectedItemBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 1, color ); }
-inline const Image *GadgetListBoxGetEnabledImage( GameWindow *g ) { return g->winGetEnabledImage( 0 ); }
-inline Color GadgetListBoxGetEnabledColor( GameWindow *g ) { return g->winGetEnabledColor( 0 ); }
-inline Color GadgetListBoxGetEnabledBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 0 ); }
-inline const Image *GadgetListBoxGetEnabledSelectedItemImageLeft( GameWindow *g ) { return g->winGetEnabledImage( 1 ); }
-inline const Image *GadgetListBoxGetEnabledSelectedItemImageRight( GameWindow *g ) { return g->winGetEnabledImage( 2 ); }
-inline const Image *GadgetListBoxGetEnabledSelectedItemImageCenter( GameWindow *g ) { return g->winGetEnabledImage( 3 ); }
-inline const Image *GadgetListBoxGetEnabledSelectedItemImageSmallCenter( GameWindow *g ){ return g->winGetEnabledImage( 4 ); }
-inline Color GadgetListBoxGetEnabledSelectedItemColor( GameWindow *g ) { return g->winGetEnabledColor( 1 ); }
-inline Color GadgetListBoxGetEnabledSelectedItemBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 1 ); }
-
-inline void GadgetListBoxSetDisabledImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 0, image ); }
-inline void GadgetListBoxSetDisabledColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 0, color ); }
-inline void GadgetListBoxSetDisabledBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 0, color ); }
-inline void GadgetListBoxSetDisabledSelectedItemImageLeft( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 1, image ); }
-inline void GadgetListBoxSetDisabledSelectedItemImageRight( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 2, image ); }
-inline void GadgetListBoxSetDisabledSelectedItemImageCenter( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 3, image ); }
-inline void GadgetListBoxSetDisabledSelectedItemImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 4, image ); }
-inline void GadgetListBoxSetDisabledSelectedItemColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 1, color ); }
-inline void GadgetListBoxSetDisabledSelectedItemBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 1, color ); }
-inline const Image *GadgetListBoxGetDisabledImage( GameWindow *g ) { return g->winGetDisabledImage( 0 ); }
-inline Color GadgetListBoxGetDisabledColor( GameWindow *g ) { return g->winGetDisabledColor( 0 ); }
-inline Color GadgetListBoxGetDisabledBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 0 ); }
-inline const Image *GadgetListBoxGetDisabledSelectedItemImageLeft( GameWindow *g ) { return g->winGetDisabledImage( 1 ); }
-inline const Image *GadgetListBoxGetDisabledSelectedItemImageRight( GameWindow *g ) { return g->winGetDisabledImage( 2 ); }
-inline const Image *GadgetListBoxGetDisabledSelectedItemImageCenter( GameWindow *g ) { return g->winGetDisabledImage( 3 ); }
-inline const Image *GadgetListBoxGetDisabledSelectedItemImageSmallCenter( GameWindow *g ) { return g->winGetDisabledImage( 4 ); }
-inline Color GadgetListBoxGetDisabledSelectedItemColor( GameWindow *g ) { return g->winGetDisabledColor( 1 ); }
-inline Color GadgetListBoxGetDisabledSelectedItemBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 1 ); }
-
-inline void GadgetListBoxSetHiliteImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 0, image ); }
-inline void GadgetListBoxSetHiliteColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 0, color ); }
-inline void GadgetListBoxSetHiliteBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 0, color ); }
-inline void GadgetListBoxSetHiliteSelectedItemImageLeft( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 1, image ); }
-inline void GadgetListBoxSetHiliteSelectedItemImageRight( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 2, image ); }
-inline void GadgetListBoxSetHiliteSelectedItemImageCenter( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 3, image ); }
-inline void GadgetListBoxSetHiliteSelectedItemImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 4, image ); }
-inline void GadgetListBoxSetHiliteSelectedItemColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 1, color ); }
-inline void GadgetListBoxSetHiliteSelectedItemBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 1, color ); }
-inline const Image *GadgetListBoxGetHiliteImage( GameWindow *g ) { return g->winGetHiliteImage( 0 ); }
-inline Color GadgetListBoxGetHiliteColor( GameWindow *g ) { return g->winGetHiliteColor( 0 ); }
-inline Color GadgetListBoxGetHiliteBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 0 ); }
-inline const Image *GadgetListBoxGetHiliteSelectedItemImageLeft( GameWindow *g ) { return g->winGetHiliteImage( 1 ); }
-inline const Image *GadgetListBoxGetHiliteSelectedItemImageRight( GameWindow *g ) { return g->winGetHiliteImage( 2 ); }
-inline const Image *GadgetListBoxGetHiliteSelectedItemImageCenter( GameWindow *g ) { return g->winGetHiliteImage( 3 ); }
-inline const Image *GadgetListBoxGetHiliteSelectedItemImageSmallCenter( GameWindow *g ) { return g->winGetHiliteImage( 4 ); }
-inline Color GadgetListBoxGetHiliteSelectedItemColor( GameWindow *g ) { return g->winGetHiliteColor( 1 ); }
-inline Color GadgetListBoxGetHiliteSelectedItemBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 1 ); }
-
-inline GameWindow *GadgetListBoxGetSlider( GameWindow *g )
-{
- ListboxData *listData = (ListboxData *)g->winGetUserData();
-
- if( listData && listData->slider )
- return listData->slider;
- return nullptr;
-}
-inline GameWindow *GadgetListBoxGetUpButton( GameWindow *g )
-{
- ListboxData *listData = (ListboxData *)g->winGetUserData();
-
- if( listData && listData->upButton )
- return listData->upButton;
- return nullptr;
-}
-inline GameWindow *GadgetListBoxGetDownButton( GameWindow *g )
-{
- ListboxData *listData = (ListboxData *)g->winGetUserData();
-
- if( listData && listData->downButton )
- return listData->downButton;
- return nullptr;
-
-}
-
-// EXTERNALS //////////////////////////////////////////////////////////////////
diff --git a/Generals/Code/GameEngine/Include/GameClient/GadgetProgressBar.h b/Generals/Code/GameEngine/Include/GameClient/GadgetProgressBar.h
deleted file mode 100644
index a4ce3684857..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/GadgetProgressBar.h
+++ /dev/null
@@ -1,140 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GadgetProgressBar.h //////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: GadgetProgressBar.h
-//
-// Created: Colin Day, June 2001
-//
-// Desc: Helpful interface for ProgressBars
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "GameClient/GameWindow.h"
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-
-
-extern void GadgetProgressBarSetProgress( GameWindow *g, Int progress );
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// INLINING ///////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-inline void GadgetProgressBarSetEnabledColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 0, color ); }
-inline void GadgetProgressBarSetEnabledBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 0, color ); }
-inline void GadgetProgressBarSetEnabledImageLeft( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 0, image ); }
-inline void GadgetProgressBarSetEnabledImageRight( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 1, image ); }
-inline void GadgetProgressBarSetEnabledImageCenter( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 2, image ); }
-inline void GadgetProgressBarSetEnabledImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 3, image ); }
-inline void GadgetProgressBarSetEnabledBarColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 4, color ); }
-inline void GadgetProgressBarSetEnabledBarBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 4, color ); }
-inline void GadgetProgressBarSetEnabledBarImageLeft( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 4, image ); }
-inline void GadgetProgressBarSetEnabledBarImageRight( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 5, image ); }
-inline void GadgetProgressBarSetEnabledBarImageCenter( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 6, image ); }
-inline void GadgetProgressBarSetEnabledBarImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 7, image ); }
-inline Color GadgetProgressBarGetEnabledColor( GameWindow *g ) { return g->winGetEnabledColor( 0 ); }
-inline Color GadgetProgressBarGetEnabledBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 0 ); }
-inline const Image *GadgetProgressBarGetEnabledImageLeft( GameWindow *g ) { return g->winGetEnabledImage( 0 ); }
-inline const Image * GadgetProgressBarGetEnabledImageRight( GameWindow *g ) { return g->winGetEnabledImage( 1 ); }
-inline const Image * GadgetProgressBarGetEnabledImageCenter( GameWindow *g ) { return g->winGetEnabledImage( 2 ); }
-inline const Image * GadgetProgressBarGetEnabledImageSmallCenter( GameWindow *g ) { return g->winGetEnabledImage( 3 ); }
-inline Color GadgetProgressBarGetEnabledBarColor( GameWindow *g ) { return g->winGetEnabledColor( 4 ); }
-inline Color GadgetProgressBarGetEnabledBarBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 4 ); }
-inline const Image * GadgetProgressBarGetEnabledBarImageLeft( GameWindow *g ) { return g->winGetEnabledImage( 4 ); }
-inline const Image * GadgetProgressBarGetEnabledBarImageRight( GameWindow *g ) { return g->winGetEnabledImage( 5 ); }
-inline const Image * GadgetProgressBarGetEnabledBarImageCenter( GameWindow *g ) { return g->winGetEnabledImage( 6 ); }
-inline const Image * GadgetProgressBarGetEnabledBarImageSmallCenter( GameWindow *g ) { return g->winGetEnabledImage( 7 ); }
-
-//-----------------------------------------------------------------------------
-inline void GadgetProgressBarSetDisabledColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 0, color ); }
-inline void GadgetProgressBarSetDisabledBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 0, color ); }
-inline void GadgetProgressBarSetDisabledImageLeft( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 0, image ); }
-inline void GadgetProgressBarSetDisabledImageRight( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 1, image ); }
-inline void GadgetProgressBarSetDisabledImageCenter( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 2, image ); }
-inline void GadgetProgressBarSetDisabledImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 3, image ); }
-inline void GadgetProgressBarSetDisabledBarColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 4, color ); }
-inline void GadgetProgressBarSetDisabledBarBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 4, color ); }
-inline void GadgetProgressBarSetDisabledBarImageLeft( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 4, image ); }
-inline void GadgetProgressBarSetDisabledBarImageRight( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 5, image ); }
-inline void GadgetProgressBarSetDisabledBarImageCenter( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 6, image ); }
-inline void GadgetProgressBarSetDisabledBarImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 7, image ); }
-inline Color GadgetProgressBarGetDisabledColor( GameWindow *g ) { return g->winGetDisabledColor( 0 ); }
-inline Color GadgetProgressBarGetDisabledBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 0 ); }
-inline const Image *GadgetProgressBarGetDisabledImageLeft( GameWindow *g ) { return g->winGetDisabledImage( 0 ); }
-inline const Image * GadgetProgressBarGetDisabledImageRight( GameWindow *g ) { return g->winGetDisabledImage( 1 ); }
-inline const Image * GadgetProgressBarGetDisabledImageCenter( GameWindow *g ) { return g->winGetDisabledImage( 2 ); }
-inline const Image * GadgetProgressBarGetDisabledImageSmallCenter( GameWindow *g ) { return g->winGetDisabledImage( 3 ); }
-inline Color GadgetProgressBarGetDisabledBarColor( GameWindow *g ) { return g->winGetDisabledColor( 4 ); }
-inline Color GadgetProgressBarGetDisabledBarBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 4 ); }
-inline const Image * GadgetProgressBarGetDisabledBarImageLeft( GameWindow *g ) { return g->winGetDisabledImage( 4 ); }
-inline const Image * GadgetProgressBarGetDisabledBarImageRight( GameWindow *g ) { return g->winGetDisabledImage( 5 ); }
-inline const Image * GadgetProgressBarGetDisabledBarImageCenter( GameWindow *g ) { return g->winGetDisabledImage( 6 ); }
-inline const Image * GadgetProgressBarGetDisabledBarImageSmallCenter( GameWindow *g ) { return g->winGetDisabledImage( 7 ); }
-
-//-----------------------------------------------------------------------------
-inline void GadgetProgressBarSetHiliteColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 0, color ); }
-inline void GadgetProgressBarSetHiliteBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 0, color ); }
-inline void GadgetProgressBarSetHiliteImageLeft( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 0, image ); }
-inline void GadgetProgressBarSetHiliteImageRight( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 1, image ); }
-inline void GadgetProgressBarSetHiliteImageCenter( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 2, image ); }
-inline void GadgetProgressBarSetHiliteImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 3, image ); }
-inline void GadgetProgressBarSetHiliteBarColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 4, color ); }
-inline void GadgetProgressBarSetHiliteBarBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 4, color ); }
-inline void GadgetProgressBarSetHiliteBarImageLeft( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 4, image ); }
-inline void GadgetProgressBarSetHiliteBarImageRight( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 5, image ); }
-inline void GadgetProgressBarSetHiliteBarImageCenter( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 6, image ); }
-inline void GadgetProgressBarSetHiliteBarImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 7, image ); }
-inline Color GadgetProgressBarGetHiliteColor( GameWindow *g ) { return g->winGetHiliteColor( 0 ); }
-inline Color GadgetProgressBarGetHiliteBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 0 ); }
-inline const Image *GadgetProgressBarGetHiliteImageLeft( GameWindow *g ) { return g->winGetHiliteImage( 0 ); }
-inline const Image * GadgetProgressBarGetHiliteImageRight( GameWindow *g ) { return g->winGetHiliteImage( 1 ); }
-inline const Image * GadgetProgressBarGetHiliteImageCenter( GameWindow *g ) { return g->winGetHiliteImage( 2 ); }
-inline const Image * GadgetProgressBarGetHiliteImageSmallCenter( GameWindow *g ) { return g->winGetHiliteImage( 3 ); }
-inline Color GadgetProgressBarGetHiliteBarColor( GameWindow *g ) { return g->winGetHiliteColor( 4 ); }
-inline Color GadgetProgressBarGetHiliteBarBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 4 ); }
-inline const Image * GadgetProgressBarGetHiliteBarImageLeft( GameWindow *g ) { return g->winGetHiliteImage( 4 ); }
-inline const Image * GadgetProgressBarGetHiliteBarImageRight( GameWindow *g ) { return g->winGetHiliteImage( 5 ); }
-inline const Image * GadgetProgressBarGetHiliteBarImageCenter( GameWindow *g ) { return g->winGetHiliteImage( 6 ); }
-inline const Image * GadgetProgressBarGetHiliteBarImageSmallCenter( GameWindow *g ) { return g->winGetHiliteImage( 7 ); }
-
-// EXTERNALS //////////////////////////////////////////////////////////////////
diff --git a/Generals/Code/GameEngine/Include/GameClient/GadgetPushButton.h b/Generals/Code/GameEngine/Include/GameClient/GadgetPushButton.h
deleted file mode 100644
index 017a4048b10..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/GadgetPushButton.h
+++ /dev/null
@@ -1,171 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GadgetPushButton.h ///////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: GadgetPushButton.h
-//
-// Created: Colin Day, June 2001
-//
-// Desc: Helpful interface for PushButtons
-//
-// PushButton IMAGE/COLOR organization
-// When control is enabled:
-// enabledDrawData[ 0 ] is the background image for the whole enabled control
-// enabledDrawData[ 1 ] is the enabled, selected button graphic
-//
-// When control is disabled:
-// disabledDrawData[ 0 ] is the background image for the whole disabled control
-// disabledDrawData[ 1 ] is the disabled, but selected button graphic
-//
-// When control is hilited (mouse over it and enabled)
-// hiliteDrawData[ 0 ] is the background image for the whole hilited control
-// hiliteDrawData[ 1 ] is the hilited, selected button graphic
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "GameClient/GameWindow.h"
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// INLINING ///////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-void GadgetCheckLikeButtonSetVisualCheck( GameWindow *g, Bool checked );
-Bool GadgetCheckLikeButtonIsChecked( GameWindow *g );
-void GadgetButtonEnableCheckLike( GameWindow *g, Bool makeCheckLike, Bool initiallyChecked );
-
-void GadgetButtonSetText( GameWindow *g, UnicodeString text );
-void GadgetButtonDrawClock( GameWindow *g, Int percent, Color color ); //Darkens the progress
-void GadgetButtonDrawInverseClock( GameWindow *g, Int percent, Color color ); //Darkens the remaining portion.
-void GadgetButtonDrawOverlayImage( GameWindow *g, const Image *image );
-void GadgetButtonSetBorder( GameWindow *g, Color color, Bool drawBorder = TRUE );
-void GadgetButtonSetData(GameWindow *g, void *data);
-void *GadgetButtonGetData(GameWindow *g);
-void GadgetButtonSetAltSound( GameWindow *g, AsciiString altSound );
-inline void GadgetButtonSetEnabledImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 0, image ); g->winSetEnabledImage( 5, nullptr );g->winSetEnabledImage( 6, nullptr );}
-inline void GadgetButtonSetEnabledColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 0, color ); }
-inline void GadgetButtonSetEnabledBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 0, color ); }
-inline void GadgetButtonSetEnabledSelectedImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 1, image ); g->winSetEnabledImage( 2, nullptr );g->winSetEnabledImage( 3, nullptr );}
-inline void GadgetButtonSetEnabledSelectedColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 1, color ); }
-inline void GadgetButtonSetEnabledSelectedBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 1, color ); }
-inline const Image *GadgetButtonGetEnabledImage( GameWindow *g ) { return g->winGetEnabledImage( 0 ); }
-inline Color GadgetButtonGetEnabledColor( GameWindow *g ) { return g->winGetEnabledColor( 0 ); }
-inline Color GadgetButtonGetEnabledBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 0 ); }
-inline const Image *GadgetButtonGetEnabledSelectedImage( GameWindow *g ) { return g->winGetEnabledImage( 1 ); }
-inline Color GadgetButtonGetEnabledSelectedColor( GameWindow *g ) { return g->winGetEnabledColor( 1 ); }
-inline Color GadgetButtonGetEnabledSelectedBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 1 ); }
-
-inline void GadgetButtonSetDisabledImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 0, image ); g->winSetEnabledImage( 5, nullptr );g->winSetEnabledImage( 6, nullptr );}
-inline void GadgetButtonSetDisabledColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 0, color ); }
-inline void GadgetButtonSetDisabledBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 0, color ); }
-inline void GadgetButtonSetDisabledSelectedImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 1, image ); g->winSetEnabledImage( 2, nullptr );g->winSetEnabledImage( 3, nullptr );}
-inline void GadgetButtonSetDisabledSelectedColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 1, color ); }
-inline void GadgetButtonSetDisabledSelectedBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 1, color ); }
-inline const Image *GadgetButtonGetDisabledImage( GameWindow *g ) { return g->winGetDisabledImage( 0 ); }
-inline Color GadgetButtonGetDisabledColor( GameWindow *g ) { return g->winGetDisabledColor( 0 ); }
-inline Color GadgetButtonGetDisabledBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 0 ); }
-inline const Image *GadgetButtonGetDisabledSelectedImage( GameWindow *g ) { return g->winGetDisabledImage( 1 ); }
-inline Color GadgetButtonGetDisabledSelectedColor( GameWindow *g ) { return g->winGetDisabledColor( 1 ); }
-inline Color GadgetButtonGetDisabledSelectedBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 1 ); }
-
-inline void GadgetButtonSetHiliteImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 0, image ); g->winSetEnabledImage( 5, nullptr );g->winSetEnabledImage( 6, nullptr );}
-inline void GadgetButtonSetHiliteColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 0, color ); }
-inline void GadgetButtonSetHiliteBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 0, color ); }
-inline void GadgetButtonSetHiliteSelectedImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 1, image ); g->winSetEnabledImage( 2, nullptr );g->winSetEnabledImage( 3, nullptr );}
-inline void GadgetButtonSetHiliteSelectedColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 1, color ); }
-inline void GadgetButtonSetHiliteSelectedBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 1, color ); }
-inline const Image *GadgetButtonGetHiliteImage( GameWindow *g ) { return g->winGetHiliteImage( 0 ); }
-inline Color GadgetButtonGetHiliteColor( GameWindow *g ) { return g->winGetHiliteColor( 0 ); }
-inline Color GadgetButtonGetHiliteBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 0 ); }
-inline const Image *GadgetButtonGetHiliteSelectedImage( GameWindow *g ) { return g->winGetHiliteImage( 1 ); }
-inline Color GadgetButtonGetHiliteSelectedColor( GameWindow *g ) { return g->winGetHiliteColor( 1 ); }
-inline Color GadgetButtonGetHiliteSelectedBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 1 ); }
-
-inline const Image *GadgetButtonGetLeftHiliteSelectedImage( GameWindow *g ) { return g->winGetHiliteImage( 1 ); }
-inline const Image *GadgetButtonGetMiddleHiliteSelectedImage( GameWindow *g ) { return g->winGetHiliteImage( 3 ); }
-inline const Image *GadgetButtonGetRightHiliteSelectedImage( GameWindow *g ) { return g->winGetHiliteImage( 4 ); }
-
-inline const Image *GadgetButtonGetLeftHiliteImage( GameWindow *g ) { return g->winGetHiliteImage( 0 ); }
-inline const Image *GadgetButtonGetMiddleHiliteImage( GameWindow *g ) { return g->winGetHiliteImage( 5 ); }
-inline const Image *GadgetButtonGetRightHiliteImage( GameWindow *g ) { return g->winGetHiliteImage( 6 ); }
-
-inline void GadgetButtonSetLeftHiliteSelectedImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 1, image ); }
-inline void GadgetButtonSetMiddleHiliteSelectedImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 3, image ); }
-inline void GadgetButtonSetRightHiliteSelectedImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 4, image ); }
-
-inline void GadgetButtonSetLeftHiliteImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 0, image ); }
-inline void GadgetButtonSetMiddleHiliteImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 5, image ); }
-inline void GadgetButtonSetRightHiliteImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 6, image ); }
-
-
-inline const Image *GadgetButtonGetLeftDisabledSelectedImage( GameWindow *g ) { return g->winGetDisabledImage( 1 ); }
-inline const Image *GadgetButtonGetMiddleDisabledSelectedImage( GameWindow *g ) { return g->winGetDisabledImage( 3 ); }
-inline const Image *GadgetButtonGetRightDisabledSelectedImage( GameWindow *g ) { return g->winGetDisabledImage( 4 ); }
-
-inline const Image *GadgetButtonGetLeftDisabledImage( GameWindow *g ) { return g->winGetDisabledImage( 0 ); }
-inline const Image *GadgetButtonGetMiddleDisabledImage( GameWindow *g ) { return g->winGetDisabledImage( 5 ); }
-inline const Image *GadgetButtonGetRightDisabledImage( GameWindow *g ) { return g->winGetDisabledImage( 6 ); }
-
-inline void GadgetButtonSetLeftDisabledSelectedImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 1, image ); }
-inline void GadgetButtonSetMiddleDisabledSelectedImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 3, image ); }
-inline void GadgetButtonSetRightDisabledSelectedImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 4, image ); }
-
-inline void GadgetButtonSetLeftDisabledImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 0, image ); }
-inline void GadgetButtonSetMiddleDisabledImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 5, image ); }
-inline void GadgetButtonSetRightDisabledImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 6, image ); }
-
-inline const Image *GadgetButtonGetLeftEnabledSelectedImage( GameWindow *g ) { return g->winGetEnabledImage( 1 ); }
-inline const Image *GadgetButtonGetMiddleEnabledSelectedImage( GameWindow *g ) { return g->winGetEnabledImage( 3 ); }
-inline const Image *GadgetButtonGetRightEnabledSelectedImage( GameWindow *g ) { return g->winGetEnabledImage( 4 ); }
-
-inline const Image *GadgetButtonGetLeftEnabledImage( GameWindow *g ) { return g->winGetEnabledImage( 0 ); }
-inline const Image *GadgetButtonGetMiddleEnabledImage( GameWindow *g ) { return g->winGetEnabledImage( 5 ); }
-inline const Image *GadgetButtonGetRightEnabledImage( GameWindow *g ) { return g->winGetEnabledImage( 6 ); }
-
-inline void GadgetButtonSetLeftEnabledSelectedImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 1, image ); }
-inline void GadgetButtonSetMiddleEnabledSelectedImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 3, image ); }
-inline void GadgetButtonSetRightEnabledSelectedImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 4, image ); }
-
-inline void GadgetButtonSetLeftEnabledImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 0, image ); }
-inline void GadgetButtonSetMiddleEnabledImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 5, image ); }
-inline void GadgetButtonSetRightEnabledImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 6, image ); }
-// EXTERNALS //////////////////////////////////////////////////////////////////
diff --git a/Generals/Code/GameEngine/Include/GameClient/GadgetRadioButton.h b/Generals/Code/GameEngine/Include/GameClient/GadgetRadioButton.h
deleted file mode 100644
index 331927813cd..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/GadgetRadioButton.h
+++ /dev/null
@@ -1,146 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GadgetRadioButton.h //////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: GadgetRadioButton.h
-//
-// Created: Colin Day, June 2001
-//
-// Desc: Helpful interface for RadioButtons
-//
-// RadioButton IMAGE/COLOR organization
-// When control is enabled:
-// enabledDrawData[ 0 ] is the background image for the whole enabled control
-// enabledDrawData[ 1 ] is the enabled, unselected radio box
-// enabledDrawData[ 2 ] is the enabled, selected radio box
-//
-// When control is disabled:
-// disabledDrawData[ 0 ] is the background image for the whole disabled control
-// disabledDrawData[ 1 ] is the disabled, unselected radio box
-// disabledDrawData[ 2 ] si the disabled, selected radio box
-//
-// When control is hilited (mouse over it and enabled)
-// hiliteDrawData[ 0 ] is the background image for the whole hilited control
-// hiliteDrawData[ 1 ] is the hilited, unselected radio box
-// hiliteDrawData[ 2 ] is the hilited, selected radio box
-//
-// GadgetRadioGetEnabledImage // LEFT
-// GadgetRadioGetEnabledUncheckedBoxImage // Middle
-// GadgetRadioGetEnabledCheckedBoxImage // right
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "GameClient/GameWindow.h"
-
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// INLINING ///////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-extern void GadgetRadioSetText( GameWindow *g, UnicodeString text );
-extern void GadgetRadioSetSelection( GameWindow *g, Bool sendMsg );
-extern void GadgetRadioSetGroup( GameWindow *g, Int group, Int screen );
-
-inline void GadgetRadioSetEnabledImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 0, image ); }
-inline void GadgetRadioSetEnabledColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 0, color ); }
-inline void GadgetRadioSetEnabledBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 0, color ); }
-inline void GadgetRadioSetEnabledUncheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 1, image ); }
-inline void GadgetRadioSetEnabledUncheckedBoxColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 1, color ); }
-inline void GadgetRadioSetEnabledUncheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 1, color ); }
-inline void GadgetRadioSetEnabledCheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 2, image ); }
-inline void GadgetRadioSetEnabledCheckedBoxColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 2, color ); }
-inline void GadgetRadioSetEnabledCheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 2, color ); }
-inline const Image *GadgetRadioGetEnabledImage( GameWindow *g ) { return g->winGetEnabledImage( 0 ); }
-inline Color GadgetRadioGetEnabledColor( GameWindow *g ) { return g->winGetEnabledColor( 0 ); }
-inline Color GadgetRadioGetEnabledBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 0 ); }
-inline const Image *GadgetRadioGetEnabledUncheckedBoxImage( GameWindow *g ) { return g->winGetEnabledImage( 1 ); }
-inline Color GadgetRadioGetEnabledUncheckedBoxColor( GameWindow *g ) { return g->winGetEnabledColor( 1 ); }
-inline Color GadgetRadioGetEnabledUncheckedBoxBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 1 ); }
-inline const Image *GadgetRadioGetEnabledCheckedBoxImage( GameWindow *g ) { return g->winGetEnabledImage( 2 ); }
-inline Color GadgetRadioGetEnabledCheckedBoxColor( GameWindow *g ) { return g->winGetEnabledColor( 2 ); }
-inline Color GadgetRadioGetEnabledCheckedBoxBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 2 ); }
-
-inline void GadgetRadioSetDisabledImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 0, image ); }
-inline void GadgetRadioSetDisabledColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 0, color ); }
-inline void GadgetRadioSetDisabledBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 0, color ); }
-inline void GadgetRadioSetDisabledUncheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 1, image ); }
-inline void GadgetRadioSetDisabledUncheckedBoxColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 1, color ); }
-inline void GadgetRadioSetDisabledUncheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 1, color ); }
-inline void GadgetRadioSetDisabledCheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 2, image ); }
-inline void GadgetRadioSetDisabledCheckedBoxColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 2, color ); }
-inline void GadgetRadioSetDisabledCheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 2, color ); }
-inline const Image *GadgetRadioGetDisabledImage( GameWindow *g ) { return g->winGetDisabledImage( 0 ); }
-inline Color GadgetRadioGetDisabledColor( GameWindow *g ) { return g->winGetDisabledColor( 0 ); }
-inline Color GadgetRadioGetDisabledBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 0 ); }
-inline const Image *GadgetRadioGetDisabledUncheckedBoxImage( GameWindow *g ) { return g->winGetDisabledImage( 1 ); }
-inline Color GadgetRadioGetDisabledUncheckedBoxColor( GameWindow *g ) { return g->winGetDisabledColor( 1 ); }
-inline Color GadgetRadioGetDisabledUncheckedBoxBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 1 ); }
-inline const Image *GadgetRadioGetDisabledCheckedBoxImage( GameWindow *g ) { return g->winGetDisabledImage( 2 ); }
-inline Color GadgetRadioGetDisabledCheckedBoxColor( GameWindow *g ) { return g->winGetDisabledColor( 2 ); }
-inline Color GadgetRadioGetDisabledCheckedBoxBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 2 ); }
-
-inline void GadgetRadioSetHiliteImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 0, image ); }
-inline void GadgetRadioSetHiliteColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 0, color ); }
-inline void GadgetRadioSetHiliteBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 0, color ); }
-inline void GadgetRadioSetHiliteUncheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 1, image ); }
-inline void GadgetRadioSetHiliteUncheckedBoxColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 1, color ); }
-inline void GadgetRadioSetHiliteUncheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 1, color ); }
-inline void GadgetRadioSetHiliteCheckedBoxImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 2, image ); }
-inline void GadgetRadioSetHiliteCheckedBoxColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 2, color ); }
-inline void GadgetRadioSetHiliteCheckedBoxBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 2, color ); }
-inline const Image *GadgetRadioGetHiliteImage( GameWindow *g ) { return g->winGetHiliteImage( 0 ); }
-inline Color GadgetRadioGetHiliteColor( GameWindow *g ) { return g->winGetHiliteColor( 0 ); }
-inline Color GadgetRadioGetHiliteBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 0 ); }
-inline const Image *GadgetRadioGetHiliteUncheckedBoxImage( GameWindow *g ) { return g->winGetHiliteImage( 1 ); }
-inline Color GadgetRadioGetHiliteUncheckedBoxColor( GameWindow *g ) { return g->winGetHiliteColor( 1 ); }
-inline Color GadgetRadioGetHiliteUncheckedBoxBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 1 ); }
-inline const Image *GadgetRadioGetHiliteCheckedBoxImage( GameWindow *g ) { return g->winGetHiliteImage( 2 ); }
-inline Color GadgetRadioGetHiliteCheckedBoxColor( GameWindow *g ) { return g->winGetHiliteColor( 2 ); }
-inline Color GadgetRadioGetHiliteCheckedBoxBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 2 ); }
-
-inline const Image *GadgetRadioGetSelectedImage( GameWindow *g ) { return g->winGetHiliteImage( 3 ); }
-inline const Image *GadgetRadioGetSelectedUncheckedBoxImage( GameWindow *g ) { return g->winGetHiliteImage( 4 ); }
-inline const Image *GadgetRadioGetSelectedCheckedBoxImage( GameWindow *g ) { return g->winGetHiliteImage( 5 ); }
-
-
-// EXTERNALS //////////////////////////////////////////////////////////////////
diff --git a/Generals/Code/GameEngine/Include/GameClient/GadgetSlider.h b/Generals/Code/GameEngine/Include/GameClient/GadgetSlider.h
deleted file mode 100644
index 1b3cfb034ab..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/GadgetSlider.h
+++ /dev/null
@@ -1,439 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GadgetSlider.h ///////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: GadgetSlider.h
-//
-// Created: Colin Day, June 2001
-//
-// Desc: Helpful interface for Sliders
-//
-// Slider Sliders are constructed of 4 pieces, two end pieces,
-// a repeating center, and a smaller repeating center pieces
-// to fill small seams. Since there are vertical sliders
-// and horizontal sliders, the LEFT end of a horizontal
-// slider is stored in the same place as the TOP end for a
-// vertical slider. The RIGHT end of a horizontal is
-// also equivalent to the BOTTOM end of a vertical one.
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "GameClient/GameWindow.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetPushButton.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/Image.h"
-
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-enum{
-HORIZONTAL_SLIDER_THUMB_POSITION = HORIZONTAL_SLIDER_THUMB_HEIGHT *2/3
-};
-// INLINING ///////////////////////////////////////////////////////////////////
-
-inline void GadgetSliderGetMinMax( GameWindow *g, Int *min, Int *max )
-{
- SliderData *sData = (SliderData *)g->winGetUserData();
-
- *max = sData->maxVal;
- *min = sData->minVal;
-
-}
-inline GameWindow *GadgetSliderGetThumb( GameWindow *g ) { return g->winGetChild(); }
-
-inline void GadgetSliderSetPosition( GameWindow *win, Int pos )
-{
- TheWindowManager->winSendSystemMsg( win,
- GSM_SET_SLIDER,
- pos,
- 0 );
-}
-
-inline Int GadgetSliderGetPosition( GameWindow *win )
-{
- SliderData *sData = (SliderData *)win->winGetUserData();
- if (sData)
- {
- return sData->position;
- }
- return -1;
-}
-
-// sliders are drawn from pieces, a left/top, right/bottom, repeating center, and small repeating center
-inline void GadgetSliderSetEnabledImages( GameWindow *g, const Image *left, const Image *right, const Image *center, const Image *smallCenter )
-{
- g->winSetEnabledImage( 0, left );
- g->winSetEnabledImage( 1, right );
- g->winSetEnabledImage( 2, center );
- g->winSetEnabledImage( 3, smallCenter );
-}
-inline void GadgetSliderSetEnabledImageLeft( GameWindow *g, const Image *left ) { g->winSetEnabledImage( 0, left ); }
-inline void GadgetSliderSetEnabledImageTop( GameWindow *g, const Image *left ) { g->winSetEnabledImage( 0, left ); }
-inline void GadgetSliderSetEnabledImageRight( GameWindow *g, const Image *right ) { g->winSetEnabledImage( 1, right ); }
-inline void GadgetSliderSetEnabledImageBottom( GameWindow *g, const Image *right ) { g->winSetEnabledImage( 1, right ); }
-inline void GadgetSliderSetEnabledImageCenter( GameWindow *g, const Image *center ) { g->winSetEnabledImage( 2, center ); }
-inline void GadgetSliderSetEnabledImageSmallCenter( GameWindow *g, const Image *smallCenter ) { g->winSetEnabledImage( 3, smallCenter ); }
-inline void GadgetSliderSetEnabledColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 0, color ); }
-inline void GadgetSliderSetEnabledBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 0, color ); }
-inline const Image *GadgetSliderGetEnabledImageLeft( GameWindow *g ) { return g->winGetEnabledImage( 0 ); }
-inline const Image *GadgetSliderGetEnabledImageTop( GameWindow *g ) { return g->winGetEnabledImage( 0 ); }
-inline const Image *GadgetSliderGetEnabledImageRight( GameWindow *g ) { return g->winGetEnabledImage( 1 ); }
-inline const Image *GadgetSliderGetEnabledImageBottom( GameWindow *g ) { return g->winGetEnabledImage( 1 ); }
-inline const Image *GadgetSliderGetEnabledImageCenter( GameWindow *g ) { return g->winGetEnabledImage( 2 ); }
-inline const Image *GadgetSliderGetEnabledImageSmallCenter( GameWindow *g ) { return g->winGetEnabledImage( 3 ); }
-inline Color GadgetSliderGetEnabledColor( GameWindow *g ) { return g->winGetEnabledColor( 0 ); }
-inline Color GadgetSliderGetEnabledBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 0 ); }
-
-// sliders are drawn from pieces, a left/top, right/bottom, repeating center, and small repeating center
-inline void GadgetSliderSetDisabledImages( GameWindow *g, const Image *left, const Image *right, const Image *center, const Image *smallCenter )
-{
- g->winSetDisabledImage( 0, left );
- g->winSetDisabledImage( 1, right );
- g->winSetDisabledImage( 2, center );
- g->winSetDisabledImage( 3, smallCenter );
-}
-inline void GadgetSliderSetDisabledImageLeft( GameWindow *g, const Image *left ) { g->winSetDisabledImage( 0, left ); }
-inline void GadgetSliderSetDisabledImageTop( GameWindow *g, const Image *left ) { g->winSetDisabledImage( 0, left ); }
-inline void GadgetSliderSetDisabledImageRight( GameWindow *g, const Image *right ) { g->winSetDisabledImage( 1, right ); }
-inline void GadgetSliderSetDisabledImageBottom( GameWindow *g, const Image *right ) { g->winSetDisabledImage( 1, right ); }
-inline void GadgetSliderSetDisabledImageCenter( GameWindow *g, const Image *center ) { g->winSetDisabledImage( 2, center ); }
-inline void GadgetSliderSetDisabledImageSmallCenter( GameWindow *g, const Image *smallCenter ) { g->winSetDisabledImage( 3, smallCenter ); }
-inline void GadgetSliderSetDisabledColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 0, color ); }
-inline void GadgetSliderSetDisabledBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 0, color ); }
-inline const Image *GadgetSliderGetDisabledImageLeft( GameWindow *g ) { return g->winGetDisabledImage( 0 ); }
-inline const Image *GadgetSliderGetDisabledImageTop( GameWindow *g ) { return g->winGetDisabledImage( 0 ); }
-inline const Image *GadgetSliderGetDisabledImageRight( GameWindow *g ) { return g->winGetDisabledImage( 1 ); }
-inline const Image *GadgetSliderGetDisabledImageBottom( GameWindow *g ) { return g->winGetDisabledImage( 1 ); }
-inline const Image *GadgetSliderGetDisabledImageCenter( GameWindow *g ) { return g->winGetDisabledImage( 2 ); }
-inline const Image *GadgetSliderGetDisabledImageSmallCenter( GameWindow *g ){ return g->winGetDisabledImage( 3 ); }
-inline Color GadgetSliderGetDisabledColor( GameWindow *g ) { return g->winGetDisabledColor( 0 ); }
-inline Color GadgetSliderGetDisabledBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 0 ); }
-
-// sliders are drawn from pieces, a left/top, right/bottom, repeating center, and small repeating center
-inline void GadgetSliderSetHiliteImages( GameWindow *g, const Image *left, const Image *right, const Image *center, const Image *smallCenter )
-{
- g->winSetHiliteImage( 0, left );
- g->winSetHiliteImage( 1, right );
- g->winSetHiliteImage( 2, center );
- g->winSetHiliteImage( 3, smallCenter );
-}
-inline void GadgetSliderSetHiliteImageLeft( GameWindow *g, const Image *left ) { g->winSetHiliteImage( 0, left ); }
-inline void GadgetSliderSetHiliteImageTop( GameWindow *g, const Image *left ) { g->winSetHiliteImage( 0, left ); }
-inline void GadgetSliderSetHiliteImageRight( GameWindow *g, const Image *right ) { g->winSetHiliteImage( 1, right ); }
-inline void GadgetSliderSetHiliteImageBottom( GameWindow *g, const Image *right ) { g->winSetHiliteImage( 1, right ); }
-inline void GadgetSliderSetHiliteImageCenter( GameWindow *g, const Image *center ) { g->winSetHiliteImage( 2, center ); }
-inline void GadgetSliderSetHiliteImageSmallCenter( GameWindow *g, const Image *smallCenter ) { g->winSetHiliteImage( 3, smallCenter ); }
-inline void GadgetSliderSetHiliteColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 0, color ); }
-inline void GadgetSliderSetHiliteBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 0, color ); }
-inline const Image *GadgetSliderGetHiliteImageLeft( GameWindow *g ) { return g->winGetHiliteImage( 0 ); }
-inline const Image *GadgetSliderGetHiliteImageTop( GameWindow *g ) { return g->winGetHiliteImage( 0 ); }
-inline const Image *GadgetSliderGetHiliteImageRight( GameWindow *g ) { return g->winGetHiliteImage( 1 ); }
-inline const Image *GadgetSliderGetHiliteImageBottom( GameWindow *g ) { return g->winGetHiliteImage( 1 ); }
-inline const Image *GadgetSliderGetHiliteImageCenter( GameWindow *g ) { return g->winGetHiliteImage( 2 ); }
-inline const Image *GadgetSliderGetHiliteImageSmallCenter( GameWindow *g ){ return g->winGetHiliteImage( 3 ); }
-inline Color GadgetSliderGetHiliteColor( GameWindow *g ) { return g->winGetHiliteColor( 0 ); }
-inline Color GadgetSliderGetHiliteBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 0 ); }
-
-///////////////////////////////////////////////////////////////////////////////
-// Functions to set the images and colors for the slider thumb
-///////////////////////////////////////////////////////////////////////////////
-
-// enabled
-inline void GadgetSliderSetEnabledThumbImage( GameWindow *g, const Image *image )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetEnabledImage( thumb, image );
- }
-inline void GadgetSliderSetEnabledThumbColor( GameWindow *g, Color color )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetEnabledColor( thumb, color );
- }
-inline void GadgetSliderSetEnabledThumbBorderColor( GameWindow *g, Color color )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetEnabledBorderColor( thumb, color );
- }
-inline void GadgetSliderSetEnabledSelectedThumbImage( GameWindow *g, const Image *image )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetEnabledSelectedImage( thumb, image );
- }
-inline void GadgetSliderSetEnabledSelectedThumbColor( GameWindow *g, Color color )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetEnabledSelectedColor( thumb, color );
- }
-inline void GadgetSliderSetEnabledSelectedThumbBorderColor( GameWindow *g, Color color )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetEnabledSelectedBorderColor( thumb, color );
- }
-inline const Image *GadgetSliderGetEnabledThumbImage( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetEnabledImage( thumb );
- else
- return nullptr;
- }
-inline Color GadgetSliderGetEnabledThumbColor( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetEnabledColor( thumb );
- else
- return WIN_COLOR_UNDEFINED;
- }
-inline Color GadgetSliderGetEnabledThumbBorderColor( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetEnabledBorderColor( thumb );
- else
- return WIN_COLOR_UNDEFINED;
- }
-inline const Image *GadgetSliderGetEnabledSelectedThumbImage( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetEnabledSelectedImage( thumb );
- else
- return nullptr;
- }
-inline Color GadgetSliderGetEnabledSelectedThumbColor( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetEnabledSelectedColor( thumb );
- else
- return WIN_COLOR_UNDEFINED;
- }
-inline Color GadgetSliderGetEnabledSelectedThumbBorderColor( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetEnabledSelectedBorderColor( thumb );
- else
- return WIN_COLOR_UNDEFINED;
- }
-
-
-// disabled
-inline void GadgetSliderSetDisabledThumbImage( GameWindow *g, const Image *image )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetDisabledImage( thumb, image );
- }
-inline void GadgetSliderSetDisabledThumbColor( GameWindow *g, Color color )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetDisabledColor( thumb, color );
- }
-inline void GadgetSliderSetDisabledThumbBorderColor( GameWindow *g, Color color )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetDisabledBorderColor( thumb, color );
- }
-inline void GadgetSliderSetDisabledSelectedThumbImage( GameWindow *g, const Image *image )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetDisabledSelectedImage( thumb, image );
- }
-inline void GadgetSliderSetDisabledSelectedThumbColor( GameWindow *g, Color color )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetDisabledSelectedColor( thumb, color );
- }
-inline void GadgetSliderSetDisabledSelectedThumbBorderColor( GameWindow *g, Color color )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetDisabledSelectedBorderColor( thumb, color );
- }
-inline const Image *GadgetSliderGetDisabledThumbImage( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetDisabledImage( thumb );
- else
- return nullptr;
- }
-inline Color GadgetSliderGetDisabledThumbColor( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetDisabledColor( thumb );
- else
- return WIN_COLOR_UNDEFINED;
- }
-inline Color GadgetSliderGetDisabledThumbBorderColor( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetDisabledBorderColor( thumb );
- else
- return WIN_COLOR_UNDEFINED;
- }
-inline const Image *GadgetSliderGetDisabledSelectedThumbImage( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetDisabledSelectedImage( thumb );
- else
- return nullptr;
- }
-inline Color GadgetSliderGetDisabledSelectedThumbColor( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetDisabledSelectedColor( thumb );
- else
- return WIN_COLOR_UNDEFINED;
- }
-inline Color GadgetSliderGetDisabledSelectedThumbBorderColor( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetDisabledSelectedBorderColor( thumb );
- else
- return WIN_COLOR_UNDEFINED;
- }
-
-// hilite
-inline void GadgetSliderSetHiliteThumbImage( GameWindow *g, const Image *image )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetHiliteImage( thumb, image );
- }
-inline void GadgetSliderSetHiliteThumbColor( GameWindow *g, Color color )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetHiliteColor( thumb, color );
- }
-inline void GadgetSliderSetHiliteThumbBorderColor( GameWindow *g, Color color )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetHiliteBorderColor( thumb, color );
- }
-inline void GadgetSliderSetHiliteSelectedThumbImage( GameWindow *g, const Image *image )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetHiliteSelectedImage( thumb, image );
- }
-inline void GadgetSliderSetHiliteSelectedThumbColor( GameWindow *g, Color color )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetHiliteSelectedColor( thumb, color );
- }
-inline void GadgetSliderSetHiliteSelectedThumbBorderColor( GameWindow *g, Color color )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- GadgetButtonSetHiliteSelectedBorderColor( thumb, color );
- }
-inline const Image *GadgetSliderGetHiliteThumbImage( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetHiliteImage( thumb );
- else
- return nullptr;
- }
-inline Color GadgetSliderGetHiliteThumbColor( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetHiliteColor( thumb );
- else
- return WIN_COLOR_UNDEFINED;
- }
-inline Color GadgetSliderGetHiliteThumbBorderColor( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetHiliteBorderColor( thumb );
- else
- return WIN_COLOR_UNDEFINED;
- }
-inline const Image *GadgetSliderGetHiliteSelectedThumbImage( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetHiliteSelectedImage( thumb );
- else
- return nullptr;
- }
-inline Color GadgetSliderGetHiliteSelectedThumbColor( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetHiliteSelectedColor( thumb );
- else
- return WIN_COLOR_UNDEFINED;
- }
-inline Color GadgetSliderGetHiliteSelectedThumbBorderColor( GameWindow *g )
- {
- GameWindow *thumb = g->winGetChild();
- if( thumb )
- return GadgetButtonGetHiliteSelectedBorderColor( thumb );
- else
- return WIN_COLOR_UNDEFINED;
- }
-
-// EXTERNALS //////////////////////////////////////////////////////////////////
diff --git a/Generals/Code/GameEngine/Include/GameClient/GadgetStaticText.h b/Generals/Code/GameEngine/Include/GameClient/GadgetStaticText.h
deleted file mode 100644
index 83090aec761..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/GadgetStaticText.h
+++ /dev/null
@@ -1,100 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GadgetStaticText.h ///////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: GadgetStaticText.h
-//
-// Created: Colin Day, June 2001
-//
-// Desc: Helpful interface for StaticTexts
-//
-// StaticText IMAGE/COLOR organization
-// When control is enabled:
-// enabledDrawData[ 0 ] is the background image for the whole enabled control
-//
-// When control is disabled:
-// disabledDrawData[ 0 ] is the background image for the whole disabled control
-//
-// When control is hilited (mouse over it and enabled)
-// hiliteDrawData[ 0 ] is the background image for the whole hilited control
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "GameClient/GameWindow.h"
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// INLINING ///////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-extern void GadgetStaticTextSetText( GameWindow *window, UnicodeString text );
-extern UnicodeString GadgetStaticTextGetText( GameWindow *window );
-extern void GadgetStaticTextSetFont( GameWindow *window, GameFont *font );
-
-// text colors
-
-// enabled background
-inline void GadgetStaticTextSetEnabledImage( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 0, image ); }
-inline void GadgetStaticTextSetEnabledColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 0, color ); }
-inline void GadgetStaticTextSetEnabledBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 0, color ); }
-inline const Image *GadgetStaticTextGetEnabledImage( GameWindow *g ) { return g->winGetEnabledImage( 0 ); }
-inline Color GadgetStaticTextGetEnabledColor( GameWindow *g ) { return g->winGetEnabledColor( 0 ); }
-inline Color GadgetStaticTextGetEnabledBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 0 ); }
-
-// disabled background
-inline void GadgetStaticTextSetDisabledImage( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 0, image ); }
-inline void GadgetStaticTextSetDisabledColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 0, color ); }
-inline void GadgetStaticTextSetDisabledBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 0, color ); }
-inline const Image *GadgetStaticTextGetDisabledImage( GameWindow *g ) { return g->winGetDisabledImage( 0 ); }
-inline Color GadgetStaticTextGetDisabledColor( GameWindow *g ) { return g->winGetDisabledColor( 0 ); }
-inline Color GadgetStaticTextGetDisabledBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 0 ); }
-
-// hilite if we choose to use it
-inline void GadgetStaticTextSetHiliteImage( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 0, image ); }
-inline void GadgetStaticTextSetHiliteColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 0, color ); }
-inline void GadgetStaticTextSetHiliteBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 0, color ); }
-inline const Image *GadgetStaticTextGetHiliteImage( GameWindow *g ) { return g->winGetHiliteImage( 0 ); }
-inline Color GadgetStaticTextGetHiliteColor( GameWindow *g ) { return g->winGetHiliteColor( 0 ); }
-inline Color GadgetStaticTextGetHiliteBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 0 ); }
-
-// EXTERNALS //////////////////////////////////////////////////////////////////
diff --git a/Generals/Code/GameEngine/Include/GameClient/GadgetTabControl.h b/Generals/Code/GameEngine/Include/GameClient/GadgetTabControl.h
deleted file mode 100644
index 17a91ba631a..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/GadgetTabControl.h
+++ /dev/null
@@ -1,273 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: C:\projects\RTS\code\gameengine\Include\GameClient\GadgetTabControl.h
-//
-// Created: Graham Smallwood, November 2001
-//
-// Desc: Helpful interface for TabControls
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-enum
-{
- GTC_BACKGROUND = 0,
- GTC_TAB_0,
- GTC_TAB_1,
- GTC_TAB_2,
- GTC_TAB_3,
- GTC_TAB_4,
- GTC_TAB_5,
- GTC_TAB_6,
- GTC_TAB_7
-};
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "GameClient/GameWindow.h"
-
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-extern void GadgetTabControlComputeTabRegion( GameWindow *tabControl );///< Recalc the tab positions based on userData
-extern void GadgetTabControlCreateSubPanes( GameWindow *tabControl);///< Create (destroy old) Windows attached to userData as Panes
-extern void GadgetTabControlComputeSubPaneSize( GameWindow *tabControl, Int *width, Int *height, Int *x, Int *y );///winSetEnabledImage( GTC_TAB_0, image ); }
-inline void GadgetTabControlSetEnabledColorTabZero( GameWindow *g, Color color ) { g->winSetEnabledColor( GTC_TAB_0, color ); }
-inline void GadgetTabControlSetEnabledBorderColorTabZero( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( GTC_TAB_0, color ); }
-inline const Image *GadgetTabControlGetEnabledImageTabZero( GameWindow *g ) { return g->winGetEnabledImage( GTC_TAB_0 ); }
-inline Color GadgetTabControlGetEnabledColorTabZero( GameWindow *g ) { return g->winGetEnabledColor( GTC_TAB_0 ); }
-inline Color GadgetTabControlGetEnabledBorderColorTabZero( GameWindow *g ) { return g->winGetEnabledBorderColor( GTC_TAB_0 ); }
-
-inline void GadgetTabControlSetEnabledImageTabOne( GameWindow *g, const Image *image ) { g->winSetEnabledImage( GTC_TAB_1, image ); }
-inline void GadgetTabControlSetEnabledColorTabOne( GameWindow *g, Color color ) { g->winSetEnabledColor( GTC_TAB_1, color ); }
-inline void GadgetTabControlSetEnabledBorderColorTabOne( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( GTC_TAB_1, color ); }
-inline const Image *GadgetTabControlGetEnabledImageTabOne( GameWindow *g ) { return g->winGetEnabledImage( GTC_TAB_1 ); }
-inline Color GadgetTabControlGetEnabledColorTabOne( GameWindow *g ) { return g->winGetEnabledColor( GTC_TAB_1 ); }
-inline Color GadgetTabControlGetEnabledBorderColorTabOne( GameWindow *g ) { return g->winGetEnabledBorderColor( GTC_TAB_1 ); }
-
-inline void GadgetTabControlSetEnabledImageTabTwo( GameWindow *g, const Image *image ) { g->winSetEnabledImage( GTC_TAB_2, image ); }
-inline void GadgetTabControlSetEnabledColorTabTwo( GameWindow *g, Color color ) { g->winSetEnabledColor( GTC_TAB_2, color ); }
-inline void GadgetTabControlSetEnabledBorderColorTabTwo( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( GTC_TAB_2, color ); }
-inline const Image *GadgetTabControlGetEnabledImageTabTwo( GameWindow *g ) { return g->winGetEnabledImage( GTC_TAB_2 ); }
-inline Color GadgetTabControlGetEnabledColorTabTwo( GameWindow *g ) { return g->winGetEnabledColor( GTC_TAB_2 ); }
-inline Color GadgetTabControlGetEnabledBorderColorTabTwo( GameWindow *g ) { return g->winGetEnabledBorderColor( GTC_TAB_2 ); }
-
-inline void GadgetTabControlSetEnabledImageTabThree( GameWindow *g, const Image *image ) { g->winSetEnabledImage( GTC_TAB_3, image ); }
-inline void GadgetTabControlSetEnabledColorTabThree( GameWindow *g, Color color ) { g->winSetEnabledColor( GTC_TAB_3, color ); }
-inline void GadgetTabControlSetEnabledBorderColorTabThree( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( GTC_TAB_3, color ); }
-inline const Image *GadgetTabControlGetEnabledImageTabThree( GameWindow *g ) { return g->winGetEnabledImage( GTC_TAB_3 ); }
-inline Color GadgetTabControlGetEnabledColorTabThree( GameWindow *g ) { return g->winGetEnabledColor( GTC_TAB_3 ); }
-inline Color GadgetTabControlGetEnabledBorderColorTabThree( GameWindow *g ) { return g->winGetEnabledBorderColor( GTC_TAB_3 ); }
-
-inline void GadgetTabControlSetEnabledImageTabFour( GameWindow *g, const Image *image ) { g->winSetEnabledImage( GTC_TAB_4, image ); }
-inline void GadgetTabControlSetEnabledColorTabFour( GameWindow *g, Color color ) { g->winSetEnabledColor( GTC_TAB_4, color ); }
-inline void GadgetTabControlSetEnabledBorderColorTabFour( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( GTC_TAB_4, color ); }
-inline const Image *GadgetTabControlGetEnabledImageTabFour( GameWindow *g ) { return g->winGetEnabledImage( GTC_TAB_4 ); }
-inline Color GadgetTabControlGetEnabledColorTabFour( GameWindow *g ) { return g->winGetEnabledColor( GTC_TAB_4 ); }
-inline Color GadgetTabControlGetEnabledBorderColorTabFour( GameWindow *g ) { return g->winGetEnabledBorderColor( GTC_TAB_4 ); }
-
-inline void GadgetTabControlSetEnabledImageTabFive( GameWindow *g, const Image *image ) { g->winSetEnabledImage( GTC_TAB_5, image ); }
-inline void GadgetTabControlSetEnabledColorTabFive( GameWindow *g, Color color ) { g->winSetEnabledColor( GTC_TAB_5, color ); }
-inline void GadgetTabControlSetEnabledBorderColorTabFive( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( GTC_TAB_5, color ); }
-inline const Image *GadgetTabControlGetEnabledImageTabFive( GameWindow *g ) { return g->winGetEnabledImage( GTC_TAB_5 ); }
-inline Color GadgetTabControlGetEnabledColorTabFive( GameWindow *g ) { return g->winGetEnabledColor( GTC_TAB_5 ); }
-inline Color GadgetTabControlGetEnabledBorderColorTabFive( GameWindow *g ) { return g->winGetEnabledBorderColor( GTC_TAB_5 ); }
-
-inline void GadgetTabControlSetEnabledImageTabSix( GameWindow *g, const Image *image ) { g->winSetEnabledImage( GTC_TAB_6, image ); }
-inline void GadgetTabControlSetEnabledColorTabSix( GameWindow *g, Color color ) { g->winSetEnabledColor( GTC_TAB_6, color ); }
-inline void GadgetTabControlSetEnabledBorderColorTabSix( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( GTC_TAB_6, color ); }
-inline const Image *GadgetTabControlGetEnabledImageTabSix( GameWindow *g ) { return g->winGetEnabledImage( GTC_TAB_6 ); }
-inline Color GadgetTabControlGetEnabledColorTabSix( GameWindow *g ) { return g->winGetEnabledColor( GTC_TAB_6 ); }
-inline Color GadgetTabControlGetEnabledBorderColorTabSix( GameWindow *g ) { return g->winGetEnabledBorderColor( GTC_TAB_6 ); }
-
-inline void GadgetTabControlSetEnabledImageTabSeven( GameWindow *g, const Image *image ) { g->winSetEnabledImage( GTC_TAB_7, image ); }
-inline void GadgetTabControlSetEnabledColorTabSeven( GameWindow *g, Color color ) { g->winSetEnabledColor( GTC_TAB_7, color ); }
-inline void GadgetTabControlSetEnabledBorderColorTabSeven( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( GTC_TAB_7, color ); }
-inline const Image *GadgetTabControlGetEnabledImageTabSeven( GameWindow *g ) { return g->winGetEnabledImage( GTC_TAB_7 ); }
-inline Color GadgetTabControlGetEnabledColorTabSeven( GameWindow *g ) { return g->winGetEnabledColor( GTC_TAB_7 ); }
-inline Color GadgetTabControlGetEnabledBorderColorTabSeven( GameWindow *g ) { return g->winGetEnabledBorderColor( GTC_TAB_7 ); }
-
-inline void GadgetTabControlSetEnabledImageBackground( GameWindow *g, const Image *image ) { g->winSetEnabledImage( GTC_BACKGROUND, image ); }
-inline void GadgetTabControlSetEnabledColorBackground( GameWindow *g, Color color ) { g->winSetEnabledColor( GTC_BACKGROUND, color ); }
-inline void GadgetTabControlSetEnabledBorderColorBackground( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( GTC_BACKGROUND, color ); }
-inline const Image *GadgetTabControlGetEnabledImageBackground( GameWindow *g ) { return g->winGetEnabledImage( GTC_BACKGROUND ); }
-inline Color GadgetTabControlGetEnabledColorBackground( GameWindow *g ) { return g->winGetEnabledColor( GTC_BACKGROUND ); }
-inline Color GadgetTabControlGetEnabledBorderColorBackground( GameWindow *g ) { return g->winGetEnabledBorderColor( GTC_BACKGROUND ); }
-
-
-
-
-inline void GadgetTabControlSetDisabledImageTabZero( GameWindow *g, const Image *image ) { g->winSetDisabledImage( GTC_TAB_0, image ); }
-inline void GadgetTabControlSetDisabledColorTabZero( GameWindow *g, Color color ) { g->winSetDisabledColor( GTC_TAB_0, color ); }
-inline void GadgetTabControlSetDisabledBorderColorTabZero( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( GTC_TAB_0, color ); }
-inline const Image *GadgetTabControlGetDisabledImageTabZero( GameWindow *g ) { return g->winGetDisabledImage( GTC_TAB_0 ); }
-inline Color GadgetTabControlGetDisabledColorTabZero( GameWindow *g ) { return g->winGetDisabledColor( GTC_TAB_0 ); }
-inline Color GadgetTabControlGetDisabledBorderColorTabZero( GameWindow *g ) { return g->winGetDisabledBorderColor( GTC_TAB_0 ); }
-
-inline void GadgetTabControlSetDisabledImageTabOne( GameWindow *g, const Image *image ) { g->winSetDisabledImage( GTC_TAB_1, image ); }
-inline void GadgetTabControlSetDisabledColorTabOne( GameWindow *g, Color color ) { g->winSetDisabledColor( GTC_TAB_1, color ); }
-inline void GadgetTabControlSetDisabledBorderColorTabOne( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( GTC_TAB_1, color ); }
-inline const Image *GadgetTabControlGetDisabledImageTabOne( GameWindow *g ) { return g->winGetDisabledImage( GTC_TAB_1 ); }
-inline Color GadgetTabControlGetDisabledColorTabOne( GameWindow *g ) { return g->winGetDisabledColor( GTC_TAB_1 ); }
-inline Color GadgetTabControlGetDisabledBorderColorTabOne( GameWindow *g ) { return g->winGetDisabledBorderColor( GTC_TAB_1 ); }
-
-inline void GadgetTabControlSetDisabledImageTabTwo( GameWindow *g, const Image *image ) { g->winSetDisabledImage( GTC_TAB_2, image ); }
-inline void GadgetTabControlSetDisabledColorTabTwo( GameWindow *g, Color color ) { g->winSetDisabledColor( GTC_TAB_2, color ); }
-inline void GadgetTabControlSetDisabledBorderColorTabTwo( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( GTC_TAB_2, color ); }
-inline const Image *GadgetTabControlGetDisabledImageTabTwo( GameWindow *g ) { return g->winGetDisabledImage( GTC_TAB_2 ); }
-inline Color GadgetTabControlGetDisabledColorTabTwo( GameWindow *g ) { return g->winGetDisabledColor( GTC_TAB_2 ); }
-inline Color GadgetTabControlGetDisabledBorderColorTabTwo( GameWindow *g ) { return g->winGetDisabledBorderColor( GTC_TAB_2 ); }
-
-inline void GadgetTabControlSetDisabledImageTabThree( GameWindow *g, const Image *image ) { g->winSetDisabledImage( GTC_TAB_3, image ); }
-inline void GadgetTabControlSetDisabledColorTabThree( GameWindow *g, Color color ) { g->winSetDisabledColor( GTC_TAB_3, color ); }
-inline void GadgetTabControlSetDisabledBorderColorTabThree( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( GTC_TAB_3, color ); }
-inline const Image *GadgetTabControlGetDisabledImageTabThree( GameWindow *g ) { return g->winGetDisabledImage( GTC_TAB_3 ); }
-inline Color GadgetTabControlGetDisabledColorTabThree( GameWindow *g ) { return g->winGetDisabledColor( GTC_TAB_3 ); }
-inline Color GadgetTabControlGetDisabledBorderColorTabThree( GameWindow *g ) { return g->winGetDisabledBorderColor( GTC_TAB_3 ); }
-
-inline void GadgetTabControlSetDisabledImageTabFour( GameWindow *g, const Image *image ) { g->winSetDisabledImage( GTC_TAB_4, image ); }
-inline void GadgetTabControlSetDisabledColorTabFour( GameWindow *g, Color color ) { g->winSetDisabledColor( GTC_TAB_4, color ); }
-inline void GadgetTabControlSetDisabledBorderColorTabFour( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( GTC_TAB_4, color ); }
-inline const Image *GadgetTabControlGetDisabledImageTabFour( GameWindow *g ) { return g->winGetDisabledImage( GTC_TAB_4 ); }
-inline Color GadgetTabControlGetDisabledColorTabFour( GameWindow *g ) { return g->winGetDisabledColor( GTC_TAB_4 ); }
-inline Color GadgetTabControlGetDisabledBorderColorTabFour( GameWindow *g ) { return g->winGetDisabledBorderColor( GTC_TAB_4 ); }
-
-inline void GadgetTabControlSetDisabledImageTabFive( GameWindow *g, const Image *image ) { g->winSetDisabledImage( GTC_TAB_5, image ); }
-inline void GadgetTabControlSetDisabledColorTabFive( GameWindow *g, Color color ) { g->winSetDisabledColor( GTC_TAB_5, color ); }
-inline void GadgetTabControlSetDisabledBorderColorTabFive( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( GTC_TAB_5, color ); }
-inline const Image *GadgetTabControlGetDisabledImageTabFive( GameWindow *g ) { return g->winGetDisabledImage( GTC_TAB_5 ); }
-inline Color GadgetTabControlGetDisabledColorTabFive( GameWindow *g ) { return g->winGetDisabledColor( GTC_TAB_5 ); }
-inline Color GadgetTabControlGetDisabledBorderColorTabFive( GameWindow *g ) { return g->winGetDisabledBorderColor( GTC_TAB_5 ); }
-
-inline void GadgetTabControlSetDisabledImageTabSix( GameWindow *g, const Image *image ) { g->winSetDisabledImage( GTC_TAB_6, image ); }
-inline void GadgetTabControlSetDisabledColorTabSix( GameWindow *g, Color color ) { g->winSetDisabledColor( GTC_TAB_6, color ); }
-inline void GadgetTabControlSetDisabledBorderColorTabSix( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( GTC_TAB_6, color ); }
-inline const Image *GadgetTabControlGetDisabledImageTabSix( GameWindow *g ) { return g->winGetDisabledImage( GTC_TAB_6 ); }
-inline Color GadgetTabControlGetDisabledColorTabSix( GameWindow *g ) { return g->winGetDisabledColor( GTC_TAB_6 ); }
-inline Color GadgetTabControlGetDisabledBorderColorTabSix( GameWindow *g ) { return g->winGetDisabledBorderColor( GTC_TAB_6 ); }
-
-inline void GadgetTabControlSetDisabledImageTabSeven( GameWindow *g, const Image *image ) { g->winSetDisabledImage( GTC_TAB_7, image ); }
-inline void GadgetTabControlSetDisabledColorTabSeven( GameWindow *g, Color color ) { g->winSetDisabledColor( GTC_TAB_7, color ); }
-inline void GadgetTabControlSetDisabledBorderColorTabSeven( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( GTC_TAB_7, color ); }
-inline const Image *GadgetTabControlGetDisabledImageTabSeven( GameWindow *g ) { return g->winGetDisabledImage( GTC_TAB_7 ); }
-inline Color GadgetTabControlGetDisabledColorTabSeven( GameWindow *g ) { return g->winGetDisabledColor( GTC_TAB_7 ); }
-inline Color GadgetTabControlGetDisabledBorderColorTabSeven( GameWindow *g ) { return g->winGetDisabledBorderColor( GTC_TAB_7 ); }
-
-inline void GadgetTabControlSetDisabledImageBackground( GameWindow *g, const Image *image ) { g->winSetDisabledImage( GTC_BACKGROUND, image ); }
-inline void GadgetTabControlSetDisabledColorBackground( GameWindow *g, Color color ) { g->winSetDisabledColor( GTC_BACKGROUND, color ); }
-inline void GadgetTabControlSetDisabledBorderColorBackground( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( GTC_BACKGROUND, color ); }
-inline const Image *GadgetTabControlGetDisabledImageBackground( GameWindow *g ) { return g->winGetDisabledImage( GTC_BACKGROUND ); }
-inline Color GadgetTabControlGetDisabledColorBackground( GameWindow *g ) { return g->winGetDisabledColor( GTC_BACKGROUND ); }
-inline Color GadgetTabControlGetDisabledBorderColorBackground( GameWindow *g ) { return g->winGetDisabledBorderColor( GTC_BACKGROUND ); }
-
-
-
-
-inline void GadgetTabControlSetHiliteImageTabZero( GameWindow *g, const Image *image ) { g->winSetHiliteImage( GTC_TAB_0, image ); }
-inline void GadgetTabControlSetHiliteColorTabZero( GameWindow *g, Color color ) { g->winSetHiliteColor( GTC_TAB_0, color ); }
-inline void GadgetTabControlSetHiliteBorderColorTabZero( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( GTC_TAB_0, color ); }
-inline const Image *GadgetTabControlGetHiliteImageTabZero( GameWindow *g ) { return g->winGetHiliteImage( GTC_TAB_0 ); }
-inline Color GadgetTabControlGetHiliteColorTabZero( GameWindow *g ) { return g->winGetHiliteColor( GTC_TAB_0 ); }
-inline Color GadgetTabControlGetHiliteBorderColorTabZero( GameWindow *g ) { return g->winGetHiliteBorderColor( GTC_TAB_0 ); }
-
-inline void GadgetTabControlSetHiliteImageTabOne( GameWindow *g, const Image *image ) { g->winSetHiliteImage( GTC_TAB_1, image ); }
-inline void GadgetTabControlSetHiliteColorTabOne( GameWindow *g, Color color ) { g->winSetHiliteColor( GTC_TAB_1, color ); }
-inline void GadgetTabControlSetHiliteBorderColorTabOne( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( GTC_TAB_1, color ); }
-inline const Image *GadgetTabControlGetHiliteImageTabOne( GameWindow *g ) { return g->winGetHiliteImage( GTC_TAB_1 ); }
-inline Color GadgetTabControlGetHiliteColorTabOne( GameWindow *g ) { return g->winGetHiliteColor( GTC_TAB_1 ); }
-inline Color GadgetTabControlGetHiliteBorderColorTabOne( GameWindow *g ) { return g->winGetHiliteBorderColor( GTC_TAB_1 ); }
-
-inline void GadgetTabControlSetHiliteImageTabTwo( GameWindow *g, const Image *image ) { g->winSetHiliteImage( GTC_TAB_2, image ); }
-inline void GadgetTabControlSetHiliteColorTabTwo( GameWindow *g, Color color ) { g->winSetHiliteColor( GTC_TAB_2, color ); }
-inline void GadgetTabControlSetHiliteBorderColorTabTwo( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( GTC_TAB_2, color ); }
-inline const Image *GadgetTabControlGetHiliteImageTabTwo( GameWindow *g ) { return g->winGetHiliteImage( GTC_TAB_2 ); }
-inline Color GadgetTabControlGetHiliteColorTabTwo( GameWindow *g ) { return g->winGetHiliteColor( GTC_TAB_2 ); }
-inline Color GadgetTabControlGetHiliteBorderColorTabTwo( GameWindow *g ) { return g->winGetHiliteBorderColor( GTC_TAB_2 ); }
-
-inline void GadgetTabControlSetHiliteImageTabThree( GameWindow *g, const Image *image ) { g->winSetHiliteImage( GTC_TAB_3, image ); }
-inline void GadgetTabControlSetHiliteColorTabThree( GameWindow *g, Color color ) { g->winSetHiliteColor( GTC_TAB_3, color ); }
-inline void GadgetTabControlSetHiliteBorderColorTabThree( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( GTC_TAB_3, color ); }
-inline const Image *GadgetTabControlGetHiliteImageTabThree( GameWindow *g ) { return g->winGetHiliteImage( GTC_TAB_3 ); }
-inline Color GadgetTabControlGetHiliteColorTabThree( GameWindow *g ) { return g->winGetHiliteColor( GTC_TAB_3 ); }
-inline Color GadgetTabControlGetHiliteBorderColorTabThree( GameWindow *g ) { return g->winGetHiliteBorderColor( GTC_TAB_3 ); }
-
-inline void GadgetTabControlSetHiliteImageTabFour( GameWindow *g, const Image *image ) { g->winSetHiliteImage( GTC_TAB_4, image ); }
-inline void GadgetTabControlSetHiliteColorTabFour( GameWindow *g, Color color ) { g->winSetHiliteColor( GTC_TAB_4, color ); }
-inline void GadgetTabControlSetHiliteBorderColorTabFour( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( GTC_TAB_4, color ); }
-inline const Image *GadgetTabControlGetHiliteImageTabFour( GameWindow *g ) { return g->winGetHiliteImage( GTC_TAB_4 ); }
-inline Color GadgetTabControlGetHiliteColorTabFour( GameWindow *g ) { return g->winGetHiliteColor( GTC_TAB_4 ); }
-inline Color GadgetTabControlGetHiliteBorderColorTabFour( GameWindow *g ) { return g->winGetHiliteBorderColor( GTC_TAB_4 ); }
-
-inline void GadgetTabControlSetHiliteImageTabFive( GameWindow *g, const Image *image ) { g->winSetHiliteImage( GTC_TAB_5, image ); }
-inline void GadgetTabControlSetHiliteColorTabFive( GameWindow *g, Color color ) { g->winSetHiliteColor( GTC_TAB_5, color ); }
-inline void GadgetTabControlSetHiliteBorderColorTabFive( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( GTC_TAB_5, color ); }
-inline const Image *GadgetTabControlGetHiliteImageTabFive( GameWindow *g ) { return g->winGetHiliteImage( GTC_TAB_5 ); }
-inline Color GadgetTabControlGetHiliteColorTabFive( GameWindow *g ) { return g->winGetHiliteColor( GTC_TAB_5 ); }
-inline Color GadgetTabControlGetHiliteBorderColorTabFive( GameWindow *g ) { return g->winGetHiliteBorderColor( GTC_TAB_5 ); }
-
-inline void GadgetTabControlSetHiliteImageTabSix( GameWindow *g, const Image *image ) { g->winSetHiliteImage( GTC_TAB_6, image ); }
-inline void GadgetTabControlSetHiliteColorTabSix( GameWindow *g, Color color ) { g->winSetHiliteColor( GTC_TAB_6, color ); }
-inline void GadgetTabControlSetHiliteBorderColorTabSix( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( GTC_TAB_6, color ); }
-inline const Image *GadgetTabControlGetHiliteImageTabSix( GameWindow *g ) { return g->winGetHiliteImage( GTC_TAB_6 ); }
-inline Color GadgetTabControlGetHiliteColorTabSix( GameWindow *g ) { return g->winGetHiliteColor( GTC_TAB_6 ); }
-inline Color GadgetTabControlGetHiliteBorderColorTabSix( GameWindow *g ) { return g->winGetHiliteBorderColor( GTC_TAB_6 ); }
-
-inline void GadgetTabControlSetHiliteImageTabSeven( GameWindow *g, const Image *image ) { g->winSetHiliteImage( GTC_TAB_7, image ); }
-inline void GadgetTabControlSetHiliteColorTabSeven( GameWindow *g, Color color ) { g->winSetHiliteColor( GTC_TAB_7, color ); }
-inline void GadgetTabControlSetHiliteBorderColorTabSeven( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( GTC_TAB_7, color ); }
-inline const Image *GadgetTabControlGetHiliteImageTabSeven( GameWindow *g ) { return g->winGetHiliteImage( GTC_TAB_7 ); }
-inline Color GadgetTabControlGetHiliteColorTabSeven( GameWindow *g ) { return g->winGetHiliteColor( GTC_TAB_7 ); }
-inline Color GadgetTabControlGetHiliteBorderColorTabSeven( GameWindow *g ) { return g->winGetHiliteBorderColor( GTC_TAB_7 ); }
-
-inline void GadgetTabControlSetHiliteImageBackground( GameWindow *g, const Image *image ) { g->winSetHiliteImage( GTC_BACKGROUND, image ); }
-inline void GadgetTabControlSetHiliteColorBackground( GameWindow *g, Color color ) { g->winSetHiliteColor( GTC_BACKGROUND, color ); }
-inline void GadgetTabControlSetHiliteBorderColorBackground( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( GTC_BACKGROUND, color ); }
-inline const Image *GadgetTabControlGetHiliteImageBackground( GameWindow *g ) { return g->winGetHiliteImage( GTC_BACKGROUND ); }
-inline Color GadgetTabControlGetHiliteColorBackground( GameWindow *g ) { return g->winGetHiliteColor( GTC_BACKGROUND ); }
-inline Color GadgetTabControlGetHiliteBorderColorBackground( GameWindow *g ) { return g->winGetHiliteBorderColor( GTC_BACKGROUND ); }
-
-
-// EXTERNALS //////////////////////////////////////////////////////////////////
diff --git a/Generals/Code/GameEngine/Include/GameClient/GadgetTextEntry.h b/Generals/Code/GameEngine/Include/GameClient/GadgetTextEntry.h
deleted file mode 100644
index 5d9dd65703d..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/GadgetTextEntry.h
+++ /dev/null
@@ -1,124 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GadgetTextEntry.h ////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: GadgetTextEntry.h
-//
-// Created: Colin Day, June 2001
-//
-// Desc: Helpful interface for TextEntrys
-//
-// TextEntry IMAGE/COLOR organization
-//
-// note that windows that have an outlined text field will use the color
-// for the outline specified with the TextBorder... functions
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "GameClient/GameWindowManager.h"
-
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-class GameWindow;
-
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// INLINING ///////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-inline void GadgetTextEntrySetText( GameWindow *g, UnicodeString text )
-{
- TheWindowManager->winSendSystemMsg( g, GEM_SET_TEXT, (WindowMsgData)&text, 0 );
-}
-extern UnicodeString GadgetTextEntryGetText( GameWindow *textentry ); ///< Get the text from the text entry field
-extern void GadgetTextEntrySetMaxLen( GameWindow *g, Short length );
-extern void GadgetTextEntrySetFont( GameWindow *g, GameFont *font ); ///< set font for window and edit text display strings
-inline void GadgetTextEntrySetTextColor( GameWindow *g, Color color )
-{
- Color back = g->winGetEnabledTextBorderColor();
- g->winSetEnabledTextColors(color,back);
- g->winSetDisabledTextColors(GameDarkenColor(color, 25),back);
-}
-// text colors
-
-// enabled
-inline void GadgetTextEntrySetEnabledImageLeft( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 0, image ); }
-inline void GadgetTextEntrySetEnabledImageRight( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 1, image ); }
-inline void GadgetTextEntrySetEnabledImageCenter( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 2, image ); }
-inline void GadgetTextEntrySetEnabledImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetEnabledImage( 3, image ); }
-inline void GadgetTextEntrySetEnabledColor( GameWindow *g, Color color ) { g->winSetEnabledColor( 0, color ); }
-inline void GadgetTextEntrySetEnabledBorderColor( GameWindow *g, Color color ) { g->winSetEnabledBorderColor( 0, color ); }
-inline const Image *GadgetTextEntryGetEnabledImageLeft( GameWindow *g ) { return g->winGetEnabledImage( 0 ); }
-inline const Image *GadgetTextEntryGetEnabledImageRight( GameWindow *g ) { return g->winGetEnabledImage( 1 ); }
-inline const Image *GadgetTextEntryGetEnabledImageCenter( GameWindow *g ) { return g->winGetEnabledImage( 2 ); }
-inline const Image *GadgetTextEntryGetEnabledImageSmallCenter( GameWindow *g ) { return g->winGetEnabledImage( 3 ); }
-inline Color GadgetTextEntryGetEnabledColor( GameWindow *g ) { return g->winGetEnabledColor( 0 ); }
-inline Color GadgetTextEntryGetEnabledBorderColor( GameWindow *g ) { return g->winGetEnabledBorderColor( 0 ); }
-
-// disabled
-inline void GadgetTextEntrySetDisabledImageLeft( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 0, image ); }
-inline void GadgetTextEntrySetDisabledImageRight( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 1, image ); }
-inline void GadgetTextEntrySetDisabledImageCenter( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 2, image ); }
-inline void GadgetTextEntrySetDisabledImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetDisabledImage( 3, image ); }
-inline void GadgetTextEntrySetDisabledColor( GameWindow *g, Color color ) { g->winSetDisabledColor( 0, color ); }
-inline void GadgetTextEntrySetDisabledBorderColor( GameWindow *g, Color color ) { g->winSetDisabledBorderColor( 0, color ); }
-inline const Image *GadgetTextEntryGetDisabledImageLeft( GameWindow *g ) { return g->winGetDisabledImage( 0 ); }
-inline const Image *GadgetTextEntryGetDisabledImageRight( GameWindow *g ) { return g->winGetDisabledImage( 1 ); }
-inline const Image *GadgetTextEntryGetDisabledImageCenter( GameWindow *g ) { return g->winGetDisabledImage( 2 ); }
-inline const Image *GadgetTextEntryGetDisabledImageSmallCenter( GameWindow *g ) { return g->winGetDisabledImage( 3 ); }
-inline Color GadgetTextEntryGetDisabledColor( GameWindow *g ) { return g->winGetDisabledColor( 0 ); }
-inline Color GadgetTextEntryGetDisabledBorderColor( GameWindow *g ) { return g->winGetDisabledBorderColor( 0 ); }
-
-// hilite
-inline void GadgetTextEntrySetHiliteImageLeft( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 0, image ); }
-inline void GadgetTextEntrySetHiliteImageRight( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 1, image ); }
-inline void GadgetTextEntrySetHiliteImageCenter( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 2, image ); }
-inline void GadgetTextEntrySetHiliteImageSmallCenter( GameWindow *g, const Image *image ) { g->winSetHiliteImage( 3, image ); }
-inline void GadgetTextEntrySetHiliteColor( GameWindow *g, Color color ) { g->winSetHiliteColor( 0, color ); }
-inline void GadgetTextEntrySetHiliteBorderColor( GameWindow *g, Color color ) { g->winSetHiliteBorderColor( 0, color ); }
-inline const Image *GadgetTextEntryGetHiliteImageLeft( GameWindow *g ) { return g->winGetHiliteImage( 0 ); }
-inline const Image *GadgetTextEntryGetHiliteImageRight( GameWindow *g ) { return g->winGetHiliteImage( 1 ); }
-inline const Image *GadgetTextEntryGetHiliteImageCenter( GameWindow *g ) { return g->winGetHiliteImage( 2 ); }
-inline const Image *GadgetTextEntryGetHiliteImageSmallCenter( GameWindow *g ) { return g->winGetHiliteImage( 3 ); }
-inline Color GadgetTextEntryGetHiliteColor( GameWindow *g ) { return g->winGetHiliteColor( 0 ); }
-inline Color GadgetTextEntryGetHiliteBorderColor( GameWindow *g ) { return g->winGetHiliteBorderColor( 0 ); }
-
-// EXTERNALS //////////////////////////////////////////////////////////////////
diff --git a/Generals/Code/GameEngine/Include/GameClient/GameWindowID.h b/Generals/Code/GameEngine/Include/GameClient/GameWindowID.h
deleted file mode 100644
index 9d5eec2be54..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/GameWindowID.h
+++ /dev/null
@@ -1,83 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GameWindowID.h ///////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: GameWindowID.h
-//
-// Created: Colin Day, July 2001
-//
-// Desc: Game window ID definitions, this is so we can uniquely
-// identify any window in the game and pass messages from
-// anywhere to anywhere else instantly
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-#define GWID_INVALID 0
-
-#define GWID_SIDEBAR 100
-
-#define GWID_SIDEBAR_1 101
-#define GWID_SIDEBAR_2 102
-#define GWID_SIDEBAR_3 103
-#define GWID_SIDEBAR_4 104
-#define GWID_SIDEBAR_5 105
-#define GWID_SIDEBAR_6 106
-#define GWID_SIDEBAR_7 107
-#define GWID_SIDEBAR_8 108
-#define GWID_SIDEBAR_9 109
-#define GWID_SIDEBAR_10 110
-#define GWID_SIDEBAR_11 111
-#define GWID_SIDEBAR_12 112
-
-#define GWID_SIDEBAR_TAB_1 151
-#define GWID_SIDEBAR_TAB_2 152
-#define GWID_SIDEBAR_TAB_3 153
-#define GWID_SIDEBAR_TAB_4 154
-
-#define GWID_SIDEBAR_RADAR 175
-
-// INLINING ///////////////////////////////////////////////////////////////////
-
-// EXTERNALS //////////////////////////////////////////////////////////////////
diff --git a/Generals/Code/GameEngine/Include/GameClient/GameWindowManager.h b/Generals/Code/GameEngine/Include/GameClient/GameWindowManager.h
deleted file mode 100644
index a3a4f53a4a6..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/GameWindowManager.h
+++ /dev/null
@@ -1,414 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GameWindowManager.h //////////////////////////////////////////////////////////////////////
-// Created: Colin Day, June 2001
-// Desc: The game window manager is the interface for interacting with
-// the windowing system for purposes of any menus, or GUI
-// controls.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-#include "Common/STLTypedefs.h"
-#include "Common/SubsystemInterface.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/Gadget.h"
-
-class GameWindow;
-
-//-------------------------------------------------------------------------------------------------
-/** Window layout info is a structure that can be passed to the load function of
- * a window script. After the script is loaded, this parameter (if present)
- * will contain information about the script file at a global level such
- * as what file version was loaded, global layout callbacks, etc */
-//-------------------------------------------------------------------------------------------------
-enum { MAX_LAYOUT_FUNC_LEN = 256 };
-
-typedef std::list GameWindowList;
-
-class WindowLayoutInfo
-{
-
-public:
- WindowLayoutInfo();
-
- UnsignedInt version; ///< file version that was loaded
- WindowLayoutInitFunc init; ///< init method (if specified)
- WindowLayoutUpdateFunc update; ///< update method (if specified)
- WindowLayoutShutdownFunc shutdown; ///< shutdown method (if specified)
- AsciiString initNameString; ///< init method in flavor of string name
- AsciiString updateNameString; ///< update method in string flavor
- AsciiString shutdownNameString; ///< shutdown method in string flavor, mmm!
- std::list windows; ///< list of top-level windows in the layout
-};
-
-//-------------------------------------------------------------------------------------------------
-/** There exists a singleton GameWindowManager that defines how we can
- * interact with the game windowing system */
-//-------------------------------------------------------------------------------------------------
-class GameWindowManager : public SubsystemInterface
-{
-
-friend class GameWindow;
-
-public:
-
- GameWindowManager();
- virtual ~GameWindowManager() override;
-
- //-----------------------------------------------------------------------------------------------
- virtual void init() override; ///< initialize function
- virtual void reset() override; ///< reset the system
- virtual void update() override; ///< update method, called once per frame
-
- virtual GameWindow *allocateNewWindow() = 0; ///< new game window
-
- void linkWindow( GameWindow *window ); ///< link into master list
- void unlinkWindow( GameWindow *window ); ///< unlink from master list
- void unlinkChildWindow( GameWindow *window ); ///< remove child from parent list
- void insertWindowAheadOf( GameWindow *window, GameWindow *aheadOf ); ///< add window to list 'ahead of'
-
- virtual GameWinDrawFunc getPushButtonImageDrawFunc() = 0;
- virtual GameWinDrawFunc getPushButtonDrawFunc() = 0;
- virtual GameWinDrawFunc getCheckBoxImageDrawFunc() = 0;
- virtual GameWinDrawFunc getCheckBoxDrawFunc() = 0;
- virtual GameWinDrawFunc getRadioButtonImageDrawFunc() = 0;
- virtual GameWinDrawFunc getRadioButtonDrawFunc() = 0;
- virtual GameWinDrawFunc getTabControlImageDrawFunc() = 0;
- virtual GameWinDrawFunc getTabControlDrawFunc() = 0;
- virtual GameWinDrawFunc getListBoxImageDrawFunc() = 0;
- virtual GameWinDrawFunc getListBoxDrawFunc() = 0;
- virtual GameWinDrawFunc getComboBoxImageDrawFunc() = 0;
- virtual GameWinDrawFunc getComboBoxDrawFunc() = 0;
- virtual GameWinDrawFunc getHorizontalSliderImageDrawFunc() = 0;
- virtual GameWinDrawFunc getHorizontalSliderDrawFunc() = 0;
- virtual GameWinDrawFunc getVerticalSliderImageDrawFunc() = 0;
- virtual GameWinDrawFunc getVerticalSliderDrawFunc() = 0;
- virtual GameWinDrawFunc getProgressBarImageDrawFunc() = 0;
- virtual GameWinDrawFunc getProgressBarDrawFunc() = 0;
- virtual GameWinDrawFunc getStaticTextImageDrawFunc() = 0;
- virtual GameWinDrawFunc getStaticTextDrawFunc() = 0;
- virtual GameWinDrawFunc getTextEntryImageDrawFunc() = 0;
- virtual GameWinDrawFunc getTextEntryDrawFunc() = 0;
-
- //---------------------------------------------------------------------------
-
- virtual GameWinDrawFunc getDefaultDraw(); ///< return default draw func
- virtual GameWinSystemFunc getDefaultSystem(); ///< return default system func
- virtual GameWinInputFunc getDefaultInput(); ///< return default input func
- virtual GameWinTooltipFunc getDefaultTooltip(); ///< return default tooltip func
-
- //---------------------------------------------------------------------------
- // MessageBox creation
- virtual GameWindow *gogoMessageBox(Int x, Int y, Int width, Int height, UnsignedShort buttonFlags,
- UnicodeString titleString, UnicodeString bodyString,
- GameWinMsgBoxFunc yesCallback,
- GameWinMsgBoxFunc noCallback,
- GameWinMsgBoxFunc okCallback,
- GameWinMsgBoxFunc cancelCallback );
-
- virtual GameWindow *gogoMessageBox(Int x, Int y, Int width, Int height, UnsignedShort buttonFlags,
- UnicodeString titleString, UnicodeString bodyString,
- GameWinMsgBoxFunc yesCallback,
- GameWinMsgBoxFunc noCallback,
- GameWinMsgBoxFunc okCallback,
- GameWinMsgBoxFunc cancelCallback, Bool useLogo );
-
-
- //---------------------------------------------------------------------------
- // gadget creation
- virtual GameWindow *gogoGadgetPushButton( GameWindow *parent, UnsignedInt status,
- Int x, Int y, Int width, Int height,
- WinInstanceData *instData,
- GameFont *defaultFont, Bool defaultVisual );
- virtual GameWindow *gogoGadgetCheckbox( GameWindow *parent, UnsignedInt status,
- Int x, Int y, Int width, Int height,
- WinInstanceData *instData,
- GameFont *defaultFont, Bool defaultVisual );
- virtual GameWindow *gogoGadgetRadioButton( GameWindow *parent, UnsignedInt status,
- Int x, Int y, Int width, Int height,
- WinInstanceData *instData,
- RadioButtonData *rData,
- GameFont *defaultFont, Bool defaultVisual );
- virtual GameWindow *gogoGadgetTabControl( GameWindow *parent, UnsignedInt status,
- Int x, Int y, Int width, Int height,
- WinInstanceData *instData,
- TabControlData *rData,
- GameFont *defaultFont, Bool defaultVisual );
- virtual GameWindow *gogoGadgetListBox( GameWindow *parent, UnsignedInt status,
- Int x, Int y, Int width, Int height,
- WinInstanceData *instData,
- ListboxData *listboxData,
- GameFont *defaultFont, Bool defaultVisual );
- virtual GameWindow *gogoGadgetSlider( GameWindow *parent, UnsignedInt status,
- Int x, Int y, Int width, Int height,
- WinInstanceData *instData,
- SliderData *sliderData,
- GameFont *defaultFont, Bool defaultVisual );
- virtual GameWindow *gogoGadgetProgressBar( GameWindow *parent, UnsignedInt status,
- Int x, Int y, Int width, Int height,
- WinInstanceData *instData,
- GameFont *defaultFont, Bool defaultVisual );
- virtual GameWindow *gogoGadgetStaticText( GameWindow *parent, UnsignedInt status,
- Int x, Int y, Int width, Int height,
- WinInstanceData *instData,
- TextData *textData,
- GameFont *defaultFont, Bool defaultVisual );
- virtual GameWindow *gogoGadgetTextEntry( GameWindow *parent, UnsignedInt status,
- Int x, Int y, Int width, Int height,
- WinInstanceData *instData,
- EntryData *entryData,
- GameFont *defaultFont, Bool defaultVisual );
- virtual GameWindow *gogoGadgetComboBox( GameWindow *parent, UnsignedInt status,
- Int x, Int y, Int width, Int height,
- WinInstanceData *instData,
- ComboBoxData *comboBoxDataTemplate,
- GameFont *defaultFont, Bool defaultVisual );
-
- /** Use this method to assign the default images to gadgets as
- * they area created */
- virtual void assignDefaultGadgetLook( GameWindow *gadget,
- GameFont *defaultFont,
- Bool assignVisual );
-
- //---------------------------------------------------------------------------
- // Creating windows
- /// create new window(s) from .wnd file ... see definition for what is returned
- virtual GameWindow *winCreateFromScript( AsciiString filename, WindowLayoutInfo *info = nullptr );
-
- /// create new window(s) from .wnd file and wrap in a WindowLayout
- virtual WindowLayout *winCreateLayout( AsciiString filename );
-
- /// free temporary strings to make the memory leak manager happy.
- virtual void freeStaticStrings();
-
- /// create a new window by setting up parameters and callbacks
- virtual GameWindow *winCreate( GameWindow *parent, UnsignedInt status,
- Int x, Int y, Int width, Int height,
- GameWinSystemFunc system,
- WinInstanceData *instData = nullptr );
-
- //---------------------------------------------------------------------------
- // Manipulating windows in the system
- virtual Int winDestroy( GameWindow *window ); ///< destroy this window
- virtual Int winDestroyAll(); ///< destroy all windows in the system
- virtual GameWindow *winGetWindowList(); ///< get head of master list
-
- /// hide all windows in a certain range of id's (inclusive );
- virtual void hideWindowsInRange( GameWindow *baseWindow, Int first, Int last,
- Bool hideFlag );
- /// enable all windows in a range of id's (inclusive)
- virtual void enableWindowsInRange( GameWindow *baseWindow, Int first, Int last,
- Bool enableFlag );
-
- /// this gets called from winHide() when a window hides itself
- virtual void windowHiding( GameWindow *window );
-
- virtual void winRepaint(); ///< draw GUI in reverse order
-
- virtual void winNextTab( GameWindow *window ); ///< give keyboard focus to the next window in the tab list
-
- virtual void winPrevTab( GameWindow *window ); ///< give keyboard focus to the previous window in the tab list
-
- virtual void registerTabList( GameWindowList tabList ); ///< we have to register a Tab List
- virtual void clearTabList(); ///< we's gotz ta clear the tab list yo!
-
- // --------------------------------------------------------------------------
- /// process a single mouse event
- virtual WinInputReturnCode winProcessMouseEvent( GameWindowMessage msg,
- ICoord2D *mousePos,
- void *data );
- /// process a singke key event
- virtual WinInputReturnCode winProcessKey( UnsignedByte key,
- UnsignedByte state );
- // --------------------------------------------------------------------------
-
- virtual GameWindow *winGetFocus(); ///< return window that has the focus
- virtual Int winSetFocus( GameWindow *window ); ///< set this window as has focus
- virtual void winSetGrabWindow( GameWindow *window ); ///< set the grab window
- virtual GameWindow *winGetGrabWindow(); ///< who is currently 'held' by mouse
- virtual void winSetLoneWindow( GameWindow *window ); ///< set the open window
-
- // Finds the top-level window at the mouse position that matches the required and forbidden status masks.
- virtual GameWindow* findWindowUnderMouse(GameWindow*& toolTipWindow, const ICoord2D* mousePos, unsigned int requiredStatusMask, unsigned int forbiddenStatusMask);
- static bool isMouseWithinWindow(GameWindow* window, const ICoord2D* mousePos, unsigned int requiredStatusMask, unsigned int forbiddenStatusMask);
-
- virtual Bool isEnabled( GameWindow *win ); ///< is window or parents enabled
- virtual Bool isHidden( GameWindow *win ); ///< is parent or parents hidden
- virtual void addWindowToParent( GameWindow *window, GameWindow *parent );
- virtual void addWindowToParentAtEnd( GameWindow *window, GameWindow *parent );
-
- /// sends a system message to specified window
- virtual WindowMsgHandledType winSendSystemMsg( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 );
-
- /// sends an input message to the specified window
- virtual WindowMsgHandledType winSendInputMsg( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 );
-
- /** get the window pointer from id, starting at 'window' and searching
- down the hierarchy. If 'window' is nullptr then all windows will
- be searched */
- virtual GameWindow *winGetWindowFromId( GameWindow *window, Int id );
- virtual Int winCapture( GameWindow *window ); ///< captures the mouse
- virtual Int winRelease( GameWindow *window ); ///< release mouse capture
- virtual GameWindow *winGetCapture(); ///< current mouse capture settings
-
- virtual Int winSetModal( GameWindow *window ); ///< put at top of modal stack
- virtual Int winUnsetModal( GameWindow *window ); /**< take window off modal stack, if window is
- not at top of stack and error will occur */
-
- //---------------------------------------------------------------------------
- /////////////////////////////////////////////////////////////////////////////
- //---------------------------------------------------------------------------
- //---------------------------------------------------------------------------
- // The following public functions you should implement change the guts
- // for to work with your application. Rather than draw images, or do string
- // operations with native methods, the game window system will always call
- // these methods to get the work done it needs
- //---------------------------------------------------------------------------
- //---------------------------------------------------------------------------
- /////////////////////////////////////////////////////////////////////////////
- //---------------------------------------------------------------------------
-
- /// draw image, coord are in screen and should be kepth within that box specified
- virtual void winDrawImage( const Image *image, Int startX, Int startY, Int endX, Int endY, Color color = 0xFFFFFFFF );
- /// draw filled rect, coords are absolute screen coords
- virtual void winFillRect( Color color, Real width, Int startX, Int startY, Int endX, Int endY );
- /// draw rect outline, coords are absolute screen coords
- virtual void winOpenRect( Color color, Real width, Int startX, Int startY, Int endX, Int endY );
- /// draw line, coords are absolute screen coords
- virtual void winDrawLine( Color color, Real width, Int startX, Int startY, Int endX, Int endY );
- /// Make a color representation out of RGBA components
- virtual Color winMakeColor( UnsignedByte red, UnsignedByte green, UnsignedByte blue, UnsignedByte alpha );
- /** Find an image reference and return a pointer to its image, you may
- recreate all Image structs to suit your project */
- virtual const Image *winFindImage( const char *name );
- virtual Int winFontHeight( GameFont *font ); ///< get height of font in pixels
- virtual Int winIsDigit( Int c ); ///< is character a digit
- virtual Int winIsAscii( Int c ); ///< is character a digit
- virtual Int winIsAlNum( Int c ); ///< is character alpha-numeric
- virtual void winFormatText( GameFont *font, UnicodeString text, Color color,
- Int x, Int y, Int width, Int height );
- virtual void winGetTextSize( GameFont *font, UnicodeString text,
- Int *width, Int *height, Int maxWidth );
- virtual UnicodeString winTextLabelToText( AsciiString label ); ///< convert localizable text label to real text
- virtual GameFont *winFindFont( AsciiString fontName, Int pointSize, Bool bold ); ///< get a font given a name
-
- /// @todo just for testing, remov this
- Bool initTestGUI();
-
- virtual GameWindow *getWindowUnderCursor( Int x, Int y, Bool ignoreEnabled = FALSE ); ///< find the top window at the given coordinates
-
- //---------------------------------------------------------------------------
- /////////////////////////////////////////////////////////////////////////////
- //---------------------------------------------------------------------------
- //---------------------------------------------------------------------------
- //---------------------------------------------------------------------------
- //---------------------------------------------------------------------------
- /////////////////////////////////////////////////////////////////////////////
- //---------------------------------------------------------------------------
-
-protected:
-
- void processDestroyList(); ///< process windows waiting to be killed
-
- Int drawWindow( GameWindow *window ); ///< draw this window
-
- void dumpWindow( GameWindow *window ); ///< for debugging
-
- GameWindow *m_windowList; // list of all top level windows
- GameWindow *m_windowTail; // last in windowList
-
- GameWindow *m_destroyList; // list of windows to destroy
-
- GameWindow *m_currMouseRgn; // window that mouse is over
- GameWindow *m_mouseCaptor; // window that captured mouse
- GameWindow *m_keyboardFocus; // window that has input focus
- ModalWindow *m_modalHead; // top of windows in the modal stack
- GameWindow *m_grabWindow; // window that grabbed the last down event
- GameWindow *m_loneWindow; // Set if we just opened a Lone Window
- GameWindowList m_tabList; // we have to register a tab list to make a tab list.
- const Image *m_cursorBitmap;
- UnsignedInt m_captureFlags;
-
-};
-
-// INLINE /////////////////////////////////////////////////////////////////////////////////////////
-inline GameWinDrawFunc GameWindowManager::getDefaultDraw() { return GameWinDefaultDraw; }
-inline GameWinSystemFunc GameWindowManager::getDefaultSystem() { return GameWinDefaultSystem; }
-inline GameWinInputFunc GameWindowManager::getDefaultInput() { return GameWinDefaultInput; }
-inline GameWinTooltipFunc GameWindowManager::getDefaultTooltip() { return GameWinDefaultTooltip; }
-
-// EXTERN /////////////////////////////////////////////////////////////////////////////////////////
-extern GameWindowManager *TheWindowManager; ///< singleton extern definition
-extern UnsignedInt WindowLayoutCurrentVersion; ///< current version of our window layouts
-
-// this function lets us generically pass button selections to our parent, we may
-// frequently want to do this because we want windows grouped on child windows for
-// convenience, but only want one logical system procedure responding to them all
-extern WindowMsgHandledType PassSelectedButtonsToParentSystem( GameWindow *window,
- UnsignedInt msg,
- WindowMsgData mData1,
- WindowMsgData mData2 );
-extern WindowMsgHandledType PassMessagesToParentSystem( GameWindow *window,
- UnsignedInt msg,
- WindowMsgData mData1,
- WindowMsgData mData2 );
-
-// TheSuperHackers @feature helmutbuhler 24/04/2025
-// GameWindowManager that does nothing. Used for Headless Mode.
-class GameWindowManagerDummy : public GameWindowManager
-{
-public:
- virtual GameWindow *winGetWindowFromId(GameWindow *window, Int id) override;
- virtual GameWindow *winCreateFromScript(AsciiString filenameString, WindowLayoutInfo *info) override;
-
- virtual GameWindow *allocateNewWindow() override { return newInstance(GameWindowDummy); }
-
- virtual GameWinDrawFunc getPushButtonImageDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getPushButtonDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getCheckBoxImageDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getCheckBoxDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getRadioButtonImageDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getRadioButtonDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getTabControlImageDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getTabControlDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getListBoxImageDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getListBoxDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getComboBoxImageDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getComboBoxDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getHorizontalSliderImageDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getHorizontalSliderDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getVerticalSliderImageDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getVerticalSliderDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getProgressBarImageDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getProgressBarDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getStaticTextImageDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getStaticTextDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getTextEntryImageDrawFunc() override { return nullptr; }
- virtual GameWinDrawFunc getTextEntryDrawFunc() override { return nullptr; }
-};
diff --git a/Generals/Code/GameEngine/Include/GameClient/HotKey.h b/Generals/Code/GameEngine/Include/GameClient/HotKey.h
deleted file mode 100644
index 3c9cade4eef..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/HotKey.h
+++ /dev/null
@@ -1,112 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-
-// FILE: HotKey.h /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Sep 2002
-//
-// Filename: HotKey.h
-//
-// author: Chris Huybregts
-//
-// purpose:
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "Common/SubsystemInterface.h"
-#include "Common/MessageStream.h"
-//-----------------------------------------------------------------------------
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-class AsciiString;
-class GameWindow;
-//-----------------------------------------------------------------------------
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-class HotKeyTranslator : public GameMessageTranslator
-{
-public:
- virtual GameMessageDisposition translateGameMessage(const GameMessage *msg) override;
- virtual ~HotKeyTranslator() override { }
-};
-
-//-----------------------------------------------------------------------------
-class HotKey
-{
-public:
- HotKey();
- GameWindow *m_win;
- AsciiString m_key;
- // we may need a checkmark system.
-};
-
-//-----------------------------------------------------------------------------
-class HotKeyManager : public SubsystemInterface
-{
-public:
- HotKeyManager();
- virtual ~HotKeyManager() override;
- // Inherited from subsystem interface -----------------------------------------------------------
- virtual void init() override; ///< Initialize the Hotkey system
- virtual void update() override {} ///< A No-op for us
- virtual void reset() override; ///< Reset
- //-----------------------------------------------------------------------------------------------
-
- void addHotKey( GameWindow *win, const AsciiString& key);
- Bool executeHotKey( const AsciiString& key); // called fromt eh HotKeyTranslator
-
- AsciiString searchHotKey( const AsciiString& label);
- AsciiString searchHotKey( const UnicodeString& uStr );
-
-private:
- typedef std::map HotKeyMap;
- HotKeyMap m_hotKeyMap;
-};
-extern HotKeyManager *TheHotKeyManager;
-//-----------------------------------------------------------------------------
-// INLINING ///////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// EXTERNALS //////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
diff --git a/Generals/Code/GameEngine/Include/GameClient/MessageBox.h b/Generals/Code/GameEngine/Include/GameClient/MessageBox.h
deleted file mode 100644
index cf5951e0990..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/MessageBox.h
+++ /dev/null
@@ -1,46 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: MessageBox.h /////////////////////////////////////////////////////////////////////////////
-// Author: Chris Huybregts, November 2001
-// Description: Message Box file containing user aliases
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-#include "GameClient/GameWindowManager.h"
-
-GameWindow *MessageBoxYesNo(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc yesCallback,GameWinMsgBoxFunc noCallback); ///< convenience function for displaying a Message box with Yes and No buttons
-GameWindow *QuitMessageBoxYesNo(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc yesCallback,GameWinMsgBoxFunc noCallback); ///< convenience function for displaying a Message box with Yes and No buttons
-
-
-GameWindow *MessageBoxYesNoCancel(UnicodeString titleString,UnicodeString bodyString, GameWinMsgBoxFunc yesCallback, GameWinMsgBoxFunc noCallback, GameWinMsgBoxFunc cancelCallback);///< convenience function for displaying a Message box with Yes,No and Cancel buttons
-
-
-GameWindow *MessageBoxOkCancel(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc okCallback,GameWinMsgBoxFunc cancelCallback);///< convenience function for displaying a Message box with Ok and Cancel buttons
-
-GameWindow *MessageBoxOk(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc okCallback);///< convenience function for displaying a Message box with Ok button
-
-
-GameWindow *MessageBoxCancel(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc cancelCallback);///< convenience function for displaying a Message box with Cancel button
diff --git a/Generals/Code/GameEngine/Include/GameClient/Shell.h b/Generals/Code/GameEngine/Include/GameClient/Shell.h
deleted file mode 100644
index 9c5c75fbed3..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/Shell.h
+++ /dev/null
@@ -1,205 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: Shell.h //////////////////////////////////////////////////////////////////////////////////
-// Author: Colin Day, September 2001
-// Description: Shell menu representations
-//
-// Using The Shell:
-// ----------------
-//
-// The Shell makes use of the window layouts to represent screens. You can push and
-// pop screens on the stack so that you don't have to keep track of how you got
-// to which screen.
-//
-// Here is what happens when you push a layout on the shell stack:
-// 1) The layout name is stored as a "pending push"
-// 2) The top of the stack has the Shutdown() method run
-// 3) The Shutdown() method (or other mechanisms like Update()) will call
-// Shell::shutdownComplete() when the shutdown process for that layout is "complete"
-// 4) Shell::shutdownComplete() sees the "pending push" in the shell
-// 5) "Pending push" layout is then loaded from disk and the pending push state is cleared
-// 6) The new layout is put on the top of the stack
-// 7) The new layout Init() method is called
-//
-// Here is what happens when you pop the top of the stack
-// 1) The stack sets a "pending pop" as in progress
-// 2) The top layout of the stack has the Shutdown() method called
-// 3) The Shutdown() method (or other mechanisms like Update()) will call
-// Shell::shutdownComplete() when the shutdown process for that layout is "complete"
-// 4) Shell::shutdownComplete() sees the "pending pop" in the shell
-// 5) The "pending pop" layout is then destroyed and removed from the stack
-// 6) The new top of the stack has the Init() method run
-//
-// Window Layouts and the Shell:
-// -----------------------------
-//
-// Window Layouts in the shell need the following functions to work property, these
-// can be assigned from the GUIEdit window layout tool:
-//
-// - Init() [OPTIONAL]
-// This is called as a result of a push or pop operation (see above for more info)
-// The window layout is loaded from disk and then this Init()
-// method is run. All shell layout Init() methods should show
-// the layout windows. At this point you could move windows
-// to starting positions, set a state that the Update() method looks at to
-// "animate" the windows to the desired positions.
-//
-// - Update() [OPTIONAL]
-// This is called once at a rate of "shellUpdateDelay" for EVERY screen on the shell
-// stack. It does not matter if the screen is on the top, or is hidden, or
-// anything, this is always called. Each update is run starting with the screen
-// at the top of the stack and progressing to the bottom of the stack.
-// States could be set in the Init() or Shutdown() methods of the layout
-// that the Update() looks at and reacts to appropriately if desired.
-//
-// - Shutdown() [REQUIRED]
-// This is called when a layout is popped off the stack, or when a new layout
-// is pushed on top of this one (see above for more detail on what happens
-// during the push/pop process). You can switch into a "shutdown" state and
-// animate the layout appropriately in the Update() method for the layout.
-// When shutdown is actually complete you should hide the all windows in
-// the layout and then you are REQUIRED to notify the shell by calling
-// the Shell::shutdownComplete() method.
-//
-// Shutdown() is also required to be able to handle the parameter "immediatePop".
-// If this parameter is TRUE it means that when control returns from the
-// shutdown function that the layout will immediately be popped off the
-// stack. We need to be able to handle this when in code we want to
-// traverse back down the stack rapidly (like when we lose connection to
-// an online service, we might pop all the way back to the login screen)
-//
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-
-// FORWARD REFERENCES /////////////////////////////////////////////////////////////////////////////
-class WindowLayout;
-class AnimateWindowManager;
-class GameWindow;
-class ShellMenuSchemeManager;
-
-enum AnimTypes CPP_11(: Int);
-
-//-------------------------------------------------------------------------------------------------
-/** This is the interface to the shell system to load, display, and
- * manage screen menu shell system layouts */
-//-------------------------------------------------------------------------------------------------
-class Shell : public SubsystemInterface
-{
-
-public:
-
- Shell();
- virtual ~Shell() override;
-
- // Inhertited from subsystem ====================================================================
- virtual void init() override;
- virtual void reset() override;
- virtual void update() override;
- //===============================================================================================
-
- void recreateWindowLayouts();
-
- void showShellMap(Bool useShellMap ); ///< access function to turn on and off the shell map
-
- void hide( Bool hide ); ///< show/hide all shell layouts
-
- // pseudo-stack operations for manipulating layouts
- void push( AsciiString filename, Bool shutdownImmediate = FALSE ); ///< load new screen on top, optionally doing an immediate shutdown
- void pop(); ///< pop top layout
- void popImmediate(); ///< pop now, don't wait for shutdown
- void showShell( Bool runInit = TRUE ); ///< init the top of stack
- void hideShell(); ///< shutdown the top of stack
- WindowLayout *top(); ///< return top layout
-
- void shutdownComplete( WindowLayout *layout, Bool impendingPush = FALSE ); ///< layout has completed shutdown
-
- WindowLayout *findScreenByFilename( AsciiString filename ); ///< find screen
- Bool isShellActive() { return m_isShellActive; } ///< Returns true if the shell is active
-
- void registerWithAnimateManager( GameWindow *win, AnimTypes animType, Bool needsToFinish, UnsignedInt delayMS = 0);
- Bool isAnimFinished();
- void reverseAnimatewindow();
- Bool isAnimReversed();
-
- void loadScheme( AsciiString name );
- ShellMenuSchemeManager *getShellMenuSchemeManager() { return m_schemeManager; }
-
- Int getScreenCount() const { return m_screenCount; } ///< Return the current number of screens
- WindowLayout *getScreenLayout( Int index ) const;
-
- WindowLayout *getSaveLoadMenuLayout(); ///< create if necessary and return layout for save load menu
- WindowLayout *getPopupReplayLayout(); ///< create if necessary and return layout for replay save menu
- WindowLayout *getOptionsLayout( Bool create ); ///< return layout for options menu, create if necessary and we are allowed to.
- void destroyOptionsLayout(); ///< destroy the shell's options layout.
-
-protected:
-
- void construct();
- void deconstruct();
-
- void linkScreen( WindowLayout *screen ); ///< link screen to list
- void unlinkScreen( WindowLayout *screen ); ///< remove screen from list
-
- void doPush( AsciiString layoutFile ); ///< workhorse for push action
- void doPop( Bool impendingPush ); ///< workhorse for pop action
-
- enum { MAX_SHELL_STACK = 16 }; ///< max simultaneous shell screens
- WindowLayout *m_screenStack[ MAX_SHELL_STACK ]; ///< the screen layout stack
- Int m_screenCount; ///< # of screens in screen stack
-
- WindowLayout *m_background; ///< The Background layout if the 3d shell isn't running
- Bool m_clearBackground; ///< Flag if we're going to clear the background or not
-
- Bool m_pendingPush; ///< TRUE when a push is pending
- Bool m_pendingPop; ///< TRUE when a pop is pending
- AsciiString m_pendingPushName; ///< layout name to be pushed
- Bool m_isShellActive; ///< TRUE when the shell is active
- Bool m_shellMapOn; ///< TRUE when the shell map is on
- AnimateWindowManager *m_animateWindowManager; ///< The animate Window Manager
- ShellMenuSchemeManager *m_schemeManager; ///< The Shell Scheme Manager
-
- //
- // we keep a pointer to this layout so that we can simply just hide/unhide this
- // window layout. Why you ask? Well, as the result of pressing a button to start
- // a save game load a super large set of operations will happen as the game
- // loads. One of those operations is the destruction of the menu, which although
- // it just destroys the windows and puts them on a destroyed list, that destroyed
- // list is also processed before we are out of our own window procedure.
- // This is a prime example why it's easier to just deal with windows by hiding and
- // un-hiding them rather than actually creating and destroying them.
- //
- WindowLayout *m_saveLoadMenuLayout; ///< save/load menu layout
- WindowLayout *m_popupReplayLayout; ///< replay save menu layout
- WindowLayout *m_optionsLayout; ///< options menu layout
-
-};
-
-// INLINING ///////////////////////////////////////////////////////////////////////////////////////
-
-// EXTERNALS //////////////////////////////////////////////////////////////////////////////////////
-extern Shell *TheShell; ///< the shell external interface
diff --git a/Generals/Code/GameEngine/Include/GameClient/ShellHooks.h b/Generals/Code/GameEngine/Include/GameClient/ShellHooks.h
deleted file mode 100644
index d6fe0418607..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/ShellHooks.h
+++ /dev/null
@@ -1,81 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-
-// ShellHooks.h
-// Author: Matthew D. Campbell, October 2002
-
-#pragma once
-
-//
-// This enumeration holds all the shell script hooks that we currently have, If you are going to
-// add more, it's important to keep the enum lined up with the names in TheShellHookNames located
-// in Scripts.cpp.
-//
-enum
-{
- SHELL_SCRIPT_HOOK_MAIN_MENU_CAMPAIGN_SELECTED = 0,
- SHELL_SCRIPT_HOOK_MAIN_MENU_CAMPAIGN_HIGHLIGHTED,
- SHELL_SCRIPT_HOOK_MAIN_MENU_CAMPAIGN_UNHIGHLIGHTED,
-
- SHELL_SCRIPT_HOOK_MAIN_MENU_SKIRMISH_SELECTED,
- SHELL_SCRIPT_HOOK_MAIN_MENU_SKIRMISH_HIGHLIGHTED,
- SHELL_SCRIPT_HOOK_MAIN_MENU_SKIRMISH_UNHIGHLIGHTED,
-
- SHELL_SCRIPT_HOOK_MAIN_MENU_OPTIONS_SELECTED,
- SHELL_SCRIPT_HOOK_MAIN_MENU_OPTIONS_HIGHLIGHTED,
- SHELL_SCRIPT_HOOK_MAIN_MENU_OPTIONS_UNHIGHLIGHTED,
-
- SHELL_SCRIPT_HOOK_MAIN_MENU_ONLINE_SELECTED,
- SHELL_SCRIPT_HOOK_MAIN_MENU_ONLINE_HIGHLIGHTED,
- SHELL_SCRIPT_HOOK_MAIN_MENU_ONLINE_UNHIGHLIGHTED,
-
- SHELL_SCRIPT_HOOK_MAIN_MENU_NETWORK_SELECTED,
- SHELL_SCRIPT_HOOK_MAIN_MENU_NETWORK_HIGHLIGHTED,
- SHELL_SCRIPT_HOOK_MAIN_MENU_NETWORK_UNHIGHLIGHTED,
-
- SHELL_SCRIPT_HOOK_MAIN_MENU_EXIT_SELECTED,
- SHELL_SCRIPT_HOOK_MAIN_MENU_EXIT_HIGHLIGHTED,
- SHELL_SCRIPT_HOOK_MAIN_MENU_EXIT_UNHIGHLIGHTED,
-
- SHELL_SCRIPT_HOOK_GENERALS_ONLINE_LOGIN,
- SHELL_SCRIPT_HOOK_GENERALS_ONLINE_LOGOUT,
- SHELL_SCRIPT_HOOK_GENERALS_ONLINE_ENTERED_FROM_GAME,
-
- SHELL_SCRIPT_HOOK_OPTIONS_OPENED,
- SHELL_SCRIPT_HOOK_OPTIONS_CLOSED,
-
- SHELL_SCRIPT_HOOK_SKIRMISH_OPENED,
- SHELL_SCRIPT_HOOK_SKIRMISH_CLOSED,
- SHELL_SCRIPT_HOOK_SKIRMISH_ENTERED_FROM_GAME,
-
- SHELL_SCRIPT_HOOK_LAN_OPENED,
- SHELL_SCRIPT_HOOK_LAN_CLOSED,
- SHELL_SCRIPT_HOOK_LAN_ENTERED_FROM_GAME,
-
- SHELL_SCRIPT_HOOK_TOTAL
-};
-
-extern const char *const TheShellHookNames[]; ///< Contains a list of the text representation of the shell hooks Used in WorldBuilder and in the shell.
-void SignalUIInteraction(Int interaction);
diff --git a/Generals/Code/GameEngine/Include/GameClient/ShellMenuScheme.h b/Generals/Code/GameEngine/Include/GameClient/ShellMenuScheme.h
deleted file mode 100644
index b5d17347b46..00000000000
--- a/Generals/Code/GameEngine/Include/GameClient/ShellMenuScheme.h
+++ /dev/null
@@ -1,152 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: ShellMenuScheme.h /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Jul 2002
-//
-// Filename: ShellMenuScheme.h
-//
-// author: Chris Huybregts
-//
-// purpose:
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "GameClient/Color.h"
-
-//-----------------------------------------------------------------------------
-// FORWARD REFERENCES /////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-class Image;
-
-//-----------------------------------------------------------------------------
-// TYPE DEFINES ///////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-class ShellMenuSchemeLine
-{
-public:
- ShellMenuSchemeLine();
- ~ShellMenuSchemeLine();
-
- ICoord2D m_startPos;
- ICoord2D m_endPos;
- Int m_width;
- Color m_color;
-
-};
-
-class ShellMenuSchemeImage
-{
-public:
- ShellMenuSchemeImage();
- ~ShellMenuSchemeImage();
-
- AsciiString m_name; ///< Name of the image
- ICoord2D m_position; ///< the position we'll draw it at
- ICoord2D m_size; ///< the size of the image needed when we draw it
- Image *m_image; ///< the actual pointer to the mapped image
-};
-
-class ShellMenuScheme
-{
-public:
- ShellMenuScheme();
- ~ShellMenuScheme();
-
- void draw();
- void addImage( ShellMenuSchemeImage* schemeImage );
- void addLine( ShellMenuSchemeLine* schemeLine );
-
-
- AsciiString m_name;
-
- typedef std::list< ShellMenuSchemeImage* > ShellMenuSchemeImageList;
- typedef ShellMenuSchemeImageList::iterator ShellMenuSchemeImageListIt;
- ShellMenuSchemeImageList m_imageList;
-
- typedef std::list< ShellMenuSchemeLine* > ShellMenuSchemeLineList;
- typedef ShellMenuSchemeLineList::iterator ShellMenuSchemeLineListIt;
- ShellMenuSchemeLineList m_lineList;
-
-
-
-
-};
-
-class ShellMenuSchemeManager
-{
-public:
- ShellMenuSchemeManager();
- ~ShellMenuSchemeManager();
-
- void init();
- void update();
-
- void setShellMenuScheme( AsciiString name );
-
- void draw();
-
- // parse Functions for the INI file
- const FieldParse *getFieldParse() const { return m_shellMenuSchemeFieldParseTable; } ///< returns the parsing fields
- static const FieldParse m_shellMenuSchemeFieldParseTable[]; ///< the parse table
- static void parseImagePart( INI* ini, void *instance, void *store, const void *userData ); ///< Parse the image part of the INI file
- static void parseLinePart( INI* ini, void *instance, void *store, const void *userData ); ///< Parse the line part of the INI file
-
- ShellMenuScheme *newShellMenuScheme(AsciiString name);
-
-private:
- typedef std::list< ShellMenuScheme* > ShellMenuSchemeList; ///< list of Shell Menu schemes
- typedef ShellMenuSchemeList::iterator ShellMenuSchemeListIt;
- ShellMenuSchemeList m_schemeList;
- ShellMenuScheme *m_currentScheme;
-
-};
-
-
-//-----------------------------------------------------------------------------
-// INLINING ///////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// EXTERNALS //////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/AnimateWindowManager.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/AnimateWindowManager.cpp
deleted file mode 100644
index c2b73a16b11..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/AnimateWindowManager.cpp
+++ /dev/null
@@ -1,422 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: AnimateWindowManager.cpp /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Mar 2002
-//
-// Filename: AnimateWindowManager.cpp
-//
-// author: Chris Huybregts
-//
-// purpose: This will contain the logic behind the different animations that
-// can happen to a window.
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "GameClient/AnimateWindowManager.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/Display.h"
-#include "GameClient/ProcessAnimateWindow.h"
-//-----------------------------------------------------------------------------
-// DEFINES ////////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// AnimateWindow PUBLIC FUNCTIONS /////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-namespace wnd
-{
-AnimateWindow::AnimateWindow()
-{
- m_delay = 0;
- m_startPos.x = m_startPos.y = 0;
- m_endPos.x = m_endPos.y = 0;
- m_curPos.x = m_curPos.y = 0;
- m_win = nullptr;
- m_animType = WIN_ANIMATION_NONE;
-
- m_restPos.x = m_restPos.y = 0;
- m_vel.x = m_vel.y = 0.0f;
- m_needsToFinish = FALSE;
- m_isFinished = FALSE;
- m_endTime = 0;
- m_startTime = 0;
-}
-AnimateWindow::~AnimateWindow()
-{
- m_win = nullptr;
-}
-
-void AnimateWindow::setAnimData( ICoord2D startPos, ICoord2D endPos,
- ICoord2D curPos, ICoord2D restPos,
- Coord2D vel, UnsignedInt startTime,
- UnsignedInt endTime )
-
-{
- m_startPos = startPos;
- m_endPos = endPos;
- m_curPos = curPos;
- m_restPos = restPos;
- m_vel = vel;
- m_startTime = startTime;
- m_endTime = endTime;
-
-}
-
-} // namespace wnd
-
-//-----------------------------------------------------------------------------
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-static void clearWinList(AnimateWindowList &winList)
-{
- while (!winList.empty())
- {
- wnd::AnimateWindow *win = *(winList.begin());
- winList.pop_front();
- deleteInstance(win);
- }
-}
-
-AnimateWindowManager::AnimateWindowManager()
-{
-// we don't allocate many of these, so no MemoryPools used
- m_slideFromRight = NEW ProcessAnimateWindowSlideFromRight;
- m_slideFromRightFast = NEW ProcessAnimateWindowSlideFromRightFast;
- m_slideFromLeft = NEW ProcessAnimateWindowSlideFromLeft;
- m_slideFromTop = NEW ProcessAnimateWindowSlideFromTop;
- m_slideFromTopFast = NEW ProcessAnimateWindowSlideFromTopFast;
- m_slideFromBottom = NEW ProcessAnimateWindowSlideFromBottom;
- m_spiral = NEW ProcessAnimateWindowSpiral;
- m_slideFromBottomTimed = NEW ProcessAnimateWindowSlideFromBottomTimed;
- m_winList.clear();
- m_needsUpdate = FALSE;
- m_reverse = FALSE;
- m_winMustFinishList.clear();
-}
-AnimateWindowManager::~AnimateWindowManager()
-{
- delete m_slideFromRight;
- delete m_slideFromRightFast;
- delete m_slideFromLeft;
- delete m_slideFromTop;
- delete m_slideFromTopFast;
- delete m_slideFromBottom;
- delete m_spiral;
- delete m_slideFromBottomTimed;
-
- m_slideFromRight = nullptr;
- resetToRestPosition();
- clearWinList(m_winList);
- clearWinList(m_winMustFinishList);
-}
-
-
-void AnimateWindowManager::init()
-{
- clearWinList(m_winList);
- clearWinList(m_winMustFinishList);
- m_needsUpdate = FALSE;
- m_reverse = FALSE;
-}
-
-void AnimateWindowManager::reset()
-{
- resetToRestPosition();
- clearWinList(m_winList);
- clearWinList(m_winMustFinishList);
- m_needsUpdate = FALSE;
- m_reverse = FALSE;
-}
-
-void AnimateWindowManager::update()
-{
-
- ProcessAnimateWindow *processAnim = nullptr;
-
- // if we need to update the windows that need to finish, update that list
- if(m_needsUpdate)
- {
- AnimateWindowList::iterator it = m_winMustFinishList.begin();
- m_needsUpdate = FALSE;
-
- while (it != m_winMustFinishList.end())
- {
- wnd::AnimateWindow *animWin = *it;
- if (!animWin)
- {
- DEBUG_CRASH(("There's No AnimateWindow in the AnimateWindow List"));
- return;
- }
- processAnim = getProcessAnimate( animWin->getAnimType() );
- if(processAnim)
- {
- if(m_reverse)
- {
- if(!processAnim->reverseAnimateWindow(animWin))
- m_needsUpdate = TRUE;
- }
- else
- {
- if(!processAnim->updateAnimateWindow(animWin))
- m_needsUpdate = TRUE;
- }
- }
-
- it ++;
- }
- }
-
- AnimateWindowList::iterator it = m_winList.begin();
-
- while (it != m_winList.end())
- {
- wnd::AnimateWindow *animWin = *it;
- if (!animWin)
- {
- DEBUG_CRASH(("There's No AnimateWindow in the AnimateWindow List"));
- return;
- }
- processAnim = getProcessAnimate( animWin->getAnimType() );
- if(m_reverse)
- {
- if(processAnim)
- processAnim->reverseAnimateWindow(animWin);
- }
- else
- {
- if(processAnim)
- processAnim->updateAnimateWindow(animWin);
- }
- it ++;
- }
-}
-
-
-void AnimateWindowManager::registerGameWindow(GameWindow *win, AnimTypes animType, Bool needsToFinish, UnsignedInt ms, UnsignedInt delayMs)
-{
- if(!win)
- {
- DEBUG_CRASH(("Win was null as it was passed into registerGameWindow... not good indeed"));
- return;
- }
- if(animType <= WIN_ANIMATION_NONE || animType >= WIN_ANIMATION_COUNT )
- {
- DEBUG_CRASH(("an Invalid WIN_ANIMATION type was passed into registerGameWindow... please fix me "));
- return;
- }
-
- // Create a new AnimateWindow class and fill in it's data.
- wnd::AnimateWindow *animWin = wnd::AnimateWindow::createNewInstance();
- animWin->setGameWindow(win);
- animWin->setAnimType(animType);
- animWin->setNeedsToFinish(needsToFinish);
- animWin->setDelay(delayMs);
-
- // Run the window through the processAnim's init function.
- ProcessAnimateWindow *processAnim = getProcessAnimate( animType );
- if(processAnim)
- {
- processAnim->setMaxDuration(ms);
- processAnim->initAnimateWindow( animWin );
- }
-
- // Add the Window to the proper list
- if(needsToFinish)
- {
- m_winMustFinishList.push_back(animWin);
- m_needsUpdate = TRUE;
- }
- else
- m_winList.push_back(animWin);
-}
-
-ProcessAnimateWindow *AnimateWindowManager::getProcessAnimate( AnimTypes animType )
-{
- switch (animType) {
- case WIN_ANIMATION_SLIDE_RIGHT:
- {
- return m_slideFromRight;
- }
- case WIN_ANIMATION_SLIDE_RIGHT_FAST:
- {
- return m_slideFromRightFast;
- }
- case WIN_ANIMATION_SLIDE_LEFT:
- {
- return m_slideFromLeft;
- }
- case WIN_ANIMATION_SLIDE_TOP:
- {
- return m_slideFromTop;
- }
- case WIN_ANIMATION_SLIDE_BOTTOM:
- {
- return m_slideFromBottom;
- }
- case WIN_ANIMATION_SPIRAL:
- {
- return m_spiral;
- }
- case WIN_ANIMATION_SLIDE_BOTTOM_TIMED:
- {
- return m_slideFromBottomTimed;
- }
- case WIN_ANIMATION_SLIDE_TOP_FAST:
- {
- return m_slideFromTopFast;
- }
- default:
- return nullptr;
- }
-}
-
-void AnimateWindowManager::reverseAnimateWindow()
-{
-
- m_reverse = TRUE;
- m_needsUpdate = TRUE;
- ProcessAnimateWindow *processAnim = nullptr;
-
- UnsignedInt maxDelay = 0;
- AnimateWindowList::iterator it = m_winMustFinishList.begin();
- while (it != m_winMustFinishList.end())
- {
- wnd::AnimateWindow *animWin = *it;
- if (!animWin)
- {
- DEBUG_CRASH(("There's No AnimateWindow in the AnimateWindow List"));
- return;
- }
- if(animWin->getDelay() > maxDelay)
- maxDelay = animWin->getDelay();
- it ++;
- }
-
- it = m_winMustFinishList.begin();
- while (it != m_winMustFinishList.end())
- {
- wnd::AnimateWindow *animWin = *it;
- if (!animWin)
- {
- DEBUG_CRASH(("There's No AnimateWindow in the AnimateWindow List"));
- return;
- }
- // Run the window through the processAnim's init function.
- processAnim = getProcessAnimate( animWin->getAnimType() );
- if(processAnim)
- {
- processAnim->initReverseAnimateWindow( animWin, maxDelay );
- }
-
- animWin->setFinished(FALSE);
- it ++;
- }
-
- it = m_winList.begin();
-
- while (it != m_winList.end())
- {
- wnd::AnimateWindow *animWin = *it;
- if (!animWin)
- {
- DEBUG_CRASH(("There's No AnimateWindow in the AnimateWindow List"));
- return;
- }
- processAnim = getProcessAnimate( animWin->getAnimType() );
-
- if(processAnim)
- processAnim->initReverseAnimateWindow(animWin);
- animWin->setFinished(FALSE);
- it ++;
- }
-
-}
-
-void AnimateWindowManager::resetToRestPosition()
-{
-
- m_reverse = TRUE;
- m_needsUpdate = TRUE;
-
- AnimateWindowList::iterator it = m_winMustFinishList.begin();
- while (it != m_winMustFinishList.end())
- {
- wnd::AnimateWindow *animWin = *it;
- if (!animWin)
- {
- DEBUG_CRASH(("There's No AnimateWindow in the AnimateWindow List"));
- return;
- }
- ICoord2D restPos = animWin->getRestPos();
- GameWindow *win = animWin->getGameWindow();
- if(win)
- win->winSetPosition(restPos.x, restPos.y);
- it ++;
- }
- it = m_winList.begin();
- while (it != m_winList.end())
- {
- wnd::AnimateWindow *animWin = *it;
- if (!animWin)
- {
- DEBUG_CRASH(("There's No AnimateWindow in the AnimateWindow List"));
- return;
- }
- ICoord2D restPos = animWin->getRestPos();
- GameWindow *win = animWin->getGameWindow();
- if(win)
- win->winSetPosition(restPos.x, restPos.y);
- it ++;
- }
-
-
-}
-
-//-----------------------------------------------------------------------------
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp
deleted file mode 100644
index 1cdda2b5253..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp
+++ /dev/null
@@ -1,427 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: ControlBarMultiSelect.cpp ////////////////////////////////////////////////////////////////
-// Author: Colin Day, March 2002
-// Desc: Context sensitive GUI for when you select multiple objects. What we do is show
-// the commands that you can use between them all
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/ThingTemplate.h"
-#include "GameClient/ControlBar.h"
-#include "GameClient/Drawable.h"
-#include "GameClient/GameClient.h"
-#include "GameClient/GadgetPushButton.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/InGameUI.h"
-#include "GameLogic/Object.h"
-
-
-
-
-//-------------------------------------------------------------------------------------------------
-/** Reset the common command data */
-//-------------------------------------------------------------------------------------------------
-void ControlBar::resetCommonCommandData()
-{
- Int i;
-
- for( i = 0; i < MAX_COMMANDS_PER_SET; i++ )
- {
- m_commonCommands[ i ] = nullptr;
- //Clear out any remnant overlays.
- GadgetButtonDrawOverlayImage( m_commandWindows[ i ], nullptr );
- }
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** add the common commands of this drawable to the common command set */
-//-------------------------------------------------------------------------------------------------
-void ControlBar::addCommonCommands( Drawable *draw, Bool firstDrawable )
-{
- Int i;
- const CommandButton *command;
-
- // sanity
- if( draw == nullptr )
- return;
-
- Object* obj = draw->getObject();
- if (!obj)
- return;
-
- if (obj->isKindOf(KINDOF_IGNORED_IN_GUI)) // ignore these guys
- return;
-
- // get the command set of this drawable
- const CommandSet *commandSet = findCommandSet( obj->getCommandSetString() );
- if( commandSet == nullptr )
- {
-
- //
- // if there is no command set for this drawable, none of the selected drawables
- // can possibly have matching commands so we'll get rid of them all
- //
- for( i = 0; i < MAX_COMMANDS_PER_SET; i++ )
- {
-
- m_commonCommands[ i ] = nullptr;
- if (m_commandWindows[ i ])
- {
- m_commandWindows[ i ]->winHide( TRUE );
- }
- // After Every change to the m_commandWIndows, we need to show fill in the missing blanks with the images
- // removed from multiplayer branch
- //showCommandMarkers();
-
- }
-
- return;
-
- }
-
-
- //
- // easy case, if we're adding the first drawable we simply just add any of the commands
- // in its set that can be multi-select commands to the common command set
- //
- if( firstDrawable == TRUE )
- {
-
- // just add each command that is classified as a common command
- for( i = 0; i < MAX_COMMANDS_PER_SET; i++ )
- {
- // our implementation doesn't necessarily make use of the max possible command buttons
- if (! m_commandWindows[ i ]) continue;
-
- // get command
- command = commandSet->getCommandButton(i);
-
- // add if present and can be used in a multi select
- if( command && BitIsSet( command->getOptions(), OK_FOR_MULTI_SELECT ) == TRUE )
- {
-
- // put it in the common command set
- m_commonCommands[ i ] = command;
-
- // show and enable this control
- m_commandWindows[ i ]->winHide( FALSE );
- m_commandWindows[ i ]->winEnable( TRUE );
-
- // set the command into the control
- setControlCommand( m_commandWindows[ i ], command );
-
- }
-
- }
-
- }
- else
- {
-
- // go through each command one by one
- for( i = 0; i < MAX_COMMANDS_PER_SET; i++ )
- {
-
- // our implementation doesn't necessarily make use of the max possible command buttons
- if (! m_commandWindows[ i ]) continue;
-
- // get the command
- command = commandSet->getCommandButton(i);
-
- Bool attackMove = (command && command->getCommandType() == GUI_COMMAND_ATTACK_MOVE) ||
- (m_commonCommands[ i ] && m_commonCommands[ i ]->getCommandType() == GUI_COMMAND_ATTACK_MOVE);
-
- // Kris: When any units have attack move, they all get it. This is to allow
- // combat units to be selected with the odd dozer or pilot and still retain that ability.
- if( attackMove && !m_commonCommands[ i ] )
- {
- // put it in the common command set
- m_commonCommands[ i ] = command;
-
- // show and enable this control
- m_commandWindows[ i ]->winHide( FALSE );
- m_commandWindows[ i ]->winEnable( TRUE );
-
- // set the command into the control
- setControlCommand( m_commandWindows[ i ], command );
- }
- else if( command != m_commonCommands[ i ] && !attackMove )
- {
- //
- // if this command does not match the command that is in the common command set then
- // *neither* this command OR the command in the common command set are really common
- // commands, so we will remove the one that has been stored in the common set
- //
-
- // remove the common command
- m_commonCommands[ i ] = nullptr;
-
- //
- // hide the window control cause it should have been made visible from a command
- // that was placed in this common 'slot' earlier
- //
- m_commandWindows[ i ]->winHide( TRUE );
- }
-
- }
-
- }
-
- // After Every change to the m_commandWIndows, we need to show fill in the missing blanks with the images
- // removed from multiplayer branch
- //showCommandMarkers();
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Populate the visible command bar with commands that are common to all the objects
- * that are selected in the UI */
-//-------------------------------------------------------------------------------------------------
-void ControlBar::populateMultiSelect()
-{
- Drawable *draw;
- Bool firstDrawable = TRUE;
- Bool portraitSet = FALSE;
- const Image *portrait = nullptr;
- Object *portraitObj = nullptr;
-
- // first reset the common command data
- resetCommonCommandData();
-
- // by default, hide all the controls in the command section
- for( Int i = 0; i < MAX_COMMANDS_PER_SET; i++ )
- {
- if (m_commandWindows[ i ])
- {
- m_commandWindows[ i ]->winHide( TRUE );
- }
- }
-
- // sanity
- DEBUG_ASSERTCRASH( TheInGameUI->getSelectCount() > 1,
- ("populateMultiSelect: Can't populate multiselect context cause there are only '%d' things selected",
- TheInGameUI->getSelectCount()) );
-
- // get the list of drawable IDs from the in game UI
- const DrawableList *selectedDrawables = TheInGameUI->getAllSelectedDrawables();
-
- // sanity
- DEBUG_ASSERTCRASH( selectedDrawables->empty() == FALSE, ("populateMultiSelect: Drawable list is empty") );
-
- // loop through all the selected drawables
- for( DrawableListCIt it = selectedDrawables->begin();
- it != selectedDrawables->end(); ++it )
- {
-
- // get the drawable
- draw = *it;
-
-
- if (draw->getObject()->isKindOf(KINDOF_IGNORED_IN_GUI)) // ignore these guys
- continue;
-
-
- //
- // add command for this drawable, note that we also sanity check to make sure the
- // drawable has an object as all interesting drawables that we can select should
- // actually have an object underneath it so that we can do interesting things with
- // it ... otherwise we should have never selected it.
- // NOTE that we're not considering objects that are currently in the process of
- // being sold as those objects can't be issued anymore commands
- //
- if( draw && draw->getObject() &&
- !draw->getObject()->getStatusBits().test( OBJECT_STATUS_SOLD ) )
- {
-
- // add the common commands of this drawable to the common command set
- addCommonCommands( draw, firstDrawable );
-
- // not adding the first drawable anymore
- firstDrawable = FALSE;
-
- //
- // keep track of the portrait images, if all units selected have the same portrait
- // we will display it in the right HUD, otherwise we won't
- //
- if( portraitSet == FALSE )
- {
-
- portrait = draw->getTemplate()->getSelectedPortraitImage();
- portraitObj = draw->getObject();
- portraitSet = TRUE;
-
- }
- else if( draw->getTemplate()->getSelectedPortraitImage() != portrait )
- portrait = nullptr;
-
- }
-
- }
-
- // set the portrait image
- setPortraitByObject( portraitObj );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Update logic for the multi select context sensitive GUI */
-//-------------------------------------------------------------------------------------------------
-void ControlBar::updateContextMultiSelect()
-{
- Drawable *draw;
- Object *obj;
- const CommandButton *command;
- GameWindow *win;
- Int objectsThatCanDoCommand[ MAX_COMMANDS_PER_SET ];
- Int i;
-
- // zero the array that counts how many objects can do each command
- memset( objectsThatCanDoCommand, 0, sizeof( objectsThatCanDoCommand ) );
-
- // sanity
- DEBUG_ASSERTCRASH( TheInGameUI->getSelectCount() > 1,
- ("updateContextMultiSelect: TheInGameUI only has '%d' things selected",
- TheInGameUI->getSelectCount()) );
-
- // get the list of drawable IDs from the in game UI
- const DrawableList *selectedDrawables = TheInGameUI->getAllSelectedDrawables();
-
- // sanity
- DEBUG_ASSERTCRASH( selectedDrawables->empty() == FALSE, ("populateMultiSelect: Drawable list is empty") );
-
- // loop through all the selected drawable IDs
- for( DrawableListCIt it = selectedDrawables->begin();
- it != selectedDrawables->end(); ++it )
- {
-
- // get the drawable from the ID
- draw = *it;
-
- if (draw->getObject()->isKindOf(KINDOF_IGNORED_IN_GUI)) // ignore these guys
- continue;
-
-
- // get the object
- obj = draw->getObject();
-
- // sanity
- if( obj == nullptr )
- continue;
-
- // for each of the visible command windows make sure the object can execute the command
- for( i = 0; i < MAX_COMMANDS_PER_SET; i++ )
- {
-
- // get the control window
- win = m_commandWindows[ i ];
-
- // our implementation doesn't necessarily make use of the max possible command buttons
- if (!win) continue;
-
- // don't consider hidden windows
- if( win->winIsHidden() == TRUE )
- continue;
-
- // get the command
- command = (const CommandButton *)GadgetButtonGetData(win);
- if( command == nullptr )
- continue;
-
- // can we do the command
- CommandAvailability availability = getCommandAvailability( command, obj, win );
-
- win->winClearStatus( WIN_STATUS_NOT_READY );
- win->winClearStatus( WIN_STATUS_ALWAYS_COLOR );
-
- // enable/disable the window control
- switch( availability )
- {
- case COMMAND_HIDDEN:
- win->winHide( TRUE );
- break;
- case COMMAND_RESTRICTED:
- win->winEnable( FALSE );
- break;
- case COMMAND_NOT_READY:
- win->winEnable( FALSE );
- win->winSetStatus( WIN_STATUS_NOT_READY );
- break;
- case COMMAND_CANT_AFFORD:
- win->winEnable( FALSE );
- win->winSetStatus( WIN_STATUS_ALWAYS_COLOR );
- break;
- default:
- win->winEnable( TRUE );
- break;
- }
-
- //If button is a CHECK_LIKE, then update it's status now.
- if( BitIsSet( command->getOptions(), CHECK_LIKE ) )
- {
- GadgetCheckLikeButtonSetVisualCheck( win, availability == COMMAND_ACTIVE );
- }
-
- if( availability == COMMAND_AVAILABLE || availability == COMMAND_ACTIVE )
- objectsThatCanDoCommand[ i ]++;
-
- }
-
- }
-
- //
- // for each command, if any objects can do the command we enable the window, otherwise
- // we disable it
- //
- for( i = 0; i < MAX_COMMANDS_PER_SET; i++ )
- {
- // our implementation doesn't necessarily make use of the max possible command buttons
- if (! m_commandWindows[ i ]) continue;
-
- // don't consider hidden commands
- if( m_commandWindows[ i ]->winIsHidden() == TRUE )
- continue;
-
- // don't consider slots that don't have commands
- if( m_commonCommands[ i ] == nullptr )
- continue;
-
- // check the count of objects that can do the command and enable/disable the control,
- if( objectsThatCanDoCommand[ i ] > 0 )
- m_commandWindows[ i ]->winEnable( TRUE );
- else
- m_commandWindows[ i ]->winEnable( FALSE );
-
- }
-
- // After Every change to the m_commandWIndows, we need to show fill in the missing blanks with the images
- // removed from multiplayer branch
- //showCommandMarkers();
-
-
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp
deleted file mode 100644
index 56d8f878315..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp
+++ /dev/null
@@ -1,383 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: ControlBarObserver.cpp /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Aug 2002
-//
-// Filename: ControlBarObserver.cpp
-//
-// author: Chris Huybregts
-//
-// purpose: All things related to the Observer Control bar, are in here.
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/GameUtility.h"
-#include "Common/NameKeyGenerator.h"
-#include "Common/PlayerList.h"
-#include "Common/Player.h"
-#include "Common/PlayerTemplate.h"
-#include "Common/KindOf.h"
-#include "Common/Recorder.h"
-#include "GameClient/ControlBar.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetPushButton.h"
-#include "GameClient/GadgetStaticText.h"
-#include "GameClient/GameText.h"
-#include "GameNetwork/NetworkDefs.h"
-//-----------------------------------------------------------------------------
-// DEFINES ////////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-enum { MAX_BUTTONS = 8};
-static NameKeyType buttonPlayerID[MAX_BUTTONS] = { NAMEKEY_INVALID,NAMEKEY_INVALID,
- NAMEKEY_INVALID,NAMEKEY_INVALID,
- NAMEKEY_INVALID,NAMEKEY_INVALID,
- NAMEKEY_INVALID,NAMEKEY_INVALID };
-static NameKeyType staticTextPlayerID[MAX_BUTTONS] = { NAMEKEY_INVALID,NAMEKEY_INVALID,
- NAMEKEY_INVALID,NAMEKEY_INVALID,
- NAMEKEY_INVALID,NAMEKEY_INVALID,
- NAMEKEY_INVALID,NAMEKEY_INVALID };
-static GameWindow *ObserverPlayerInfoWindow = nullptr;
-static GameWindow *ObserverPlayerListWindow = nullptr;
-
-static GameWindow *buttonPlayer[MAX_BUTTONS] = {0};
-static GameWindow *staticTextPlayer[MAX_BUTTONS] = {0};
-
-
-static NameKeyType buttonCancelID = NAMEKEY_INVALID;
-
-static GameWindow *winFlag = nullptr;
-static GameWindow *winGeneralPortrait = nullptr;
-// TheSuperHackers @tweak Allow idle worker selection for observers.
-static GameWindow *buttonIdleWorker = nullptr;
-static GameWindow *staticTextNumberOfUnits = nullptr;
-static GameWindow *staticTextNumberOfBuildings = nullptr;
-static GameWindow *staticTextNumberOfUnitsKilled = nullptr;
-static GameWindow *staticTextNumberOfUnitsLost = nullptr;
-static GameWindow *staticTextPlayerName = nullptr;
-
-static NameKeyType s_replayObserverNameKey = NAMEKEY_INVALID;
-
-//-----------------------------------------------------------------------------
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-
-void ControlBar::initObserverControls()
-{
- ObserverPlayerInfoWindow = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey("ControlBar.wnd:ObserverPlayerInfoWindow"));
- ObserverPlayerListWindow = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey("ControlBar.wnd:ObserverPlayerListWindow"));
-
- for (Int i = 0; i < MAX_BUTTONS; i++)
- {
- AsciiString tmpString;
- tmpString.format("ControlBar.wnd:ButtonPlayer%d", i);
- buttonPlayerID[i] = TheNameKeyGenerator->nameToKey( tmpString );
- buttonPlayer[i] = TheWindowManager->winGetWindowFromId( ObserverPlayerListWindow, buttonPlayerID[i] );
- tmpString.format("ControlBar.wnd:StaticTextPlayer%d", i);
- staticTextPlayerID[i] = TheNameKeyGenerator->nameToKey( tmpString );
- staticTextPlayer[i] = TheWindowManager->winGetWindowFromId( ObserverPlayerListWindow, staticTextPlayerID[i] );
- }
-
- staticTextNumberOfUnits = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey("ControlBar.wnd:StaticTextNumberOfUnits"));
- staticTextNumberOfBuildings = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey("ControlBar.wnd:StaticTextNumberOfBuildings"));
- staticTextNumberOfUnitsKilled = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey("ControlBar.wnd:StaticTextNumberOfUnitsKilled"));
- staticTextNumberOfUnitsLost = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey("ControlBar.wnd:StaticTextNumberOfUnitsLost"));
- staticTextPlayerName = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey("ControlBar.wnd:StaticTextPlayerName"));
- winFlag = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey("ControlBar.wnd:WinFlag"));
- winGeneralPortrait = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey("ControlBar.wnd:WinGeneralPortrait"));
- buttonIdleWorker = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey("ControlBar.wnd:ButtonIdleWorker"));
-
- buttonCancelID = TheNameKeyGenerator->nameToKey("ControlBar.wnd:ButtonCancel");
-
- s_replayObserverNameKey = TheNameKeyGenerator->nameToKey("ReplayObserver");
-}
-
-//-------------------------------------------------------------------------------------------------
-void ControlBar::setObserverLookAtPlayer(Player *player)
-{
- if (player != nullptr && player == ThePlayerList->findPlayerWithNameKey(s_replayObserverNameKey))
- {
- // Looking at the observer. Treat as not looking at player.
- m_observerLookAtPlayer = nullptr;
- }
- else
- {
- m_observerLookAtPlayer = player;
- }
-}
-
-//-------------------------------------------------------------------------------------------------
-void ControlBar::setObservedPlayer(Player *player)
-{
- if (player != nullptr && player == ThePlayerList->findPlayerWithNameKey(s_replayObserverNameKey))
- {
- // Looking at the observer. Treat as not observing player.
- m_observedPlayer = nullptr;
- }
- else
- {
- m_observedPlayer = player;
- }
-}
-
-//-------------------------------------------------------------------------------------------------
-/** System callback for the ControlBarObserverSystem */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType ControlBarObserverSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- static NameKeyType buttonCommunicator = NAMEKEY_INVALID;
-
- switch( msg )
- {
- // --------------------------------------------------------------------------------------------
- case GWM_CREATE:
- {
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GBM_MOUSE_ENTERING:
- case GBM_MOUSE_LEAVING:
- {
- break;
- }
-
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- case GBM_SELECTED_RIGHT:
- {
- GameWindow *control = (GameWindow *)mData1;
-
- Int controlID = control->winGetWindowId();
- if( controlID == buttonCancelID)
- {
- rts::changeObservedPlayer(nullptr);
-
- ObserverPlayerInfoWindow->winHide(TRUE);
- ObserverPlayerListWindow->winHide(FALSE);
- buttonIdleWorker->winHide(TRUE);
- TheControlBar->populateObserverList();
- }
-
- for(Int i = 0; i (GadgetButtonGetData(buttonPlayer[i]));
- rts::changeObservedPlayer(player);
-
- ObserverPlayerInfoWindow->winHide(FALSE);
- ObserverPlayerListWindow->winHide(TRUE);
-
- if(TheControlBar->getObserverLookAtPlayer())
- TheControlBar->populateObserverInfoWindow();
-
- return MSG_HANDLED;
- }
- }
-
- // if( controlID == buttonCommunicator && TheGameLogic->getGameMode() == GAME_INTERNET )
- /*
- {
- popupCommunicatorLayout = TheWindowManager->winCreateLayout( "Menus/PopupCommunicator.wnd" );
- popupCommunicatorLayout->runInit();
- popupCommunicatorLayout->hide( FALSE );
- popupCommunicatorLayout->bringForward();
- }
-*/
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-//-----------------------------------------------------------------------------
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-void ControlBar::populateObserverList()
-{
- Int currentButton = 0, i;
- if(TheRecorder->isMultiplayer())
- {
-
- for (i = 0; i < MAX_SLOTS; ++i)
- {
- AsciiString name;
- name.format("player%d", i);
- Player *p = ThePlayerList->findPlayerWithNameKey(TheNameKeyGenerator->nameToKey(name));
- if(p)
- {
- if(p->isPlayerObserver())
- continue;
- DEBUG_ASSERTCRASH(currentButton < MAX_BUTTONS, ("ControlBar::populateObserverList trying to populate more buttons then we have"));
- GadgetButtonSetData(buttonPlayer[currentButton], (void *)p);
- GadgetButtonSetEnabledImage( buttonPlayer[currentButton], p->getPlayerTemplate()->getEnabledImage() );
- //GadgetButtonSetHiliteImage( buttonPlayer[currentButton], p->getPlayerTemplate()->getHiliteImage() );
- //GadgetButtonSetHiliteSelectedImage( buttonPlayer[currentButton], p->getPlayerTemplate()->getPushedImage() );
- //GadgetButtonSetDisabledImage( buttonPlayer[currentButton], p->getPlayerTemplate()->getDisabledImage() );
- buttonPlayer[currentButton]->winSetTooltip(p->getPlayerDisplayName());
- buttonPlayer[currentButton]->winHide(FALSE);
- buttonPlayer[currentButton]->winSetStatus( WIN_STATUS_USE_OVERLAY_STATES );
-
- const GameSlot *slot = TheGameInfo->getConstSlot(i);
- Color playerColor = p->getPlayerColor();
- Color backColor = GameMakeColor(0, 0, 0, 255);
- staticTextPlayer[currentButton]->winSetEnabledTextColors( playerColor, backColor );
- staticTextPlayer[currentButton]->winHide(FALSE);
- AsciiString teamStr;
- teamStr.format("Team:%d", slot->getTeamNumber() + 1);
- if (slot->isAI() && slot->getTeamNumber() == -1)
- teamStr = "Team:AI";
-
- UnicodeString text;
- text.format(TheGameText->fetch("CONTROLBAR:ObsPlayerLabel"), p->getPlayerDisplayName().str(),
- TheGameText->fetch(teamStr).str());
-
- GadgetStaticTextSetText(staticTextPlayer[currentButton], text );
-
- ++currentButton;
- }
- }
- for(currentButton; currentButtonwinHide(TRUE);
- staticTextPlayer[currentButton]->winHide(TRUE);
- }
- }
- else
- {
- for(i =0; i < MAX_PLAYER_COUNT; ++i)
- {
- Player *p = ThePlayerList->getNthPlayer(i);
- if(p && !p->isPlayerObserver() && p->getPlayerType() == PLAYER_HUMAN)
- {
- DEBUG_ASSERTCRASH(currentButton < MAX_BUTTONS, ("ControlBar::populateObserverList trying to populate more buttons then we have"));
- GadgetButtonSetData(buttonPlayer[currentButton], (void *)p);
- GadgetButtonSetEnabledImage( buttonPlayer[currentButton], p->getPlayerTemplate()->getEnabledImage() );
- //GadgetButtonSetHiliteImage( buttonPlayer[currentButton], p->getPlayerTemplate()->getHiliteImage() );
- //GadgetButtonSetHiliteSelectedImage( buttonPlayer[currentButton], p->getPlayerTemplate()->getPushedImage() );
- //GadgetButtonSetDisabledImage( buttonPlayer[currentButton], p->getPlayerTemplate()->getDisabledImage() );
- buttonPlayer[currentButton]->winSetTooltip(p->getPlayerDisplayName());
- buttonPlayer[currentButton]->winHide(FALSE);
- buttonPlayer[currentButton]->winSetStatus( WIN_STATUS_USE_OVERLAY_STATES );
-
- Color playerColor = p->getPlayerColor();
- Color backColor = GameMakeColor(0, 0, 0, 255);
- staticTextPlayer[currentButton]->winSetEnabledTextColors( playerColor, backColor );
- staticTextPlayer[currentButton]->winHide(FALSE);
- GadgetStaticTextSetText(staticTextPlayer[currentButton], p->getPlayerDisplayName());
-
- ++currentButton;
- break;
- }
- }
- for(currentButton; currentButtonwinHide(TRUE);
- staticTextPlayer[currentButton]->winHide(TRUE);
- }
- }
-}
-
-void ControlBar::populateObserverInfoWindow ()
-{
- if(ObserverPlayerInfoWindow->winIsHidden())
- return;
-
- if( !m_observerLookAtPlayer )
- {
- ObserverPlayerInfoWindow->winHide(TRUE);
- ObserverPlayerListWindow->winHide(FALSE);
- buttonIdleWorker->winHide(TRUE);
- populateObserverList();
- return;
- }
-
- UnicodeString uString;
- KindOfMaskType mask,clearmask;
- mask.set(KINDOF_SCORE);
- clearmask.set(KINDOF_STRUCTURE);
-
- uString.format(L"%d",m_observerLookAtPlayer->countObjects(mask,clearmask));
- GadgetStaticTextSetText(staticTextNumberOfUnits, uString);
-
- Int numBuildings = 0;
- mask.clear();
- mask.set(KINDOF_SCORE);
- mask.set(KINDOF_STRUCTURE);
- clearmask.clear();
- numBuildings = m_observerLookAtPlayer->countObjects(mask,clearmask);
- mask.clear();
- mask.set(KINDOF_SCORE_CREATE);
- mask.set(KINDOF_STRUCTURE);
- numBuildings += m_observerLookAtPlayer->countObjects(mask,clearmask);
- mask.clear();
- mask.set(KINDOF_SCORE_DESTROY);
- mask.set(KINDOF_STRUCTURE);
- numBuildings += m_observerLookAtPlayer->countObjects(mask,clearmask);
- uString.format(L"%d",numBuildings);
- GadgetStaticTextSetText(staticTextNumberOfBuildings, uString);
- uString.format(L"%d",m_observerLookAtPlayer->getScoreKeeper()->getTotalUnitsDestroyed());
- GadgetStaticTextSetText(staticTextNumberOfUnitsKilled, uString);
- uString.format(L"%d",m_observerLookAtPlayer->getScoreKeeper()->getTotalUnitsLost());
- GadgetStaticTextSetText(staticTextNumberOfUnitsLost, uString);
- GadgetStaticTextSetText(staticTextPlayerName, m_observerLookAtPlayer->getPlayerDisplayName());
- Color color = m_observerLookAtPlayer->getPlayerColor();
- staticTextPlayerName->winSetEnabledTextColors(color, GameMakeColor(0,0,0,255));
- winFlag->winSetEnabledImage(0, m_observerLookAtPlayer->getPlayerTemplate()->getFlagWaterMarkImage());
- winGeneralPortrait->winHide(FALSE);
- buttonIdleWorker->winHide(FALSE);
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp
deleted file mode 100644
index 197205b5f47..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp
+++ /dev/null
@@ -1,104 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: ControlBarPrintPositions.cpp /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Sep 2002
-//
-// Filename: ControlBarPrintPositions.cpp
-//
-// author: Chris Huybregts
-//
-// purpose: Convenience function for degayifying the whole squished control bar
-// process
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/WindowLayout.h"
-//-----------------------------------------------------------------------------
-// DEFINES ////////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-void PrintInfoRecursive( GameWindow *win, FILE *fp)
-{
- if(!win)
- return;
- ICoord2D pos, size;
- win->winGetSize(&size.x, &size.y);
- win->winGetPosition(&pos.x, &pos.y);
- fprintf(fp, "ControlBarResizer %s\n",win->winGetInstanceData()->m_decoratedNameString.str());
- fprintf(fp, " AltPosition = X:%d Y:%d\n",pos.x, pos.y);
- fprintf(fp, " AltSize = X:%d Y:%d\n",size.x, size.y);
- fprintf(fp, "END\n\n");
-
- PrintInfoRecursive(win->winGetChild(),fp);
- PrintInfoRecursive(win->winGetNext(),fp);
-
-}
-
-void PrintOffsetsFromControlBarParent()
-{
- GameWindow *controlBarParent = TheWindowManager->winGetWindowFromId( nullptr, TheNameKeyGenerator->nameToKey( "ControlBar.wnd:ControlBarParent" ));
- if(!controlBarParent)
- return;
-
- WindowLayout *layout = TheWindowManager->winCreateLayout("controlBarHidden.wnd");
- if(!layout)
- return;
- FILE *fp = fopen("ControlBarEasier.txt", "w");
- if(!fp)
- return;
-
- PrintInfoRecursive(layout->getFirstWindow(), fp);
-
- fclose(fp);
- layout->destroyWindows();
- deleteInstance(layout);
-}
-
-
-//-----------------------------------------------------------------------------
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp
deleted file mode 100644
index f639cd61517..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp
+++ /dev/null
@@ -1,245 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: ControlBarResizer.cpp /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Sep 2002
-//
-// Filename: ControlBarResizer.cpp
-//
-// author: Chris Huybregts
-//
-// purpose: We want a "squished" control bar, this is the methods that will do it
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "GameClient/ControlBar.h"
-#include "GameClient/ControlBarResizer.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/Display.h"
-//-----------------------------------------------------------------------------
-// DEFINES ////////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-const FieldParse ControlBarResizer::m_controlBarResizerParseTable[] =
-{
- { "AltPosition", INI::parseICoord2D, nullptr, offsetof( ResizerWindow, m_altPos ) },
- { "AltSize", INI::parseICoord2D, nullptr, offsetof( ResizerWindow, m_altSize ) },
- { nullptr, nullptr, nullptr, 0 }
-
-};
-//-----------------------------------------------------------------------------
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-ResizerWindow::ResizerWindow()
-{
- m_defaultPos.x = m_defaultPos.y = 0;
- m_defaultSize.x = m_defaultSize.y = 0;
- m_altSize.x = m_altSize.y = 0;
- m_altPos.x = m_altPos.y = 0;
-}
-
-ControlBarResizer::ControlBarResizer()
-{
-
-}
-ControlBarResizer::~ControlBarResizer()
-{
- ResizerWindowList::iterator it = m_resizerWindowsList.begin();
- while (it != m_resizerWindowsList.end())
- {
- ResizerWindow *rWin = *it;
- if( !rWin )
- {
- it = m_resizerWindowsList.erase(it);
- continue;
- }
- delete rWin;
- it = m_resizerWindowsList.erase(it);
- }
- m_resizerWindowsList.clear();
-}
-
-void ControlBarResizer::init()
-{
- INI ini;
- // Read from INI all the ControlBarSchemes
- ini.loadFileDirectory( "Data\\INI\\ControlBarResizer", INI_LOAD_OVERWRITE, nullptr );
-
-}
-
-
-ResizerWindow *ControlBarResizer::findResizerWindow( AsciiString name )
-{
- ResizerWindowList::iterator it = m_resizerWindowsList.begin();
-
- while (it != m_resizerWindowsList.end())
- {
- ResizerWindow *rWin = *it;
- if( !rWin )
- {
- DEBUG_CRASH(("There's no resizerWindow in ControlBarResizer::findResizerWindow"));
- it++;
- continue;
- }
- // find the scheme that best matches our resolution
- if(rWin->m_name.compare(name) == 0)
- {
- return rWin;
- }
- it ++;
- }
- return nullptr;
-}
-
-ResizerWindow *ControlBarResizer::newResizerWindow( AsciiString name )
-{
- ResizerWindow *newRwin = NEW ResizerWindow;
- if(!newRwin)
- return nullptr;
-
- newRwin->m_name = name;
- GameWindow *win = nullptr;
- win = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey(name));
- if( !win )
- {
- DEBUG_ASSERTCRASH(win,("ControlBarResizer::newResizerWindow could not find window %s Are you sure that window is loaded yet?", name.str()) );
- delete newRwin;
- return nullptr;
- }
- win->winGetPosition(&newRwin->m_defaultPos.x,&newRwin->m_defaultPos.y);
- win->winGetSize(&newRwin->m_defaultSize.x,&newRwin->m_defaultSize.y);
- m_resizerWindowsList.push_back(newRwin);
- return newRwin;
-}
-void ControlBarResizer::sizeWindowsDefault()
-{
- ResizerWindowList::iterator it = m_resizerWindowsList.begin();
- GameWindow *win = nullptr;
- while (it != m_resizerWindowsList.end())
- {
- ResizerWindow *rWin = *it;
- if( !rWin )
- {
- DEBUG_CRASH(("There's no resizerWindow in ControlBarResizer::sizeWindowsDefault"));
- it++;
- continue;
- }
- win = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey(rWin->m_name));
- if(!win)
- {
- it++;
- continue;
- }
- win->winSetPosition(rWin->m_defaultPos.x, rWin->m_defaultPos.y);
- win->winSetSize(rWin->m_defaultSize.x, rWin->m_defaultSize.y);
- DEBUG_LOG(("sizeWindowsDefault:%s pos X:%d pos Y: %d size X:%d sizeY: %d",rWin->m_name.str(),rWin->m_defaultPos.x, rWin->m_defaultPos.y,rWin->m_defaultSize.x, rWin->m_defaultSize.y ));
- it ++;
- }
-}
-void ControlBarResizer::sizeWindowsAlt()
-{
- ResizerWindowList::iterator it = m_resizerWindowsList.begin();
- GameWindow *win = nullptr;
- Real x = (Real)TheDisplay->getWidth() / DEFAULT_DISPLAY_WIDTH;
- Real y = (Real)TheDisplay->getHeight() / DEFAULT_DISPLAY_HEIGHT;
- while (it != m_resizerWindowsList.end())
- {
- ResizerWindow *rWin = *it;
- if( !rWin )
- {
- DEBUG_CRASH(("There's no resizerWindow in ControlBarResizer::sizeWindowsDefault"));
- it++;
- continue;
- }
- win = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey(rWin->m_name));
- if(!win)
- {
- it++;
- continue;
- }
-
- win->winSetPosition(rWin->m_altPos.x * x, rWin->m_altPos.y * y);
- if(rWin->m_altSize.x >0 || rWin->m_altSize.y > 0)
- win->winSetSize(rWin->m_altSize.x *x, rWin->m_altSize.y *y);
- DEBUG_LOG(("sizeWindowsAlt:%s pos X:%d pos Y: %d size X:%d sizeY: %d",rWin->m_name.str(), rWin->m_altPos.x*x, rWin->m_altPos.y*y,rWin->m_altSize.x*x, rWin->m_altSize.y *y));
- it ++;
- }
-}
-
-
-void INI::parseControlBarResizerDefinition( INI* ini )
-{
-// AsciiString name;
-// ResizerWindow *rWin = nullptr;
-//
-// // read the name
-// const char* c = ini->getNextToken();
-// name.set( c );
-//
-//// ControlBarResizer *resizer = TheControlBar->getControlBarResizer();
-// if( !resizer )
-// {
-// //We don't need it if we're in the builder... which doesn't have this.
-// return;
-// }
-// rWin = resizer->findResizerWindow( name );
-// if( rWin == nullptr )
-// {
-//
-// // image not found, create a new one
-// rWin = resizer->newResizerWindow(name);
-// DEBUG_ASSERTCRASH( rWin, ("parseControlBarResizerDefinition: unable to allocate ResizerWindow for '%s'",
-// name.str()) );
-//
-// } // end if
-//
-// // parse the ini definition
-// ini->initFromINI( rWin, resizer->getFieldParse());
-//
-}
-
-
-//-----------------------------------------------------------------------------
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp
deleted file mode 100644
index 5bbe5fe01ec..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp
+++ /dev/null
@@ -1,123 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: ControlBarUnderConstruction.cpp //////////////////////////////////////////////////////////
-// Author: Colin Day, March 2002
-// Desc: Methods specific to the control bar under construction context
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/NameKeyGenerator.h"
-#include "Common/ThingTemplate.h"
-
-#include "GameLogic/Object.h"
-#include "GameLogic/Module/UpdateModule.h"
-
-#include "GameClient/Drawable.h"
-#include "GameClient/GameText.h"
-#include "GameClient/ControlBar.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetStaticText.h"
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-void ControlBar::updateConstructionTextDisplay( Object *obj )
-{
- UnicodeString text;
- static UnsignedInt descID = TheNameKeyGenerator->nameToKey( "ControlBar.wnd:UnderConstructionDesc" );
- GameWindow *descWindow = TheWindowManager->winGetWindowFromId( nullptr, descID );
-
- // sanity
- DEBUG_ASSERTCRASH( descWindow, ("Under construction window not found") );
-
- // format the message
- text.format( TheGameText->fetch( "CONTROLBAR:UnderConstructionDesc" ),
- obj->getConstructionPercent() );
- GadgetStaticTextSetText( descWindow, text );
-
- // record this as the last percentage displayed
- m_displayedConstructPercent = obj->getConstructionPercent();
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Populate the interface for an under construction context. */
-//-------------------------------------------------------------------------------------------------
-void ControlBar::populateUnderConstruction( Object *objectUnderConstruction )
-{
-
- // sanity
- if( objectUnderConstruction == nullptr )
- return;
-
- // get our parent window
- GameWindow *parent = m_contextParent[ CP_UNDER_CONSTRUCTION ];
-
- // set the cancel construction button
-/// @todo srj -- remove hard-coding here, please
- const CommandButton *commandButton = findCommandButton( "Command_CancelConstruction" );
- NameKeyType id;
- id = TheNameKeyGenerator->nameToKey( "ControlBar.wnd:ButtonCancelConstruction" );
- GameWindow *win = TheWindowManager->winGetWindowFromId( parent, id );
-
- setControlCommand( win, commandButton );
- win->winSetStatus( WIN_STATUS_USE_OVERLAY_STATES );
-
- // set the text description of what is building
- updateConstructionTextDisplay( objectUnderConstruction );
-
- // set the portrait for the thing being constructed
- setPortraitByObject( objectUnderConstruction );
-
- // and show the rally point, if it should have one,
- ExitInterface *exit = objectUnderConstruction->getObjectExitInterface();
- if( exit )
- showRallyPoint( exit->getRallyPoint() );
-
-
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-void ControlBar::updateContextUnderConstruction()
-{
- Object *obj = m_currentSelectedDrawable->getObject();
-
- // if the object is no longer under construction switch to a new appropriate context
- if( !obj->getStatusBits().test( OBJECT_STATUS_UNDER_CONSTRUCTION ) )
- {
-
- evaluateContextUI();
- return;
-
- }
-
- // if the construction percent has changed since what was last shown to the user update the text
- if( m_displayedConstructPercent != obj->getConstructionPercent() )
- updateConstructionTextDisplay( obj );
-
-}
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 ddafc23e33e..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp
+++ /dev/null
@@ -1,144 +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_NETGEARDELAY) {
-// GadgetStaticTextSetText(control, TheGameText->fetch("GUI:NetgearDelay"));
- 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/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp
deleted file mode 100644
index 2dbfe6c95ca..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp
+++ /dev/null
@@ -1,597 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: Diplomacy.cpp ///////////////////////////////////////////////////////////////////////
-// Author: Matthew D. Campbell - August 2002
-// Desc: GUI callbacks for the diplomacy menu
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/GlobalData.h"
-#include "Common/MultiplayerSettings.h"
-#include "Common/Player.h"
-#include "Common/PlayerList.h"
-#include "Common/PlayerTemplate.h"
-#include "Common/Recorder.h"
-#include "GameClient/AnimateWindowManager.h"
-#include "GameClient/Diplomacy.h"
-#include "GameClient/DisconnectMenu.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GadgetCheckBox.h"
-#include "GameClient/GadgetListBox.h"
-#include "GameClient/GadgetTextEntry.h"
-#include "GameClient/GadgetStaticText.h"
-#include "GameClient/GadgetRadioButton.h"
-#include "GameClient/GameClient.h"
-#include "GameClient/GameText.h"
-#include "GameClient/GUICallbacks.h"
-#include "GameClient/InGameUI.h"
-#include "GameLogic/GameLogic.h"
-#include "GameLogic/VictoryConditions.h"
-#include "GameNetwork/GameInfo.h"
-#include "GameNetwork/NetworkInterface.h"
-#include "GameNetwork/GameSpy/BuddyDefs.h"
-#include "GameNetwork/GameSpy/PeerDefs.h"
-
-
-//-------------------------------------------------------------------------------------------------
-
-static NameKeyType staticTextPlayerID[MAX_SLOTS];
-static NameKeyType staticTextSideID[MAX_SLOTS];
-static NameKeyType staticTextTeamID[MAX_SLOTS];
-static NameKeyType staticTextStatusID[MAX_SLOTS];
-static NameKeyType buttonMuteID[MAX_SLOTS];
-static NameKeyType buttonUnMuteID[MAX_SLOTS];
-static NameKeyType radioButtonInGameID = NAMEKEY_INVALID;
-static NameKeyType radioButtonBuddiesID = NAMEKEY_INVALID;
-static GameWindow *radioButtonInGame = nullptr;
-static GameWindow *radioButtonBuddies = nullptr;
-static NameKeyType winInGameID = NAMEKEY_INVALID;
-static NameKeyType winBuddiesID = NAMEKEY_INVALID;
-static NameKeyType winSoloID = NAMEKEY_INVALID;
-static GameWindow *winInGame = nullptr;
-static GameWindow *winBuddies = nullptr;
-static GameWindow *winSolo = nullptr;
-static GameWindow *staticTextPlayer[MAX_SLOTS] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
-static GameWindow *staticTextSide[MAX_SLOTS] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
-static GameWindow *staticTextTeam[MAX_SLOTS] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
-static GameWindow *staticTextStatus[MAX_SLOTS] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
-static GameWindow *buttonMute[MAX_SLOTS] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
-static GameWindow *buttonUnMute[MAX_SLOTS] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
-static Int slotNumInRow[MAX_SLOTS];
-
-//-------------------------------------------------------------------------------------------------
-
-static WindowLayout *theLayout = nullptr;
-static GameWindow *theWindow = nullptr;
-static AnimateWindowManager *theAnimateWindowManager = nullptr;
-WindowMsgHandledType BuddyControlSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2);
-void InitBuddyControls(Int type);
-void updateBuddyInfo();
-static void grabWindowPointers()
-{
- for (Int i=0; iwinGetWindowFromId(theWindow, staticTextPlayerID[i]);
- staticTextSide[i] = TheWindowManager->winGetWindowFromId(theWindow, staticTextSideID[i]);
- staticTextTeam[i] = TheWindowManager->winGetWindowFromId(theWindow, staticTextTeamID[i]);
- staticTextStatus[i] = TheWindowManager->winGetWindowFromId(theWindow, staticTextStatusID[i]);
- buttonMute[i] = TheWindowManager->winGetWindowFromId(theWindow, buttonMuteID[i]);
- buttonUnMute[i] = TheWindowManager->winGetWindowFromId(theWindow, buttonUnMuteID[i]);
-
- slotNumInRow[i] = -1;
- }
-}
-
-static void releaseWindowPointers()
-{
- for (Int i=0; im_animateWindows)
- {
- Bool wasFinished = theAnimateWindowManager->isFinished();
- theAnimateWindowManager->update();
- if (theAnimateWindowManager->isFinished() && !wasFinished && theAnimateWindowManager->isReversed())
- theWindow->winHide( TRUE );
- }
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-static BriefingList theBriefingList;
-
-//-------------------------------------------------------------------------------------------------
-BriefingList* GetBriefingTextList()
-{
- return &theBriefingList;
-}
-
-//-------------------------------------------------------------------------------------------------
-void UpdateDiplomacyBriefingText(AsciiString newText, Bool clear)
-{
- GameWindow *listboxSolo = TheWindowManager->winGetWindowFromId(theWindow, NAMEKEY("Diplomacy.wnd:ListboxSolo"));
-
- if (clear)
- {
- theBriefingList.clear();
- if (listboxSolo)
- GadgetListBoxReset(listboxSolo);
- }
-
- if (newText.isEmpty())
- return;
-
- if (std::find(theBriefingList.begin(), theBriefingList.end(), newText) != theBriefingList.end())
- return;
-
- theBriefingList.push_back(newText);
- if (!listboxSolo)
- return;
-
- UnicodeString translated = TheGameText->fetch(newText);
-
- Int numEntries = GadgetListBoxGetNumEntries(listboxSolo);
- GadgetListBoxAddEntryText(listboxSolo, translated, TheInGameUI->getMessageColor(numEntries%2), -1);
-}
-
-// ------------------------------------------------------------------------------------------------
-// ------------------------------------------------------------------------------------------------
-void ShowDiplomacy( Bool immediate )
-{
- if (!TheInGameUI->getInputEnabled() || TheGameLogic->isIntroMoviePlaying() ||
- TheGameLogic->isLoadingMap())
- return;
-
-
- if (TheInGameUI->isQuitMenuVisible())
- return;
-
- if (TheDisconnectMenu && TheDisconnectMenu->isScreenVisible())
- return;
-
- if (theWindow)
- {
- theWindow->winHide(FALSE);
- theWindow->winEnable(TRUE);
- }
- else
- {
- theLayout = TheWindowManager->winCreateLayout( "Diplomacy.wnd" );
- theWindow = theLayout->getFirstWindow();
- theLayout->setUpdate(updateFunc);
- theAnimateWindowManager = NEW AnimateWindowManager;
- radioButtonInGameID = TheNameKeyGenerator->nameToKey("Diplomacy.wnd:RadioButtonInGame");
- radioButtonBuddiesID = TheNameKeyGenerator->nameToKey("Diplomacy.wnd:RadioButtonBuddies");
- radioButtonInGame = TheWindowManager->winGetWindowFromId(nullptr, radioButtonInGameID);
- radioButtonBuddies = TheWindowManager->winGetWindowFromId(nullptr, radioButtonBuddiesID);
- winInGameID = TheNameKeyGenerator->nameToKey("Diplomacy.wnd:InGameParent");
- winBuddiesID = TheNameKeyGenerator->nameToKey("Diplomacy.wnd:BuddiesParent");
- winSoloID = TheNameKeyGenerator->nameToKey("Diplomacy.wnd:SoloParent");
- winInGame = TheWindowManager->winGetWindowFromId(nullptr, winInGameID);
- winBuddies = TheWindowManager->winGetWindowFromId(nullptr, winBuddiesID);
- winSolo = TheWindowManager->winGetWindowFromId(nullptr, winSoloID);
-
- if (!TheRecorder->isMultiplayer())
- {
- GameWindow *listboxSolo = TheWindowManager->winGetWindowFromId(theWindow, NAMEKEY("Diplomacy.wnd:ListboxSolo"));
- if (listboxSolo)
- {
- for (BriefingList::iterator it = theBriefingList.begin(); it != theBriefingList.end(); ++it)
- {
- UnicodeString translated = TheGameText->fetch(*it);
- Int numEntries = GadgetListBoxGetNumEntries(listboxSolo);
- GadgetListBoxAddEntryText(listboxSolo, translated, TheInGameUI->getMessageColor(numEntries%2), -1);
- }
- }
- }
- }
- theLayout->hide(FALSE);
-
- radioButtonInGame->winHide(TRUE);
- radioButtonBuddies->winHide(TRUE);
- GadgetRadioSetSelection(radioButtonInGame, FALSE);
- if (TheRecorder->isMultiplayer())
- {
- winInGame->winHide(FALSE);
- winBuddies->winHide(TRUE);
- winSolo->winHide(TRUE);
- }
- else
- {
- winInGame->winHide(TRUE);
- winBuddies->winHide(TRUE);
- winSolo->winHide(FALSE);
- }
-
- theAnimateWindowManager->reset();
- if (!immediate && TheGlobalData->m_animateWindows)
- theAnimateWindowManager->registerGameWindow( theWindow, WIN_ANIMATION_SLIDE_TOP, TRUE, 200 );
-
- TheInGameUI->registerWindowLayout(theLayout);
- grabWindowPointers();
- PopulateInGameDiplomacyPopup();
-
- if(TheGameSpyInfo && TheGameSpyInfo->getLocalProfileID() != 0)
- {
- radioButtonInGame->winHide(FALSE);
- radioButtonBuddies->winHide(FALSE);
- InitBuddyControls(1);
- PopulateOldBuddyMessages();
- updateBuddyInfo();
- }
-
-}
-
-// ------------------------------------------------------------------------------------------------
-// ------------------------------------------------------------------------------------------------
-void ResetDiplomacy()
-{
- if(theLayout)
- {
- TheInGameUI->unregisterWindowLayout(theLayout);
- theLayout->destroyWindows();
- deleteInstance(theLayout);
- InitBuddyControls(-1);
- theLayout = nullptr;
- }
- theWindow = nullptr;
-
- delete theAnimateWindowManager;
- theAnimateWindowManager = nullptr;
-}
-
-// ------------------------------------------------------------------------------------------------
-// ------------------------------------------------------------------------------------------------
-void HideDiplomacy( Bool immediate )
-{
- releaseWindowPointers();
- if (theWindow)
- {
- if (immediate || !TheGlobalData->m_animateWindows)
- {
- theWindow->winHide(TRUE);
- theWindow->winEnable(FALSE);
- }
- else
- {
- if (theAnimateWindowManager->isFinished())
- theAnimateWindowManager->reverseAnimateWindow();
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// ------------------------------------------------------------------------------------------------
-void ToggleDiplomacy( Bool immediate )
-{
- // If we bring this up, let's hide the quit menu
- HideQuitMenu();
-
- if (theWindow)
- {
- Bool show = theWindow->winIsHidden();
- if (show)
- ShowDiplomacy( immediate );
- else
- HideDiplomacy( immediate );
- }
- else
- {
- ShowDiplomacy( immediate );
- }
-}
-
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType DiplomacyInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
-// UnsignedByte state = mData2;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
- HideDiplomacy();
- return MSG_HANDLED;
- //return MSG_IGNORED;
- }
-
- }
-
- return MSG_HANDLED;
-
- }
-
- }
-
- return MSG_IGNORED;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType DiplomacySystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- if(BuddyControlSystem(window, msg, mData1, mData2) == MSG_HANDLED)
- {
- return MSG_HANDLED;
- }
- switch( msg )
- {
- //---------------------------------------------------------------------------------------------
- case GGM_FOCUS_CHANGE:
- {
-// Bool focus = (Bool) mData1;
- //if (focus)
- //TheWindowManager->winSetGrabWindow( chatTextEntry );
- break;
- }
-
- //---------------------------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
- // if we're given the opportunity to take the keyboard focus we must say we don't want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = FALSE;
-
- return MSG_HANDLED;
- }
-
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- NameKeyType controlID = (NameKeyType)control->winGetWindowId();
- static NameKeyType buttonHideID = NAMEKEY( "Diplomacy.wnd:ButtonHide" );
- if (controlID == buttonHideID)
- {
- HideDiplomacy( FALSE );
- }
- else if( controlID == radioButtonInGameID)
- {
- winInGame->winHide(FALSE);
- winBuddies->winHide(TRUE);
- }
- else if( controlID == radioButtonBuddiesID)
- {
- winInGame->winHide(TRUE);
- winBuddies->winHide(FALSE);
- }
-
- for (Int i=0; i= 0)
- {
- TheGameInfo->getSlot(slotNumInRow[i])->mute(TRUE);
- PopulateInGameDiplomacyPopup();
- break;
- }
- if (controlID == buttonUnMuteID[i] && slotNumInRow[i] >= 0)
- {
- TheGameInfo->getSlot(slotNumInRow[i])->mute(FALSE);
- PopulateInGameDiplomacyPopup();
- break;
- }
- }
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-void PopulateInGameDiplomacyPopup()
-{
- if (!TheGameInfo)
- return;
-
- Int rowNum = 0;
- for (Int slotNum=0; slotNumgetConstSlot(slotNum);
- if (slot && slot->isOccupied())
- {
- Bool isInGame = false;
- // Note - for skirmish, TheNetwork == nullptr. jba.
- if (TheNetwork && TheNetwork->isPlayerConnected(slotNum)) {
- isInGame = true;
- } else if ((TheNetwork == nullptr) && slot->isHuman()) {
- // this is a skirmish game and it is the human player.
- isInGame = true;
- }
- if (slot->isAI())
- isInGame = true;
- AsciiString playerName;
- playerName.format("player%d", slotNum);
- Player *player = ThePlayerList->findPlayerWithNameKey(NAMEKEY(playerName));
- Bool isAlive = !TheVictoryConditions->hasSinglePlayerBeenDefeated(player);
- Bool isObserver = player->isPlayerObserver();
-
- if (slot->isHuman() && TheGameInfo->getLocalSlotNum() != slotNum && isInGame)
- {
- // show mute button
- if (buttonMute[rowNum])
- {
- buttonMute[rowNum]->winHide(slot->isMuted());
- }
- if (buttonUnMute[rowNum])
- {
- buttonUnMute[rowNum]->winHide(!slot->isMuted());
- }
- }
- else
- {
- // can't mute self, AI players, or MIA humans
- if (buttonMute[rowNum])
- buttonMute[rowNum]->winHide(TRUE);
- if (buttonUnMute[rowNum])
- buttonUnMute[rowNum]->winHide(TRUE);
- }
-
- Color playerColor = TheMultiplayerSettings->getColor(slot->getApparentColor())->getColor();
- Color backColor = GameMakeColor(0, 0, 0, 255);
- Color aliveColor = GameMakeColor(0, 255, 0, 255);
- Color deadColor = GameMakeColor(255, 0, 0, 255);
- Color observerInGameColor = GameMakeColor(255, 255, 255, 255);
- Color goneColor = GameMakeColor(196, 0, 0, 255);
- Color observerGoneColor = GameMakeColor(196, 196, 196, 255);
-
- if (staticTextPlayer[rowNum])
- {
- staticTextPlayer[rowNum]->winSetEnabledTextColors( playerColor, backColor );
- GadgetStaticTextSetText(staticTextPlayer[rowNum], slot->getName());
- }
- if (staticTextSide[rowNum])
- {
- staticTextSide[rowNum]->winSetEnabledTextColors( playerColor, backColor );
- GadgetStaticTextSetText(staticTextSide[rowNum], slot->getApparentPlayerTemplateDisplayName() );
- }
- if (staticTextTeam[rowNum])
- {
- staticTextTeam[rowNum]->winSetEnabledTextColors( playerColor, backColor );
- AsciiString teamStr;
- teamStr.format("Team:%d", slot->getTeamNumber() + 1);
- if (slot->isAI() && slot->getTeamNumber() == -1)
- teamStr = "Team:AI";
- GadgetStaticTextSetText(staticTextTeam[rowNum], TheGameText->fetch(teamStr) );
- }
- if (staticTextStatus[rowNum])
- {
- staticTextStatus[rowNum]->winHide(FALSE);
- if (isInGame)
- {
- if (isAlive)
- {
- staticTextStatus[rowNum]->winSetEnabledTextColors( aliveColor, backColor );
- GadgetStaticTextSetText(staticTextStatus[rowNum], TheGameText->fetch("GUI:PlayerAlive"));
- }
- else
- {
- if (isObserver)
- {
- staticTextStatus[rowNum]->winSetEnabledTextColors( observerInGameColor, backColor );
- GadgetStaticTextSetText(staticTextStatus[rowNum], TheGameText->fetch("GUI:PlayerObserver"));
- }
- else
- {
- staticTextStatus[rowNum]->winSetEnabledTextColors( deadColor, backColor );
- GadgetStaticTextSetText(staticTextStatus[rowNum], TheGameText->fetch("GUI:PlayerDead"));
- }
- }
- }
- else
- {
- // not in game
- if (isObserver)
- {
- staticTextStatus[rowNum]->winSetEnabledTextColors( observerGoneColor, backColor );
- GadgetStaticTextSetText(staticTextStatus[rowNum], TheGameText->fetch("GUI:PlayerObserverGone"));
- }
- else
- {
- staticTextStatus[rowNum]->winSetEnabledTextColors( goneColor, backColor );
- GadgetStaticTextSetText(staticTextStatus[rowNum], TheGameText->fetch("GUI:PlayerGone"));
- }
- }
- }
-
- slotNumInRow[rowNum++] = slotNum;
- }
- }
-
- while (rowNum < MAX_SLOTS)
- {
- slotNumInRow[rowNum] = -1;
- if (staticTextPlayer[rowNum])
- staticTextPlayer[rowNum]->winHide(TRUE);
- if (staticTextSide[rowNum])
- staticTextSide[rowNum]->winHide(TRUE);
- if (staticTextTeam[rowNum])
- staticTextTeam[rowNum]->winHide(TRUE);
- if (staticTextStatus[rowNum])
- staticTextStatus[rowNum]->winHide(TRUE);
- if (buttonMute[rowNum])
- buttonMute[rowNum]->winHide(TRUE);
- if (buttonUnMute[rowNum])
- buttonUnMute[rowNum]->winHide(TRUE);
-
- ++rowNum;
- }
-}
-
-
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp
deleted file mode 100644
index ee2000cabae..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp
+++ /dev/null
@@ -1,308 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: ExtendedMessageBox.cpp ///////////////////////////////////////////////////////////////////
-// Author: Matt Campbell, January 2003
-// Description: We go quiet in 1 day, gold in 15. Poor time to rewrite message boxes, so
-// we get this file instead. Phooey.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/GameEngine.h"
-#include "Common/NameKeyGenerator.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/Shell.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GadgetStaticText.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/ExtendedMessageBox.h"
-
-WindowMsgHandledType ExtendedMessageBoxSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 );
-
-//-------------------------------------------------------------------------------------------------
-/** Create an extended Modal Message Box */
-//-------------------------------------------------------------------------------------------------
-static GameWindow *gogoExMessageBox(Int x, Int y, Int width, Int height, UnsignedShort buttonFlags,
- UnicodeString titleString, UnicodeString bodyString, void *userData,
- MessageBoxFunc yesCallback,
- MessageBoxFunc noCallback,
- MessageBoxFunc okCallback,
- MessageBoxFunc cancelCallback )
-{
- // first check to make sure we have some buttons to display
- if(buttonFlags == 0 )
- {
- return nullptr;
- }
-
- GameWindow *parent = TheWindowManager->winCreateFromScript( "Menus/MessageBox.wnd" );
- TheWindowManager->winSetModal( parent );
- TheWindowManager->winSetFocus( nullptr ); // make sure we lose focus from other windows even if we refuse focus ourselves
- TheWindowManager->winSetFocus( parent );
-
- // If the user wants the size to be different then the default
- float ratioX, ratioY = 1;
-
- if( width > 0 && height > 0 )
- {
- ICoord2D temp;
- //First grab the percent increase/decrease compared to the default size
- parent->winGetSize( &temp.x, &temp.y);
- ratioX = (float)width / (float)temp.x;
- ratioY = (float)height / (float)temp.y;
- //Set the window's new size
- parent->winSetSize( width, height);
-
- //Resize/reposition all the children windows based off the ratio
- GameWindow *child;
- for( child = parent->winGetChild(); child; child = child->winGetNext() )
- {
- child->winGetSize(&temp.x, &temp.y);
- temp.x =Int(temp.x * ratioX);
- temp.y =Int(temp.y * ratioY);
- child->winSetSize(temp.x, temp.y);
-
- child->winGetPosition(&temp.x, &temp.y);
- temp.x =Int(temp.x * ratioX);
- temp.y =Int(temp.y * ratioY);
- child->winSetPosition(temp.x, temp.y);
- }
- }
-
- // If the user wants to position the message box somewhere other then default
- if( x >= 0 && y >= 0)
- parent->winSetPosition(x, y);
-
- // Reposition the buttons
- Int buttonX[3], buttonY[3];
-
- //In the layout, buttonOk will be in the first button position
- NameKeyType buttonOkID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonOk" );
- GameWindow *buttonOk = TheWindowManager->winGetWindowFromId(parent, buttonOkID);
- buttonOk->winGetPosition(&buttonX[0], &buttonY[0]);
-
- NameKeyType buttonYesID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonYes" );
- GameWindow *buttonYes = TheWindowManager->winGetWindowFromId(parent, buttonYesID);
- //buttonNo in the second position
- NameKeyType buttonNoID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonNo" );
- GameWindow *buttonNo = TheWindowManager->winGetWindowFromId(parent, buttonNoID);
- buttonNo->winGetPosition(&buttonX[1], &buttonY[1]);
-
- //and buttonCancel in the third
- NameKeyType buttonCancelID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonCancel" );
- GameWindow *buttonCancel = TheWindowManager->winGetWindowFromId(parent, buttonCancelID);
- buttonCancel->winGetPosition(&buttonX[2], &buttonY[2]);
-
- //we shouldn't have button OK and Yes on the same dialog
- if((buttonFlags & (MSG_BOX_OK | MSG_BOX_YES)) == (MSG_BOX_OK | MSG_BOX_YES) )
- {
- DEBUG_CRASH(("Passed in MSG_BOX_OK and MSG_BOX_YES. Big No No."));
- }
-
- //Position the OK button if we have one
- if( (buttonFlags & MSG_BOX_OK) == MSG_BOX_OK)
- {
- buttonOk->winSetPosition(buttonX[0], buttonY[0]);
- buttonOk->winHide(FALSE);
- }
- else if( (buttonFlags & MSG_BOX_YES) == MSG_BOX_YES)
- {
- //Position the Yes if we have one
- buttonYes->winSetPosition(buttonX[0], buttonY[0]);
- buttonYes->winHide(FALSE);
- }
-
- if((buttonFlags & (MSG_BOX_NO | MSG_BOX_CANCEL)) == (MSG_BOX_NO | MSG_BOX_CANCEL) )
- {
- //If we have both the No and Cancel button, then the no should go in the middle position
- buttonNo->winSetPosition(buttonX[1], buttonY[1]);
- buttonCancel->winSetPosition(buttonX[2], buttonY[2]);
- buttonNo->winHide(FALSE);
- buttonCancel->winHide(FALSE);
- }
- else if( (buttonFlags & MSG_BOX_NO) == MSG_BOX_NO)
- {
- //if we just have the no button, then position it in the right most spot
- buttonNo->winSetPosition(buttonX[2], buttonY[2]);
- buttonNo->winHide(FALSE);
- }
- else if( (buttonFlags & MSG_BOX_CANCEL) == MSG_BOX_CANCEL)
- {
- //else if we just have the Cancel button, well, it should always go in the right spot
- buttonCancel->winSetPosition(buttonX[2], buttonY[2]);
- buttonCancel->winHide(FALSE);
- }
-
- // Fill the text into the text boxes
- NameKeyType staticTextTitleID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:StaticTextTitle" );
- GameWindow *staticTextTitle = TheWindowManager->winGetWindowFromId(parent, staticTextTitleID);
- GadgetStaticTextSetText(staticTextTitle,titleString);
-
- NameKeyType staticTextMessageID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:StaticTextMessage" );
- GameWindow *staticTextMessage = TheWindowManager->winGetWindowFromId(parent, staticTextMessageID);
- GadgetStaticTextSetText(staticTextMessage,bodyString);
-
- // create a structure that will pass the functions to
- WindowExMessageBoxData *MsgBoxCallbacks = NEW WindowExMessageBoxData;
- MsgBoxCallbacks->cancelCallback = cancelCallback;
- MsgBoxCallbacks->noCallback = noCallback;
- MsgBoxCallbacks->okCallback = okCallback;
- MsgBoxCallbacks->yesCallback = yesCallback;
- MsgBoxCallbacks->userData = userData;
- //pass the structure to the dialog
- parent->winSetUserData( MsgBoxCallbacks );
-
- parent->winSetSystemFunc(ExtendedMessageBoxSystem);
-
- //make sure the dialog is showing and bring it to the top
- parent->winHide(FALSE);
- parent->winBringToTop();
-
- return parent;
-}
-
-GameWindow *ExMessageBoxYesNo (UnicodeString titleString,UnicodeString bodyString, void *userData,
- MessageBoxFunc yesCallback, MessageBoxFunc noCallback)
-{
- return gogoExMessageBox(-1,-1,-1,-1,MSG_BOX_NO | MSG_BOX_YES , titleString, bodyString, userData, yesCallback, noCallback, nullptr, nullptr);
-}
-
-GameWindow *ExMessageBoxYesNoCancel (UnicodeString titleString,UnicodeString bodyString, void *userData,
- MessageBoxFunc yesCallback, MessageBoxFunc noCallback, MessageBoxFunc cancelCallback)
-{
- return gogoExMessageBox(-1,-1,-1,-1,MSG_BOX_NO | MSG_BOX_YES | MSG_BOX_CANCEL , titleString, bodyString, userData, yesCallback, noCallback, nullptr, cancelCallback);
-}
-
-GameWindow *ExMessageBoxOkCancel (UnicodeString titleString,UnicodeString bodyString, void *userData,
- MessageBoxFunc okCallback, MessageBoxFunc cancelCallback)
-{
- return gogoExMessageBox(-1,-1,-1,-1,MSG_BOX_OK | MSG_BOX_CANCEL , titleString, bodyString, userData, nullptr, nullptr, okCallback, cancelCallback);
-}
-
-GameWindow *ExMessageBoxOk (UnicodeString titleString,UnicodeString bodyString, void *userData,
- MessageBoxFunc okCallback)
-{
- return gogoExMessageBox(-1,-1,-1,-1,MSG_BOX_OK, titleString, bodyString, userData, nullptr, nullptr, okCallback, nullptr);
-}
-
-GameWindow *ExMessageBoxCancel (UnicodeString titleString,UnicodeString bodyString, void *userData,
- MessageBoxFunc cancelCallback)
-{
- return gogoExMessageBox(-1,-1,-1,-1, MSG_BOX_CANCEL, titleString, bodyString, userData, nullptr, nullptr, nullptr, cancelCallback);
-}
-
-
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
-
-
-
-//-------------------------------------------------------------------------------------------------
-/** Message Box window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType ExtendedMessageBoxSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
-
- switch( msg )
- {
-
- //---------------------------------------------------------------------------------------------
- case GWM_DESTROY:
- {
- delete (WindowExMessageBoxData *)window->winGetUserData();
- window->winSetUserData( nullptr );
- break;
-
- }
-
- // --------------------------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
- static NameKeyType buttonOkID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonOk" );
- static NameKeyType buttonYesID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonYes" );
- static NameKeyType buttonNoID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonNo" );
- static NameKeyType buttonCancelID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonCancel" );
- WindowExMessageBoxData *MsgBoxCallbacks = (WindowExMessageBoxData *)window->winGetUserData();
-
- MessageBoxReturnType ret = MB_RETURN_CLOSE;
-
- if( controlID == buttonOkID )
- {
- if (MsgBoxCallbacks->okCallback)
- ret = MsgBoxCallbacks->okCallback(MsgBoxCallbacks->userData);
- }
- else if( controlID == buttonYesID )
- {
- if (MsgBoxCallbacks->yesCallback)
- ret = MsgBoxCallbacks->yesCallback(MsgBoxCallbacks->userData);
- }
- else if( controlID == buttonNoID )
- {
- if (MsgBoxCallbacks->noCallback)
- ret = MsgBoxCallbacks->noCallback(MsgBoxCallbacks->userData);
- }
- else if( controlID == buttonCancelID )
- {
- if (MsgBoxCallbacks->cancelCallback)
- ret = MsgBoxCallbacks->cancelCallback(MsgBoxCallbacks->userData);
- }
-
- if (ret == MB_RETURN_CLOSE)
- TheWindowManager->winDestroy(window);
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGameChat.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGameChat.cpp
deleted file mode 100644
index 0080b64a8dd..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGameChat.cpp
+++ /dev/null
@@ -1,361 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: InGameChat.cpp ///////////////////////////////////////////////////////////////////////
-// Author: Matthew D. Campbell - June 2002
-// Desc: GUI callbacks for the in-game chat entry
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/Player.h"
-#include "Common/PlayerList.h"
-#include "GameClient/DisconnectMenu.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GadgetTextEntry.h"
-#include "GameClient/GadgetStaticText.h"
-#include "GameClient/GameClient.h"
-#include "GameClient/GameText.h"
-#include "GameClient/GUICallbacks.h"
-#include "GameClient/InGameUI.h"
-#include "GameClient/LanguageFilter.h"
-#include "GameLogic/GameLogic.h"
-#include "GameNetwork/GameInfo.h"
-#include "GameNetwork/NetworkInterface.h"
-
-static GameWindow *chatWindow = nullptr;
-static GameWindow *chatTextEntry = nullptr;
-static GameWindow *chatTypeStaticText = nullptr;
-static UnicodeString s_savedChat;
-static InGameChatType inGameChatType;
-
-// ------------------------------------------------------------------------------------------------
-// ------------------------------------------------------------------------------------------------
-void ShowInGameChat( Bool immediate )
-{
- if (TheGameLogic->isInReplayGame())
- return;
-
- if (TheInGameUI->isQuitMenuVisible())
- return;
-
- if (TheDisconnectMenu && TheDisconnectMenu->isScreenVisible())
- return;
-
- if (chatWindow)
- {
- chatWindow->winHide(FALSE);
- chatWindow->winEnable(TRUE);
- chatTextEntry->winHide(FALSE);
- chatTextEntry->winEnable(TRUE);
- GadgetTextEntrySetText( chatTextEntry, s_savedChat );
- s_savedChat.clear();
- }
- else
- {
- chatWindow = TheWindowManager->winCreateFromScript( "InGameChat.wnd" );
-
- static NameKeyType textEntryChatID = TheNameKeyGenerator->nameToKey( "InGameChat.wnd:TextEntryChat" );
- chatTextEntry = TheWindowManager->winGetWindowFromId( nullptr, textEntryChatID );
- GadgetTextEntrySetText( chatTextEntry, UnicodeString::TheEmptyString );
-
- static NameKeyType chatTypeStaticTextID = TheNameKeyGenerator->nameToKey( "InGameChat.wnd:StaticTextChatType" );
- chatTypeStaticText = TheWindowManager->winGetWindowFromId( nullptr, chatTypeStaticTextID );
- }
- TheWindowManager->winSetFocus( chatTextEntry );
- SetInGameChatType( INGAME_CHAT_EVERYONE );
-}
-
-// ------------------------------------------------------------------------------------------------
-// ------------------------------------------------------------------------------------------------
-void ResetInGameChat()
-{
- if(chatWindow)
- TheWindowManager->winDestroy( chatWindow );
- chatWindow = nullptr;
- chatTextEntry = nullptr;
- chatTypeStaticText = nullptr;
- s_savedChat.clear();
-}
-
-// ------------------------------------------------------------------------------------------------
-// ------------------------------------------------------------------------------------------------
-void HideInGameChat( Bool immediate )
-{
- if (chatWindow)
- {
- s_savedChat = GadgetTextEntryGetText( chatTextEntry );
- chatWindow->winHide(TRUE);
- chatWindow->winEnable(FALSE);
- chatTextEntry->winHide(TRUE);
- chatTextEntry->winEnable(FALSE);
- TheWindowManager->winSetFocus( nullptr );
- }
- TheWindowManager->winSetFocus( nullptr );
-}
-
-// ------------------------------------------------------------------------------------------------
-// ------------------------------------------------------------------------------------------------
-void SetInGameChatType( InGameChatType chatType )
-{
- inGameChatType = chatType;
- if (chatTypeStaticText)
- {
- switch (inGameChatType)
- {
- case INGAME_CHAT_EVERYONE:
- if (ThePlayerList->getLocalPlayer()->isPlayerActive())
- GadgetStaticTextSetText( chatTypeStaticText, TheGameText->fetch("Chat:Everyone") );
- else
- GadgetStaticTextSetText( chatTypeStaticText, TheGameText->fetch("Chat:Observers") );
- break;
- case INGAME_CHAT_ALLIES:
- GadgetStaticTextSetText( chatTypeStaticText, TheGameText->fetch("Chat:Allies") );
- break;
- case INGAME_CHAT_PLAYERS:
- GadgetStaticTextSetText( chatTypeStaticText, TheGameText->fetch("Chat:Players") );
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// ------------------------------------------------------------------------------------------------
-Bool IsInGameChatActive() {
- if (chatWindow != nullptr) {
- if (chatWindow->winIsHidden() == FALSE) {
- return TRUE;
- }
- }
- return FALSE;
-}
-
-// Slash commands -------------------------------------------------------------------------
-extern "C" {
-int getQR2HostingStatus();
-}
-extern int isThreadHosting;
-
-Bool handleInGameSlashCommands(UnicodeString uText)
-{
- AsciiString message;
- message.translate(uText);
-
- if (message.getCharAt(0) != '/')
- {
- return FALSE; // not a slash command
- }
-
- AsciiString remainder = message.str() + 1;
- AsciiString token;
- remainder.nextToken(&token);
- token.toLower();
-
- if (token == "host")
- {
- UnicodeString s;
- s.format(L"Hosting qr2:%d thread:%d", getQR2HostingStatus(), isThreadHosting);
- TheInGameUI->message(s);
- return TRUE; // was a slash command
- }
-
- return FALSE; // not a slash command
-}
-
-// ------------------------------------------------------------------------------------------------
-// ------------------------------------------------------------------------------------------------
-void ToggleInGameChat( Bool immediate )
-{
- static Bool justHid = false;
- if (justHid)
- {
- justHid = false;
- return;
- }
-
- if (TheGameLogic->isInReplayGame())
- return;
-
- if (!TheGameInfo->isMultiPlayer() && TheGlobalData->m_netMinPlayers)
- return;
-
- if (chatWindow)
- {
- Bool show = chatWindow->winIsHidden();
- if (show)
- ShowInGameChat( immediate );
- else
- {
- if (chatTextEntry)
- {
- // Send what is there, clear it out, and hide the window
- UnicodeString msg = GadgetTextEntryGetText( chatTextEntry );
- msg.trim();
- if (!msg.isEmpty() && !handleInGameSlashCommands(msg))
- {
- const Player *localPlayer = ThePlayerList->getLocalPlayer();
- AsciiString playerName;
- Int playerMask = 0;
-
- for (Int i=0; ifindPlayerWithNameKey( TheNameKeyGenerator->nameToKey( playerName ) );
- if (player && localPlayer)
- {
- switch (inGameChatType)
- {
- case INGAME_CHAT_EVERYONE:
- if (!TheGameInfo->getConstSlot(i)->isMuted())
- playerMask |= (1<getRelationship(localPlayer->getDefaultTeam()) == ALLIES &&
- localPlayer->getRelationship(player->getDefaultTeam()) == ALLIES) || player==localPlayer )
- playerMask |= (1<filterLine(msg);
- TheNetwork->sendChat(msg, playerMask);
- }
- GadgetTextEntrySetText( chatTextEntry, UnicodeString::TheEmptyString );
- HideInGameChat( immediate );
- justHid = true;
- }
- }
- }
- else
- {
- ShowInGameChat( immediate );
- }
-}
-
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType InGameChatInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
-// UnsignedByte state = mData2;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
- HideInGameChat();
- return MSG_HANDLED;
- //return MSG_IGNORED;
- }
-
- }
-
- return MSG_HANDLED;
-
- }
-
- }
-
- return MSG_IGNORED;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType InGameChatSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
- //---------------------------------------------------------------------------------------------
- case GGM_FOCUS_CHANGE:
- {
-// Bool focus = (Bool) mData1;
- //if (focus)
- //TheWindowManager->winSetGrabWindow( chatTextEntry );
- break;
- }
-
- //---------------------------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- return MSG_HANDLED;
- }
-
- //---------------------------------------------------------------------------------------------
- case GEM_EDIT_DONE:
- {
- ToggleInGameChat();
- //HideInGameChat();
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- static NameKeyType buttonClearID = TheNameKeyGenerator->nameToKey( "InGameChat.wnd:ButtonClear" );
- if (control && control->winGetWindowId() == buttonClearID)
- {
- if (chatTextEntry)
- GadgetTextEntrySetText( chatTextEntry, UnicodeString::TheEmptyString );
- s_savedChat.clear();
- }
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp
deleted file mode 100644
index e2013ac2748..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp
+++ /dev/null
@@ -1,250 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: InGamePopupMessage.cpp /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Jul 2002
-//
-// Filename: InGamePopupMessage.cpp
-//
-// author: Chris Huybregts
-//
-// purpose: Init, input, and system for the in game message popup
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/GlobalData.h"
-#include "Common/NameKeyGenerator.h"
-#include "Common/version.h"
-#include "Common/MessageStream.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GadgetStaticText.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/InGameUI.h"
-#include "GameClient/DisplayStringManager.h"
-
-//-----------------------------------------------------------------------------
-// DEFINES ////////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-static NameKeyType parentID = NAMEKEY_INVALID;
-static NameKeyType staticTextMessageID = NAMEKEY_INVALID;
-static NameKeyType buttonOkID = NAMEKEY_INVALID;
-
-
-static GameWindow *parent = nullptr;
-static GameWindow *staticTextMessage = nullptr;
-static GameWindow *buttonOk = nullptr;
-
-
-static Bool pause = FALSE;
-//-----------------------------------------------------------------------------
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the InGamePopupMessageInit menu */
-//-------------------------------------------------------------------------------------------------
-void InGamePopupMessageInit( WindowLayout *layout, void *userData )
-{
-
- parentID = TheNameKeyGenerator->nameToKey("InGamePopupMessage.wnd:InGamePopupMessageParent");
- parent = TheWindowManager->winGetWindowFromId(nullptr, parentID);
-
- staticTextMessageID = TheNameKeyGenerator->nameToKey("InGamePopupMessage.wnd:StaticTextMessage");
- staticTextMessage = TheWindowManager->winGetWindowFromId(parent, staticTextMessageID);
- buttonOkID = TheNameKeyGenerator->nameToKey("InGamePopupMessage.wnd:ButtonOk");
- buttonOk = TheWindowManager->winGetWindowFromId(parent, buttonOkID);
-
- PopupMessageData *pMData = TheInGameUI->getPopupMessageData();
-
- if(!pMData)
- {
- DEBUG_ASSERTCRASH(pMData, ("We're in InGamePopupMessage without a pointer to pMData") );
- ///< @todo: add a call to the close this bitch method when I implement it CLH
- return;
- }
-
- DisplayString *tempString = TheDisplayStringManager->newDisplayString();
- tempString->setText(pMData->message);
- tempString->setFont(staticTextMessage->winGetFont());
- tempString->setWordWrap(pMData->width - 14);
- Int width, height;
- tempString->getSize(&width, &height);
- TheDisplayStringManager->freeDisplayString(tempString);
-
- GadgetStaticTextSetText(staticTextMessage, pMData->message);
- // set the positions/sizes
- Int widthOk, heightOk;
- buttonOk->winGetSize(&widthOk, &heightOk);
- parent->winSetPosition( pMData->x, pMData->y);
- parent->winSetSize( pMData->width, height + 7 + 2 + 2 + heightOk + 2 );
- staticTextMessage->winSetPosition( 2, 2);
- staticTextMessage->winSetSize( pMData->width - 4, height + 7);
- buttonOk->winSetPosition(pMData->width - widthOk - 2, height + 7 + 2 + 2);
- staticTextMessage->winSetEnabledTextColors(pMData->textColor, 0);
- pause = pMData->pause;
- if(pMData->pause)
- TheWindowManager->winSetModal( parent );
-
- TheWindowManager->winSetFocus( parent );
-
- parent->winHide(FALSE);
- parent->winBringToTop();
-}
-
-//-------------------------------------------------------------------------------------------------
-/** InGamePopupMessageInput callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType InGamePopupMessageInput( GameWindow *window, UnsignedInt msg, WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
- // if (buttonPushed)
- // break;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ENTER:
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)buttonOk, buttonOkID );
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
- return MSG_IGNORED;
-
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** InGamePopupMessageSystem callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType InGamePopupMessageSystem( GameWindow *window, UnsignedInt msg, WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CREATE:
- {
-
- break;
-
- }
- //---------------------------------------------------------------------------------------------
- case GWM_DESTROY:
- {
-
- break;
-
- }
-
- //----------------------------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- break;
-
- }
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if( controlID == buttonOkID )
- {
- if(!pause)
- TheMessageStream->appendMessage( GameMessage::MSG_CLEAR_INGAME_POPUP_MESSAGE );
- else
- TheInGameUI->clearPopupMessageData();
- }
- break;
- }
- default:
- return MSG_IGNORED;
-
- }
-
-
- return MSG_HANDLED;
-
-}
-
-//-----------------------------------------------------------------------------
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp
deleted file mode 100644
index 6f2c4de1e08..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp
+++ /dev/null
@@ -1,251 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: CreditsMenu.cpp /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Dec 2002
-//
-// Filename: CreditsMenu.cpp
-//
-// author: Chris Huybregts
-//
-// purpose: The credits screen...yay
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "Common/GameAudio.h"
-#include "Common/AudioEventRTS.h"
-#include "Common/AudioHandleSpecialValues.h"
-
-#include "GameClient/Credits.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/Shell.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GameWindowManager.h"
-
-//-----------------------------------------------------------------------------
-// DEFINES ////////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-static NameKeyType parentMainMenuID = NAMEKEY_INVALID;
-
-// window pointers --------------------------------------------------------------------------------
-static GameWindow *parentMainMenu = nullptr;
-
-//-----------------------------------------------------------------------------
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-/** Initialize the single player menu */
-//-------------------------------------------------------------------------------------------------
-void CreditsMenuInit( WindowLayout *layout, void *userData )
-{
- TheShell->showShellMap(FALSE);
-
- delete TheCredits;
- TheCredits = new CreditsManager;
- TheCredits->load();
- TheCredits->init();
-
- parentMainMenuID = TheNameKeyGenerator->nameToKey( "CreditsMenu.wnd:ParentCreditsWindow" );
- parentMainMenu = TheWindowManager->winGetWindowFromId( nullptr, parentMainMenuID );
-
-
- // show menu
- layout->hide( FALSE );
-
- // set keyboard focus to main parent
- TheWindowManager->winSetFocus( parentMainMenu );
-
-
-
- TheAudio->removeAudioEvent( AHSV_StopTheMusicFade );
- AudioEventRTS event( "Credits" );
- event.setShouldFade( TRUE );
- TheAudio->addAudioEvent( &event );
-
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** single player menu shutdown method */
-//-------------------------------------------------------------------------------------------------
-void CreditsMenuShutdown( WindowLayout *layout, void *userData )
-{
- TheCredits->reset();
- delete TheCredits;
- TheCredits = nullptr;
- TheShell->showShellMap(TRUE);
-
- // hide menu
- layout->hide( TRUE );
-
- // our shutdown is complete
- TheShell->shutdownComplete( layout );
-
- TheAudio->removeAudioEvent( AHSV_StopTheMusicFade );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** single player menu update method */
-//-------------------------------------------------------------------------------------------------
-void CreditsMenuUpdate( WindowLayout *layout, void *userData )
-{
-
- if(TheCredits)
- {
- TheWindowManager->winSetFocus( parentMainMenu );
- TheCredits->update();
- if(TheCredits->isFinished())
- TheShell->pop();
- }
- else
- TheShell->pop();
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Replay menu input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType CreditsMenuInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
-
- TheShell->pop();
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** single player menu window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType CreditsMenuSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CREATE:
- {
-
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GWM_DESTROY:
- {
-
- break;
-
- }
-
- // --------------------------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- return MSG_HANDLED;
-
- }
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
-
- break;
- }
-
- default:
- return MSG_IGNORED;
- }
-
- return MSG_HANDLED;
-}
-
-//-----------------------------------------------------------------------------
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp
deleted file mode 100644
index 017da844eec..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp
+++ /dev/null
@@ -1,309 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: DifficultySelect.cpp /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Nov 2002
-//
-// Filename: DifficultySelect.cpp
-//
-// author: Chris Huybregts
-//
-// purpose: The popup campaign difficulty select
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "Common/OptionPreferences.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/Shell.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetPushButton.h"
-#include "GameClient/GadgetRadioButton.h"
-#include "GameClient/CampaignManager.h"
-
-#include "GameLogic/ScriptEngine.h"
-
-//-----------------------------------------------------------------------------
-// DEFINES ////////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-static GameDifficulty s_AIDiff = DIFFICULTY_NORMAL;
-static NameKeyType buttonOkID = NAMEKEY_INVALID;
-static GameWindow * buttonOk = nullptr;
-static NameKeyType buttonCancelID = NAMEKEY_INVALID;
-static GameWindow * buttonCancel = nullptr;
-static NameKeyType radioButtonEasyAIID = NAMEKEY_INVALID;
-static NameKeyType radioButtonMediumAIID = NAMEKEY_INVALID;
-static NameKeyType radioButtonHardAIID = NAMEKEY_INVALID;
-static GameWindow * radioButtonEasyAI = nullptr;
-static GameWindow * radioButtonMediumAI = nullptr;
-static GameWindow * radioButtonHardAI = nullptr;
-
-void setupGameStart(AsciiString mapName, GameDifficulty diff);
-//-----------------------------------------------------------------------------
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-static void SetDifficultyRadioButton()
-{
- OptionPreferences pref;
- if (!TheScriptEngine)
- {
- s_AIDiff = DIFFICULTY_NORMAL;
- }
- else
- {
- switch (pref.getCampaignDifficulty())
- {
- case DIFFICULTY_EASY:
- {
- GadgetRadioSetSelection(radioButtonEasyAI, FALSE);
- s_AIDiff = DIFFICULTY_EASY;
- break;
- }
- case DIFFICULTY_NORMAL:
- {
- GadgetRadioSetSelection(radioButtonMediumAI, FALSE);
- s_AIDiff = DIFFICULTY_NORMAL;
- break;
- }
- case DIFFICULTY_HARD:
- {
- GadgetRadioSetSelection(radioButtonHardAI, FALSE);
- s_AIDiff = DIFFICULTY_HARD;
- break;
- }
-
- default:
- {
- DEBUG_CRASH(("unrecognized difficulty level in the script engine"));
- }
-
- }
- }
-
-}
-
-
-void DifficultySelectInit( WindowLayout *layout, void *userData )
-{
- NameKeyType parentID = TheNameKeyGenerator->nameToKey( "DifficultySelect.wnd:DifficultySelectParent" );
- GameWindow *parent = TheWindowManager->winGetWindowFromId( nullptr, parentID );
-
- buttonOkID = TheNameKeyGenerator->nameToKey( "DifficultySelect.wnd:ButtonOk" );
- buttonOk = TheWindowManager->winGetWindowFromId( parent, buttonOkID );
- buttonCancelID = TheNameKeyGenerator->nameToKey( "DifficultySelect.wnd:ButtonCancel" );
- buttonCancel = TheWindowManager->winGetWindowFromId( parent, buttonCancelID );
- radioButtonEasyAIID = TheNameKeyGenerator->nameToKey( "DifficultySelect.wnd:RadioButtonEasy" );
- radioButtonEasyAI = TheWindowManager->winGetWindowFromId( parent, radioButtonEasyAIID );
- radioButtonMediumAIID = TheNameKeyGenerator->nameToKey( "DifficultySelect.wnd:RadioButtonMedium" );
- radioButtonMediumAI = TheWindowManager->winGetWindowFromId( parent, radioButtonMediumAIID );
- radioButtonHardAIID = TheNameKeyGenerator->nameToKey( "DifficultySelect.wnd:RadioButtonHard" );
- radioButtonHardAI = TheWindowManager->winGetWindowFromId( parent, radioButtonHardAIID );
-
- s_AIDiff = DIFFICULTY_NORMAL;
- SetDifficultyRadioButton();
- // set keyboard focus to main parent
-// AsciiString parentName( "SkirmishMapSelectMenu.wnd:SkrimishMapSelectMenuParent" );
-// NameKeyType parentID = TheNameKeyGenerator->nameToKey( parentName );
-// parent = TheWindowManager->winGetWindowFromId( nullptr, parentID );
-//
-// TheWindowManager->winSetFocus( parent );
-//
- parent->winBringToTop();
- TheWindowManager->winSetModal(parent);
-
-}
-
-
-//-------------------------------------------------------------------------------------------------
-/** Map select menu input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType DifficultySelectInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
-// switch( msg )
-// {
-//
-// // --------------------------------------------------------------------------------------------
-// case GWM_CHAR:
-// {
-// UnsignedByte key = mData1;
-// UnsignedByte state = mData2;
-//
-// switch( key )
-// {
-//
-// // ----------------------------------------------------------------------------------------
-// case KEY_ESC:
-// {
-//
-// //
-// // send a simulated selected event to the parent window of the
-// // back/exit button
-// //
-// if( BitIsSet( state, KEY_STATE_UP ) )
-// {
-// AsciiString buttonName( "SkirmishMapSelectMenu.wnd:ButtonBack" );
-// NameKeyType buttonID = TheNameKeyGenerator->nameToKey( buttonName );
-// GameWindow *button = TheWindowManager->winGetWindowFromId( window, buttonID );
-//
-// TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
-// (WindowMsgData)button, buttonID );
-//
-// } // end if
-//
-// // don't let key fall through anywhere else
-// return MSG_HANDLED;
-//
-// } // end escape
-//
-// } // end switch( key )
-//
-// } // end char
-//
-// } // end switch( msg )
-
- return MSG_IGNORED;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** MapSelect menu window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType DifficultySelectSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CREATE:
- {
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GWM_DESTROY:
- {
- break;
-
- }
-
- // --------------------------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- return MSG_HANDLED;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- // this isn't fixed yet
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if ( controlID == buttonOkID )
- {
- OptionPreferences pref;
- pref.setCampaignDifficulty(s_AIDiff);
- pref.write();
- //TheScriptEngine->setGlobalDifficulty(s_AIDiff); // CANNOT DO THIS! REPLAYS WILL BREAK!
- WindowLayout *layout = window->winGetLayout();
- if (layout)
- {
- layout->destroyWindows();
- deleteInstance(layout);
- }
-
- setupGameStart(TheCampaignManager->getCurrentMap(), s_AIDiff);
- // start the game
- }
- else if ( controlID == buttonCancelID )
- {
- TheCampaignManager->setCampaign( AsciiString::TheEmptyString );
- TheWindowManager->winUnsetModal(window);
- WindowLayout *layout = window->winGetLayout();
- if (layout)
- {
- layout->destroyWindows();
- deleteInstance(layout);
- }
-
- }
- else if ( controlID == radioButtonEasyAIID )
- {
- s_AIDiff = DIFFICULTY_EASY;
- }
- else if ( controlID == radioButtonMediumAIID )
- {
- s_AIDiff = DIFFICULTY_NORMAL;
- }
- else if ( controlID == radioButtonHardAIID )
- {
- s_AIDiff = DIFFICULTY_HARD;
- }
-
- break;
-
- }
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-//-----------------------------------------------------------------------------
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp
deleted file mode 100644
index 497bcd95ede..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp
+++ /dev/null
@@ -1,434 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: DownloadMenu.cpp /////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: DownloadMenu.cpp
-//
-// Created: Matthew D. Campbell, July 2002
-//
-// Desc: the Patch Download window control
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/GameEngine.h"
-#include "Common/NameKeyGenerator.h"
-#include "GameClient/GUICallbacks.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetStaticText.h"
-#include "GameClient/GadgetProgressBar.h"
-#include "GameClient/GameText.h"
-#include "GameClient/MessageBox.h"
-
-#include "GameLogic/GameLogic.h"
-
-#include "GameNetwork/DownloadManager.h"
-#include "GameNetwork/GameSpy/MainMenuUtils.h"
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
-static NameKeyType buttonCancelID = NAMEKEY_INVALID;
-static NameKeyType staticTextSizeID = NAMEKEY_INVALID;
-static NameKeyType staticTextTimeID = NAMEKEY_INVALID;
-static NameKeyType staticTextFileID = NAMEKEY_INVALID;
-static NameKeyType staticTextStatusID = NAMEKEY_INVALID;
-static NameKeyType progressBarMunkeeID = NAMEKEY_INVALID;
-
-static GameWindow * staticTextSize = nullptr;
-static GameWindow * staticTextTime = nullptr;
-static GameWindow * staticTextFile = nullptr;
-static GameWindow * staticTextStatus = nullptr;
-static GameWindow * progressBarMunkee = nullptr;
-
-static GameWindow *parent = nullptr;
-
-static void closeDownloadWindow()
-{
- DEBUG_ASSERTCRASH(parent, ("No Parent"));
- if (!parent)
- return;
-
- WindowLayout *menuLayout = parent->winGetLayout();
- if (menuLayout)
- {
- menuLayout->runShutdown();
- menuLayout->destroyWindows();
- deleteInstance(menuLayout);
- menuLayout = nullptr;
- }
-
- GameWindow *mainWin = TheWindowManager->winGetWindowFromId( nullptr, NAMEKEY("MainMenu.wnd:MainMenuParent") );
- if (mainWin)
- TheWindowManager->winSetFocus( mainWin );
-}
-
-static void errorCallback()
-{
- HandleCanceledDownload();
- closeDownloadWindow();
-}
-
-static void successQuitCallback()
-{
- TheGameEngine->setQuitting( TRUE );
- closeDownloadWindow();
-
- // Clean up game data. No crashy-crash for you!
- if (TheGameLogic->isInGame())
- TheGameLogic->exitGame();
-}
-
-static void successNoQuitCallback()
-{
- HandleCanceledDownload();
- closeDownloadWindow();
-}
-
-class DownloadManagerMunkee : public DownloadManager
-{
-public:
- DownloadManagerMunkee() {m_shouldQuitOnSuccess = true; m_shouldQuitOnSuccess = false;}
- virtual HRESULT OnError( Int error ) override;
- virtual HRESULT OnEnd() override;
- virtual HRESULT OnProgressUpdate( Int bytesread, Int totalsize, Int timetaken, Int timeleft ) override;
- virtual HRESULT OnStatusUpdate( Int status ) override;
- virtual HRESULT downloadFile( AsciiString server, AsciiString username, AsciiString password, AsciiString file, AsciiString localfile, AsciiString regkey, Bool tryResume ) override;
-
-private:
- Bool m_shouldQuitOnSuccess;
-};
-
-HRESULT DownloadManagerMunkee::downloadFile( AsciiString server, AsciiString username, AsciiString password, AsciiString file, AsciiString localfile, AsciiString regkey, Bool tryResume )
-{
- // see if we'll need to restart
- if (strstr(localfile.str(), "patches\\") != nullptr)
- {
- m_shouldQuitOnSuccess = true;
- }
-
- if (staticTextFile)
- {
- AsciiString bob = file;
-
- // just get the filename, not the pathname
- const char *tmp = bob.reverseFind('/');
- if (tmp)
- bob = tmp+1;
- tmp = bob.reverseFind('\\');
- if (tmp)
- bob = tmp+1;
-
- UnicodeString fileString;
- fileString.translate(bob);
- GadgetStaticTextSetText(staticTextFile, fileString);
- }
-
- password.format("-%s", password.str());
- return DownloadManager::downloadFile( server, username, password, file, localfile, regkey, tryResume );
-}
-HRESULT DownloadManagerMunkee::OnError( Int error )
-{
- HRESULT ret = DownloadManager::OnError( error );
-
- MessageBoxOk(TheGameText->fetch("GUI:DownloadErrorTitle"), getErrorString(), errorCallback);
- return ret;
-}
-HRESULT DownloadManagerMunkee::OnEnd()
-{
- HRESULT ret = DownloadManager::OnEnd();
-
- if (isFileQueuedForDownload())
- {
- return downloadNextQueuedFile();
- }
- if (m_shouldQuitOnSuccess)
- MessageBoxOk(TheGameText->fetch("GUI:DownloadSuccessTitle"), TheGameText->fetch("GUI:DownloadSuccessMustQuit"), successQuitCallback);
- else
- MessageBoxOk(TheGameText->fetch("GUI:DownloadSuccessTitle"), TheGameText->fetch("GUI:DownloadSuccess"), successNoQuitCallback);
- return ret;
-}
-
-static time_t lastUpdate = 0;
-static Int timeLeft = 0;
-HRESULT DownloadManagerMunkee::OnProgressUpdate( Int bytesread, Int totalsize, Int timetaken, Int timeleft )
-{
- HRESULT ret = DownloadManager::OnProgressUpdate( bytesread, totalsize, timetaken, timeleft );
-
- if (progressBarMunkee)
- {
- Int percent = bytesread * 100 / totalsize;
- GadgetProgressBarSetProgress( progressBarMunkee, percent );
- }
-
- if (staticTextSize)
- {
- UnicodeString sizeString;
- sizeString.format(TheGameText->fetch("GUI:DownloadBytesRatio"), bytesread, totalsize);
- GadgetStaticTextSetText(staticTextSize, sizeString);
- }
- timeLeft = timeleft;
- if (staticTextTime && GadgetStaticTextGetText(staticTextTime).isEmpty()) // only update immediately the first time
- {
- lastUpdate = time(nullptr);
- UnicodeString timeString;
- if (timeleft)
- {
- DEBUG_ASSERTCRASH(timeleft > 0, ("Time left is negative!"));
- timeleft = max(1, timeleft);
- Int takenHour, takenMin, takenSec;
- takenHour = timeleft / 60 / 60;
- takenMin = timeleft / 60;
- takenSec = timeleft % 60;
- timeString.format(TheGameText->fetch("GUI:DownloadTimeLeft"), takenHour, takenMin, takenSec);
- }
- else
- {
- timeString = TheGameText->fetch("GUI:DownloadUnknownTime");
- }
- GadgetStaticTextSetText(staticTextTime, timeString);
- }
- return ret;
-}
-
-HRESULT DownloadManagerMunkee::OnStatusUpdate( Int status )
-{
- HRESULT ret = DownloadManager::OnStatusUpdate( status );
-
- if (staticTextStatus)
- {
- GadgetStaticTextSetText(staticTextStatus, getStatusString());
- }
- return ret;
-}
-
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////////////////////////
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the menu */
-//-------------------------------------------------------------------------------------------------
-void DownloadMenuInit( WindowLayout *layout, void *userData )
-{
-
- //set keyboard focus to main parent and set modal
- NameKeyType parentID = TheNameKeyGenerator->nameToKey("DownloadMenu.wnd:ParentDownload");
- parent = TheWindowManager->winGetWindowFromId( nullptr, parentID );
-
- // get ids for our children controls
- buttonCancelID = TheNameKeyGenerator->nameToKey( "DownloadMenu.wnd:ButtonCancel" );
- staticTextSizeID = TheNameKeyGenerator->nameToKey( "DownloadMenu.wnd:StaticTextSize" );
- staticTextTimeID = TheNameKeyGenerator->nameToKey( "DownloadMenu.wnd:StaticTextTime" );
- staticTextFileID = TheNameKeyGenerator->nameToKey( "DownloadMenu.wnd:StaticTextFile" );
- staticTextStatusID = TheNameKeyGenerator->nameToKey( "DownloadMenu.wnd:StaticTextStatus" );
- progressBarMunkeeID = TheNameKeyGenerator->nameToKey( "DownloadMenu.wnd:ProgressBarMunkee" );
-
- staticTextSize = TheWindowManager->winGetWindowFromId( parent, staticTextSizeID );
- staticTextTime = TheWindowManager->winGetWindowFromId( parent, staticTextTimeID );
- staticTextFile = TheWindowManager->winGetWindowFromId( parent, staticTextFileID );
- staticTextStatus = TheWindowManager->winGetWindowFromId( parent, staticTextStatusID );
- progressBarMunkee = TheWindowManager->winGetWindowFromId( parent, progressBarMunkeeID );
-
- DEBUG_ASSERTCRASH(!TheDownloadManager, ("Download manager already exists"));
-
- delete TheDownloadManager;
- TheDownloadManager = NEW DownloadManagerMunkee;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** menu shutdown method */
-//-------------------------------------------------------------------------------------------------
-void DownloadMenuShutdown( WindowLayout *layout, void *userData )
-{
- DEBUG_ASSERTCRASH(TheDownloadManager, ("No download manager"));
-
- delete TheDownloadManager;
- TheDownloadManager = nullptr;
-
- staticTextSize = nullptr;
- staticTextTime = nullptr;
- staticTextFile = nullptr;
- staticTextStatus = nullptr;
- progressBarMunkee = nullptr;
- parent = nullptr;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** menu update method */
-//-------------------------------------------------------------------------------------------------
-void DownloadMenuUpdate( WindowLayout *layout, void *userData )
-{
- if (staticTextTime && !GadgetStaticTextGetText(staticTextTime).isEmpty())
- {
- time_t now = time(nullptr);
- if (now <= lastUpdate)
- return;
-
- lastUpdate = now;
-
- UnicodeString timeString;
- if (timeLeft)
- {
- DEBUG_ASSERTCRASH(timeLeft > 0, ("Time left is negative!"));
- timeLeft = max(1, timeLeft);
- Int takenHour, takenMin, takenSec;
- takenHour = timeLeft / 60 / 60;
- takenMin = timeLeft / 60;
- takenSec = timeLeft % 60;
- timeString.format(TheGameText->fetch("GUI:DownloadTimeLeft"), takenHour, takenMin, takenSec);
- }
- else
- {
- timeString = TheGameText->fetch("GUI:DownloadUnknownTime");
- }
- GadgetStaticTextSetText(staticTextTime, timeString);
- }
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** menu input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType DownloadMenuInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
- NameKeyType buttonID = TheNameKeyGenerator->nameToKey( "DownloadMenu.wnd:ButtonCancel" );
- GameWindow *button = TheWindowManager->winGetWindowFromId( window, buttonID );
-
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)button, buttonID );
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** menu window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType DownloadMenuSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CREATE:
- {
-
- break;
-
- }
- //---------------------------------------------------------------------------------------------
- case GWM_DESTROY:
- {
-
- break;
-
- }
-
- //----------------------------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- break;
-
- }
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if( controlID == buttonCancelID )
- {
- HandleCanceledDownload();
- closeDownloadWindow();
- }
-
- break;
-
- }
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/EstablishConnectionsWindow.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/EstablishConnectionsWindow.cpp
deleted file mode 100644
index 0f18591b0d6..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/EstablishConnectionsWindow.cpp
+++ /dev/null
@@ -1,194 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-///// EstablishConnectionsWindow.cpp /////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-
-#include "GameClient/GameWindowManager.h"
-#include "Common/NameKeyGenerator.h"
-#include "GameClient/EstablishConnectionsMenu.h"
-#include "GameNetwork/GUIUtil.h"
-#include "GameNetwork/GameSpy/StagingRoomGameInfo.h"
-
-static WindowLayout *establishConnectionsLayout;
-
-static NameKeyType buttonQuitID = NAMEKEY_INVALID;
-static NameKeyType staticPlayer1NameID = NAMEKEY_INVALID;
-static NameKeyType staticPlayer2NameID = NAMEKEY_INVALID;
-static NameKeyType staticPlayer3NameID = NAMEKEY_INVALID;
-static NameKeyType staticPlayer4NameID = NAMEKEY_INVALID;
-static NameKeyType staticPlayer5NameID = NAMEKEY_INVALID;
-static NameKeyType staticPlayer6NameID = NAMEKEY_INVALID;
-static NameKeyType staticPlayer7NameID = NAMEKEY_INVALID;
-
-static NameKeyType staticPlayer1StatusID = NAMEKEY_INVALID;
-static NameKeyType staticPlayer2StatusID = NAMEKEY_INVALID;
-static NameKeyType staticPlayer3StatusID = NAMEKEY_INVALID;
-static NameKeyType staticPlayer4StatusID = NAMEKEY_INVALID;
-static NameKeyType staticPlayer5StatusID = NAMEKEY_INVALID;
-static NameKeyType staticPlayer6StatusID = NAMEKEY_INVALID;
-static NameKeyType staticPlayer7StatusID = NAMEKEY_INVALID;
-
-static GameWindow *buttonQuitWindow = nullptr;
-static GameWindow *staticPlayer1Name = nullptr;
-static GameWindow *staticPlayer2Name = nullptr;
-static GameWindow *staticPlayer3Name = nullptr;
-static GameWindow *staticPlayer4Name = nullptr;
-static GameWindow *staticPlayer5Name = nullptr;
-static GameWindow *staticPlayer6Name = nullptr;
-static GameWindow *staticPlayer7Name = nullptr;
-
-static GameWindow *staticPlayer1Status = nullptr;
-static GameWindow *staticPlayer2Status = nullptr;
-static GameWindow *staticPlayer3Status = nullptr;
-static GameWindow *staticPlayer4Status = nullptr;
-static GameWindow *staticPlayer5Status = nullptr;
-static GameWindow *staticPlayer6Status = nullptr;
-static GameWindow *staticPlayer7Status = nullptr;
-
-static const char *layoutFilename = "GameSpyGameOptionsMenu.wnd";
-static const char *parentName = "GameSpyGameOptionsMenuParent";
-static const char *gadgetsToHide[] =
-{
- "MapWindow",
- "StaticTextGameName",
- "StaticTextTeam",
- "StaticTextFaction",
- "StaticTextColor",
- "StaticTextPlayers",
- "TextEntryMapDisplay",
- "ButtonSelectMap",
- "ButtonStart",
- "StaticTextMapPreview",
- nullptr
-};
-static const char *perPlayerGadgetsToHide[] =
-{
- "ComboBoxTeam",
- "ComboBoxColor",
- "ComboBoxPlayerTemplate",
- "ComboBoxPlayer",
- "ButtonAccept",
- "GenericPing",
- //"ButtonStartPosition",
- nullptr
-};
-
-static const char *qmlayoutFilename = "WOLQuickMatchMenu.wnd";
-static const char *qmparentName = "WOLQuickMatchMenuParent";
-static const char *qmgadgetsToHide[] =
-{
- "StaticTextTitle",
- "ButtonBack",
- "ButtonOptions",
- "ButtonBuddies",
- "ButtonWiden",
- "ButtonStop",
- "ButtonStart",
- nullptr
-};
-static const char *qmperPlayerGadgetsToHide[] =
-{
- //"ButtonStartPosition",
- nullptr
-};
-
-static void showGameSpyGameOptionsUnderlyingGUIElements( Bool show )
-{
- ShowUnderlyingGUIElements( show, layoutFilename, parentName, gadgetsToHide, perPlayerGadgetsToHide );
-
-}
-static void showGameSpyQMUnderlyingGUIElements( Bool show )
-{
- ShowUnderlyingGUIElements( show, qmlayoutFilename, qmparentName, qmgadgetsToHide, qmperPlayerGadgetsToHide );
-}
-
-static void InitEstablishConnectionsDialog() {
- buttonQuitID = TheNameKeyGenerator->nameToKey( "EstablishConnectionsScreen.wnd:ButtonQuit" );
- buttonQuitWindow = TheWindowManager->winGetWindowFromId(nullptr, buttonQuitID);
-}
-
-void ShowEstablishConnectionsWindow() {
- if (establishConnectionsLayout == nullptr) {
- establishConnectionsLayout = TheWindowManager->winCreateLayout( "Menus/EstablishConnectionsScreen.wnd" );
- InitEstablishConnectionsDialog();
- }
- establishConnectionsLayout->hide(FALSE);
- TheWindowManager->winSetFocus(establishConnectionsLayout->getFirstWindow());
- if (!TheGameSpyGame->isQMGame())
- {
- showGameSpyGameOptionsUnderlyingGUIElements(FALSE);
- }
- else
- {
- showGameSpyQMUnderlyingGUIElements(FALSE);
- }
-}
-
-void HideEstablishConnectionsWindow() {
- if (establishConnectionsLayout == nullptr) {
-// establishConnectionsLayout = TheWindowManager->winCreateLayout( "Menus/EstablishConnectionsScreen.wnd" );
-// InitEstablishConnectionsDialog();
- return;
- }
-// establishConnectionsLayout->hide(TRUE);
-// establishConnectionsLayout->hide(TRUE);
-// TheWindowManager->winDestroy(establishConnectionsLayout);
- establishConnectionsLayout->destroyWindows();
- deleteInstance(establishConnectionsLayout);
- establishConnectionsLayout = nullptr;
- if (!TheGameSpyGame->isQMGame())
- {
- showGameSpyGameOptionsUnderlyingGUIElements(TRUE);
- }
- else
- {
- showGameSpyQMUnderlyingGUIElements(TRUE);
- }
-}
-
-WindowMsgHandledType EstablishConnectionsControlInput(GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2) {
-
- return MSG_IGNORED;
-}
-
-WindowMsgHandledType EstablishConnectionsControlSystem(GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2) {
-
- switch (msg) {
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if (controlID == buttonQuitID) {
- TheEstablishConnectionsMenu->abortGame();
- }
- break;
- }
- }
- return MSG_HANDLED;
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp
deleted file mode 100644
index 837a3c72e08..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp
+++ /dev/null
@@ -1,1161 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: KeyboardOptionsMenu.cpp /////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: Command & Conquer: Generals
-//
-// File name: KeyboardOptionsMenu.cpp
-//
-// Created: Chris Brue, July 2002
-//
-// Desc: the Keyboard options window control
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/GameAudio.h"
-#include "Common/GameEngine.h"
-#include "Common/UserPreferences.h"
-
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GadgetCheckBox.h"
-#include "GameClient/GadgetComboBox.h"
-#include "GameClient/GadgetListBox.h"
-#include "GameClient/GadgetSlider.h"
-#include "GameClient/GadgetStaticText.h"
-#include "GameClient/IMEManager.h"
-#include "GameClient/Shell.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/Mouse.h"
-#include "GameClient/GameText.h"
-#include "GameClient/MetaEvent.h"
-
-#include "GameNetwork/FirewallHelper.h"
-#include "GameNetwork/IPEnumeration.h"
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
-WindowMsgHandledType KeyboardTextEntryInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 );
-
-static NameKeyType buttonBackID = NAMEKEY_INVALID;
-static GameWindow *buttonBack = nullptr;
-
-static NameKeyType parentKeyboardOptionsMenuID = NAMEKEY_INVALID;
-static GameWindow *parentKeyboardOptionsMenu = nullptr;
-
-static NameKeyType comboBoxCategoryListID = NAMEKEY_INVALID;
-static GameWindow *comboBoxCategoryList = nullptr;
-
-static NameKeyType listBoxCommandListID = NAMEKEY_INVALID;
-static GameWindow *listBoxCommandList = nullptr;
-
-static NameKeyType staticTextDescriptionID = NAMEKEY_INVALID;
-static GameWindow *staticTextDescription = nullptr;
-
-static NameKeyType staticTextCurrentHotkeyID = NAMEKEY_INVALID;
-static GameWindow *staticTextCurrentHotkey = nullptr;
-
-static NameKeyType buttonResetAllID = NAMEKEY_INVALID;
-static GameWindow *buttonResetAll = nullptr;
-
-static NameKeyType textEntryAssignHotkeyID = NAMEKEY_INVALID;
-static GameWindow *textEntryAssignHotkey = nullptr;
-
-static NameKeyType buttonAssignID = NAMEKEY_INVALID;
-static GameWindow *buttonAssign = nullptr;
-
-//use Bools to test if modifiers are used
-
-Bool shiftDown = false;
-Bool altDown = false;
-Bool ctrlDown = false;
-
-// shows whether or not a correctly formatted hotkey assignment is in the text area
-Bool absolute = false;
-
-// initialize these, they will be used a lot
-UnicodeString alt;
-UnicodeString ctrl;
-UnicodeString shift;
-
-
-
-void populateCategoryBox()
-{
- Int i;
- Int index;
- Color color = GameMakeColor(255,255,255,255);
- AsciiString temp;
- UnicodeString str;
- GadgetComboBoxReset(comboBoxCategoryList);
- for ( i = 0; i < CATEGORY_NUM_CATEGORIES; ++i)
- {
- temp.format("GUI:%s", CategoryListName[i]);
- str = TheGameText->fetch( temp );
- index = GadgetComboBoxAddEntry(comboBoxCategoryList, str, color);
- }
-
- GadgetComboBoxSetSelectedPos(comboBoxCategoryList, 0);
-}
-
-// keeps track of whether or not each text modifier is being currently displayed in the text entry field
-void setKeyDown( UnicodeString mod, Bool b )
-{
- if( mod == TheGameText->fetch( "KEYBOARD:Shift+" ) )
- shiftDown = b;
- else if( mod == TheGameText->fetch( "KEYBOARD:Ctrl+" ) )
- ctrlDown = b;
- else
- altDown = b;
-}
-
-// initialized the command list box
-void fillCommandListBox( MappableKeyCategories cat )
-{
- if(!listBoxCommandList)
- return;
-
- GadgetListBoxReset(listBoxCommandList);
- Color color = GameMakeColor(255,255,255,255);
-
- for(const MetaMapRec *rec = TheMetaMap->getFirstMetaMapRec(); rec; rec = rec->m_next)
- {
- if(rec->m_category == cat)
- GadgetListBoxAddEntryText(listBoxCommandList, rec->m_displayName, color, -1, -1 );
-
- }
-}
-
-void doKeyUp(EntryData *e, UnicodeString mod )
-{
- char c = e->text->getText().getCharAt( e->text->getTextLength() - 1);
- // if there are modifiers, check which ones exist and act accordingly
- if( c == '+' )
- {
- // if all of the mods are down, make string out of other two
- if( altDown && ctrlDown && shiftDown )
- {
- if( mod == shift )
- {
- UnicodeString temp = alt;
- temp.concat( ctrl );
- e->text->setText( temp );
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, false );
- }
- else if( mod == alt )
- {
- UnicodeString temp = ctrl;
- temp.concat( shift );
- e->text->setText( temp );
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, false );
- }
- else if( mod == ctrl )
- {
- UnicodeString temp = alt;
- temp.concat( shift );
- e->text->setText( temp );
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, false );
- }
- }
- // if alt and ctrl are both down
- else if( altDown && ctrlDown )
- {
- if( mod == alt )
- {
- e->text->setText( ctrl );
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, false );
- }
- else if( mod == ctrl )
- {
- e->text->setText( ctrl );
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, false );
- }
- }
- // if alt and shift are both down
- else if( altDown && shiftDown )
- {
- if( mod == alt )
- {
- e->text->setText( shift );
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, false );
- }
- else if( mod == shift )
- {
- e->text->setText( alt );
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, false );
- }
- }
- // if ctrl and shift are both down
- else if( ctrlDown && shiftDown )
- {
- if( mod == ctrl )
- {
- e->text->setText( shift );
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, false );
- }
- else if( mod == shift )
- {
- e->text->setText( ctrl );
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, false );
- }
- }
- // else only one mod, just clear everything
- else
- {
- e->text->setText( UnicodeString::TheEmptyString );
- e->sText->setText( UnicodeString::TheEmptyString );
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, false );
- }
- }
- else
- {
- // this absolute thang will/might need more than one test
- absolute = true;
- }
-}
-
-// preforms the correct action when a modifier key is pressed down
-void doKeyDown(EntryData *e, UnicodeString mod )
-{
- // simple cases if there are no mods present
- //sanity check
- if( e->text->getTextLength() <= 1 )
- {
- // reset text
- e->text->setText( mod );
- e->sText->setText( mod );
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, true );
- }
-
- else //if( e->text->getTextLength() )
- {
- char c = e->text->getText().getCharAt( e->text->getTextLength() - 1);
- if( c != '+' && absolute)
- {
- e->text->setText( mod );
- e->sText->setText( mod );
- e->charPos = e->text->getTextLength();
- // try resetting all mods first
- setKeyDown( shift, false );
- setKeyDown( alt, false );
- setKeyDown( ctrl, false );
-
- setKeyDown( mod, true );
- absolute = false;
-
- }
- //else only allow modifiers are present
- else
- {
- if( mod == shift && shiftDown )
- {
- }
- else if( mod == ctrl && ctrlDown )
- {
- }
- else if( mod == alt && altDown )
- {
- }
- else
- {
- //figure out the cases for which mod goes first
-
- // puts shift at the end of the mods
- if( altDown && ctrlDown)
- {
- UnicodeString temp = alt;
- temp.concat( ctrl );
- temp.concat( mod );
- e->text->setText(temp);
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, true );
- }
- // if alt and shift are down, puts ctrl in the middle
- else if( altDown && shiftDown )
- {
- UnicodeString temp = alt;
- temp.concat( ctrl );
- temp.concat( shift );
- e->text->setText( temp );
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, true );
- }
- // puts either shift or ctrl after alt
- else if( altDown )
- {
- UnicodeString temp = alt;
- temp.concat( mod );
- e->text->setText(temp);
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, true );
- }
- // puts alt infront of these two
- else if( ctrlDown && shiftDown )
- {
- UnicodeString temp = alt;
- temp.concat( ctrl );
- temp.concat( shift );
- e->text->setText( temp );
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, true );
- }
- // if only ctrl+ is currently being displayed
- else if( ctrlDown )
- {
- // if it's alt, put it in front
- if( mod == alt )
- {
- UnicodeString temp = mod;
- temp.concat( ctrl );
- e->text->setText( temp );
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, true );
- }
- //else put shift after ctrl
- else
- {
- UnicodeString temp = ctrl;
- temp.concat( mod );
- e->text->setText( temp );
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, true );
- }
- }
- // else put alt or ctrl in front of shift
- else if( shiftDown )
- {
- UnicodeString temp = mod;
- temp.concat( shift );
- e->text->setText( temp );
- e->charPos = e->text->getTextLength();
- setKeyDown( mod, true );
- }
-
- }
-
- }
- }
-}
-
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the options menu */
-//-------------------------------------------------------------------------------------------------
-void KeyboardOptionsMenuInit( WindowLayout *layout, void *userData )
-{
-
- //set keyboard focus to main parent
- parentKeyboardOptionsMenuID = TheNameKeyGenerator->nameToKey("KeyboardOptionsMenu.wnd:ParentKeyboardOptionsMenu");
- parentKeyboardOptionsMenu = TheWindowManager->winGetWindowFromId( nullptr, parentKeyboardOptionsMenuID );
-
- // get ids for our children controls
- buttonBackID = TheNameKeyGenerator->nameToKey( "KeyboardOptionsMenu.wnd:ButtonBack" );
- buttonBack = TheWindowManager->winGetWindowFromId( parentKeyboardOptionsMenu, buttonBackID );
-
- comboBoxCategoryListID = TheNameKeyGenerator->nameToKey( "KeyboardOptionsMenu.wnd:ComboBoxCategoryList" );
- comboBoxCategoryList = TheWindowManager->winGetWindowFromId( /*parentKeyboardOptionsMenu*/nullptr, comboBoxCategoryListID );
-
- listBoxCommandListID = TheNameKeyGenerator->nameToKey( "KeyboardOptionsMenu.wnd:ListBoxCommandList" );
- listBoxCommandList = TheWindowManager->winGetWindowFromId( nullptr, listBoxCommandListID );
-
- staticTextDescriptionID = TheNameKeyGenerator->nameToKey( "KeyboardOptionsMenu.wnd:StaticTextDescription" );
- staticTextDescription = TheWindowManager->winGetWindowFromId( nullptr, staticTextDescriptionID );
-
- staticTextCurrentHotkeyID = TheNameKeyGenerator->nameToKey( "KeyboardOptionsMenu.wnd:StaticTextCurrentHotkey" );
- staticTextCurrentHotkey = TheWindowManager->winGetWindowFromId( nullptr, staticTextCurrentHotkeyID );
-
- buttonResetAllID = TheNameKeyGenerator->nameToKey( "KeyboardOptionsMenu.wnd:ButtonResetAll" );
- buttonResetAll = TheWindowManager->winGetWindowFromId( nullptr, buttonResetAllID );
-
- textEntryAssignHotkeyID = TheNameKeyGenerator->nameToKey( "KeyboardOptionsMenu.wnd:TextEntryAssignHotkey" );
- textEntryAssignHotkey = TheWindowManager->winGetWindowFromId( nullptr, textEntryAssignHotkeyID );
-
- buttonAssignID = TheNameKeyGenerator->nameToKey( "KeyboardOptionsMenu.wnd:ButtonAssign" );
- buttonAssign = TheWindowManager->winGetWindowFromId( nullptr, buttonAssignID );
-
-
-
- //special text entry box that needs its own function
- textEntryAssignHotkey->winSetInputFunc( KeyboardTextEntryInput );
-
- // populate category combo box
- populateCategoryBox();
-
- // populate command list
- fillCommandListBox(CATEGORY_CONTROL);
-
- //disable textEntry until specific command is chosen
- textEntryAssignHotkey->winEnable( false );
-
- //clear textEntry field
- EntryData *e = (EntryData *)textEntryAssignHotkey->winGetUserData();
- e->text->setText( UnicodeString::TheEmptyString );
- e->charPos = e->text->getTextLength();
-
- // set up these strings because they will be called a lot
- alt = TheGameText->fetch( "KEYBOARD:Alt+" );
- ctrl = TheGameText->fetch( "KEYBOARD:Ctrl+" );
- shift = TheGameText->fetch( "KEYBOARD:Shift+" );
-
- // show menu
- layout->hide( FALSE );
-
- // set keyboard focus to main parent
- TheWindowManager->winSetFocus( parentKeyboardOptionsMenu );
-}
-
-//-------------------------------------------------------------------------------------------------
-/** options menu shutdown method */
-//-------------------------------------------------------------------------------------------------
-void KeyboardOptionsMenuShutdown( WindowLayout *layout, void *userData )
-{
- // hide menu
- layout->hide( TRUE );
-
- // our shutdown is complete
- TheShell->shutdownComplete( layout );
-}
-
-//-------------------------------------------------------------------------------------------------
-/** options menu update method */
-//-------------------------------------------------------------------------------------------------
-void KeyboardOptionsMenuUpdate( WindowLayout *layout, void *userData )
-{
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Options menu input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType KeyboardOptionsMenuInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
- NameKeyType buttonID = TheNameKeyGenerator->nameToKey( "KeyboardOptionsMenu.wnd:ButtonBack" );
- GameWindow *button = TheWindowManager->winGetWindowFromId( window, buttonID );
-
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)button, buttonID );
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** options menu window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType KeyboardOptionsMenuSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CREATE:
- {
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GWM_DESTROY:
- {
-
- break;
-
- }
-
- // --------------------------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- return MSG_HANDLED;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GCM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if(controlID == comboBoxCategoryListID )
- {
- Int selected;
- GadgetComboBoxGetSelectedPos(comboBoxCategoryList, &selected);
-
- LookupListRec rec;
- rec = CategoryListName[selected];
- MappableKeyCategories cat = (MappableKeyCategories)(rec.value);
- fillCommandListBox( cat );
-
- //reset current hotkey description
- GadgetStaticTextSetText( staticTextDescription, TheGameText->fetch( "GUI:NULL" ) );
-
- //reset current hotkey text
- GadgetStaticTextSetText( staticTextCurrentHotkey, TheGameText->fetch( "GUI:NULL" ) );
-
- //clear textEntry field
- EntryData *e = (EntryData *)textEntryAssignHotkey->winGetUserData();
- e->text->setText( UnicodeString::TheEmptyString );
- e->charPos = e->text->getTextLength();
-
- //disable textEntry until specific command is chosen
- textEntryAssignHotkey->winEnable( false );
-
- }
- break;
-
- }
-
- // ---------------------------------------------------------------------------------------------
- case GLM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if( controlID == listBoxCommandListID )
- {
- Int selected;
- GadgetListBoxGetSelected( listBoxCommandList, &selected );
- UnicodeString str;
- str = GadgetListBoxGetText( listBoxCommandList, selected/*, Int column = 0*/ );
- for(const MetaMapRec *rec = TheMetaMap->getFirstMetaMapRec(); rec; rec = rec->m_next)
- {
- if(rec->m_displayName == str)
- {
- //set text in description window
- GadgetStaticTextSetText( staticTextDescription, rec->m_description );
- //set text in current hotkey text
- MappableKeyType type = rec->m_key;
- //enable text entry for assigning different hotkey
- textEntryAssignHotkey->winEnable( true );
-
- for (const LookupListRec* keyName = KeyNames; keyName->name; keyName++)
- {
- if( keyName->value == type )
- {
- const char *cptr = keyName->name;
- AsciiString aStr;
- aStr.format( cptr );
- UnicodeString uStr;
- uStr.translate( aStr );
-
- GadgetStaticTextSetText( staticTextCurrentHotkey, uStr );
- break;
- }
- }
-
- break;
- }
- }
-
- }
-
- break;
-
- }
-
- // ---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if( controlID == buttonBackID )
- {
-
- // go back one screen
- TheShell->pop();
-
- }
- else if( controlID == buttonAssignID )
- {
- // check grammar in text field
- }
- else if( controlID == buttonResetAllID )
- {
- // populate category combo box
- populateCategoryBox();
-
- // populate command list
- fillCommandListBox(CATEGORY_CONTROL);
-
- //reset current hotkey text
- GadgetStaticTextSetText( staticTextCurrentHotkey, TheGameText->fetch( "GUI:NULL" ) );
-
- //clear textEntry field
- EntryData *e = (EntryData *)textEntryAssignHotkey->winGetUserData();
- e->text->setText( UnicodeString::TheEmptyString );
- e->charPos = e->text->getTextLength();
-
- //set all mods to false
- setKeyDown(alt, false );
- setKeyDown(ctrl, false );
- setKeyDown(shift, false );
-
- //disable text entry
- textEntryAssignHotkey->winEnable( false );
-
- }
-
- break;
-
- }
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-// KeyboardTextEntryInput =======================================================
-/** Handle input for text entry field */
-//=============================================================================
-WindowMsgHandledType KeyboardTextEntryInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- EntryData *e = (EntryData *)window->winGetUserData();
-
- WinInstanceData *instData = window->winGetInstanceData();
-
- if ( TheIMEManager && TheIMEManager->isAttachedTo( window) && TheIMEManager->isComposing())
- {
- // ignore input while IME has focus
- return MSG_HANDLED;
- }
-
- switch( msg )
- {
- // ------------------------------------------------------------------------
- case GWM_IME_CHAR:
- {
- WideChar ch = (WideChar) mData1;
-
- // --------------------------------------------------------------------
- if ( ch == VK_RETURN )
- {
- // Done with this edit
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_EDIT_DONE,
- (WindowMsgData)window,
- 0 );
- return MSG_HANDLED;
- };
-
- if( ch )
- {
- // Constrain keys based on rules for entry box.
- if( e->numericalOnly )
- {
- if( TheWindowManager->winIsDigit( ch ) == 0 )
- return MSG_HANDLED;
- }
- else if( e->alphaNumericalOnly )
- {
- if( TheWindowManager->winIsAlNum( ch ) == 0 )
- return MSG_HANDLED;
- }
- else if ( e->aSCIIOnly )
- {
- if ( TheWindowManager->winIsAscii( ch ) == 0 )
- {
- return MSG_HANDLED;
- }
- }
-
- if( e->text->getTextLength() <= 1 )
- {
- e->text->setText( UnicodeString::TheEmptyString );
- e->text->appendChar( ch );
- e->charPos = e->text->getTextLength();
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
- return MSG_HANDLED;
- }
- //else check is modifiers are present
- else
- {
- char c = e->text->getText().getCharAt(e->text->getTextLength() - 1 );
- if(c == '+' )
- {
- e->text->appendChar( ch );
- e->charPos++;
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
- return MSG_HANDLED;
- }
- // if not, reset textEntry
- else
- {
- //if any of the modifiers are down, just replace letter
- if( ( shiftDown | ctrlDown | altDown ) && ( !absolute ) )
- {
- char test = e->text->getText().getCharAt(e->text->getTextLength() - 1);
- // only replace letter if not the same as last char of string (removes flickering)
- if( test != ch )
- {
- e->text->removeLastChar();
- e->text->appendChar( ch );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
- }
- }
- //else reset textEntry
- else
- {
- e->text->setText( UnicodeString::TheEmptyString );
- e->text->appendChar( ch );
- e->charPos = 1;
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
- }
- return MSG_HANDLED;
- }
- }
-
-
- }
- break;
- }
- // ------------------------------------------------------------------------
- case GWM_CHAR:
-
- switch( mData1 )
- {
- /*
- // --------------------------------------------------------------------
- case KEY_KPENTER:
- case KEY_ENTER:
- // Done with this edit
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
- if( e->receivedUnichar == FALSE )
- {
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_EDIT_DONE,
- (WindowMsgData)window,
- 0 );
- }
- }
-
- break;
- */
-
- // -------------------------------------------------------------------------------------------
- // modifier cases
-
- case KEY_LCTRL:
- {
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
- UnicodeString mod = ctrl;
- doKeyDown( e, mod );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
-
- return MSG_HANDLED;
- }
- if( BitIsSet(mData2, KEY_STATE_UP ) )
- {
- UnicodeString mod = ctrl;
- doKeyUp( e, mod );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
-
- return MSG_HANDLED;
- }
- break;
- }
-
- case KEY_RSHIFT:
- case KEY_LSHIFT:
- {
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
- UnicodeString mod = shift;
- doKeyDown( e, mod );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
-
- return MSG_HANDLED;
-
- }
- if( BitIsSet( mData2, KEY_STATE_UP ) )
- {
- UnicodeString mod = shift;
- doKeyUp(e, mod );
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
-
-
- return MSG_HANDLED;
- }
- break;
- }
-
- case KEY_LALT:
- {
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
- UnicodeString mod = alt;
- doKeyDown( e, mod );
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
-
- return MSG_HANDLED;
-
- }
- if( BitIsSet(mData2, KEY_STATE_UP ) )
- {
- UnicodeString mod = alt;
- doKeyUp( e, mod );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
-
- return MSG_HANDLED;
- }
- break;
- }
-
- // -------------------------------------------------------------------------------------------
-
-
- // --------------------------------------------------------------------
- // Don't process these keys
- case KEY_ESC:
- case KEY_PGUP:
- case KEY_PGDN:
- case KEY_HOME:
- case KEY_END:
- case KEY_F1:
- case KEY_F2:
- case KEY_F3:
- case KEY_F4:
- case KEY_F5:
- case KEY_F6:
- case KEY_F7:
- case KEY_F8:
- case KEY_F9:
- case KEY_F10:
- case KEY_F11:
- case KEY_F12:
- case KEY_CAPS:
- return MSG_IGNORED;
-
- // --------------------------------------------------------------------
- case KEY_DOWN:
- case KEY_RIGHT:
- case KEY_TAB:
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- window->winNextTab();
- break;
-
- // --------------------------------------------------------------------
- case KEY_UP:
- case KEY_LEFT:
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- window->winPrevTab();
- break;
-
- // --------------------------------------------------------------------
- case KEY_BACKSPACE:
- {
- e->text->setText( UnicodeString::TheEmptyString );
- e->charPos = e->text->getTextLength();
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
- setKeyDown(shift, false );
- setKeyDown(ctrl, false );
- setKeyDown(alt, false );
- return MSG_HANDLED;
-
- break;
- }
- case KEY_DEL:
- {
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
- // if conCharPos != 0 this will fall through to next case.
- // it should be noted that conCharPos can only != 0 in Jap & Kor
- if( e->conCharPos == 0 )
- {
- if( e->charPos > 0 )
- {
-
- e->text->removeLastChar();
- e->sText->removeLastChar();
- e->charPos--;
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
- }
- }
- }
- break;
- }
-
- // ----------------------------------------------------------------------------------------
- // doing research to see if this will fix the keyboard stuff
- /*default:
- {
- char ch = mData1;
- if( ch && ( BitIsSet( mData2, KEY_STATE_DOWN ) ) )
- {
- // Constrain keys based on rules for entry box.
- if( e->numericalOnly )
- {
- if( TheWindowManager->winIsDigit( ch ) == 0 )
- return MSG_HANDLED;
- }
- else if( e->alphaNumericalOnly )
- {
- if( TheWindowManager->winIsAlNum( ch ) == 0 )
- return MSG_HANDLED;
- }
- else if ( e->aSCIIOnly )
- {
- if ( TheWindowManager->winIsAscii( ch ) == 0 )
- {
- return MSG_HANDLED;
- }
- }
-
- if( e->text->getTextLength() <= 1 )
- {
- e->text->setText( UnicodeString::TheEmptyString );
- e->text->appendChar( ch );
- e->charPos = e->text->getTextLength();
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
- return MSG_HANDLED;
- }
- //else check is modifiers are present
- else
- {
- char c = e->text->getText().getCharAt(e->text->getTextLength() - 1 );
- if(c == '+' )
- {
- e->text->appendChar( ch );
- e->charPos++;
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
- return MSG_HANDLED;
- }
- // if not, reset textEntry
- else
- {
- //if any of the modifiers are down, just replace letter
- if( ( shiftDown | ctrlDown | altDown ) && ( !absolute ) )
- {
- char test = e->text->getText().getCharAt(e->text->getTextLength() - 1);
- // only replace letter if not the same as last char of string (removes flickering)
- if( test != ch )
- {
- e->text->removeLastChar();
- e->text->appendChar( ch );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
- }
- }
- //else reset textEntry
- else
- {
- e->text->setText( UnicodeString::TheEmptyString );
- e->text->appendChar( ch );
- e->charPos = 1;
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
- }
- return MSG_HANDLED;
- }
- }
-
-
- }
- }*/
-
-
- }
-
- break;
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DOWN:
- BitSet( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSetFocus( window );
- break;
-
- // ------------------------------------------------------------------------
- case GWM_MOUSE_ENTERING:
-
- if (BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- {
-
- BitSet( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_MOUSE_ENTERING,
- (WindowMsgData)window, 0 );
- TheWindowManager->winSetFocus( window );
- }
-
- break;
-
- // ------------------------------------------------------------------------
- case GWM_MOUSE_LEAVING:
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- {
-
- BitClear( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_MOUSE_LEAVING,
- (WindowMsgData)window, 0 );
- }
- break;
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DRAG:
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GGM_LEFT_DRAG,
- (WindowMsgData)window, 0 );
- break;
-
- // ------------------------------------------------------------------------
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp
deleted file mode 100644
index 9283219f788..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp
+++ /dev/null
@@ -1,929 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////////////
-// FILE: LanLobbyMenu.cpp
-// Author: Chris Huybregts, October 2001
-// Description: Lan Lobby Menu
-///////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Lib/BaseType.h"
-#include "Common/crc.h"
-#include "Common/GameEngine.h"
-#include "Common/GlobalData.h"
-#include "Common/MultiplayerSettings.h"
-#include "Common/NameKeyGenerator.h"
-#include "Common/Player.h"
-#include "Common/PlayerTemplate.h"
-#include "Common/QuotedPrintable.h"
-#include "Common/OptionPreferences.h"
-#include "GameClient/AnimateWindowManager.h"
-#include "GameClient/ClientInstance.h"
-#include "GameClient/GameText.h"
-#include "GameClient/MapUtil.h"
-#include "GameClient/Mouse.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/Shell.h"
-#include "GameClient/ShellHooks.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GameInfoWindow.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetListBox.h"
-#include "GameClient/GadgetTextEntry.h"
-#include "GameClient/MessageBox.h"
-#include "GameClient/GameWindowTransitions.h"
-#include "GameLogic/GameLogic.h"
-#include "GameNetwork/IPEnumeration.h"
-#include "GameNetwork/LANAPICallbacks.h"
-#include "GameNetwork/LANGameInfo.h"
-
-Bool LANisShuttingDown = false;
-Bool LANbuttonPushed = false;
-Bool LANSocketErrorDetected = FALSE;
-char *LANnextScreen = nullptr;
-
-static Int initialGadgetDelay = 2;
-static Bool justEntered = FALSE;
-
-
-
-LANPreferences::LANPreferences()
-{
- loadFromIniFile();
-}
-
-LANPreferences::~LANPreferences()
-{
-}
-
-Bool LANPreferences::loadFromIniFile()
-{
- if (rts::ClientInstance::getInstanceId() > 1u)
- {
- AsciiString fname;
- fname.format("Network_Instance%.2u.ini", rts::ClientInstance::getInstanceId());
- return load(fname);
- }
-
- return load("Network.ini");
-}
-
-UnicodeString LANPreferences::getUserName()
-{
- UnicodeString ret;
-
- LANPreferences::const_iterator it = find("UserName");
- if (it != end())
- {
- // Found an user name. Use it if valid.
- ret = QuotedPrintableToUnicodeString(it->second);
- ret.trim();
- if (!ret.isEmpty())
- {
- return ret;
- }
- }
-
- if (rts::ClientInstance::getInstanceId() > 1u)
- {
- // TheSuperHackers @feature Use the instance id as default user name
- // to avoid duplicate names for multiple client instances.
- ret.format(L"Instance%.2d", rts::ClientInstance::getInstanceId());
- return ret;
- }
-
- // Use machine name as default user name.
- IPEnumeration IPs;
- ret.translate(IPs.getMachineName());
- return ret;
-}
-
-Int LANPreferences::getPreferredColor()
-{
- Int ret;
- LANPreferences::const_iterator it = find("Color");
- if (it == end())
- {
- return -1;
- }
-
- ret = atoi(it->second.str());
- if (ret < -1 || ret >= TheMultiplayerSettings->getNumColors())
- ret = -1;
-
- return ret;
-}
-
-Int LANPreferences::getPreferredFaction()
-{
- Int ret;
- LANPreferences::const_iterator it = find("PlayerTemplate");
- if (it == end())
- {
- return PLAYERTEMPLATE_RANDOM;
- }
-
- ret = atoi(it->second.str());
- if (ret == PLAYERTEMPLATE_OBSERVER || ret < PLAYERTEMPLATE_MIN || ret >= ThePlayerTemplateStore->getPlayerTemplateCount())
- ret = PLAYERTEMPLATE_RANDOM;
-
- if (ret >= 0)
- {
- const PlayerTemplate *fac = ThePlayerTemplateStore->getNthPlayerTemplate(ret);
- if (!fac)
- ret = PLAYERTEMPLATE_RANDOM;
- else if (fac->getStartingBuilding().isEmpty())
- ret = PLAYERTEMPLATE_RANDOM;
- }
-
- return ret;
-}
-
-Bool LANPreferences::usesSystemMapDir()
-{
- OptionPreferences::const_iterator it = find("UseSystemMapDir");
- if (it == end())
- return TRUE;
-
- if (stricmp(it->second.str(), "yes") == 0) {
- return TRUE;
- }
- return FALSE;
-}
-
-AsciiString LANPreferences::getPreferredMap()
-{
- AsciiString ret;
- LANPreferences::const_iterator it = find("Map");
- if (it == end())
- {
- ret = getDefaultMap(TRUE);
- return ret;
- }
-
- ret = QuotedPrintableToAsciiString(it->second);
- ret.trim();
- if (ret.isEmpty() || !isValidMap(ret, TRUE))
- {
- ret = getDefaultMap(TRUE);
- return ret;
- }
-
- return ret;
-}
-
-Int LANPreferences::getNumRemoteIPs()
-{
- Int ret;
- LANPreferences::const_iterator it = find("NumRemoteIPs");
- if (it == end())
- {
- ret = 0;
- return ret;
- }
-
- ret = atoi(it->second.str());
- return ret;
-}
-
-UnicodeString LANPreferences::getRemoteIPEntry(Int i)
-{
- UnicodeString ret;
- AsciiString key;
- key.format("RemoteIP%d", i);
-
- AsciiString ipstr;
- AsciiString asciientry;
-
- LANPreferences::const_iterator it = find(key.str());
- if (it == end())
- {
- asciientry = "";
- return ret;
- }
-
- asciientry = it->second;
-
- asciientry.nextToken(&ipstr, ":");
- asciientry.set(asciientry.str() + 1); // skip the ':'
-
- ret.translate(ipstr);
- if (!asciientry.isEmpty())
- {
- ret.concat(L"(");
- ret.concat(QuotedPrintableToUnicodeString(asciientry));
- ret.concat(L")");
- }
-
- return ret;
-}
-
-static const char superweaponRestrictionKey[] = "SuperweaponRestrict";
-
-Bool LANPreferences::getSuperweaponRestricted() const
-{
- LANPreferences::const_iterator it = find(superweaponRestrictionKey);
- if (it == end())
- {
- return false;
- }
-
- return ( it->second.compareNoCase( "yes" ) == 0 );
-}
-
-void LANPreferences::setSuperweaponRestricted( Bool superweaponRestricted )
-{
- (*this)[superweaponRestrictionKey] = superweaponRestricted ? "Yes" : "No";
-}
-
-static const char startingCashKey[] = "StartingCash";
-Money LANPreferences::getStartingCash() const
-{
- LANPreferences::const_iterator it = find(startingCashKey);
- if (it == end())
- {
- return TheMultiplayerSettings->getDefaultStartingMoney();
- }
-
- Money money;
- money.deposit( strtoul( it->second.str(), nullptr, 10 ), FALSE, FALSE );
-
- return money;
-}
-
-void LANPreferences::setStartingCash( const Money & startingCash )
-{
- AsciiString option;
-
- option.format( "%d", startingCash.countMoney() );
-
- (*this)[startingCashKey] = option;
-}
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
-
-
-// window ids ------------------------------------------------------------------------------
-static NameKeyType parentLanLobbyID = NAMEKEY_INVALID;
-static NameKeyType buttonBackID = NAMEKEY_INVALID;
-static NameKeyType buttonClearID = NAMEKEY_INVALID;
-static NameKeyType buttonHostID = NAMEKEY_INVALID;
-static NameKeyType buttonJoinID = NAMEKEY_INVALID;
-static NameKeyType buttonDirectConnectID = NAMEKEY_INVALID;
-static NameKeyType buttonEmoteID = NAMEKEY_INVALID;
-static NameKeyType staticToolTipID = NAMEKEY_INVALID;
-static NameKeyType textEntryPlayerNameID = NAMEKEY_INVALID;
-static NameKeyType textEntryChatID = NAMEKEY_INVALID;
-static NameKeyType listboxPlayersID = NAMEKEY_INVALID;
-static NameKeyType staticTextGameInfoID = NAMEKEY_INVALID;
-
-
-// Window Pointers ------------------------------------------------------------------------
-static GameWindow *parentLanLobby = nullptr;
-static GameWindow *buttonBack = nullptr;
-static GameWindow *buttonClear = nullptr;
-static GameWindow *buttonHost = nullptr;
-static GameWindow *buttonJoin = nullptr;
-static GameWindow *buttonDirectConnect = nullptr;
-static GameWindow *buttonEmote = nullptr;
-static GameWindow *staticToolTip = nullptr;
-static GameWindow *textEntryPlayerName = nullptr;
-static GameWindow *textEntryChat = nullptr;
-static GameWindow *staticTextGameInfo = nullptr;
-
-//external declarations of the Gadgets the callbacks can use
-NameKeyType listboxChatWindowID = NAMEKEY_INVALID;
-GameWindow *listboxChatWindow = nullptr;
-GameWindow *listboxPlayers = nullptr;
-NameKeyType listboxGamesID = NAMEKEY_INVALID;
-GameWindow *listboxGames = nullptr;
-
-// hack to disable framerate limiter in LAN games
-//static Bool shellmapOn;
-static Bool useFpsLimit;
-static UnicodeString defaultName;
-
-static void playerTooltip(GameWindow *window,
- WinInstanceData *instData,
- UnsignedInt mouse)
-{
- Int x, y, row, col;
- x = LOLONGTOSHORT(mouse);
- y = HILONGTOSHORT(mouse);
-
- GadgetListBoxGetEntryBasedOnXY(window, x, y, row, col);
-
- if (row == -1 || col == -1)
- {
- //TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:LobbyPlayers") );
- return;
- }
-
- UnsignedInt playerIP = (UnsignedInt)GadgetListBoxGetItemData( window, row, col );
- LANPlayer *player = TheLAN->LookupPlayer(playerIP);
- if (!player)
- {
- DEBUG_CRASH(("No player info in listbox!"));
- //TheMouse->setCursorTooltip( TheGameText->fetch("TOOLTIP:LobbyPlayers") );
- return;
- }
-
- setLANPlayerTooltip(player);
-}
-
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the Lan Lobby Menu */
-//-------------------------------------------------------------------------------------------------
-void LanLobbyMenuInit( WindowLayout *layout, void *userData )
-{
- LANnextScreen = nullptr;
- LANbuttonPushed = false;
- LANisShuttingDown = false;
-
- // get the ids for our controls
- parentLanLobbyID = TheNameKeyGenerator->nameToKey( "LanLobbyMenu.wnd:LanLobbyMenuParent" );
- buttonBackID = TheNameKeyGenerator->nameToKey( "LanLobbyMenu.wnd:ButtonBack" );
- buttonClearID = TheNameKeyGenerator->nameToKey( "LanLobbyMenu.wnd:ButtonClear" );
- buttonHostID = TheNameKeyGenerator->nameToKey( "LanLobbyMenu.wnd:ButtonHost" );
- buttonJoinID = TheNameKeyGenerator->nameToKey( "LanLobbyMenu.wnd:ButtonJoin" );
- buttonDirectConnectID = TheNameKeyGenerator->nameToKey( "LanLobbyMenu.wnd:ButtonDirectConnect" );
- buttonEmoteID = TheNameKeyGenerator->nameToKey( "LanLobbyMenu.wnd:ButtonEmote" );
- staticToolTipID = TheNameKeyGenerator->nameToKey( "LanLobbyMenu.wnd:StaticToolTip" );
- textEntryPlayerNameID = TheNameKeyGenerator->nameToKey( "LanLobbyMenu.wnd:TextEntryPlayerName" );
- textEntryChatID = TheNameKeyGenerator->nameToKey( "LanLobbyMenu.wnd:TextEntryChat" );
- listboxPlayersID = TheNameKeyGenerator->nameToKey( "LanLobbyMenu.wnd:ListboxPlayers" );
- listboxChatWindowID = TheNameKeyGenerator->nameToKey( "LanLobbyMenu.wnd:ListboxChatWindowLanLobby" );
- listboxGamesID = TheNameKeyGenerator->nameToKey( "LanLobbyMenu.wnd:ListboxGames" );
- staticTextGameInfoID = TheNameKeyGenerator->nameToKey( "LanLobbyMenu.wnd:StaticTextGameInfo" );
-
-
- // Get pointers to the window buttons
- parentLanLobby = TheWindowManager->winGetWindowFromId( nullptr, parentLanLobbyID );
- buttonBack = TheWindowManager->winGetWindowFromId( nullptr, buttonBackID);
- buttonClear = TheWindowManager->winGetWindowFromId( nullptr, buttonClearID);
- buttonHost = TheWindowManager->winGetWindowFromId( nullptr, buttonHostID );
- buttonJoin = TheWindowManager->winGetWindowFromId( nullptr, buttonJoinID );
- buttonDirectConnect = TheWindowManager->winGetWindowFromId( nullptr, buttonDirectConnectID );
- buttonEmote = TheWindowManager->winGetWindowFromId( nullptr,buttonEmoteID );
- staticToolTip = TheWindowManager->winGetWindowFromId( nullptr, staticToolTipID );
- textEntryPlayerName = TheWindowManager->winGetWindowFromId( nullptr, textEntryPlayerNameID );
- textEntryChat = TheWindowManager->winGetWindowFromId( nullptr, textEntryChatID );
- listboxPlayers = TheWindowManager->winGetWindowFromId( nullptr, listboxPlayersID );
- listboxChatWindow = TheWindowManager->winGetWindowFromId( nullptr, listboxChatWindowID );
- listboxGames = TheWindowManager->winGetWindowFromId( nullptr, listboxGamesID );
- staticTextGameInfo = TheWindowManager->winGetWindowFromId( nullptr, staticTextGameInfoID );
- listboxPlayers->winSetTooltipFunc(playerTooltip);
-
- // Show Menu
- layout->hide( FALSE );
-
- // Init LAN API Singleton
- if (!TheLAN)
- {
- TheLAN = NEW LANAPI(); /// @todo clh delete TheLAN and
- useFpsLimit = TheGlobalData->m_useFpsLimit;
- }
- else
- {
- TheWritableGlobalData->m_useFpsLimit = useFpsLimit;
- TheLAN->reset();
- }
-
- // Choose an IP address, then initialize the LAN singleton
- UnsignedInt IP = TheGlobalData->m_defaultIP;
- IPEnumeration IPs;
- const WideChar* IPSource;
- if (!IP)
- {
- EnumeratedIP *IPlist = IPs.getAddresses();
- /*
- while (IPlist && IPlist->getNext())
- {
- IPlist = IPlist->getNext();
- }
- */
- DEBUG_ASSERTCRASH(IPlist, ("No IP addresses found!"));
- if (!IPlist)
- {
- /// @todo: display error and exit lan lobby if no IPs are found
- }
-
- IPSource = L"Local IP chosen";
- IP = IPlist->getIP();
- }
- else
- {
- IPSource = L"Default local IP";
- }
-#if defined(RTS_DEBUG)
- UnicodeString str;
- str.format(L"%s: %d.%d.%d.%d", IPSource, PRINTF_IP_AS_4_INTS(IP));
- GadgetListBoxAddEntryText(listboxChatWindow, str, chatSystemColor, -1, 0);
-#endif
-
- // TheLAN->init() sets us to be in a LAN menu screen automatically.
- TheLAN->init();
- if (TheLAN->SetLocalIP(IP) == FALSE) {
- LANSocketErrorDetected = TRUE;
- }
-
- //Initialize the gadgets on the window
- //UnicodeString txtInput;
- //txtInput.translate(IPs.getMachineName());
- LANPreferences prefs;
- defaultName = prefs.getUserName();
- defaultName.truncateTo(g_lanPlayerNameLength);
-
- GadgetTextEntrySetText( textEntryPlayerName, defaultName);
- // Clear the text entry line
- GadgetTextEntrySetText(textEntryChat, UnicodeString::TheEmptyString);
-
- GadgetListBoxReset(listboxPlayers);
- GadgetListBoxReset(listboxGames);
-
- defaultName.truncateTo(g_lanPlayerNameLength);
- TheLAN->RequestSetName(defaultName);
- TheLAN->RequestLocations();
-
- /*
- UnicodeString unicodeChat;
-
- unicodeChat = L"Local IP list:";
- GadgetListBoxAddEntryText(listboxChatWindow, unicodeChat, chatSystemColor, -1, 0);
-
- IPlist = IPs.getAddresses();
- while (IPlist)
- {
- unicodeChat.translate(IPlist->getIPstring());
- GadgetListBoxAddEntryText(listboxChatWindow, unicodeChat, chatSystemColor, -1, 0);
- IPlist = IPlist->getNext();
- }
- */
-
- // Set Keyboard to Main Parent
- //TheWindowManager->winSetFocus( parentLanLobby );
- TheWindowManager->winSetFocus( textEntryChat );
- CreateLANGameInfoWindow(staticTextGameInfo);
-
- //TheShell->showShellMap(FALSE);
- //shellmapOn = FALSE;
- // coming out of a game, re-load the shell map
- TheShell->showShellMap(TRUE);
-
- // check for MOTD
- TheLAN->checkMOTD();
- layout->hide(FALSE);
- layout->bringForward();
-
- justEntered = TRUE;
- initialGadgetDelay = 2;
- GameWindow *win = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey("LanLobbyMenu.wnd:GadgetParent"));
- if(win)
- win->winHide(TRUE);
-
-
- // animate controls
- //TheShell->registerWithAnimateManager(parentLanLobby, WIN_ANIMATION_SLIDE_TOP, TRUE);
-// TheShell->registerWithAnimateManager(buttonHost, WIN_ANIMATION_SLIDE_LEFT, TRUE, 600);
-// TheShell->registerWithAnimateManager(buttonJoin, WIN_ANIMATION_SLIDE_LEFT, TRUE, 400);
-// TheShell->registerWithAnimateManager(buttonDirectConnect, WIN_ANIMATION_SLIDE_LEFT, TRUE, 200);
-// //TheShell->registerWithAnimateManager(buttonOptions, WIN_ANIMATION_SLIDE_LEFT, TRUE, 1);
-// TheShell->registerWithAnimateManager(buttonBack, WIN_ANIMATION_SLIDE_RIGHT, TRUE, 1);
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** This is called when a shutdown is complete for this menu */
-//-------------------------------------------------------------------------------------------------
-static void shutdownComplete( WindowLayout *layout )
-{
-
- LANisShuttingDown = false;
-
- // hide the layout
- layout->hide( TRUE );
-
- // our shutdown is complete
- TheShell->shutdownComplete( layout, (LANnextScreen != nullptr) );
-
- if (LANnextScreen != nullptr)
- {
- TheShell->push(LANnextScreen);
- }
-
- LANnextScreen = nullptr;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Lan Lobby menu shutdown method */
-//-------------------------------------------------------------------------------------------------
-void LanLobbyMenuShutdown( WindowLayout *layout, void *userData )
-{
- LANPreferences prefs;
- prefs["UserName"] = UnicodeStringToQuotedPrintable(GadgetTextEntryGetText( textEntryPlayerName ));
- prefs.write();
-
- DestroyGameInfoWindow();
- // hide menu
- //layout->hide( TRUE );
-
- TheLAN->RequestLobbyLeave( true );
-
- // Reset the LAN singleton
- //TheLAN->reset();
-
- // our shutdown is complete
- //TheShell->shutdownComplete( layout );
- TheWritableGlobalData->m_useFpsLimit = useFpsLimit;
-
- LANisShuttingDown = true;
-
- // if we are shutting down for an immediate pop, skip the animations
- Bool popImmediate = *(Bool *)userData;
-
- LANSocketErrorDetected = FALSE;
-
- if( popImmediate )
- {
-
- shutdownComplete( layout );
- return;
-
- }
-
- TheShell->reverseAnimatewindow();
- TheTransitionHandler->reverse("LanLobbyFade");
- //if( shellmapOn)
-// TheShell->showShellMap(TRUE);
-}
-
-
-//-------------------------------------------------------------------------------------------------
-/** Lan Lobby menu update method */
-//-------------------------------------------------------------------------------------------------
-void LanLobbyMenuUpdate( WindowLayout * layout, void *userData)
-{
- if (TheGameLogic->isInShellGame() && TheGameLogic->getFrame() == 1)
- {
- SignalUIInteraction(SHELL_SCRIPT_HOOK_LAN_ENTERED_FROM_GAME);
- }
-
- if(justEntered)
- {
- if(initialGadgetDelay == 1)
- {
- TheTransitionHandler->setGroup("LanLobbyFade");
- initialGadgetDelay = 2;
- justEntered = FALSE;
- }
- else
- initialGadgetDelay--;
- }
-
- if(LANisShuttingDown && TheShell->isAnimFinished() && TheTransitionHandler->isFinished())
- shutdownComplete(layout);
-
- if (TheShell->isAnimFinished() && !LANbuttonPushed && TheLAN)
- TheLAN->update();
-
- if (LANSocketErrorDetected == TRUE) {
- LANSocketErrorDetected = FALSE;
- DEBUG_LOG(("SOCKET ERROR! BAILING!"));
- MessageBoxOk(TheGameText->fetch("GUI:NetworkError"), TheGameText->fetch("GUI:SocketError"), nullptr);
-
- // we have a socket problem, back out to the main menu.
- TheWindowManager->winSendSystemMsg(buttonBack->winGetParent(), GBM_SELECTED,
- (WindowMsgData)buttonBack, buttonBackID);
- }
-
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Lan Lobby menu input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType LanLobbyMenuInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
- if (LANbuttonPushed)
- break;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)buttonBack, buttonBackID );
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Lan Lobby menu window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType LanLobbyMenuSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- UnicodeString txtInput;
-
- switch( msg )
- {
-
-
- case GWM_CREATE:
- {
- SignalUIInteraction(SHELL_SCRIPT_HOOK_LAN_OPENED);
- break;
- }
-
- case GWM_DESTROY:
- {
- SignalUIInteraction(SHELL_SCRIPT_HOOK_LAN_CLOSED);
- break;
- }
-
- case GWM_INPUT_FOCUS:
- {
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- return MSG_HANDLED;
- }
- case GLM_DOUBLE_CLICKED:
- {
- if (LANbuttonPushed)
- break;
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
- if( controlID == listboxGamesID )
- {
- int rowSelected = mData2;
-
- if (rowSelected >= 0)
- {
- LANGameInfo * theGame = TheLAN->LookupGameByListOffset(rowSelected);
- if (theGame)
- {
- TheLAN->RequestGameJoin(theGame);
- }
- }
- }
- break;
- }
- case GLM_SELECTED:
- {
- if (LANbuttonPushed)
- break;
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
- if( controlID == listboxGamesID )
- {
- int rowSelected = mData2;
- if( rowSelected < 0 )
- {
- HideGameInfoWindow(TRUE);
- break;
- }
- LANGameInfo * theGame = TheLAN->LookupGameByListOffset(rowSelected);
- if (theGame)
- RefreshGameInfoWindow(theGame, theGame->getName());
- else
- HideGameInfoWindow(TRUE);
-
- }
- break;
- }
- case GBM_SELECTED:
- {
- if (LANbuttonPushed)
- break;
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if ( controlID == buttonBackID )
- {
- //shellmapOn = TRUE;
- LANbuttonPushed = true;
- DEBUG_LOG(("Back was hit - popping to main menu"));
- TheShell->pop();
- delete TheLAN;
- TheLAN = nullptr;
- //TheTransitionHandler->reverse("LanLobbyFade");
-
- }
- else if ( controlID == buttonHostID )
- {
- TheLAN->RequestGameCreate( L"", FALSE);
-
- }
- else if ( controlID == buttonClearID )
- {
- GadgetTextEntrySetText(textEntryPlayerName, UnicodeString::TheEmptyString);
- TheWindowManager->winSendSystemMsg( window,
- GEM_UPDATE_TEXT,
- (WindowMsgData)textEntryPlayerName,
- 0 );
-
- }
- else if ( controlID == buttonJoinID )
- {
-
- //TheShell->push( "Menus/LanGameOptionsMenu.wnd" );
-
- int rowSelected = -1;
- GadgetListBoxGetSelected( listboxGames, &rowSelected );
-
- if (rowSelected >= 0)
- {
- LANGameInfo * theGame = TheLAN->LookupGameByListOffset(rowSelected);
- if (theGame)
- {
- TheLAN->RequestGameJoin(theGame);
- }
- }
- else
- {
- GadgetListBoxAddEntryText(listboxChatWindow, TheGameText->fetch("LAN:ErrorNoGameSelected") , chatSystemColor, -1, 0);
- }
-
- }
- else if ( controlID == buttonEmoteID )
- {
- // read the user's input
- txtInput.set(GadgetTextEntryGetText( textEntryChat ));
- // Clear the text entry line
- GadgetTextEntrySetText(textEntryChat, UnicodeString::TheEmptyString);
- // Clean up the text (remove leading/trailing chars, etc)
- txtInput.trim();
- // Echo the user's input to the chat window
- if (!txtInput.isEmpty()) {
-// TheLAN->RequestChat(txtInput, LANAPIInterface::LANCHAT_EMOTE);
- TheLAN->RequestChat(txtInput, LANAPIInterface::LANCHAT_NORMAL);
- }
- }
- else if (controlID == buttonDirectConnectID)
- {
- TheLAN->RequestLobbyLeave( false );
- TheShell->push("Menus/NetworkDirectConnect.wnd");
- }
-
- break;
- }
-
- case GEM_UPDATE_TEXT:
- {
- if (LANbuttonPushed)
- break;
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if ( controlID == textEntryPlayerNameID )
- {
- // grab the user's name
- txtInput.set(GadgetTextEntryGetText( textEntryPlayerName ));
-
- // Clean up the text (remove leading/trailing chars, etc)
- const WideChar *c = txtInput.str();
- while (c && (iswspace(*c)))
- c++;
-
- if (c)
- txtInput = UnicodeString(c);
- else
- txtInput = UnicodeString::TheEmptyString;
-
- txtInput.truncateTo(g_lanPlayerNameLength);
-
- if (!txtInput.isEmpty() && txtInput.getCharAt(txtInput.getLength()-1) == L',')
- txtInput.removeLastChar(); // we use , for strtok's so we can't allow them in names. :(
-
- if (!txtInput.isEmpty() && txtInput.getCharAt(txtInput.getLength()-1) == L':')
- txtInput.removeLastChar(); // we use : for strtok's so we can't allow them in names. :(
-
- if (!txtInput.isEmpty() && txtInput.getCharAt(txtInput.getLength()-1) == L';')
- txtInput.removeLastChar(); // we use ; for strtok's so we can't allow them in names. :(
-
- // send it over the network
- if (!txtInput.isEmpty())
- TheLAN->RequestSetName(txtInput);
- else
- {
- TheLAN->RequestSetName(defaultName);
- }
-
- // Put the whitespace-free version in the box
- GadgetTextEntrySetText( textEntryPlayerName, txtInput );
-
- }
- break;
- }
- case GEM_EDIT_DONE:
- {
- if (LANbuttonPushed)
- break;
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- // Take the user's input and echo it into the chat window as well as
- // send it to the other clients on the lan
- if ( controlID == textEntryChatID )
- {
-
- // read the user's input
- txtInput.set(GadgetTextEntryGetText( textEntryChat ));
- // Clear the text entry line
- GadgetTextEntrySetText(textEntryChat, UnicodeString::TheEmptyString);
- // Clean up the text (remove leading/trailing chars, etc)
- while (!txtInput.isEmpty() && iswspace(txtInput.getCharAt(0)))
- txtInput = UnicodeString(txtInput.str()+1);
-
- // Echo the user's input to the chat window
- if (!txtInput.isEmpty())
- TheLAN->RequestChat(txtInput, LANAPIInterface::LANCHAT_NORMAL);
-
- }
- /*
- else if ( controlID == textEntryPlayerNameID )
- {
- // grab the user's name
- txtInput.set(GadgetTextEntryGetText( textEntryPlayerName ));
-
- // Clean up the text (remove leading/trailing chars, etc)
- txtInput.trim();
-
- // send it over the network
- if (!txtInput.isEmpty())
- TheLAN->RequestSetName(txtInput);
-
- // Put the whitespace-free version in the box
- GadgetTextEntrySetText( textEntryPlayerName, txtInput );
-
- }
- */
- break;
- }
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp
deleted file mode 100644
index 87dfe8b7b51..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp
+++ /dev/null
@@ -1,462 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: LanMapSelectMenu.cpp ////////////////////////////////////////////////////////////////////////
-// Author: Colin Day, October 2001
-// Description: MapSelect menu window callbacks
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/GameEngine.h"
-#include "Common/NameKeyGenerator.h"
-#include "Common/MessageStream.h"
-#include "Common/UserPreferences.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/Shell.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetListBox.h"
-#include "GameClient/GadgetRadioButton.h"
-#include "GameNetwork/LANAPICallbacks.h"
-#include "GameClient/MapUtil.h"
-#include "GameNetwork/GUIUtil.h"
-
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
-static NameKeyType buttonBack = NAMEKEY_INVALID;
-static NameKeyType buttonOK = NAMEKEY_INVALID;
-static NameKeyType listboxMap = NAMEKEY_INVALID;
-static NameKeyType winMapPreviewID = NAMEKEY_INVALID;
-static GameWindow *parent = nullptr;
-static GameWindow *mapList = nullptr;
-static GameWindow *winMapPreview = nullptr;
-static NameKeyType radioButtonSystemMapsID = NAMEKEY_INVALID;
-static NameKeyType radioButtonUserMapsID = NAMEKEY_INVALID;
-
-static GameWindow *buttonMapStartPosition[MAX_SLOTS] = {0};
-static NameKeyType buttonMapStartPositionID[MAX_SLOTS] = { NAMEKEY_INVALID,NAMEKEY_INVALID,
- NAMEKEY_INVALID,NAMEKEY_INVALID,
- NAMEKEY_INVALID,NAMEKEY_INVALID,
- NAMEKEY_INVALID,NAMEKEY_INVALID };
-
-
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////////////////////////
-void positionStartSpots( AsciiString mapName, GameWindow *buttonMapStartPositions[], GameWindow *mapWindow);
-static const char *layoutFilename = "LanGameOptionsMenu.wnd";
-static const char *parentName = "LanGameOptionsMenuParent";
-static const char *gadgetsToHide[] =
-{
- "MapWindow",
- //"StaticTextTitle",
- "StaticTextTeam",
- "StaticTextFaction",
- "StaticTextColor",
- "TextEntryMapDisplay",
- "ButtonSelectMap",
- "ButtonStart",
- "StaticTextMapPreview",
-
- nullptr
-};
-static const char *perPlayerGadgetsToHide[] =
-{
- "ComboBoxTeam",
- "ComboBoxColor",
- "ComboBoxPlayerTemplate",
- nullptr
-};
-
-static void showLANGameOptionsUnderlyingGUIElements( Bool show )
-{
- ShowUnderlyingGUIElements( show, layoutFilename, parentName, gadgetsToHide, perPlayerGadgetsToHide );
- GameWindow *win = TheWindowManager->winGetWindowFromId( nullptr, TheNameKeyGenerator->nameToKey("LanGameOptionsMenu.wnd:ButtonBack") );
- if(win)
- win->winEnable( show );
-
-}
-
-static void NullifyControls()
-{
- parent = nullptr;
- mapList = nullptr;
- if (winMapPreview)
- {
- winMapPreview->winSetUserData(nullptr);
- winMapPreview = nullptr;
- }
- for (Int i=0; inameToKey( "LanMapSelectMenu.wnd:LanMapSelectMenuParent" );
- parent = TheWindowManager->winGetWindowFromId( nullptr, parentID );
-
- TheWindowManager->winSetFocus( parent );
-
- LANPreferences pref;
- Bool usesSystemMapDir = pref.usesSystemMapDir();
-
- const MapMetaData *mmd = TheMapCache->findMap(TheLAN->GetMyGame()->getMap());
- if (mmd)
- {
- usesSystemMapDir = mmd->m_isOfficial;
- }
-
-
- buttonBack = TheNameKeyGenerator->nameToKey( "LanMapSelectMenu.wnd:ButtonBack" );
- buttonOK = TheNameKeyGenerator->nameToKey( "LanMapSelectMenu.wnd:ButtonOK" );
- listboxMap = TheNameKeyGenerator->nameToKey( "LanMapSelectMenu.wnd:ListboxMap" );
- winMapPreviewID = TheNameKeyGenerator->nameToKey( "LanMapSelectMenu.wnd:WinMapPreview" );
-
- radioButtonSystemMapsID = TheNameKeyGenerator->nameToKey( "LanMapSelectMenu.wnd:RadioButtonSystemMaps" );
- radioButtonUserMapsID = TheNameKeyGenerator->nameToKey( "LanMapSelectMenu.wnd:RadioButtonUserMaps" );
- GameWindow *radioButtonSystemMaps = TheWindowManager->winGetWindowFromId( parent, radioButtonSystemMapsID );
- GameWindow *radioButtonUserMaps = TheWindowManager->winGetWindowFromId( parent, radioButtonUserMapsID );
- winMapPreview = TheWindowManager->winGetWindowFromId(parent, winMapPreviewID);
- if (usesSystemMapDir)
- GadgetRadioSetSelection( radioButtonSystemMaps, FALSE );
- else
- GadgetRadioSetSelection( radioButtonUserMaps, FALSE );
-
- AsciiString tmpString;
- for (Int i = 0; i < MAX_SLOTS; i++)
- {
- tmpString.format("LanMapSelectMenu.wnd:ButtonMapStartPosition%d", i);
- buttonMapStartPositionID[i] = TheNameKeyGenerator->nameToKey( tmpString );
- buttonMapStartPosition[i] = TheWindowManager->winGetWindowFromId( winMapPreview, buttonMapStartPositionID[i] );
- DEBUG_ASSERTCRASH(buttonMapStartPosition[i], ("Could not find the ButtonMapStartPosition[%d]",i ));
- buttonMapStartPosition[i]->winHide(TRUE);
- buttonMapStartPosition[i]->winEnable(FALSE);
- }
-
- // get the listbox window
- NameKeyType mapListID = TheNameKeyGenerator->nameToKey( "LanMapSelectMenu.wnd:ListboxMap" );
- mapList = TheWindowManager->winGetWindowFromId( parent, mapListID );
- if( mapList )
- {
- if (TheMapCache)
- TheMapCache->updateCache();
- populateMapListbox( mapList, usesSystemMapDir, TRUE, TheLAN->GetMyGame()->getMap() );
- }
-}
-
-//-------------------------------------------------------------------------------------------------
-/** MapSelect menu shutdown method */
-//-------------------------------------------------------------------------------------------------
-void LanMapSelectMenuShutdown( WindowLayout *layout, void *userData )
-{
-
- // hide menu
- layout->hide( TRUE );
-
- NullifyControls();
-
- // our shutdown is complete
- TheShell->shutdownComplete( layout );
-}
-
-//-------------------------------------------------------------------------------------------------
-/** MapSelect menu update method */
-//-------------------------------------------------------------------------------------------------
-void LanMapSelectMenuUpdate( WindowLayout *layout, void *userData )
-{
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Map select menu input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType LanMapSelectMenuInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
- NameKeyType buttonID = TheNameKeyGenerator->nameToKey( "LanMapSelectMenu.wnd:ButtonBack" );
- GameWindow *button = TheWindowManager->winGetWindowFromId( window, buttonID );
-
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)button, buttonID );
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** MapSelect menu window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType LanMapSelectMenuSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- GameWindow *mapWindow = nullptr;
- if (listboxMap != NAMEKEY_INVALID)
- {
- mapWindow = TheWindowManager->winGetWindowFromId( parent, listboxMap );
- }
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CREATE:
- {
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GWM_DESTROY:
- {
- NullifyControls();
-
- break;
-
- }
-
- // --------------------------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- return MSG_HANDLED;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GLM_DOUBLE_CLICKED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
- if( controlID == listboxMap )
- {
- int rowSelected = mData2;
-
- if (rowSelected >= 0)
- {
- GadgetListBoxSetSelected( control, rowSelected );
- GameWindow *button = TheWindowManager->winGetWindowFromId( window, buttonOK );
-
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)button, buttonOK );
- }
- }
- break;
- }
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if ( controlID == radioButtonSystemMapsID )
- {
- if (TheMapCache)
- TheMapCache->updateCache();
- populateMapListbox( mapList, TRUE, TRUE, TheLAN->GetMyGame()->getMap() );
- LANPreferences pref;
- pref["UseSystemMapDir"] = "yes";
- pref.write();
- }
- else if ( controlID == radioButtonUserMapsID )
- {
- if (TheMapCache)
- TheMapCache->updateCache();
- populateMapListbox( mapList, FALSE, TRUE, TheLAN->GetMyGame()->getMap() );
- LANPreferences pref;
- pref["UseSystemMapDir"] = "no";
- pref.write();
- }
- else if ( controlID == buttonBack )
- {
-
- if (mapSelectLayout)
- {
- mapSelectLayout->destroyWindows();
- deleteInstance(mapSelectLayout);
- mapSelectLayout = nullptr;
- }
-
- // set the controls to nullptr since they've been destroyed.
- NullifyControls();
- showLANGameOptionsUnderlyingGUIElements(TRUE);
- PostToLanGameOptions( MAP_BACK );
- }
- else if ( controlID == buttonOK )
- {
- Int selected = -1;
- UnicodeString map;
-
- // get the selected index
- if (mapWindow != nullptr)
- {
- GadgetListBoxGetSelected( mapWindow, &selected );
- }
-
- if( selected != -1 )
- {
- // get text of the map to load
- map = GadgetListBoxGetText( mapWindow, selected, 0 );
-
- // set the map name in the global data map name
- AsciiString asciiMap;
- const char *mapFname = (const char *)GadgetListBoxGetItemData( mapWindow, selected );
- DEBUG_ASSERTCRASH(mapFname, ("No map item data"));
- if (mapFname)
- asciiMap = mapFname;
- else
- asciiMap.translate( map );
- TheLAN->GetMyGame()->setMap( asciiMap );
- asciiMap.toLower();
- std::map::iterator it = TheMapCache->find(asciiMap);
- if (it != TheMapCache->end())
- {
- TheLAN->GetMyGame()->getSlot(0)->setMapAvailability(true);
- TheLAN->GetMyGame()->setMapCRC( it->second.m_CRC );
- TheLAN->GetMyGame()->setMapSize( it->second.m_filesize );
-
- TheLAN->GetMyGame()->resetStartSpots();
- TheLAN->GetMyGame()->adjustSlotsForMap(); // BGC- adjust the slots for the new map.
- }
-
-
- if (mapSelectLayout)
- {
- mapSelectLayout->destroyWindows();
- deleteInstance(mapSelectLayout);
- mapSelectLayout = nullptr;
- }
-
- // set the controls to nullptr since they've been destroyed.
- NullifyControls();
-
- showLANGameOptionsUnderlyingGUIElements(TRUE);
- PostToLanGameOptions(SEND_GAME_OPTS);
-
- }
- }
-
- break;
-
- }
-
- case GLM_SELECTED:
- {
-
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
- if( controlID == listboxMap )
- {
- int rowSelected = mData2;
- if( rowSelected < 0 )
- {
- positionStartSpots( AsciiString::TheEmptyString, buttonMapStartPosition, winMapPreview);
-// winMapPreview->winClearStatus(WIN_STATUS_IMAGE);
- break;
- }
- winMapPreview->winSetStatus(WIN_STATUS_IMAGE);
- UnicodeString map;
- // get text of the map to load
- map = GadgetListBoxGetText( mapWindow, rowSelected, 0 );
-
- // set the map name in the global data map name
- AsciiString asciiMap;
- const char *mapFname = (const char *)GadgetListBoxGetItemData( mapWindow, rowSelected );
- DEBUG_ASSERTCRASH(mapFname, ("No map item data"));
- if (mapFname)
- asciiMap = mapFname;
- else
- asciiMap.translate( map );
- asciiMap.toLower();
- Image *image = getMapPreviewImage(asciiMap);
- winMapPreview->winSetUserData((void *)TheMapCache->findMap(asciiMap));
- if(image)
- {
- winMapPreview->winSetEnabledImage(0, image);
- }
- else
- {
- winMapPreview->winClearStatus(WIN_STATUS_IMAGE);
- }
- positionStartSpots( asciiMap, buttonMapStartPosition, winMapPreview);
- }
- break;
- }
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp
deleted file mode 100644
index 1412088c582..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp
+++ /dev/null
@@ -1,527 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////////////
-// FILE: NetworkDirectConnect.cpp
-// Author: Bryan Cleveland, November 2001
-// Description: Lan Lobby Menu
-///////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "gamespy/peer/peer.h"
-
-#include "Common/QuotedPrintable.h"
-#include "Common/OptionPreferences.h"
-#include "GameClient/AnimateWindowManager.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GameText.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetComboBox.h"
-#include "GameClient/GadgetTextEntry.h"
-#include "GameClient/GadgetStaticText.h"
-#include "GameClient/Shell.h"
-#include "GameClient/GameWindowTransitions.h"
-
-#include "GameNetwork/IPEnumeration.h"
-#include "GameNetwork/LANAPI.h"
-#include "GameNetwork/LANAPICallbacks.h"
-
-
-// window ids ------------------------------------------------------------------------------
-
-// Window Pointers ------------------------------------------------------------------------
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
-
-extern Bool LANbuttonPushed;
-extern Bool LANisShuttingDown;
-
-static Bool isShuttingDown = false;
-static Bool buttonPushed = false;
-
-static NameKeyType buttonBackID = NAMEKEY_INVALID;
-static NameKeyType buttonHostID = NAMEKEY_INVALID;
-static NameKeyType buttonJoinID = NAMEKEY_INVALID;
-static NameKeyType editPlayerNameID = NAMEKEY_INVALID;
-static NameKeyType comboboxRemoteIPID = NAMEKEY_INVALID;
-static NameKeyType staticLocalIPID = NAMEKEY_INVALID;
-
-static GameWindow *buttonBack = nullptr;
-static GameWindow *buttonHost = nullptr;
-static GameWindow *buttonJoin = nullptr;
-static GameWindow *editPlayerName = nullptr;
-static GameWindow *comboboxRemoteIP = nullptr;
-static GameWindow *staticLocalIP = nullptr;
-
-void PopulateRemoteIPComboBox()
-{
- LANPreferences userprefs;
- GadgetComboBoxReset(comboboxRemoteIP);
-
- Int numRemoteIPs = userprefs.getNumRemoteIPs();
- Color white = GameMakeColor(255,255,255,255);
-
- for (Int i = 0; i < numRemoteIPs; ++i)
- {
- UnicodeString entry;
- entry = userprefs.getRemoteIPEntry(i);
- GadgetComboBoxAddEntry(comboboxRemoteIP, entry, white);
- }
-
- if (numRemoteIPs > 0)
- {
- GadgetComboBoxSetSelectedPos(comboboxRemoteIP, 0, TRUE);
- }
- userprefs.write();
-}
-
-void UpdateRemoteIPList()
-{
- Int n1[4], n2[4];
- LANPreferences prefs;
- Int numEntries = GadgetComboBoxGetLength(comboboxRemoteIP);
- Int currentSelection = -1;
- GadgetComboBoxGetSelectedPos(comboboxRemoteIP, ¤tSelection);
- UnicodeString unisel = GadgetComboBoxGetText(comboboxRemoteIP);
- AsciiString sel;
- sel.translate(unisel);
-
-// UnicodeString newEntry = prefs.getRemoteIPEntry(0);
- UnicodeString newEntry = unisel;
- UnicodeString newIP;
- newEntry.nextToken(&newIP, L":");
- Int numFields = swscanf(newIP.str(), L"%d.%d.%d.%d", &(n1[0]), &(n1[1]), &(n1[2]), &(n1[3]));
-
- if (numFields != 4) {
- // this is not a properly formatted IP, don't change a thing.
- return;
- }
-
- prefs["RemoteIP0"] = sel;
-
- Int currentINIEntry = 1;
-
- for (Int i = 0; i < numEntries; ++i)
- {
- if (i != currentSelection)
- {
- GadgetComboBoxSetSelectedPos(comboboxRemoteIP, i, FALSE);
- UnicodeString uni;
- uni = GadgetComboBoxGetText(comboboxRemoteIP);
- AsciiString ascii;
- ascii.translate(uni);
-
- // prevent more than one copy of an IP address from being put in the list.
- if (currentSelection == -1)
- {
- UnicodeString oldEntry = uni;
- UnicodeString oldIP;
- oldEntry.nextToken(&oldIP, L":");
-
- swscanf(oldIP.str(), L"%d.%d.%d.%d", &(n2[0]), &(n2[1]), &(n2[2]), &(n2[3]));
-
- Bool isEqual = TRUE;
- for (Int i = 0; (i < 4) && (isEqual == TRUE); ++i) {
- if (n1[i] != n2[i]) {
- isEqual = FALSE;
- }
- }
- // check to see if this is a duplicate or if this is not a properly formatted IP address.
- if (isEqual == TRUE)
- {
- --numEntries;
- continue;
- }
- }
- AsciiString temp;
- temp.format("RemoteIP%d", currentINIEntry);
- ++currentINIEntry;
- prefs[temp.str()] = ascii;
- }
- }
-
- if (currentSelection == -1)
- {
- ++numEntries;
- }
-
- AsciiString numRemoteIPs;
- numRemoteIPs.format("%d", numEntries);
-
- prefs["NumRemoteIPs"] = numRemoteIPs;
-
- prefs.write();
-}
-
-void HostDirectConnectGame()
-{
- // Init LAN API Singleton
- DEBUG_ASSERTCRASH(TheLAN != nullptr, ("TheLAN is null!"));
- if (!TheLAN)
- {
- TheLAN = NEW LANAPI();
- }
-
- UnsignedInt localIP = TheLAN->GetLocalIP();
- UnicodeString localIPString;
- localIPString.format(L"%d.%d.%d.%d", PRINTF_IP_AS_4_INTS(localIP));
-
- UnicodeString name;
- name = GadgetTextEntryGetText(editPlayerName);
-
- LANPreferences prefs;
- prefs["UserName"] = UnicodeStringToQuotedPrintable(name);
- prefs.write();
-
- name.truncateTo(g_lanPlayerNameLength);
- TheLAN->RequestSetName(name);
- TheLAN->RequestGameCreate(localIPString, TRUE);
-}
-
-void JoinDirectConnectGame()
-{
- // Init LAN API Singleton
-
- if (!TheLAN)
- {
- TheLAN = NEW LANAPI();
- }
-
- UnsignedInt ipaddress = 0;
- UnicodeString ipunistring = GadgetComboBoxGetText(comboboxRemoteIP);
- AsciiString asciientry;
- asciientry.translate(ipunistring);
-
- AsciiString ipstring;
- asciientry.nextToken(&ipstring, "(");
-
- Int ip1, ip2, ip3, ip4;
- Int numFields = sscanf(ipstring.str(), "%d.%d.%d.%d", &ip1, &ip2, &ip3, &ip4);
- (void)numFields; DEBUG_ASSERTCRASH(numFields == 4, ("JoinDirectConnectGame - invalid IP address format: %s", ipstring.str()));
-
- DEBUG_LOG(("JoinDirectConnectGame - joining at %d.%d.%d.%d", ip1, ip2, ip3, ip4));
-
- ipaddress = (ip1 << 24) + (ip2 << 16) + (ip3 << 8) + ip4;
-// ipaddress = htonl(ipaddress);
-
- UnicodeString name;
- name = GadgetTextEntryGetText(editPlayerName);
-
- LANPreferences prefs;
- prefs["UserName"] = UnicodeStringToQuotedPrintable(name);
- prefs.write();
-
- UpdateRemoteIPList();
- PopulateRemoteIPComboBox();
-
- name.truncateTo(g_lanPlayerNameLength);
- TheLAN->RequestSetName(name);
-
- TheLAN->RequestGameJoinDirectConnect(ipaddress);
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the WOL Welcome Menu */
-//-------------------------------------------------------------------------------------------------
-void NetworkDirectConnectInit( WindowLayout *layout, void *userData )
-{
- LANbuttonPushed = false;
- LANisShuttingDown = false;
-
- if (TheLAN == nullptr)
- {
- TheLAN = NEW LANAPI();
- TheLAN->init();
- }
- TheLAN->reset();
-
- buttonPushed = false;
- isShuttingDown = false;
- TheShell->showShellMap(TRUE);
- buttonBackID = TheNameKeyGenerator->nameToKey( "NetworkDirectConnect.wnd:ButtonBack" );
- buttonHostID = TheNameKeyGenerator->nameToKey( "NetworkDirectConnect.wnd:ButtonHost" );
- buttonJoinID = TheNameKeyGenerator->nameToKey( "NetworkDirectConnect.wnd:ButtonJoin" );
- editPlayerNameID = TheNameKeyGenerator->nameToKey( "NetworkDirectConnect.wnd:EditPlayerName" );
- comboboxRemoteIPID = TheNameKeyGenerator->nameToKey( "NetworkDirectConnect.wnd:ComboboxRemoteIP" );
- staticLocalIPID = TheNameKeyGenerator->nameToKey( "NetworkDirectConnect.wnd:StaticLocalIP" );
-
- buttonBack = TheWindowManager->winGetWindowFromId( nullptr, buttonBackID);
- buttonHost = TheWindowManager->winGetWindowFromId( nullptr, buttonHostID);
- buttonJoin = TheWindowManager->winGetWindowFromId( nullptr, buttonJoinID);
- editPlayerName = TheWindowManager->winGetWindowFromId( nullptr, editPlayerNameID);
- comboboxRemoteIP = TheWindowManager->winGetWindowFromId( nullptr, comboboxRemoteIPID);
- staticLocalIP = TheWindowManager->winGetWindowFromId( nullptr, staticLocalIPID);
-
-// // animate controls
-// TheShell->registerWithAnimateManager(buttonBack, WIN_ANIMATION_SLIDE_LEFT, TRUE, 800);
-// TheShell->registerWithAnimateManager(buttonHost, WIN_ANIMATION_SLIDE_LEFT, TRUE, 600);
-// TheShell->registerWithAnimateManager(buttonJoin, WIN_ANIMATION_SLIDE_LEFT, TRUE, 200);
-//
- LANPreferences userprefs;
- UnicodeString name;
- name = userprefs.getUserName();
-
- if (name.isEmpty())
- {
- name = TheGameText->fetch("GUI:Player");
- }
-
- GadgetTextEntrySetText(editPlayerName, name);
-
- PopulateRemoteIPComboBox();
-
- UnicodeString ipstr;
-
- delete TheLAN;
- TheLAN = nullptr;
-
- if (TheLAN == nullptr) {
-// DEBUG_ASSERTCRASH(TheLAN != nullptr, ("TheLAN is null initializing the direct connect screen."));
- TheLAN = NEW LANAPI();
-
- OptionPreferences prefs;
- UnsignedInt IP = prefs.getOnlineIPAddress();
-
- IPEnumeration IPs;
-
-// if (!IP)
-// {
- EnumeratedIP *IPlist = IPs.getAddresses();
- DEBUG_ASSERTCRASH(IPlist, ("No IP addresses found!"));
- if (!IPlist)
- {
- /// @todo: display error and exit lan lobby if no IPs are found
- }
-
- Bool foundIP = FALSE;
- EnumeratedIP *tempIP = IPlist;
- while ((tempIP != nullptr) && (foundIP == FALSE)) {
- if (IP == tempIP->getIP()) {
- foundIP = TRUE;
- }
- tempIP = tempIP->getNext();
- }
-
- if (foundIP == FALSE) {
- // The IP that we had no longer exists, we need to pick a new one.
- IP = IPlist->getIP();
- }
-
-// IP = IPlist->getIP();
-// }
- TheLAN->init();
- TheLAN->SetLocalIP(IP);
- }
-
- UnsignedInt ip = TheLAN->GetLocalIP();
- ipstr.format(L"%d.%d.%d.%d", PRINTF_IP_AS_4_INTS(ip));
- GadgetStaticTextSetText(staticLocalIP, ipstr);
-
- TheLAN->RequestLobbyLeave(true);
- layout->hide(FALSE);
- layout->bringForward();
- TheTransitionHandler->setGroup("NetworkDirectConnectFade");
-
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** This is called when a shutdown is complete for this menu */
-//-------------------------------------------------------------------------------------------------
-static void shutdownComplete( WindowLayout *layout )
-{
-
- isShuttingDown = false;
-
- // hide the layout
- layout->hide( TRUE );
-
- // our shutdown is complete
- TheShell->shutdownComplete( layout );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Welcome Menu shutdown method */
-//-------------------------------------------------------------------------------------------------
-void NetworkDirectConnectShutdown( WindowLayout *layout, void *userData )
-{
- isShuttingDown = true;
-
- // if we are shutting down for an immediate pop, skip the animations
- Bool popImmediate = *(Bool *)userData;
- if( popImmediate )
- {
-
- shutdownComplete( layout );
- return;
-
- }
-
- TheShell->reverseAnimatewindow();
-
- TheTransitionHandler->reverse("NetworkDirectConnectFade");
-}
-
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Welcome Menu update method */
-//-------------------------------------------------------------------------------------------------
-void NetworkDirectConnectUpdate( WindowLayout * layout, void *userData)
-{
- // We'll only be successful if we've requested to
- if(isShuttingDown && TheShell->isAnimFinished() && TheTransitionHandler->isFinished())
- shutdownComplete(layout);
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Welcome Menu input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType NetworkDirectConnectInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
- if (buttonPushed)
- break;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)buttonBack, buttonBackID );
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Welcome Menu window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType NetworkDirectConnectSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- UnicodeString txtInput;
-
- switch( msg )
- {
-
-
- case GWM_CREATE:
- {
-
- break;
- }
-
- case GWM_DESTROY:
- {
- break;
- }
-
- case GWM_INPUT_FOCUS:
- {
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- return MSG_HANDLED;
- }
-
- case GBM_SELECTED:
- {
- if (buttonPushed)
- break;
-
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if ( controlID == buttonBackID )
- {
- UnicodeString name;
- name = GadgetTextEntryGetText(editPlayerName);
-
- LANPreferences prefs;
- prefs["UserName"] = UnicodeStringToQuotedPrintable(name);
- prefs.write();
-
- name.truncateTo(g_lanPlayerNameLength);
- TheLAN->RequestSetName(name);
-
- buttonPushed = true;
- LANbuttonPushed = true;
- TheShell->pop();
- }
- else if (controlID == buttonHostID)
- {
- HostDirectConnectGame();
- }
- else if (controlID == buttonJoinID)
- {
- JoinDirectConnectGame();
- }
- break;
- }
-
- case GEM_EDIT_DONE:
- {
- break;
- }
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp
deleted file mode 100644
index 1a4cb024866..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp
+++ /dev/null
@@ -1,207 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: PopupCommunicator.cpp /////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: PopupCommunicator.cpp
-//
-// Created: Chris Brue, July 2002
-//
-// Desc: Electronic Arts instant messaging system
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "GameClient/GUICallbacks.h"
-#include "GameClient/GameWindowManager.h"
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
-static NameKeyType buttonOkID = NAMEKEY_INVALID;
-static GameWindow *buttonOk = nullptr;
-static GameWindow *parent = nullptr;
-
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////////////////////////
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the Popup Communicator */
-//-------------------------------------------------------------------------------------------------
-void PopupCommunicatorInit( WindowLayout *layout, void *userData )
-{
-
- //set keyboard focus to main parent and set modal
- NameKeyType parentID = TheNameKeyGenerator->nameToKey("PopupCommunicator.wnd:PopupCommunicator");
- parent = TheWindowManager->winGetWindowFromId( nullptr, parentID );
- TheWindowManager->winSetFocus( parent );
- TheWindowManager->winSetModal( parent );
-
- // get ids for our children controls
- buttonOkID = TheNameKeyGenerator->nameToKey( "PopupCommunicator.wnd:ButtonOk" );
- buttonOk = TheWindowManager->winGetWindowFromId( parent, buttonOkID );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Popup Communicator shutdown method */
-//-------------------------------------------------------------------------------------------------
-void PopupCommunicatorShutdown( WindowLayout *layout, void *userData )
-{
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Popup Communicator update method */
-//-------------------------------------------------------------------------------------------------
-void PopupcommunicatorUpdate( WindowLayout *layout, void *userData )
-{
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Popup Communicator input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType PopupCommunicatorInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
-
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)buttonOk, buttonOkID );
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Popup Communicator window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType PopupCommunicatorSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CREATE:
- {
-
- break;
-
- }
- //---------------------------------------------------------------------------------------------
- case GWM_DESTROY:
- {
-
- break;
-
- }
-
- //----------------------------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- break;
-
- }
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if( controlID == buttonOkID )
- {
- WindowLayout *popupCommunicatorLayout = window->winGetLayout();
- if (popupCommunicatorLayout)
- {
- popupCommunicatorLayout->destroyWindows();
- deleteInstance(popupCommunicatorLayout);
- popupCommunicatorLayout = nullptr;
- }
- }
-
- break;
-
- }
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp
deleted file mode 100644
index 193183b0665..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp
+++ /dev/null
@@ -1,263 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: PopupJoinGame.cpp /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Jul 2002
-//
-// Filename: PopupJoinGame.cpp
-//
-// author: Matthew D. Campbell
-//
-// purpose: Contains the Callbacks for the Join Game Popup
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/GlobalData.h"
-#include "Common/NameKeyGenerator.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GadgetTextEntry.h"
-#include "GameClient/GadgetStaticText.h"
-#include "GameNetwork/GameSpy/PeerDefs.h"
-#include "GameNetwork/GameSpy/PeerThread.h"
-#include "GameNetwork/GameSpyOverlay.h"
-
-
-//-----------------------------------------------------------------------------
-// DEFINES ////////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-static NameKeyType parentPopupID = NAMEKEY_INVALID;
-static NameKeyType textEntryGamePasswordID = NAMEKEY_INVALID;
-static NameKeyType buttonCancelID = NAMEKEY_INVALID;
-
-static GameWindow *parentPopup = nullptr;
-static GameWindow *textEntryGamePassword = nullptr;
-
-static void joinGame( AsciiString password );
-
-//-----------------------------------------------------------------------------
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the PopupHostGameInit menu */
-//-------------------------------------------------------------------------------------------------
-void PopupJoinGameInit( WindowLayout *layout, void *userData )
-{
- parentPopupID = TheNameKeyGenerator->nameToKey("PopupJoinGame.wnd:ParentJoinPopUp");
- parentPopup = TheWindowManager->winGetWindowFromId(nullptr, parentPopupID);
-
- textEntryGamePasswordID = TheNameKeyGenerator->nameToKey("PopupJoinGame.wnd:TextEntryGamePassword");
- textEntryGamePassword = TheWindowManager->winGetWindowFromId(parentPopup, textEntryGamePasswordID);
- GadgetTextEntrySetText(textEntryGamePassword, UnicodeString::TheEmptyString);
-
- NameKeyType staticTextGameNameID = TheNameKeyGenerator->nameToKey("PopupJoinGame.wnd:StaticTextGameName");
- GameWindow *staticTextGameName = TheWindowManager->winGetWindowFromId(parentPopup, staticTextGameNameID);
- GadgetStaticTextSetText(staticTextGameName, UnicodeString::TheEmptyString);
-
- buttonCancelID = NAMEKEY("PopupJoinGame.wnd:ButtonCancel");
-
- GameSpyStagingRoom *ourRoom = TheGameSpyInfo->findStagingRoomByID(TheGameSpyInfo->getCurrentStagingRoomID());
- if (ourRoom)
- GadgetStaticTextSetText(staticTextGameName, ourRoom->getGameName());
-
- TheWindowManager->winSetFocus( parentPopup );
- TheWindowManager->winSetModal( parentPopup );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** PopupHostGameInput callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType PopupJoinGameInput( GameWindow *window, UnsignedInt msg, WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
-// if (buttonPushed)
-// break;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
- GameSpyCloseOverlay(GSOVERLAY_GAMEPASSWORD);
- SetLobbyAttemptHostJoin( FALSE );
- parentPopup = nullptr;
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** PopupHostGameSystem callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType PopupJoinGameSystem( GameWindow *window, UnsignedInt msg, WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CREATE:
- {
-
- break;
-
- }
- //---------------------------------------------------------------------------------------------
- case GWM_DESTROY:
- {
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
- if (controlID == buttonCancelID)
- {
- GameSpyCloseOverlay(GSOVERLAY_GAMEPASSWORD);
- SetLobbyAttemptHostJoin( FALSE );
- parentPopup = nullptr;
- }
- break;
- }
-
- //----------------------------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- break;
-
- }
- //---------------------------------------------------------------------------------------------
- case GEM_EDIT_DONE:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if( controlID == textEntryGamePasswordID )
- {
- // read the user's input and clear the entry box
- UnicodeString txtInput;
- txtInput.set(GadgetTextEntryGetText( textEntryGamePassword ));
- GadgetTextEntrySetText(textEntryGamePassword, UnicodeString::TheEmptyString);
- txtInput.trim();
- if (!txtInput.isEmpty())
- {
- AsciiString munkee;
- munkee.translate(txtInput);
- joinGame(munkee);
- }
- }
- break;
- }
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-
-//-----------------------------------------------------------------------------
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-static void joinGame( AsciiString password )
-{
- GameSpyStagingRoom *ourRoom = TheGameSpyInfo->findStagingRoomByID(TheGameSpyInfo->getCurrentStagingRoomID());
- if (!ourRoom)
- {
- GameSpyCloseOverlay(GSOVERLAY_GAMEPASSWORD);
- SetLobbyAttemptHostJoin( FALSE );
- parentPopup = nullptr;
- return;
- }
- PeerRequest req;
- req.peerRequestType = PeerRequest::PEERREQUEST_JOINSTAGINGROOM;
- req.text = ourRoom->getGameName().str();
- req.stagingRoom.id = ourRoom->getID();
- req.password = password.str();
- TheGameSpyPeerMessageQueue->addRequest(req);
- DEBUG_LOG(("Attempting to join game %d(%ls) with password [%s]", ourRoom->getID(), ourRoom->getGameName().str(), password.str()));
- GameSpyCloseOverlay(GSOVERLAY_GAMEPASSWORD);
- parentPopup = nullptr;
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp
deleted file mode 100644
index fbce261d6a1..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp
+++ /dev/null
@@ -1,485 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: PopupReplay.cpp /////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: Generals
-//
-// File name: PopupReplay.cpp
-//
-// Created: Matthew D. Campbell, November 2002
-//
-// Desc: the Replay Save window control
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/LocalFileSystem.h"
-#include "Common/MessageStream.h"
-#include "Common/Recorder.h"
-#include "GameClient/GadgetListBox.h"
-#include "GameClient/GadgetTextEntry.h"
-#include "GameClient/GameText.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GUICallbacks.h"
-#include "GameClient/MessageBox.h"
-#include "GameClient/Shell.h"
-#include "GameLogic/GameLogic.h"
-
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
-static NameKeyType buttonBackKey = NAMEKEY_INVALID;
-static NameKeyType buttonSaveKey = NAMEKEY_INVALID;
-static NameKeyType listboxGamesKey = NAMEKEY_INVALID;
-static NameKeyType textEntryReplayNameKey = NAMEKEY_INVALID;
-
-static GameWindow *parent = nullptr;
-static GameWindow *replaySavedParent = nullptr;
-
-static time_t s_fileSavePopupStartTime = 0;
-static const time_t s_fileSavePopupDuration = 1000;
-
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////////////////////////
-extern void PopulateReplayFileListbox(GameWindow *listbox);
-extern void ScoreScreenEnableControls(Bool enable);
-extern UnicodeString GetReplayFilenameFromListbox(GameWindow *listbox, Int index);
-extern std::string LastReplayFileName;
-
-//-------------------------------------------------------------------------------------------------
-/** Show or hide the "Replay Saved" popup */
-//-------------------------------------------------------------------------------------------------
-void ShowReplaySavedPopup(Bool show)
-{
- if (replaySavedParent != nullptr) {
- if (show) {
- replaySavedParent->winHide(FALSE);
- } else {
- replaySavedParent->winHide(TRUE);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-/** Close the save/load menu */
-// ------------------------------------------------------------------------------------------------
-static void closeSaveMenu( GameWindow *window )
-{
- WindowLayout *layout = window->winGetLayout();
-
- if( layout )
- layout->hide( TRUE );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the SaveLoad menu */
-//-------------------------------------------------------------------------------------------------
-void PopupReplayInit( WindowLayout *layout, void *userData )
-{
-
- // get ids for our children controls
- buttonBackKey = NAMEKEY( "PopupReplay.wnd:ButtonBack" );
- buttonSaveKey = NAMEKEY( "PopupReplay.wnd:ButtonSave" );
- listboxGamesKey = NAMEKEY( "PopupReplay.wnd:ListboxGames" );
- textEntryReplayNameKey = NAMEKEY( "PopupReplay.wnd:TextEntryReplayName" );
-
- //set keyboard focus to main parent and set modal
- NameKeyType parentID = TheNameKeyGenerator->nameToKey("PopupReplay.wnd:PopupReplayMenu");
- parent = TheWindowManager->winGetWindowFromId( nullptr, parentID );
- TheWindowManager->winSetFocus( parent );
-
- NameKeyType replaySavedParentID = TheNameKeyGenerator->nameToKey("PopupReplay.wnd:PopupReplaySaved");
- replaySavedParent = TheWindowManager->winGetWindowFromId( nullptr, replaySavedParentID);
- if (replaySavedParent == nullptr) {
- DEBUG_CRASH(("replaySavedParent == nullptr"));
- }
-
- ShowReplaySavedPopup(FALSE);
-
- // enable the menu action buttons
- GameWindow *buttonFrame = TheWindowManager->winGetWindowFromId( parent, NAMEKEY( "PopupReplay.wnd:MenuButtonFrame" ) );
- buttonFrame->winEnable( TRUE );
-
- // get the listbox that will have the save games in it
- GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( nullptr, listboxGamesKey );
- DEBUG_ASSERTCRASH( listboxGames != nullptr, ("PopupReplayInit - Unable to find games listbox") );
-
- // populate the listbox with the save games on disk
- PopulateReplayFileListbox(listboxGames);
-
- GameWindow *textEntryReplayName = TheWindowManager->winGetWindowFromId( parent, textEntryReplayNameKey );
- GadgetTextEntrySetText(textEntryReplayName, UnicodeString::TheEmptyString);
- TheWindowManager->winSetFocus( textEntryReplayName );
-
- //Disable the button immediately as the code above us starts off with an empty string.
- GameWindow *control = TheWindowManager->winGetWindowFromId( parent, buttonSaveKey );
- if( control )
- {
- control->winEnable( FALSE );
- }
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** SaveLoad menu shutdown method */
-//-------------------------------------------------------------------------------------------------
-void PopupReplayShutdown( WindowLayout *layout, void *userData )
-{
- parent = nullptr;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** SaveLoad menu update method */
-//-------------------------------------------------------------------------------------------------
-void PopupReplayUpdate( WindowLayout *layout, void *userData )
-{
-
- if (s_fileSavePopupStartTime != 0)
- {
- // the replay save confirmation popup is up
- // check to see if its time to take it down.
- if ((timeGetTime() - s_fileSavePopupStartTime) >= s_fileSavePopupDuration)
- {
- ShowReplaySavedPopup(FALSE);
-
- // close the save/load menu
- closeSaveMenu( parent );
- ScoreScreenEnableControls(TRUE);
-
- // reset the timer to 0 cause we have to.
- s_fileSavePopupStartTime = 0;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// ------------------------------------------------------------------------------------------------
-WindowMsgHandledType PopupReplayInput( GameWindow *window, UnsignedInt msg, WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
- GameWindow *button = TheWindowManager->winGetWindowFromId( parent, buttonBackKey );
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)button, buttonBackKey );
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-}
-
-static void reallySaveReplay();
-static std::string replayPath;
-
-// ------------------------------------------------------------------------------------------------
-/** Save the replay */
-// ------------------------------------------------------------------------------------------------
-static GameWindow *messageBoxWin = nullptr;
-static void saveReplay( UnicodeString filename )
-{
- AsciiString translated;
- if (filename == TheGameText->fetch("GUI:LastReplay"))
- {
- translated = TheRecorder->getLastReplayFileName();
- }
- else
- {
- translated.translate(filename);
- }
-
- AsciiString fullPath = TheRecorder->getReplayDir();
- fullPath.concat(translated);
- fullPath.concat(TheRecorder->getReplayExtention());
-
- replayPath = fullPath.str();
- messageBoxWin = nullptr;
- if (TheLocalFileSystem->doesFileExist(fullPath.str()))
- {
- messageBoxWin = MessageBoxOkCancel(TheGameText->fetch("GUI:OverwriteReplayTitle"), TheGameText->fetch("GUI:OverwriteReplay"), reallySaveReplay, nullptr);
- }
- else
- {
- reallySaveReplay();
- }
-}
-void reallySaveReplay()
-{
- AsciiString filename = replayPath.c_str();
-
- AsciiString oldFilename;
- oldFilename = TheRecorder->getReplayDir();
- oldFilename.concat(LastReplayFileName.c_str());
- oldFilename.concat(TheRecorder->getReplayExtention());
-
- if (oldFilename == filename)
- return;
-
- if (TheLocalFileSystem->doesFileExist(filename.str()))
- {
- if(DeleteFile(filename.str()) == 0)
- {
- wchar_t buffer[1024];
- FormatMessageW ( FORMAT_MESSAGE_FROM_SYSTEM, nullptr, GetLastError(), 0, buffer, ARRAY_SIZE(buffer), nullptr);
- UnicodeString errorStr;
- errorStr.set(buffer);
- errorStr.trim();
- if(messageBoxWin)
- {
- TheWindowManager->winUnsetModal(messageBoxWin);
- messageBoxWin = nullptr;
- }
- MessageBoxOk(TheGameText->fetch("GUI:Error"),errorStr, nullptr);
-
- // get the listbox that will have the save games in it
- GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( parent, listboxGamesKey );
- DEBUG_ASSERTCRASH( listboxGames != nullptr, ("reallySaveReplay - Unable to find games listbox") );
-
- // populate the listbox with the save games on disk
- PopulateReplayFileListbox(listboxGames);
- return;
- }
- }
-
- // copy the replay to the right place
- if(CopyFile(oldFilename.str(),filename.str(), FALSE) == 0)
- {
- wchar_t buffer[1024];
- FormatMessageW( FORMAT_MESSAGE_FROM_SYSTEM, nullptr, GetLastError(), 0, buffer, ARRAY_SIZE(buffer), nullptr);
- UnicodeString errorStr;
- errorStr.set(buffer);
- errorStr.trim();
- if(messageBoxWin)
- {
- TheWindowManager->winUnsetModal(messageBoxWin);
- messageBoxWin = nullptr;
- }
- MessageBoxOk(TheGameText->fetch("GUI:Error"),errorStr, nullptr);
- return;
- }
-
- // get the listbox that will have the save games in it
- GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( parent, listboxGamesKey );
- DEBUG_ASSERTCRASH( listboxGames != nullptr, ("reallySaveReplay - Unable to find games listbox") );
-
- // populate the listbox with the save games on disk
- PopulateReplayFileListbox(listboxGames);
-
- ShowReplaySavedPopup(TRUE);
- s_fileSavePopupStartTime = timeGetTime();
-}
-
-//-------------------------------------------------------------------------------------------------
-/** SaveLoad menu system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType PopupReplaySystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CREATE:
- {
-
- break;
-
- }
- //---------------------------------------------------------------------------------------------
- case GWM_DESTROY:
- {
-
- break;
-
- }
-
- //----------------------------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- break;
-
- }
-
- // --------------------------------------------------------------------------------------------
- case GLM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
-
- GameWindow *listboxGames = TheWindowManager->winGetWindowFromId( window, listboxGamesKey );
- DEBUG_ASSERTCRASH( listboxGames != nullptr, ("PopupReplaySystem - Unable to find games listbox") );
-
- //
- // handle games listbox, when certain items are selected in the listbox only some
- // commands are available
- //
- if( control == listboxGames )
- {
- int rowSelected = mData2;
- if (rowSelected >= 0)
- {
- UnicodeString filename;
- filename = GadgetListBoxGetText(listboxGames, rowSelected);
- GameWindow *textEntryReplayName = TheWindowManager->winGetWindowFromId( window, textEntryReplayNameKey );
- DEBUG_ASSERTCRASH( textEntryReplayName != nullptr, ("PopupReplaySystem - Unable to find text entry") );
- GadgetTextEntrySetText(textEntryReplayName, filename);
- }
- }
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GEM_EDIT_DONE:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if( controlID == textEntryReplayNameKey )
- {
- UnicodeString filename = GadgetTextEntryGetText( control );
- if (filename.isEmpty())
- break;
-
- saveReplay(filename);
-
- }
-
- break;
-
- }
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if( controlID == buttonSaveKey )
- {
- // get the filename, and see if we are overwriting
- GameWindow *textEntryReplayName = TheWindowManager->winGetWindowFromId( window, textEntryReplayNameKey );
- DEBUG_ASSERTCRASH( textEntryReplayName != nullptr, ("PopupReplaySystem - Unable to find text entry") );
-
- UnicodeString filename = GadgetTextEntryGetText( textEntryReplayName );
- if (filename.isEmpty())
- break;
-
- saveReplay(filename);
-
- }
- else if( controlID == buttonBackKey )
- {
-
- // close the save/load menu
- closeSaveMenu( window );
- ScoreScreenEnableControls(TRUE);
-
- }
-
- break;
-
- }
-
- case GEM_UPDATE_TEXT:
- {
- //Kris:
- //Enable or disable the save button -- disabled when empty.
- GameWindow *control = TheWindowManager->winGetWindowFromId( parent, textEntryReplayNameKey );
- if( control )
- {
- UnicodeString filename;
- filename.set( GadgetTextEntryGetText( control ) );
- control = TheWindowManager->winGetWindowFromId( parent, buttonSaveKey );
- if( control )
- {
- if( filename.isEmpty() )
- {
- control->winEnable( FALSE );
- }
- else
- {
- control->winEnable( TRUE );
- }
- }
- }
-
- break;
- }
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
deleted file mode 100644
index d5b957f7dfb..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
+++ /dev/null
@@ -1,555 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: QuitMenu.cpp /////////////////////////////////////////////////////////////////////////////
-// Author: Colin Day, October 2001
-// Description: Quit menu window callbacks
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/FramePacer.h"
-#include "Common/GameEngine.h"
-#include "Common/GameState.h"
-#include "Common/MessageStream.h"
-#include "Common/Player.h"
-#include "Common/PlayerList.h"
-#include "Common/RandomValue.h"
-#include "Common/Recorder.h"
-#include "GameClient/GUICallbacks.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GadgetPushButton.h"
-#include "GameClient/GameText.h"
-#include "GameClient/MessageBox.h"
-#include "GameClient/Shell.h"
-#include "GameClient/InGameUI.h"
-#include "GameLogic/GameLogic.h"
-#include "GameLogic/VictoryConditions.h"
-#include "GameClient/ControlBar.h"
-#include "GameClient/GameWindowTransitions.h"
-#include "GameClient/DisconnectMenu.h"
-#include "GameLogic/ScriptEngine.h"
-
-
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
-static WindowLayout *quitMenuLayout = nullptr;
-static WindowLayout *fullQuitMenuLayout = nullptr;
-static WindowLayout *noSaveLoadQuitMenuLayout = nullptr;
-
-static Bool isVisible = FALSE;
-
-static GameWindow *quitConfirmationWindow = nullptr;
-
-//external declarations of the Gadgets the callbacks can use
-static WindowLayout *saveLoadMenuLayout = nullptr;
-
-static GameWindow *buttonRestartWin = nullptr;
-static GameWindow *buttonSaveLoadWin = nullptr;
-static GameWindow *buttonOptionsWin = nullptr;
-static GameWindow *buttonExitWin = nullptr;
-
-static NameKeyType buttonExit = NAMEKEY_INVALID;
-static NameKeyType buttonRestart = NAMEKEY_INVALID;
-static NameKeyType buttonReturn = NAMEKEY_INVALID;
-static NameKeyType buttonOptions = NAMEKEY_INVALID;
-static NameKeyType buttonSaveLoad = NAMEKEY_INVALID;
-
-static void initGadgetsFullQuit()
-{
- buttonExit = TheNameKeyGenerator->nameToKey( "QuitMenu.wnd:ButtonExit" );
- buttonRestart = TheNameKeyGenerator->nameToKey( "QuitMenu.wnd:ButtonRestart" );
- buttonReturn = TheNameKeyGenerator->nameToKey( "QuitMenu.wnd:ButtonReturn" );
- buttonOptions = TheNameKeyGenerator->nameToKey( "QuitMenu.wnd:ButtonOptions" );
- buttonSaveLoad = TheNameKeyGenerator->nameToKey( "QuitMenu.wnd:ButtonSaveLoad" );
-
- buttonRestartWin = TheWindowManager->winGetWindowFromId( nullptr, buttonRestart );
- buttonSaveLoadWin = TheWindowManager->winGetWindowFromId( nullptr, buttonSaveLoad );
- buttonOptionsWin = TheWindowManager->winGetWindowFromId( nullptr, buttonOptions );
- buttonExitWin = TheWindowManager->winGetWindowFromId( nullptr, buttonExit );
-}
-
-static void initGadgetsNoSaveQuit()
-{
- buttonExit = TheNameKeyGenerator->nameToKey( "QuitNoSave.wnd:ButtonExit" );
- buttonRestart = TheNameKeyGenerator->nameToKey( "QuitNoSave.wnd:ButtonRestart" );
- buttonReturn = TheNameKeyGenerator->nameToKey( "QuitNoSave.wnd:ButtonReturn" );
- buttonOptions = TheNameKeyGenerator->nameToKey( "QuitNoSave.wnd:ButtonOptions" );
- buttonSaveLoad = NAMEKEY_INVALID;
-
- buttonRestartWin = TheWindowManager->winGetWindowFromId( nullptr, buttonRestart );
- buttonOptionsWin = TheWindowManager->winGetWindowFromId( nullptr, buttonOptions );
- buttonSaveLoadWin = nullptr;
- buttonExitWin = TheWindowManager->winGetWindowFromId( nullptr, buttonExit );
-
-}
-
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////////////////////////
-
-void destroyQuitMenu()
-{
- // destroy the quit menu
- quitConfirmationWindow = nullptr;
- if(fullQuitMenuLayout)
- {
- fullQuitMenuLayout->destroyWindows();
- deleteInstance(fullQuitMenuLayout);
- fullQuitMenuLayout = nullptr;
- }
- if(noSaveLoadQuitMenuLayout)
- {
- noSaveLoadQuitMenuLayout->destroyWindows();
- deleteInstance(noSaveLoadQuitMenuLayout);
- noSaveLoadQuitMenuLayout = nullptr;
- }
- quitMenuLayout = nullptr;
- isVisible = FALSE;
-
- TheInGameUI->setQuitMenuVisible(FALSE);
-}
-
-/**
- * quits the program
- */
-static void exitQuitMenu()
-{
- // destroy the quit menu
- destroyQuitMenu();
-
- // clear out all the game data
- if ( TheGameLogic->isInMultiplayerGame() && !TheGameLogic->isInSkirmishGame() && !TheGameInfo->isSandbox() )
- {
- GameMessage *msg = TheMessageStream->appendMessage(GameMessage::MSG_SELF_DESTRUCT);
- msg->appendBooleanArgument(TRUE);
- }
- TheGameLogic->exitGame();
- // TheGameLogic->clearGameData();
- // display the menu on top of the shell stack
- // TheShell->showShell();
-
- // this will trigger an exit
- // TheGameEngine->setQuitting( TRUE );
- TheInGameUI->setClientQuiet( TRUE );
-}
-static void noExitQuitMenu()
-{
- quitConfirmationWindow = nullptr;
-}
-
-static void quitToDesktopQuitMenu()
-{
- // destroy the quit menu
- destroyQuitMenu();
-
- if (TheGameLogic->isInGame())
- {
- if (TheRecorder->getMode() == RECORDERMODETYPE_RECORD)
- {
- TheRecorder->stopRecording();
- }
- TheGameLogic->clearGameData();
- }
- TheGameEngine->setQuitting(TRUE);
- TheInGameUI->setClientQuiet( TRUE );
-
-}
-
-static void surrenderQuitMenu()
-{
- // destroy the quit menu
- destroyQuitMenu();
-
- if (TheVictoryConditions->isLocalAlliedVictory())
- return;
-
- GameMessage *msg = TheMessageStream->appendMessage(GameMessage::MSG_SELF_DESTRUCT);
- msg->appendBooleanArgument(TRUE);
-
- TheInGameUI->setClientQuiet( TRUE );
-}
-
-static void restartMissionMenu()
-{
- // destroy the quit menu
- destroyQuitMenu();
-
- Int gameMode = TheGameLogic->getGameMode();
- AsciiString mapName = TheGlobalData->m_mapName;
-
- // TheSuperHackers @bugfix Caball009 07/02/2026 Reuse the previous seed value for the new skirmish match to prevent mismatches.
- // Campaign, challenge, and skirmish single-player scenarios all use GAME_SINGLE_PLAYER and are expected to use 0 as seed value.
- DEBUG_ASSERTCRASH((TheSkirmishGameInfo != nullptr) == (gameMode == GAME_SKIRMISH), ("Unexpected game mode on map / mission restart"));
- const Int seed = TheSkirmishGameInfo ? TheSkirmishGameInfo->getSeed() : 0;
-
- //
- // if the map name was from a save game it will have "Save/" at the front of it,
- // we want to go back to the original pristine map string for the map name when restarting
- //
- if (TheGameState->isInSaveDirectory(mapName))
- mapName = TheGameState->getPristineMapName();
-
- // End the current game
- AsciiString replayFile = TheRecorder->getCurrentReplayFilename();
- if (TheRecorder->getMode() == RECORDERMODETYPE_RECORD)
- {
- TheRecorder->stopRecording();
- }
-
- Int rankPointsStartedWith = TheGameLogic->getRankPointsToAddAtGameStart();// must write down before reset
- GameDifficulty diff = TheScriptEngine->getGlobalDifficulty();
- Int fps = TheFramePacer->getFramesPerSecondLimit();
-
- TheGameLogic->clearGameData(FALSE);
- TheGameEngine->setQuitting(FALSE);
-
- if (replayFile.isNotEmpty())
- {
- TheRecorder->playbackFile(replayFile);
- }
- else
- {
- // send a message to the logic for a new game
- TheWritableGlobalData->m_pendingFile = mapName;
- GameMessage *msg = TheMessageStream->appendMessage( GameMessage::MSG_NEW_GAME );
- msg->appendIntegerArgument(gameMode);
- msg->appendIntegerArgument(diff);
- msg->appendIntegerArgument(rankPointsStartedWith);
- msg->appendIntegerArgument(fps);
- DEBUG_LOG(("Restarting game mode %d, Diff=%d, RankPoints=%d", gameMode,
- TheScriptEngine->getGlobalDifficulty(),
- rankPointsStartedWith)
- );
-
- InitRandom(seed);
- }
- //TheTransitionHandler->remove("QuitFull"); //KRISMORNESS ADD
- //quitMenuLayout = nullptr; //KRISMORNESS ADD
- //isVisible = TRUE; //KRISMORNESS ADD
- //HideQuitMenu(); //KRISMORNESS ADD
- TheInGameUI->setClientQuiet( TRUE );
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-void HideQuitMenu()
-{
- // Note: This is called as a safety a lot, without checking for the prescence of the quit menu.
- // So don't do anything that counts on that menu actually being here.
- if(!isVisible)
- return;
- if(quitMenuLayout && quitMenuLayout == noSaveLoadQuitMenuLayout)
- TheTransitionHandler->reverse("QuitNoSaveBack");
- else if( quitMenuLayout && quitMenuLayout == fullQuitMenuLayout)
- TheTransitionHandler->reverse("QuitFullBack");
-
- TheInGameUI->setQuitMenuVisible( FALSE );
- isVisible = FALSE;
- if (quitConfirmationWindow)
- TheWindowManager->winDestroy(quitConfirmationWindow);
- quitConfirmationWindow = nullptr;
- if ( !TheGameLogic->isInMultiplayerGame() )
- TheGameLogic->setGamePaused(FALSE);
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Toggle visibility of the quit menu */
-//-------------------------------------------------------------------------------------------------
-void ToggleQuitMenu()
-{
- if (TheGameLogic->isIntroMoviePlaying() || TheGameLogic->isLoadingMap() ||TheScriptEngine->isGameEnding())
- return;
-
- // BGC- If we are currently in the disconnect screen, don't let the quit menu come up.
- if (TheDisconnectMenu != nullptr) {
- if (TheDisconnectMenu->isScreenVisible() == TRUE) {
- return;
- }
- }
-
- // BGC- this is kind of hackish, but its the safest way to do it I think.
- // Basically we're seeing if either the save/load window or the options window is up
- // and if one of them is, we quit out of them rather than toggle the quit menu.
- if (TheShell->getOptionsLayout(FALSE) != FALSE) {
- WindowLayout *optLayout = TheShell->getOptionsLayout(FALSE);
- GameWindow *optionsParent = optLayout->getFirstWindow();
- DEBUG_ASSERTCRASH(optionsParent != nullptr, ("Not able to get the options layout parent window"));
- GameWindow *optionsBack = TheWindowManager->winGetWindowFromId(optionsParent, TheNameKeyGenerator->nameToKey( "OptionsMenu.wnd:ButtonBack" ));
- DEBUG_ASSERTCRASH(optionsBack != nullptr, ("Not able to get the back button window from the options menu"));
- TheWindowManager->winSendSystemMsg(optLayout->getFirstWindow(), GBM_SELECTED, (WindowMsgData)optionsBack, 0);
- return;
- }
- if ((saveLoadMenuLayout != nullptr) && (saveLoadMenuLayout->isHidden() == FALSE))
- {
- GameWindow *saveLoadParent = saveLoadMenuLayout->getFirstWindow();
- DEBUG_ASSERTCRASH(saveLoadParent != nullptr, ("Not able to get the save/load layout parent window"));
- GameWindow *saveLoadBack = TheWindowManager->winGetWindowFromId(saveLoadParent, TheNameKeyGenerator->nameToKey( "PopupSaveLoad.wnd:ButtonBack" ));
- DEBUG_ASSERTCRASH(saveLoadBack != nullptr, ("Not able to get the back button window from the save/load menu"));
- TheWindowManager->winSendSystemMsg(saveLoadMenuLayout->getFirstWindow(), GBM_SELECTED, (WindowMsgData)saveLoadBack, 0);
- saveLoadMenuLayout = nullptr;
- return;
- }
-
- // if we're visible hide our quit menu
- if(isVisible && quitMenuLayout)
- {
-
- isVisible = FALSE;
-
- if (quitConfirmationWindow)
- TheWindowManager->winDestroy(quitConfirmationWindow);
- quitConfirmationWindow = nullptr;
-
- if ( !TheGameLogic->isInMultiplayerGame() )
- TheGameLogic->setGamePaused(FALSE);
- if(quitMenuLayout && quitMenuLayout == noSaveLoadQuitMenuLayout)
- TheTransitionHandler->reverse("QuitNoSaveBack");
- else if( quitMenuLayout && quitMenuLayout == fullQuitMenuLayout )
- {
- TheTransitionHandler->reverse("QuitFullBack");
- //begin KRISMORNESS
- //TheTransitionHandler->reverse("QuitFull");
- //if( TheTransitionHandler->areTransitionsEnabled() )
- //else
- //{
- // TheTransitionHandler->remove("QuitFull");
- // quitMenuLayout = nullptr;
- // isVisible = TRUE;
- // HideQuitMenu();
- //}
- //end KRISMORNESS
- }
- }
- else
- {
-
- TheMouse->setCursor( Mouse::ARROW );
-
- TheControlBar->hidePurchaseScience();
- if ( TheGameLogic->isInMultiplayerGame() || TheGameLogic->isInReplayGame() )
- {
- // we don't want to show the save load button.
- if(!noSaveLoadQuitMenuLayout)
- noSaveLoadQuitMenuLayout = TheWindowManager->winCreateLayout( "Menus/QuitNoSave.wnd" );
- quitMenuLayout = noSaveLoadQuitMenuLayout;
- initGadgetsNoSaveQuit();
- TheTransitionHandler->remove("QuitNoSave");
- TheTransitionHandler->setGroup("QuitNoSave");
- }
- else
- {
- if(!fullQuitMenuLayout)
- fullQuitMenuLayout= TheWindowManager->winCreateLayout( "Menus/QuitMenu.wnd" );
- quitMenuLayout = fullQuitMenuLayout;
- initGadgetsFullQuit();
- TheTransitionHandler->remove("QuitFull");
- TheTransitionHandler->setGroup("QuitFull");
- }
-
- // load the quit menu from the layout file if needed
- if( quitMenuLayout == nullptr )
- {
- DEBUG_CRASH(("Could not load a quit menu layout"));
- isVisible = FALSE;
- TheInGameUI->setQuitMenuVisible(FALSE);
- return;
- }
-
- //quitMenuLayout->hide(FALSE);
-
- // if we are watching a cinematic, we need to disable the save/load button
- // because the save load window doesn't fit in the screen in letterbox mode.
- if (TheInGameUI->getInputEnabled() == FALSE) {
- if(buttonSaveLoadWin)
- buttonSaveLoadWin->winEnable(FALSE);
- buttonOptionsWin->winEnable(FALSE);
- } else if (buttonSaveLoadWin)
- {
- if(buttonSaveLoadWin)
- buttonSaveLoadWin->winEnable(TRUE);
- buttonOptionsWin->winEnable(TRUE);
- }
-
- // Disable the restart, load, save, etc buttons in network games
- if ( TheGameLogic->isInMultiplayerGame() || TheGameLogic->isInSkirmishGame() )
- {
- buttonRestartWin->winEnable(TRUE);
- if (TheGameLogic->isInSkirmishGame() == FALSE) {
- GadgetButtonSetText(buttonRestartWin, TheGameText->fetch("GUI:Surrender"));
-
- }
-
- if (TheGameLogic->isInSkirmishGame() == TRUE) {
- TheGameLogic->setGamePaused(TRUE);
- }
-
- if ((!ThePlayerList->getLocalPlayer()->isPlayerActive() || TheVictoryConditions->isLocalAlliedVictory()) &&
- (TheGameLogic->isInSkirmishGame() == FALSE))
- {
- buttonRestartWin->winEnable(FALSE); // can't surrender when you're dead
- }
- }
- else
- {
- buttonRestartWin->winEnable(TRUE);
- if(!TheGameLogic->isInReplayGame())
- {
- GadgetButtonSetText(buttonRestartWin, TheGameText->fetch("GUI:RestartMission"));
- GadgetButtonSetText(buttonExitWin, TheGameText->fetch("GUI:ExitMission"));
-
- }
- //if we're not in a multiplayer game, pause the game
- TheGameLogic->setGamePaused(TRUE);
- }
-
-
- if (quitConfirmationWindow)
- TheWindowManager->winDestroy(quitConfirmationWindow);
- quitConfirmationWindow = nullptr;
- HideDiplomacy();
- HideInGameChat();
- TheControlBar->hidePurchaseScience();
- isVisible = TRUE;
- }
-
- TheInGameUI->setQuitMenuVisible(isVisible);
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Quit menu window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType QuitMenuSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CREATE:
- {
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GWM_DESTROY:
- {
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if( controlID == buttonSaveLoad )
- {
-
- //
- // these commented lines (12-11-2002) will allow access to load only when were
- // viewing an in-game cinema ... but it's brittle, so I'm disableing it for
- // now and just using the grey button for the whole save/load button for now
- // during a cinema
- //
-
-// SaveLoadLayoutType layoutType = SLLT_SAVE_AND_LOAD;
-
- //
- // if input is disabled we are in an in-game cinematic and can load only, since we
- // are in the quit menu we are paused and therefore input is disabled all
- // the time ... in order to figure out if the *game* has input disabled we need
- // to query for the input enabled memory in the game logic which represents the
- // input enabled status of the game if we were not currently paused
- //
-// if( TheGameLogic->getInputEnabledMemory() == FALSE )
-// layoutType = SLLT_LOAD_ONLY;
-
- saveLoadMenuLayout = TheShell->getSaveLoadMenuLayout();
-// saveLoadMenuLayout->runInit( &layoutType );
- saveLoadMenuLayout->runInit();
- saveLoadMenuLayout->hide( FALSE );
- saveLoadMenuLayout->bringForward();
- }
- else if( controlID == buttonExit )
- {
- quitConfirmationWindow = QuitMessageBoxYesNo(TheGameText->fetch("GUI:QuitPopupTitle"), TheGameText->fetch("GUI:QuitPopupMessage"),/*quitCallback*/exitQuitMenu,noExitQuitMenu);
- }
- else if( controlID == buttonReturn )
- {
-
- // hide this menu
- ToggleQuitMenu();
-
- }
- else if( buttonOptions == controlID )
- {
- WindowLayout *optLayout = TheShell->getOptionsLayout(TRUE);
- DEBUG_ASSERTCRASH(optLayout != nullptr, ("options menu layout is null"));
- optLayout->runInit();
- optLayout->hide(FALSE);
- optLayout->bringForward();
- }
-// else if( controlID == buttonQuitToDesktop )
-// {
-// quitConfirmationWindow = MessageBoxYesNo(TheGameText->fetch("GUI:QuitPopupTitle"), TheGameText->fetch("GUI:QuitToDesktopConf"),/*quitCallback*/quitToDesktopQuitMenu,noExitQuitMenu);
-//
-// } // end else if
- else if( controlID == buttonRestart )
- {
- if ( TheGameLogic->isInMultiplayerGame() )
- {
- // we really want to surrender
- quitConfirmationWindow = MessageBoxYesNo(TheGameText->fetch("GUI:SurrenderConfirmationTitle"),
- TheGameText->fetch("GUI:SurrenderConfirmation"),
- /*quitCallback*/surrenderQuitMenu,noExitQuitMenu);
- }
- else
- {
- //we really want to restart
- quitConfirmationWindow = MessageBoxYesNo(TheGameText->fetch("GUI:RestartConfirmationTitle"),
- TheGameText->fetch("GUI:RestartConfirmation"),
- /*quitCallback*/restartMissionMenu,noExitQuitMenu);
- }
- }
-
- break;
-
- }
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
deleted file mode 100644
index 4b02271bfb7..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
+++ /dev/null
@@ -1,829 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: ReplayMenu.cpp /////////////////////////////////////////////////////////////////////
-// Author: Chris The masta Huybregts, December 2001
-// Description: Replay Menus
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-
-#include "Lib/BaseType.h"
-#include "Common/FileSystem.h"
-#include "Common/GameEngine.h"
-#include "Common/GameState.h"
-#include "Common/Recorder.h"
-#include "Common/version.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GadgetListBox.h"
-#include "GameClient/Shell.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/MessageBox.h"
-#include "GameClient/MapUtil.h"
-#include "GameClient/Mouse.h"
-#include "GameClient/GameText.h"
-#include "GameClient/GameWindowTransitions.h"
-
-typedef UnicodeString ReplayName;
-typedef UnicodeString TooltipString;
-typedef std::map ReplayTooltipMap;
-
-static ReplayTooltipMap replayTooltipCache;
-
-// window ids -------------------------------------------------------------------------------------
-static NameKeyType parentReplayMenuID = NAMEKEY_INVALID;
-static NameKeyType buttonLoadID = NAMEKEY_INVALID;
-static NameKeyType buttonBackID = NAMEKEY_INVALID;
-static NameKeyType listboxReplayFilesID = NAMEKEY_INVALID;
-static NameKeyType buttonDeleteID = NAMEKEY_INVALID;
-static NameKeyType buttonCopyID = NAMEKEY_INVALID;
-
-static Bool isShuttingDown = false;
-
-// window pointers --------------------------------------------------------------------------------
-static GameWindow *parentReplayMenu = nullptr;
-static GameWindow *buttonLoad = nullptr;
-static GameWindow *buttonBack = nullptr;
-static GameWindow *listboxReplayFiles = nullptr;
-static GameWindow *buttonDelete = nullptr;
-static GameWindow *buttonCopy = nullptr;
-static Int initialGadgetDelay = 2;
-static Bool justEntered = FALSE;
-
-
-#if defined(RTS_DEBUG)
-static GameWindow *buttonAnalyzeReplay = nullptr;
-#endif
-
-void deleteReplay();
-void copyReplay();
-static Bool callCopy = FALSE;
-static Bool callDelete = FALSE;
-void deleteReplayFlag() { callDelete = TRUE;}
-void copyReplayFlag() { callCopy = TRUE;}
-
-UnicodeString GetReplayFilenameFromListbox(GameWindow *listbox, Int index)
-{
- UnicodeString fname = GadgetListBoxGetText(listbox, index);
-
- if (fname == TheGameText->fetch("GUI:LastReplay"))
- {
- fname.translate(TheRecorder->getLastReplayFileName());
- }
-
- UnicodeString ext;
- ext.translate(TheRecorder->getReplayExtention());
- fname.concat(ext);
-
- return fname;
-}
-
-//-------------------------------------------------------------------------------------------------
-
-static Bool readReplayMapInfo(const AsciiString& filename, RecorderClass::ReplayHeader &header, ReplayGameInfo &info, const MapMetaData *&mapData)
-{
- header.forPlayback = FALSE;
- header.filename = filename;
-
- if (TheRecorder != nullptr && TheRecorder->readReplayHeader(header))
- {
- if (ParseAsciiStringToGameInfo(&info, header.gameOptions))
- {
- if (TheMapCache != nullptr)
- mapData = TheMapCache->findMap(info.getMap());
- else
- mapData = nullptr;
-
- return true;
- }
- }
- return false;
-}
-
-//-------------------------------------------------------------------------------------------------
-
-static void removeReplayExtension(UnicodeString& replayName)
-{
- const Int extensionLength = TheRecorder->getReplayExtention().getLength();
- replayName.truncateBy(extensionLength);
-}
-
-//-------------------------------------------------------------------------------------------------
-
-static UnicodeString createReplayName(const AsciiString& filename)
-{
- AsciiString lastReplayFName = TheRecorder->getLastReplayFileName();
- lastReplayFName.concat(TheRecorder->getReplayExtention());
- UnicodeString replayName;
-
- if (lastReplayFName.compareNoCase(filename) == 0)
- {
- replayName = TheGameText->fetch("GUI:LastReplay");
- }
- else
- {
- replayName.translate(filename);
- removeReplayExtension(replayName);
- }
- return replayName;
-}
-
-//-------------------------------------------------------------------------------------------------
-
-static UnicodeString createMapName(const AsciiString& filename, const ReplayGameInfo& info, const MapMetaData *mapData)
-{
- UnicodeString mapName;
- if (!mapData)
- {
- // TheSuperHackers @bugfix helmutbuhler 08/03/2025 Just use the filename.
- // Displaying a long map path string would break the map list gui.
- const char* filename = info.getMap().reverseFind('\\');
- mapName.translate(filename ? filename + 1 : info.getMap());
- }
- else
- {
- mapName = mapData->m_displayName;
- }
- return mapName;
-}
-
-//-------------------------------------------------------------------------------------------------
-// TheSuperHackers @feature Stubbjax 21/10/2025 Show extra info tooltip when hovering over a replay.
-
-static void showReplayTooltip(GameWindow* window, WinInstanceData* instData, UnsignedInt mouse)
-{
- Int x, y, row, col;
- x = LOLONGTOSHORT(mouse);
- y = HILONGTOSHORT(mouse);
-
- GadgetListBoxGetEntryBasedOnXY(window, x, y, row, col);
-
- if (row == -1 || col == -1)
- {
- TheMouse->setCursorTooltip(UnicodeString::TheEmptyString);
- return;
- }
-
- UnicodeString replayFileName = GetReplayFilenameFromListbox(window, row);
-
- ReplayTooltipMap::const_iterator it = replayTooltipCache.find(replayFileName);
- if (it != replayTooltipCache.end())
- TheMouse->setCursorTooltip(it->second, -1, nullptr, 1.5f);
- else
- TheMouse->setCursorTooltip(UnicodeString::TheEmptyString);
-}
-
-static UnicodeString buildReplayTooltip(RecorderClass::ReplayHeader header, ReplayGameInfo info)
-{
- UnicodeString tooltipStr;
-
- if (header.endTime < header.startTime)
- header.startTime = header.endTime;
-
- time_t totalSeconds = header.endTime - header.startTime;
- UnsignedInt hours = totalSeconds / 3600;
- UnsignedInt mins = (totalSeconds % 3600) / 60;
- UnsignedInt secs = totalSeconds % 60;
- Real fps = totalSeconds > 0 ? header.frameCount / totalSeconds : 0;
- tooltipStr.format(L"%02u:%02u:%02u (%g fps)", hours, mins, secs, fps);
-
- if (header.localPlayerIndex >= 0)
- {
- // MP game
- for (Int i = 0; i < MAX_SLOTS; ++i)
- {
- const GameSlot* slot = info.getConstSlot(i);
- if (slot && slot->isHuman())
- {
- tooltipStr.concat(L"\n");
- tooltipStr.concat(info.getConstSlot(i)->getName());
- }
- }
- }
-
- return tooltipStr;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Populate the listbox with the names of the available replay files */
-//-------------------------------------------------------------------------------------------------
-void PopulateReplayFileListbox(GameWindow *listbox)
-{
- replayTooltipCache.clear();
-
- if (!TheMapCache)
- return;
-
- GadgetListBoxReset(listbox);
- const Int listboxLength = GadgetListBoxGetListLength(listbox);
- const Int columns = GadgetListBoxGetNumColumns(listbox);
-
- // TheSuperHackers @tweak xezon 08/06/2025 Now shows missing maps in red color.
- enum {
- COLOR_SP = 0,
- COLOR_SP_CRC_MISMATCH,
- COLOR_MP,
- COLOR_MP_CRC_MISMATCH,
- COLOR_MISSING_MAP,
- COLOR_MISSING_MAP_CRC_MISMATCH,
- COLOR_MAX
- };
- Color colors[] = {
- GameMakeColor( 255, 255, 255, 255 ),
- GameMakeColor( 128, 128, 128, 255 ),
- GameMakeColor( 255, 255, 255, 255 ),
- GameMakeColor( 128, 128, 128, 255 ),
- GameMakeColor( 243, 24, 24, 255 ),
- GameMakeColor( 128, 32, 32, 255 )
- };
- static_assert(ARRAY_SIZE(colors) == COLOR_MAX, "Mismatch between colors array size and COLOR_MAX");
-
- AsciiString asciistr;
- AsciiString asciisearch;
- asciisearch = "*";
- asciisearch.concat(TheRecorder->getReplayExtention());
-
- FilenameList replayFilenames;
- FilenameListIter it;
-
- TheFileSystem->getFileListInDirectory(TheRecorder->getReplayDir(), asciisearch, replayFilenames, FALSE);
-
- TheMapCache->updateCache();
-
- for (it = replayFilenames.begin(); it != replayFilenames.end(); ++it)
- {
- // just want the filename
- asciistr.set((*it).reverseFind('\\') + 1);
-
- RecorderClass::ReplayHeader header;
- ReplayGameInfo info;
- const MapMetaData *mapData;
-
- if (readReplayMapInfo(asciistr, header, info, mapData))
- {
- // columns are: name, date, version, map, extra
-
- // name
- UnicodeString replayNameToShow = createReplayName(asciistr);
-
- // TheSuperHackers @tweak Caball009 07/02/2026 Display both time and date instead of only time.
- const UnicodeString displayTimeBuffer = getUnicodeTimeBuffer(header.timeVal);
- const UnicodeString displayDateBuffer = getUnicodeDateBuffer(header.timeVal);
-
- // version (no-op)
-
- // map
- UnicodeString mapStr = createMapName(asciistr, info, mapData);
-
- // tooltip
- UnicodeString tooltipStr = buildReplayTooltip(header, info);
-
- UnicodeString key;
- key.translate(asciistr);
- replayTooltipCache[key] = tooltipStr;
-
- // pick a color
- Color color;
- Color mapColor;
-
- const Bool hasMap = mapData != nullptr;
-
- const Bool isCrcCompatible = RecorderClass::replayMatchesGameVersion(header);
-
- if (isCrcCompatible)
- {
- if (header.localPlayerIndex >= 0)
- {
- // MP
- color = colors[COLOR_MP];
- }
- else
- {
- // SP
- color = colors[COLOR_SP];
- }
-
- if (hasMap)
- mapColor = color;
- else
- mapColor = colors[COLOR_MISSING_MAP];
- }
- else
- {
- if (header.localPlayerIndex >= 0)
- {
- // MP
- color = colors[COLOR_MP_CRC_MISMATCH];
- }
- else
- {
- // SP
- color = colors[COLOR_SP_CRC_MISMATCH];
- }
-
- if (hasMap)
- mapColor = color;
- else
- mapColor = colors[COLOR_MISSING_MAP_CRC_MISMATCH];
- }
-
- const Int insertionIndex = GadgetListBoxAddEntryText(listbox, replayNameToShow, color, -1, 0);
- DEBUG_ASSERTCRASH(insertionIndex >= 0, ("Expects valid index"));
-
- // TheSuperHackers @info Caball009 09/02/2026 Original replay menu has 4 columns; the code now supports a future 5-column layout.
- // If there aren't two columns for time and date, concatenate them for a single column.
- if (columns == 4)
- {
- UnicodeString displayDateTimeBuffer;
- displayDateTimeBuffer.format(L"%s %s", displayTimeBuffer.str(), displayDateBuffer.str());
-
- GadgetListBoxAddEntryText(listbox, displayDateTimeBuffer, color, insertionIndex, 1);
- GadgetListBoxAddEntryText(listbox, header.versionString, color, insertionIndex, 2);
- GadgetListBoxAddEntryText(listbox, mapStr, mapColor, insertionIndex, 3);
- }
- else if (columns == 5)
- {
- GadgetListBoxAddEntryText(listbox, displayTimeBuffer, color, insertionIndex, 1);
- GadgetListBoxAddEntryText(listbox, displayDateBuffer, color, insertionIndex, 2);
- GadgetListBoxAddEntryText(listbox, header.versionString, color, insertionIndex, 3);
- GadgetListBoxAddEntryText(listbox, mapStr, mapColor, insertionIndex, 4);
- }
- else
- {
- DEBUG_CRASH(("Replay menu uses %d columns; expected either 4 or 5", columns));
- }
-
- // TheSuperHackers @performance Now stops processing when the list is full.
- if (insertionIndex == listboxLength - 1)
- break;
- }
- }
- GadgetListBoxSetSelected(listbox, 0);
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the single player menu */
-//-------------------------------------------------------------------------------------------------
-void ReplayMenuInit( WindowLayout *layout, void *userData )
-{
- TheShell->showShellMap(TRUE);
-
- // get ids for our children controls
- parentReplayMenuID = TheNameKeyGenerator->nameToKey( "ReplayMenu.wnd:ParentReplayMenu" );
- buttonLoadID = TheNameKeyGenerator->nameToKey( "ReplayMenu.wnd:ButtonLoadReplay" );
- buttonBackID = TheNameKeyGenerator->nameToKey( "ReplayMenu.wnd:ButtonBack" );
- listboxReplayFilesID = TheNameKeyGenerator->nameToKey( "ReplayMenu.wnd:ListboxReplayFiles" );
- buttonDeleteID = TheNameKeyGenerator->nameToKey( "ReplayMenu.wnd:ButtonDeleteReplay" );
- buttonCopyID = TheNameKeyGenerator->nameToKey( "ReplayMenu.wnd:ButtonCopyReplay" );
-
- parentReplayMenu = TheWindowManager->winGetWindowFromId( nullptr, parentReplayMenuID );
- buttonLoad = TheWindowManager->winGetWindowFromId( parentReplayMenu, buttonLoadID );
- buttonBack = TheWindowManager->winGetWindowFromId( parentReplayMenu, buttonBackID );
- listboxReplayFiles = TheWindowManager->winGetWindowFromId( parentReplayMenu, listboxReplayFilesID );
- listboxReplayFiles->winSetTooltipFunc(showReplayTooltip);
- buttonDelete = TheWindowManager->winGetWindowFromId( parentReplayMenu, buttonDeleteID );
- buttonCopy = TheWindowManager->winGetWindowFromId( parentReplayMenu, buttonCopyID );
-
-#if ENABLE_GUI_HACKS
- // TheSuperHackers @tweak Caball009 07/02/2026 The version column is wider than the time / date column.
- // Switch them so that there's enough space to show both time and date without a line break.
- ListboxData* list = static_cast(listboxReplayFiles->winGetUserData());
-
- if (list->columns == 4 && list->columnWidth[1] < list->columnWidth[2])
- std::swap(list->columnWidth[1], list->columnWidth[2]);
-#endif
-
- //Load the listbox shiznit
- GadgetListBoxReset(listboxReplayFiles);
- PopulateReplayFileListbox(listboxReplayFiles);
-
-#if defined(RTS_DEBUG)
- WinInstanceData instData;
- instData.init();
- BitSet( instData.m_style, GWS_PUSH_BUTTON | GWS_MOUSE_TRACK );
- instData.m_textLabelString = "Debug: Analyze Replay";
- instData.setTooltipText(L"Only Used in Debug and Internal!");
- buttonAnalyzeReplay = TheWindowManager->gogoGadgetPushButton( parentReplayMenu,
- WIN_STATUS_ENABLED | WIN_STATUS_IMAGE,
- 4, 4,
- 180, 26,
- &instData, nullptr, TRUE );
-#endif
-
- // show menu
- layout->hide( FALSE );
-
- // set keyboard focus to main parent
- TheWindowManager->winSetFocus( parentReplayMenu );
- justEntered = TRUE;
- initialGadgetDelay = 2;
- GameWindow *win = TheWindowManager->winGetWindowFromId(nullptr, TheNameKeyGenerator->nameToKey("ReplayMenu.wnd:GadgetParent"));
- if(win)
- win->winHide(TRUE);
- isShuttingDown = FALSE;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** single player menu shutdown method */
-//-------------------------------------------------------------------------------------------------
-void ReplayMenuShutdown( WindowLayout *layout, void *userData )
-{
-
- Bool popImmediate = *(Bool *)userData;
- if( popImmediate )
- {
-
- layout->hide( TRUE );
- TheShell->shutdownComplete( layout );
- return;
-
- }
-
- // our shutdown is complete
- TheTransitionHandler->reverse("ReplayMenuFade");
- isShuttingDown = TRUE;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** single player menu update method */
-//-------------------------------------------------------------------------------------------------
-void ReplayMenuUpdate( WindowLayout *layout, void *userData )
-{
- if(justEntered)
- {
- if(initialGadgetDelay == 1)
- {
- TheTransitionHandler->remove("MainMenuDefaultMenuLogoFade");
- TheTransitionHandler->setGroup("ReplayMenuFade");
- initialGadgetDelay = 2;
- justEntered = FALSE;
- }
- else
- initialGadgetDelay--;
- }
-
- if(callCopy)
- copyReplay();
- if(callDelete)
- deleteReplay();
- // We'll only be successful if we've requested to
- if(isShuttingDown && TheShell->isAnimFinished()&& TheTransitionHandler->isFinished())
- TheShell->shutdownComplete( layout );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Replay menu input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType ReplayMenuInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
-
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)buttonBack, buttonBackID );
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-
-}
-
-void reallyLoadReplay()
-{
- UnicodeString filename;
- Int selected;
- GadgetListBoxGetSelected( listboxReplayFiles, &selected );
- if(selected < 0)
- {
- MessageBoxOk(TheGameText->fetch("GUI:NoFileSelected"),TheGameText->fetch("GUI:PleaseSelectAFile"), nullptr);
- return;
- }
-
- filename = GetReplayFilenameFromListbox(listboxReplayFiles, selected);
-
- AsciiString asciiFilename;
- asciiFilename.translate(filename);
-
- TheRecorder->playbackFile(asciiFilename);
-
- if(parentReplayMenu != nullptr)
- {
- parentReplayMenu->winHide(TRUE);
- }
-}
-
-static void loadReplay(UnicodeString filename)
-{
- AsciiString asciiFilename;
- asciiFilename.translate(filename);
-
- RecorderClass::ReplayHeader header;
- ReplayGameInfo info;
- const MapMetaData *mapData;
-
- if(!readReplayMapInfo(asciiFilename, header, info, mapData))
- {
- // TheSuperHackers @bugfix Prompts a message box when the replay was deleted by the user while the Replay Menu was opened.
-
- UnicodeString title = TheGameText->FETCH_OR_SUBSTITUTE("GUI:ReplayFileNotFoundTitle", L"REPLAY NOT FOUND");
- UnicodeString body = TheGameText->FETCH_OR_SUBSTITUTE("GUI:ReplayFileNotFound", L"This replay cannot be loaded because the file no longer exists on this device.");
-
- MessageBoxOk(title, body, nullptr);
- }
- else if(mapData == nullptr)
- {
- // TheSuperHackers @bugfix Prompts a message box when the map used by the replay was not found.
-
- UnicodeString title = TheGameText->FETCH_OR_SUBSTITUTE("GUI:ReplayMapNotFoundTitle", L"MAP NOT FOUND");
- UnicodeString body = TheGameText->FETCH_OR_SUBSTITUTE("GUI:ReplayMapNotFound", L"This replay cannot be loaded because the map was not found on this device.");
-
- MessageBoxOk(title, body, nullptr);
- }
- else if(!TheRecorder->replayMatchesGameVersion(header))
- {
- // Pressing OK loads the replay.
-
- MessageBoxOkCancel(TheGameText->fetch("GUI:OlderReplayVersionTitle"), TheGameText->fetch("GUI:OlderReplayVersion"), reallyLoadReplay, nullptr);
- }
- else
- {
- TheRecorder->playbackFile(asciiFilename);
-
- if(parentReplayMenu != nullptr)
- {
- parentReplayMenu->winHide(TRUE);
- }
- }
-}
-
-//-------------------------------------------------------------------------------------------------
-/** single player menu window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType ReplayMenuSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CREATE:
- {
-
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GWM_DESTROY:
- {
-
- break;
-
- }
-
- // --------------------------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // if we're given the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- return MSG_HANDLED;
-
- }
- //---------------------------------------------------------------------------------------------
- case GLM_DOUBLE_CLICKED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
- if( controlID == listboxReplayFilesID )
- {
- int rowSelected = mData2;
-
- if (rowSelected >= 0)
- {
- UnicodeString filename = GetReplayFilenameFromListbox(listboxReplayFiles, rowSelected);
- loadReplay(filename);
- }
- }
- break;
- }
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- UnicodeString filename;
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
-#if defined(RTS_DEBUG)
- if( controlID == buttonAnalyzeReplay->winGetWindowId() )
- {
- if(listboxReplayFiles)
- {
- Int selected;
- GadgetListBoxGetSelected( listboxReplayFiles, &selected );
- if(selected < 0)
- {
- MessageBoxOk(L"Blah Blah",L"Please select something munkee boy", nullptr);
- break;
- }
-
- filename = GetReplayFilenameFromListbox(listboxReplayFiles, selected);
-
- AsciiString asciiFilename;
- asciiFilename.translate(filename);
- if (TheRecorder->analyzeReplay(asciiFilename))
- {
- do
- {
- TheRecorder->update();
- } while (TheRecorder->isPlaybackInProgress());
- }
- }
- }
- else
-#endif
- if( controlID == buttonLoadID )
- {
- if(listboxReplayFiles)
- {
- Int selected;
- GadgetListBoxGetSelected( listboxReplayFiles, &selected );
- if(selected < 0)
- {
- MessageBoxOk(TheGameText->fetch("GUI:NoFileSelected"),TheGameText->fetch("GUI:PleaseSelectAFile"), nullptr);
- break;
- }
-
- filename = GetReplayFilenameFromListbox(listboxReplayFiles, selected);
- loadReplay(filename);
- }
- }
- else if( controlID == buttonBackID )
- {
-
- // thou art directed to return to thy known solar system immediately!
- TheShell->pop();
-
- }
- else if( controlID == buttonDeleteID )
- {
- Int selected;
- GadgetListBoxGetSelected( listboxReplayFiles, &selected );
- if(selected < 0)
- {
- MessageBoxOk(TheGameText->fetch("GUI:NoFileSelected"),TheGameText->fetch("GUI:PleaseSelectAFile"), nullptr);
- break;
- }
- filename = GetReplayFilenameFromListbox(listboxReplayFiles, selected);
- MessageBoxYesNo(TheGameText->fetch("GUI:DeleteFile"), TheGameText->fetch("GUI:AreYouSureDelete"), deleteReplayFlag, nullptr);
- }
- else if( controlID == buttonCopyID )
- {
- Int selected;
- GadgetListBoxGetSelected( listboxReplayFiles, &selected );
- if(selected < 0)
- {
- MessageBoxOk(TheGameText->fetch("GUI:NoFileSelected"),TheGameText->fetch("GUI:PleaseSelectAFile"), nullptr);
- break;
- }
- filename = GetReplayFilenameFromListbox(listboxReplayFiles, selected);
- MessageBoxYesNo(TheGameText->fetch("GUI:CopyReplay"), TheGameText->fetch("GUI:AreYouSureCopy"), copyReplayFlag, nullptr);
- }
- break;
- }
-
- default:
- return MSG_IGNORED;
- }
-
- return MSG_HANDLED;
-}
-
-void deleteReplay()
-{
- callDelete = FALSE;
- Int selected;
- GadgetListBoxGetSelected( listboxReplayFiles, &selected );
- if(selected < 0)
- {
- MessageBoxOk(TheGameText->fetch("GUI:NoFileSelected"),TheGameText->fetch("GUI:PleaseSelectAFile"), nullptr);
- return;
- }
- AsciiString filename, translate;
- filename = TheRecorder->getReplayDir();
- translate.translate(GetReplayFilenameFromListbox(listboxReplayFiles, selected));
- filename.concat(translate);
- if(DeleteFile(filename.str()) == 0)
- {
- char buffer[1024];
- FormatMessage ( FORMAT_MESSAGE_FROM_SYSTEM, nullptr, GetLastError(), 0, buffer, sizeof(buffer), nullptr);
- UnicodeString errorStr;
- translate.set(buffer);
- errorStr.translate(translate);
- MessageBoxOk(TheGameText->fetch("GUI:Error"),errorStr, nullptr);
- }
- //Load the listbox shiznit
- GadgetListBoxReset(listboxReplayFiles);
- PopulateReplayFileListbox(listboxReplayFiles);
-}
-
-
-void copyReplay()
-{
- callCopy = FALSE;
- Int selected;
- GadgetListBoxGetSelected( listboxReplayFiles, &selected );
- if(selected < 0)
- {
- MessageBoxOk(TheGameText->fetch("GUI:NoFileSelected"),TheGameText->fetch("GUI:PleaseSelectAFile"), nullptr);
- return;
- }
- AsciiString filename, translate;
- filename = TheRecorder->getReplayDir();
- translate.translate(GetReplayFilenameFromListbox(listboxReplayFiles, selected));
- filename.concat(translate);
-
- char path[1024];
- LPITEMIDLIST pidl;
- SHGetSpecialFolderLocation(nullptr, CSIDL_DESKTOPDIRECTORY, &pidl);
- SHGetPathFromIDList(pidl,path);
- AsciiString newFilename;
- newFilename.set(path);
- newFilename.concat("\\");
- newFilename.concat(translate);
- if(CopyFile(filename.str(),newFilename.str(), FALSE) == 0)
- {
- wchar_t buffer[1024];
- FormatMessageW( FORMAT_MESSAGE_FROM_SYSTEM, nullptr, GetLastError(), 0, buffer, ARRAY_SIZE(buffer), nullptr);
- UnicodeString errorStr;
- errorStr.set(buffer);
- errorStr.trim();
- MessageBoxOk(TheGameText->fetch("GUI:Error"),errorStr, nullptr);
- }
-
-}
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp
deleted file mode 100644
index b9bc05763f5..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp
+++ /dev/null
@@ -1,265 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: SinglePlayerMenu.cpp /////////////////////////////////////////////////////////////////////
-// Author: Colin Day, October 2001
-// Description: Single Player Menus
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/GameEngine.h"
-#include "GameClient/AnimateWindowManager.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/Shell.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GameWindowManager.h"
-
-static Bool isShuttingDown = false;
-static Bool buttonPushed = false;
-//-------------------------------------------------------------------------------------------------
-/** This is called when a shutdown is complete for this menu */
-//-------------------------------------------------------------------------------------------------
-static void shutdownComplete( WindowLayout *layout )
-{
-
- isShuttingDown = false;
-
- // hide the layout
- layout->hide( TRUE );
-
- // our shutdown is complete
- TheShell->shutdownComplete( layout );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the single player menu */
-//-------------------------------------------------------------------------------------------------
-void SinglePlayerMenuInit( WindowLayout *layout, void *userData )
-{
- TheShell->showShellMap(TRUE);
- buttonPushed = false;
- isShuttingDown = false;
-
- // show menu
- layout->hide( FALSE );
-
- // set keyboard focus to main parent
- NameKeyType parentID = TheNameKeyGenerator->nameToKey( "SinglePlayerMenu.wnd:SinglePlayerMenuParent" );
- GameWindow *parent = TheWindowManager->winGetWindowFromId( nullptr, parentID );
- TheWindowManager->winSetFocus( parent );
-
- NameKeyType buttonNewID = TheNameKeyGenerator->nameToKey( "SinglePlayerMenu.wnd:ButtonNew" );
- GameWindow *buttonNew = TheWindowManager->winGetWindowFromId( nullptr, buttonNewID );
- TheShell->registerWithAnimateManager(buttonNew, WIN_ANIMATION_SLIDE_LEFT, TRUE,1);
-
- NameKeyType buttonLoadID = TheNameKeyGenerator->nameToKey( "SinglePlayerMenu.wnd:ButtonLoad" );
- GameWindow *buttonLoad = TheWindowManager->winGetWindowFromId( nullptr, buttonLoadID );
- TheShell->registerWithAnimateManager(buttonLoad, WIN_ANIMATION_SLIDE_LEFT, TRUE,200);
-
- NameKeyType buttonBackID = TheNameKeyGenerator->nameToKey( "SinglePlayerMenu.wnd:ButtonBack" );
- GameWindow *buttonBack = TheWindowManager->winGetWindowFromId( nullptr, buttonBackID );
- TheShell->registerWithAnimateManager(buttonBack, WIN_ANIMATION_SLIDE_RIGHT, TRUE,1);
-
-
- //TheShell->registerWithAnimateManager(parent, WIN_ANIMATION_SLIDE_TOP, TRUE);
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** single player menu shutdown method */
-//-------------------------------------------------------------------------------------------------
-void SinglePlayerMenuShutdown( WindowLayout *layout, void *userData )
-{
- isShuttingDown = true;
-
- // if we are shutting down for an immediate pop, skip the animations
- Bool popImmediate = *(Bool *)userData;
- if( popImmediate )
- {
-
- shutdownComplete( layout );
- return;
-
- }
-
- TheShell->reverseAnimatewindow();
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** single player menu update method */
-//-------------------------------------------------------------------------------------------------
-void SinglePlayerMenuUpdate( WindowLayout *layout, void *userData )
-{
-
- // We'll only be successful if we've requested to
- if(isShuttingDown && TheShell->isAnimFinished())
- shutdownComplete(layout);
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** SinglePlayer menu input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType SinglePlayerMenuInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
- if (buttonPushed)
- break;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
- NameKeyType buttonID = TheNameKeyGenerator->nameToKey( "SinglePlayerMenu.wnd:ButtonBack" );
- GameWindow *button = TheWindowManager->winGetWindowFromId( window, buttonID );
-
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)button, buttonID );
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** single player menu window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType SinglePlayerMenuSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- static NameKeyType buttonNew = NAMEKEY_INVALID;
- static NameKeyType buttonLoad = NAMEKEY_INVALID;
- static NameKeyType buttonBack = NAMEKEY_INVALID;
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CREATE:
- {
-
- // get ids for our children controls
- buttonNew = TheNameKeyGenerator->nameToKey( "SinglePlayerMenu.wnd:ButtonNew" );
- buttonLoad = TheNameKeyGenerator->nameToKey( "SinglePlayerMenu.wnd:ButtonLoad" );
- buttonBack = TheNameKeyGenerator->nameToKey( "SinglePlayerMenu.wnd:ButtonBack" );
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GWM_DESTROY:
- {
-
- break;
-
- }
-
- // --------------------------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- return MSG_HANDLED;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
- if (buttonPushed)
- break;
-
- if( controlID == buttonNew )
- {
-
- // open up the map select menu
- TheShell->push( "Menus/MapSelectMenu.wnd" );
- buttonPushed = true;
-
- }
- else if( controlID == buttonLoad )
- {
-
- }
- else if( controlID == buttonBack )
- {
-
- // thou art directed to return to thy known solar system immediately!
- TheShell->pop();
- buttonPushed = true;
-
- }
-
- break;
-
- }
-
- default:
- return MSG_IGNORED;
- }
-
- return MSG_HANDLED;
-}
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp
deleted file mode 100644
index c1b7a4058d1..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp
+++ /dev/null
@@ -1,1438 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////////////
-// FILE: WOLBuddyOverlay.cpp
-// Author: Chris Huybregts, November 2001
-// Description: Lan Lobby Menu
-///////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/AudioEventRTS.h"
-#include "Common/PlayerList.h"
-#include "Common/Player.h"
-#include "GameClient/GameText.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/Shell.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetListBox.h"
-#include "GameClient/GadgetPushButton.h"
-#include "GameClient/GadgetStaticText.h"
-#include "GameClient/GadgetTextEntry.h"
-#include "GameClient/GadgetRadioButton.h"
-#include "GameClient/Display.h"
-#include "GameNetwork/GameSpyOverlay.h"
-#include "GameNetwork/GameSpy/PeerDefs.h"
-#include "GameNetwork/GameSpy/BuddyDefs.h"
-#include "GameNetwork/GameSpy/BuddyThread.h"
-#include "GameNetwork/GameSpy/LobbyUtils.h"
-#include "GameNetwork/GameSpy/PersistentStorageDefs.h"
-#include "GameNetwork/GameSpy/PersistentStorageThread.h"
-#include "GameNetwork/GameSpy/ThreadUtils.h"
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
-
-
-// window ids ------------------------------------------------------------------------------
-static NameKeyType parentID = NAMEKEY_INVALID;
-static NameKeyType buttonHideID = NAMEKEY_INVALID;
-static NameKeyType buttonAddBuddyID = NAMEKEY_INVALID;
-static NameKeyType buttonDeleteBuddyID = NAMEKEY_INVALID;
-static NameKeyType textEntryID = NAMEKEY_INVALID;
-static NameKeyType listboxBuddyID = NAMEKEY_INVALID;
-static NameKeyType listboxChatID = NAMEKEY_INVALID;
-static NameKeyType buttonAcceptBuddyID = NAMEKEY_INVALID;
-static NameKeyType buttonDenyBuddyID = NAMEKEY_INVALID;
-static NameKeyType radioButtonBuddiesID = NAMEKEY_INVALID;
-static NameKeyType radioButtonIgnoreID = NAMEKEY_INVALID;
-static NameKeyType parentBuddiesID = NAMEKEY_INVALID;
-static NameKeyType parentIgnoreID = NAMEKEY_INVALID;
-static NameKeyType listboxIgnoreID = NAMEKEY_INVALID;
-static NameKeyType buttonNotificationID = NAMEKEY_INVALID;
-
-
-// Window Pointers ------------------------------------------------------------------------
-static GameWindow *parent = nullptr;
-static GameWindow *buttonHide = nullptr;
-static GameWindow *buttonAddBuddy = nullptr;
-static GameWindow *buttonDeleteBuddy = nullptr;
-static GameWindow *textEntry = nullptr;
-static GameWindow *listboxBuddy = nullptr;
-static GameWindow *listboxChat = nullptr;
-static GameWindow *buttonAcceptBuddy = nullptr;
-static GameWindow *buttonDenyBuddy = nullptr;
-static GameWindow *radioButtonBuddies = nullptr;
-static GameWindow *radioButtonIgnore = nullptr;
-static GameWindow *parentBuddies = nullptr;
-static GameWindow *parentIgnore = nullptr;
-static GameWindow *listboxIgnore = nullptr;
-
-static Bool isOverlayActive = false;
-void insertChat( BuddyMessage msg );
-// RightClick pointers ---------------------------------------------------------------------
-static GameWindow *rcMenu = nullptr;
-static WindowLayout *noticeLayout = nullptr;
-static UnsignedInt noticeExpires = 0;
-enum { NOTIFICATION_EXPIRES = 3000 };
-
-void setUnignoreText( WindowLayout *layout, AsciiString nick, GPProfile id);
-void refreshIgnoreList();
-void showNotificationBox( AsciiString nick, UnicodeString message);
-void deleteNotificationBox();
-static Bool lastNotificationWasStatus = FALSE;
-static Int numOnlineInNotification = 0;
-
-class BuddyControls
-{
-public:
- BuddyControls();
- GameWindow *listboxChat;
- NameKeyType listboxChatID;
-
- GameWindow *listboxBuddies;
- NameKeyType listboxBuddiesID;
-
- GameWindow *textEntryEdit;
- NameKeyType textEntryEditID;
- Bool isInit;
-};
-
-static BuddyControls buddyControls;
-BuddyControls::BuddyControls( )
-{
- listboxChat = nullptr;
- listboxChatID = NAMEKEY_INVALID;
- listboxBuddies = nullptr;
- listboxBuddiesID = NAMEKEY_INVALID;
- textEntryEdit = nullptr;
- textEntryEditID = NAMEKEY_INVALID;
- isInit = FALSE;
-}
-// At this point I don't give a damn about how good this way is. I'm doing it anyway.
-enum
-{
- BUDDY_RESETALL_CRAP = -1,
- BUDDY_WINDOW_BUDDIES = 0,
- BUDDY_WINDOW_DIPLOMACY,
- BUDDY_WINDOW_WELCOME_SCREEN,
-};
-
-void InitBuddyControls(Int type)
-{
- if(!TheGameSpyInfo)
- {
- buddyControls.textEntryEditID = NAMEKEY_INVALID;
- buddyControls.textEntryEdit = nullptr;
- buddyControls.listboxBuddiesID = NAMEKEY_INVALID;
- buddyControls.listboxChatID = NAMEKEY_INVALID;
- buddyControls.listboxBuddies = nullptr;
- buddyControls.listboxChat = nullptr;
- buddyControls.isInit = FALSE;
- return;
- }
- switch (type) {
- case BUDDY_RESETALL_CRAP:
- buddyControls.textEntryEditID = NAMEKEY_INVALID;
- buddyControls.textEntryEdit = nullptr;
- buddyControls.listboxBuddiesID = NAMEKEY_INVALID;
- buddyControls.listboxChatID = NAMEKEY_INVALID;
- buddyControls.listboxBuddies = nullptr;
- buddyControls.listboxChat = nullptr;
- buddyControls.isInit = FALSE;
- break;
- case BUDDY_WINDOW_BUDDIES:
- buddyControls.textEntryEditID = TheNameKeyGenerator->nameToKey( "WOLBuddyOverlay.wnd:TextEntryChat" );
- buddyControls.textEntryEdit = TheWindowManager->winGetWindowFromId(nullptr, buddyControls.textEntryEditID);
- buddyControls.listboxBuddiesID = TheNameKeyGenerator->nameToKey( "WOLBuddyOverlay.wnd:ListboxBuddies" );
- buddyControls.listboxChatID = TheNameKeyGenerator->nameToKey( "WOLBuddyOverlay.wnd:ListboxBuddyChat" );
- buddyControls.listboxBuddies = TheWindowManager->winGetWindowFromId( nullptr, buddyControls.listboxBuddiesID );
- buddyControls.listboxChat = TheWindowManager->winGetWindowFromId( nullptr, buddyControls.listboxChatID);
- GadgetTextEntrySetText(buddyControls.textEntryEdit, UnicodeString::TheEmptyString);
- buddyControls.isInit = TRUE;
- break;
- case BUDDY_WINDOW_DIPLOMACY:
- buddyControls.textEntryEditID = TheNameKeyGenerator->nameToKey( "Diplomacy.wnd:TextEntryChat" );
- buddyControls.textEntryEdit = TheWindowManager->winGetWindowFromId(nullptr, buddyControls.textEntryEditID);
- buddyControls.listboxBuddiesID = TheNameKeyGenerator->nameToKey( "Diplomacy.wnd:ListboxBuddies" );
- buddyControls.listboxChatID = TheNameKeyGenerator->nameToKey( "Diplomacy.wnd:ListboxBuddyChat" );
- buddyControls.listboxBuddies = TheWindowManager->winGetWindowFromId( nullptr, buddyControls.listboxBuddiesID );
- buddyControls.listboxChat = TheWindowManager->winGetWindowFromId( nullptr, buddyControls.listboxChatID);
- GadgetTextEntrySetText(buddyControls.textEntryEdit, UnicodeString::TheEmptyString);
- buddyControls.isInit = TRUE;
- break;
- case BUDDY_WINDOW_WELCOME_SCREEN:
- break;
- default:
- DEBUG_CRASH(("Well, you really shouldn't have gotten here, if you really care about GUI Bugs, search for this string, you you don't care, call chris (who probably doesn't care either"));
- }
-
-}
-
-WindowMsgHandledType BuddyControlSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2)
-{
- if(!TheGameSpyInfo || TheGameSpyInfo->getLocalProfileID() == 0 || !buddyControls.isInit)
- {
- return MSG_IGNORED;
- }
-
- switch( msg )
- {
- case GLM_RIGHT_CLICKED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if( controlID == buddyControls.listboxBuddiesID )
- {
- RightClickStruct *rc = (RightClickStruct *)mData2;
- WindowLayout *rcLayout;
- if(rc->pos < 0)
- break;
-
- GPProfile profileID = (GPProfile)GadgetListBoxGetItemData(control, rc->pos, 0);
- RCItemType itemType = (RCItemType)(Int)GadgetListBoxGetItemData(control, rc->pos, 1);
- UnicodeString nick = GadgetListBoxGetText(control, rc->pos);
-
- GadgetListBoxSetSelected(control, rc->pos);
- if (itemType == ITEM_BUDDY)
- rcLayout = TheWindowManager->winCreateLayout("Menus/RCBuddiesMenu.wnd");
- else if (itemType == ITEM_REQUEST)
- rcLayout = TheWindowManager->winCreateLayout("Menus/RCBuddyRequestMenu.wnd");
- else
- rcLayout = TheWindowManager->winCreateLayout("Menus/RCNonBuddiesMenu.wnd");
- rcMenu = rcLayout->getFirstWindow();
- rcMenu->winGetLayout()->runInit();
- rcMenu->winBringToTop();
- rcMenu->winHide(FALSE);
-
-
- ICoord2D rcSize, rcPos;
- rcMenu->winGetSize(&rcSize.x, &rcSize.y);
- rcPos.x = rc->mouseX;
- rcPos.y = rc->mouseY;
- if(rc->mouseX + rcSize.x > TheDisplay->getWidth())
- rcPos.x = TheDisplay->getWidth() - rcSize.x;
- if(rc->mouseY + rcSize.y > TheDisplay->getHeight())
- rcPos.y = TheDisplay->getHeight() - rcSize.y;
- rcMenu->winSetPosition(rcPos.x, rcPos.y);
-
-
- GameSpyRCMenuData *rcData = NEW GameSpyRCMenuData;
- rcData->m_id = profileID;
- rcData->m_nick.translate(nick);
- rcData->m_itemType = itemType;
- setUnignoreText(rcLayout, rcData->m_nick, rcData->m_id);
- rcMenu->winSetUserData((void *)rcData);
- TheWindowManager->winSetLoneWindow(rcMenu);
- }
- else
- return MSG_IGNORED;
- break;
- }
- case GEM_EDIT_DONE:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
- if(controlID != buddyControls.textEntryEditID)
- return MSG_IGNORED;
-
- // see if someone's selected
- Int selected = -1;
- GadgetListBoxGetSelected(buddyControls.listboxBuddies, &selected);
- if (selected >= 0)
- {
- GPProfile selectedProfile = (GPProfile)GadgetListBoxGetItemData(buddyControls.listboxBuddies, selected);
- BuddyInfoMap *m = TheGameSpyInfo->getBuddyMap();
- BuddyInfoMap::iterator recipIt = m->find(selectedProfile);
- if (recipIt == m->end())
- break;
-
- DEBUG_LOG(("Trying to send a buddy message to %d.", selectedProfile));
- if (TheGameSpyGame && TheGameSpyGame->isInGame() && TheGameSpyGame->isGameInProgress() &&
- !ThePlayerList->getLocalPlayer()->isPlayerActive())
- {
- DEBUG_LOG(("I'm dead - gotta look for cheats."));
- for (Int i=0; igetGameSpySlot(i)->getProfileID()));
- if (TheGameSpyGame->getGameSpySlot(i)->getProfileID() == selectedProfile)
- {
- // can't send to someone in our game if we're dead/observing. security breach and all that. no seances for you.
- if (buddyControls.listboxChat)
- {
- GadgetListBoxAddEntryText( buddyControls.listboxChat, TheGameText->fetch("Buddy:CantTalkToIngameBuddy"),
- GameSpyColor[GSCOLOR_DEFAULT], -1, -1 );
- }
- return MSG_HANDLED;
- }
- }
- }
-
- // read the user's input and clear the entry box
- UnicodeString txtInput;
- txtInput.set(GadgetTextEntryGetText( buddyControls.textEntryEdit ));
- GadgetTextEntrySetText(buddyControls.textEntryEdit, UnicodeString::TheEmptyString);
- txtInput.trim();
- if (!txtInput.isEmpty())
- {
- // Send the message
- BuddyRequest req;
- req.buddyRequestType = BuddyRequest::BUDDYREQUEST_MESSAGE;
- wcslcpy(req.arg.message.text, txtInput.str(), MAX_BUDDY_CHAT_LEN);
- req.arg.message.recipient = selectedProfile;
- TheGameSpyBuddyMessageQueue->addRequest(req);
-
- // save message for future incarnations of the buddy window
- BuddyMessageList *messages = TheGameSpyInfo->getBuddyMessages();
- BuddyMessage message;
- message.m_timestamp = time(nullptr);
- message.m_senderID = TheGameSpyInfo->getLocalProfileID();
- message.m_senderNick = TheGameSpyInfo->getLocalBaseName();
- message.m_recipientID = selectedProfile;
- message.m_recipientNick = recipIt->second.m_name;
- message.m_message = UnicodeString(req.arg.message.text);
- messages->push_back(message);
-
- // put message on screen
- insertChat(message);
- }
- }
- else
- {
- // nobody selected. Prompt the user.
- if (buddyControls.listboxChat)
- {
- GadgetListBoxAddEntryText( buddyControls.listboxChat, TheGameText->fetch("Buddy:SelectBuddyToChat"),
- GameSpyColor[GSCOLOR_DEFAULT], -1, -1 );
- }
- }
- break;
- }
- default:
- return MSG_IGNORED;
- }
- return MSG_HANDLED;
-}
-
-
-void insertChat( BuddyMessage msg )
-{
- if (buddyControls.listboxChat)
- {
- BuddyInfoMap *m = TheGameSpyInfo->getBuddyMap();
- BuddyInfoMap::iterator senderIt = m->find(msg.m_senderID);
- BuddyInfoMap::iterator recipientIt = m->find(msg.m_recipientID);
- Bool localSender = (msg.m_senderID == TheGameSpyInfo->getLocalProfileID());
- UnicodeString s;
- //UnicodeString timeStr = UnicodeString(_wctime( (const time_t *)&msg.m_timestamp ));
- UnicodeString timeStr;
- if (localSender /*&& recipientIt != m->end()*/)
- {
- s.format(L"[%hs -> %hs] %s", TheGameSpyInfo->getLocalBaseName().str(), msg.m_recipientNick.str(), msg.m_message.str());
- Int index = GadgetListBoxAddEntryText( buddyControls.listboxChat, s, GameSpyColor[GSCOLOR_PLAYER_SELF], -1, -1 );
- GadgetListBoxAddEntryText( buddyControls.listboxChat, timeStr, GameSpyColor[GSCOLOR_PLAYER_SELF], index, 1);
- }
- else if (!localSender /*&& senderIt != m->end()*/)
- {
- if (!msg.m_senderID)
- {
- s = msg.m_message;
- Int index = GadgetListBoxAddEntryText( buddyControls.listboxChat, s, GameSpyColor[GSCOLOR_DEFAULT], -1, -1 );
- GadgetListBoxAddEntryText( buddyControls.listboxChat, timeStr, GameSpyColor[GSCOLOR_DEFAULT], index, 1);
- }
- else
- {
- s.format(L"[%hs] %s", msg.m_senderNick.str(), msg.m_message.str());
- Int index = GadgetListBoxAddEntryText( buddyControls.listboxChat, s, GameSpyColor[GSCOLOR_PLAYER_BUDDY], -1, -1 );
- GadgetListBoxAddEntryText( buddyControls.listboxChat, timeStr, GameSpyColor[GSCOLOR_PLAYER_BUDDY], index, 1);
- }
- }
- }
-}
-
-void updateBuddyInfo()
-{
- if (!TheGameSpyBuddyMessageQueue->isConnected())
- {
- GadgetListBoxReset(buddyControls.listboxBuddies);
- return;
- }
-
- if (!buddyControls.isInit)
- return;
-
- int selected;
- GPProfile selectedProfile = 0;
- int visiblePos = GadgetListBoxGetTopVisibleEntry(buddyControls.listboxBuddies);
-
- GadgetListBoxGetSelected(buddyControls.listboxBuddies, &selected);
- if (selected >= 0)
- selectedProfile = (GPProfile)GadgetListBoxGetItemData(buddyControls.listboxBuddies, selected);
-
- selected = -1;
- GadgetListBoxReset(buddyControls.listboxBuddies);
-
- // Add buddies
- BuddyInfoMap *buddies = TheGameSpyInfo->getBuddyMap();
- BuddyInfoMap::iterator bIt;
- for (bIt = buddies->begin(); bIt != buddies->end(); ++bIt)
- {
- BuddyInfo info = bIt->second;
- GPProfile profileID = bIt->first;
-
- // insert name into box
- UnicodeString formatStr;
- formatStr.translate(info.m_name.str());//, info.m_status, info.m_statusString.str(), info.m_locationString.str());
- Color nameColor = (TheGameSpyInfo->isSavedIgnored(profileID)) ?
- GameSpyColor[GSCOLOR_PLAYER_IGNORED] : GameSpyColor[GSCOLOR_PLAYER_BUDDY];
- int index = GadgetListBoxAddEntryText(buddyControls.listboxBuddies, formatStr, nameColor, -1, -1);
-
- // insert status into box
- AsciiString marker;
- marker.format("Buddy:%ls", info.m_statusString.str());
- if (!info.m_statusString.compareNoCase(L"Offline") ||
- !info.m_statusString.compareNoCase(L"Online") ||
- !info.m_statusString.compareNoCase(L"Matching"))
- {
- formatStr = TheGameText->fetch(marker);
- }
- else if (!info.m_statusString.compareNoCase(L"Staging") ||
- !info.m_statusString.compareNoCase(L"Loading") ||
- !info.m_statusString.compareNoCase(L"Playing"))
- {
- formatStr.format(TheGameText->fetch(marker), info.m_locationString.str());
- }
- else if (!info.m_statusString.compareNoCase(L"Chatting"))
- {
- UnicodeString roomName;
- GroupRoomMap::iterator gIt = TheGameSpyInfo->getGroupRoomList()->find( _wtoi(info.m_locationString.str()) );
- if (gIt != TheGameSpyInfo->getGroupRoomList()->end())
- {
- AsciiString s;
- s.format("GUI:%s", gIt->second.m_name.str());
- roomName = TheGameText->fetch(s);
- }
- formatStr.format(TheGameText->fetch(marker), roomName.str());
- }
- else
- {
- formatStr = info.m_statusString;
- }
- GadgetListBoxAddEntryText(buddyControls.listboxBuddies, formatStr, GameSpyColor[GSCOLOR_DEFAULT], index, 1);
- GadgetListBoxSetItemData(buddyControls.listboxBuddies, (void *)(profileID), index, 0 );
- GadgetListBoxSetItemData(buddyControls.listboxBuddies, (void *)(ITEM_BUDDY), index, 1 );
-
- if (profileID == selectedProfile)
- selected = index;
- }
-
- // add requests
- buddies = TheGameSpyInfo->getBuddyRequestMap();
- for (bIt = buddies->begin(); bIt != buddies->end(); ++bIt)
- {
- BuddyInfo info = bIt->second;
- GPProfile profileID = bIt->first;
-
- // insert name into box
- UnicodeString formatStr;
- formatStr.translate(info.m_name.str());
- int index = GadgetListBoxAddEntryText(buddyControls.listboxBuddies, formatStr, GameSpyColor[GSCOLOR_DEFAULT], -1, -1);
- GadgetListBoxSetItemData(buddyControls.listboxBuddies, (void *)(profileID), index, 0 );
-
- // insert status into box
- formatStr = TheGameText->fetch("GUI:BuddyAddReq");
- GadgetListBoxAddEntryText(buddyControls.listboxBuddies, formatStr, GameSpyColor[GSCOLOR_DEFAULT], index, 1);
- GadgetListBoxSetItemData(buddyControls.listboxBuddies, (void *)(ITEM_REQUEST), index, 1 );
-
- if (profileID == selectedProfile)
- selected = index;
- }
-
-
- // select the same guy
- if (selected >= 0)
- {
- GadgetListBoxSetSelected(buddyControls.listboxBuddies, selected);
- }
-
- // view the same spot
- GadgetListBoxSetTopVisibleEntry(buddyControls.listboxBuddies, visiblePos);
-}
-
-void HandleBuddyResponses()
-{
- if (TheGameSpyBuddyMessageQueue)
- {
- BuddyResponse resp;
- if (TheGameSpyBuddyMessageQueue->getResponse( resp ))
- {
- switch (resp.buddyResponseType)
- {
- case BuddyResponse::BUDDYRESPONSE_LOGIN:
- {
- deleteNotificationBox();
- }
- break;
- case BuddyResponse::BUDDYRESPONSE_DISCONNECT:
- {
- lastNotificationWasStatus = FALSE;
- numOnlineInNotification = 0;
- showNotificationBox(AsciiString::TheEmptyString, TheGameText->fetch("Buddy:MessageDisconnected"));
- }
- break;
- case BuddyResponse::BUDDYRESPONSE_MESSAGE:
- {
- if ( wcscmp(resp.arg.message.text, L"I have authorized your request to add me to your list") == 0 )
- break;
-
- if (TheGameSpyInfo->isSavedIgnored(resp.profile))
- {
- //DEBUG_CRASH(("Player is ignored!"));
- break; // no buddy messages from ignored people
- }
-
- // save message for future incarnations of the buddy window
- BuddyMessageList *messages = TheGameSpyInfo->getBuddyMessages();
- BuddyMessage message;
- message.m_timestamp = resp.arg.message.date;
- message.m_senderID = resp.profile;
- message.m_recipientID = TheGameSpyInfo->getLocalProfileID();
- message.m_recipientNick = TheGameSpyInfo->getLocalBaseName();
- message.m_message = resp.arg.message.text;
- // insert status into box
- BuddyInfoMap *m = TheGameSpyInfo->getBuddyMap();
- BuddyInfoMap::iterator senderIt = m->find(message.m_senderID);
- AsciiString nick;
- if (senderIt != m->end())
- nick = senderIt->second.m_name.str();
- else
- nick = resp.arg.message.nick;
- message.m_senderNick = nick;
- messages->push_back(message);
-
- DEBUG_LOG(("Inserting buddy chat from '%s'/'%s'", nick.str(), resp.arg.message.nick));
-
- // put message on screen
- insertChat(message);
-
- // play audio notification
- AudioEventRTS buddyMsgAudio("GUIMessageReceived");
- if( TheAudio )
- {
- TheAudio->addAudioEvent( &buddyMsgAudio );
- }
-
- UnicodeString snippet = message.m_message;
- snippet.truncateTo(11);
- UnicodeString s;
- s.format(TheGameText->fetch("Buddy:MessageNotification"), nick.str(), snippet.str());
- lastNotificationWasStatus = FALSE;
- numOnlineInNotification = 0;
- showNotificationBox(AsciiString::TheEmptyString, s);
- }
- break;
- case BuddyResponse::BUDDYRESPONSE_REQUEST:
- {
- // save request for future incarnations of the buddy window
- BuddyInfoMap *m = TheGameSpyInfo->getBuddyRequestMap();
- BuddyInfo info;
- info.m_countryCode = resp.arg.request.countrycode;
- info.m_email = resp.arg.request.email;
- info.m_name = resp.arg.request.nick;
- info.m_id = resp.profile;
- info.m_status = (GPEnum)0;
- info.m_statusString = resp.arg.request.text;
- (*m)[resp.profile] = info;
-
- // TODO: put request on screen
- updateBuddyInfo();
- // insert status into box
- lastNotificationWasStatus = FALSE;
- numOnlineInNotification = 0;
- showNotificationBox(info.m_name, TheGameText->fetch("Buddy:AddNotification"));
- }
- break;
- case BuddyResponse::BUDDYRESPONSE_STATUS:
- {
- BuddyInfoMap *m = TheGameSpyInfo->getBuddyMap();
- BuddyInfoMap::const_iterator bit = m->find(resp.profile);
- Bool seenPreviously = FALSE;
- GPEnum oldStatus = GP_OFFLINE;
- GPEnum newStatus = resp.arg.status.status;
- if (bit != m->end())
- {
- seenPreviously = TRUE;
- oldStatus = (*m)[resp.profile].m_status;
- }
- BuddyInfo info;
- info.m_countryCode = resp.arg.status.countrycode;
- info.m_email = resp.arg.status.email;
- info.m_name = resp.arg.status.nick;
- info.m_id = resp.profile;
- info.m_status = newStatus;
- info.m_statusString = UnicodeString(MultiByteToWideCharSingleLine(resp.arg.status.statusString).c_str());
- info.m_locationString = UnicodeString(MultiByteToWideCharSingleLine(resp.arg.status.location).c_str());
- (*m)[resp.profile] = info;
-
- updateBuddyInfo();
- PopulateLobbyPlayerListbox();
- RefreshGameListBoxes();
- if ( (newStatus == GP_OFFLINE && seenPreviously) ||
- (newStatus == GP_ONLINE && (oldStatus == GP_OFFLINE || !seenPreviously)) )
- //if (!info.m_statusString.compareNoCase(L"Offline") ||
- //!info.m_statusString.compareNoCase(L"Online"))
- {
- // insert status into box
- AsciiString marker;
- marker.format("Buddy:%lsNotification", info.m_statusString.str());
-
- lastNotificationWasStatus = TRUE;
- if (newStatus != GP_OFFLINE)
- ++numOnlineInNotification;
-
- showNotificationBox(info.m_name, TheGameText->fetch(marker));
- }
- else if( newStatus == GP_RECV_GAME_INVITE && !seenPreviously)
- {
- lastNotificationWasStatus = TRUE;
- if (newStatus != GP_OFFLINE)
- ++numOnlineInNotification;
-
- showNotificationBox(info.m_name, TheGameText->fetch("Buddy:OnlineNotification"));
- }
- }
- break;
- }
- }
- }
- else
- {
- DEBUG_CRASH(("No buddy message queue!"));
- }
- if(noticeLayout && timeGetTime() > noticeExpires)
- {
- deleteNotificationBox();
- }
-}
-
-void showNotificationBox( AsciiString nick, UnicodeString message)
-{
-// if(!GameSpyIsOverlayOpen(GSOVERLAY_BUDDY))
-// return;
- if( !noticeLayout )
- noticeLayout = TheWindowManager->winCreateLayout( "Menus/PopupBuddyListNotification.wnd" );
- noticeLayout->hide( FALSE );
- if (buttonNotificationID == NAMEKEY_INVALID)
- {
- buttonNotificationID = TheNameKeyGenerator->nameToKey("PopupBuddyListNotification.wnd:ButtonNotification");
- }
- GameWindow *win = TheWindowManager->winGetWindowFromId(nullptr,buttonNotificationID);
- if(!win)
- {
- deleteNotificationBox();
- return;
- }
-
- if (lastNotificationWasStatus && numOnlineInNotification > 1)
- {
- message = TheGameText->fetch("Buddy:MultipleOnlineNotification");
- }
-
- if (nick.isNotEmpty())
- message.format(message, nick.str());
- GadgetButtonSetText(win, message);
- //GadgetStaticTextSetText(win, message);
- noticeExpires = timeGetTime() + NOTIFICATION_EXPIRES;
- noticeLayout->bringForward();
-
- AudioEventRTS buttonClick("GUICommunicatorIncoming");
-
- if( TheAudio )
- {
- TheAudio->addAudioEvent( &buttonClick );
- }
-
-}
-
-void deleteNotificationBox()
-{
- lastNotificationWasStatus = FALSE;
- numOnlineInNotification = 0;
- if(noticeLayout)
- {
- noticeLayout->destroyWindows();
- deleteInstance(noticeLayout);
- noticeLayout = nullptr;
- }
-}
-
-void PopulateOldBuddyMessages()
-{
- // show previous messages
- BuddyMessageList *messages = TheGameSpyInfo->getBuddyMessages();
- for (BuddyMessageList::iterator mIt = messages->begin(); mIt != messages->end(); ++mIt)
- {
- BuddyMessage message = *mIt;
- insertChat(message);
- }
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the WOL Buddy Overlay */
-//-------------------------------------------------------------------------------------------------
-void WOLBuddyOverlayInit( WindowLayout *layout, void *userData )
-{
- parentID = TheNameKeyGenerator->nameToKey( "WOLBuddyOverlay.wnd:BuddyMenuParent" );
- buttonHideID = TheNameKeyGenerator->nameToKey( "WOLBuddyOverlay.wnd:ButtonHide" );
- buttonAddBuddyID = TheNameKeyGenerator->nameToKey( "WOLBuddyOverlay.wnd:ButtonAdd" );
- buttonDeleteBuddyID = TheNameKeyGenerator->nameToKey( "WOLBuddyOverlay.wnd:ButtonDelete" );
- //textEntryID = TheNameKeyGenerator->nameToKey( "WOLBuddyOverlay.wnd:TextEntryChat" );
- //listboxBuddyID = TheNameKeyGenerator->nameToKey( "WOLBuddyOverlay.wnd:ListboxBuddies" );
- //listboxChatID = TheNameKeyGenerator->nameToKey( "WOLBuddyOverlay.wnd:ListboxBuddyChat" );
- buttonAcceptBuddyID = TheNameKeyGenerator->nameToKey( "WOLBuddyOverlay.wnd:ButtonYes" );
- buttonDenyBuddyID = TheNameKeyGenerator->nameToKey( "WOLBuddyOverlay.wnd:ButtonNo" );
- radioButtonBuddiesID = TheNameKeyGenerator->nameToKey( "WOLBuddyOverlay.wnd:RadioButtonBuddies" );
- radioButtonIgnoreID = TheNameKeyGenerator->nameToKey( "WOLBuddyOverlay.wnd:RadioButtonIgnore" );
- parentBuddiesID = TheNameKeyGenerator->nameToKey( "WOLBuddyOverlay.wnd:BuddiesParent" );
- parentIgnoreID = TheNameKeyGenerator->nameToKey( "WOLBuddyOverlay.wnd:IgnoreParent" );
- listboxIgnoreID = TheNameKeyGenerator->nameToKey( "WOLBuddyOverlay.wnd:ListboxIgnore" );
-
-
- parent = TheWindowManager->winGetWindowFromId( nullptr, parentID );
- buttonHide = TheWindowManager->winGetWindowFromId( parent, buttonHideID);
- buttonAddBuddy = TheWindowManager->winGetWindowFromId( parent, buttonAddBuddyID);
- buttonDeleteBuddy = TheWindowManager->winGetWindowFromId( parent, buttonDeleteBuddyID);
- // textEntry = TheWindowManager->winGetWindowFromId( parent, textEntryID);
- //listboxBuddy = TheWindowManager->winGetWindowFromId( parent, listboxBuddyID);
- //listboxChat = TheWindowManager->winGetWindowFromId( parent, listboxChatID);
- buttonAcceptBuddy = TheWindowManager->winGetWindowFromId( parent, buttonAcceptBuddyID);
- buttonDenyBuddy = TheWindowManager->winGetWindowFromId( parent, buttonDenyBuddyID);
- radioButtonBuddies = TheWindowManager->winGetWindowFromId( parent, radioButtonBuddiesID);
- radioButtonIgnore = TheWindowManager->winGetWindowFromId( parent, radioButtonIgnoreID);
- parentBuddies = TheWindowManager->winGetWindowFromId( parent, parentBuddiesID);
- parentIgnore = TheWindowManager->winGetWindowFromId( parent, parentIgnoreID);
- listboxIgnore = TheWindowManager->winGetWindowFromId( parent, listboxIgnoreID);
-
- InitBuddyControls(BUDDY_WINDOW_BUDDIES);
-
- GadgetRadioSetSelection(radioButtonBuddies,FALSE);
- parentBuddies->winHide(FALSE);
- parentIgnore->winHide(TRUE);
-
- //GadgetTextEntrySetText(textEntry, UnicodeString::TheEmptyString);
-
- PopulateOldBuddyMessages();
-
- // Show Menu
- layout->hide( FALSE );
-
- // Set Keyboard to Main Parent
- TheWindowManager->winSetFocus( parent );
-
- isOverlayActive = true;
- updateBuddyInfo();
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Buddy Overlay shutdown method */
-//-------------------------------------------------------------------------------------------------
-void WOLBuddyOverlayShutdown( WindowLayout *layout, void *userData )
-{
- listboxIgnore = nullptr;
-
- // hide menu
- layout->hide( TRUE );
-
- // our shutdown is complete
- //TheShell->shutdownComplete( layout );
-
- isOverlayActive = false;
-
- InitBuddyControls(BUDDY_RESETALL_CRAP);
-
-}
-
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Buddy Overlay update method */
-//-------------------------------------------------------------------------------------------------
-void WOLBuddyOverlayUpdate( WindowLayout * layout, void *userData)
-{
- if (!TheGameSpyBuddyMessageQueue || !TheGameSpyBuddyMessageQueue->isConnected())
- GameSpyCloseOverlay(GSOVERLAY_BUDDY);
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Buddy Overlay input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType WOLBuddyOverlayInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)buttonHide, buttonHideID );
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Buddy Overlay window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType WOLBuddyOverlaySystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- UnicodeString txtInput;
- if(BuddyControlSystem(window, msg, mData1, mData2) == MSG_HANDLED)
- {
- return MSG_HANDLED;
- }
- switch( msg )
- {
-
-
- case GWM_CREATE:
- {
-
- break;
- }
-
- case GWM_DESTROY:
- {
- break;
- }
-
- case GWM_INPUT_FOCUS:
- {
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- return MSG_HANDLED;
- }
- case GLM_RIGHT_CLICKED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if( controlID == listboxIgnoreID )
- {
- RightClickStruct *rc = (RightClickStruct *)mData2;
- WindowLayout *rcLayout;
- if(rc->pos < 0)
- break;
-
- Bool isBuddy = false, isRequest = false;
- GPProfile profileID = (GPProfile)GadgetListBoxGetItemData(control, rc->pos);
- UnicodeString nick = GadgetListBoxGetText(control, rc->pos);
- BuddyInfoMap *buddies = TheGameSpyInfo->getBuddyMap();
- BuddyInfoMap::iterator bIt;
- bIt = buddies->find(profileID);
- if (bIt != buddies->end())
- {
- isBuddy = true;
- }
- else
- {
- buddies = TheGameSpyInfo->getBuddyRequestMap();
- bIt = buddies->find(profileID);
- if (bIt != buddies->end())
- {
- isRequest = true;
- }
- else
- {
- // neither buddy nor request
- //break;
- }
- }
-
- GadgetListBoxSetSelected(control, rc->pos);
- if (isBuddy)
- rcLayout = TheWindowManager->winCreateLayout("Menus/RCBuddiesMenu.wnd");
- else if (isRequest)
- rcLayout = TheWindowManager->winCreateLayout("Menus/RCBuddyRequestMenu.wnd");
- else
- rcLayout = TheWindowManager->winCreateLayout("Menus/RCNonBuddiesMenu.wnd");
- rcMenu = rcLayout->getFirstWindow();
- rcMenu->winGetLayout()->runInit();
- rcMenu->winBringToTop();
- rcMenu->winHide(FALSE);
-
-
-
- rcMenu->winSetPosition(rc->mouseX, rc->mouseY);
- GameSpyRCMenuData *rcData = NEW GameSpyRCMenuData;
- rcData->m_id = profileID;
- rcData->m_nick.translate(nick);
- rcData->m_itemType = (isBuddy)?ITEM_BUDDY:((isRequest)?ITEM_REQUEST:ITEM_NONBUDDY);
- setUnignoreText(rcLayout, rcData->m_nick, rcData->m_id);
- rcMenu->winSetUserData((void *)rcData);
- TheWindowManager->winSetLoneWindow(rcMenu);
- }
- break;
- }
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if (controlID == buttonHideID)
- {
- GameSpyCloseOverlay( GSOVERLAY_BUDDY );
- }
- else if (controlID == radioButtonBuddiesID)
- {
- parentBuddies->winHide(FALSE);
- parentIgnore->winHide(TRUE);
- }
- else if (controlID == radioButtonIgnoreID)
- {
- parentBuddies->winHide(TRUE);
- parentIgnore->winHide(FALSE);
- refreshIgnoreList();
- }
- else if (controlID == buttonAddBuddyID)
- {
- /*
- UnicodeString uName = GadgetTextEntryGetText(textEntry);
- AsciiString aName;
- aName.translate(uName);
- if (!aName.isEmpty())
- {
- TheWOLBuddyList->requestBuddyAdd(aName);
- }
- GadgetTextEntrySetText(textEntry, UnicodeString::TheEmptyString);
- */
- }
- else if (controlID == buttonDeleteBuddyID)
- {
- /*
- int selected;
- AsciiString selectedName = AsciiString::TheEmptyString;
-
- GadgetListBoxGetSelected(listbox, &selected);
- if (selected >= 0)
- selectedName = TheNameKeyGenerator->keyToName((NameKeyType)(int)GadgetListBoxGetItemData(listbox, selected));
-
- if (!selectedName.isEmpty())
- {
- TheWOLBuddyList->requestBuddyDelete(selectedName);
- }
- */
- }
- break;
- }
- case GLM_DOUBLE_CLICKED:
- {
- /*
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
- if( controlID == listboxBuddyID )
- {
- int rowSelected = mData2;
-
- if (rowSelected >= 0)
- {
- UnicodeString buddyName;
- GameWindow *listboxWindow = TheWindowManager->winGetWindowFromId( parent, listboxBuddyID );
-
- // get text of buddy name
- buddyName = GadgetListBoxGetText( listboxWindow, rowSelected,0 );
- GPProfile buddyID = (GPProfile)GadgetListBoxGetItemData( listboxWindow, rowSelected, 0 );
-
- Int index = -1;
- gpGetBuddyIndex(TheGPConnection, buddyID, &index);
- if (index >= 0)
- {
- GPBuddyStatus status;
- gpGetBuddyStatus(TheGPConnection, rowSelected, &status);
-
- UnicodeString string;
- string.format(L"To join %s in %hs:", buddyName.str(), status.locationString);
- GameSpyAddText(string, GSCOLOR_DEFAULT);
-
- if (status.status == GP_CHATTING)
- {
- AsciiString location = status.locationString;
- AsciiString val;
- location.nextToken(&val, "/");
- location.nextToken(&val, "/");
- location.nextToken(&val, "/");
-
- string.format(L" ???");
- if (!val.isEmpty())
- {
- Int groupRoom = atoi(val.str());
- if (TheGameSpyChat->getCurrentGroupRoomID() == groupRoom)
- {
- // already there
- string.format(L" nothing");
- GameSpyAddText(string, GSCOLOR_DEFAULT);
- }
- else
- {
- GroupRoomMap *rooms = TheGameSpyChat->getGroupRooms();
- if (rooms)
- {
- Bool needToJoin = true;
- GroupRoomMap::iterator it = rooms->find(groupRoom);
- if (it != rooms->end())
- {
- // he's in a different room
- if (TheGameSpyChat->getCurrentGroupRoomID())
- {
- string.format(L" leave group room");
- GameSpyAddText(string, GSCOLOR_DEFAULT);
-
- TheGameSpyChat->leaveRoom(GroupRoom);
- }
- else if (TheGameSpyGame->isInGame())
- {
- if (TheGameSpyGame->isGameInProgress())
- {
- string.format(L" can't leave game in progress");
- GameSpyAddText(string, GSCOLOR_DEFAULT);
- needToJoin = false;
- }
- else
- {
- string.format(L" leave game setup");
- GameSpyAddText(string, GSCOLOR_DEFAULT);
-
- TheGameSpyChat->leaveRoom(StagingRoom);
- TheGameSpyGame->leaveGame();
- }
- }
- if (needToJoin)
- {
- string.format(L" join lobby %d", groupRoom);
- TheGameSpyChat->joinGroupRoom(groupRoom);
- GameSpyAddText(string, GSCOLOR_DEFAULT);
- }
- }
- }
- }
- }
- }
- }
- else
- {
- DEBUG_CRASH(("No buddy associated with that ProfileID"));
- GameSpyUpdateBuddyOverlay();
- }
- }
- }
- */
- break;
- }
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-}
-
-WindowMsgHandledType PopupBuddyNotificationSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
- case GWM_CREATE:
- {
- break;
- }
-
- case GWM_DESTROY:
- {
- break;
- }
-
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if (controlID == buttonNotificationID)
- {
- GameSpyOpenOverlay( GSOVERLAY_BUDDY );
- }
- break;
- }
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-}
-
-/*
-static NameKeyType buttonAcceptBuddyID = NAMEKEY_INVALID;
-static NameKeyType buttonDenyBuddyID = NAMEKEY_INVALID;
-*/
-static NameKeyType buttonAddID = NAMEKEY_INVALID;
-static NameKeyType buttonDeleteID = NAMEKEY_INVALID;
-static NameKeyType buttonPlayID = NAMEKEY_INVALID;
-static NameKeyType buttonIgnoreID = NAMEKEY_INVALID;
-static NameKeyType buttonStatsID = NAMEKEY_INVALID;
-// Window Pointers ------------------------------------------------------------------------
-//static GameWindow *rCparent = nullptr;
-
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Buddy Overlay Right Click menu callbacks */
-//-------------------------------------------------------------------------------------------------
-void WOLBuddyOverlayRCMenuInit( WindowLayout *layout, void *userData )
-{
- AsciiString controlName;
- controlName.format("%s:ButtonAdd",layout->getFilename().str()+6);
- buttonAddID = TheNameKeyGenerator->nameToKey( controlName );
- controlName.format("%s:ButtonDelete",layout->getFilename().str()+6);
- buttonDeleteID = TheNameKeyGenerator->nameToKey( controlName );
- controlName.format("%s:ButtonPlay",layout->getFilename().str()+6);
- buttonPlayID = TheNameKeyGenerator->nameToKey( controlName );
- controlName.format("%s:ButtonIgnore",layout->getFilename().str()+6);
- buttonIgnoreID = TheNameKeyGenerator->nameToKey( controlName );
- controlName.format("%s:ButtonStats",layout->getFilename().str()+6);
- buttonStatsID = TheNameKeyGenerator->nameToKey( controlName );
-}
-static void closeRightClickMenu(GameWindow *win)
-{
-
- if(win)
- {
- WindowLayout *winLay = win->winGetLayout();
- if(!winLay)
- return;
- winLay->destroyWindows();
- deleteInstance(winLay);
- winLay = nullptr;
-
- }
-}
-
-void RequestBuddyAdd(Int profileID, AsciiString nick)
-{
- // request to add a buddy
- BuddyRequest req;
- req.buddyRequestType = BuddyRequest::BUDDYREQUEST_ADDBUDDY;
- req.arg.addbuddy.id = profileID;
- UnicodeString buddyAddstr;
- buddyAddstr = TheGameText->fetch("GUI:BuddyAddReq");
- wcslcpy(req.arg.addbuddy.text, buddyAddstr.str(), MAX_BUDDY_CHAT_LEN);
- TheGameSpyBuddyMessageQueue->addRequest(req);
-
- UnicodeString s;
- Bool exists = TRUE;
- s.format(TheGameText->fetch("Buddy:InviteSent", &exists));
- if (!exists)
- {
- // no string yet. don't display.
- return;
- }
-
- // save message for future incarnations of the buddy window
- BuddyMessageList *messages = TheGameSpyInfo->getBuddyMessages();
- BuddyMessage message;
- message.m_timestamp = time(nullptr);
- message.m_senderID = 0;
- message.m_senderNick = "";
- message.m_recipientID = TheGameSpyInfo->getLocalProfileID();
- message.m_recipientNick = TheGameSpyInfo->getLocalBaseName();
- message.m_message.format(TheGameText->fetch("Buddy:InviteSentToPlayer"), nick.str());
-
- // insert status into box
- messages->push_back(message);
-
- DEBUG_LOG(("Inserting buddy add request"));
-
- // put message on screen
- insertChat(message);
-
- // play audio notification
- AudioEventRTS buddyMsgAudio("GUIMessageReceived");
- if( TheAudio )
- {
- TheAudio->addAudioEvent( &buddyMsgAudio );
- }
-
- lastNotificationWasStatus = FALSE;
- numOnlineInNotification = 0;
- showNotificationBox(AsciiString::TheEmptyString, s);
-}
-
-WindowMsgHandledType WOLBuddyOverlayRCMenuSystem( GameWindow *window, UnsignedInt msg, WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- case GWM_CREATE:
- {
-
- break;
- }
-
- case GWM_DESTROY:
- {
- rcMenu = nullptr;
- break;
- }
-
- case GGM_CLOSE:
- {
- closeRightClickMenu(window);
- //rcMenu = nullptr;
- break;
- }
-
-
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
- GameSpyRCMenuData *rcData = (GameSpyRCMenuData*)window->winGetUserData();
- if(!rcData)
- break;
- DEBUG_ASSERTCRASH(rcData, ("WOLBuddyOverlayRCMenuSystem GBM_SELECTED:: we're attempting to read the GameSpyRCMenuData from the window, but the data's not there"));
- GPProfile profileID = rcData->m_id;
- AsciiString nick = rcData->m_nick;
-
- Bool isBuddy = false, isRequest = false;
- Bool isGameSpyUser = profileID > 0;
- if (rcData->m_itemType == ITEM_BUDDY)
- isBuddy = TRUE;
- else if (rcData->m_itemType == ITEM_REQUEST)
- isRequest = TRUE;
-
- delete rcData;
- rcData = nullptr;
-
- window->winSetUserData(nullptr);
- //DEBUG_ASSERTCRASH(profileID > 0, ("Bad profile ID in user data!"));
-
- if( controlID == buttonAddID )
- {
- if(!isGameSpyUser)
- break;
- DEBUG_LOG(("ButtonAdd was pushed"));
- if (isRequest)
- {
- // ok the request
- BuddyRequest req;
- req.buddyRequestType = BuddyRequest::BUDDYREQUEST_OKADD;
- req.arg.profile.id = profileID;
- TheGameSpyBuddyMessageQueue->addRequest(req);
-
- BuddyInfoMap *m = TheGameSpyInfo->getBuddyRequestMap();
- m->erase( profileID );
- // if the profile ID is not from a buddy and we're okaying his request, then
- // request to add him to our list automatically CLH 2-18-03
- if(!TheGameSpyInfo->isBuddy(profileID))
- {
- RequestBuddyAdd(profileID, nick);
- }
- updateBuddyInfo();
- }
- else if (!isBuddy)
- {
- RequestBuddyAdd(profileID, nick);
- }
- }
- else if( controlID == buttonDeleteID )
- {
- if(!isGameSpyUser)
- break;
- if (isBuddy)
- {
- // delete the buddy
- BuddyRequest req;
- req.buddyRequestType = BuddyRequest::BUDDYREQUEST_DELBUDDY;
- req.arg.profile.id = profileID;
- TheGameSpyBuddyMessageQueue->addRequest(req);
- }
- else
- {
- // delete the request
- BuddyRequest req;
- req.buddyRequestType = BuddyRequest::BUDDYREQUEST_DENYADD;
- req.arg.profile.id = profileID;
- TheGameSpyBuddyMessageQueue->addRequest(req);
- BuddyInfoMap *m = TheGameSpyInfo->getBuddyRequestMap();
- m->erase( profileID );
- }
- BuddyInfoMap *buddies = (isBuddy)?TheGameSpyInfo->getBuddyMap():TheGameSpyInfo->getBuddyRequestMap();
- buddies->erase(profileID);
- updateBuddyInfo();
- DEBUG_LOG(("ButtonDelete was pushed"));
- PopulateLobbyPlayerListbox();
- }
- else if( controlID == buttonPlayID )
- {
- DEBUG_LOG(("buttonPlayID was pushed"));
- }
- else if( controlID == buttonIgnoreID )
- {
- DEBUG_LOG(("%s is isGameSpyUser %d", nick.str(), isGameSpyUser));
- if( isGameSpyUser )
- {
- if(TheGameSpyInfo->isSavedIgnored(profileID))
- {
- TheGameSpyInfo->removeFromSavedIgnoreList(profileID);
- }
- else
- {
- TheGameSpyInfo->addToSavedIgnoreList(profileID, nick);
- }
- }
- else
- {
- if(TheGameSpyInfo->isIgnored(nick))
- {
- TheGameSpyInfo->removeFromIgnoreList(nick);
- }
- else
- {
- TheGameSpyInfo->addToIgnoreList(nick);
- }
- }
- updateBuddyInfo();
- refreshIgnoreList();
- // repopulate our player listboxes now
- PopulateLobbyPlayerListbox();
- }
- else if( controlID == buttonStatsID )
- {
- DEBUG_LOG(("buttonStatsID was pushed"));
- GameSpyCloseOverlay(GSOVERLAY_PLAYERINFO);
- SetLookAtPlayer(profileID,nick );
- GameSpyOpenOverlay(GSOVERLAY_PLAYERINFO);
- PSRequest req;
- req.requestType = PSRequest::PSREQUEST_READPLAYERSTATS;
- req.player.id = profileID;
- TheGameSpyPSMessageQueue->addRequest(req);
- }
- closeRightClickMenu(window);
- break;
- }
- default:
- return MSG_IGNORED;
-
- }
- return MSG_HANDLED;
-}
-
-
-void setUnignoreText( WindowLayout *layout, AsciiString nick, GPProfile id)
-{
- AsciiString controlName;
- controlName.format("%s:ButtonIgnore",layout->getFilename().str()+6);
- NameKeyType ID = TheNameKeyGenerator->nameToKey( controlName );
- GameWindow *win = TheWindowManager->winGetWindowFromId(layout->getFirstWindow(), ID);
- if(win)
- {
- if(TheGameSpyInfo->isSavedIgnored(id) || TheGameSpyInfo->isIgnored(nick))
- GadgetButtonSetText(win, TheGameText->fetch("GUI:Unignore"));
- }
-}
-
-void refreshIgnoreList()
-{
-
-
- SavedIgnoreMap tempMap;
- tempMap = TheGameSpyInfo->returnSavedIgnoreList();
- SavedIgnoreMap::iterator it = tempMap.begin();
- GadgetListBoxReset(listboxIgnore);
- while(it != tempMap.end())
- {
- UnicodeString name;
- name.translate(it->second);
- Int pos = GadgetListBoxAddEntryText(listboxIgnore, name, GameMakeColor(255,100,100,255),-1);
- GadgetListBoxSetItemData(listboxIgnore, (void *)it->first,pos );
- ++it;
- }
- IgnoreList tempList;
- tempList = TheGameSpyInfo->returnIgnoreList();
- IgnoreList::iterator iListIt = tempList.begin();
- while( iListIt != tempList.end())
- {
- AsciiString aName = *iListIt;
- UnicodeString name;
- name.translate(aName);
- Int pos = GadgetListBoxAddEntryText(listboxIgnore, name, GameMakeColor(255,100,100,255),-1);
- GadgetListBoxSetItemData(listboxIgnore, nullptr,pos );
- ++iListIt;
- }
-
-//
-// GPProfile profileID = 0;
-// PlayerInfoMap::iterator it = TheGameSpyInfo->getPlayerInfoMap()->find(aName);
-// if (it != TheGameSpyInfo->getPlayerInfoMap()->end())
-// profileID = it->second.m_profileID;
-
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp
deleted file mode 100644
index aef620ff9d1..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp
+++ /dev/null
@@ -1,232 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////////////
-// FILE: WOLCustomScoreScreen.cpp
-// Author: Matt Campbell, December 2001
-// Description: Custom match score screen
-///////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Lib/BaseType.h"
-#include "Common/GameEngine.h"
-#include "Common/NameKeyGenerator.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/Shell.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetListBox.h"
-#include "GameClient/GadgetTextEntry.h"
-#include "Common/GlobalData.h"
-//#include "GameNetwork/WOL.h"
-//#include "GameNetwork/WOLmenus.h"
-
-
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
-// window ids ------------------------------------------------------------------------------
-static NameKeyType parentWOLCustomScoreID = NAMEKEY_INVALID;
-static NameKeyType buttonDisconnectID = NAMEKEY_INVALID;
-static NameKeyType buttonLobbyID = NAMEKEY_INVALID;
-
-// Window Pointers ------------------------------------------------------------------------
-static GameWindow *parentWOLCustomScore = nullptr;
-static GameWindow *buttonDisconnect = nullptr;
-static GameWindow *buttonLobby = nullptr;
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the WOL Status Menu */
-//-------------------------------------------------------------------------------------------------
-void WOLCustomScoreScreenInit( WindowLayout *layout, void *userData )
-{
- parentWOLCustomScoreID = TheNameKeyGenerator->nameToKey( "WOLCustomScoreScreen.wnd:WOLCustomScoreScreenParent" );
- buttonDisconnectID = TheNameKeyGenerator->nameToKey( "WOLCustomScoreScreen.wnd:ButtonDisconnect" );
- buttonLobbyID = TheNameKeyGenerator->nameToKey( "WOLCustomScoreScreen.wnd:ButtonLobby" );
- parentWOLCustomScore = TheWindowManager->winGetWindowFromId( nullptr, parentWOLCustomScoreID );
- buttonDisconnect = TheWindowManager->winGetWindowFromId( nullptr, buttonDisconnectID);
- buttonLobby = TheWindowManager->winGetWindowFromId( nullptr, buttonLobbyID);
-
- /*
- if (WOL::TheWOL->getState() == WOL::WOLAPI_FATAL_ERROR)
- {
- // We can get to the score screen even though we've been disconnected. Just hide
- // any buttons that lead back into WOL.
- buttonLobby->winHide( TRUE );
- }
- */
-
- // Show Menu
- layout->hide( FALSE );
-
- // Set Keyboard to Main Parent
- TheWindowManager->winSetFocus( parentWOLCustomScore );
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Status Menu shutdown method */
-//-------------------------------------------------------------------------------------------------
-void WOLCustomScoreScreenShutdown( WindowLayout *layout, void *userData )
-{
- // hide menu
- layout->hide( TRUE );
-
- // our shutdown is complete
- TheShell->shutdownComplete( layout );
-}
-
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Status Menu update method */
-//-------------------------------------------------------------------------------------------------
-void WOLCustomScoreScreenUpdate( WindowLayout * layout, void *userData)
-{
- /*
- if (WOL::TheWOL)
- WOL::TheWOL->update();
- */
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Status Menu input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType WOLCustomScoreScreenInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)buttonDisconnect, buttonDisconnectID );
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Status Menu window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType WOLCustomScoreScreenSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- UnicodeString txtInput;
-
- switch( msg )
- {
-
- case GWM_CREATE:
- {
-
- break;
- }
-
- case GWM_DESTROY:
- {
- break;
- }
-
- case GWM_INPUT_FOCUS:
- {
- // if we're given the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- return MSG_HANDLED;
- }
-
- case GBM_SELECTED:
- {
- /*
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if ( controlID == buttonDisconnectID )
- {
- if (WOL::TheWOL->setState( WOL::WOLAPI_FATAL_ERROR ))
- {
- WOL::TheWOL->addCommand( WOL::WOLCOMMAND_RESET ); // don't display an error, log out, or anything
- }
-
- }
- else if ( controlID == buttonLobbyID )
- {
- if (WOL::TheWOL->getState() != WOL::WOLAPI_FATAL_ERROR)
- {
- WOL::TheWOL->setScreen(WOL::WOLAPI_MENU_CUSTOMLOBBY);
- WOL::TheWOL->setGameMode(WOL::WOLTYPE_CUSTOM);
- WOL::TheWOL->setState( WOL::WOLAPI_LOBBY );
- WOL::TheWOL->addCommand( WOL::WOLCOMMAND_REFRESH_CHANNELS );
- }
- else
- {
- }
- }
- */
- break;
- }
-
- case GEM_EDIT_DONE:
- {
- break;
- }
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp
deleted file mode 100644
index 2729a2eb158..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp
+++ /dev/null
@@ -1,225 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: ReplayMenu.cpp /////////////////////////////////////////////////////////////////////
-// Author: Chris The masta Huybregts, December 2001
-// Description: Replay Menus
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/GameEngine.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Shell.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/MessageBox.h"
-#include "GameNetwork/WOLBrowser/WebBrowser.h"
-
-// window ids -------------------------------------------------------------------------------------
-static NameKeyType parentWindowID = NAMEKEY_INVALID;
-static NameKeyType buttonBackID = NAMEKEY_INVALID;
-static NameKeyType windowLadderID = NAMEKEY_INVALID;
-
-
-// window pointers --------------------------------------------------------------------------------
-static GameWindow *parentWindow = nullptr;
-static GameWindow *buttonBack = nullptr;
-static GameWindow *windowLadder = nullptr;
-
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the single player menu */
-//-------------------------------------------------------------------------------------------------
-void WOLLadderScreenInit( WindowLayout *layout, void *userData )
-{
- TheShell->showShellMap(TRUE);
-
- // get ids for our children controls
- parentWindowID = TheNameKeyGenerator->nameToKey( "WOLLadderScreen.wnd:LadderParent" );
- buttonBackID = TheNameKeyGenerator->nameToKey( "WOLLadderScreen.wnd:ButtonBack" );
- windowLadderID = TheNameKeyGenerator->nameToKey( "WOLLadderScreen.wnd:WindowLadder" );
-
- parentWindow = TheWindowManager->winGetWindowFromId( nullptr, parentWindowID );
- buttonBack = TheWindowManager->winGetWindowFromId( parentWindow, buttonBackID );
- windowLadder = TheWindowManager->winGetWindowFromId( parentWindow, windowLadderID );
-
- //Load the listbox shiznit
-// PopulateReplayFileListbox(listboxReplayFiles);
-
- //TheWebBrowser->createBrowserWindow("Westwood", windowLadder);
- if (TheWebBrowser != nullptr)
- {
- TheWebBrowser->createBrowserWindow("MessageBoard", windowLadder);
- }
-
- // show menu
- layout->hide( FALSE );
-
- // set keyboard focus to main parent
- TheWindowManager->winSetFocus( parentWindow );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** single player menu shutdown method */
-//-------------------------------------------------------------------------------------------------
-void WOLLadderScreenShutdown( WindowLayout *layout, void *userData )
-{
-
- if (TheWebBrowser != nullptr)
- {
- TheWebBrowser->closeBrowserWindow(windowLadder);
- }
-
- // hide menu
- layout->hide( TRUE );
-
- // our shutdown is complete
- TheShell->shutdownComplete( layout );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** single player menu update method */
-//-------------------------------------------------------------------------------------------------
-void WOLLadderScreenUpdate( WindowLayout *layout, void *userData )
-{
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Replay menu input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType WOLLadderScreenInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
-
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)buttonBack, buttonBackID );
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** single player menu window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType WOLLadderScreenSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CREATE:
- {
-
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GWM_DESTROY:
- {
-
- break;
-
- }
-
- // --------------------------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- return MSG_HANDLED;
-
- }
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if( controlID == buttonBackID )
- {
-
- // thou art directed to return to thy known solar system immediately!
- TheShell->pop();
-
- }
-
- break;
-
- }
-
- default:
- return MSG_IGNORED;
- }
-
- return MSG_HANDLED;
-}
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLocaleSelectPopup.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLocaleSelectPopup.cpp
deleted file mode 100644
index 086149c9516..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLocaleSelectPopup.cpp
+++ /dev/null
@@ -1,230 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////////////
-// FILE: WOLLocaleSelectPopup.cpp
-// Author: Matt Campbell, December 2001
-// Description: WOL locale select popup
-///////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "GameClient/GameText.h"
-#include "Common/CustomMatchPreferences.h"
-#include "Common/GameEngine.h"
-#include "Common/GameSpyMiscPreferences.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/Shell.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetListBox.h"
-#include "Common/GlobalData.h"
-#include "GameNetwork/GameSpyOverlay.h"
-#include "GameNetwork/GameSpy/PeerDefs.h"
-#include "GameNetwork/GameSpy/PeerThread.h"
-#include "GameNetwork/GameSpy/PersistentStorageDefs.h"
-#include "GameNetwork/GameSpy/PersistentStorageThread.h"
-
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
-// window ids ------------------------------------------------------------------------------
-static NameKeyType parentLocaleSelectID = NAMEKEY_INVALID;
-static NameKeyType buttonOkID = NAMEKEY_INVALID;
-static NameKeyType listboxLocaleID = NAMEKEY_INVALID;
-
-// Window Pointers ------------------------------------------------------------------------
-static GameWindow *parentLocaleSelect = nullptr;
-static GameWindow *buttonOk = nullptr;
-static GameWindow *listboxLocale = nullptr;
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the WOL Status Menu */
-//-------------------------------------------------------------------------------------------------
-void WOLLocaleSelectInit( WindowLayout *layout, void *userData )
-{
- parentLocaleSelectID = TheNameKeyGenerator->nameToKey( "PopupLocaleSelect.wnd:ParentLocaleSelect" );
- buttonOkID = TheNameKeyGenerator->nameToKey( "PopupLocaleSelect.wnd:ButtonOk" );
- listboxLocaleID = TheNameKeyGenerator->nameToKey( "PopupLocaleSelect.wnd:ListBoxLocaleSelect" );
- parentLocaleSelect = TheWindowManager->winGetWindowFromId( nullptr, parentLocaleSelectID );
- buttonOk = TheWindowManager->winGetWindowFromId( nullptr, buttonOkID);
- listboxLocale = TheWindowManager->winGetWindowFromId( nullptr, listboxLocaleID);
-
- for (int i=LOC_MIN; i<=LOC_MAX; ++i)
- {
- AsciiString id;
- id.format("WOL:Locale%2.2d", i);
- GadgetListBoxAddEntryText(listboxLocale, TheGameText->fetch(id.str()), GameSpyColor[GSCOLOR_DEFAULT], -1, -1);
- }
- GadgetListBoxSetSelected(listboxLocale, 0);
-
- // Show Menu
- layout->hide( FALSE );
-
- // Set Keyboard to Main Parent
- TheWindowManager->winSetFocus( parentLocaleSelect );
- TheWindowManager->winSetModal( parentLocaleSelect );
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Status Menu shutdown method */
-//-------------------------------------------------------------------------------------------------
-void WOLLocaleSelectShutdown( WindowLayout *layout, void *userData )
-{
-
- // hide menu
- layout->hide( TRUE );
-
- // our shutdown is complete
- TheShell->shutdownComplete( layout );
-
-}
-
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Status Menu update method */
-//-------------------------------------------------------------------------------------------------
-void WOLLocaleSelectUpdate( WindowLayout * layout, void *userData)
-{
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Status Menu input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType WOLLocaleSelectInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
-// UnsignedByte key = mData1;
-// UnsignedByte state = mData2;
-
- // ----------------------------------------------------------------------------------------
- // don't let key fall through anywhere else
- return MSG_HANDLED;
- }
- }
- return MSG_IGNORED;
-}
-
-//Int getRegistryNicknameOffset(AsciiString nick); /// @todo: mdc remove this once we can save ini pref files
-//-------------------------------------------------------------------------------------------------
-/** WOL Status Menu window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType WOLLocaleSelectSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- UnicodeString txtInput;
-
- switch( msg )
- {
-
-
- case GWM_CREATE:
- {
-
- break;
- }
-
- case GWM_DESTROY:
- {
- break;
- }
-
- case GWM_INPUT_FOCUS:
- {
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- return MSG_HANDLED;
- }
-
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if ( controlID == buttonOkID )
- {
- int selected;
- GadgetListBoxGetSelected(listboxLocale, &selected);
- if (selected < 0)
- return MSG_HANDLED; // can't select nothing!
- PSRequest psReq;
- psReq.requestType = PSRequest::PSREQUEST_UPDATEPLAYERLOCALE;
- psReq.player.locale = selected + LOC_MIN;
- psReq.email = TheGameSpyInfo->getLocalEmail().str();
- psReq.nick = TheGameSpyInfo->getLocalBaseName().str();
- psReq.password = TheGameSpyInfo->getLocalPassword().str();
- psReq.player.id = TheGameSpyInfo->getLocalProfileID();
-
- TheGameSpyPSMessageQueue->addRequest(psReq);
- GameSpyCloseOverlay(GSOVERLAY_LOCALESELECT);
-
- GameSpyMiscPreferences cPref;
- cPref.setLocale(psReq.player.locale);
- cPref.write();
-
- PSPlayerStats stats = TheGameSpyPSMessageQueue->findPlayerStatsByID(TheGameSpyInfo->getLocalProfileID());
- stats.locale = psReq.player.locale;
- if (stats.id == TheGameSpyInfo->getLocalProfileID())
- TheGameSpyPSMessageQueue->trackPlayerStats(stats);
-
- if(stats.id == 0)
- {
- stats = TheGameSpyInfo->getCachedLocalPlayerStats();
- stats.locale = psReq.player.locale;
- TheGameSpyInfo->setCachedLocalPlayerStats(stats);
- }
- else
- {
- // force an update of our shtuff
- PSResponse newResp;
- newResp.responseType = PSResponse::PSRESPONSE_PLAYERSTATS;
- newResp.player = TheGameSpyPSMessageQueue->findPlayerStatsByID(TheGameSpyInfo->getLocalProfileID());
- TheGameSpyPSMessageQueue->addResponse(newResp);
- }
- CheckReOpenPlayerInfo();
- }
- break;
- }
-
- case GEM_EDIT_DONE:
- {
- break;
- }
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp
deleted file mode 100644
index 6edaba07101..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp
+++ /dev/null
@@ -1,1537 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////////////
-// FILE: WOLLoginMenu.cpp
-// Author: Chris Huybregts, November 2001
-// Description: Lan Lobby Menu
-///////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/STLTypedefs.h"
-
-#include "Common/file.h"
-#include "Common/FileSystem.h"
-#include "Common/GameEngine.h"
-#include "Common/GameSpyMiscPreferences.h"
-#include "Common/QuotedPrintable.h"
-#include "Common/Registry.h"
-#include "Common/OptionPreferences.h"
-#include "GameClient/AnimateWindowManager.h"
-#include "GameClient/ClientInstance.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GameText.h"
-#include "GameClient/Shell.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetListBox.h"
-#include "GameClient/GadgetComboBox.h"
-#include "GameClient/GadgetCheckBox.h"
-#include "GameClient/GadgetStaticText.h"
-#include "GameClient/GadgetTextEntry.h"
-#include "GameClient/MessageBox.h"
-#include "GameClient/ShellHooks.h"
-#include "GameClient/GameWindowTransitions.h"
-
-#include "GameNetwork/GameSpy/GSConfig.h"
-#include "GameNetwork/GameSpy/PeerDefs.h"
-#include "GameNetwork/GameSpy/PeerThread.h"
-#include "GameNetwork/GameSpy/PingThread.h"
-#include "GameNetwork/GameSpy/BuddyThread.h"
-#include "GameNetwork/GameSpy/ThreadUtils.h"
-#include "GameNetwork/GameSpy/PersistentStorageThread.h"
-
-#include "GameNetwork/GameSpyOverlay.h"
-
-#include "GameNetwork/WOLBrowser/WebBrowser.h"
-
-
-#ifdef ALLOW_NON_PROFILED_LOGIN
-Bool GameSpyUseProfiles = false;
-#endif // ALLOW_NON_PROFILED_LOGIN
-
-static Bool webBrowserActive = FALSE;
-static Bool useWebBrowserForTOS = FALSE;
-
-static Bool isShuttingDown = false;
-static Bool buttonPushed = false;
-static const char *nextScreen = nullptr;
-
-static const UnsignedInt loginTimeoutInMS = 10000;
-static UnsignedInt loginAttemptTime = 0;
-
-class GameSpyLoginPreferences : public UserPreferences
-{
-public:
- GameSpyLoginPreferences();
- virtual ~GameSpyLoginPreferences() override;
-
- Bool loadFromIniFile();
-
- virtual Bool load(AsciiString fname) override;
- virtual Bool write() override;
-
- AsciiString getPasswordForEmail( AsciiString email );
- AsciiString getDateForEmail( AsciiString email, AsciiString &month, AsciiString &date, AsciiString &year );
- AsciiStringList getNicksForEmail( AsciiString email );
- void addLogin( AsciiString email, AsciiString nick, AsciiString password, AsciiString date );
- void forgetLogin( AsciiString email );
- AsciiStringList getEmails();
-
-private:
- typedef std::map PassMap;
- typedef std::map DateMap;
- typedef std::map NickMap;
- PassMap m_emailPasswordMap;
- NickMap m_emailNickMap;
- DateMap m_emailDateMap;
-};
-
-static AsciiString obfuscate( AsciiString in )
-{
- char *buf = NEW char[in.getLength() + 1];
- strcpy(buf, in.str());
- static const char *xorWord = "1337Munkee";
- char *c = buf;
- const char *c2 = xorWord;
- while (*c)
- {
- if (!*c2)
- c2 = xorWord;
- if (*c != *c2)
- *c = *c++ ^ *c2++;
- else
- c++, c2++;
- }
- AsciiString out = buf;
- delete[] buf;
- return out;
-}
-
-GameSpyLoginPreferences::GameSpyLoginPreferences()
-{
- loadFromIniFile();
-}
-
-GameSpyLoginPreferences::~GameSpyLoginPreferences()
-{
-}
-
-Bool GameSpyLoginPreferences::loadFromIniFile()
-{
- if (rts::ClientInstance::getInstanceId() > 1u)
- {
- AsciiString fname;
- fname.format("GameSpyLogin_Instance%.2u.ini", rts::ClientInstance::getInstanceId());
- return load(fname);
- }
-
- return load("GameSpyLogin.ini");
-}
-
-
-Bool GameSpyLoginPreferences::load( AsciiString fname )
-{
- if (!UserPreferences::load(fname))
- return false;
-
- UserPreferences::iterator upIt = begin();
- while (upIt != end())
- {
- AsciiString key = upIt->first;
- if (key.startsWith("pass_"))
- {
- AsciiString email, pass;
- email = key.str() + 5;
- pass = upIt->second;
-
- AsciiString quoPass = QuotedPrintableToAsciiString(pass);
- pass = obfuscate(quoPass);
-
- m_emailPasswordMap[email] = pass;
- }
- if (key.startsWith("date_"))
- {
- AsciiString email, date;
- email = key.str() + 5;
- date = upIt->second;
-
- date = QuotedPrintableToAsciiString(date);
-
- m_emailDateMap[email] = date;
- }
- else if (key.startsWith("nick_"))
- {
- AsciiString email, nick, nicks;
- email = key.str() + 5;
- nicks = upIt->second;
- while (nicks.nextToken(&nick, ","))
- {
- m_emailNickMap[email].push_back(nick);
- }
- }
- ++upIt;
- }
-
- return true;
-}
-
-Bool GameSpyLoginPreferences::write()
-{
- if (m_filename.isEmpty())
- return false;
-
- FILE *fp = fopen(m_filename.str(), "w");
- if (fp)
- {
- fprintf(fp, "lastEmail = %s\n", ((*this)["lastEmail"].str()));
- fprintf(fp, "lastName = %s\n", ((*this)["lastName"].str()));
- fprintf(fp, "useProfiles = %s\n", ((*this)["useProfiles"].str()));
- PassMap::iterator passIt = m_emailPasswordMap.begin();
- while (passIt != m_emailPasswordMap.end())
- {
- AsciiString pass = obfuscate(passIt->second);
- AsciiString quoPass = AsciiStringToQuotedPrintable(pass);
-
- fprintf(fp, "pass_%s = %s\n", passIt->first.str(), quoPass.str());
- ++passIt;
- }
-
- PassMap::iterator dateIt = m_emailDateMap.begin();
- while (dateIt != m_emailDateMap.end())
- {
- AsciiString date = AsciiStringToQuotedPrintable(dateIt->second);
-
- fprintf(fp, "date_%s = %s\n", dateIt->first.str(), date.str());
- ++dateIt;
- }
-
- NickMap::iterator nickIt = m_emailNickMap.begin();
- while (nickIt != m_emailNickMap.end())
- {
- AsciiString nicks;
- AsciiStringListIterator listIt = nickIt->second.begin();
- while (listIt != nickIt->second.end())
- {
- nicks.concat(*listIt);
- nicks.concat(',');
- ++listIt;
- }
- fprintf(fp, "nick_%s = %s\n", nickIt->first.str(), nicks.str());
- ++nickIt;
- }
-
- fclose(fp);
- return true;
- }
- return false;
-}
-AsciiString GameSpyLoginPreferences::getDateForEmail( AsciiString email, AsciiString &month, AsciiString &date, AsciiString &year )
-{
- if ( m_emailDateMap.find(email) == m_emailDateMap.end() )
- return AsciiString::TheEmptyString;
- AsciiString fullDate = m_emailDateMap[email];
- if(fullDate.getLength() != 8)
- return AsciiString::TheEmptyString;
- month.format("%c%c", fullDate.getCharAt(0), fullDate.getCharAt(1));
- date.format("%c%c", fullDate.getCharAt(2), fullDate.getCharAt(3));
- year.format("%c%c%c%c", fullDate.getCharAt(4), fullDate.getCharAt(5), fullDate.getCharAt(6), fullDate.getCharAt(7));
- return m_emailDateMap[email];
-}
-
-AsciiString GameSpyLoginPreferences::getPasswordForEmail( AsciiString email )
-{
- if ( m_emailPasswordMap.find(email) == m_emailPasswordMap.end() )
- return AsciiString::TheEmptyString;
- return m_emailPasswordMap[email];
-}
-
-AsciiStringList GameSpyLoginPreferences::getNicksForEmail( AsciiString email )
-{
- if ( m_emailNickMap.find(email) == m_emailNickMap.end() )
- {
- AsciiStringList empty;
- return empty;
- }
- return m_emailNickMap[email];
-}
-
-void GameSpyLoginPreferences::addLogin( AsciiString email, AsciiString nick, AsciiString password, AsciiString date )
-{
- if ( std::find(m_emailNickMap[email].begin(), m_emailNickMap[email].end(), nick) == m_emailNickMap[email].end() )
- m_emailNickMap[email].push_back(nick);
- m_emailPasswordMap[email] = password;
- m_emailDateMap[email] = date;
-}
-
-void GameSpyLoginPreferences::forgetLogin( AsciiString email )
-{
- m_emailNickMap.erase(email);
- m_emailPasswordMap.erase(email);
- m_emailDateMap.erase(email);
-
-}
-
-AsciiStringList GameSpyLoginPreferences::getEmails()
-{
- AsciiStringList theList;
- NickMap::iterator it = m_emailNickMap.begin();
- while (it != m_emailNickMap.end())
- {
- theList.push_back(it->first);
- ++it;
- }
- return theList;
-}
-
-static GameSpyLoginPreferences *loginPref = nullptr;
-
-static void startPings()
-{
- std::list pingServers = TheGameSpyConfig->getPingServers();
- Int timeout = TheGameSpyConfig->getPingTimeoutInMs();
- Int reps = TheGameSpyConfig->getNumPingRepetitions();
-
- for (std::list::const_iterator it = pingServers.begin(); it != pingServers.end(); ++it)
- {
- AsciiString pingServer = *it;
- PingRequest req;
- req.hostname = pingServer.str();
- req.repetitions = reps;
- req.timeout = timeout;
- ThePinger->addRequest(req);
- }
-}
-
-//-------------------------------------------------------------------------------------------------
-/** This is called when a shutdown is complete for this menu */
-//-------------------------------------------------------------------------------------------------
-static void shutdownComplete( WindowLayout *layout )
-{
-
- isShuttingDown = false;
-
- // hide the layout
- layout->hide( TRUE );
-
- // our shutdown is complete
- TheShell->shutdownComplete( layout, (nextScreen != nullptr) );
-
- if (nextScreen != nullptr)
- {
- if (loginPref)
- {
- loginPref->write();
- delete loginPref;
- loginPref = nullptr;
- }
- TheShell->push(nextScreen);
- }
- else
- {
- DEBUG_ASSERTCRASH(loginPref != nullptr, ("loginPref == nullptr"));
- if (loginPref)
- {
- loginPref->write();
- delete loginPref;
- loginPref = nullptr;
- }
- }
-
- nextScreen = nullptr;
-
-}
-
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
-// window ids ------------------------------------------------------------------------------
-static NameKeyType parentWOLLoginID = NAMEKEY_INVALID;
-static NameKeyType buttonBackID = NAMEKEY_INVALID; // profile, quick
-static NameKeyType buttonLoginID = NAMEKEY_INVALID; // profile, quick
-static NameKeyType buttonCreateAccountID = NAMEKEY_INVALID; // profile, quick
-static NameKeyType buttonUseAccountID = NAMEKEY_INVALID; // quick
-static NameKeyType buttonDontUseAccountID = NAMEKEY_INVALID; // profile
-static NameKeyType buttonTOSID = NAMEKEY_INVALID; // TOS
-static NameKeyType parentTOSID = NAMEKEY_INVALID; // TOS Parent
-static NameKeyType buttonTOSOKID = NAMEKEY_INVALID; // TOS
-static NameKeyType listboxTOSID = NAMEKEY_INVALID; // TOS
-static NameKeyType comboBoxEmailID = NAMEKEY_INVALID; // profile
-static NameKeyType comboBoxLoginNameID = NAMEKEY_INVALID; // profile
-static NameKeyType textEntryLoginNameID = NAMEKEY_INVALID; // quick
-static NameKeyType textEntryPasswordID = NAMEKEY_INVALID; // profile
-static NameKeyType checkBoxRememberPasswordID = NAMEKEY_INVALID; // checkbox to remember information or not
-static NameKeyType textEntryMonthID = NAMEKEY_INVALID; // profile
-static NameKeyType textEntryDayID = NAMEKEY_INVALID; // profile
-static NameKeyType textEntryYearID = NAMEKEY_INVALID; // profile
-
-// Window Pointers ------------------------------------------------------------------------
-static GameWindow *parentWOLLogin = nullptr;
-static GameWindow *buttonBack = nullptr;
-static GameWindow *buttonLogin = nullptr;
-static GameWindow *buttonCreateAccount = nullptr;
-static GameWindow *buttonUseAccount = nullptr;
-static GameWindow *buttonDontUseAccount = nullptr;
-static GameWindow *buttonTOS = nullptr;
-static GameWindow *parentTOS = nullptr;
-static GameWindow *buttonTOSOK = nullptr;
-static GameWindow *listboxTOS = nullptr;
-static GameWindow *comboBoxEmail = nullptr;
-static GameWindow *comboBoxLoginName = nullptr;
-static GameWindow *textEntryLoginName = nullptr;
-static GameWindow *textEntryPassword = nullptr;
-static GameWindow *checkBoxRememberPassword = nullptr;
-static GameWindow *textEntryMonth = nullptr;
-static GameWindow *textEntryDay = nullptr;
-static GameWindow *textEntryYear = nullptr;
-
-void EnableLoginControls( Bool state )
-{
- if (buttonLogin)
- buttonLogin->winEnable(state);
- if (buttonCreateAccount)
- buttonCreateAccount->winEnable(state);
- if (buttonUseAccount)
- buttonUseAccount->winEnable(state);
- if (buttonDontUseAccount)
- buttonDontUseAccount->winEnable(state);
- if (comboBoxEmail)
- comboBoxEmail->winEnable(state);
- if (comboBoxLoginName)
- comboBoxLoginName->winEnable(state);
- if (textEntryLoginName)
- textEntryLoginName->winEnable(state);
- if (textEntryPassword)
- textEntryPassword->winEnable(state);
- if (checkBoxRememberPassword)
- checkBoxRememberPassword->winEnable(state);
- if( buttonTOS )
- buttonTOS->winEnable(state);
-
- if (textEntryMonth)
- textEntryMonth->winEnable(state);
- if (textEntryDay)
- textEntryDay->winEnable(state);
- if( textEntryYear )
- textEntryYear->winEnable(state);
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the WOL Login Menu */
-//-------------------------------------------------------------------------------------------------
-void WOLLoginMenuInit( WindowLayout *layout, void *userData )
-{
- nextScreen = nullptr;
- buttonPushed = false;
- isShuttingDown = false;
- loginAttemptTime = 0;
-
- if (!loginPref)
- {
- loginPref = NEW GameSpyLoginPreferences;
- }
-
- // if the ESRB warning is blank (other country) hide the box
- GameWindow *esrbTitle = TheWindowManager->winGetWindowFromId( nullptr, NAMEKEY("GameSpyLoginProfile.wnd:StaticTextESRBTop") );
- GameWindow *esrbParent = TheWindowManager->winGetWindowFromId( nullptr, NAMEKEY("GameSpyLoginProfile.wnd:ParentESRB") );
- if (esrbTitle && esrbParent)
- {
- if ( GadgetStaticTextGetText( esrbTitle ).getLength() < 2 )
- {
- esrbParent->winHide(TRUE);
- }
- }
-
- parentWOLLoginID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:WOLLoginMenuParent" );
- buttonBackID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:ButtonBack" );
- buttonLoginID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:ButtonLogin" );
- buttonCreateAccountID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:ButtonCreateAccount" );
- buttonUseAccountID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:ButtonUseAccount" );
- buttonDontUseAccountID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:ButtonDontUseAccount" );
- buttonTOSID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:ButtonTOS" );
- parentTOSID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:ParentTOS" );
- buttonTOSOKID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:ButtonTOSOK" );
- listboxTOSID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:ListboxTOS" );
- comboBoxEmailID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:ComboBoxEmail" );
- comboBoxLoginNameID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:ComboBoxLoginName" );
- textEntryLoginNameID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:TextEntryLoginName" );
- textEntryPasswordID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:TextEntryPassword" );
- checkBoxRememberPasswordID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:CheckBoxRememberInfo" );
- textEntryMonthID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:TextEntryMonth" );
- textEntryDayID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:TextEntryDay" );
- textEntryYearID = TheNameKeyGenerator->nameToKey( "GameSpyLoginProfile.wnd:TextEntryYear" );
-
- parentWOLLogin = TheWindowManager->winGetWindowFromId( nullptr, parentWOLLoginID );
- buttonBack = TheWindowManager->winGetWindowFromId( nullptr, buttonBackID);
- buttonLogin = TheWindowManager->winGetWindowFromId( nullptr, buttonLoginID);
- buttonCreateAccount = TheWindowManager->winGetWindowFromId( nullptr, buttonCreateAccountID);
- buttonUseAccount = TheWindowManager->winGetWindowFromId( nullptr, buttonUseAccountID);
- buttonDontUseAccount = TheWindowManager->winGetWindowFromId( nullptr, buttonDontUseAccountID);
- buttonTOS = TheWindowManager->winGetWindowFromId( nullptr, buttonTOSID);
- parentTOS = TheWindowManager->winGetWindowFromId( nullptr, parentTOSID);
- buttonTOSOK = TheWindowManager->winGetWindowFromId( nullptr, buttonTOSOKID);
- listboxTOS = TheWindowManager->winGetWindowFromId( nullptr, listboxTOSID);
- comboBoxEmail = TheWindowManager->winGetWindowFromId( nullptr, comboBoxEmailID);
- comboBoxLoginName = TheWindowManager->winGetWindowFromId( nullptr, comboBoxLoginNameID);
- textEntryLoginName = TheWindowManager->winGetWindowFromId( nullptr, textEntryLoginNameID);
- textEntryPassword = TheWindowManager->winGetWindowFromId( nullptr, textEntryPasswordID);
- checkBoxRememberPassword = TheWindowManager->winGetWindowFromId( nullptr, checkBoxRememberPasswordID);
- textEntryMonth = TheWindowManager->winGetWindowFromId( nullptr, textEntryMonthID);
- textEntryDay = TheWindowManager->winGetWindowFromId( nullptr, textEntryDayID);
- textEntryYear = TheWindowManager->winGetWindowFromId( nullptr, textEntryYearID);
-
- GadgetTextEntrySetText(textEntryMonth, UnicodeString::TheEmptyString);
-
- GadgetTextEntrySetText(textEntryDay, UnicodeString::TheEmptyString);
-
- GadgetTextEntrySetText(textEntryYear, UnicodeString::TheEmptyString);
-
-
-
- GameWindowList tabList;
- tabList.push_front(comboBoxEmail);
- tabList.push_back(comboBoxLoginName);
- tabList.push_back(textEntryPassword);
- tabList.push_back(textEntryMonth);
- tabList.push_back(textEntryDay);
- tabList.push_back(textEntryYear);
- tabList.push_back(checkBoxRememberPassword);
- tabList.push_back(buttonLogin);
- tabList.push_back(buttonCreateAccount);
- tabList.push_back(buttonTOS);
- tabList.push_back(buttonBack);
- TheWindowManager->clearTabList();
- TheWindowManager->registerTabList(tabList);
- TheWindowManager->winSetFocus( comboBoxEmail );
- // short form or long form?
-#ifdef ALLOW_NON_PROFILED_LOGIN
- if (parentWOLLogin)
- {
- GameSpyUseProfiles = true;
-#endif // ALLOW_NON_PROFILED_LOGIN
-
- DEBUG_ASSERTCRASH(buttonBack, ("buttonBack missing!"));
- DEBUG_ASSERTCRASH(buttonLogin, ("buttonLogin missing!"));
- DEBUG_ASSERTCRASH(buttonCreateAccount, ("buttonCreateAccount missing!"));
- //DEBUG_ASSERTCRASH(buttonDontUseAccount, ("buttonDontUseAccount missing!"));
- DEBUG_ASSERTCRASH(comboBoxEmail, ("comboBoxEmail missing!"));
- DEBUG_ASSERTCRASH(comboBoxLoginName, ("comboBoxLoginName missing!"));
- DEBUG_ASSERTCRASH(textEntryPassword, ("textEntryPassword missing!"));
-
- //TheShell->registerWithAnimateManager(parentWOLLogin, WIN_ANIMATION_SLIDE_TOP, TRUE);
- /**/
-// TheShell->registerWithAnimateManager(buttonTOS, WIN_ANIMATION_SLIDE_BOTTOM, TRUE);
- //TheShell->registerWithAnimateManager(buttonCreateAccount, WIN_ANIMATION_SLIDE_LEFT, TRUE);
- //TheShell->registerWithAnimateManager(buttonDontUseAccount, WIN_ANIMATION_SLIDE_LEFT, TRUE);
-// TheShell->registerWithAnimateManager(buttonBack, WIN_ANIMATION_SLIDE_BOTTOM, TRUE);
- /**/
-#ifdef ALLOW_NON_PROFILED_LOGIN
- }
- else
- {
- GameSpyUseProfiles = false;
-
- parentWOLLoginID = TheNameKeyGenerator->nameToKey( "GameSpyLoginQuick.wnd:WOLLoginMenuParent" );
- buttonBackID = TheNameKeyGenerator->nameToKey( "GameSpyLoginQuick.wnd:ButtonBack" );
- buttonLoginID = TheNameKeyGenerator->nameToKey( "GameSpyLoginQuick.wnd:ButtonLogin" );
- buttonCreateAccountID = TheNameKeyGenerator->nameToKey( "GameSpyLoginQuick.wnd:ButtonCreateAccount" );
- buttonUseAccountID = TheNameKeyGenerator->nameToKey( "GameSpyLoginQuick.wnd:ButtonUseAccount" );
- buttonDontUseAccountID = TheNameKeyGenerator->nameToKey( "GameSpyLoginQuick.wnd:ButtonDontUseAccount" );
- buttonTOSID = TheNameKeyGenerator->nameToKey( "GameSpyLoginQuick.wnd:ButtonTOS" );
- parentTOSID = TheNameKeyGenerator->nameToKey( "GameSpyLoginQuick.wnd:ParentTOS" );
- buttonTOSOKID = TheNameKeyGenerator->nameToKey( "GameSpyLoginQuick.wnd:ButtonTOSOK" );
- listboxTOSID = TheNameKeyGenerator->nameToKey( "GameSpyLoginQuick.wnd:ListboxTOS" );
- comboBoxEmailID = TheNameKeyGenerator->nameToKey( "GameSpyLoginQuick.wnd:ComboBoxEmail" );
- textEntryLoginNameID = TheNameKeyGenerator->nameToKey( "GameSpyLoginQuick.wnd:TextEntryLoginName" );
- textEntryPasswordID = TheNameKeyGenerator->nameToKey( "GameSpyLoginQuick.wnd:TextEntryPassword" );
- checkBoxRememberPasswordID = TheNameKeyGenerator->nameToKey( "GameSpyLoginQuick.wnd:CheckBoxRememberPassword" );
-
- parentWOLLogin = TheWindowManager->winGetWindowFromId( nullptr, parentWOLLoginID );
- buttonBack = TheWindowManager->winGetWindowFromId( nullptr, buttonBackID);
- buttonLogin = TheWindowManager->winGetWindowFromId( nullptr, buttonLoginID);
- buttonCreateAccount = TheWindowManager->winGetWindowFromId( nullptr, buttonCreateAccountID);
- buttonUseAccount = TheWindowManager->winGetWindowFromId( nullptr, buttonUseAccountID);
- buttonDontUseAccount = TheWindowManager->winGetWindowFromId( nullptr, buttonDontUseAccountID);
- comboBoxEmail = TheWindowManager->winGetWindowFromId( nullptr, comboBoxEmailID);
- buttonTOS = TheWindowManager->winGetWindowFromId( nullptr, buttonTOSID);
- parentTOS = TheWindowManager->winGetWindowFromId( nullptr, parentTOSID);
- buttonTOSOK = TheWindowManager->winGetWindowFromId( nullptr, buttonTOSOKID);
- listboxTOS = TheWindowManager->winGetWindowFromId( nullptr, listboxTOSID);
- textEntryLoginName = TheWindowManager->winGetWindowFromId( nullptr, textEntryLoginNameID);
- textEntryPassword = TheWindowManager->winGetWindowFromId( nullptr, textEntryPasswordID);
- checkBoxRememberPassword = TheWindowManager->winGetWindowFromId( nullptr, checkBoxRememberPasswordID);
-
- DEBUG_ASSERTCRASH(buttonBack, ("buttonBack missing!"));
- DEBUG_ASSERTCRASH(buttonLogin, ("buttonLogin missing!"));
- DEBUG_ASSERTCRASH(buttonCreateAccount, ("buttonCreateAccount missing!"));
- DEBUG_ASSERTCRASH(buttonUseAccount, ("buttonUseAccount missing!"));
- DEBUG_ASSERTCRASH(textEntryLoginName, ("textEntryLoginName missing!"));
- TheWindowManager->winSetFocus( textEntryLoginName );
- //TheShell->registerWithAnimateManager(parentWOLLogin, WIN_ANIMATION_SLIDE_TOP, TRUE);
-
-// TheShell->registerWithAnimateManager(buttonTOS, WIN_ANIMATION_SLIDE_LEFT, TRUE);
-// TheShell->registerWithAnimateManager(buttonCreateAccount, WIN_ANIMATION_SLIDE_LEFT, TRUE);
-// TheShell->registerWithAnimateManager(buttonUseAccount, WIN_ANIMATION_SLIDE_LEFT, TRUE);
-// TheShell->registerWithAnimateManager(buttonBack, WIN_ANIMATION_SLIDE_RIGHT, TRUE);
-
- }
-#endif // ALLOW_NON_PROFILED_LOGIN
-
-
-#ifdef ALLOW_NON_PROFILED_LOGIN
- if (GameSpyUseProfiles)
- {
-#endif // ALLOW_NON_PROFILED_LOGIN
- // Read login names from registry...
- GadgetComboBoxReset(comboBoxEmail);
- GadgetTextEntrySetText(textEntryPassword, UnicodeString::TheEmptyString);
-
- // look for cached nicks to add
- AsciiString lastName;
- AsciiString lastEmail;
- Bool markCheckBox = FALSE;
- UserPreferences::const_iterator it = loginPref->find("lastName");
- if (it != loginPref->end())
- {
- lastName = it->second;
- }
- it = loginPref->find("lastEmail");
- if (it != loginPref->end())
- {
- lastEmail = it->second;
- }
-
- // fill in list of Emails, and select the most recent
- AsciiStringList cachedEmails = loginPref->getEmails();
- AsciiStringListIterator eIt = cachedEmails.begin();
- Int selectedPos = -1;
- while (eIt != cachedEmails.end())
- {
- UnicodeString uniEmail;
- uniEmail.translate(*eIt);
- Int pos = GadgetComboBoxAddEntry(comboBoxEmail, uniEmail, GameSpyColor[GSCOLOR_DEFAULT]);
- if (*eIt == lastEmail)
- selectedPos = pos;
-
- ++eIt;
- }
- if (selectedPos >= 0)
- {
- GadgetComboBoxSetSelectedPos(comboBoxEmail, selectedPos);
-
- // fill in the password for the selected email
- UnicodeString pass;
- pass.translate(loginPref->getPasswordForEmail(lastEmail));
- GadgetTextEntrySetText(textEntryPassword, pass);
-
- AsciiString month,day,year;
- loginPref->getDateForEmail(lastEmail, month, day, year);
- pass.translate(month);
- GadgetTextEntrySetText(textEntryMonth, pass);
- pass.translate(day);
- GadgetTextEntrySetText(textEntryDay, pass);
- pass.translate(year);
- GadgetTextEntrySetText(textEntryYear, pass);
-
- markCheckBox = TRUE;
- }
-
- // fill in list of nicks for selected email, selecting the most recent
- GadgetComboBoxReset(comboBoxLoginName);
- AsciiStringList cachedNicks = loginPref->getNicksForEmail(lastEmail);
- AsciiStringListIterator nIt = cachedNicks.begin();
- selectedPos = -1;
- while (nIt != cachedNicks.end())
- {
- UnicodeString uniNick;
- uniNick.translate(*nIt);
- Int pos = GadgetComboBoxAddEntry(comboBoxLoginName, uniNick, GameSpyColor[GSCOLOR_DEFAULT]);
- if (*nIt == lastName)
- selectedPos = pos;
-
- ++nIt;
- }
- if (selectedPos >= 0)
- {
- GadgetComboBoxSetSelectedPos(comboBoxLoginName, selectedPos);
- markCheckBox = TRUE;
- }
- // always start with not storing information
- if( markCheckBox)
- GadgetCheckBoxSetChecked(checkBoxRememberPassword, TRUE);
- else
- GadgetCheckBoxSetChecked(checkBoxRememberPassword, FALSE);
-#ifdef ALLOW_NON_PROFILED_LOGIN
- }
- else
- {
- // Read login names from registry...
- GadgetComboBoxReset(comboBoxLoginName);
- UnicodeString nick;
-
- UserPreferences::const_iterator it = loginPref->find("lastName");
- if (it != loginPref->end())
- {
- nick.translate(it->second);
- }
- else
- {
- char userBuf[32] = "";
- unsigned long bufSize = 32;
- GetUserName(userBuf, &bufSize);
- nick.translate(userBuf);
- }
-
- GadgetTextEntrySetText(textEntryLoginName, nick);
- }
-#endif // ALLOW_NON_PROFILED_LOGIN
-
- EnableLoginControls(TRUE);
-
- // Show Menu
- layout->hide( FALSE );
-
- // Set Keyboard to Main Parent
-
- RaiseGSMessageBox();
-
- OptionPreferences optionPref;
- if (!optionPref.getBool("SawTOS", TRUE))
- {
- TheWindowManager->winSendSystemMsg( parentWOLLogin, GBM_SELECTED,
- (WindowMsgData)buttonTOS, buttonTOSID );
- }
- TheTransitionHandler->setGroup("GameSpyLoginProfileFade");
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Login Menu shutdown method */
-//-------------------------------------------------------------------------------------------------
-static Bool loggedInOK = false;
-void WOLLoginMenuShutdown( WindowLayout *layout, void *userData )
-{
- isShuttingDown = true;
- loggedInOK = false;
- TheWindowManager->clearTabList();
- if (webBrowserActive)
- {
- if (TheWebBrowser != nullptr)
- {
- TheWebBrowser->closeBrowserWindow(listboxTOS);
- }
- webBrowserActive = FALSE;
- }
-
- // if we are shutting down for an immediate pop, skip the animations
- Bool popImmediate = *(Bool *)userData;
- if( popImmediate )
- {
-
- shutdownComplete( layout );
- return;
-
- }
-
- TheShell->reverseAnimatewindow();
- TheTransitionHandler->reverse("GameSpyLoginProfileFade");
-
-}
-
-
-// this is used to check if we've got all the pings
-static void checkLogin()
-{
- if (loggedInOK && ThePinger && !ThePinger->arePingsInProgress())
- {
- // save off our ping string, and end those threads
- AsciiString pingStr = ThePinger->getPingString( 1000 );
- DEBUG_LOG(("Ping string is %s", pingStr.str()));
- TheGameSpyInfo->setPingString(pingStr);
- //delete ThePinger;
- //ThePinger = nullptr;
-
- buttonPushed = true;
- loggedInOK = false; // don't try this again
-
- loginAttemptTime = 0;
-
- // start looking for group rooms
- TheGameSpyInfo->clearGroupRoomList();
-
- SignalUIInteraction(SHELL_SCRIPT_HOOK_GENERALS_ONLINE_LOGIN);
- nextScreen = "Menus/WOLWelcomeMenu.wnd";
- TheShell->pop();
-
- // read in some cached data
- GameSpyMiscPreferences mPref;
- PSPlayerStats localPSStats = GameSpyPSMessageQueueInterface::parsePlayerKVPairs(mPref.getCachedStats().str());
- localPSStats.id = TheGameSpyInfo->getLocalProfileID();
- TheGameSpyInfo->setCachedLocalPlayerStats(localPSStats);
-// TheGameSpyPSMessageQueue->trackPlayerStats(localPSStats);
-
- // and push the info around to other players
-// PSResponse newResp;
-// newResp.responseType = PSResponse::PSRESPONSE_PLAYERSTATS;
-// newResp.player = localPSStats;
-// TheGameSpyPSMessageQueue->addResponse(newResp);
- }
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Login Menu update method */
-//-------------------------------------------------------------------------------------------------
-void WOLLoginMenuUpdate( WindowLayout * layout, void *userData)
-{
-
- // We'll only be successful if we've requested to
- if(isShuttingDown && TheShell->isAnimFinished() && TheTransitionHandler->isFinished())
- shutdownComplete(layout);
-
- if (TheShell->isAnimFinished() && !buttonPushed && TheGameSpyPeerMessageQueue)
- {
- PingResponse pingResp;
- if (ThePinger && ThePinger->getResponse(pingResp))
- {
- checkLogin();
- }
-
- PeerResponse resp;
- if (!loggedInOK && TheGameSpyPeerMessageQueue->getResponse( resp ))
- {
- switch (resp.peerResponseType)
- {
- case PeerResponse::PEERRESPONSE_GROUPROOM:
- {
- GameSpyGroupRoom room;
- room.m_groupID = resp.groupRoom.id;
- room.m_maxWaiting = resp.groupRoom.maxWaiting;
- room.m_name = resp.groupRoomName.c_str();
- room.m_translatedName = L"TEST";
- room.m_numGames = resp.groupRoom.numGames;
- room.m_numPlaying = resp.groupRoom.numPlaying;
- room.m_numWaiting = resp.groupRoom.numWaiting;
- TheGameSpyInfo->addGroupRoom( room );
- }
- break;
- case PeerResponse::PEERRESPONSE_LOGIN:
- {
- loggedInOK = true;
-
- // fetch our player info
- TheGameSpyInfo->setLocalName( resp.nick.c_str() );
- TheGameSpyInfo->setLocalProfileID( resp.player.profileID );
- TheGameSpyInfo->loadSavedIgnoreList();
- TheGameSpyInfo->setLocalIPs(resp.player.internalIP, resp.player.externalIP);
- TheGameSpyInfo->readAdditionalDisconnects();
- //TheGameSpyInfo->setLocalEmail( resp.player.email );
- //TheGameSpyInfo->setLocalPassword( resp)
-
- GameSpyMiscPreferences miscPref;
- TheGameSpyInfo->setMaxMessagesPerUpdate(miscPref.getMaxMessagesPerUpdate());
- }
- break;
- case PeerResponse::PEERRESPONSE_DISCONNECT:
- {
- loginAttemptTime = 0;
- UnicodeString title, body;
- AsciiString disconMunkee;
- disconMunkee.format("GUI:GSDisconReason%d", resp.discon.reason);
- title = TheGameText->fetch( "GUI:GSErrorTitle" );
- body = TheGameText->fetch( disconMunkee );
- GSMessageBoxOk( title, body );
- EnableLoginControls( TRUE );
-
- // kill & restart the threads
- AsciiString motd = TheGameSpyInfo->getMOTD();
- AsciiString config = TheGameSpyInfo->getConfig();
- DEBUG_LOG(("Tearing down GameSpy from WOLLoginMenuUpdate(PEERRESPONSE_DISCONNECT)"));
- TearDownGameSpy();
- SetUpGameSpy( motd.str(), config.str() );
- }
- break;
- }
- }
-
- checkLogin();
- }
-
- if (TheGameSpyInfo && !buttonPushed && loginAttemptTime && (loginAttemptTime + loginTimeoutInMS < timeGetTime()))
- {
- // timed out a login attempt, so say so
- loginAttemptTime = 0;
- UnicodeString title, body;
- AsciiString disconMunkee;
- disconMunkee.format("GUI:GSDisconReason4"); // ("could not connect to server")
- title = TheGameText->fetch( "GUI:GSErrorTitle" );
- body = TheGameText->fetch( disconMunkee );
- GSMessageBoxOk( title, body );
- EnableLoginControls( TRUE );
-
- // kill & restart the threads
- AsciiString motd = TheGameSpyInfo->getMOTD();
- AsciiString config = TheGameSpyInfo->getConfig();
- DEBUG_LOG(("Tearing down GameSpy from WOLLoginMenuUpdate(login timeout)"));
- TearDownGameSpy();
- SetUpGameSpy( motd.str(), config.str() );
- }
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Login Menu input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType WOLLoginMenuInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
- if (buttonPushed)
- break;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)buttonBack, buttonBackID );
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-}
-
-static Bool isNickOkay(UnicodeString nick)
-{
- static const WideChar * legalIRCChars = L"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789[]`_^{|}-";
-
- Int len = nick.getLength();
- if (len == 0)
- return TRUE;
-
- if (len == 1 && nick.getCharAt(0) == L'-')
- return FALSE;
-
- WideChar newChar = nick.getCharAt(len-1);
- if (wcschr(legalIRCChars, newChar) == nullptr)
- return FALSE;
-
- return TRUE;
-}
-
-static Bool isAgeOkay(AsciiString &month, AsciiString &day, AsciiString year)
-{
- if(month.isEmpty() || day.isEmpty() || year.isEmpty() || year.getLength() != 4)
- return FALSE;
-
- Int monthInt = atoi(month.str());
- Int dayInt = atoi(day.str());
-
- if(monthInt > 12 || dayInt > 31)
- return FALSE;
- // setup date buffer for local region date format
- month.format("%02.2d",monthInt);
- day.format("%02.2d",dayInt);
-
- // test the year first
- #define DATE_BUFFER_SIZE 256
- char dateBuffer[ DATE_BUFFER_SIZE ];
- GetDateFormat( LOCALE_SYSTEM_DEFAULT,
- 0, nullptr,
- "yyyy",
- dateBuffer, DATE_BUFFER_SIZE );
- Int sysVal = atoi(dateBuffer);
- Int userVal = atoi(year.str());
- if(sysVal - userVal >= 14)
- return TRUE;
- else if( sysVal - userVal <= 12)
- return FALSE;
-
- GetDateFormat( LOCALE_SYSTEM_DEFAULT,
- 0, nullptr,
- "MM",
- dateBuffer, DATE_BUFFER_SIZE );
- sysVal = atoi(dateBuffer);
- userVal = atoi(month.str());
- if(sysVal - userVal >0 )
- return TRUE;
- else if( sysVal -userVal < 0 )
- return FALSE;
-// month.format("%02.2d",userVal);
- GetDateFormat( LOCALE_SYSTEM_DEFAULT,
- 0, nullptr,
- "dd",
- dateBuffer, DATE_BUFFER_SIZE );
- sysVal = atoi(dateBuffer);
- userVal = atoi(day.str());
- if(sysVal - userVal< 0)
- return FALSE;
-// day.format("%02.2d",userVal);
- return TRUE;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Login Menu window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType WOLLoginMenuSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- UnicodeString txtInput;
-
- switch( msg )
- {
-
-
- case GWM_CREATE:
- {
- break;
- }
-
- case GWM_DESTROY:
- {
- break;
- }
-
- case GWM_INPUT_FOCUS:
- {
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- return MSG_HANDLED;
- }
-
- // someone typed in a combo box. Clear password (or fill it in if the typed name matches a known login name)
- case GCM_UPDATE_TEXT:
- {
- UnicodeString uNick = GadgetComboBoxGetText(comboBoxLoginName);
- UnicodeString uEmail = GadgetComboBoxGetText(comboBoxEmail);
- AsciiString nick, email;
- nick.translate(uNick);
- email.translate(uEmail);
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- UnicodeString trimmedNick = uNick, trimmedEmail = uEmail;
- trimmedNick.trim();
- trimmedEmail.trim();
- if (!trimmedNick.isEmpty())
- {
- trimmedNick.trimEnd(L'\\');
- trimmedNick.trimEnd(L'/');
- }
- if (!trimmedEmail.isEmpty())
- {
- trimmedEmail.trimEnd(L'\\');
- trimmedEmail.trimEnd(L'/');
- }
- if (trimmedEmail.getLength() != uEmail.getLength())
- {
- // we just trimmed a space. set the text back and bail
- GadgetComboBoxSetText(comboBoxEmail, trimmedEmail);
- break;
- }
- if (trimmedNick.getLength() != nick.getLength())
- {
- // we just trimmed a space. set the text back and bail
- GadgetComboBoxSetText(comboBoxLoginName, trimmedNick);
- break;
- }
-
- if (controlID == comboBoxEmailID)
- {
- // email changed. look up password, and choose new login names
-
- // fill in the password for the selected email
- UnicodeString pass;
- pass.translate(loginPref->getPasswordForEmail(email));
- GadgetTextEntrySetText(textEntryPassword, pass);
-
- // fill in list of nicks for selected email, selecting the first
- AsciiStringList cachedNicks = loginPref->getNicksForEmail(email);
- AsciiStringListIterator nIt = cachedNicks.begin();
- Int selectedPos = -1;
- GadgetComboBoxReset(comboBoxLoginName);
- while (nIt != cachedNicks.end())
- {
- UnicodeString uniNick;
- uniNick.translate(*nIt);
- GadgetComboBoxAddEntry(comboBoxLoginName, uniNick, GameSpyColor[GSCOLOR_DEFAULT]);
- selectedPos = 0;
- ++nIt;
- }
- if (selectedPos >= 0)
- {
- GadgetComboBoxSetSelectedPos(comboBoxLoginName, selectedPos);
- GadgetCheckBoxSetChecked(checkBoxRememberPassword, true);
- AsciiString month,day,year;
- loginPref->getDateForEmail(email, month, day, year);
- pass.translate(month);
- GadgetTextEntrySetText(textEntryMonth, pass);
- pass.translate(day);
- GadgetTextEntrySetText(textEntryDay, pass);
- pass.translate(year);
- GadgetTextEntrySetText(textEntryYear, pass);
-
- }
- else
- {
- GadgetCheckBoxSetChecked(checkBoxRememberPassword, false);
- GadgetTextEntrySetText(textEntryMonth, UnicodeString::TheEmptyString);
- GadgetTextEntrySetText(textEntryDay, UnicodeString::TheEmptyString);
- GadgetTextEntrySetText(textEntryYear, UnicodeString::TheEmptyString);
-
- }
- }
- else if (controlID == comboBoxLoginNameID)
- {
- // they typed a new login name. Email & pass shouldn't change
- }
-
- break;
- }
-
- case GCM_SELECTED:
- {
- if (buttonPushed)
- break;
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if (controlID == comboBoxEmailID)
- {
- // email changed. look up password, and choose new login names
- UnicodeString uEmail = GadgetComboBoxGetText(comboBoxEmail);
- AsciiString email;
- email.translate(uEmail);
-
- // fill in the password for the selected email
- UnicodeString pass;
- pass.translate(loginPref->getPasswordForEmail(email));
- GadgetTextEntrySetText(textEntryPassword, pass);
-
- // fill in list of nicks for selected email, selecting the first
- AsciiStringList cachedNicks = loginPref->getNicksForEmail(email);
- AsciiStringListIterator nIt = cachedNicks.begin();
- Int selectedPos = -1;
- GadgetComboBoxReset(comboBoxLoginName);
- while (nIt != cachedNicks.end())
- {
- UnicodeString uniNick;
- uniNick.translate(*nIt);
- GadgetComboBoxAddEntry(comboBoxLoginName, uniNick, GameSpyColor[GSCOLOR_DEFAULT]);
- selectedPos = 0;
- ++nIt;
- }
- if (selectedPos >= 0)
- {
- GadgetComboBoxSetSelectedPos(comboBoxLoginName, selectedPos);
- GadgetCheckBoxSetChecked(checkBoxRememberPassword, true);
- AsciiString month,day,year;
- loginPref->getDateForEmail(email, month, day, year);
- pass.translate(month);
- GadgetTextEntrySetText(textEntryMonth, pass);
- pass.translate(day);
- GadgetTextEntrySetText(textEntryDay, pass);
- pass.translate(year);
- GadgetTextEntrySetText(textEntryYear, pass);
-
- }
- else
- {
- GadgetCheckBoxSetChecked(checkBoxRememberPassword, false);
- GadgetTextEntrySetText(textEntryMonth, UnicodeString::TheEmptyString);
- GadgetTextEntrySetText(textEntryDay, UnicodeString::TheEmptyString);
- GadgetTextEntrySetText(textEntryYear, UnicodeString::TheEmptyString);
- }
-
- }
- else if (controlID == comboBoxLoginNameID)
- {
- // they typed a new login name. Email & pass shouldn't change
- }
- break;
- }
-
- case GBM_SELECTED:
- {
- if (buttonPushed)
- break;
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- // If we back out, just bail - we haven't gotten far enough to need to log out
- if ( controlID == buttonBackID )
- {
- buttonPushed = true;
- TearDownGameSpy();
- TheShell->pop();
- }
-#ifdef ALLOW_NON_PROFILED_LOGIN
- else if ( controlID == buttonUseAccountID )
- {
- buttonPushed = true;
- nextScreen = "Menus/GameSpyLoginProfile.wnd";
- TheShell->pop();
- //TheShell->push( "Menus/GameSpyLoginProfile.wnd" );
- }
- else if ( controlID == buttonDontUseAccountID )
- {
- buttonPushed = true;
- nextScreen = "Menus/GameSpyLoginQuick.wnd";
- TheShell->pop();
- //TheShell->push( "Menus/GameSpyLoginQuick.wnd" );
- }
-#endif // ALLOW_NON_PROFILED_LOGIN
- else if ( controlID == buttonCreateAccountID )
- {
-#ifdef ALLOW_NON_PROFILED_LOGIN
- if (GameSpyUseProfiles)
- {
-#endif // ALLOW_NON_PROFILED_LOGIN
- // actually attempt to create an account based on info entered
- AsciiString month, day, year;
- month.translate( GadgetTextEntryGetText(textEntryMonth) );
- day.translate( GadgetTextEntryGetText(textEntryDay) );
- year.translate( GadgetTextEntryGetText(textEntryYear) );
-
- if(!isAgeOkay(month, day, year))
- {
- GSMessageBoxOk(TheGameText->fetch("GUI:AgeFailedTitle"), TheGameText->fetch("GUI:AgeFailed"));
- break;
- }
-
- AsciiString login, password, email;
- email.translate( GadgetComboBoxGetText(comboBoxEmail) );
- login.translate( GadgetComboBoxGetText(comboBoxLoginName) );
- password.translate( GadgetTextEntryGetText(textEntryPassword) );
-
- if ( !email.isEmpty() && !login.isEmpty() && !password.isEmpty() )
- {
- loginAttemptTime = timeGetTime();
- BuddyRequest req;
- req.buddyRequestType = BuddyRequest::BUDDYREQUEST_LOGINNEW;
- strlcpy(req.arg.login.nick, login.str(), ARRAY_SIZE(req.arg.login.nick));
- strlcpy(req.arg.login.email, email.str(), ARRAY_SIZE(req.arg.login.email));
- strlcpy(req.arg.login.password, password.str(), ARRAY_SIZE(req.arg.login.password));
- req.arg.login.hasFirewall = TRUE;
-
- TheGameSpyInfo->setLocalBaseName( login );
- //TheGameSpyInfo->setLocalProfileID( resp.player.profileID );
- TheGameSpyInfo->setLocalEmail( email );
- TheGameSpyInfo->setLocalPassword( password );
- DEBUG_LOG(("before create: TheGameSpyInfo->stuff(%s/%s/%s)", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str()));
-
- TheGameSpyBuddyMessageQueue->addRequest( req );
- if(checkBoxRememberPassword && GadgetCheckBoxIsChecked(checkBoxRememberPassword))
- {
- (*loginPref)["lastName"] = login;
- (*loginPref)["lastEmail"] = email;
- (*loginPref)["useProfiles"] = "yes";
- AsciiString date;
- date = month;
- date.concat(day);
- date.concat(year);
-
- loginPref->addLogin(email, login, password, date);
- }
-
- EnableLoginControls( FALSE );
-
- // fire off some pings
- startPings();
- }
- else
- {
- // user didn't fill in all info. prompt him.
- if(email.isEmpty() && login.isEmpty() && password.isEmpty())
- GSMessageBoxOk(TheGameText->fetch("GUI:Error"), TheGameText->fetch("GUI:GSNoLoginInfoAll"));
- else if( email.isEmpty() && login.isEmpty())
- GSMessageBoxOk(TheGameText->fetch("GUI:Error"), TheGameText->fetch("GUI:GSNoLoginInfoEmailNickname"));
- else if( email.isEmpty() && password.isEmpty())
- GSMessageBoxOk(TheGameText->fetch("GUI:Error"), TheGameText->fetch("GUI:GSNoLoginInfoEmailPassword"));
- else if( login.isEmpty() && password.isEmpty())
- GSMessageBoxOk(TheGameText->fetch("GUI:Error"), TheGameText->fetch("GUI:GSNoLoginInfoNicknamePassword"));
- else if( email.isEmpty())
- GSMessageBoxOk(TheGameText->fetch("GUI:Error"), TheGameText->fetch("GUI:GSNoLoginInfoEmail"));
- else if( password.isEmpty())
- GSMessageBoxOk(TheGameText->fetch("GUI:Error"), TheGameText->fetch("GUI:GSNoLoginInfoPassword"));
- else if( login.isEmpty() )
- GSMessageBoxOk(TheGameText->fetch("GUI:Error"), TheGameText->fetch("GUI:GSNoLoginInfoNickname"));
- else
- GSMessageBoxOk(TheGameText->fetch("GUI:Error"), TheGameText->fetch("GUI:GSNoLoginInfoAll"));
- }
-#ifdef ALLOW_NON_PROFILED_LOGIN
- }
- else
- {
- // not the profile screen - switch to it
- buttonPushed = TRUE;
- nextScreen = "Menus/GameSpyLoginProfile.wnd";
- TheShell->pop();
- }
-#endif // ALLOW_NON_PROFILED_LOGIN
- }
- else if ( controlID == buttonLoginID )
- {
- AsciiString login, password, email;
-
-#ifdef ALLOW_NON_PROFILED_LOGIN
- if (GameSpyUseProfiles)
- {
-#endif // ALLOW_NON_PROFILED_LOGIN
- AsciiString month, day, year;
- month.translate( GadgetTextEntryGetText(textEntryMonth) );
- day.translate( GadgetTextEntryGetText(textEntryDay) );
- year.translate( GadgetTextEntryGetText(textEntryYear) );
-
- if(!isAgeOkay(month, day, year))
- {
- GSMessageBoxOk(TheGameText->fetch("GUI:AgeFailedTitle"), TheGameText->fetch("GUI:AgeFailed"));
- break;
- }
-
- email.translate( GadgetComboBoxGetText(comboBoxEmail) );
- login.translate( GadgetComboBoxGetText(comboBoxLoginName) );
- password.translate( GadgetTextEntryGetText(textEntryPassword) );
-
- if ( !email.isEmpty() && !login.isEmpty() && !password.isEmpty() )
- {
- loginAttemptTime = timeGetTime();
- BuddyRequest req;
- req.buddyRequestType = BuddyRequest::BUDDYREQUEST_LOGIN;
- strlcpy(req.arg.login.nick, login.str(), ARRAY_SIZE(req.arg.login.nick));
- strlcpy(req.arg.login.email, email.str(), ARRAY_SIZE(req.arg.login.email));
- strlcpy(req.arg.login.password, password.str(), ARRAY_SIZE(req.arg.login.password));
- req.arg.login.hasFirewall = true;
-
- TheGameSpyInfo->setLocalBaseName( login );
- //TheGameSpyInfo->setLocalProfileID( resp.player.profileID );
- TheGameSpyInfo->setLocalEmail( email );
- TheGameSpyInfo->setLocalPassword( password );
- DEBUG_LOG(("before login: TheGameSpyInfo->stuff(%s/%s/%s)", TheGameSpyInfo->getLocalBaseName().str(), TheGameSpyInfo->getLocalEmail().str(), TheGameSpyInfo->getLocalPassword().str()));
-
- TheGameSpyBuddyMessageQueue->addRequest( req );
- if(checkBoxRememberPassword && GadgetCheckBoxIsChecked(checkBoxRememberPassword))
- {
- (*loginPref)["lastName"] = login;
- (*loginPref)["lastEmail"] = email;
- (*loginPref)["useProfiles"] = "yes";
- AsciiString date;
- date = month;
- date.concat(day);
- date.concat(year);
-
- loginPref->addLogin(email, login, password,date);
- }
- else
- {
- loginPref->forgetLogin(email);
- }
- EnableLoginControls( FALSE );
-
- // fire off some pings
- startPings();
- }
- else
- {
- // user didn't fill in all info. prompt him.
- if(email.isEmpty() && login.isEmpty() && password.isEmpty())
- GSMessageBoxOk(TheGameText->fetch("GUI:GSErrorTitle"), TheGameText->fetch("GUI:GSNoLoginInfoAll"));
- else if( email.isEmpty() && login.isEmpty())
- GSMessageBoxOk(TheGameText->fetch("GUI:GSErrorTitle"), TheGameText->fetch("GUI:GSNoLoginInfoEmailNickname"));
- else if( email.isEmpty() && password.isEmpty())
- GSMessageBoxOk(TheGameText->fetch("GUI:GSErrorTitle"), TheGameText->fetch("GUI:GSNoLoginInfoEmailPassword"));
- else if( login.isEmpty() && password.isEmpty())
- GSMessageBoxOk(TheGameText->fetch("GUI:GSErrorTitle"), TheGameText->fetch("GUI:GSNoLoginInfoNicknamePassword"));
- else if( email.isEmpty())
- GSMessageBoxOk(TheGameText->fetch("GUI:GSErrorTitle"), TheGameText->fetch("GUI:GSNoLoginInfoEmail"));
- else if( password.isEmpty())
- GSMessageBoxOk(TheGameText->fetch("GUI:GSErrorTitle"), TheGameText->fetch("GUI:GSNoLoginInfoPassword"));
- else if( login.isEmpty() )
- GSMessageBoxOk(TheGameText->fetch("GUI:GSErrorTitle"), TheGameText->fetch("GUI:GSNoLoginInfoNickname"));
- else
- GSMessageBoxOk(TheGameText->fetch("GUI:GSErrorTitle"), TheGameText->fetch("GUI:GSNoLoginInfoAll"));
- }
-#ifdef ALLOW_NON_PROFILED_LOGIN
- }
- else
- {
- login.translate( GadgetTextEntryGetText(textEntryLoginName) );
-
- if ( !login.isEmpty() )
- {
- loginAttemptTime = timeGetTime();
- PeerRequest req;
- req.peerRequestType = PeerRequest::PEERREQUEST_LOGIN;
- req.nick = login.str();
- req.login.profileID = 0;
- TheGameSpyPeerMessageQueue->addRequest( req );
-
- (*loginPref)["lastName"] = login;
- loginPref->erase("lastEmail");
- (*loginPref)["useProfiles"] = "no";
- EnableLoginControls( FALSE );
-
- // fire off some pings
- startPings();
- }
- }
-#endif // ALLOW_NON_PROFILED_LOGIN
-
- }
- else if ( controlID == buttonTOSID )
- {
- parentTOS->winHide(FALSE);
- useWebBrowserForTOS = FALSE;//loginPref->getBool("UseTOSBrowser", TRUE);
- if (useWebBrowserForTOS && (TheWebBrowser != nullptr))
- {
- TheWebBrowser->createBrowserWindow("TermsOfService", listboxTOS);
- webBrowserActive = TRUE;
- }
- else
- {
- // Okay, no web browser. This means we're looking at a UTF-8 text file.
- GadgetListBoxReset(listboxTOS);
- AsciiString fileName;
- fileName.format("Data\\%s\\TOS.txt", GetRegistryLanguage().str());
- File *theFile = TheFileSystem->openFile(fileName.str(), File::READ);
- if (theFile)
- {
- Int size = theFile->size();
-
- char *fileBuf = new char[size];
- Color tosColor = GameMakeColor(255, 255, 255, 255);
-
- Int bytesRead = theFile->read(fileBuf, size);
- if (bytesRead == size && size > 2)
- {
- fileBuf[size-1] = 0; // just to be safe
- AsciiString asciiBuf = fileBuf+2;
- AsciiString asciiLine;
- while (asciiBuf.nextToken(&asciiLine, "\r\n"))
- {
- UnicodeString uniLine;
- uniLine = UnicodeString(MultiByteToWideCharSingleLine(asciiLine.str()).c_str());
- uniLine.trimEnd();
- DEBUG_LOG(("adding TOS line: [%ls]", uniLine.str()));
- GadgetListBoxAddEntryText(listboxTOS, uniLine, tosColor, -1);
- }
-
- }
-
- delete[] fileBuf;
- fileBuf = nullptr;
-
- theFile->close();
- theFile = nullptr;
- }
- }
- EnableLoginControls( FALSE );
- buttonBack->winEnable(FALSE);
-
- }
- else if ( controlID == buttonTOSOKID )
- {
- EnableLoginControls( TRUE );
-
- parentTOS->winHide(TRUE);
- if (useWebBrowserForTOS && (TheWebBrowser != nullptr))
- {
- if (listboxTOS != nullptr)
- {
- TheWebBrowser->closeBrowserWindow(listboxTOS);
- }
- }
-
- OptionPreferences optionPref;
- optionPref["SawTOS"] = "yes";
- optionPref.write();
- webBrowserActive = FALSE;
- buttonBack->winEnable(TRUE);
- }
- break;
- }
-
- case GEM_EDIT_DONE:
- {
- break;
- }
- /*
- case GEM_UPDATE_TEXT:
- {
- if (buttonPushed)
- break;
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if ( controlID == textEntryLoginNameID )
- {
- UnicodeString munkee = GadgetTextEntryGetText( textEntryLoginName );
- if ( !isNickOkay( munkee ) )
- {
- munkee.removeLastChar();
- GadgetTextEntrySetText( textEntryLoginName, munkee );
- }
- }
- break;
- }
- */
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-}
-
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp
deleted file mode 100644
index 98c4e4cb9d5..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp
+++ /dev/null
@@ -1,196 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////////////
-// FILE: WOLMessageWindow.cpp
-// Author: Chris Huybregts, November 2001
-// Description: Lan Lobby Menu
-///////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/GameEngine.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/Shell.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetListBox.h"
-#include "GameClient/GadgetTextEntry.h"
-#include "GameNetwork/IPEnumeration.h"
-//#include "GameNetwork/WOL.h"
-
-
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
-// window ids ------------------------------------------------------------------------------
-static NameKeyType parentWOLMessageWindowID = NAMEKEY_INVALID;
-static NameKeyType buttonCancelID = NAMEKEY_INVALID;
-
-// Window Pointers ------------------------------------------------------------------------
-static GameWindow *parentWOLMessageWindow = nullptr;
-static GameWindow *buttonCancel = nullptr;
-
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the WOLMessage Window */
-//-------------------------------------------------------------------------------------------------
-void WOLMessageWindowInit( WindowLayout *layout, void *userData )
-{
- parentWOLMessageWindowID = TheNameKeyGenerator->nameToKey( "WOLMessageWindow.wnd:WOLMessageWindowParent" );
- buttonCancelID = TheNameKeyGenerator->nameToKey( "WOLMessageWindow.wnd:ButtonCancel" );
- parentWOLMessageWindow = TheWindowManager->winGetWindowFromId( nullptr, parentWOLMessageWindowID );
- buttonCancel = TheWindowManager->winGetWindowFromId( nullptr, buttonCancelID);
-
-
- // Show Menu
- layout->hide( FALSE );
-
- // Set Keyboard to Main Parent
- TheWindowManager->winSetFocus( parentWOLMessageWindow );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOLMessage Window shutdown method */
-//-------------------------------------------------------------------------------------------------
-void WOLMessageWindowShutdown( WindowLayout *layout, void *userData )
-{
-
- // hide menu
- layout->hide( TRUE );
-
- // our shutdown is complete
- TheShell->shutdownComplete( layout );
-}
-
-
-//-------------------------------------------------------------------------------------------------
-/** WOLMessage Window update method */
-//-------------------------------------------------------------------------------------------------
-void WOLMessageWindowUpdate( WindowLayout * layout, void *userData)
-{
- /*
- if (WOL::TheWOL)
- WOL::TheWOL->update();
- */
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOLMessage Window input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType WOLMessageWindowInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)buttonCancel, buttonCancelID );
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOLMessage Window window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType WOLMessageWindowSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- UnicodeString txtInput;
-
- switch( msg )
- {
-
-
- case GWM_CREATE:
- {
-
- break;
- }
-
- case GWM_DESTROY:
- {
- break;
- }
-
- case GWM_INPUT_FOCUS:
- {
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- return MSG_HANDLED;
- }
-
- case GBM_SELECTED:
- {
- break;
- }
-
- case GEM_EDIT_DONE:
- {
- break;
- }
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp
deleted file mode 100644
index 50e90a74af5..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp
+++ /dev/null
@@ -1,239 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////////////
-// FILE: WOLQMScoreScreen.cpp
-// Author: Matt Campbell, November 2001
-// Description: QuickMatch score screen (different from normal screen in that it has 'QM' and 'Discon' buttons)
-///////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/GameEngine.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/Shell.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetListBox.h"
-#include "GameClient/GadgetTextEntry.h"
-//#include "GameNetwork/WOL.h"
-//#include "GameNetwork/WOLmenus.h"
-
-
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
-// window ids ------------------------------------------------------------------------------
-static NameKeyType parentWOLQMScoreID = NAMEKEY_INVALID;
-static NameKeyType buttonDisconnectID = NAMEKEY_INVALID;
-static NameKeyType buttonQuickmatchID = NAMEKEY_INVALID;
-
-// Window Pointers ------------------------------------------------------------------------
-static GameWindow *parentWOLQMScore = nullptr;
-static GameWindow *buttonDisconnect = nullptr;
-static GameWindow *buttonQuickmatch = nullptr;
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the WOL Status Menu */
-//-------------------------------------------------------------------------------------------------
-void WOLQMScoreScreenInit( WindowLayout *layout, void *userData )
-{
- parentWOLQMScoreID = TheNameKeyGenerator->nameToKey( "WOLQMScoreScreen.wnd:WOLQMScoreScreenParent" );
- buttonDisconnectID = TheNameKeyGenerator->nameToKey( "WOLQMScoreScreen.wnd:ButtonDisconnect" );
- buttonQuickmatchID = TheNameKeyGenerator->nameToKey( "WOLQMScoreScreen.wnd:ButtonQuickMatch" );
- parentWOLQMScore = TheWindowManager->winGetWindowFromId( nullptr, parentWOLQMScoreID );
- buttonDisconnect = TheWindowManager->winGetWindowFromId( nullptr, buttonDisconnectID);
- buttonQuickmatch = TheWindowManager->winGetWindowFromId( nullptr, buttonQuickmatchID);
-
- /*
- if (WOL::TheWOL->getState() == WOL::WOLAPI_FATAL_ERROR)
- {
- // We can get to the score screen even though we've been disconnected. Just hide
- // any buttons that lead back into WOL.
-
- buttonQuickmatch->winHide( TRUE );
- }
- */
-
- // Show Menu
- layout->hide( FALSE );
-
- // Set Keyboard to Main Parent
- TheWindowManager->winSetFocus( parentWOLQMScore );
-
- //progressLayout = TheShell->top();
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Status Menu shutdown method */
-//-------------------------------------------------------------------------------------------------
-void WOLQMScoreScreenShutdown( WindowLayout *layout, void *userData )
-{
-
- // hide menu
- layout->hide( TRUE );
-
- // our shutdown is complete
- TheShell->shutdownComplete( layout );
-
- //progressLayout = nullptr;
-
-}
-
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Status Menu update method */
-//-------------------------------------------------------------------------------------------------
-void WOLQMScoreScreenUpdate( WindowLayout * layout, void *userData)
-{
- /*
- if (WOL::TheWOL)
- WOL::TheWOL->update();
- */
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Status Menu input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType WOLQMScoreScreenInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)buttonDisconnect, buttonDisconnectID );
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Status Menu window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType WOLQMScoreScreenSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- UnicodeString txtInput;
-
- switch( msg )
- {
-
-
- case GWM_CREATE:
- {
-
- break;
- }
-
- case GWM_DESTROY:
- {
- break;
- }
-
- case GWM_INPUT_FOCUS:
- {
- // if we're given the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- return MSG_HANDLED;
- }
-
- case GBM_SELECTED:
- {
- /*
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if ( controlID == buttonDisconnectID )
- {
- //TheShell->pop();
- if (WOL::TheWOL->setState( WOL::WOLAPI_FATAL_ERROR ))
- {
- WOL::TheWOL->addCommand( WOL::WOLCOMMAND_RESET ); // don't display an error, log out, or anything
- }
-
- }
- else if ( controlID == buttonQuickmatchID )
- {
- //TheShell->pop();
- if (WOL::TheWOL->getState() != WOL::WOLAPI_FATAL_ERROR)
- {
- if (WOL::TheWOL->setState( WOL::WOLAPI_TOURNAMENT ))
- {
- WOL::TheWOL->setScreen( WOL::WOLAPI_MENU_QUICKMATCH );
- WOL::TheWOL->addCommand( WOL::WOLCOMMAND_FIND_MATCH_CHANNEL );
- }
- }
-
- }
- */
- break;
- }
-
- case GEM_EDIT_DONE:
- {
- break;
- }
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp
deleted file mode 100644
index 9c45f169ea4..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp
+++ /dev/null
@@ -1,216 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////////////
-// FILE: WOLLoginMenu.cpp
-// Author: Chris Huybregts, November 2001
-// Description: Lan Lobby Menu
-///////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/GameEngine.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/Shell.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetListBox.h"
-#include "GameClient/GadgetTextEntry.h"
-//#include "GameNetwork/WOL.h"
-//#include "GameNetwork/WOLmenus.h"
-
-
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
-// window ids ------------------------------------------------------------------------------
-static NameKeyType parentWOLStatusID = NAMEKEY_INVALID;
-static NameKeyType buttonDisconnectID = NAMEKEY_INVALID;
-
-// Window Pointers ------------------------------------------------------------------------
-static GameWindow *parentWOLStatus = nullptr;
-static GameWindow *buttonDisconnect = nullptr;
-GameWindow *progressTextWindow = nullptr;
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the WOL Status Menu */
-//-------------------------------------------------------------------------------------------------
-void WOLStatusMenuInit( WindowLayout *layout, void *userData )
-{
- parentWOLStatusID = TheNameKeyGenerator->nameToKey( "WOLStatusMenu.wnd:WOLStatusMenuParent" );
- buttonDisconnectID = TheNameKeyGenerator->nameToKey( "WOLStatusMenu.wnd:ButtonDisconnect" );
- parentWOLStatus = TheWindowManager->winGetWindowFromId( nullptr, parentWOLStatusID );
- buttonDisconnect = TheWindowManager->winGetWindowFromId( nullptr, buttonDisconnectID);
-
- progressTextWindow = TheWindowManager->winGetWindowFromId( nullptr,
- TheNameKeyGenerator->nameToKey( "WOLStatusMenu.wnd:ListboxStatus" ) );
-
- // Show Menu
- layout->hide( FALSE );
-
- // Set Keyboard to Main Parent
- TheWindowManager->winSetFocus( parentWOLStatus );
-
- //progressLayout = TheShell->top();
-
- //WOL::raiseWOLMessageBox();
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Status Menu shutdown method */
-//-------------------------------------------------------------------------------------------------
-void WOLStatusMenuShutdown( WindowLayout *layout, void *userData )
-{
-
- // hide menu
- layout->hide( TRUE );
-
- // our shutdown is complete
- TheShell->shutdownComplete( layout );
-
- //progressLayout = nullptr;
-
- //WOL::raiseWOLMessageBox();
-}
-
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Status Menu update method */
-//-------------------------------------------------------------------------------------------------
-void WOLStatusMenuUpdate( WindowLayout * layout, void *userData)
-{
- //if (WOL::TheWOL)
- //WOL::TheWOL->update();
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Status Menu input callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType WOLStatusMenuInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CHAR:
- {
- UnsignedByte key = mData1;
- UnsignedByte state = mData2;
-
- switch( key )
- {
-
- // ----------------------------------------------------------------------------------------
- case KEY_ESC:
- {
-
- //
- // send a simulated selected event to the parent window of the
- // back/exit button
- //
- if( BitIsSet( state, KEY_STATE_UP ) )
- {
- TheWindowManager->winSendSystemMsg( window, GBM_SELECTED,
- (WindowMsgData)buttonDisconnect, buttonDisconnectID );
-
- }
-
- // don't let key fall through anywhere else
- return MSG_HANDLED;
-
- }
-
- }
-
- }
-
- }
-
- return MSG_IGNORED;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** WOL Status Menu window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType WOLStatusMenuSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- UnicodeString txtInput;
-
- switch( msg )
- {
-
-
- case GWM_CREATE:
- {
-
- break;
- }
-
- case GWM_DESTROY:
- {
- break;
- }
-
- case GWM_INPUT_FOCUS:
- {
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- return MSG_HANDLED;
- }
-
- case GBM_SELECTED:
- {
- /*
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if ( controlID == buttonDisconnectID )
- {
- //TheShell->pop();
- if (WOL::TheWOL->setState( WOL::WOLAPI_FATAL_ERROR ))
- {
- WOL::TheWOL->addCommand( WOL::WOLCOMMAND_RESET ); // don't display an error, log out, or anything
- }
-
- }
- */
- break;
- }
-
- case GEM_EDIT_DONE:
- {
- break;
- }
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp
deleted file mode 100644
index 82518dd1b99..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/MessageBox.cpp
+++ /dev/null
@@ -1,265 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: MessageBox.cpp /////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: MessageBox.cpp
-//
-// Created: Chris Huybregts, June 2001
-//
-// Desc: the Message Box control
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/GameEngine.h"
-#include "Common/NameKeyGenerator.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/Shell.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/MessageBox.h"
-
-
-GameWindow *MessageBoxYesNo(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc yesCallback,GameWinMsgBoxFunc noCallback) ///< convenience function for displaying a Message box with Yes and No buttons
-{
- return TheWindowManager->gogoMessageBox(-1,-1,-1,-1,MSG_BOX_NO | MSG_BOX_YES , titleString, bodyString, yesCallback, noCallback, nullptr, nullptr);
-}
-GameWindow *QuitMessageBoxYesNo(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc yesCallback,GameWinMsgBoxFunc noCallback) ///< convenience function for displaying a Message box with Yes and No buttons
-{
- return TheWindowManager->gogoMessageBox(-1,-1,-1,-1,MSG_BOX_NO | MSG_BOX_YES , titleString, bodyString, yesCallback, noCallback, nullptr, nullptr, TRUE);
-}
-
-
-GameWindow *MessageBoxYesNoCancel(UnicodeString titleString,UnicodeString bodyString, GameWinMsgBoxFunc yesCallback, GameWinMsgBoxFunc noCallback, GameWinMsgBoxFunc cancelCallback)///< convenience function for displaying a Message box with Yes,No and Cancel buttons
-{
- return TheWindowManager->gogoMessageBox(-1,-1,-1,-1,MSG_BOX_NO | MSG_BOX_YES | MSG_BOX_CANCEL , titleString, bodyString, yesCallback, noCallback, nullptr, cancelCallback);
-}
-
-
-GameWindow *MessageBoxOkCancel(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc okCallback,GameWinMsgBoxFunc cancelCallback)///< convenience function for displaying a Message box with Ok and Cancel buttons
-{
- return TheWindowManager->gogoMessageBox(-1,-1,-1,-1,MSG_BOX_OK | MSG_BOX_CANCEL , titleString, bodyString, nullptr, nullptr, okCallback, cancelCallback);
-}
-
-GameWindow *MessageBoxOk(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc okCallback)///< convenience function for displaying a Message box with Ok button
-{
- return TheWindowManager->gogoMessageBox(-1,-1,-1,-1,MSG_BOX_OK, titleString, bodyString, nullptr, nullptr, okCallback, nullptr);
-}
-
-
-GameWindow *MessageBoxCancel(UnicodeString titleString,UnicodeString bodyString,GameWinMsgBoxFunc cancelCallback)///< convenience function for displaying a Message box with Cancel button
-{
- return TheWindowManager->gogoMessageBox(-1,-1,-1,-1, MSG_BOX_CANCEL, titleString, bodyString, nullptr, nullptr, nullptr, cancelCallback);
-}
-
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////////////////////////
-
-
-
-//-------------------------------------------------------------------------------------------------
-/** Message Box window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType MessageBoxSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
-
- switch( msg )
- {
-
- //---------------------------------------------------------------------------------------------
- case GWM_DESTROY:
- {
- delete (WindowMessageBoxData *)window->winGetUserData();
- window->winSetUserData( nullptr );
- break;
-
- }
-
- // --------------------------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
- static NameKeyType buttonOkID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonOk" );
- static NameKeyType buttonYesID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonYes" );
- static NameKeyType buttonNoID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonNo" );
- static NameKeyType buttonCancelID = TheNameKeyGenerator->nameToKey( "MessageBox.wnd:ButtonCancel" );
- WindowMessageBoxData *MsgBoxCallbacks = (WindowMessageBoxData *)window->winGetUserData();
-
- if( controlID == buttonOkID )
- {
- //simple enough,if we have a callback, call it, if not, then just destroy the window
- if (MsgBoxCallbacks->okCallback)
- MsgBoxCallbacks->okCallback();
-
- TheWindowManager->winDestroy(window);
-
- }
- else if( controlID == buttonYesID )
- {
- if (MsgBoxCallbacks->yesCallback)
- MsgBoxCallbacks->yesCallback();
- TheWindowManager->winDestroy(window);
- }
- else if( controlID == buttonNoID )
- {
- if (MsgBoxCallbacks->noCallback)
- MsgBoxCallbacks->noCallback();
- TheWindowManager->winDestroy(window);
- }
- else if( controlID == buttonCancelID )
- {
- if (MsgBoxCallbacks->cancelCallback)
- MsgBoxCallbacks->cancelCallback();
- TheWindowManager->winDestroy(window);
- }
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-//-------------------------------------------------------------------------------------------------
-/** Message Box window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType QuitMessageBoxSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
-
- switch( msg )
- {
-
- //---------------------------------------------------------------------------------------------
- case GWM_DESTROY:
- {
- delete (WindowMessageBoxData *)window->winGetUserData();
- window->winSetUserData( nullptr );
- break;
-
- }
-
- // --------------------------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // if we're givin the opportunity to take the keyboard focus we must say we want it
- if( mData1 == TRUE )
- *(Bool *)mData2 = TRUE;
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
- static NameKeyType buttonOkID = TheNameKeyGenerator->nameToKey( "QuitMessageBox.wnd:ButtonOk" );
- static NameKeyType buttonYesID = TheNameKeyGenerator->nameToKey( "QuitMessageBox.wnd:ButtonYes" );
- static NameKeyType buttonNoID = TheNameKeyGenerator->nameToKey( "QuitMessageBox.wnd:ButtonNo" );
- static NameKeyType buttonCancelID = TheNameKeyGenerator->nameToKey( "QuitMessageBox.wnd:ButtonCancel" );
- WindowMessageBoxData *MsgBoxCallbacks = (WindowMessageBoxData *)window->winGetUserData();
-
- if( controlID == buttonOkID )
- {
- //simple enough,if we have a callback, call it, if not, then just destroy the window
- if (MsgBoxCallbacks->okCallback)
- MsgBoxCallbacks->okCallback();
-
- TheWindowManager->winDestroy(window);
-
- }
- else if( controlID == buttonYesID )
- {
- if (MsgBoxCallbacks->yesCallback)
- MsgBoxCallbacks->yesCallback();
- TheWindowManager->winDestroy(window);
- }
- else if( controlID == buttonNoID )
- {
- if (MsgBoxCallbacks->noCallback)
- MsgBoxCallbacks->noCallback();
- TheWindowManager->winDestroy(window);
- }
- else if( controlID == buttonCancelID )
- {
- if (MsgBoxCallbacks->cancelCallback)
- MsgBoxCallbacks->cancelCallback();
- TheWindowManager->winDestroy(window);
- }
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp
deleted file mode 100644
index cf2c0115bbe..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp
+++ /dev/null
@@ -1,74 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: ReplayControls.cpp ///////////////////////////////////////////////////////////////////////
-// Author: Bryan Cleveland - December 2001
-// Desc: GUI Control box for the playback controls
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "GameClient/GameWindow.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GameClient.h"
-
-//-------------------------------------------------------------------------------------------------
-/** Input procedure for the control bar */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType ReplayControlInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- return MSG_IGNORED;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** System callback for the control bar parent */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType ReplayControlSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
-
- //---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
-
- break;
-
- }
-
- //---------------------------------------------------------------------------------------------
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp
deleted file mode 100644
index 205cbda9638..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp
+++ /dev/null
@@ -1,376 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: CheckBox.cpp /////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: CheckBox.cpp
-//
-// Created: Colin Day, June 2001
-//
-// Desc: Checkbox GUI control
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "Common/Language.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/Keyboard.h"
-
-// DEFINES ////////////////////////////////////////////////////////////////////
-
-// PRIVATE TYPES //////////////////////////////////////////////////////////////
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////
-
-// PUBLIC DATA ////////////////////////////////////////////////////////////////
-
-// PRIVATE PROTOTYPES /////////////////////////////////////////////////////////
-
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-// GadgetCheckBoxInput ========================================================
-/** Handle input for check box */
-//=============================================================================
-WindowMsgHandledType GadgetCheckBoxInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- WinInstanceData *instData = window->winGetInstanceData();
-
- switch( msg )
- {
-
- // ------------------------------------------------------------------------
- case GWM_MOUSE_ENTERING:
- {
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- {
-
- BitSet( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_MOUSE_ENTERING,
- (WindowMsgData)window,
- mData1 );
- //TheWindowManager->winSetFocus( window );
-
- }
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_MOUSE_LEAVING:
- {
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- {
-
- BitClear( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_MOUSE_LEAVING,
- (WindowMsgData)window,
- mData1 );
- }
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DRAG:
- {
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(), GGM_LEFT_DRAG,
- (WindowMsgData)window, mData1 );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DOWN:
- {
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_UP:
- {
-
- if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) == FALSE )
- {
- // this up click was not meant for this button
- return MSG_IGNORED;
- }
-
- // Toggle the check state
- instData->m_state ^= WIN_STATE_SELECTED;
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(), GBM_SELECTED,
- (WindowMsgData)window, mData1 );
-
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_RIGHT_DOWN:
- {
-
- break;
- }
-
- //-------------------------------------------------------------------------
- case GWM_RIGHT_UP:
- {
- // Need to be specially marked to care about right mouse events
- if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) )
- {
- TheWindowManager->winSendSystemMsg( instData->getOwner(), GBM_SELECTED_RIGHT,
- (WindowMsgData)window, mData1 );
-
- BitClear( instData->m_state, WIN_STATE_SELECTED );
- }
- else
- {
- // this up click was not meant for this button
- return MSG_IGNORED;
- }
- break;
- }
-
- // ------------------------------------------------------------------------
- case GWM_CHAR:
- {
-
- switch( mData1 )
- {
-
- // --------------------------------------------------------------------
- case KEY_ENTER:
- case KEY_SPACE:
- {
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
- // Toggle the check state
- instData->m_state ^= WIN_STATE_SELECTED;
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_SELECTED,
- (WindowMsgData)window,
- 0 );
- }
- break;
-
- }
-
- // --------------------------------------------------------------------
- case KEY_DOWN:
- case KEY_RIGHT:
- case KEY_TAB:
- {
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- TheWindowManager->winNextTab(window);
- break;
-
- }
-
- // --------------------------------------------------------------------
- case KEY_UP:
- case KEY_LEFT:
- {
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- TheWindowManager->winPrevTab(window);
- break;
-
- }
-
- // --------------------------------------------------------------------
- default:
- {
-
- return MSG_IGNORED;
-
- }
-
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- default:
- {
-
- return MSG_IGNORED;
-
- }
-
- }
-
- return MSG_HANDLED;
-
-}
-
-// GadgetCheckBoxSystem =======================================================
-/** Handle system messages for check box */
-//=============================================================================
-WindowMsgHandledType GadgetCheckBoxSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- WinInstanceData *instData = window->winGetInstanceData();
-
- switch( msg )
- {
- // ------------------------------------------------------------------------
- case GGM_SET_LABEL:
- {
- window->winSetText( *(UnicodeString*)mData1 );
- break;
- }
-
- // ------------------------------------------------------------------------
- case GWM_CREATE:
- break;
-
- // ------------------------------------------------------------------------
- case GWM_DESTROY:
- break;
-
- // ------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
-
- if( mData1 == FALSE )
- BitClear( instData->m_state, WIN_STATE_HILITED );
- else
- BitSet( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GGM_FOCUS_CHANGE,
- mData1,
- window->winGetWindowId() );
- if( mData1 == FALSE )
- *(Bool*)mData2 = FALSE;
- else
- *(Bool*)mData2 = TRUE;
-
- break;
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-// GadgetCheckBoxSetText ======================================================
-/** Set the text for the control */
-//=============================================================================
-void GadgetCheckBoxSetText( GameWindow *g, UnicodeString text )
-{
-
- // sanity
- if( g == nullptr )
- return;
-
- TheWindowManager->winSendSystemMsg( g, GGM_SET_LABEL, (WindowMsgData)&text, 0 );
-
-}
-
-// GadgetCheckBoxSetChecked ============================================
-//=============================================================================
-/** Set the check state for the check box */
-//=============================================================================
-void GadgetCheckBoxSetChecked( GameWindow *g, Bool isChecked)
-{
- WinInstanceData *instData = g->winGetInstanceData();
- if (isChecked)
- {
- BitSet(instData->m_state, WIN_STATE_SELECTED);
- }
- else
- {
- BitClear(instData->m_state, WIN_STATE_SELECTED);
- }
-
- TheWindowManager->winSendSystemMsg( g->winGetOwner(), GBM_SELECTED,
- (WindowMsgData)g, 0 );
-
-}
-
-// GadgetCheckBoxToggle ============================================
-//=============================================================================
-/** Toggle the check state for the check box */
-//=============================================================================
-void GadgetCheckBoxToggle( GameWindow *g)
-{
- WinInstanceData *instData = g->winGetInstanceData();
- Bool isChecked = BitIsSet(instData->m_state, WIN_STATE_SELECTED);
- if (isChecked)
- {
- BitClear(instData->m_state, WIN_STATE_SELECTED);
- }
- else
- {
- BitSet(instData->m_state, WIN_STATE_SELECTED);
- }
-
- TheWindowManager->winSendSystemMsg( g->winGetOwner(), GBM_SELECTED,
- (WindowMsgData)g, 0 );
-
-}
-
-// GadgetCheckBoxIsChecked ======================================================
-/** Check the check state */
-//=============================================================================
-Bool GadgetCheckBoxIsChecked( GameWindow *g )
-{
- WinInstanceData *instData = g->winGetInstanceData();
- return (BitIsSet(instData->m_state, WIN_STATE_SELECTED));
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetComboBox.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetComboBox.cpp
deleted file mode 100644
index 96769530207..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetComboBox.cpp
+++ /dev/null
@@ -1,1107 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GadgetComboBox.cpp ///////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: ListBox.cpp
-//
-// Created: Dean Iverson, March 1998
-// Colin Day, June 2001
-//
-// Desc: ListBox GUI control
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "Common/Language.h"
-#include "Common/AudioEventRTS.h"
-#include "Common/GameAudio.h"
-#include "Common/Debug.h"
-#include "GameClient/DisplayStringManager.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetListBox.h"
-#include "GameClient/GadgetComboBox.h"
-#include "GameClient/GadgetTextEntry.h"
-#include "GameClient/GadgetPushButton.h"
-#include "GameClient/GadgetSlider.h"
-#include "GameClient/GameWindowGlobal.h"
-
-// DEFINES ////////////////////////////////////////////////////////////////////
-
-// PRIVATE TYPES //////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// PRIVATE DATA ///////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-// PUBLIC DATA ////////////////////////////////////////////////////////////////
-
-// PRIVATE PROTOTYPES /////////////////////////////////////////////////////////
-
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-void HideListBox(GameWindow * window);
-
-// GadgetComboBoxInput =========================================================
-/** Handle input for Combo box */
-//=============================================================================
-WindowMsgHandledType GadgetComboBoxInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-// ComboBoxData *combo = (ComboBoxData *)window->winGetUserData();
- WinInstanceData *instData = window->winGetInstanceData();
- GameWindow *editBox = GadgetComboBoxGetEditBox(window);
- switch (msg)
- {
-
- // ------------------------------------------------------------------------
- case GWM_CHAR:
- {
-
- switch (mData1)
- {
-
- // --------------------------------------------------------------------
- case KEY_DOWN:
- case KEY_RIGHT:
- case KEY_TAB:
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- TheWindowManager->winNextTab(window);
- break;
-
- // --------------------------------------------------------------------
- case KEY_UP:
- case KEY_LEFT:
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- TheWindowManager->winPrevTab(window);
- break;
-
- // --------------------------------------------------------------------
- default:
- return TheWindowManager->winSendInputMsg( editBox, GWM_CHAR, mData1, mData2 );
-
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_WHEEL_DOWN:
- {
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_WHEEL_UP:
- {
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_UP:
- {
- ComboBoxData *comboData = (ComboBoxData *)window->winGetUserData();
- ICoord2D winSize;
- //ICoord2D winPosition;
- ICoord2D newSize;
- Int listX =0;
- Int multiplier;
- comboData->dontHide = FALSE;
- AudioEventRTS buttonClick("GUIClick");
-
- if( TheAudio )
- {
- TheAudio->addAudioEvent( &buttonClick );
- }
-
- GameWindow *listBox = GadgetComboBoxGetListBox(window);
- if (listBox)
- {
- TheWindowManager->winSetLoneWindow(window);
- // If the Listbox isn't showing, Show it.
- if(listBox->winIsHidden())
- {
- listBox->winHide(FALSE);
- window->winGetSize(&winSize.x, &winSize.y);
- WinInstanceData *listInstData = listBox->winGetInstanceData();
- ListboxData *listData = (ListboxData *)listBox->winGetUserData();
- // If we have less entries then our max display is set to, only show
- // those entries and not additional blank lines. Also, just so it looks
- // pretty, hide the list box's sliders if we don't need to scroll.
- if(comboData->entryCount <= comboData->maxDisplay)
- {
- multiplier = comboData->entryCount;
- listX = winSize.x;// + 16;
-
- if(listData->upButton)
- listData->upButton->winHide(TRUE);
- if(listData->downButton)
- listData->downButton->winHide(TRUE);
- if(listData->slider)
- listData->slider->winHide(TRUE);
- }
- else
- {
- multiplier = comboData->maxDisplay;
- listX = winSize.x;
- if(listData->upButton)
- listData->upButton->winHide(FALSE);
- if(listData->downButton)
- listData->downButton->winHide(FALSE);
- if(listData->slider)
- listData->slider->winHide(FALSE);
-
- }
-
- newSize.y = ((TheWindowManager->winFontHeight( listInstData->getFont() ) ) * multiplier) + multiplier * 2 + 4;
- window->winSetSize(winSize.x , winSize.y + newSize.y );
- listBox->winSetPosition(0, winSize.y);
-
- listBox->winSetSize(listX , newSize.y);
- }
- // if the Listbox was showing, hide it.
- else
- {
- HideListBox(window);
- }
- } break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_RIGHT_UP:
- {
- break;
-
- }
-
-/*
- // ------------------------------------------------------------------------
- case GWM_MOUSE_ENTERING:
- {
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- {
-
- BitSet( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_MOUSE_ENTERING,
- (WindowMsgData)window,
- 0 );
- TheWindowManager->winSetFocus( window );
-
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_MOUSE_LEAVING:
- {
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ))
- {
-
- BitClear( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_MOUSE_LEAVING,
- (WindowMsgData)window,
- 0 );
- }
-
- break;
-
- }
-*/
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DRAG:
-
- if (BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GGM_LEFT_DRAG,
- (WindowMsgData)window,
- 0 );
- break;
-
- // ------------------------------------------------------------------------
-// case GWM_LEFT_DOWN:
-
- // we want to eat the down... so we may receive the up.
-// return MSG_HANDLED;
-
- //-------------------------------------------------------------------------
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-// HideListBox ================================================================
-/** Called to close the listbox if it is opened */
-//=============================================================================
-void HideListBox(GameWindow * window)
-{
- ICoord2D winSize;
- ICoord2D newSize;
- GameWindow *listBox = GadgetComboBoxGetListBox(window);
- if (!listBox)
- return;
-
- if(!listBox->winIsHidden())
- {
- listBox->winHide(TRUE);
- GameWindow *editBox = GadgetComboBoxGetEditBox(window);
- editBox->winGetSize(&winSize.x, &winSize.y);
- window->winGetSize(&newSize.x, &newSize.y);
- window->winSetSize(newSize.x, winSize.y );
- }
-}
-
-// GadgetListBoxSystem ========================================================
-/** Handle system messages for list box */
-//=============================================================================
-WindowMsgHandledType GadgetComboBoxSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-// ListboxData *list = (ListboxData *)window->winGetUserData();
- WinInstanceData *instData = window->winGetInstanceData();
- ComboBoxData *comboData = (ComboBoxData *)window->winGetUserData();
- switch( msg )
- {
- // ------------------------------------------------------------------------
- case GGM_SET_LABEL:
- {
- instData->setText(*(UnicodeString*)mData1);
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GCM_GET_TEXT:
- {
- if(comboData->editBox)
- *(UnicodeString*)mData2 = GadgetTextEntryGetText(comboData->editBox);
- break;
- }
-
- // ------------------------------------------------------------------------
- case GCM_SET_TEXT:
- {
- if (comboData->editBox)
- GadgetTextEntrySetText(comboData->editBox,*(const UnicodeString*)mData1);
- break;
-
- }
-
- case GEM_UPDATE_TEXT:
- {
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GCM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
- if (comboData->listBox)
- {
- GadgetListBoxSetSelected(comboData->listBox, -1);
- HideListBox(window);
- }
- break;
- }
-
- // ------------------------------------------------------------------------
- // if we get sent an edit done message from the text box, lets notify the parent
- case GEM_EDIT_DONE:
- {
- if ((GameWindow *)mData1 == comboData->editBox)
- {
- HideListBox(window);
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GCM_SELECTED,
- (WindowMsgData)window,
- 0 );
- }
- break;
- }
- // ------------------------------------------------------------------------
- // Set the selection in the listbox, this will trigger the listbox selected message
- // which will set the edit box.
- case GCM_SET_SELECTION:
- {
- GameWindow *listBox = GadgetComboBoxGetListBox(window);
- if(listBox)
- {
- if( !listBox->winIsHidden() && mData2 == TRUE )
- comboData->dontHide = TRUE;
-
- GadgetListBoxSetSelected(listBox, (Int)mData1);
- }
- break;
- }
- // ------------------------------------------------------------------------
- // Get what the listbox has selected.
- case GCM_GET_SELECTION:
- {
- if(comboData->listBox)
- GadgetListBoxGetSelected(comboData->listBox, (Int *)mData2);
- else
- {
- DEBUG_CRASH(("We don't have a listbox as part of the combo box"));
- *(Int *)mData2 = -1;
- }
- break;
- }
- // ------------------------------------------------------------------------
- // Set the User Data for the specified listbox element
- case GCM_SET_ITEM_DATA:
- {
- if(comboData->listBox)
- {
- GadgetListBoxSetItemData(comboData->listBox, (void *)mData2, (Int)mData1 );
- }
-
- break;
- }
- // ------------------------------------------------------------------------
- // Get the user Data for the specified listbox element
- case GCM_GET_ITEM_DATA:
- {
- if(comboData->listBox)
- {
- *(void **)mData2 = GadgetListBoxGetItemData(comboData->listBox, (Int) mData1, 0);
- }
- break;
- }
- // ------------------------------------------------------------------------
- // Pass onto the parent window the selection the listbox just made
- case GLM_SELECTED:
- {
- if((GameWindow *) mData1 == comboData->listBox)
- {
- if( comboData->dontHide == TRUE )
- {
- comboData->dontHide = FALSE;
- }
- else
- HideListBox(window);
-
- // Nothing was actually selected, so we just want to
- if( mData2 == -1)
- {
- break;
- }
-
- //Grab the text that was selected
- UnicodeString tempUString;
- Color color;
- tempUString = GadgetListBoxGetTextAndColor( comboData->listBox, &color, mData2, 0 );
-
- GadgetTextEntrySetTextColor(comboData->editBox, color);
-
- GadgetTextEntrySetText(comboData->editBox, tempUString);
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GCM_SELECTED,
- (WindowMsgData)window,
- 0 );
- }
- break;
- }
-
- // ------------------------------------------------------------------------
- case GGM_LEFT_DRAG:
- {
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GCM_DEL_ALL:
- {
- if ( comboData->listBox )
- GadgetListBoxReset(comboData->listBox);
- if ( comboData->editBox )
- GadgetTextEntrySetText(comboData->editBox, UnicodeString::TheEmptyString );
- comboData->entryCount = 0;
- //HideListBox(window);
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GCM_DEL_ENTRY:
- {
-
- break;
-
- }
- // ------------------------------------------------------------------------
- case GGM_CLOSE:
- {
- HideListBox(window);
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GCM_ADD_ENTRY:
- {
- GameWindow *listBox = GadgetComboBoxGetListBox(window);
- ListboxData *listData = (ListboxData *)listBox->winGetUserData();
-
- Int addedIndex = -1;
- if( listBox )
- {
- //Increase our internal entry count
- comboData->entryCount++;
- //If we've exceeded the set listlength, resize it to twice the size
- if(comboData->entryCount >= listData->listLength)
- GadgetListBoxSetListLength(listBox,listData->listLength * 2);
- //Add the entry to the Listbox
- addedIndex = GadgetListBoxAddEntryText( listBox, *(UnicodeString*)mData1, mData2, -1, 0 );
-
- // Now resize the list box
- ICoord2D winSize;
- ICoord2D newSize;
- ICoord2D editBoxSize;
- Int listX;
- Int multiplier;
- WinInstanceData *listInstData = listBox->winGetInstanceData();
- GameWindow *editBox = GadgetComboBoxGetEditBox(window);
- window->winGetSize(&winSize.x, &winSize.y);
- editBox->winGetSize(&editBoxSize.x, &editBoxSize.y);
- // If the listbox has less entries then the MaxDisplay, size it smaller
- if(comboData->entryCount <= comboData->maxDisplay)
- {
- multiplier = comboData->entryCount;
- listX = winSize.x + 16;
- if(listData->upButton)
- listData->upButton->winHide(TRUE);
- if(listData->downButton)
- listData->downButton->winHide(TRUE);
- if(listData->slider)
- listData->slider->winHide(TRUE);
- }
- else
- {
- //Else size it to the MaxDisplay Size
- multiplier = comboData->maxDisplay;
- listX = winSize.x;
- if(listData->upButton)
- listData->upButton->winHide(FALSE);
- if(listData->downButton)
- listData->downButton->winHide(FALSE);
- if(listData->slider)
- listData->slider->winHide(FALSE);
- }
- newSize.y = ((TheWindowManager->winFontHeight( listInstData->getFont() ) ) * multiplier) + multiplier * 2 + 4;
- listBox->winSetPosition(0, editBoxSize.y);
- listBox->winSetSize(listX , newSize.y);
- }
-
- return( (WindowMsgHandledType) addedIndex );
- }
-
-
- // ------------------------------------------------------------------------
- case GWM_CREATE:
- break;
-
- // ------------------------------------------------------------------------
- case GGM_RESIZED:
- {
- Int width = (Int)mData1;
- Int height = (Int)mData2;
- ICoord2D dropDownSize;
-
- // get needed window sizes
-
- comboData->dropDownButton->winGetSize( &dropDownSize.x, &dropDownSize.y );
-
- GameWindow *listBox = GadgetComboBoxGetListBox(window);
- if (listBox->winIsHidden())
- {
- if (listBox)
- listBox->winSetSize(width,height);
-
- if( comboData->dropDownButton )
- {
- comboData->dropDownButton->winSetPosition( width - dropDownSize.x, 0 );
- }
-
- if( comboData->editBox )
- {
- comboData->editBox->winSetPosition( 0, 0 );
- comboData->editBox->winSetSize( width - dropDownSize.x, height );
- }
- }
- break;
-
- }
-
- // ------------------------------------------------------------------------
-
- // ------------------------------------------------------------------------
- case GWM_DESTROY:
- {
- TheWindowManager->winSetLoneWindow(nullptr); // if we are transitioning screens, close all combo boxes
- delete (ComboBoxData *)window->winGetUserData();
- window->winSetUserData(nullptr);
- comboData = nullptr;
- break;
- }
-
- // ------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // If we're losing focus
- if( mData1 == FALSE )
- {
- BitClear( instData->m_state, WIN_STATE_HILITED );
- }
- else
- {
- BitSet( instData->m_state, WIN_STATE_HILITED );
- }
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GGM_FOCUS_CHANGE,
- mData1,
- window->winGetWindowId() );
-
- Bool wantsFocus = FALSE;
- GameWindow *editBox = GadgetComboBoxGetEditBox(window);
- // we need to tell the text entry box to take the focus.
- TheWindowManager->winSendSystemMsg( editBox, GWM_INPUT_FOCUS, mData1, (WindowMsgData)&wantsFocus );
-
- *(Bool*)mData2 = TRUE;
- break;
-
- }
-
-
- case GBM_SELECTED:
- {
- // See if the drop down button was selected
- if( (GameWindow *)mData1 == comboData->dropDownButton )
- {
- ICoord2D winSize;
- //ICoord2D winPosition;
- ICoord2D newSize;
- Int listX =0;
- Int multiplier;
- comboData->dontHide = FALSE;
- GameWindow *listBox = GadgetComboBoxGetListBox(window);
- if (listBox)
- {
- TheWindowManager->winSetLoneWindow(window);
- // If the Listbox isn't showing, Show it.
- if(listBox->winIsHidden())
- {
- listBox->winHide(FALSE);
- window->winGetSize(&winSize.x, &winSize.y);
- WinInstanceData *listInstData = listBox->winGetInstanceData();
- ListboxData *listData = (ListboxData *)listBox->winGetUserData();
- // If we have less entries then our max display is set to, only show
- // those entries and not additional blank lines. Also, just so it looks
- // pretty, hide the list box's sliders if we don't need to scroll.
- if(comboData->entryCount <= comboData->maxDisplay)
- {
- multiplier = comboData->entryCount;
- listX = winSize.x;// + 16;
-
- if(listData->upButton)
- listData->upButton->winHide(TRUE);
- if(listData->downButton)
- listData->downButton->winHide(TRUE);
- if(listData->slider)
- listData->slider->winHide(TRUE);
- }
- else
- {
- multiplier = comboData->maxDisplay;
- listX = winSize.x;
- if(listData->upButton)
- listData->upButton->winHide(FALSE);
- if(listData->downButton)
- listData->downButton->winHide(FALSE);
- if(listData->slider)
- listData->slider->winHide(FALSE);
-
- }
-
- newSize.y = ((TheWindowManager->winFontHeight( listInstData->getFont() ) ) * multiplier) + multiplier * 2 + 4;
- window->winSetSize(winSize.x , winSize.y + newSize.y );
- listBox->winSetPosition(0, winSize.y);
-
- listBox->winSetSize(listX , newSize.y);
- }
- // if the Listbox was showing, hide it.
- else
- {
- HideListBox(window);
- }
- }
- }
- break;
- }
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-// GadgetComboBoxSetColors ====================================================
-/** Set the colors for a Combo box, note that this will also automatically
- * change the colors of any attached slider, slider thumb, and slider
- * buttons */
-//=============================================================================
-void GadgetComboBoxSetColors( GameWindow *comboBox,
- Color enabledColor,
- Color enabledBorderColor,
- Color enabledSelectedItemColor,
- Color enabledSelectedItemBorderColor,
- Color disabledColor,
- Color disabledBorderColor,
- Color disabledSelectedItemColor,
- Color disabledSelectedItemBorderColor,
- Color hiliteColor,
- Color hiliteBorderColor,
- Color hiliteSelectedItemColor,
- Color hiliteSelectedItemBorderColor )
-{
-// ComboBoxData *comboBoxData = (ComboBoxData *)comboBox->winGetUserData();
- // enabled
-
-// enabled
- GadgetComboBoxSetEnabledColor( comboBox, enabledColor);
- GadgetComboBoxSetEnabledBorderColor( comboBox, enabledBorderColor );
- GadgetComboBoxSetEnabledSelectedItemColor( comboBox, enabledSelectedItemColor );
- GadgetComboBoxSetEnabledSelectedItemBorderColor( comboBox, enabledSelectedItemBorderColor );
- // disabled
- GadgetComboBoxSetDisabledColor( comboBox, disabledColor );
- GadgetComboBoxSetDisabledBorderColor( comboBox, disabledBorderColor );
- GadgetComboBoxSetDisabledSelectedItemColor( comboBox, disabledSelectedItemColor );
- GadgetComboBoxSetDisabledSelectedItemBorderColor( comboBox, disabledSelectedItemBorderColor );
- // hilite
- GadgetComboBoxSetHiliteColor( comboBox, hiliteColor );
- GadgetComboBoxSetHiliteBorderColor( comboBox,hiliteBorderColor );
- GadgetComboBoxSetHiliteSelectedItemColor( comboBox, hiliteSelectedItemColor );
- GadgetComboBoxSetHiliteSelectedItemBorderColor( comboBox, hiliteSelectedItemBorderColor );
-
- GameWindow *editBox = GadgetComboBoxGetEditBox(comboBox);
- if (editBox)
- {
- // enabled
- GadgetButtonSetEnabledColor( editBox, enabledColor );
- GadgetButtonSetEnabledBorderColor( editBox, enabledBorderColor );
- GadgetButtonSetEnabledSelectedColor( editBox, enabledSelectedItemColor );
- GadgetButtonSetEnabledSelectedBorderColor( editBox, enabledSelectedItemBorderColor );
- // disabled
- GadgetButtonSetDisabledColor( editBox, disabledColor );
- GadgetButtonSetDisabledBorderColor( editBox, disabledBorderColor );
- GadgetButtonSetDisabledSelectedColor( editBox, disabledSelectedItemColor );
- GadgetButtonSetDisabledSelectedBorderColor( editBox, disabledSelectedItemBorderColor );
- // hilite
- GadgetButtonSetHiliteColor( editBox,hiliteColor );
- GadgetButtonSetHiliteBorderColor( editBox, hiliteBorderColor );
- GadgetButtonSetHiliteSelectedColor( editBox, hiliteSelectedItemColor );
- GadgetButtonSetHiliteSelectedBorderColor( editBox, hiliteSelectedItemBorderColor );
- }
-
- GameWindow *dropDownButton = GadgetComboBoxGetDropDownButton(comboBox);
- if (dropDownButton)
- {
- // enabled
- GadgetButtonSetEnabledColor( dropDownButton, enabledColor );
- GadgetButtonSetEnabledBorderColor( dropDownButton, enabledBorderColor );
- GadgetButtonSetEnabledSelectedColor( dropDownButton, enabledSelectedItemColor );
- GadgetButtonSetEnabledSelectedBorderColor( dropDownButton, enabledSelectedItemBorderColor );
- // disabled
- GadgetButtonSetDisabledColor( dropDownButton, disabledColor );
- GadgetButtonSetDisabledBorderColor( dropDownButton, disabledBorderColor );
- GadgetButtonSetDisabledSelectedColor( dropDownButton, disabledSelectedItemColor );
- GadgetButtonSetDisabledSelectedBorderColor( dropDownButton, disabledSelectedItemBorderColor );
- // hilite
- GadgetButtonSetHiliteColor( dropDownButton,hiliteColor );
- GadgetButtonSetHiliteBorderColor( dropDownButton, hiliteBorderColor );
- GadgetButtonSetHiliteSelectedColor( dropDownButton, hiliteSelectedItemColor );
- GadgetButtonSetHiliteSelectedBorderColor( dropDownButton, hiliteSelectedItemBorderColor );
- }
-
- GameWindow * listBox = GadgetComboBoxGetListBox( comboBox );
- if ( listBox )
- {
- GadgetListBoxSetColors(listBox,
- enabledColor,
- enabledBorderColor,
- enabledSelectedItemColor,
- enabledSelectedItemBorderColor,
- disabledColor,
- disabledBorderColor,
- disabledSelectedItemColor,
- disabledSelectedItemBorderColor,
- hiliteColor,
- hiliteBorderColor,
- hiliteSelectedItemColor,
- hiliteSelectedItemBorderColor );
- }
-}
-
-// GadgetComboBoxSetIsEditable ================================================
-/** Sets up the Text Entry gadget as editable or not */
-//=============================================================================
-void GadgetComboBoxSetIsEditable(GameWindow *comboBox, Bool isEditable )
-{
- ComboBoxData *comboData = (ComboBoxData *)comboBox->winGetUserData();
- GameWindow *editBox = GadgetComboBoxGetEditBox(comboBox);
- UnsignedInt status ;
- if(!editBox)
- return;
-
- comboData->isEditable = isEditable;
- if (isEditable)
- {
- status = editBox->winGetStatus();
-
- BitClear(status, WIN_STATUS_NO_INPUT);
-// BitClear(status, WIN_STATUS_NO_FOCUS);
- editBox->winSetStatus(status);
- }
- else
- {
- status = editBox->winGetStatus();
-
- BitSet(status, WIN_STATUS_NO_INPUT);
-// BitSet(status, WIN_STATUS_NO_FOCUS);
- editBox->winSetStatus(status);
- }
-}
-
-// GadgetComboBoxSetIsAsciiOnly ==================================================
-/** Get the text the Combo Box */
-//=============================================================================
-void GadgetComboBoxSetLettersAndNumbersOnly(GameWindow *comboBox, Bool isLettersAndNumbersOnly)
-{
- //sanity
- if(comboBox == nullptr)
- return;
- ComboBoxData *comboData = (ComboBoxData *)comboBox->winGetUserData();
-
- comboData->lettersAndNumbersOnly = isLettersAndNumbersOnly;
- if(comboData->entryData)
- comboData->entryData->alphaNumericalOnly = isLettersAndNumbersOnly;
-
-}
-
-// GadgetComboBoxSetAsciiOnly ==================================================
-/** Get the text the Combo Box */
-//=============================================================================
-void GadgetComboBoxSetAsciiOnly(GameWindow *comboBox, Bool isAsciiOnly )
-{
- //sanity
- if(comboBox == nullptr)
- return;
- ComboBoxData *comboData = (ComboBoxData *)comboBox->winGetUserData();
-
- comboData->asciiOnly = isAsciiOnly;
- if(comboData->entryData)
- comboData->entryData->aSCIIOnly = isAsciiOnly;
-
-}
-
-// GadgetComboBoxSetMaxChars ==================================================
-/** Get the text the Combo Box */
-//=============================================================================
-void GadgetComboBoxSetMaxChars( GameWindow *comboBox, Int maxChars )
-{
- //sanity
- if(comboBox == nullptr)
- return;
-
- ComboBoxData *comboData = (ComboBoxData *)comboBox->winGetUserData();
- comboData->maxChars = maxChars;
- comboData->entryData->maxTextLen = maxChars;
-
-}
-
-// GadgetComboBoxSetMaxDisplay ================================================
-/** Sets the MaxDisplay variable to the new Max Display */
-//=============================================================================
-void GadgetComboBoxSetMaxDisplay( GameWindow *comboBox, Int maxDisplay )
-{
- ComboBoxData *comboData = (ComboBoxData *)comboBox->winGetUserData();
- comboData->maxDisplay = maxDisplay;
-
-}
-
-// GadgetComboBoxGetText =======================================================
-/** Get the text the Combo Box */
-//=============================================================================
-UnicodeString GadgetComboBoxGetText( GameWindow *comboBox )
-{
-
- // sanity
- if( comboBox == nullptr )
- return UnicodeString::TheEmptyString;
-
- // verify that this is a combo box
- if( BitIsSet( comboBox->winGetStyle(), GWS_COMBO_BOX ) == FALSE )
- return UnicodeString::TheEmptyString;
-
- return GadgetTextEntryGetText( GadgetComboBoxGetEditBox(comboBox) );
-}
-
-// GadgetComboBoxSetText =======================================================
-/** Set the text the Combo Box */
-//=============================================================================
-void GadgetComboBoxSetText( GameWindow *comboBox, UnicodeString text )
-{
- if( comboBox == nullptr )
- return;
-
- GadgetTextEntrySetText(GadgetComboBoxGetEditBox(comboBox), text);
-}
-
-// GadgetComboBoxAddEntry =======================================================
-/** Convenience wrapper function for adding an entry */
-//=============================================================================
-Int GadgetComboBoxAddEntry( GameWindow *comboBox, UnicodeString text, Color color )
-{
- // sanity
- if( comboBox == nullptr )
- return -1;
- return (Int)TheWindowManager->winSendSystemMsg( comboBox, GCM_ADD_ENTRY, (WindowMsgData)&text, color );
-}
-// GadgetComboBoxReset =======================================================
-/** Convenience wrapper function for resetting the Combo Box entries */
-//=============================================================================
-void GadgetComboBoxReset( GameWindow *comboBox )
-{
- // sanity
- if( comboBox == nullptr )
- return;
- // reset via system message
- TheWindowManager->winSendSystemMsg( comboBox, GCM_DEL_ALL, 0, 0 );
-}
-// GadgetComboBoxHideList =======================================================
-/** Convenience wrapper function hiding the list */
-//=============================================================================
-void GadgetComboBoxHideList( GameWindow *comboBox )
-{
- // sanity
- if( comboBox == nullptr )
- return;
- // reset via system message
- TheWindowManager->winSendSystemMsg( comboBox, GGM_CLOSE, 0, 0 );
-}
-// GadgetComboBoxSetFont =======================================================
-/** Function used to set the Font of the combo box and all sub gadgets */
-//=============================================================================
-void GadgetComboBoxSetFont( GameWindow *comboBox, GameFont *font )
-{
- // sanity
- if( comboBox == nullptr )
- return;
-
- // set the ListBox gadget's font
- GameWindow *listBox = GadgetComboBoxGetListBox(comboBox);
- if(listBox)
- listBox->winSetFont( font);
-
- // set the Text Entry gadget's font
- GameWindow *editBox = GadgetComboBoxGetEditBox(comboBox);
- if(editBox)
- editBox->winSetFont(font);
-
- //Need to setup the default window font
- DisplayString *dString;
-
- // set the font for the display strings all windows have
- dString = comboBox->winGetInstanceData()->getTextDisplayString();
- if( dString )
- dString->setFont( font );
- dString = comboBox->winGetInstanceData()->getTooltipDisplayString();
- if( dString )
- dString->setFont( font );
-}
-
-// GadgetComboBoxSetEnabledTextColors =========================================
-/** Set the Enabled Text Colors for the Sub Gadgets*/
-//=============================================================================
-void GadgetComboBoxSetEnabledTextColors(GameWindow *comboBox, Color color, Color borderColor )
-{
- // sanity
- if( comboBox == nullptr )
- return;
-
- ComboBoxData *comboBoxData = (ComboBoxData *)comboBox->winGetUserData();
- if(comboBoxData->listBox)
- comboBoxData->listBox->winSetEnabledTextColors( color,borderColor);
- if(comboBoxData->editBox)
- comboBoxData->editBox->winSetEnabledTextColors(color,borderColor);
-}
-// GadgetComboBoxSetDisabledTextColors ========================================
-/** Set the Disabled Text Colors for the Sub Gadgets */
-//=============================================================================
-void GadgetComboBoxSetDisabledTextColors(GameWindow *comboBox, Color color, Color borderColor )
-{
- ComboBoxData *comboBoxData = (ComboBoxData *)comboBox->winGetUserData();
- // sanity
- if( comboBox == nullptr )
- return;
-
- if(comboBoxData->listBox)
- comboBoxData->listBox->winSetDisabledTextColors( color,borderColor);
- if(comboBoxData->editBox)
- comboBoxData->editBox->winSetDisabledTextColors(color,borderColor);
-}
-// GadgetComboBoxSetHiliteTextColors ==========================================
-/** Set the Hilite Text Colors for the Sub Gadgets */
-//=============================================================================
-void GadgetComboBoxSetHiliteTextColors( GameWindow *comboBox,Color color, Color borderColor )
-{
- // sanity
- if( comboBox == nullptr )
- return;
-
- ComboBoxData *comboBoxData = (ComboBoxData *)comboBox->winGetUserData();
-
- if(comboBoxData->listBox)
- comboBoxData->listBox->winSetHiliteTextColors( color,borderColor);
- if(comboBoxData->editBox)
- comboBoxData->editBox->winSetHiliteTextColors(color,borderColor);
-}
-// GadgetComboBoxSetIMECompositeTextColors ====================================
-/** Set the IME Composite Text Colors Text Colors for the Sub Gadgets */
-//=============================================================================
-void GadgetComboBoxSetIMECompositeTextColors(GameWindow *comboBox, Color color, Color borderColor )
-{
- // sanity
- if( comboBox == nullptr )
- return;
-
- ComboBoxData *comboBoxData = (ComboBoxData *)comboBox->winGetUserData();
-
- if(comboBoxData->listBox)
- comboBoxData->listBox->winSetIMECompositeTextColors( color,borderColor);
- if(comboBoxData->editBox)
- comboBoxData->editBox->winSetIMECompositeTextColors(color,borderColor);
-}
-
-// GadgetComboBoxGetSelectedPos ===============================================
-/** Convenience wrapper function for getting the selected Position */
-//=============================================================================
-void GadgetComboBoxGetSelectedPos( GameWindow *comboBox, Int *selectedIndex )
-{
- // sanity
- if( comboBox == nullptr )
- return;
-
- // get selected indices via system message
- TheWindowManager->winSendSystemMsg( comboBox, GCM_GET_SELECTION, 0, (WindowMsgData)selectedIndex );
-}
-
-// GadgetComboBoxSetSelectedPos ===============================================
-/** Convenience wrapper function for setting the selected Position, if don't hide
- is set to true, the listbox won't be forced to hide when the Selected call is
- passed back */
-//=============================================================================
-void GadgetComboBoxSetSelectedPos( GameWindow *comboBox, Int selectedIndex, Bool dontHide )
-{
- // sanity
- if( comboBox == nullptr )
- return;
-
- // get selected indices via system message
- TheWindowManager->winSendSystemMsg( comboBox, GCM_SET_SELECTION, selectedIndex, dontHide );
-}
-// GadgetComboBoxSetItemData ==================================================
-/** Convenience wrapper function for setting the Item data for the listbox under the combo box */
-//=============================================================================
-void GadgetComboBoxSetItemData( GameWindow *comboBox, Int index, void *data )
-{
- if (comboBox)
- TheWindowManager->winSendSystemMsg( comboBox, GCM_SET_ITEM_DATA, index, (WindowMsgData)data);
-}
-// GadgetComboBoxGetItemData ==================================================
-/** Convenience wrapper function for getting the Item data from the listbox under the combo Box */
-//=============================================================================
-void *GadgetComboBoxGetItemData( GameWindow *comboBox, Int index )
-{
- void *data = nullptr;
-
- if (comboBox)
- {
- TheWindowManager->winSendSystemMsg( comboBox, GCM_GET_ITEM_DATA, index, (WindowMsgData)&data);
- }
- return (data);
-}
-
-// GadgetComboBoxGetLength =================================================
-/** Get the list length data contained in the listboxData
- * parameter. */
-//=============================================================================
-Int GadgetComboBoxGetLength( GameWindow *combobox )
-{
- ComboBoxData *comboboxData = (ComboBoxData *)combobox->winGetUserData();
- if (comboboxData)
- return comboboxData->entryCount;
-
- return 0;
-}
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp
deleted file mode 100644
index 6be12558529..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp
+++ /dev/null
@@ -1,481 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: HorizontalSlider.cpp /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: HorizontalSlider.cpp
-//
-// Created: Colin Day, June 2001
-//
-// Desc: Horizontal GUI slider
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "Common/Language.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GadgetSlider.h"
-
-// DEFINES ////////////////////////////////////////////////////////////////////
-
-// PRIVATE TYPES //////////////////////////////////////////////////////////////
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////
-
-// PUBLIC DATA ////////////////////////////////////////////////////////////////
-
-// PRIVATE PROTOTYPES /////////////////////////////////////////////////////////
-
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-// GadgetHorizontalSliderInput ================================================
-/** Handle input for horizontal slider */
-//=============================================================================
-WindowMsgHandledType GadgetHorizontalSliderInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- SliderData *s = (SliderData *)window->winGetUserData();
- WinInstanceData *instData = window->winGetInstanceData();
- ICoord2D size, childSize, childCenter;
- window->winGetSize( &size.x, &size.y );
- switch( msg )
- {
- // ------------------------------------------------------------------------
- case GWM_MOUSE_ENTERING:
- {
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- {
-
- BitSet( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_MOUSE_ENTERING,
- (WindowMsgData)window,
- 0 );
- //TheWindowManager->winSetFocus( window );
-
- }
-
- if(window->winGetChild() && BitIsSet(window->winGetChild()->winGetStyle(),GWS_PUSH_BUTTON) )
- {
- WinInstanceData *instDataChild = window->winGetChild()->winGetInstanceData();
- BitSet(instDataChild->m_state, WIN_STATE_HILITED);
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_MOUSE_LEAVING:
- {
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ))
- {
-
- BitClear( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_MOUSE_LEAVING,
- (WindowMsgData)window,
- 0 );
- }
- if(window->winGetChild() && BitIsSet(window->winGetChild()->winGetStyle(),GWS_PUSH_BUTTON) )
- {
- WinInstanceData *instDataChild = window->winGetChild()->winGetInstanceData();
- BitClear(instDataChild->m_state, WIN_STATE_HILITED);
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DRAG:
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GGM_LEFT_DRAG,
- (WindowMsgData)window,
- mData1 );
- break;
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DOWN:
- break;
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_UP:
- {
- Int x, y;
- Int mousex = mData1 & 0xFFFF;
-// Int mousey = mData1 >> 16;
-
- GameWindow *child = window->winGetChild();
- Int pageClickSize, clickPos;
-
- window->winGetScreenPosition( &x, &y );
-
- child->winGetSize( &childSize.x, &childSize.y );
- child->winGetPosition( &childCenter.x, &childCenter.y );
- childCenter.x += childSize.x / 2;
- childCenter.y += childSize.y / 2;
-
- //
- // when you click on the slider, but not the button, we will jump
- // the slider position up/down by this much
- //
- pageClickSize = size.x / 5;
-
- clickPos = mousex - x;
- if( clickPos >= childCenter.x )
- {
-
- clickPos = childCenter.x + pageClickSize;
- if( clickPos > mousex - x )
- clickPos = mousex - x;
-
- }
- else
- {
-
- clickPos = childCenter.x - pageClickSize;
- if( clickPos < mousex - x )
- clickPos = mousex - x;
-
- }
-
- // keep it all valid to the window
- if( clickPos > x + size.x - childSize.x / 2 )
- clickPos = x + size.y - childSize.x / 2;
- if( clickPos < childSize.x / 2 )
- clickPos = childSize.x / 2;
-
- child->winSetPosition( clickPos - childSize.x / 2, HORIZONTAL_SLIDER_THUMB_POSITION);
- TheWindowManager->winSendSystemMsg( window, GGM_LEFT_DRAG, 0, mData1 );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_CHAR:
- {
-
- switch( mData1 )
- {
-
- // --------------------------------------------------------------------
- case KEY_RIGHT:
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
-
- if( s->position > s->minVal + 1 )
- {
- GameWindow *child = window->winGetChild();
-
- s->position -= 2;
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GSM_SLIDER_TRACK,
- (WindowMsgData)window,
- s->position );
-
- // Translate to window coords
- child->winSetPosition( (Int)((s->position - s->minVal) * s->numTicks), HORIZONTAL_SLIDER_THUMB_POSITION );
-
- }
-
- }
-
- break;
-
- // --------------------------------------------------------------------
- case KEY_LEFT:
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
-
- if( s->position < s->maxVal - 1 )
- {
- GameWindow *child = window->winGetChild();
-
- s->position += 2;
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GSM_SLIDER_TRACK,
- (WindowMsgData)window,
- s->position );
-
- // Translate to window coords
- child->winSetPosition( (Int)((s->position - s->minVal) * s->numTicks),HORIZONTAL_SLIDER_THUMB_POSITION );
-
- }
-
- }
-
- break;
-
- // --------------------------------------------------------------------
- case KEY_DOWN:
- case KEY_TAB:
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- window->winNextTab();
- break;
-
- // --------------------------------------------------------------------
- case KEY_UP:
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- window->winPrevTab();
- break;
-
- // --------------------------------------------------------------------
- default:
- return MSG_IGNORED;
-
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-// GadgetHorizontalSliderSystem ===============================================
-/** Handle system messages for horizontal slider */
-//=============================================================================
-WindowMsgHandledType GadgetHorizontalSliderSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- SliderData *s = (SliderData *)window->winGetUserData();
- WinInstanceData *instData = window->winGetInstanceData();
- ICoord2D size, childSize, childCenter,childRelativePos;
- window->winGetSize( &size.x, &size.y );
- switch( msg )
- {
- // ------------------------------------------------------------------------
- case GGM_LEFT_DRAG:
- {
- Int mousex = mData2 & 0xFFFF;
-// Int mousey = mData2 >> 16;
- Int x, y, delta;
- GameWindow *child = window->winGetChild();
-
-
- window->winGetScreenPosition( &x, &y );
-
- child->winGetSize( &childSize.x, &childSize.y );
- child->winGetScreenPosition( &childCenter.x, &childCenter.y );
- child->winGetPosition(&childRelativePos.x, &childRelativePos.y);
- childCenter.x += childSize.x / 2;
- childCenter.y += childSize.y / 2;
-
- //
- // ignore drag attempts when the mouse is right or left of slider totally
- // and put the dragging thumb back at the slider pos
- //
- if( mousex > x + size.x -HORIZONTAL_SLIDER_THUMB_WIDTH/2 )
- {
-
- TheWindowManager->winSendSystemMsg( window, GSM_SET_SLIDER,
- s->maxVal, 0 );
- // tell owner i moved
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GSM_SLIDER_TRACK,
- (WindowMsgData)window,
- s->position );
- break;
-
- }
- else if( mousex < x + HORIZONTAL_SLIDER_THUMB_WIDTH/2)
- {
-
- TheWindowManager->winSendSystemMsg( window, GSM_SET_SLIDER,
- s->minVal, 0 );
- // tell owner i moved
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GSM_SLIDER_TRACK,
- (WindowMsgData)window,
- s->position );
- break;
-
- }
-
- if( childCenter.x < x + childSize.x / 2 )
- {
- child->winSetPosition( 0,HORIZONTAL_SLIDER_THUMB_POSITION );
- s->position = s->minVal;
-
- }
- else if( childCenter.x >= x + size.x - childSize.x / 2 )
- {
- child->winSetPosition( (Int)((s->maxVal - s->minVal) * s->numTicks) -HORIZONTAL_SLIDER_THUMB_WIDTH/2 , HORIZONTAL_SLIDER_THUMB_POSITION );
- s->position = s->maxVal;
-
- }
- else
- {
- delta = childCenter.x - x -HORIZONTAL_SLIDER_THUMB_WIDTH/2;
-
- // Calc slider position
- s->position = (Int)((delta) / s->numTicks)+ s->minVal ;
-
- /*
- s->position += s->minVal;
- */
-
- if( s->position > s->maxVal )
- s->position = s->maxVal;
- if( s->position < s->minVal)
- s->position = s->minVal;
-
- child->winSetPosition( childRelativePos.x, HORIZONTAL_SLIDER_THUMB_POSITION );
- }
-
- // tell owner i moved
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GSM_SLIDER_TRACK,
- (WindowMsgData)window,
- s->position );
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GSM_SET_SLIDER:
- {
- Int newPos = (Int)mData1;
- GameWindow *child = window->winGetChild();
-
- // TheSuperHackers @fix No longer reject out of bounds positions to prevent
- // reset of custom option.ini settings to 0.
-
- s->position = newPos;
-
- // Translate to window coords
- newPos = (Int)((newPos - s->minVal) * s->numTicks);
- newPos = clamp(0, newPos, (Int)((s->maxVal - s->minVal) * s->numTicks));
-
- child->winSetPosition( newPos , HORIZONTAL_SLIDER_THUMB_POSITION );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GSM_SET_MIN_MAX:
- {
- ICoord2D size;
- GameWindow *child = window->winGetChild();
-
- window->winGetSize( &size.x, &size.y );
-
- s->minVal = (Int)mData1;
- s->maxVal = (Int)mData2;
- s->numTicks = (Real)(size.x - HORIZONTAL_SLIDER_THUMB_WIDTH)/(Real)(s->maxVal - s->minVal);
- s->position = s->minVal;
-
- child->winSetPosition( 0, HORIZONTAL_SLIDER_THUMB_POSITION );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_CREATE:
- break;
-
- // ------------------------------------------------------------------------
- case GWM_DESTROY:
- delete ( (SliderData *)window->winGetUserData() );
- window->winSetUserData(nullptr);
- s = nullptr;
- break;
-
- // ------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // If we're losing focus
- if( mData1 == FALSE )
- BitClear( instData->m_state, WIN_STATE_HILITED );
- else
- BitSet( instData->m_state, WIN_STATE_HILITED );
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GGM_FOCUS_CHANGE,
- mData1,
- window->winGetWindowId() );
-
- *(Bool*)mData2 = TRUE;
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GGM_RESIZED:
- {
-// Int width = (Int)mData1;
- Int height = (Int)mData2;
- GameWindow *thumb = window->winGetChild();
-
- if( thumb )
- thumb->winSetSize( GADGET_SIZE, height );
-
- break;
-
- }
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp
deleted file mode 100644
index cd943ef7a47..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp
+++ /dev/null
@@ -1,2825 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GadgetListBox.cpp ////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: ListBox.cpp
-//
-// Created: Dean Iverson, March 1998
-// Colin Day, June 2001
-//
-// Desc: ListBox GUI control
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/AudioEventRTS.h"
-#include "Common/Language.h"
-#include "Common/Debug.h"
-#include "Common/GameAudio.h"
-#include "GameClient/DisplayStringManager.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GadgetListBox.h"
-#include "GameClient/GadgetPushButton.h"
-#include "GameClient/GadgetSlider.h"
-#include "GameClient/GameWindowGlobal.h"
-#include "GameClient/Keyboard.h"
-
-
-// DEFINES ////////////////////////////////////////////////////////////////////
-// Sets up the user's OS set doubleclick time so if they don't like it... they can
-// change it in their OS.
-static UnsignedInt doubleClickTime = GetDoubleClickTime();
-
-// PRIVATE TYPES //////////////////////////////////////////////////////////////
-typedef struct _AddMessageStruct
-{
- Int row; // The row to add the data to
- Int column; // The column to add the data to
- const void *data; // void pointer, can be either an DisplayString or an Image
- Int type; // Can either be set to LISTBOX_TEXT or LISTBOX_IMAGE
- Bool overwrite; // Do we overwrite existing data?
- Int width; // set to -1 if we want the defaults
- Int height; // set to -1 if we want the defaults
-} AddMessageStruct;
-
-
-typedef struct _TextAndColor
-{
- UnicodeString string; // Holds a unicode String
- Color color; // holds a text's color
-} TextAndColor;
-
-///////////////////////////////////////////////////////////////////////////////
-// PRIVATE DATA ///////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-static void doAudioFeedback(GameWindow *window)
-{
- if (!window)
- return;
-
- ListboxData *lData = (ListboxData *)window->winGetUserData();
- if (!lData)
- return;
-
- if (lData->audioFeedback)
- {
- AudioEventRTS buttonClick("GUIComboBoxClick");
-
- if( TheAudio )
- {
- TheAudio->addAudioEvent( &buttonClick );
- }
- }
-}
-
-static Int getListboxEntryBasedOnCoord(GameWindow *window, Int x, Int y, Int &row, Int &column)
-{
- Int pos;
- Int winx, winy, i;
- WinInstanceData *instData = window->winGetInstanceData();
- ListboxData *list = (ListboxData *)window->winGetUserData();
-
- window->winGetScreenPosition( &winx, &winy );
-
- // Adjust for title if present
- if( instData->getTextLength() )
- winy += TheWindowManager->winFontHeight( instData->getFont() ) + 1;
-
- pos = -2;
-
- for( i=0; ; i++ )
- {
- if( i > 0 )
- if( list->listData[ i - 1 ].listHeight >
- (list->displayPos + list->displayHeight ) )
- {
- pos = -1;
- break;
- }
-
- if( i == list->endPos )
- {
- pos = -1;
- break;
- }
-
- if( list->listData[i].listHeight > (y - winy + list->displayPos) )
- break;
- }
-
- column = -1;
- if( pos == -2 )
- {
- pos = i;
- Int total = 0;
- for( i = 0; i < list->columns ;i++)
- {
- total += list->columnWidth[i];
- if(x - winx < total)
- {
- column = i;
- break;
- }
- }
- }
- row = pos;
- return pos;
-}
-
-Int GadgetListBoxGetEntryBasedOnXY( GameWindow *listbox, Int x, Int y, Int &row, Int &column)
-{
- return getListboxEntryBasedOnCoord( listbox, x, y, row, column );
-
-}
-
-// getListboxTopEntry =========================================================
-//=============================================================================
-static Int getListboxTopEntry( ListboxData *list )
-{
- Int entry;
-
- // determine which entry is at the top of the display area
- for( entry=0; ; entry++ )
- {
- if( list->listData[entry].listHeight > list->displayPos )
- return entry;
-
- if( entry >= list->endPos )
- return 0;
- }
-
- return 0;
-}
-
-// getListboxTopEntry =========================================================
-//=============================================================================
-static Int getListboxBottomEntry( ListboxData *list )
-{
- Int entry;
-
- // determine which entry is at the top of the display area
- for( entry=list->endPos - 1; ; entry-- )
- {
- if( entry < 0 )
- return 0;
- if( list->listData[entry].listHeight == list->displayPos + list->displayHeight )
- return entry;
- if( list->listData[entry].listHeight < list->displayPos + list->displayHeight && entry != list->endPos - 1)
- return entry + 1;
- if( list->listData[entry].listHeight < list->displayPos + list->displayHeight)
- return entry;
- }
-
- return 0;
-}
-
-
-// removeSelection ============================================================
-/** Remove Selection from a multiple selection list */
-//=============================================================================
-static void removeSelection( ListboxData *list, Int i )
-{
- memcpy( &list->selections[i], &list->selections[(i+1)],
- ((list->listLength - i) * sizeof(Int)) );
-
- // put -1 at end of list just for safety
- list->selections[(list->listLength - 1)] = -1;
-}
-
-// adjustDisplay ==============================================================
-/** Update Display List information including scrollbar */
-//=============================================================================
-static void adjustDisplay( GameWindow *window, Int adjustment,
- Bool updateSlider )
-{
- Int entry;
- SliderData *sData;
- ListboxData *list = (ListboxData *)window->winGetUserData();
-
- // determine which entry is at the top of the display area
- entry = getListboxTopEntry( list ) + adjustment;
-
- if( entry < 0 )
- entry = 0;
- else if( entry >= list->endPos )
- entry = list->endPos - 1;
-
- if( updateSlider )
- {
- if( entry > 0 )
- list->displayPos = list->listData[(entry - 1)].listHeight + 1;
- else
- list->displayPos = 0;
- }
-
- if( list->slider != nullptr )
- {
- ICoord2D sliderSize, sliderChildSize;
- GameWindow *child;
-
- sData = (SliderData *)list->slider->winGetUserData();
- list->slider->winGetSize( &sliderSize.x, &sliderSize.y );
- // Take into account that there is a line-drawn outline surrounding listbox
- sData->maxVal = list->totalHeight - ( list->displayHeight - TOTAL_OUTLINE_HEIGHT ) + 1;
-
- if( sData->maxVal < 0 )
- {
- sData->maxVal = 0;
- }
-
- child = list->slider->winGetChild();
- child->winGetSize( &sliderChildSize.x, &sliderChildSize.y );
- sData->numTicks = (float)((sliderSize.y - sliderChildSize.y) / (float)sData->maxVal);
-
- if( updateSlider )
- TheWindowManager->winSendSystemMsg( list->slider,
- GSM_SET_SLIDER,
- (sData->maxVal - list->displayPos),
- 0 );
- }
-
-}
-
-// computeTotalHeight =========================================================
-/** Compute Total Height and fill in listHeight values */
-//=============================================================================
-static void computeTotalHeight( GameWindow *window )
-{
- Int i, height = 0;
- Int tempHeight;
- ListboxData *list = (ListboxData *)window->winGetUserData();
- WinInstanceData *instData = window->winGetInstanceData();
-
- for( i=0; iendPos; i++ )
- {
-
- if(!list->listData[i].cell)
- continue;
- tempHeight = 0;
-
- for (Int j = 0; j < list->columns; j++)
- {
- Int cellHeight = 0;
- if(list->listData[i].cell[j].cellType == LISTBOX_TEXT)
- {
- if( BitIsSet( window->winGetStatus(), WIN_STATUS_ONE_LINE ) == TRUE )
- {
- cellHeight = TheWindowManager->winFontHeight( instData->getFont() );
- }
- else
- {
- DisplayString *displayString = (DisplayString *)list->listData[i].cell[j].data;
- if(displayString)
- displayString->getSize( nullptr, &cellHeight );
- }
- }
- else if(list->listData[i].cell[j].cellType == LISTBOX_IMAGE)
- {
- if(list->listData[i].cell[j].height > 0)
- cellHeight = list->listData[i].cell[j].height + 1;
- else
- cellHeight = TheWindowManager->winFontHeight( instData->getFont() );
- }
- if(cellHeight > tempHeight)
- tempHeight = cellHeight;
- }
- list->listData[i].height = tempHeight;
- height += (list->listData[i].height + 1);
- list->listData[i].listHeight = height;
- }
-
- list->totalHeight = height;
-
- adjustDisplay( window, 0, TRUE );
-}
-
-// addImageEntry ==============================================================
-/** Add Images to position and column. Row and Column are both based from starting
- Position 0 */
-//=============================================================================
-static Int addImageEntry( const Image *image, Color color, Int row, Int column, GameWindow *window, Bool overwrite, Int width, Int height )
-{
-// WinInstanceData *instData = window->winGetInstanceData();
- ListboxData *list = (ListboxData *)window->winGetUserData();
-
- if( column >= list->columns || row >= list->listLength )
- {
- DEBUG_CRASH(("Tried to add Image to Listbox at invalid position"));
- return -1;
- }
-
- // If we want to just add an entry to the bottom, set the defaults
- if (row == -1)
- {
- row = list->insertPos;
- list->insertPos++;
- list->endPos++;
- }
- if( column == -1 )
- column = 0;
-
- ListEntryRow *listRow = &list->listData[row];
-
- // Check and see if we have allocated cells for that row yet, if not, allocate them
- if(!listRow->cell)
- {
- listRow->cell = NEW ListEntryCell[list->columns];
- memset(listRow->cell,0,list->columns * sizeof(ListEntryCell));
- }
- // if we're copying over strings, then lets first deallocate them.
- if(listRow->cell[column].cellType == LISTBOX_TEXT)
- {
- TheDisplayStringManager->freeDisplayString((DisplayString *)listRow->cell[column].data);
-
- }
- //add Image to selected row/cell
- listRow->cell[column].cellType = LISTBOX_IMAGE;
- listRow->cell[column].data = (void *)image;
- listRow->cell[column].color = color;
- listRow->cell[column].height = height;
- listRow->cell[column].width = width;
-
- computeTotalHeight( window );
-
- return (row);
-
-}
-
-// startingRow will get moved to startingRow+1, etc. This assumes there is space!!!!!
-static Int moveRowsDown(ListboxData *list, Int startingRow)
-{
- //
- // copy the cells down
- //
- Int copyLen = (list->endPos - startingRow) * sizeof(ListEntryRow);
- char *buf = NEW char[copyLen];
- memcpy(buf, list->listData + startingRow, copyLen);
- memcpy(list->listData + startingRow + 1, buf, copyLen );
- delete[] buf;
-
- list->endPos ++;
- list->insertPos = list->endPos;
-
- //
- // remove the display or links to images after the shift
- //
- list->listData[startingRow].cell = nullptr;
- list->listData[startingRow].height = 0;
- list->listData[startingRow].listHeight = 0;
-
- if( list->multiSelect )
- {
- Int i = 0;
-
- while( list->selections[i] >= 0 )
- {
- if( startingRow <= list->selections[i] )
- list->selections[i]++;
- i++;
- }
- }
- else
- {
- if( list->selectPos >= startingRow )
- list->selectPos++;
- }
-
- /*
- if( list->displayPos > 0 )
- adjustDisplay( window, (-1 * mData1), TRUE );
-
- computeTotalHeight( window );
- */
-
- return 1;
-}
-
-// addEntry ===================================================================
-/** Add and process one string at insertPos */
-//=============================================================================
-static Int addEntry( UnicodeString *string, Int color, Int row, Int column, GameWindow *window, Bool overwrite )
-{
-// WinInstanceData *instData = window->winGetInstanceData();
- ListboxData *list = (ListboxData *)window->winGetUserData();
- Int width;
- DisplayString *displayString;
-
- // make sure our params are good
- if( column >= list->columns || row >= list->listLength )
- {
- DEBUG_CRASH(("Tried to add text to Listbox at invalid position"));
- return -1;
- }
-
- // If we want to just add an entry to the bottom, set the defaults
- if (row == -1)
- {
- row = list->insertPos;
- list->insertPos++;
- list->endPos++;
- }
- if( column == -1 )
- column = 0;
-
- width = list->columnWidth[column] - TEXT_WIDTH_OFFSET;
-
- Int rowsAdded = 0;
-
- ListEntryRow *listRow = &list->listData[row];
- // Here I've decided to just overwrite what's in the row, if that's not what we want, change it here
- // Check and see if we have allocated cells for that row yet, if not, allocate them
- if(!listRow->cell)
- {
- listRow->cell = NEW ListEntryCell[list->columns];
- memset(listRow->cell,0,list->columns * sizeof(ListEntryCell));
- rowsAdded = 1;
- }
- else if (!overwrite)
- {
- // Shove things down
- moveRowsDown(list, row);
- listRow->cell = NEW ListEntryCell[list->columns];
- memset(listRow->cell,0,list->columns * sizeof(ListEntryCell));
- rowsAdded = 1;
- }
-
- //add Image to selected row/cell
- listRow->cell[column].cellType = LISTBOX_TEXT;
-
- // assign the color to the list data element
- listRow->cell[column].color = color;
-
- // copy text
- if( !listRow->cell[column].data )
- listRow->cell[column].data = (void *) TheDisplayStringManager->newDisplayString();
- displayString = (DisplayString *) listRow->cell[column].data;
- if ( BitIsSet( window->winGetStatus(), WIN_STATUS_ONE_LINE ) == FALSE )
- displayString->setWordWrap( width );
- displayString->setText( *string );
-
- /** @todo we need for formalize this, but for now just set the font
- of this listbox entry to the font of the window */
- displayString->setFont( window->winGetFont() );
-
- if (overwrite)
- {
- Int oldRowHeight = listRow->height;
- Int oldTotalHeight = listRow->listHeight;
- Int rowHeight;
- Int totalHeight;
-
- if (!oldTotalHeight && row)
- {
- oldTotalHeight = list->listData[row-1].listHeight;
- }
-
- displayString->getSize( nullptr, &rowHeight );
- if (rowHeight > oldRowHeight)
- {
- totalHeight = oldTotalHeight + (rowHeight - oldRowHeight);
- listRow->height = rowHeight;
- listRow->listHeight = totalHeight + rowsAdded;
- list->totalHeight += (rowHeight - oldRowHeight) + rowsAdded;
- adjustDisplay( window, 0, TRUE );
- }
- }
- else
- {
- computeTotalHeight( window );
- }
-
- return (row);
-}
-
-// PUBLIC DATA ////////////////////////////////////////////////////////////////
-
-// PRIVATE PROTOTYPES /////////////////////////////////////////////////////////
-
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-// GadgetListBoxInput =========================================================
-/** Handle input for list box */
-//=============================================================================
-WindowMsgHandledType GadgetListBoxInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- ListboxData *list = (ListboxData *)window->winGetUserData();
- WinInstanceData *instData = window->winGetInstanceData();
-
- switch (msg)
- {
-
- // ------------------------------------------------------------------------
- case GWM_CHAR:
- {
-
- switch (mData1)
- {
-
- // --------------------------------------------------------------------
- case KEY_ENTER:
- case KEY_SPACE:
- {
-
- if( BitIsSet( mData2, KEY_STATE_UP ) )
- {
- doAudioFeedback(window);
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GLM_DOUBLE_CLICKED,
- (WindowMsgData)window,
- list->selectPos );
- }
-
- break;
-
- }
-
- // --------------------------------------------------------------------
- case KEY_DOWN:
- {
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
-
- if( list->selectPos == -1 )
- {
- list->selectPos = 0;
- adjustDisplay( window, 0, TRUE );
- }
- else if( list->selectPos < list->endPos - 1 )
- {
-
- list->selectPos++;
-
- while (1)
- {
- Int cellBottom = list->listData[list->selectPos].listHeight;
- Int cellTop = cellBottom - list->listData[list->selectPos].height;
- Int displayTop = list->displayPos;
- Int displayBottom = list->displayPos + list->displayHeight - 1; // account for the border
-
- if ( cellTop < displayTop )
- {
- adjustDisplay(window, -1, TRUE );
- }
- else if ( cellBottom < displayBottom )
- {
- adjustDisplay(window, 0, TRUE );
- break;
- }
- else
- {
- adjustDisplay(window, 1, TRUE );
- }
- }
-
- }
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GLM_SELECTED,
- (WindowMsgData)window,
- list->selectPos );
- }
-
- break;
-
- }
-
- // --------------------------------------------------------------------
- case KEY_UP:
- {
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
-
- if( list->selectPos == -1 )
- {
- list->selectPos = 0;
- adjustDisplay( window, 0, TRUE );
- }
- else if( list->selectPos > 0 )
- {
-
- list->selectPos--;
-
- while (1)
- {
- if( list->listData[list->selectPos].listHeight - list->listData[list->selectPos].height < list->displayPos )
- {
- list->displayPos = list->listData[list->selectPos].listHeight +1;
- adjustDisplay( window, -1, TRUE );
- }
- else if( list->listData[list->selectPos].listHeight > list->displayPos + list->displayHeight)
- {
- list->displayPos = list->listData[list->selectPos].listHeight - list->displayHeight;
- adjustDisplay(window, 1, TRUE);
- }
- else
- {
- adjustDisplay(window, 0, TRUE);
- break;
- }
- }
- }
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GLM_SELECTED,
- (WindowMsgData)window,
- list->selectPos );
- }
-
- break;
-
- }
-
- // --------------------------------------------------------------------
- case KEY_RIGHT:
- case KEY_TAB:
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- TheWindowManager->winNextTab(window);
- break;
-
- // --------------------------------------------------------------------
- case KEY_LEFT:
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- TheWindowManager->winPrevTab(window);
- break;
-
- // --------------------------------------------------------------------
- default:
- {
- Bool foundIt = false;
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
- // set the position to start looking for the line of text with this character
- Int position = list->selectPos;
- // only search the max number of times so that we're not looping over and over
- for(Int i = 0; i < list->endPos; ++i)
- {
- // start at the next position
- ++position;
- // if we've reached the end of the list, start at the beginning
- if( position >= list->endPos)
- position = 0;
-
- ListEntryCell *cell = nullptr;
- // go through the columns until we find a column with text
- Int j = 0;
- for(; j < list->columns; ++j)
- {
- cell = &list->listData[position].cell[j];
- if(cell && cell->cellType == LISTBOX_TEXT && cell->data)
- {
- break;
- }
- }
- if(!cell || cell->cellType != LISTBOX_TEXT)
- continue;
- DisplayString *dString = (DisplayString *)cell->data;
- if(!dString)
- continue;
- for(j = 0; j < TheKeyboard->MAX_KEY_STATES; ++j)
- {
- if(dString->getText().getCharAt(0) == TheKeyboard->getPrintableKey((KeyDefType)mData1, j))
- {
- list->selectPos = position;
- Int prevPos = getListboxTopEntry(list);
- //list->displayPos = list->listData[position].listHeight - list->displayHeight;
- adjustDisplay(window, position - prevPos, TRUE);
- foundIt = TRUE;
- break;
- }
- }
- if(foundIt)
- {
- doAudioFeedback(window);
- break;
- }
-
- }
-
-
- }
-
- if (!foundIt)
- return MSG_IGNORED;
- }
-
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_WHEEL_DOWN:
- {
- if( list->endPos <= 0)
- break;
-
- if (list->listData[list->endPos - 1].listHeight > list->displayHeight + list->displayPos)
- adjustDisplay( window, 1, TRUE );
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_WHEEL_UP:
- {
- if( list->endPos <= 0)
- break;
-
- adjustDisplay( window, -1, TRUE );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_UP:
- {
- TheWindowManager->winSetFocus( window );
-// Int mousex = mData1 & 0xFFFF;
- Int mousey = mData1 >> 16;
- Int x, y, i;
- Int oldPos = list->selectPos;
-
- window->winGetScreenPosition( &x, &y );
-
- // Adjust for title if present
- if( instData->getTextLength() )
- y += TheWindowManager->winFontHeight( instData->getFont() ) + 1;
-
- list->selectPos = -2;
-
- for( i=0; ; i++ )
- {
-
- if( i > 0 )
- if( list->listData[ i - 1 ].listHeight >
- (list->displayPos + list->displayHeight) )
- {
- list->selectPos = -1;
- break;
- }
-
- if( i == list->endPos )
- {
- list->selectPos = -1;
- break;
- }
-
- if( list->listData[i].listHeight > (mousey - y + list->displayPos) )
- break;
- }
-
- //Bool dblClicked = FALSE;
- if( list->doubleClickTime + doubleClickTime > timeGetTime() &&
- (i == oldPos || (oldPos == -1 && ( i>=0 && iendPos ) )) )
- {
- int temp;
- list->doubleClickTime = 0;
- if( oldPos == -1 )
- temp = i;
- else
- temp = oldPos;
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GLM_DOUBLE_CLICKED,
- (WindowMsgData)window,
- temp );
- //break;
- }
- if( (i == oldPos) && (list->forceSelect == FALSE) )
- {
- list->selectPos = -1;
- }
-
- if( (list->selectPos == -2) && (i < list->endPos) )
- {
- list->selectPos = i;
- }
-
- if( (list->selectPos < 0) && (list->forceSelect) )
- {
- list->selectPos = oldPos;
- }
- list->doubleClickTime = timeGetTime();
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GLM_SELECTED,
- (WindowMsgData)window,
- list->selectPos );
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_RIGHT_DOWN:
- doAudioFeedback(window);
- break; // if we're in game, we want to eat this message because we're right clicking on a listbox
- case GWM_RIGHT_UP:
- {
- TheWindowManager->winSetFocus( window );
- Int pos;
- Int mousex = mData1 & 0xFFFF;
- Int mousey = mData1 >> 16;
- Int x, y, i;
- RightClickStruct rc;
-
- window->winGetScreenPosition( &x, &y );
-
- // Adjust for title if present
- if( instData->getTextLength() )
- y += TheWindowManager->winFontHeight( instData->getFont() ) + 1;
-
- pos = -2;
-
- for( i=0; ; i++ )
- {
- if( i > 0 )
- if( list->listData[ i - 1 ].listHeight >
- (list->displayPos + list->displayHeight ) )
- {
- pos = -1;
- break;
- }
-
- if( i == list->endPos )
- {
- pos = -1;
- break;
- }
-
- if( list->listData[i].listHeight > (mousey - y + list->displayPos) )
- break;
- }
-
- if( pos == -2 )
- pos = i;
-
- rc.pos = pos;
- rc.mouseX = mousex;
- rc.mouseY = mousey;
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GLM_RIGHT_CLICKED,
- (WindowMsgData)window,
- (WindowMsgData)&rc );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_MOUSE_ENTERING:
- {
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- {
-
- BitSet( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_MOUSE_ENTERING,
- (WindowMsgData)window,
- 0 );
- //TheWindowManager->winSetFocus( window );
-
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_MOUSE_LEAVING:
- {
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ))
- {
-
- BitClear( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_MOUSE_LEAVING,
- (WindowMsgData)window,
- 0 );
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DRAG:
-
- if (BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GGM_LEFT_DRAG,
- (WindowMsgData)window,
- 0 );
- break;
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DOWN:
- doAudioFeedback(window);
- // we want to eat the down... so we may receive the up.
- return MSG_HANDLED;
-
- //-------------------------------------------------------------------------
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-// GadgetListBoxMultiInput ====================================================
-/** Handle input for multiple selection list box */
-//=============================================================================
-WindowMsgHandledType GadgetListBoxMultiInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- ListboxData *list = (ListboxData *)window->winGetUserData();
- WinInstanceData *instData = window->winGetInstanceData();
-
- switch( msg )
- {
- // ------------------------------------------------------------------------
- case GWM_CHAR:
- {
-
- switch( mData1 )
- {
-
- // --------------------------------------------------------------------
- case KEY_TAB:
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- window->winNextTab();
- break;
-
- // --------------------------------------------------------------------
- default:
- return MSG_IGNORED;
- }
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_UP:
- //case GWM_LEFT_CLICK:
- {
- TheWindowManager->winSetFocus( window );
-// Int *selections = list->selections;
- Int selectPos = -2;
-// Int mousex = mData1 & 0xFFFF;
- Int mousey = mData1 >> 16;
- Int x, y, i;
- Bool removed = FALSE;
-
- window->winGetScreenPosition( &x, &y );
-
- // Adjust for title if present
- if( instData->getTextLength() )
- y += TheWindowManager->winFontHeight( instData->getFont() ) + 1;
-
- for( i = 0; ; i++ )
- {
-
- if( i > 0 )
- if( list->listData[ i - 1 ].listHeight >
- (list->displayPos + list->displayHeight ) )
- {
- selectPos = -1;
- break;
- }
-
- if( i == list->endPos )
- {
- selectPos = -1;
- break;
- }
-
- if( list->listData[i].listHeight > (mousey - y + list->displayPos) )
- break;
- }
-
- if( selectPos == -2 )
- selectPos = i;
-
- i = 0;
- while( list->selections[i] >= 0 )
- {
- if( list->selections[i] == selectPos )
- {
- removeSelection( list, i );
- removed = TRUE;
- break;
- }
-
- i++;
- }
-
- if( removed == FALSE )
- {
- list->selections[ i] = selectPos;
- list->selections[ i + 1 ] = -1;
- }
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GLM_SELECTED,
- (WindowMsgData)window,
- selectPos );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_RIGHT_UP:
- {
-/*
- Int selectPos = -2;
-// Int mousex = mData1 & 0xFFFF;
- Int mousey = mData1 >> 16;
- Int x, y, i;
-
- window->winGetScreenPosition( &x, &y );
-
- // Adjust for title if present
- if( instData->getTextLength() )
- y += TheWindowManager->winFontHeight( instData->getFont() ) + 1;
-
- for( i = 0; ; i++ )
- {
- if( i > 0 )
- if( list->listData[ i - 1 ].listHeight >
- (list->displayPos + list->displayHeight ) )
- {
- selectPos = -1;
- break;
- }
-
- if( i == list->endPos )
- {
- selectPos = -1;
- break;
- }
-
- if( list->listData[i].listHeight > (mousey - y + list->displayPos) )
- break;
- }
-
- if( selectPos == -2 )
- selectPos = i;
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GLM_RIGHT_CLICKED,
- (WindowMsgData)window,
- selectPos );*/
- TheWindowManager->winSetFocus( window );
- Int pos;
- Int mousex = mData1 & 0xFFFF;
- Int mousey = mData1 >> 16;
- Int x, y, i;
- RightClickStruct rc;
-
- window->winGetScreenPosition( &x, &y );
-
- // Adjust for title if present
- if( instData->getTextLength() )
- y += TheWindowManager->winFontHeight( instData->getFont() ) + 1;
-
- pos = -2;
-
- for( i=0; ; i++ )
- {
- if( i > 0 )
- if( list->listData[ i - 1 ].listHeight >
- (list->displayPos + list->displayHeight ) )
- {
- pos = -1;
- break;
- }
-
- if( i == list->endPos )
- {
- pos = -1;
- break;
- }
-
- if( list->listData[i].listHeight > (mousey - y + list->displayPos) )
- break;
- }
-
- if( pos == -2 )
- pos = i;
-
- rc.pos = pos;
- rc.mouseX = mousex;
- rc.mouseY = mousey;
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GLM_RIGHT_CLICKED,
- (WindowMsgData)window,
- (WindowMsgData)&rc );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_WHEEL_DOWN:
-
- // Simulate the down button if it exists
- if( list->downButton )
- {
- if( list->displayPos + list->displayHeight <= list->totalHeight )
- adjustDisplay( window, 1, TRUE );
- }
- break;
-
- // ------------------------------------------------------------------------
- case GWM_WHEEL_UP:
-
- // Simulate the up button if it exists
- if( list->upButton )
- {
- if( list->displayPos > 0 )
- adjustDisplay( window, -1, TRUE );
- }
- break;
-
- // ------------------------------------------------------------------------
- case GWM_MOUSE_ENTERING:
- {
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- {
-
- BitSet( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_MOUSE_ENTERING,
- (WindowMsgData)window,
- 0 );
- //TheWindowManager->winSetFocus( window );
-
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_MOUSE_LEAVING:
- {
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ))
- {
-
- BitClear( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_MOUSE_LEAVING,
- (WindowMsgData)window,
- 0 );
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DRAG:
-
- if (BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GGM_LEFT_DRAG,
- (WindowMsgData)window,
- 0 );
- break;
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DOWN:
- doAudioFeedback(window);
- // we want to eat the down... so we may receive the up.
- return MSG_HANDLED;
-
- // ------------------------------------------------------------------------
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-// GadgetListBoxSystem ========================================================
-/** Handle system messages for list box */
-//=============================================================================
-WindowMsgHandledType GadgetListBoxSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- ListboxData *list = (ListboxData *)window->winGetUserData();
- WinInstanceData *instData = window->winGetInstanceData();
- ICoord2D *pos;
-
- switch( msg )
- {
- // ------------------------------------------------------------------------
- case GGM_SET_LABEL:
- {
- instData->setText(*(UnicodeString*)mData1);
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GLM_GET_TEXT:
- {
- pos = (ICoord2D *)mData1;
- TextAndColor *tAndC = (TextAndColor *)mData2;
-
- if(pos->x >= list->columns || pos->y >= list->listLength ||
- list->listData[pos->y].cell[pos->x].cellType != LISTBOX_TEXT)
- {
- tAndC->string = UnicodeString::TheEmptyString;
- tAndC->color = 0;
- }
- else
- {
- tAndC->string = ((DisplayString *)list->listData[ pos->y ].cell[pos->x].data)->getText();
- tAndC->color = list->listData[ pos->y ].cell[pos->x].color;
- }
- break;
- }
-
- // ------------------------------------------------------------------------
- case GBM_SELECTED:
- {
-
- // See if the up button was selected
- if( (GameWindow *)mData1 == list->upButton )
- {
- if( list->displayPos > 0 )
- adjustDisplay( window, -1, TRUE );
- }
- else if( (GameWindow *)mData1 == list->downButton )
- {
- if( list->displayPos + list->displayHeight <= list->totalHeight )
- adjustDisplay( window, 1, TRUE );
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GGM_LEFT_DRAG:
- {
-
- if( (GameWindow *)mData1 == list->upButton )
- {
- if( list->displayPos > 0 )
- adjustDisplay( window, -1, TRUE );
- }
- else if( (GameWindow *)mData1 == list->downButton )
- {
- if( list->displayPos + list->displayHeight <= list->totalHeight )
- adjustDisplay( window, 1, TRUE );
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GLM_DEL_ALL:
- {
-
- //
- // Reset the listbox by freeing all the display string stuff and setting
- // everything else to zero
- //
- // Loop through and destroy any display strings we've allocated that aren't used
- for( Int i = 0; i < list->listLength; i++ )
- {
- // Loop though
- ListEntryCell *cells = list->listData[i].cell;
- for (int j = list->columns - 1; j >=0; j-- )
- {
- if(!cells)
- break;
- if( cells[j].cellType == LISTBOX_TEXT )
- {
- if ( cells[j].data )
- {
- TheDisplayStringManager->freeDisplayString((DisplayString *) cells[j].data );
- }
- }
-
- cells[j].userData = nullptr;
- cells[j].data = nullptr;
- }
- delete[](list->listData[i].cell);
- list->listData[i].cell = nullptr;
- }
- //zero out the header structure
- memset(list->listData,0,list->listLength * sizeof(ListEntryRow));
-
- if( mData1 != GP_DONT_UPDATE )
- {
- list->displayPos = 0;
- }
-
- if( list->multiSelect )
- memset( list->selections, -1, list->listLength * sizeof( Int ) );
- else
- list->selectPos = -1;
-
- list->insertPos = 0;
- list->endPos = 0;
-
- list->totalHeight = 0;
-
- adjustDisplay( window, 0, TRUE );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GLM_DEL_ENTRY:
- {
- Int i;
-
- if( list->endPos <= (Int)mData1 )
- break;
-
- ListEntryCell *cells = list->listData[mData1].cell;
- if(cells)
- for( i = 0; i <= list->columns; i ++ )
- {
- if( cells[i].cellType == LISTBOX_TEXT && cells[i].data )
- TheDisplayStringManager->freeDisplayString((DisplayString *) cells[i].data );
- cells[i].data = nullptr;
- cells[i].userData = nullptr;
- }
-
- delete[](list->listData[mData1].cell);
- list->listData[mData1].cell = nullptr;
-
- memcpy( &list->listData[mData1], &list->listData[(mData1+1)],
- (list->endPos - mData1 - 1) * sizeof(ListEntryRow) );
-
- list->endPos--;
- list->insertPos = list->endPos;
-
- if( list->multiSelect )
- {
- i = 0;
-
- while( list->selections[i] >= 0 )
- {
- if( (Int)mData1 < list->selections[i] )
- list->selections[i]--;
- else if ( (Int)mData1 == list->selections[i] )
- {
- removeSelection( list, i );
- i--; // compensate for lost entry
- }
-
- i++;
- }
- }
- else
- {
- if( (Int)mData1 < list->selectPos )
- list->selectPos--;
- else if ( (Int)mData1 == list->selectPos )
- list->selectPos = -1;
- }
-
- computeTotalHeight( window );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GLM_ADD_ENTRY:
- {
- Bool success = TRUE;
- Int addedIndex = -1;
- AddMessageStruct *addInfo = (AddMessageStruct*)mData1;
- if (addInfo->row >= list->insertPos)
- addInfo->row = -1;
-
- Int row = addInfo->row;
- // Special case, we're just appending and we've reached the end.
- if( addInfo->row == -1 && list->insertPos == list->listLength )
- {
- row = list->insertPos;
- // Check to see if we've filled our buffer and need to scroll the window
- if( list->insertPos == list->listLength )
- {
- if( list->autoPurge )
- TheWindowManager->winSendSystemMsg( window, GLM_SCROLL_BUFFER, 1, 0 );
- else
- success = FALSE;
- }
- }
- else if (addInfo->row != -1 && !addInfo->overwrite && list->insertPos == list->listLength)
- {
- // We're inserting into the middle with no space - see if we can scroll the window
- if( list->autoPurge )
- TheWindowManager->winSendSystemMsg( window, GLM_SCROLL_BUFFER, 1, 0 );
- else
- success = FALSE;
- }
-
- if(success)
- {
- if( addInfo->type == LISTBOX_TEXT )
- {
- addedIndex = addEntry( (UnicodeString *)addInfo->data, mData2, addInfo->row, addInfo->column, window, addInfo->overwrite );
- }
- else if ( addInfo->type == LISTBOX_IMAGE )
- {
- addedIndex = addImageEntry( (const Image *)addInfo->data, mData2, addInfo->row, addInfo->column, window, addInfo->overwrite,addInfo->width, addInfo->height );
- }
- else
- success = FALSE;
- }
-
- if( success )
- {
-
- if( list->autoScroll )
- {
-
- while( TRUE )
- {
- // If off bottom of screen, scroll and try again.
- // we use -1 because insertPos was increased in addEntry
- if( row == -1 )
- {
- if( list->listData[(list->insertPos - 1)].listHeight >=
- (list->displayPos + list->displayHeight) )
- adjustDisplay( window, 1, TRUE );
- else
- break;
- }
- else
- {
- if( list->listData[( row )].listHeight >=
- (list->displayPos + list->displayHeight) )
- adjustDisplay( window, 1, TRUE );
- else
- break;
- }
- }
-
- }
-
- if( list->multiSelect )
- {
- Int i = 0;
-
- while( list->selections[i] >= 0 )
- {
-
- if( (row = list->selections[i]) != 0 )
- list->selections[i] = -1;
-
- i++;
-
- }
-
- }
- else
- {
- if( row == list->selectPos )
- list->selectPos = -1;
- }
-
- }
-
- return((WindowMsgHandledType) addedIndex );
-
- }
-
- // ------------------------------------------------------------------------
- case GLM_TOGGLE_MULTI_SELECTION:
- {
-
- if( (Int)mData1 < 0 )
- {
- // a negative number will purge the entire list.
- if( list->multiSelect )
- memset( list->selections, -1, list->listLength * sizeof(Int) );
- else
- {
- // this message has no effect in a non-multi listbox
- }
-
- break;
- }
-
- // if there is no cells we shouldn't be selecting this entry
- if( !list->listData[ mData1 ].cell )
- break;
-
- if( list->multiSelect )
- {
- Int i = 0;
- Bool removed = FALSE;
-
- while( list->selections[i] >= 0 )
- {
- if( list->selections[i] == (Int)mData1 )
- {
- removeSelection( list, i );
- removed = TRUE;
- break;
- }
-
- i++;
- }
-
- if( removed == FALSE )
- {
- list->selections[i] = (Int)mData1;
- list->selections[i+1] = -1;
- }
- }
- else
- {
- // this message has no effect in a non-multi listbox
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GLM_SET_SELECTION:
- {
- const Int *selectList = (const Int *)mData1;
- Int selectCount = (Int)mData2;
- DEBUG_ASSERTCRASH( list->multiSelect || selectCount == 1, ("Bad selection size"));
-
- if( selectList[0] < 0 || list->listLength <= selectList[0] )
- {
-
- if( list->multiSelect )
- memset( list->selections, -1, list->listLength * sizeof(Int) );
- else
- list->selectPos = -1;
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GLM_SELECTED,
- (WindowMsgData)window,
- list->selectPos );
-
- break;
-
- }
-
- if( list->multiSelect )
- {
- // forced selections override the entire selection list.
- Int i=0;
- for (; iendPos; ++i)
- {
- // don't select off the end
- if (list->listLength <= selectList[i])
- {
- break;
- }
-
- // if there is no cells we shouldn't be selecting this entry
- if( !list->listData[ selectList[i] ].cell )
- {
- break;
- }
-
- list->selections[i] = selectList[i];
- }
- list->selections[i] = -1;
- }
- else
- {
- // if there is no cells we shouldn't be selecting this entry
- if( !list->listData[ selectList[0] ].cell )
- {
- break;
- }
-
- list->selectPos = selectList[0];
- GameWindow *parent = window->winGetParent();
- if( parent && BitIsSet( parent->winGetStyle(), GWS_COMBO_BOX ) )
- {
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GLM_SELECTED,
- (WindowMsgData)window,
- list->selectPos );
- break;
- }
- if( list->listData[list->selectPos].listHeight < list->displayPos )
- {
-
- TheWindowManager->winSendSystemMsg( window, GLM_UPDATE_DISPLAY,
- list->selectPos, 0 );
- }
- else if( list->listData[list->selectPos].listHeight >
- (list->displayPos + list->displayHeight) )
- {
-
- if( list->selectPos > 0 )
- list->displayPos =
- list->listData[list->selectPos].listHeight - list->displayHeight;
- else
- list->displayPos = 0;
-
- adjustDisplay( window, 0, TRUE );
-
- }
-
- }
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GLM_SELECTED,
- (WindowMsgData)window,
- list->selectPos );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GLM_SCROLL_BUFFER:
- {
-
- if( list->endPos < (Int)mData1 )
- break;
-
- //
- // scroll buffer literally scrolls the entire list data buffer
- // up one entry, effectively removing the top entry.
- //
-
- //
- // Loop through and remove all the entries from the top up until we reach
- // the position mData1 contains
- //
- ListEntryCell *cells = nullptr;
- Int i = 0;
- for (; i < (Int)mData1; i++)
- {
- cells = list->listData[i].cell;
-
- if(cells)
- for( Int j = 0; j < list->columns; j++ )
- {
- if( cells[j].cellType == LISTBOX_TEXT && cells[j].data )
- TheDisplayStringManager->freeDisplayString((DisplayString *) cells[j].data );
-
-// free(cells[i].userData);
- cells[j].data = nullptr;
- cells[j].userData = nullptr;
- cells[j].color = 0;
- cells[j].cellType = 0;
- }
-
- delete[](list->listData[i].cell);
- list->listData[i].cell = nullptr;
- }
-
-
- //
- // copy the cells up
- //
- memcpy(list->listData, &list->listData[mData1],
- (list->endPos - mData1) * sizeof(ListEntryRow) );
-
- list->endPos -= mData1;
- list->insertPos = list->endPos;
-
- //
- // remove the display or links to images after the shift
- //
- for(i = 0; i < (Int)mData1; i ++)
- {
- list->listData[list->endPos + i].cell = nullptr;
- }
-
-
- if( list->multiSelect )
- {
- Int i = 0;
-
- while( list->selections[i] >= 0 )
- {
- if( (Int)mData1 >= list->selections[i] )
- list->selections[i] -= (Int)mData1;
- else
- {
- removeSelection( list, i );
- i--; // compensate for lost entry
- }
-
- i++;
- }
- }
- else
- {
- if( list->selectPos > 0 )
- list->selectPos -= mData1;
- }
-
- if( list->displayPos > 0 )
- adjustDisplay( window, (-1 * mData1), TRUE );
-
- computeTotalHeight( window );
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GLM_GET_SELECTION:
- {
-
- if( list->multiSelect )
- *(Int*)mData2 = (Int)list->selections;
- else
- *(Int*)mData2 = list->selectPos;
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GLM_SET_UP_BUTTON:
- list->upButton = (GameWindow *)mData1;
- break;
-
- // ------------------------------------------------------------------------
- case GLM_SET_DOWN_BUTTON:
- list->downButton = (GameWindow *)mData1;
- break;
-
- // ------------------------------------------------------------------------
- case GLM_SET_SLIDER:
- list->slider = (GameWindow *)mData1;
- break;
-
- // ------------------------------------------------------------------------
- case GWM_CREATE:
- break;
-
- // ------------------------------------------------------------------------
- case GGM_RESIZED:
- {
- Int width = (Int)mData1;
- Int height = (Int)mData2;
- ICoord2D downSize = {0, 0};
- ICoord2D upSize = {0, 0};
- ICoord2D sliderSize = {0, 0};
- GameWindow *child = nullptr;
- ICoord2D sliderChildSize = {0, 0};
-
- // get needed window sizes
- if (list->downButton)
- list->downButton->winGetSize( &downSize.x, &downSize.y );
- if (list->upButton)
- list->upButton->winGetSize( &upSize.x, &upSize.y );
- if (list->slider)
- {
- list->slider->winGetSize( &sliderSize.x, &sliderSize.y );
- child = list->slider->winGetChild();
- if (child)
- child->winGetSize( &sliderChildSize.x, &sliderChildSize.y );
- }
-
- if( list->upButton )
- {
-
- list->upButton->winSetPosition( width - upSize.x - 2, 2 );
-
- }
-
- if( list->downButton )
- {
-
- list->downButton->winSetPosition( width - downSize.x - 2,
- height - downSize.y - 2 );
-
- }
-
- if( list->slider )
- {
- list->slider->winSetSize( sliderSize.x,
- height - (2 * upSize.y) -6 );
- list->slider->winSetPosition( width - sliderSize.x -2, upSize.y + 3 );
-
- }
-
- list->displayHeight = height;
- // store display height
- if( instData->getTextLength() )
- {
- list->displayHeight -= TheWindowManager->winFontHeight( instData->getFont() );
- }
-
- //
- // Setup listbox Columns
- //
- if( list->columns == 1 )
- {
- list->columnWidth[0] = width;
- if( list->slider )
- {
- ICoord2D sliderSize;
-
- list->slider->winGetSize( &sliderSize.x, &sliderSize.y );
- list->columnWidth[0] -= sliderSize.x;
-
- }
- }
- else
- {
- if( !list->columnWidthPercentage )
- break;
- if(!list->columnWidth)
- break;
-
- Int totalWidth = width;
- if( list->slider )
- {
- ICoord2D sliderSize;
-
- list->slider->winGetSize( &sliderSize.x, &sliderSize.y );
- totalWidth -= sliderSize.x;
-
- }
- for(Int i = 0; i < list->columns; i++ )
- {
- list->columnWidth[i] = list->columnWidthPercentage[i] * totalWidth / 100;
- }
- }
- //reset the total height
- computeTotalHeight(window);
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GLM_UPDATE_DISPLAY:
- {
-
- if( mData1 > 0 )
- // set the display to the top of a specific entry
- // which is the previous listHeight + 1
- list->displayPos = list->listData[(mData1 - 1)].listHeight + 1;
- else
- list->displayPos = 0;
-
- if( list->displayPos + list->displayHeight >= list->totalHeight )
- {
- list->displayPos = list->totalHeight - list->displayHeight;
- }
- adjustDisplay( window, 0, TRUE );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_DESTROY:
- {
- Int i;
-
- // Loop through and destroy any display strings we've allocated
- for( i = 0; i < list->listLength; i++ )
- {
- //We're now onto a row of cells we are not using anymore Pull off the cells and loop through them
- ListEntryCell *cells = list->listData[i].cell;
- for (int j = list->columns - 1; j >=0; j-- )
- {
- if(!cells)
- break;
- if( cells[j].cellType == LISTBOX_TEXT )
- {
- // If we can delete the stuff that won't be showing up in the new listData structure
- if ( cells[j].data )
- {
- TheDisplayStringManager->freeDisplayString((DisplayString *) cells[j].data );
- }
- }
-// free(cells[j].userData);
-
- // Null out the data pointers so they're not destroyed when we free up this listdata
- cells[j].userData = nullptr;
- cells[j].data = nullptr;
- }
- delete[](list->listData[i].cell);
- list->listData[i].cell = nullptr;
- }
-
- delete[]( list->listData );
- delete[]( list->columnWidth );
- delete[]( list->columnWidthPercentage );
- if( list->multiSelect )
- delete[]( list->selections );
-
- delete (ListboxData *)window->winGetUserData();
- window->winSetUserData( nullptr );
- list = nullptr;
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- // If we're losing focus
- if( mData1 == FALSE )
- {
- BitClear( instData->m_state, WIN_STATE_HILITED );
- }
- else
- {
- BitSet( instData->m_state, WIN_STATE_HILITED );
- }
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GGM_FOCUS_CHANGE,
- mData1,
- window->winGetWindowId() );
-
- *(Bool*)mData2 = TRUE;
- break;
-
- }
- // ------------------------------------------------------------------------
- case GSM_SLIDER_TRACK:
- {
- SliderData *sData = (SliderData *)list->slider->winGetUserData();
- list->displayPos = sData->maxVal - mData2;
-
- if( list->displayPos > (list->totalHeight - list->displayHeight + 1) )
- list->displayPos = (list->totalHeight - list->displayHeight + 1);
-
- if( list->displayPos < 0)
- list->displayPos = 0;
-
- adjustDisplay( window, 0, FALSE );
- break;
-
- }
- // ------------------------------------------------------------------------
- case GLM_SET_ITEM_DATA:
- {
- void *data = (void *)mData2;
- pos = (ICoord2D *)mData1;
-
- if (pos->y >= 0 && pos->y < list->endPos && list->listData[pos->y].cell)
- list->listData[pos->y].cell[pos->x].userData = data;
-
- break;
- }
- // ------------------------------------------------------------------------
- case GLM_GET_ITEM_DATA:
- {
- pos = (ICoord2D *)mData1;
- void **data = (void **)mData2;
-
- *data = nullptr; // initialize to nullptr
- if (pos->y >= 0 && pos->y < list->endPos && list->listData[pos->y].cell)
- *data = list->listData[pos->y].cell[pos->x].userData;
-
- break;
- }
-
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-// GadgetListBoxSetColors =====================================================
-/** Set the colors for a list box, note that this will also automatically
- * change the colors of any attached slider, slider thumb, and slider
- * buttons */
-//=============================================================================
-void GadgetListBoxSetColors( GameWindow *listbox,
- Color enabledColor,
- Color enabledBorderColor,
- Color enabledSelectedItemColor,
- Color enabledSelectedItemBorderColor,
- Color disabledColor,
- Color disabledBorderColor,
- Color disabledSelectedItemColor,
- Color disabledSelectedItemBorderColor,
- Color hiliteColor,
- Color hiliteBorderColor,
- Color hiliteSelectedItemColor,
- Color hiliteSelectedItemBorderColor )
-{
- ListboxData *listboxData = (ListboxData *)listbox->winGetUserData();
-
- // enabled
- GadgetListBoxSetEnabledColor( listbox, enabledColor );
- GadgetListBoxSetEnabledBorderColor( listbox, enabledBorderColor );
- GadgetListBoxSetEnabledSelectedItemColor( listbox, enabledSelectedItemColor );
- GadgetListBoxSetEnabledSelectedItemBorderColor( listbox, enabledSelectedItemBorderColor );
-
- // disabled
- GadgetListBoxSetDisabledColor( listbox, disabledColor );
- GadgetListBoxSetDisabledBorderColor( listbox, disabledBorderColor );
- GadgetListBoxSetDisabledSelectedItemColor( listbox, disabledSelectedItemColor );
- GadgetListBoxSetDisabledSelectedItemBorderColor( listbox, disabledSelectedItemBorderColor );
-
- // hilited
- GadgetListBoxSetHiliteColor( listbox, hiliteColor );
- GadgetListBoxSetHiliteBorderColor( listbox, hiliteBorderColor );
- GadgetListBoxSetHiliteSelectedItemColor( listbox, hiliteSelectedItemColor );
- GadgetListBoxSetHiliteSelectedItemBorderColor( listbox, hiliteSelectedItemBorderColor );
-
- // assign default slider colors and images as part of the list box
- GameWindow *slider = listboxData->slider;
- if( slider )
- {
- GameWindow *upButton = listboxData->upButton;
- GameWindow *downButton = listboxData->downButton;
-
- // slider and slider thumb ----------------------------------------------
-
- // enabled
- GadgetSliderSetEnabledColor( slider, GadgetListBoxGetEnabledColor( listbox ) );
- GadgetSliderSetEnabledBorderColor( slider, GadgetListBoxGetEnabledBorderColor( listbox ) );
-
- // Disabled
- GadgetSliderSetDisabledColor( slider, GadgetListBoxGetDisabledColor( listbox ) );
- GadgetSliderSetDisabledBorderColor( slider, GadgetListBoxGetDisabledBorderColor( listbox ) );
-
- // Hilite
- GadgetSliderSetHiliteColor( slider, GadgetListBoxGetHiliteColor( listbox ) );
- GadgetSliderSetHiliteBorderColor( slider, GadgetListBoxGetHiliteBorderColor( listbox ) );
-
- // up button ------------------------------------------------------------
-
- // enabled
- GadgetButtonSetEnabledColor( upButton, GadgetSliderGetEnabledColor( slider ) );
- GadgetButtonSetEnabledBorderColor( upButton, GadgetSliderGetEnabledBorderColor( slider ) );
- GadgetButtonSetEnabledSelectedColor( upButton, GadgetSliderGetEnabledSelectedThumbColor( slider ) );
- GadgetButtonSetEnabledSelectedBorderColor( upButton, GadgetSliderGetEnabledSelectedThumbBorderColor( slider ) );
-
- // disabled
- GadgetButtonSetDisabledColor( upButton, GadgetSliderGetDisabledColor( slider ) );
- GadgetButtonSetDisabledBorderColor( upButton, GadgetSliderGetDisabledBorderColor( slider ) );
- GadgetButtonSetDisabledSelectedColor( upButton, GadgetSliderGetDisabledSelectedThumbColor( slider ) );
- GadgetButtonSetDisabledSelectedBorderColor( upButton, GadgetSliderGetDisabledSelectedThumbBorderColor( slider ) );
-
- // hilite
- GadgetButtonSetHiliteColor( upButton, GadgetSliderGetHiliteColor( slider ) );
- GadgetButtonSetHiliteBorderColor( upButton, GadgetSliderGetHiliteBorderColor( slider ) );
- GadgetButtonSetHiliteSelectedColor( upButton, GadgetSliderGetHiliteSelectedThumbColor( slider ) );
- GadgetButtonSetHiliteSelectedBorderColor( upButton, GadgetSliderGetHiliteSelectedThumbBorderColor( slider ) );
-
- // down button ----------------------------------------------------------
-
- // enabled
- GadgetButtonSetEnabledColor( downButton, GadgetSliderGetEnabledColor( slider ) );
- GadgetButtonSetEnabledBorderColor( downButton, GadgetSliderGetEnabledBorderColor( slider ) );
- GadgetButtonSetEnabledSelectedColor( downButton, GadgetSliderGetEnabledSelectedThumbColor( slider ) );
- GadgetButtonSetEnabledSelectedBorderColor( downButton, GadgetSliderGetEnabledSelectedThumbBorderColor( slider ) );
-
- // disabled
- GadgetButtonSetDisabledColor( downButton, GadgetSliderGetDisabledColor( slider ) );
- GadgetButtonSetDisabledBorderColor( downButton, GadgetSliderGetDisabledBorderColor( slider ) );
- GadgetButtonSetDisabledSelectedColor( downButton, GadgetSliderGetDisabledSelectedThumbColor( slider ) );
- GadgetButtonSetDisabledSelectedBorderColor( downButton, GadgetSliderGetDisabledSelectedThumbBorderColor( slider ) );
-
- // hilite
- GadgetButtonSetHiliteColor( downButton, GadgetSliderGetHiliteColor( slider ) );
- GadgetButtonSetHiliteBorderColor( downButton, GadgetSliderGetHiliteBorderColor( slider ) );
- GadgetButtonSetHiliteSelectedColor( downButton, GadgetSliderGetHiliteSelectedThumbColor( slider ) );
- GadgetButtonSetHiliteSelectedBorderColor( downButton, GadgetSliderGetHiliteSelectedThumbBorderColor( slider ) );
-
- }
-
-}
-
-// GadgetListBoxGetText =======================================================
-/** Get the text for a list box entry */
-//=============================================================================
-UnicodeString GadgetListBoxGetText( GameWindow *listbox, Int row, Int column)
-{
- Color color;
- return GadgetListBoxGetTextAndColor( listbox,&color,row,column );
-}
-
-// GadgetListBoxGetText =======================================================
-/** Get the text for a list box entry */
-//=============================================================================
-UnicodeString GadgetListBoxGetTextAndColor( GameWindow *listbox, Color *color, Int row, Int column)
-{
- *color = 0;
- // sanity
- if( listbox == nullptr || row == -1 || column == -1)
- return UnicodeString::TheEmptyString;
-
- // verify that this is a list box
- if( BitIsSet( listbox->winGetStyle(), GWS_SCROLL_LISTBOX ) == FALSE )
- return UnicodeString::TheEmptyString;
- TextAndColor tAndC;
- //UnicodeString result;
- ICoord2D pos;
- pos.x = column;
- pos.y = row;
- TheWindowManager->winSendSystemMsg( listbox, GLM_GET_TEXT, (WindowMsgData)&pos, (WindowMsgData)&tAndC );
-
-
- *color = tAndC.color;
- return tAndC.string;
-
- //return UnicodeString::TheEmptyString;
-
-}
-
-// GadgetListBoxAddEntryText ==================================================
-/** Add a new string entry into the listbox at the insert position */
-//=============================================================================
-Int GadgetListBoxAddEntryText( GameWindow *listbox,
- UnicodeString text,
- Color color, Int row, Int column, Bool overwrite )
-{
- if (!listbox)
- return -1;
- if (text.isEmpty())
- text = L" ";
- Int index;
- AddMessageStruct addInfo;
- addInfo.row = row;
- addInfo.column = column;
- addInfo.type = LISTBOX_TEXT;
- addInfo.data = &text;
- addInfo.overwrite = overwrite;
- addInfo.height = -1;
- addInfo.width = -1;
-
- ListboxData *listData = (ListboxData *)listbox->winGetUserData();
- if (listData == nullptr)
- return -1;
- Bool wasFull = (listData->listLength <= listData->endPos);
- Int newEntryOffset = (wasFull)?0:1;
- Int oldBottomIndex = GadgetListBoxGetBottomVisibleEntry(listbox);
-
- /// @TODO: Don't do this type cast!
- index = (Int) TheWindowManager->winSendSystemMsg( listbox, GLM_ADD_ENTRY, (WindowMsgData)&addInfo, color );
-
- //DEBUG_ASSERTLOG(!listData->scrollIfAtEnd, ("Adding line %d (orig end was %d, newEntryOffset is %d, (%d-%d)?=%d, isFull=%d/%d ll=%d, end=%d",
- //index, oldBottomIndex, newEntryOffset, index, oldBottomIndex, newEntryOffset, wasFull, GadgetListBoxIsFull(listbox), listData->listLength, listData->endPos));
- if(listData->scrollIfAtEnd && index - oldBottomIndex == newEntryOffset && GadgetListBoxIsFull(listbox))
- {
- GadgetListBoxSetBottomVisibleEntry( listbox, index );
- }
-
- return (index);
-}
-
-// GadgetListBoxAddEntryImage =================================================
-/** Add a new string entry into the listbox at the insert position */
-//=============================================================================
-Int GadgetListBoxAddEntryImage( GameWindow *listbox, const Image *image,
- Int row, Int column,
- Int hight, Int width,
- Bool overwrite, Color color )
-{
- Int index;
- AddMessageStruct addInfo;
- addInfo.row = row;
- addInfo.column = column;
- addInfo.type = LISTBOX_IMAGE;
- addInfo.data = image;
- addInfo.overwrite = overwrite;
- addInfo.height = hight;
- addInfo.width = width;
- /// @TODO: Don't do this type cast!
- index = (Int) TheWindowManager->winSendSystemMsg( listbox, GLM_ADD_ENTRY, (WindowMsgData)&addInfo, color );
- return (index);
-}
-
-Int GadgetListBoxAddEntryImage( GameWindow *listbox, const Image *image,
- Int row, Int column,
- Bool overwrite, Color color )
-{
- return GadgetListBoxAddEntryImage(listbox, image, row, column, -1, -1, overwrite, color);
-}
-
-// GadgetListBoxSetFont =======================================================
-/** Set the font for a listbox control, we need to set the window
- * text font, the tooltip font, and the edit text display strings for
- * the text data itself and the secret text */
-//=============================================================================
-void GadgetListBoxSetFont( GameWindow *g, GameFont *font )
-{
- ListboxData *listData = (ListboxData *)g->winGetUserData();
- DisplayString *dString;
-
- // set the font for the display strings all windows have
- dString = g->winGetInstanceData()->getTextDisplayString();
- if( dString )
- dString->setFont( font );
- dString = g->winGetInstanceData()->getTooltipDisplayString();
- if( dString )
- dString->setFont( font );
-
- // listbox specific
- if( listData )
- for( Int i = 0; i < listData->listLength; i++ )
- {
- if(listData->listData[i].cell)
- for( Int j = 0; j < listData->columns; j++ )
- {
- if( listData->listData[i].cell[j].cellType == LISTBOX_TEXT && listData->listData[i].cell[j].data )
- {
- dString = (DisplayString *)listData->listData[i].cell[j].data;
- dString->setFont( font );
- }
- }
- }
-
-}
-
-// GadgetListboxCreateScrollbar ===============================================
-/** Create the scroll bar using a slider and two buttons for a listbox */
-//=============================================================================
-void GadgetListboxCreateScrollbar( GameWindow *listbox )
-{
- ListboxData *listData = (ListboxData *)listbox->winGetUserData();
- WinInstanceData winInstData;
- SliderData sData = { 0 };
- Int buttonWidth, buttonHeight;
- Int sliderButtonWidth, sliderButtonHeight;
- Int fontHeight;
- Int top;
- Int bottom;
- UnsignedInt status = listbox->winGetStatus();
- Bool title = FALSE;
- Int width, height;
-
- // get width and height of listbox
- listbox->winGetSize( &width, &height );
-
- // do we have a title
- if( listbox->winGetTextLength() )
- title = TRUE;
-
- // remove unwanted status bits.
- status &= ~(WIN_STATUS_BORDER | WIN_STATUS_HIDDEN | WIN_STATUS_NO_INPUT);
-
- fontHeight = TheWindowManager->winFontHeight( listbox->winGetFont() );
- top = title ? (fontHeight + 1):0;
- bottom = title ? (height - (fontHeight + 1)):height;
-
- // initialize instData
- winInstData.init();
-
- // size of button
- buttonWidth = 21;//GADGET_SIZE;
- buttonHeight = 22;//GADGET_SIZE;
-
- // ----------------------------------------------------------------------
- // Create Top Button
- // ----------------------------------------------------------------------
- status |= WIN_STATUS_IMAGE;
-
- winInstData.m_owner = listbox;
- winInstData.m_style = GWS_PUSH_BUTTON;
-
- // if listbox tracks, so will this sub control
- if( BitIsSet( listbox->winGetStyle(), GWS_MOUSE_TRACK ) )
- BitSet( winInstData.m_style, GWS_MOUSE_TRACK );
-
- listData->upButton =
- TheWindowManager->gogoGadgetPushButton( listbox,
- status | WIN_STATUS_ACTIVE | WIN_STATUS_ENABLED,
- width - buttonWidth -2, top+2,
- buttonWidth, buttonHeight,
- &winInstData, nullptr, TRUE );
-
- // ----------------------------------------------------------------------
- // Create Bottom Button
- // ----------------------------------------------------------------------
-
- winInstData.init();
- winInstData.m_style = GWS_PUSH_BUTTON;
- winInstData.m_owner = listbox;
-
- // if listbox tracks, so will this sub control
- if( BitIsSet( listbox->winGetStyle(), GWS_MOUSE_TRACK ) )
- BitSet( winInstData.m_style, GWS_MOUSE_TRACK );
-
- listData->downButton =
- TheWindowManager->gogoGadgetPushButton( listbox,
- status | WIN_STATUS_ACTIVE | WIN_STATUS_ENABLED,
- width - buttonWidth -2,
- (top + bottom - buttonHeight -2),
- buttonWidth, buttonHeight,
- &winInstData, nullptr, TRUE );
-
- // ----------------------------------------------------------------------
- // create the slider
- // ----------------------------------------------------------------------
-
- // size of button
- sliderButtonWidth = buttonWidth;//GADGET_SIZE;
- sliderButtonHeight = GADGET_SIZE;
-
- // initialize instData
- winInstData.init();
- winInstData.m_style = GWS_VERT_SLIDER;
- winInstData.m_owner = listbox;
-
- // if listbox tracks, so will this sub control
- if( BitIsSet( listbox->winGetStyle(), GWS_MOUSE_TRACK ) )
- BitSet( winInstData.m_style, GWS_MOUSE_TRACK );
-
- // initialize sData
- memset( &sData, 0, sizeof(SliderData) );
-
- // Create Slider
- listData->slider =
- TheWindowManager->gogoGadgetSlider( listbox,
- status | WIN_STATUS_ACTIVE | WIN_STATUS_ENABLED,
- width - sliderButtonWidth - 2,
- (top + buttonHeight + 3),
- sliderButtonWidth, bottom - (2 * buttonHeight) - 6,
- &winInstData, &sData, nullptr, TRUE );
-
- // we now have all the scrollbar parts, this better be set :)
- listData->scrollBar = TRUE;
-
-}
-
-// GadgetListBoxAddMultiSelect ================================================
-/** Enable multi selections for a listbox
- *
- * ASSUMPTION: The listLength must already be set at this time so
- * that we can make enough space to hold all the selection data, if you
- * change the list length you must also change the selection array
- * for multi select listboxes
- */
-//=============================================================================
-void GadgetListBoxAddMultiSelect( GameWindow *listbox )
-{
- ListboxData *listboxData = (ListboxData *)listbox->winGetUserData();
-
- DEBUG_ASSERTCRASH(listboxData && listboxData->selections == nullptr, ("selections is not null"));
- listboxData->selections = NEW Int [listboxData->listLength];
- DEBUG_LOG(( "Enable list box multi select: listLength (select) = %d * %d = %d bytes;",
- listboxData->listLength, sizeof(Int),
- listboxData->listLength *sizeof(Int) ));
-
- if( listboxData->selections == nullptr )
- {
-
- delete[]( listboxData->listData );
- listboxData->listData = nullptr;
- return;
-
- }
-
- memset( listboxData->selections, -1,
- listboxData->listLength * sizeof(Int) );
-
- // set mutliselect flag
- listboxData->multiSelect = TRUE;
-
- // adjust the input procedure for the listbox
- listbox->winSetInputFunc( GadgetListBoxMultiInput );
-
-}
-
-// GadgetListBoxRemoveMultiSelect =============================================
-/** Remove multi select capability from a listbox */
-//=============================================================================
-void GadgetListBoxRemoveMultiSelect( GameWindow *listbox )
-{
- ListboxData *listData = (ListboxData *)listbox->winGetUserData();
-
- delete[]( listData->selections );
- listData->selections = nullptr;
-
- listData->multiSelect = FALSE;
-
- // adjust the input procedure for the listbox
- listbox->winSetInputFunc( GadgetListBoxInput );
-
-}
-
-// GadgetListBoxSetListLength =================================================
-/** Set OR reset the list length data contained in the listboxData
- * parameter. When adjusting the size of lists we also have to
- * adjust multiselection lists if present and any display
- * strings present */
-//=============================================================================
-void GadgetListBoxSetListLength( GameWindow *listbox, Int newLength )
-{
- ListboxData *listboxData = (ListboxData *)listbox->winGetUserData();
-
-
-// ListboxData *listboxData = (ListboxData *)listbox->winGetUserData();
-// ListEntry *newData = (ListEntry *)malloc(newLength * sizeof(ListEntry));
- DEBUG_ASSERTCRASH(listboxData, ("We don't have our needed listboxData!"));
- if( !listboxData )
- return;
- DEBUG_ASSERTCRASH(listboxData->columns > 0,("We need at least one Column in the listbox"));
- if( listboxData->columns < 1 )
- return;
-
- Int columns = listboxData->columns;
- ListEntryRow *newData = NEW ListEntryRow[ newLength ];
- DEBUG_ASSERTCRASH(newData, ("Unable to allocate new data structures for the Listbox"));
- if( !newData )
- return;
- Int i;
- // zero out the new Data structure
- memset( newData, 0, newLength * sizeof( ListEntryRow ) );
-
- // we want to copy over different amounts of data depending on if we're adding
- // to the list box or removing from the listbox
- if(newLength >= listboxData->listLength)
- {
- memcpy(newData,listboxData->listData,listboxData->listLength * sizeof( ListEntryRow ) );
- }
- else
- {
- // If we're removing entries from the listbox, we need to reset the length,
- // position, and selection to their new places
- if( listboxData->displayPos >newLength)
- listboxData->displayPos = newLength;
- //if we're multiselect, just select no position
- if(listboxData->selectPos > newLength || listboxData->multiSelect)
- listboxData->selectPos = -1;
- if(listboxData->insertPos > newLength)
- listboxData->insertPos = newLength;
-
- listboxData->endPos = newLength;
- //copy only the data that we'll be needing.
- memcpy(newData,listboxData->listData,newLength * sizeof( ListEntryRow ) );
- }
-
- // Loop through and destroy any display strings we've allocated that aren't used
- for( i = 0; i < listboxData->listLength; i++ )
- {
- //We're now onto a row of cells we are not using anymore Pull off the cells and loop through them
- ListEntryCell *cells = listboxData->listData[i].cell;
- for (int j = columns - 1; j >=0; j-- )
- {
- if(!cells)
- break;
- if ( i >= newLength )
- {
- if( cells[j].cellType == LISTBOX_TEXT && i >= newLength)
- {
- // If we can delete the stuff that won't be showing up in the new listData structure
- if ( cells[j].data )
- {
- TheDisplayStringManager->freeDisplayString((DisplayString *) cells[j].data );
- }
- }
-// free(cells[j].userData);
- }
- }
- if (i >= newLength) {
- delete[](listboxData->listData[i].cell);
- listboxData->listData[i].cell = nullptr;
- }
- }
-
- listboxData->listLength = newLength;
-
- delete[]( listboxData->listData );
- listboxData->listData = newData;
-
- //reset the total height
- computeTotalHeight(listbox);
-
- // Sanity check that everything was created properly
- if( listboxData->listData == nullptr )
- {
-
- DEBUG_LOG(( "Unable to allocate listbox data pointer" ));
- assert( 0 );
- return;
-
- }
-
- // adjust the selection array for multi select listboxes
- if( listboxData->multiSelect )
- {
-
- GadgetListBoxRemoveMultiSelect( listbox );
- GadgetListBoxAddMultiSelect( listbox );
-
- }
-
-}
-
-//=============================================================================
-Int GadgetListBoxGetListLength( GameWindow *listbox )
-{
- ListboxData *listboxData = (ListboxData *)listbox->winGetUserData();
- if (listboxData)
- return listboxData->listLength;
-
- return 0;
-}
-
-//=============================================================================
-Int GadgetListBoxGetMaxSelectedLength( GameWindow *listbox )
-{
- ListboxData *listboxData = (ListboxData *)listbox->winGetUserData();
- if (listboxData)
- return listboxData->multiSelect ? listboxData->listLength : 1;
-
- return 0;
-}
-
-// GadgetListBoxGetNumEntries =================================================
-/** Get the list length data contained in the listboxData
- * parameter. */
-//=============================================================================
-Int GadgetListBoxGetNumEntries( GameWindow *listbox )
-{
- if (!listbox)
- return 0;
-
- ListboxData *listboxData = (ListboxData *)listbox->winGetUserData();
- if (listboxData)
- return listboxData->endPos;
-
- return 0;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Get the selected item(s) of a listbox. For a single select listbox the parameter
- * should be a single integer pointer. For a multi select listbox the parameter
- * should be an (Int *), this array returned will be an array of indices of the selected items
- * of the list box. An entry of -1 in this array is the "end" of the selected list,
- * and this list will never be larger than the max items in the list box */
-//-------------------------------------------------------------------------------------------------
-void GadgetListBoxGetSelected( GameWindow *listbox, Int *selectList )
-{
-
- // sanity
- if( listbox == nullptr )
- return;
-
- // get selected indices via system message
- TheWindowManager->winSendSystemMsg( listbox, GLM_GET_SELECTION, 0, (WindowMsgData)selectList );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Set the selected item of a listbox. The parameter is a single integer. If
- * the selected index is less than 0, nothing is selected. */
-//-------------------------------------------------------------------------------------------------
-void GadgetListBoxSetSelected( GameWindow *listbox, Int selectIndex )
-{
-
- // sanity
- if( listbox == nullptr )
- return;
-
- // set selected index via system message
- TheWindowManager->winSendSystemMsg( listbox, GLM_SET_SELECTION, (WindowMsgData)(&selectIndex), 1 );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Set the selected item of a listbox. */
-//-------------------------------------------------------------------------------------------------
-void GadgetListBoxSetSelected( GameWindow *listbox, const Int *selectList, Int selectCount )
-{
- // sanity
- if( listbox == nullptr )
- return;
- // set selected index via system message
- TheWindowManager->winSendSystemMsg( listbox, GLM_SET_SELECTION, (WindowMsgData)selectList, selectCount );
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Reset the content of the listbox */
-//-------------------------------------------------------------------------------------------------
-void GadgetListBoxReset( GameWindow *listbox )
-{
-
- // sanity
- if( listbox == nullptr )
- return;
-
- // reset via system message
- TheWindowManager->winSendSystemMsg( listbox, GLM_DEL_ALL, 0, 0 );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-void GadgetListBoxSetItemData( GameWindow *listbox, void *data, Int row, Int column )
-{
- ICoord2D pos;
- pos.x = column;
- pos.y = row;
-
- if (listbox)
- TheWindowManager->winSendSystemMsg( listbox, GLM_SET_ITEM_DATA, (WindowMsgData)&pos, (WindowMsgData)data);
-
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-void *GadgetListBoxGetItemData( GameWindow *listbox, Int row, Int column)
-{
- void *data = nullptr;
- ICoord2D pos;
- pos.x = column;
- pos.y = row;
-
- if (listbox)
- {
- TheWindowManager->winSendSystemMsg( listbox, GLM_GET_ITEM_DATA, (WindowMsgData)&pos, (WindowMsgData)&data);
- }
- return (data);
-
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-Int GadgetListBoxGetBottomVisibleEntry( GameWindow *window )
-{
- if (!window)
- return 0;
-
- ListboxData *listData = (ListboxData *)window->winGetUserData();
- if (!listData)
- return 0;
-
- return getListboxBottomEntry(listData);
-
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-bool GadgetListBoxIsFull(GameWindow *window)
-{
- if (!window)
- return FALSE;
- ListboxData *listData = (ListboxData *)window->winGetUserData();
- if (!listData)
- return FALSE;
-
- Int entry = getListboxBottomEntry(listData);
- if(listData->listData[entry].listHeight >= listData->displayPos + listData->displayHeight - 5)
- return TRUE;
- else
- return FALSE;
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-void GadgetListBoxSetBottomVisibleEntry( GameWindow *window, Int newPos )
-{
- if (!window)
- return;
-
- ListboxData *listData = (ListboxData *)window->winGetUserData();
- if (!listData)
- return;
-
- int prevPos = GadgetListBoxGetBottomVisibleEntry( window );
-
- adjustDisplay(window, newPos - prevPos + 1, true);
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-Int GadgetListBoxGetTopVisibleEntry( GameWindow *window )
-{
- if (!window)
- return 0;
-
- ListboxData *listData = (ListboxData *)window->winGetUserData();
- if (!listData)
- return 0;
-
- return getListboxTopEntry(listData);
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-void GadgetListBoxSetTopVisibleEntry( GameWindow *window, Int newPos )
-{
- if (!window)
- return;
-
- ListboxData *listData = (ListboxData *)window->winGetUserData();
- if (!listData)
- return;
-
- int prevPos = GadgetListBoxGetTopVisibleEntry( window );
-
- adjustDisplay(window, newPos - prevPos, true);
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-void GadgetListBoxSetAudioFeedback( GameWindow *listbox, Bool enable )
-{
- if (!listbox)
- return;
- ListboxData *listboxData = (ListboxData *)listbox->winGetUserData();
- if (!listboxData)
- return;
-
- listboxData->audioFeedback = enable;
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-Int GadgetListBoxGetNumColumns( GameWindow *listbox )
-{
- if (!listbox)
- return 0;
- ListboxData *listboxData = (ListboxData *)listbox->winGetUserData();
- if (!listboxData)
- return 0;
-
- return listboxData->columns;
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-Int GadgetListBoxGetColumnWidth( GameWindow *listbox, Int column )
-{
- if (!listbox)
- return 0;
- ListboxData *listboxData = (ListboxData *)listbox->winGetUserData();
- if (!listboxData)
- return 0;
- if (listboxData->columns <= column || column < 0)
- return 0;
-
- return listboxData->columnWidth[column];
-}
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetProgressBar.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetProgressBar.cpp
deleted file mode 100644
index d798d23f0d6..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetProgressBar.cpp
+++ /dev/null
@@ -1,118 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: ProgressBar.cpp //////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: ProgressBar.cpp
-//
-// Created: Colin Day, June 2001
-//
-// Desc: Progress bar GUI control
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "Common/Language.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GameWindowManager.h"
-
-// DEFINES ////////////////////////////////////////////////////////////////////
-
-// PRIVATE TYPES //////////////////////////////////////////////////////////////
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////
-
-// PUBLIC DATA ////////////////////////////////////////////////////////////////
-
-// PRIVATE PROTOTYPES /////////////////////////////////////////////////////////
-
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-
-// GadgetProgressBarSystem ====================================================
-/** Handle system messages for Progress Bar */
-//=============================================================================
-WindowMsgHandledType GadgetProgressBarSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
- // ------------------------------------------------------------------------
- case GWM_DESTROY:
- {
- window->winSetUserData( nullptr );
- break;
- }
-
- // ------------------------------------------------------------------------
- case GPM_SET_PROGRESS:
- {
- Int newPos = (Int)mData1;
-
- if (newPos < 0 || newPos > 100)
- break;
-
- window->winSetUserData( (void *)newPos );
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-// GadgetProgressBarSetProgress ===============================================
-/** send progress system message to Progress Bar */
-//=============================================================================
-void GadgetProgressBarSetProgress( GameWindow *g, Int progress )
-{
- if(!g)
- return;
-
- TheWindowManager->winSendSystemMsg( g, GPM_SET_PROGRESS, progress, 0);
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp
deleted file mode 100644
index de74e32a20e..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp
+++ /dev/null
@@ -1,448 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: RadioButton.cpp //////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: RadioButton.cpp
-//
-// Created: Colin Day, June 2001
-//
-// Desc: Radio button GUI control
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "Common/Language.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/Gadget.h"
-
-// DEFINES ////////////////////////////////////////////////////////////////////
-
-// PRIVATE TYPES //////////////////////////////////////////////////////////////
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////
-
-// PUBLIC DATA ////////////////////////////////////////////////////////////////
-
-// PRIVATE PROTOTYPES /////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-// doRadioUnselect ============================================================
-/** Do the unselect of matching group not including exception window */
-//=============================================================================
-static void doRadioUnselect( GameWindow *window, Int group, Int screen,
- GameWindow *except )
-{
-
- //
- // if this is a radio button we have something to consider, but we
- // will ignore the except window
- //
- if( window != except && BitIsSet( window->winGetStyle(), GWS_RADIO_BUTTON ) )
- {
- RadioButtonData *radioData = (RadioButtonData *)window->winGetUserData();
-
- if( radioData->group == group && radioData->screen == screen )
- {
- WinInstanceData *instData = window->winGetInstanceData();
-
- BitClear( instData->m_state, WIN_STATE_SELECTED );
-
- }
-
- }
-
- // recursively call on all my children
- GameWindow *child;
-
- for( child = window->winGetChild(); child; child = child->winGetNext() )
- doRadioUnselect( child, group, screen, except );
-
-}
-
-// unselectOtherRadioOfGroup ==================================================
-/** Go through the entire window system, including child windows and
- * unselect any radio buttons of the specified group, but not the
- * window specified */
-//=============================================================================
-static void unselectOtherRadioOfGroup( Int group, Int screen,
- GameWindow *except )
-{
- GameWindow *window = TheWindowManager->winGetWindowList();
-
- for( window = TheWindowManager->winGetWindowList();
- window;
- window = window->winGetNext() )
- doRadioUnselect( window, group, screen, except );
-
-}
-
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-
-// GadgetRadioButtonInput =====================================================
-/** Handle input for radio button */
-//=============================================================================
-WindowMsgHandledType GadgetRadioButtonInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- WinInstanceData *instData = window->winGetInstanceData();
-
- switch( msg )
- {
-
- // ------------------------------------------------------------------------
- case GWM_MOUSE_ENTERING:
- {
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- {
-
- BitSet( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( instData->getOwner(),
- GBM_MOUSE_ENTERING,
- (WindowMsgData)window,
- mData1 );
- //TheWindowManager->winSetFocus( window );
-
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_MOUSE_LEAVING:
- {
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- {
-
- BitClear( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( instData->getOwner(),
- GBM_MOUSE_LEAVING,
- (WindowMsgData)window,
- mData1 );
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DRAG:
- {
-
- TheWindowManager->winSendSystemMsg( instData->getOwner(), GGM_LEFT_DRAG,
- (WindowMsgData)window, mData1 );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DOWN:
- {
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_UP:
- {
-
- if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) == FALSE )
- {
- RadioButtonData *radioData = (RadioButtonData *)window->winGetUserData();
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_SELECTED,
- (WindowMsgData)window,
- mData1 );
-
- //
- // unselect any windows in the system (including children) that
- // are radio buttons with this same group and screen ID
- //
- if( radioData->group != 0 )
- unselectOtherRadioOfGroup(radioData->group, radioData->screen, window );
-
- // this button is now selected
- BitSet( instData->m_state, WIN_STATE_SELECTED );
-
- }
- else if( BitIsSet( instData->getState(), WIN_STATE_HILITED ) == FALSE )
- {
-
- // this up click was not meant for this button
- return MSG_IGNORED;
-
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_CHAR:
- {
-
- switch( mData1 )
- {
-
- // --------------------------------------------------------------------
- case KEY_ENTER:
- case KEY_SPACE:
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
-
- if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) == FALSE )
- {
- RadioButtonData *radioData = (RadioButtonData *)window->winGetUserData();
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_SELECTED,
- (WindowMsgData)window,
- mData1 );
-
- //
- // unselect any windows in the system (including children) that
- // are radio buttons with this same group and screen ID
- //
- if( radioData->group != 0 )
- unselectOtherRadioOfGroup(radioData->group, radioData->screen, window );
-
- // this button is now selected
- BitSet( instData->m_state, WIN_STATE_SELECTED );
-
- }
-
- }
-
- break;
-
- // --------------------------------------------------------------------
- case KEY_DOWN:
- case KEY_RIGHT:
- case KEY_TAB:
- {
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- window->winNextTab();
- break;
-
- }
-
- // --------------------------------------------------------------------
- case KEY_UP:
- case KEY_LEFT:
- {
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- window->winPrevTab();
- break;
-
- }
-
- // --------------------------------------------------------------------
- default:
- {
-
- return MSG_IGNORED;
-
- }
-
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- default:
- {
-
- return MSG_IGNORED;
-
- }
-
- }
-
- return MSG_HANDLED;
-
-}
-
-// GadgetRadioButtonSystem ====================================================
-/** Handle system messages for radio button */
-//=============================================================================
-WindowMsgHandledType GadgetRadioButtonSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- WinInstanceData *instData = window->winGetInstanceData();
-
- switch( msg )
- {
-
- // ------------------------------------------------------------------------
- case GBM_SET_SELECTION:
- {
-
- if( BitIsSet( instData->getState(), WIN_STATE_SELECTED ) == FALSE )
- {
-
- // do we want to send a selected message?
- if( (Bool)mData1 == TRUE )
- {
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_SELECTED,
- (WindowMsgData)window,
- 0 );
- }
-
- //
- // unselect any windows in the system (including children) that
- // are radio buttons with this same group and screen ID
- //
- RadioButtonData *radioData = (RadioButtonData *)window->winGetUserData();
- if( radioData->group != 0 )
- unselectOtherRadioOfGroup(radioData->group, radioData->screen, window );
-
- // this button is now selected
- BitSet( instData->m_state, WIN_STATE_SELECTED );
-
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GGM_SET_LABEL:
- {
-
- window->winSetText( *(UnicodeString*)mData1 );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_CREATE:
- break;
-
- // ------------------------------------------------------------------------
- case GWM_DESTROY:
- {
- // free radio button user data
- delete (RadioButtonData *)window->winGetUserData();
- window->winSetUserData( nullptr );
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- {
-
- if( mData1 == FALSE )
- BitClear( instData->m_state, WIN_STATE_HILITED );
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GGM_FOCUS_CHANGE,
- mData1,
- window->winGetWindowId() );
-
- *(Bool*)mData2 = TRUE;
- break;
-
- }
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-// GadgetRadioSetText =========================================================
-/** Set the text for the control */
-//=============================================================================
-void GadgetRadioSetText( GameWindow *g, UnicodeString text )
-{
-
- // sanity
- if( g == nullptr )
- return;
-
- TheWindowManager->winSendSystemMsg( g, GGM_SET_LABEL, (WindowMsgData)&text, 0 );
-
-}
-
-// GadgetRadioSetGroup ========================================================
-/** Set the group number for a radio button, only one radio button of
- * a group can be selected at any given time */
-//=============================================================================
-void GadgetRadioSetGroup( GameWindow *g, Int group, Int screen )
-{
- RadioButtonData *radioData = (RadioButtonData *)g->winGetUserData();
-
- radioData->group = group;
- radioData->screen = screen;
-
-}
-
-
-// GadgetRadioSetText =========================================================
-/** Set the text for the control */
-//=============================================================================
-void GadgetRadioSetSelection( GameWindow *g, Bool sendMsg )
-{
-
- // sanity
- if( g == nullptr )
- return;
-
- TheWindowManager->winSendSystemMsg( g, GBM_SET_SELECTION, (WindowMsgData)&sendMsg, 0 );
-
-}
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetStaticText.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetStaticText.cpp
deleted file mode 100644
index 68a010e6bac..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetStaticText.cpp
+++ /dev/null
@@ -1,226 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: StaticText.cpp ///////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: StaticText.cpp
-//
-// Created: Colin Day, June 2001
-//
-// Desc: Static text control
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "Common/Language.h"
-#include "GameClient/DisplayStringManager.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GameWindowManager.h"
-
-// DEFINES ////////////////////////////////////////////////////////////////////
-
-// PRIVATE TYPES //////////////////////////////////////////////////////////////
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////
-
-// PUBLIC DATA ////////////////////////////////////////////////////////////////
-
-// PRIVATE PROTOTYPES /////////////////////////////////////////////////////////
-
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-// GadgetStaticTextInput ======================================================
-/** Handle input for text field */
-//=============================================================================
-WindowMsgHandledType GadgetStaticTextInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
- // ------------------------------------------------------------------------
- case GWM_CHAR:
- switch (mData1)
- {
-
- case KEY_DOWN:
- case KEY_RIGHT:
- case KEY_TAB:
- // Just in case some fool sets static text as a tab stop
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- window->winNextTab();
- break;
-
- case KEY_UP:
- case KEY_LEFT:
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- window->winPrevTab();
- break;
-
- default:
- return MSG_IGNORED;
- }
-
- break;
-
- default:
- return MSG_IGNORED;
-
- }
- return MSG_HANDLED;
-
-
-}
-
-// GadgetStaticTextSystem =====================================================
-/** Handle system messages for text field */
-//=============================================================================
-WindowMsgHandledType GadgetStaticTextSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-// WinInstanceData *instData = window->winGetInstanceData();
-
- switch( msg )
- {
- // ------------------------------------------------------------------------
- case GGM_GET_LABEL:
- {
- TextData *tData = (TextData *)window->winGetUserData();
- if (tData && tData->text)
- *(UnicodeString*)mData2 = tData->text->getText();
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GGM_SET_LABEL:
- {
- if( mData1 )
- {
- TextData *tData = (TextData *)window->winGetUserData();
- if (tData && tData->text)
- tData->text->setText( *(UnicodeString*)mData1 );
- }
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_CREATE:
- break;
-
- // ------------------------------------------------------------------------
- case GWM_DESTROY:
- {
- TextData *data = (TextData *)window->winGetUserData();
-
- // free the display string
- TheDisplayStringManager->freeDisplayString( data->text );
-
- // free text data
- delete (TextData *)window->winGetUserData();
- window->winSetUserData( nullptr );
-
- break;
-
- }
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-}
-
-// GadgetStaticTextSetText ====================================================
-/** Set the text for a static text control */
-//=============================================================================
-void GadgetStaticTextSetText( GameWindow *window, UnicodeString text )
-{
- if(!window)
- return;
- TheWindowManager->winSendSystemMsg( window, GGM_SET_LABEL, (WindowMsgData)&text, 0 );
-
-}
-
-UnicodeString GadgetStaticTextGetText( GameWindow *window )
-{
- if(!window)
- return UnicodeString::TheEmptyString;
- TextData *tData = (TextData *)window->winGetUserData();
- if(!tData)
- return UnicodeString::TheEmptyString;
- return tData->text->getText();
-}
-
-// GadgetStaticTextSetFont ====================================================
-/** Set the font for a text control, we need to set the window
- * text font, the tooltip font, and the static text display strings for
- * the text data itself */
-//=============================================================================
-void GadgetStaticTextSetFont( GameWindow *g, GameFont *font )
-{
- TextData *textData = (TextData *)g->winGetUserData();
- DisplayString *dString;
-
- // set the font for the display strings all windows have
- dString = g->winGetInstanceData()->getTextDisplayString();
- if( dString )
- dString->setFont( font );
- dString = g->winGetInstanceData()->getTooltipDisplayString();
- if( dString )
- dString->setFont( font );
-
- // static text specific
- if( textData )
- {
-
- dString = textData->text;
- if( dString )
- dString->setFont( font );
-
- }
-
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTabControl.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTabControl.cpp
deleted file mode 100644
index 8262f771162..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTabControl.cpp
+++ /dev/null
@@ -1,366 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: RadioButton.cpp //////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: \projects\RTS\code\gameengine\Source\GameClient\GUI\Gadget\GadgetTabControl.cpp
-//
-// Created: Graham Smallwood, November 2001
-//
-// Desc: Tab Set GUI control
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "Common/Language.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GadgetTabControl.h"
-
-// DEFINES ////////////////////////////////////////////////////////////////////
-
-// PRIVATE TYPES //////////////////////////////////////////////////////////////
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////
-
-// PUBLIC DATA ////////////////////////////////////////////////////////////////
-
-// PRIVATE PROTOTYPES /////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-
-// GadgetTabControlInput =====================================================
-/** Handle input for TabControl */
-//=============================================================================
-WindowMsgHandledType GadgetTabControlInput( GameWindow *tabControl, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-// WinInstanceData *instData = tabControl->winGetInstanceData();
- TabControlData *tabData = (TabControlData *)tabControl->winGetUserData();
-
- Int tabX, tabY;
- tabControl->winGetScreenPosition( &tabX, &tabY );
- Int mouseX = LOLONGTOSHORT(mData1) - tabX;//mData1 is packedMouseCoords in screen space
- Int mouseY = HILONGTOSHORT(mData1) - tabY;
- Int tabsLeft = tabData->tabsLeftLimit;
- Int tabsRight = tabData->tabsRightLimit;
- Int tabsBottom = tabData->tabsBottomLimit;
- Int tabsTop = tabData->tabsTopLimit;
-
- switch( msg )
- {
- case GWM_LEFT_DOWN:
- {
- if( (mouseX < tabsLeft)
- || (mouseX > tabsRight)
- || (mouseY < tabsTop)
- || (mouseY > tabsBottom)
- )
- {//I eat input on myself that isn't a tab (a button click would mean I don't see the input ever.)
- return MSG_HANDLED;
- }
-
- Int distanceIn;
- Int tabSize;
- if( (tabData->tabEdge == TP_RIGHT_SIDE) || (tabData->tabEdge == TP_LEFT_SIDE) )
- {//scan down to find which button
- distanceIn = mouseY - tabsTop;
- tabSize = tabData->tabHeight;
- }
- else
- {//scan right to find which button
- distanceIn = mouseX - tabsLeft;
- tabSize = tabData->tabWidth;
- }
- Int tabPressed = distanceIn / tabSize;
- if( ! tabData->subPaneDisabled[tabPressed] && (tabPressed != tabData->activeTab) )
- GadgetTabControlShowSubPane( tabControl, tabPressed );
- }
-
- default:
- {
- return MSG_IGNORED;
- }
- }
-
- return MSG_HANDLED;
-
-}
-
-// GadgetTabControlSystem ====================================================
-/** Handle system messages for TabControl */
-//=============================================================================
-WindowMsgHandledType GadgetTabControlSystem( GameWindow *tabControl, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
- // ------------------------------------------------------------------------
- case GWM_CREATE:
- break;
-
- // ------------------------------------------------------------------------
- case GWM_DESTROY:
- {
- // free tab control user data
- delete (TabControlData *)tabControl->winGetUserData();
- tabControl->winSetUserData( nullptr );
-
- break;
-
- }
-
- case GGM_RESIZED:
- {//On resize, we need to upkeep the pane sizes and tabs since they are bound to us
- GadgetTabControlResizeSubPanes( tabControl );
- GadgetTabControlComputeTabRegion( tabControl );
-
- break;
- }
-
- case GBM_SELECTED:
- {//Pass buttons messages up
- GameWindow *parent = tabControl->winGetParent();
-
- if( parent )
- return TheWindowManager->winSendSystemMsg( parent, msg, mData1, mData2 );
-
- break;
- }
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-void GadgetTabControlComputeTabRegion( GameWindow *tabControl )///< Recalc the tab positions based on userData
-{
- Int winWidth, winHeight;
- tabControl->winGetSize( &winWidth, &winHeight );
-
- TabControlData *tabData = (TabControlData *)tabControl->winGetUserData();
-
- Int horzOffset = 0, vertOffset = 0;
- if( (tabData->tabEdge == TP_TOP_SIDE) || (tabData->tabEdge == TP_BOTTOM_SIDE) )
- {
- if( tabData->tabOrientation == TP_CENTER )
- {
- horzOffset = winWidth - ( 2 * tabData->paneBorder ) - ( tabData->tabCount * tabData->tabWidth );
- horzOffset /= 2;
- }
- else if( tabData->tabOrientation == TP_BOTTOMRIGHT )
- {
- horzOffset = winWidth - ( 2 * tabData->paneBorder ) - ( tabData->tabCount * tabData->tabWidth );
- }
- else if( tabData->tabOrientation == TP_TOPLEFT )
- {
- horzOffset = 0;
- }
- }
- else
- {
- if( tabData->tabOrientation == TP_CENTER )
- {
- vertOffset = winHeight - ( 2 * tabData->paneBorder ) - ( tabData->tabCount * tabData->tabHeight );
- vertOffset /= 2;
- }
- else if( tabData->tabOrientation == TP_BOTTOMRIGHT )
- {
- vertOffset = winHeight - ( 2 * tabData->paneBorder ) - ( tabData->tabCount * tabData->tabHeight );
- }
- else if( tabData->tabOrientation == TP_TOPLEFT )
- {
- vertOffset = 0;
- }
- }
-
- if( tabData->tabEdge == TP_TOP_SIDE )
- {
- tabData->tabsTopLimit = tabData->paneBorder;
- tabData->tabsBottomLimit = tabData->paneBorder + tabData->tabHeight;
- tabData->tabsLeftLimit = tabData->paneBorder + horzOffset;
- tabData->tabsRightLimit = tabData->paneBorder + horzOffset + ( tabData->tabWidth * tabData->tabCount );
- }
- else if( tabData->tabEdge == TP_BOTTOM_SIDE )
- {
- tabData->tabsTopLimit = winHeight - tabData->paneBorder - tabData->tabHeight;
- tabData->tabsBottomLimit = winHeight - tabData->paneBorder;
- tabData->tabsLeftLimit = tabData->paneBorder + horzOffset;
- tabData->tabsRightLimit = tabData->paneBorder + horzOffset + ( tabData->tabWidth * tabData->tabCount );
- }
- else if( tabData->tabEdge == TP_RIGHT_SIDE )
- {
- tabData->tabsLeftLimit = winWidth - tabData->paneBorder - tabData->tabWidth;
- tabData->tabsRightLimit = winWidth - tabData->paneBorder;
- tabData->tabsTopLimit = tabData->paneBorder + vertOffset;
- tabData->tabsBottomLimit = tabData->paneBorder + vertOffset + ( tabData->tabHeight * tabData->tabCount );
- }
- else if( tabData->tabEdge == TP_LEFT_SIDE )
- {
- tabData->tabsLeftLimit = tabData->paneBorder;
- tabData->tabsRightLimit = tabData->paneBorder + tabData->tabWidth;
- tabData->tabsTopLimit = tabData->paneBorder + vertOffset;
- tabData->tabsBottomLimit = tabData->paneBorder + vertOffset + ( tabData->tabHeight * tabData->tabCount );
- }
-
-}
-
-void GadgetTabControlComputeSubPaneSize( GameWindow *tabControl, Int *width, Int *height, Int *x, Int *y )
-{
- Int winWidth, winHeight;
- tabControl->winGetSize( &winWidth, &winHeight );
-
- TabControlData *tabData = (TabControlData *)tabControl->winGetUserData();
-
- if( (tabData->tabEdge == TP_TOP_SIDE) || (tabData->tabEdge == TP_BOTTOM_SIDE) )
- *height = winHeight - (2 * tabData->paneBorder) - tabData->tabHeight;
- else
- *height = winHeight - (2 * tabData->paneBorder);
-
- if( (tabData->tabEdge == TP_LEFT_SIDE) || (tabData->tabEdge == TP_RIGHT_SIDE) )
- *width = winWidth - (2 * tabData->paneBorder) - tabData->tabWidth;
- else
- *width = winWidth - (2 * tabData->paneBorder);
-
- if( tabData->tabEdge == TP_LEFT_SIDE )
- *x = tabData->paneBorder + tabData->tabWidth;
- else
- *x = tabData->paneBorder;
-
- if( tabData->tabEdge == TP_TOP_SIDE )
- *y = tabData->paneBorder + tabData->tabHeight;
- else
- *y = tabData->paneBorder;
-}
-
-void GadgetTabControlShowSubPane( GameWindow *tabControl, Int whichPane)
-{
- TabControlData *tabData = (TabControlData *)tabControl->winGetUserData();
-
- for( Int paneIndex = 0; paneIndex < NUM_TAB_PANES; paneIndex++ )
- {
- if( tabData->subPanes[paneIndex] != nullptr )
- tabData->subPanes[paneIndex]->winHide( true );
- }
- if( tabData->subPanes[whichPane] )
- tabData->activeTab = whichPane;
- else
- tabData->activeTab = 0;
-
- tabData->activeTab = min( tabData->activeTab, tabData->tabCount - 1 );
-
- tabData->subPanes[tabData->activeTab]->winHide( false );
-}
-
-void GadgetTabControlCreateSubPanes( GameWindow *tabControl )///< Create User Windows attached to userData as Panes
-{//These two funcs are called after all the Editor set data is updated
- TabControlData *tabData = (TabControlData *)tabControl->winGetUserData();
- Int width, height, x, y;
- GadgetTabControlComputeSubPaneSize(tabControl, &width, &height, &x, &y);
-
- for( Int paneIndex = 0; paneIndex < NUM_TAB_PANES; paneIndex++ )
- {
- if( tabData->subPanes[paneIndex] == nullptr )//This one is blank
- {
- tabData->subPanes[paneIndex] = TheWindowManager->winCreate( tabControl,
- WIN_STATUS_NONE, x, y,
- width, height,
- PassSelectedButtonsToParentSystem,
- nullptr);
- WinInstanceData *instData = tabData->subPanes[paneIndex]->winGetInstanceData();
- BitSet( instData->m_style, GWS_TAB_PANE );
- char buffer[20];
- sprintf( buffer, "Pane %d", paneIndex );
- instData->m_decoratedNameString = buffer;
- //set enabled status to that of Parent
- tabData->subPanes[paneIndex]->winEnable( BitIsSet(tabControl->winGetStatus(), WIN_STATUS_ENABLED) );
- }
- else//this one exists, tabCount will control keeping extra panes perma-hidden
- {
- tabData->subPanes[paneIndex]->winSetSize( width, height );
- tabData->subPanes[paneIndex]->winSetPosition( x, y );
- }
- }
-
- GadgetTabControlShowSubPane( tabControl, tabData->activeTab );
-}
-
-void GadgetTabControlResizeSubPanes( GameWindow *tabControl )
-{
- TabControlData *tabData = (TabControlData *)tabControl->winGetUserData();
- Int width, height, x, y;
- GadgetTabControlComputeSubPaneSize(tabControl, &width, &height, &x, &y);
- for( Int paneIndex = 0; paneIndex < NUM_TAB_PANES; paneIndex++ )
- {
- if( tabData->subPanes[paneIndex] )
- {
- tabData->subPanes[paneIndex]->winSetSize( width, height );
- tabData->subPanes[paneIndex]->winSetPosition( x, y );
- }
- }
-}
-
-///winGetUserData();
- GameWindow *child = tabControl->winGetChild();
- if( child )
- {//need to write down children, and they are reversed from our array
- while( child->winGetNext() != nullptr )
- {
- child = child->winGetNext();
- }
-
- while( child )
- {
- tabData->subPanes[childIndex] = child;
- childIndex++;
- child = child->winGetPrev();
- }
- }
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp
deleted file mode 100644
index 68e53631086..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp
+++ /dev/null
@@ -1,598 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: TextEntry.cpp ////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: TextEntry.cpp
-//
-// Created: Colin Day, June 2001
-//
-// Desc: Text entry GUI gadget
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "Common/Language.h"
-#include "GameClient/DisplayStringManager.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/IMEManager.h"
-
-// DEFINES ////////////////////////////////////////////////////////////////////
-
-// PRIVATE TYPES //////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-// PRIVATE DATA ///////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-static Byte drawCnt = 0;
-// static TbIME *ourIME = nullptr; ///< @todo need this for IME kanji support
-static GameWindow *curWindow = nullptr; /**< so we can keep track of the input
- window when using IME */
-
-// PUBLIC DATA ////////////////////////////////////////////////////////////////
-
-// PRIVATE PROTOTYPES /////////////////////////////////////////////////////////
-
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-// GadgetTextEntryInput =======================================================
-/** Handle input for text entry field */
-//=============================================================================
-WindowMsgHandledType GadgetTextEntryInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- EntryData *e = (EntryData *)window->winGetUserData();
- WinInstanceData *instData = window->winGetInstanceData();
-
- if ( TheIMEManager && TheIMEManager->isAttachedTo( window) && TheIMEManager->isComposing())
- {
- // ignore input while IME has focus
- return MSG_HANDLED;
- }
-
- switch( msg )
- {
- // ------------------------------------------------------------------------
- case GWM_IME_CHAR:
- {
- WideChar ch = (WideChar) mData1;
-
- // --------------------------------------------------------------------
- if ( ch == VK_RETURN )
- {
- // Done with this edit
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_EDIT_DONE,
- (WindowMsgData)window,
- 0 );
- return MSG_HANDLED;
- };
-
- if( ch )
- {
- // Constrain keys based on rules for entry box.
- if( e->numericalOnly )
- {
- if( TheWindowManager->winIsDigit( ch ) == 0 )
- return MSG_HANDLED;
- }
- if( e->alphaNumericalOnly )
- {
- if( TheWindowManager->winIsAlNum( ch ) == 0 )
- return MSG_HANDLED;
- }
- if ( e->aSCIIOnly )
- {
- if ( TheWindowManager->winIsAscii( ch ) == 0 )
- {
- return MSG_HANDLED;
- }
- }
-
- if( e->charPos < e->maxTextLen-1 )
- {
- e->text->appendChar( ch );
- e->sText->appendChar( L'*' );
- e->charPos++;
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
- }
- }
- break;
- }
- // ------------------------------------------------------------------------
- case GWM_CHAR:
- if ( BitIsSet( mData2, KEY_STATE_DOWN ) && BitIsSet( mData2, KEY_STATE_ALT | KEY_STATE_CONTROL ) )
- {
- return MSG_IGNORED; // text extries shouldn't care about CTRL+* or ALT+*
- }
-
- switch( mData1 )
- {
- /*
- // --------------------------------------------------------------------
- case KEY_KPENTER:
- case KEY_ENTER:
- // Done with this edit
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
- if( e->receivedUnichar == FALSE )
- {
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_EDIT_DONE,
- (WindowMsgData)window,
- 0 );
- }
- }
-
- break;
- */
- // --------------------------------------------------------------------
- // Don't process these keys
- case KEY_ESC:
- case KEY_PGUP:
- case KEY_PGDN:
- case KEY_HOME:
- case KEY_END:
- case KEY_F1:
- case KEY_F2:
- case KEY_F3:
- case KEY_F4:
- case KEY_F5:
- case KEY_F6:
- case KEY_F7:
- case KEY_F8:
- case KEY_F9:
- case KEY_F10:
- case KEY_F11:
- case KEY_F12:
- case KEY_CAPS:
- case KEY_DEL:
- return MSG_IGNORED;
-
- // --------------------------------------------------------------------
- case KEY_DOWN:
- case KEY_RIGHT:
- case KEY_TAB:
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
- GameWindow *parent;
- parent = window->winGetParent();
- if(parent && !BitIsSet(parent->winGetStyle(), GWS_COMBO_BOX))
- parent = nullptr;
- if(parent)
- TheWindowManager->winNextTab(parent);
- else
- TheWindowManager->winNextTab(window);
- }
-
- break;
-
- // --------------------------------------------------------------------
- case KEY_UP:
- case KEY_LEFT:
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
- GameWindow *parent;
- parent = window->winGetParent();
- if(parent && !BitIsSet(parent->winGetStyle(), GWS_COMBO_BOX))
- parent = nullptr;
- if(parent)
- TheWindowManager->winPrevTab(parent);
- else
- TheWindowManager->winPrevTab(window);
- }
- break;
-
- // --------------------------------------------------------------------
- case KEY_BACKSPACE:
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
- // if conCharPos != 0 this will fall through to next case.
- // it should be noted that conCharPos can only != 0 in Jap & Kor
- if( e->conCharPos == 0 )
- {
- if( e->charPos > 0 )
- {
-
- e->text->removeLastChar();
- e->sText->removeLastChar();
- e->charPos--;
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
- }
- }
- }
- break;
-
- }
-
- break;
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DOWN:
- BitSet( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSetFocus( window );
- break;
-
- // ------------------------------------------------------------------------
- case GWM_MOUSE_ENTERING:
-
- if (BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- {
-
- BitSet( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_MOUSE_ENTERING,
- (WindowMsgData)window, 0 );
- //TheWindowManager->winSetFocus( window );
- }
-
- break;
-
- // ------------------------------------------------------------------------
- case GWM_MOUSE_LEAVING:
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- {
-
- BitClear( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_MOUSE_LEAVING,
- (WindowMsgData)window, 0 );
- }
- break;
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DRAG:
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GGM_LEFT_DRAG,
- (WindowMsgData)window, 0 );
- break;
-
- // ------------------------------------------------------------------------
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-// GadgetTextEntrySystem ======================================================
-/** Handle system messages for entry field */
-//=============================================================================
-WindowMsgHandledType GadgetTextEntrySystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- EntryData *e = (EntryData *)window->winGetUserData();
- WinInstanceData *instData = window->winGetInstanceData();
-
- switch( msg )
- {
-
- // ------------------------------------------------------------------------
- case GEM_GET_TEXT:
- *(UnicodeString*)mData2 = e->text->getText();
- break;
-
- // ------------------------------------------------------------------------
- case GEM_SET_TEXT:
- {
-
- const UnicodeString* ustr = (const UnicodeString*)mData1;
- e->text->setText( *ustr );
- e->charPos = ustr->getLength();
- e->constructText->setText( UnicodeString::TheEmptyString );
- e->conCharPos = 0;
-
- // set our secret text string to be filled with '*' the same length
- e->sText->setText( UnicodeString::TheEmptyString );
- Int len = ustr->getLength();
- for( Int i = 0; i < len; i++ )
- e->sText->appendChar( L'*' );
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_CREATE:
-
- break;
-
- // ------------------------------------------------------------------------
- case GWM_DESTROY:
-
- // delete the edit display string
- TheDisplayStringManager->freeDisplayString( e->text );
- TheDisplayStringManager->freeDisplayString( e->sText );
- TheDisplayStringManager->freeDisplayString( e->constructText );
-
- // delete construct list
- if( e->constructList )
- TheWindowManager->winDestroy( e->constructList );
-
- // free all edit data
- delete( (EntryData *)window->winGetUserData() );
- window->winSetUserData(nullptr);
- e = nullptr;
- break;
-
- // ------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
- if( mData1 == FALSE )
- {
- // If we're losing focus
- /// @todo need to enable this for IME support
- // ourIME->UnActivate();
- curWindow = nullptr;
- BitClear( instData->m_state, WIN_STATE_SELECTED );
- BitClear( instData->m_state, WIN_STATE_HILITED );
-
- if( e->constructList )
- e->constructList->winHide( TRUE );
- e->constructText->setText( UnicodeString::TheEmptyString );
- e->conCharPos = 0;
- if(TheIMEManager && TheIMEManager->isAttachedTo(window))
- TheIMEManager->attach(nullptr);
- //TheIMEManager->detach();
- }
- else
- {
- curWindow = window;
- /// @todo need to enable this for IME support
- if (TheIMEManager)
- TheIMEManager->attach( window );
- // ourIME->Activate( (void *)ApplicationHWnd );
- BitSet( instData->m_state, WIN_STATE_SELECTED );
- BitSet( instData->m_state, WIN_STATE_HILITED );
- }
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GGM_FOCUS_CHANGE,
- mData1,
- window->winGetWindowId() );
-
- *(Bool*)mData2 = TRUE;
- break;
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-/** @todo we might want to do something like this if we use IME for language
- * support in this product */
-/*
-// used to create interface to IME
-BoolCode InitializeEntryGadget()
-{
- ourIME = NEW TbIME;
-
- ourIME->Composition_SetMaxLength( 11 );
-
- return TRUE;
-}
-
-// used to destroy interface to IME
-BoolCode ShutdownEntryGadget()
-{
- delete ourIME;
- ourIME = nullptr;
-
- return TRUE;
-}
-
-void InformEntry( WideChar c )
-{
- Int i, listCount = 0;
- EntryData *e;
-
- if( ourIME == nullptr || curWindow == nullptr )
- return;
-
- e = (EntryData *)curWindow->winGetUserData();
-
- if( ( (OurLanguage == LANGUAGE_ID_JAPANESE) ||
- (OurLanguage == LANGUAGE_ID_KOREAN) ) &&
- ( (e->aSCIIOnly == FALSE ) &&
- (e->alphaNumericalOnly == FALSE ) &&
- (e->numericalOnly == FALSE ) ) )
- {
- e->receivedUnichar = TRUE;
-
- // we must eat the following keys
- switch( c )
- {
- case L'\a':
- case L'\b':
- case L'\f':
- case L'\t':
- case L'\v':
- return;
-
- // we must completely ignore the return key
- case L'\r':
- case L'\n':
- e->receivedUnichar = FALSE;
- return;
- }
-
- if( e->charPos < e->maxTextLen-1 )
- {
- e->text[ e->charPos++ ] = c;
- e->text[ e->charPos ] = 0;
- }
-
- // always update the construction buffer after a key has come through here.
- TheWindowManager->winStrcpy( e->constructText, (WideChar *)ourIME->Composition_Get() );
- e->conCharPos = NoxStrlen( e->constructText );
-
- // we might need to update our listbox
- listCount = ourIME->CandidateList_GetSize();
-
- if( TRUE ) //listCount == 0)
- {
- // if no entries just hide it and leave
- if( e->constructList )
- e->constructList->winHide( TRUE );
- }
- else
- {
- Int maxWidth = 0;
- ListboxData list = nullptr;
- ICoord2D constructSize, sliderSize;
-
- WinHide( e->constructList, FALSE );
- list = (ListBoxData)e->constructList->winGetUserData();
-
- e->constructList->winGetSize( &constructSize.x, &constructSize.y );
- list->slider->winGetSize( &sliderSize.x, &sliderSize.y );
-
- TheWindowManager->winSendSystemMsg( e->constructList, GLM_DEL_ALL, 0, 0 );
-
- for( i=0; iCandidateList_GetItem( i );
-
- TheWindowManager->winGetTextSize( e->constructList->instData.font,
- text, nullptr, &tempWidth, 0 );
-
- if( tempWidth > maxWidth )
- maxWidth = tempWidth;
-
- UnicodeString tmp(text);
- TheWindowManager->winSendSystemMsg( e->constructList, GLM_ADD_ENTRY,
- (WindowMsgData)&tmp, -1 );
- }
-
- e->constructList->winSetSize( maxWidth + sliderSize.y,
- constructSize.y );
- }
- }
-}
-*/
-
-// GadgetTextEntrySetFont =====================================================
-/** Set the font for a text entry control, we need to set the window
- * text font, the tooltip font, and the edit text display strings for
- * the text data itself and the secret text */
-//=============================================================================
-void GadgetTextEntrySetFont( GameWindow *g, GameFont *font )
-{
- EntryData *entryData = (EntryData *)g->winGetUserData();
- DisplayString *dString;
-
- // set the font for the display strings all windows have
- dString = g->winGetInstanceData()->getTextDisplayString();
- if( dString )
- dString->setFont( font );
- dString = g->winGetInstanceData()->getTooltipDisplayString();
- if( dString )
- dString->setFont( font );
-
- // text entry specific
- if( entryData )
- {
-
- dString = entryData->text;
- if( dString )
- dString->setFont( font );
- dString = entryData->sText;
- if( dString )
- dString->setFont( font );
-
- }
-
-}
-
-// GadgetTextEntryGetText =======================================================
-/** Get the text for a Text entry */
-//=============================================================================
-UnicodeString GadgetTextEntryGetText( GameWindow *textentry )
-{
-
- // sanity
- if( textentry == nullptr )
- return UnicodeString::TheEmptyString;
-
- // verify that this is a list box
- if( BitIsSet( textentry->winGetStyle(), GWS_ENTRY_FIELD ) == FALSE )
- return UnicodeString::TheEmptyString;
-
- UnicodeString result;
- TheWindowManager->winSendSystemMsg( textentry, GEM_GET_TEXT, 0, (WindowMsgData)&result );
- return result;
-
-}
-
-//=============================================================================
-void GadgetTextEntrySetMaxLen( GameWindow *g, Short length )
-{
- if( g == nullptr )
- return;
-
- EntryData *data = static_cast( g->winGetUserData() );
-
- if( length > ENTRY_TEXT_LEN )
- length = ENTRY_TEXT_LEN;
-
- data->maxTextLen = length;
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp
deleted file mode 100644
index 0d622ad8900..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp
+++ /dev/null
@@ -1,470 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: VerticalSlider.cpp ///////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Westwood Studios Pacific.
-//
-// Confidential Information
-// Copyright (C) 2001 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// Project: RTS3
-//
-// File name: VerticalSlider.cpp
-//
-// Created: Colin Day, June 2001
-//
-// Desc: Vertical slider gui control
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-// USER INCLUDES //////////////////////////////////////////////////////////////
-#include "Common/Language.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/Gadget.h"
-
-// DEFINES ////////////////////////////////////////////////////////////////////
-
-// PRIVATE TYPES //////////////////////////////////////////////////////////////
-
-// PRIVATE DATA ///////////////////////////////////////////////////////////////
-
-// PUBLIC DATA ////////////////////////////////////////////////////////////////
-
-// PRIVATE PROTOTYPES /////////////////////////////////////////////////////////
-
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-// GadgetVerticalSliderInput ==================================================
-/** Handle input for vertical slider */
-//=============================================================================
-WindowMsgHandledType GadgetVerticalSliderInput( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- SliderData *s = (SliderData *)window->winGetUserData();
- WinInstanceData *instData = window->winGetInstanceData();
-
- switch( msg )
- {
-
- // ------------------------------------------------------------------------
- case GWM_MOUSE_ENTERING:
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- {
-
- BitSet( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_MOUSE_ENTERING,
- (WindowMsgData)window,
- 0 );
- //TheWindowManager->winSetFocus( window );
-
- }
- break;
-
- // ------------------------------------------------------------------------
- case GWM_MOUSE_LEAVING:
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- {
-
- BitClear( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GBM_MOUSE_LEAVING,
- (WindowMsgData)window,
- 0 );
- }
- break;
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DRAG:
-
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GGM_LEFT_DRAG,
- (WindowMsgData)window,
- mData1 );
- break;
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DOWN:
- break;
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_UP:
- {
- Int x, y;
-// Int mousex = mData1 & 0xFFFF;
- Int mousey = mData1 >> 16;
- ICoord2D size, childSize, childCenter;
- GameWindow *child = window->winGetChild();
- Int pageClickSize, clickPos;
-
- window->winGetScreenPosition( &x, &y );
- window->winGetSize( &size.x, &size.y );
- child->winGetSize( &childSize.x, &childSize.y );
- child->winGetPosition( &childCenter.x, &childCenter.y );
- childCenter.x += childSize.x / 2;
- childCenter.y += childSize.y / 2;
-
- //
- // when you click on the slider, but not the button, we will jump
- // the slider position up/down by this much
- //
- pageClickSize = size.y / 5;
-
- clickPos = mousey - y;
- if( clickPos >= childCenter.y )
- {
-
- clickPos = childCenter.y + pageClickSize;
- if( clickPos > mousey - y )
- clickPos = mousey - y;
-
- }
- else
- {
-
- clickPos = childCenter.y - pageClickSize;
- if( clickPos < mousey - y )
- clickPos = mousey - y;
-
- }
-
- // keep pos valid on window
- if( clickPos > y + size.y - childSize.y / 2 )
- clickPos = y + size.y - childSize.y / 2;
- if( clickPos < childSize.y / 2 )
- clickPos = childSize.y / 2;
-
- child->winSetPosition( 0, clickPos - childSize.y / 2 );
- TheWindowManager->winSendSystemMsg( window, GGM_LEFT_DRAG, 0, mData1 );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_CHAR:
- {
-
- switch (mData1)
- {
-
- // --------------------------------------------------------------------
- case KEY_UP:
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
-
- if( s->position < s->maxVal - 1)
- {
- GameWindow *child = window->winGetChild();
-
- s->position += 2;
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GSM_SLIDER_TRACK,
- (WindowMsgData)window,
- s->position );
- // Translate to window coords
- child->winSetPosition( 0, (Int)((s->maxVal - s->position) * s->numTicks) );
-
- }
-
- }
-
- break;
-
- // --------------------------------------------------------------------
- case KEY_DOWN:
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- {
-
- if( s->position > s->minVal + 1 )
- {
- GameWindow *child = window->winGetChild();
-
- s->position -= 2;
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GSM_SLIDER_TRACK,
- (WindowMsgData)window,
- s->position );
- // Translate to window coords
- child->winSetPosition( 0, (Int)((s->maxVal - s->position) * s->numTicks) );
- }
- }
- break;
-
- // --------------------------------------------------------------------
- case KEY_RIGHT:
- case KEY_TAB:
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- window->winNextTab();
- break;
-
- // --------------------------------------------------------------------
- case KEY_LEFT:
-
- if( BitIsSet( mData2, KEY_STATE_DOWN ) )
- window->winPrevTab();
- break;
-
- default:
- return MSG_IGNORED;
-
- }
-
- break;
-
- }
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
-// GadgetVerticalSliderSystem =================================================
-/** Handle system messages for vertical slider */
-//=============================================================================
-WindowMsgHandledType GadgetVerticalSliderSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- SliderData *s = (SliderData *)window->winGetUserData();
- WinInstanceData *instData = window->winGetInstanceData();
-
- switch( msg )
- {
-
- // ------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- // tell owner I've finished moving
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GSM_SLIDER_DONE,
- (WindowMsgData)window,
- s->position );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GGM_LEFT_DRAG:
- {
-// Int mousex = mData2 & 0xFFFF;
- Int mousey = mData2 >> 16;
- Int x, y, delta;
- ICoord2D size, childSize, childCenter;
- GameWindow *child = window->winGetChild();
-
- window->winGetScreenPosition( &x, &y );
- window->winGetSize( &size.x, &size.y );
- child->winGetSize( &childSize.x, &childSize.y );
- child->winGetScreenPosition( &childCenter.x, &childCenter.y );
- childCenter.x += childSize.x / 2;
- childCenter.y += childSize.y / 2;
-
- //
- // ignore drag attempts when the mouse is below or above the slider totally
- // and put the dragging thumb back at the slider pos
- //
- if( mousey > y + size.y )
- {
-
- //s->position = s->minVal;
- TheWindowManager->winSendSystemMsg( window, GSM_SET_SLIDER,
- s->minVal, 0 );
- // tell owner i moved
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GSM_SLIDER_TRACK,
- (WindowMsgData)window,
- s->position );
- break;
-
- }
- else if( mousey < y )
- {
-
- //s->position = s->maxVal;
- TheWindowManager->winSendSystemMsg( window, GSM_SET_SLIDER,
- s->maxVal, 0 );
- // tell owner i moved
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GSM_SLIDER_TRACK,
- (WindowMsgData)window,
- s->position );
- break;
-
- }
-
- if( childCenter.y <= y + childSize.y / 2 )
- {
- child->winSetPosition( 0, 0 );
- s->position = s->maxVal;
- }
- else if( childCenter.y >= y + size.y - childSize.y / 2 )
- {
- child->winSetPosition( 0, size.y - childSize.y );
- s->position = s->minVal;
- }
- else
- {
- delta = childCenter.y - y - childSize.y/2;
-
- // Calc slider position
- s->position = (Int)(delta / s->numTicks) ;
-
- /*
- s->position += s->minVal;
- */
-
- if( s->position > s->maxVal )
- s->position = s->maxVal;
-
- // Invert slider position so that maxval is at the top
- s->position = s->maxVal - s->position;
-
- }
-
- // tell owner i moved
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GSM_SLIDER_TRACK,
- (WindowMsgData)window,
- s->position );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GSM_SET_SLIDER:
- {
- Int newPos = (Int)mData1;
- GameWindow *child = window->winGetChild();
-
- // TheSuperHackers @fix No longer reject out of bounds positions to prevent
- // reset of custom option.ini settings to 0.
-
- s->position = newPos;
-
- // Translate to window coords
- newPos = (Int)((s->maxVal - newPos) * s->numTicks);
- newPos = clamp(0, newPos, (Int)((s->maxVal - s->minVal) * s->numTicks));
-
- child->winSetPosition( 0, newPos );
-
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GSM_SET_MIN_MAX:
- {
- Int newPos;
- ICoord2D size;
- GameWindow *child = window->winGetChild();
-
- window->winGetSize( &size.x, &size.y );
-
- s->minVal = (Int)mData1;
- s->maxVal = (Int)mData2;
- s->numTicks = (Real)( size.y-GADGET_SIZE)/(Real)(s->maxVal - s->minVal);
- s->position = s->minVal;
-
- // Translate to window coords
- newPos = (Int)((s->maxVal - s->minVal) * s->numTicks);
-
- child->winSetPosition( 0, newPos );
- break;
-
- }
-
- // ------------------------------------------------------------------------
- case GWM_CREATE:
- break;
-
- // ------------------------------------------------------------------------
- case GWM_DESTROY:
- delete( (SliderData *)window->winGetUserData() );
- window->winSetUserData(nullptr);
- s = nullptr;
- break;
-
- // ------------------------------------------------------------------------
- case GWM_INPUT_FOCUS:
-
- // If we're losing focus
- if( mData1 == FALSE )
- {
- BitClear( instData->m_state, WIN_STATE_HILITED );
- } else {
- BitSet( instData->m_state, WIN_STATE_HILITED );
- }
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GGM_FOCUS_CHANGE,
- mData1,
- window->winGetWindowId() );
-
- *(Bool*)mData2 = TRUE;
- break;
-
- // ------------------------------------------------------------------------
- case GGM_RESIZED:
- {
- Int width = (Int)mData1;
-// Int height = (Int)mData2;
- GameWindow *thumb = window->winGetChild();
-
- if( thumb )
- thumb->winSetSize( width, GADGET_SIZE );
-
- break;
-
- }
-
- default:
- return MSG_IGNORED;
-
- }
-
- return MSG_HANDLED;
-
-}
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp
deleted file mode 100644
index d3d2afadcdc..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/GameWindowManager.cpp
+++ /dev/null
@@ -1,4064 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: GameWindowManager.cpp ////////////////////////////////////////////////////////////////////
-// Created: Colin Day, June 2001
-// Dean Iverson, March 1998 (Original window code)
-// Desc: The game window manager is the singleton class that we interface
-// with to interact with the game windowing system.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/Debug.h"
-#include "Common/Language.h"
-#include "GameClient/Display.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/Mouse.h"
-#include "GameClient/DisplayStringManager.h"
-#include "GameClient/WindowLayout.h"
-#include "GameClient/Gadget.h"
-#include "GameClient/GameWindowGlobal.h"
-#include "GameClient/GadgetListBox.h"
-#include "GameClient/GadgetComboBox.h"
-#include "GameClient/GadgetTabControl.h"
-#include "GameClient/GadgetProgressBar.h"
-#include "GameClient/GadgetStaticText.h"
-#include "GameClient/GadgetTextEntry.h"
-#include "GameClient/GadgetSlider.h"
-#include "GameClient/GadgetRadioButton.h"
-#include "GameClient/GadgetCheckBox.h"
-#include "GameClient/GlobalLanguage.h"
-#include "GameClient/GameWindowTransitions.h"
-#include "Common/NameKeyGenerator.h"
-
-// PUBLIC DATA ////////////////////////////////////////////////////////////////////////////////////
-GameWindowManager *TheWindowManager = nullptr;
-UnsignedInt WindowLayoutCurrentVersion = 2;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-//
-// with this status set to true, the window system will propagate mouse position
-// messages to windows. You may want to disable this if you feel the mouse position
-// messages are "spamming" your window and making a particular debugging situation
-// difficult. Make sure you do enable this before you check in again tho because
-// it is necessary for any code that needs to look at objects or anything under
-// the radar cursor
-//
-static Bool sendMousePosMessages = TRUE;
-
-//-------------------------------------------------------------------------------------------------
-/** Process windows waiting to be destroyed */
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::processDestroyList()
-{
- GameWindow *next;
- GameWindow *doDestroy;
-
- //
- // we need to pass the ownership of the destroy list so
- // if, while destroying a window, we need to add other windows
- // to the destroy list it won't cause problems.
- //
- doDestroy = m_destroyList;
-
- // set the list to empty
- m_destroyList = nullptr;
-
- // do the destroys
- for( ; doDestroy; doDestroy = next )
- {
-
- next = doDestroy->m_next;
-
- // Check to see if this window is "special"
- if( m_mouseCaptor == doDestroy )
- winRelease( doDestroy );
-
- if( m_keyboardFocus == doDestroy )
- winSetFocus( nullptr );
-
- if( (m_modalHead != nullptr) && (doDestroy == m_modalHead->window) )
- winUnsetModal( m_modalHead->window );
-
- if( m_currMouseRgn == doDestroy )
- m_currMouseRgn = nullptr;
-
- if( m_grabWindow == doDestroy )
- m_grabWindow = nullptr;
-
- // send the destroy message to the window we're about to kill
- winSendSystemMsg( doDestroy, GWM_DESTROY, 0, 0 );
-
- DEBUG_ASSERTCRASH(doDestroy->winGetUserData() == nullptr, ("Win user data is expected to be deleted now"));
-
- // free the memory
- deleteInstance(doDestroy);
-
- }
-
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-//-------------------------------------------------------------------------------------------------
-/** Generic function to simply propagate only button press messages to parent and let it deal with it */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType PassSelectedButtonsToParentSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- // sanity
- if( window == nullptr )
- return MSG_IGNORED;
-
- if( (msg == GBM_SELECTED) || (msg == GBM_SELECTED_RIGHT) || (msg == GBM_MOUSE_ENTERING) || (msg == GBM_MOUSE_LEAVING) || (msg == GEM_EDIT_DONE))
- {
- GameWindow *parent = window->winGetParent();
-
- if( parent )
- return TheWindowManager->winSendSystemMsg( parent, msg, mData1, mData2 );
-
- }
-
- return MSG_IGNORED;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Generic function to simply propagate only button press messages to parent and let it deal with it */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType PassMessagesToParentSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- // sanity
- if( window == nullptr )
- return MSG_IGNORED;
-
-
- GameWindow *parent = window->winGetParent();
-
- if( parent )
- return TheWindowManager->winSendSystemMsg( parent, msg, mData1, mData2 );
-
- return MSG_IGNORED;
-
-}
-
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-GameWindowManager::GameWindowManager()
-{
-
- m_windowList = nullptr; // list of all top level windows
- m_windowTail = nullptr; // last in windowList
-
- m_destroyList = nullptr; // list of windows to destroy
-
- m_currMouseRgn = nullptr; // window that mouse is over
- m_mouseCaptor = nullptr; // window that captured mouse
- m_keyboardFocus = nullptr; // window that has input focus
- m_modalHead = nullptr; // top of windows in the modal stack
- m_grabWindow = nullptr; // window that grabbed the last down event
- m_loneWindow = nullptr; // Set if we just opened a combo box
-
- m_cursorBitmap = nullptr;
- m_captureFlags = 0;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-GameWindowManager::~GameWindowManager()
-{
-
- // destroy all windows
- winDestroyAll();
- freeStaticStrings();
-
- delete TheTransitionHandler;
- TheTransitionHandler = nullptr;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Initialize the game window manager system */
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::init()
-{
- if(!TheTransitionHandler)
- TheTransitionHandler = NEW GameWindowTransitionsHandler;
- TheTransitionHandler->load();
- TheTransitionHandler->init();
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Reset window system */
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::reset()
-{
-
- // destroy all windows left
- winDestroyAll();
- if(TheTransitionHandler)
- TheTransitionHandler->reset();
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Update cycle for game window manager */
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::update()
-{
-
- // Process windows waiting to be destroyed
- processDestroyList();
- if(TheTransitionHandler)
- TheTransitionHandler->update();
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Puts a window at the head of the window list */
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::linkWindow( GameWindow *window )
-{
- GameWindow *lastModalWindow = nullptr;
- GameWindow *tmp = m_windowList;
- while (tmp)
- {
- const ModalWindow *modal = m_modalHead;
- while (modal)
- {
- if (modal->window == tmp && modal->window != window)
- {
- lastModalWindow = tmp;
- }
- modal = modal->next;
- }
- tmp = tmp->m_next;
- }
-
- if (!lastModalWindow)
- {
-
- // Add to head of the top level window list
- window->m_prev = nullptr;
- window->m_next = m_windowList;
-
- if( m_windowList )
- m_windowList->m_prev = window;
- else
- {
- // first on list is also the tail
- m_windowTail = window;
- }
-
- m_windowList = window;
- }
- else
- {
- // lastModalWindow points to a modal window - add behind it
- window->m_prev = lastModalWindow;
- window->m_next = lastModalWindow->m_next;
- lastModalWindow->m_next = window;
- if (window->m_next)
- {
- window->m_next->m_prev = window;
- }
- }
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Insert the window ahead of the the 'aheadOf' window. 'aheadOf' can
- * be a window in the master list or a child of any window in that master
- * list */
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::insertWindowAheadOf( GameWindow *window,
- GameWindow *aheadOf )
-{
-
- // sanity
- if( window == nullptr )
- return;
-
- // we'll say that an aheadOf window means at the head of the list
- if( aheadOf == nullptr )
- {
-
- linkWindow( window );
- return;
-
- }
-
- // get parent of aheadOf
- GameWindow *aheadOfParent = aheadOf->winGetParent();
-
- //
- // if ahead of has no parent insert it in the master list just before
- // ahead of
- //
- if( aheadOfParent == nullptr )
- {
-
- window->m_prev = aheadOf->m_prev;
-
- if( aheadOf->m_prev )
- aheadOf->m_prev->m_next = window;
- else
- m_windowList = window;
-
- aheadOf->m_prev = window;
- window->m_next = aheadOf;
-
- }
- else
- {
-
- window->m_prev = aheadOf->m_prev;
-
- if( aheadOf->m_prev )
- aheadOf->m_prev->m_next = window;
- else
- aheadOfParent->m_child = window;
-
- aheadOf->m_prev = window;
- window->m_next = aheadOf;
-
- window->m_parent = aheadOfParent;
-
- }
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Takes a window off the window list */
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::unlinkWindow( GameWindow *window )
-{
-
- if( window->m_next )
- window->m_next->m_prev = window->m_prev;
- else
- {
- // no next means this is the tail
- m_windowTail = window->m_prev;
- }
-
- if( window->m_prev )
- window->m_prev->m_next = window->m_next;
- else
- m_windowList = window->m_next;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Takes a child window off its parent's window list */
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::unlinkChildWindow( GameWindow *window )
-{
-
- if( window->m_prev )
- {
-
- window->m_prev->m_next = window->m_next;
-
- if( window->m_next )
- window->m_next->m_prev = window->m_prev;
-
- }
- else
- {
-
- if( window->m_next )
- {
-
- window->m_parent->m_child = window->m_next;
-
- window->m_next->m_prev = window->m_prev;
-
- window->m_next = nullptr;
-
- }
- else
- {
-
- window->m_parent->m_child = nullptr;
-
- }
-
- }
-
- // remove the parent reference from this window
- window->m_parent = nullptr;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Check window and parents to see if this window is enabled */
-//-------------------------------------------------------------------------------------------------
-Bool GameWindowManager::isEnabled( GameWindow *win )
-{
-
- // sanity
- if( win == nullptr )
- return FALSE;
-
- if( BitIsSet( win->m_status, WIN_STATUS_ENABLED ) == FALSE )
- {
- return FALSE;
- }
-
- while( win->m_parent )
- {
- win = win->m_parent;
- if( BitIsSet( win->m_status, WIN_STATUS_ENABLED ) == FALSE )
- {
- return FALSE;
- }
- }
-
- return TRUE;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Check window and parents to see if this window is hidden */
-//-------------------------------------------------------------------------------------------------
-Bool GameWindowManager::isHidden( GameWindow *win )
-{
-
- // we'll allow for the idea that if a window doesn't exist it is hidden
- if( win == nullptr )
- return TRUE;
-
- if( BitIsSet( win->m_status, WIN_STATUS_HIDDEN ))
- {
- return TRUE;
- }
-
- while( win->m_parent )
- {
- win = win->m_parent;
- if( BitIsSet( win->m_status, WIN_STATUS_HIDDEN ))
- {
- return TRUE;
- }
- }
-
- return FALSE;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-// Adds a child window to its parent.
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::addWindowToParent( GameWindow *window,
- GameWindow *parent )
-{
- if( parent )
- {
-
- // add to parent's list of children
- window->m_prev = nullptr;
- window->m_next = parent->m_child;
-
- if( parent->m_child )
- parent->m_child->m_prev = window;
-
- parent->m_child = window;
-
- window->m_parent = parent;
-
- }
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Add a child window to the parent, put place it at the end of the
- * parent window child list */
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::addWindowToParentAtEnd( GameWindow *window,
- GameWindow *parent )
-{
-
- if( parent )
- {
-
- window->m_prev = nullptr;
- window->m_next = nullptr;
- if( parent->m_child )
- {
- GameWindow *last;
-
- // wind down to last child in list
- last = parent->m_child;
- while( last->m_next != nullptr )
- last = last->m_next;
-
- // tie to list
- last->m_next = window;
- window->m_prev = last;
-
- }
- else
- parent->m_child = window;
-
- // assign the parent to the window
- window->m_parent = parent;
-
- }
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** this gets called from winHide() when a window hides itself */
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::windowHiding( GameWindow *window )
-{
-
- // if this window has keyboard focus remove it
- if( m_keyboardFocus == window )
- m_keyboardFocus = nullptr;
-
- // if this is the modal head, unset it
- if( m_modalHead && m_modalHead->window == window )
- winUnsetModal( window );
-
- // if this is the captor, it shall no longer be
- if( m_mouseCaptor == window )
- winCapture( nullptr );
-
- //
- // since hiding a parent will also hide the children, when a parent
- // hides we must call this same method for all the children so they
- // each have a chance to go through this logic
- //
- GameWindow *child;
- for( child = window->winGetChild(); child; child = child->winGetNext() )
- windowHiding( child );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Hide all windows in a certain range of id's (inclusive) */
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::hideWindowsInRange( GameWindow *baseWindow,
- Int first, Int last,
- Bool hideFlag )
-{
- Int i;
- GameWindow *window;
-
- for( i = first; i <= last; i++ )
- {
-
- window = winGetWindowFromId( baseWindow, i );
- if( window )
- window->winHide( hideFlag );
-
- }
-
-}
-
-//-------------------------------------------------------------------------------------------------
-// Enable all windows in a certain range of id's (inclusive)
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::enableWindowsInRange( GameWindow *baseWindow,
- Int first, Int last,
- Bool enableFlag )
-{
- Int i;
- GameWindow *window;
-
- for( i =first; i <= last; i++ )
- {
-
- window = winGetWindowFromId( baseWindow, i );
- if( window )
- window->winEnable( enableFlag );
-
- }
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Captures the mouse capture. */
-//-------------------------------------------------------------------------------------------------
-Int GameWindowManager::winCapture( GameWindow *window )
-{
-
- if( m_mouseCaptor != nullptr)
- return WIN_ERR_MOUSE_CAPTURED;
-
- m_mouseCaptor = window;
-
- return WIN_ERR_OK;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Releases the mouse capture. */
-//-------------------------------------------------------------------------------------------------
-Int GameWindowManager::winRelease( GameWindow *window )
-{
-
- if( window == m_mouseCaptor )
- m_mouseCaptor = nullptr;
-
- return WIN_ERR_OK;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Returns the current mouse captor. */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::winGetCapture()
-{
-
- return m_mouseCaptor;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Gets the window pointer from its id */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::winGetWindowFromId( GameWindow *window, Int id )
-{
-
- if( window == nullptr )
- window = m_windowList;
-
- for( ; window; window = window->m_next )
- {
-
- if( window->winGetWindowId() == id)
- return window;
- else if( window->m_child )
- {
- GameWindow *child = winGetWindowFromId( window->m_child, id );
-
- if( child )
- return child;
-
- }
-
- }
-
- return nullptr;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Gets the Window List Pointer */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::winGetWindowList()
-{
-
- return m_windowList;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Send a system message to the specified window */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType GameWindowManager::winSendSystemMsg( GameWindow *window,
- UnsignedInt msg,
- WindowMsgData mData1,
- WindowMsgData mData2 )
-{
-
- if( window == nullptr)
- return MSG_IGNORED;
-
- if( msg != GWM_DESTROY && BitIsSet( window->m_status, WIN_STATUS_DESTROYED ) )
- return MSG_IGNORED;
-
- return window->m_system( window, msg, mData1, mData2 );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Send a system message to the specified window */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType GameWindowManager::winSendInputMsg( GameWindow *window,
- UnsignedInt msg,
- WindowMsgData mData1,
- WindowMsgData mData2 )
-{
-
- if( window == nullptr )
- return MSG_IGNORED;
-
- if( msg != GWM_DESTROY && BitIsSet( window->m_status, WIN_STATUS_DESTROYED ) )
- return MSG_IGNORED;
-
- return window->m_input( window, msg, mData1, mData2 );
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Get the current input focus */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::winGetFocus()
-{
-
- return m_keyboardFocus;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Set the current input focus */
-//-------------------------------------------------------------------------------------------------
-Int GameWindowManager::winSetFocus( GameWindow *window )
-{
- Bool wantsFocus = FALSE;
-
- // if a window doesn't want keyboard focus don't give it
- if( window )
- if( BitIsSet( window->winGetStatus(), WIN_STATUS_NO_FOCUS) )
- return 0;
-
- //
- // Tell current focus window that it's losing focus
- // unless we are trying to give focus to the current focus window
- //
- if( (m_keyboardFocus) && (m_keyboardFocus != window) )
- {
- Bool wf; // dummy var, ignored, but must be passed
- winSendSystemMsg( m_keyboardFocus, GWM_INPUT_FOCUS, FALSE, (WindowMsgData)&wf );
- }
-
- // Set focus to new window
- m_keyboardFocus = window;
-
- // Tell new focus window that it has focus
- if( m_keyboardFocus )
- {
-
- for (;;)
- {
- winSendSystemMsg( window, GWM_INPUT_FOCUS, TRUE, (WindowMsgData)&wantsFocus );
- if (wantsFocus)
- break;
-
- window = window->winGetParent();
- if( window == nullptr )
- break;
- }
-
- }
-
- // If new window doesn't want focus, set focus to nullptr
- if( wantsFocus == FALSE )
- m_keyboardFocus = nullptr;
-
- return WIN_ERR_OK;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Process key press through the GUI. */
-//-------------------------------------------------------------------------------------------------
-WinInputReturnCode GameWindowManager::winProcessKey( UnsignedByte key,
- UnsignedByte state )
-{
- WinInputReturnCode returnCode = WIN_INPUT_NOT_USED;
-
- // Check for keyboard focus and a legal key for sanity
- if( m_keyboardFocus && (key != KEY_NONE) )
- {
- GameWindow *win = m_keyboardFocus;
-
- returnCode = WIN_INPUT_USED; // assume input will be used
-
- //
- // Pass the keystroke up the window hierarchy until it is
- // processed or we reach the top level window
- //
- while( winSendInputMsg( win, GWM_CHAR, key, state ) == MSG_IGNORED )
- {
-
- win = win->winGetParent();
- if( win == nullptr )
- {
-
- returnCode = WIN_INPUT_NOT_USED; // oops, it wasn't used after all
- break;
-
- }
-
- }
-
- }
-
- return returnCode;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Process a single mouse event through the window system */
-//-------------------------------------------------------------------------------------------------
-WinInputReturnCode GameWindowManager::winProcessMouseEvent( GameWindowMessage msg,
- ICoord2D *mousePos,
- void *data )
-{
- WinInputReturnCode returnCode = WIN_INPUT_NOT_USED;
- Bool objectTooltip = FALSE;
- UnsignedInt packedMouseCoords;
- GameWindow *window = nullptr;
- GameWindow *toolTipWindow = nullptr;
- Int dx, dy;
- Bool clearGrabWindow = FALSE;
-
- // pack mouse coords into one entity for message passing
- packedMouseCoords = SHORTTOLONG( mousePos->x, mousePos->y );
-
- // clear tooltip ... it will be reset if necessary
- TheMouse->setCursorTooltip( UnicodeString::TheEmptyString );
-
- // Check for mouse capture
- if( m_mouseCaptor )
- {
-
- // no window grabbed as of yet
- m_grabWindow = nullptr;
-
- // what what window within the captured window are we in
- window = m_mouseCaptor->winPointInChild( mousePos->x, mousePos->y );
-
- //
- // send buttons, drags, wheels to the windows, we don't continually
- // send mouse positions
- //
- if( sendMousePosMessages == TRUE || msg != GWM_MOUSE_POS )
- {
- GameWindow *win = window;
-
- if( win )
- {
- while( win != nullptr )
- {
-
- if( winSendInputMsg( win, msg, packedMouseCoords, 0 ) == MSG_HANDLED )
- {
-
- // if used clear the event
- returnCode = WIN_INPUT_USED;
- break;
-
- }
-
- // if we just tested mouseCaptor don't go any higher in the chain
- if( win == m_mouseCaptor )
- break;
-
- win = win->winGetParent();
-
- }
-
- }
- else
- {
-
- // if used clear the event
- if( winSendInputMsg( m_mouseCaptor, msg, packedMouseCoords, 0 ) == MSG_HANDLED )
- returnCode = WIN_INPUT_USED;
-
- }
-
- }
-
- }
- else
- {
-
- if( m_grabWindow )
- {
- GameWindow *parent;
-
- switch( msg )
- {
-
- // --------------------------------------------------------------------
- case GWM_LEFT_UP:
- {
- //Play a beep sound if the window is disabled.
- m_grabWindow->winPointInChild( mousePos->x, mousePos->y, FALSE, TRUE );
-
- BitClear( m_grabWindow->m_status, WIN_STATUS_ACTIVE );
- if( m_grabWindow->winPointInWindow( mousePos->x, mousePos->y ) )
- winSendInputMsg( m_grabWindow, GWM_LEFT_UP, packedMouseCoords, 0 );
- else if( BitIsSet( m_grabWindow->m_status, WIN_STATUS_DRAGGABLE ))
- {
- winSendInputMsg( m_grabWindow, GWM_LEFT_UP, packedMouseCoords, 0 );
- }
-
- clearGrabWindow = TRUE;
- break;
-
- }
-
- // --------------------------------------------------------------------
- case MOUSE_EVENT_NONE:
- case GWM_LEFT_DRAG:
- {
-
- if( BitIsSet( m_grabWindow->m_status, WIN_STATUS_DRAGGABLE ) )
- {
- ICoord2D *mouseDelta = (ICoord2D *)data;
- dx = mouseDelta->x;
- dy = mouseDelta->y;
-
- // Clip window to parent
- if( m_grabWindow->winGetParent() )
- {
-
- parent = m_grabWindow->winGetParent();
-
- if( m_grabWindow->m_region.lo.x + dx < 0 )
- dx = 0 - m_grabWindow->m_region.lo.x;
- else if( m_grabWindow->m_region.hi.x + dx > parent->m_size.x )
- dx = parent->m_size.x - m_grabWindow->m_region.hi.x;
-
- if( m_grabWindow->m_region.lo.y + dy < 0 )
- dy = 0 - m_grabWindow->m_region.lo.y;
- else if( m_grabWindow->m_region.hi.y + dy > parent->m_size.y )
- dy = parent->m_size.y - m_grabWindow->m_region.hi.y;
- }
-
- // Move the window, but keep it completely visible within screen boundaries
- IRegion2D newRegion;
- ICoord2D grabSize;
-
- m_grabWindow->winGetPosition( &newRegion.lo.x, &newRegion.lo.y );
- m_grabWindow->winGetSize( &grabSize.x, &grabSize.y );
-
- newRegion.lo.x += dx;
- newRegion.lo.y += dy;
- if( newRegion.lo.x < 0 )
- newRegion.lo.x = 0;
- if( newRegion.lo.y < 0 )
- newRegion.lo.y = 0;
-
- newRegion.hi.x = newRegion.lo.x + grabSize.x;
- newRegion.hi.y = newRegion.lo.y + grabSize.y;
- if( newRegion.hi.x > (Int)TheDisplay->getWidth() )
- newRegion.hi.x = (Int)TheDisplay->getWidth();
- if( newRegion.hi.y > (Int)TheDisplay->getHeight() )
- newRegion.hi.y = (Int)TheDisplay->getHeight();
-
- newRegion.lo.x = newRegion.hi.x - grabSize.x;
- newRegion.lo.y = newRegion.hi.y - grabSize.y;
-
- m_grabWindow->winSetPosition( newRegion.lo.x, newRegion.lo.y );
-
- }
-
- // Send mouse drag message
- winSendInputMsg( m_grabWindow, msg, packedMouseCoords, 0 );
- break;
-
- }
-
- }
-
- // mark event handled
- returnCode = WIN_INPUT_USED;
-
- }
- else
- {
-
- if( m_modalHead && m_modalHead->window )
- {
- window = m_modalHead->window->winPointInChild( mousePos->x, mousePos->y );
- }
- else
- {
- // search for top-level window which contains pointer
- window = findWindowUnderMouse(toolTipWindow, mousePos, WIN_STATUS_ABOVE, WIN_STATUS_HIDDEN);
-
- // check !above, below and hidden
- if( window == nullptr )
- window = findWindowUnderMouse(toolTipWindow, mousePos, WIN_STATUS_NONE, WIN_STATUS_ABOVE | WIN_STATUS_BELOW | WIN_STATUS_HIDDEN);
-
- // check below and !hidden
- if( window == nullptr )
- window = findWindowUnderMouse(toolTipWindow, mousePos, WIN_STATUS_BELOW, WIN_STATUS_HIDDEN);
- }
-
- if( window )
- if( BitIsSet( window->m_status, WIN_STATUS_NO_INPUT ) )
- {
- if(window->winGetParent() && BitIsSet( window->winGetParent()->winGetInstanceData()->getStyle(), GWS_COMBO_BOX ))
- window = window->winGetParent();
- else
- window = nullptr;
- }
-
- if( window )
- {
- GameWindow *tempWin;
-
- //
- // only send messages for button states, wheel states, we do not
- // continually send messages for mouse positions
- //
- if( sendMousePosMessages == TRUE || msg != GWM_MOUSE_POS )
- {
-
- tempWin = window;
-
- // Give everyone a chance to do something with the clicks
- GameWindow *oldLoneWindow = m_loneWindow;
- while( winSendInputMsg( tempWin, msg, packedMouseCoords, 0 ) == MSG_IGNORED )
- {
-
- tempWin = tempWin->m_parent;
- if( tempWin == nullptr )
- break;
-
- }
-
-
- // First check to see if m_loneWindow is set if so, close the window
- if( m_loneWindow && m_loneWindow == oldLoneWindow
- &&( msg == GWM_LEFT_UP || msg == GWM_MIDDLE_UP || msg == GWM_RIGHT_UP || tempWin))
- {
- if(!m_loneWindow->winIsChild(tempWin))
- winSetLoneWindow( nullptr );
- /*
- ComboBoxData *cData = (ComboBoxData *)m_comboBoxOpen->winGetUserData();
- // verify that the window that ate the message wasn't one of our own
- if(cData->dropDownButton != tempWin &&
- cData->editBox != tempWin &&
- cData->listBox != tempWin &&
- cData->listboxData->upButton != tempWin &&
- cData->listboxData->downButton != tempWin &&
- cData->listboxData->slider != tempWin &&
- cData->listboxData->slider != tempWin->winGetParent())
- winSetOpenComboBoxWindow( nullptr );*/
-
- }
- if( tempWin )
- {
-
- //
- // Someone cares, if this is a left button down event
- // it should get "grabbed"
- /// @todo should allow for left handed mouse configs here?
- //
- if( msg == GWM_LEFT_DOWN )
- {
-
-// if( tempWin != windowList )
-// WinActivate( tempWin );
- m_grabWindow = tempWin;
-
- }
-
- // event is used
- returnCode = WIN_INPUT_USED;
-
- }
-
- }
-
- }
-
- if( toolTipWindow == nullptr )
- {
-
- if( isHidden( window ) == FALSE )
- toolTipWindow = window;
-
- }
-
- // if tooltips are on set them into the window
- Bool tooltipsOn = TRUE;
- if( tooltipsOn )
- {
-// if( toolTipWindow && toolTipWindow->winGetParent() && BitIsSet( toolTipWindow->winGetParent()->winGetInstanceData()->getStyle(), GWS_COMBO_BOX ))
-// toolTipWindow = toolTipWindow->winGetParent();
- if( toolTipWindow )
- {
- // do we have a callback to call for the tooltip
- if( toolTipWindow->m_tooltip )
- toolTipWindow->m_tooltip( toolTipWindow,
- &toolTipWindow->m_instData,
- packedMouseCoords );
-
- // else, do we have a normal tooltip to set
- else if( toolTipWindow->m_instData.getTooltipTextLength() )
- TheMouse->setCursorTooltip( toolTipWindow->m_instData.getTooltipText(), toolTipWindow->m_instData.m_tooltipDelay );
-
- }
- else
- {
-
- //
- // not pointing at a window... perhaps we are pointing at a valid
- // tooltip-able object in the game world ... let's set a flag so
- // during the object testing we can set the tooltip, we can do
- // whatever we like now that we know no other tooltip was set from
- // a window
- //
- objectTooltip = TRUE;
-
- }
-
- }
-
- }
-
- }
-
- //
- // check if new current window is different from the last
- // but only if both windows fall within the mouseCaptor if one exists
- //
- if( (m_grabWindow == nullptr) && (window != m_currMouseRgn) )
- {
- if( m_mouseCaptor )
- {
- if( m_mouseCaptor->winIsChild( m_currMouseRgn ) )
- winSendInputMsg( m_currMouseRgn, GWM_MOUSE_LEAVING, packedMouseCoords, 0 );
- }
- else if( m_currMouseRgn )
- winSendInputMsg( m_currMouseRgn, GWM_MOUSE_LEAVING, packedMouseCoords, 0 );
-
- if( window )
- winSendInputMsg( window, GWM_MOUSE_ENTERING, packedMouseCoords, 0 );
-
- m_currMouseRgn = window;
-
- }
-
- // clear grabWindow if necessary
- if( clearGrabWindow == TRUE )
- {
-
- m_grabWindow = nullptr;
- clearGrabWindow = FALSE;
-
- }
-
- return returnCode;
-
-}
-
-bool GameWindowManager::isMouseWithinWindow(GameWindow* window, const ICoord2D* mousePos, unsigned int requiredStatusMask, unsigned int forbiddenStatusMask)
-{
- return ((BitIsSet(window->m_status, requiredStatusMask) || requiredStatusMask == 0) &&
- !BitIsSet(window->m_status, forbiddenStatusMask) &&
- mousePos->x >= window->m_region.lo.x &&
- mousePos->x <= window->m_region.hi.x &&
- mousePos->y >= window->m_region.lo.y &&
- mousePos->y <= window->m_region.hi.y);
-}
-
-GameWindow* GameWindowManager::findWindowUnderMouse(GameWindow*& toolTipWindow, const ICoord2D* mousePos, unsigned int requiredStatusMask, unsigned int forbiddenStatusMask)
-{
- for (GameWindow* window = m_windowList; window; window = window->m_next)
- {
- if (!isMouseWithinWindow(window, mousePos, requiredStatusMask, forbiddenStatusMask))
- continue;
-
- if (toolTipWindow == nullptr)
- {
- GameWindow* childWindow = window->winPointInAnyChild(mousePos->x, mousePos->y, TRUE, TRUE);
-
- if (childWindow->m_tooltip || childWindow->m_instData.getTooltipTextLength())
- toolTipWindow = childWindow;
- }
-
- if (BitIsSet(window->m_status, WIN_STATUS_ENABLED))
- {
- // determine which child window the mouse is in
- return window->winPointInChild(mousePos->x, mousePos->y);
- }
- }
-
- return nullptr;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Draw a window and its children, in parent-first order.
- * Children's coordinates are relative to their parents.
- * Note that hidden windows automatically will not draw any
- * of their children ... but see-thru windows only will not
- * draw themselves, but will give their children an
- * opportunity to draw */
-//-------------------------------------------------------------------------------------------------
-Int GameWindowManager::drawWindow( GameWindow *window )
-{
- GameWindow *child;
-
- if( window == nullptr )
- return WIN_ERR_INVALID_WINDOW;
-
- if( BitIsSet( window->m_status, WIN_STATUS_HIDDEN ) == FALSE )
- {
-
- if( !BitIsSet( window->m_status, WIN_STATUS_SEE_THRU ) && window->m_draw )
- window->m_draw( window, &window->m_instData );
-
- /// @todo visit list boxes and borders, this is stupid!
- // for list boxes only draw the borders BEFORE the children
- if( BitIsSet( window->winGetStyle(), GWS_SCROLL_LISTBOX ) )
- if( BitIsSet( window->m_status, WIN_STATUS_BORDER ) == TRUE &&
- !BitIsSet( window->m_status, WIN_STATUS_SEE_THRU ) )
- window->winDrawBorder();
-
- // draw children in reverse order just like the window list
- child = window->m_child;
- while( child && child->m_next )
- child = child->m_next;
-
- for( ; child; child = child->m_prev )
- drawWindow( child );
-
- //
- // draw the border for the window AFTER the window contents AND the
- // children contents have drawn
- //
- if( !BitIsSet( window->winGetStyle(), GWS_SCROLL_LISTBOX ) )
- if( BitIsSet( window->m_status, WIN_STATUS_BORDER ) == TRUE &&
- !BitIsSet( window->m_status, WIN_STATUS_SEE_THRU ) )
- window->winDrawBorder();
-
- }
-
- return WIN_ERR_OK;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Draw the GUI in reverse order to correlate with clicking priority */
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::winRepaint()
-{
- GameWindow *window, *next;
-
- // draw below windows
- for( window = m_windowTail; window; window = next )
- {
- next = window->m_prev;
-
- if( BitIsSet( window->m_status, WIN_STATUS_BELOW ) )
- drawWindow( window );
- }
-
- // draw non-above and non-below windows
- for( window = m_windowTail; window; window = next )
- {
- next = window->m_prev;
-
- if (BitIsSet( window->m_status, WIN_STATUS_ABOVE |
- WIN_STATUS_BELOW ) == FALSE)
- drawWindow( window );
- }
-
- // draw above windows
- for( window = m_windowTail; window; window = next )
- {
- next = window->m_prev;
-
- if( BitIsSet( window->m_status, WIN_STATUS_ABOVE ) )
- drawWindow( window );
- }
-
- if(TheTransitionHandler)
- TheTransitionHandler->draw();
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Dump information about all the windows for resource problems */
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::dumpWindow( GameWindow *window )
-{
-#ifndef FINAL
- GameWindow *child;
-
- if( window == nullptr )
- return;
-
- DEBUG_LOG(( "ID: %d\tRedraw: 0x%08X\tUser Data: %d",
- window->winGetWindowId(), window->m_draw, window->m_userData ));
-
- for( child = window->m_child; child; child = child->m_next )
- dumpWindow( child );
-
- return;
-#endif
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Create a new window by setting up its parameters and callbacks. */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::winCreate( GameWindow *parent,
- UnsignedInt status,
- Int x, Int y,
- Int width, Int height,
- GameWinSystemFunc system,
- WinInstanceData *instData )
-{
- GameWindow *window;
-
- // allocate new window
- window = allocateNewWindow();
- if( window == nullptr )
- {
-
- DEBUG_LOG(( "WinCreate error: Could not allocate new window" ));
-#ifndef FINAL
- {
- GameWindow *win;
-
- for( win = m_windowList; win; win = win->m_next )
- dumpWindow( win );
- }
-#endif
-
- return nullptr;
-
- }
-
- // If this is a child window add it to the parent's window list
- if( parent )
- addWindowToParent( window, parent );
- else
- linkWindow( window );
-
- window->m_status = status;
- window->m_size.x = width;
- window->m_size.y = height;
-
- window->m_region.lo.x = x;
- window->m_region.lo.y = y;
- window->m_region.hi.x = x + width;
- window->m_region.hi.y = y + height;
-
- window->normalizeWindowRegion();
-
- // set the system function and send a create message to window
- window->winSetSystemFunc( system );
- winSendSystemMsg( window, GWM_CREATE, 0, 0 );
-
- // copy over instance data if present
- if( instData )
- window->winSetInstanceData( instData );
-
- // set default font
- if (TheGlobalLanguageData && TheGlobalLanguageData->m_defaultWindowFont.name.isNotEmpty())
- { window->winSetFont( winFindFont(
- TheGlobalLanguageData->m_defaultWindowFont.name,
- TheGlobalLanguageData->m_defaultWindowFont.size,
- TheGlobalLanguageData->m_defaultWindowFont.bold) );
- }
- else
- window->winSetFont( winFindFont( "Times New Roman", 14, FALSE ) );
-
- return window;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Take a window and its children off the top level list and free
- * their allocation class data. */
-//-------------------------------------------------------------------------------------------------
-Int GameWindowManager::winDestroy( GameWindow *window )
-{
- GameWindow *child, *next;
-
- if( window == nullptr )
- return WIN_ERR_INVALID_WINDOW;
-
- //
- // we should never have edit data allocated in the window code, it's
- // completely handled by the editor ONLY
- //
- DEBUG_ASSERTCRASH( window->winGetEditData() == nullptr,
- ("winDestroy(): edit data should NOT be present!") );
-
- if( BitIsSet( window->m_status, WIN_STATUS_DESTROYED ) )
- return WIN_ERR_OK;
-
- BitSet( window->m_status, WIN_STATUS_DESTROYED );
- window->freeImages();
-
- if( m_mouseCaptor == window )
- winRelease( window );
-
- if( m_keyboardFocus == window )
- winSetFocus( nullptr );
-
- if( (m_modalHead != nullptr) && (window == m_modalHead->window) )
- winUnsetModal( m_modalHead->window );
-
- if( m_currMouseRgn == window )
- m_currMouseRgn = nullptr;
-
- if( m_grabWindow == window )
- m_grabWindow = nullptr;
-
- for( child = window->m_child; child; child = next )
- {
- next = child->m_next;
- winDestroy( child );
- }
-
- // Remove the top level window from list
- if( window->m_parent == nullptr )
- unlinkWindow( window );
- else
- unlinkChildWindow( window );
-
- // Add to head of the destroy list
- window->m_prev = nullptr;
- window->m_next = m_destroyList;
-
- m_destroyList = window;
-
- //
- // if this window is part of a layout screen, notify the screen that
- // this window is going away
- //
- if( window->m_layout )
- window->m_layout->removeWindow( window );
-
- return WIN_ERR_OK;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Destroy all windows on the window list IMMEDIATELY */
-//-------------------------------------------------------------------------------------------------
-Int GameWindowManager::winDestroyAll()
-{
- GameWindow *win, *next;
-
- //
- // NOTE that it is CRITICAL that the windows be destroyed this way,
- // the editor has windows that are not on this main list that must
- // exist throughout a reset of the system (copy/paste for instance)
- // so DO NOT ever change this to a clever pool of memory for the
- // windows and reset the _pool_ ... I will have to kill you! CBD
- //
-
- for( next = win = m_windowList; next; win = next)
- {
- next = win->m_next;
-
- winDestroy( win );
-
- }
-
- // Destroy All Windows just added to destroy list
- processDestroyList();
-
- return WIN_ERR_OK;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Sets selected window into a modal state. This window will get
- * put at the top of a modal stack */
-//-------------------------------------------------------------------------------------------------
-Int GameWindowManager::winSetModal( GameWindow *window )
-{
- ModalWindow *modal;
-
- if( window == nullptr )
- return WIN_ERR_INVALID_WINDOW;
-
- // verify requesting window is a root window
- if( window->m_parent != nullptr )
- {
- DEBUG_LOG(( "WinSetModal: Non Root window attempted to go modal." ));
- return WIN_ERR_INVALID_PARAMETER; // return error if not
- }
- // Allocate new Modal Window Entry
- modal = newInstance(ModalWindow);
- if( modal == nullptr )
- {
- DEBUG_LOG(( "WinSetModal: Unable to allocate space for Modal Entry." ));
- return WIN_ERR_GENERAL_FAILURE;
- }
-
- // Put new entry at top of list
- modal->window = window;
- modal->next = m_modalHead;
- m_modalHead = modal;
-
- return WIN_ERR_OK;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** pops window off of the modal stack. If this window is not the top
- * of the modal stack an error will occur. */
-//-------------------------------------------------------------------------------------------------
-Int GameWindowManager::winUnsetModal( GameWindow *window )
-{
- ModalWindow *next;
-
- if( window == nullptr )
- return WIN_ERR_INVALID_WINDOW;
-
- // verify entry is at top of list
- if( (m_modalHead == nullptr) || (m_modalHead->window != window) )
- {
-
- // return error if not
- DEBUG_LOG(( "WinUnsetModal: Invalid window attempting to unset modal (%d)",
- window->winGetWindowId() ));
- return WIN_ERR_GENERAL_FAILURE;
-
- }
-
- // remove from top of list
- next = m_modalHead->next;
- deleteInstance(m_modalHead);
- m_modalHead = next;
-
- return WIN_ERR_OK;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Get the grabbed window */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::winGetGrabWindow()
-{
-
- return m_grabWindow;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Explicitly set the grab window */
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::winSetGrabWindow( GameWindow *window )
-{
-
- m_grabWindow = window;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Explicitly set the grab window */
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::winSetLoneWindow( GameWindow *window )
-{
- // ignore if we're trying to set the same window
- if( m_loneWindow == window )
- return;
- if( m_loneWindow )
- winSendSystemMsg( m_loneWindow, GGM_CLOSE, 0, 0 );
- m_loneWindow = window;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Create a Modal Message Box */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::gogoMessageBox(Int x, Int y, Int width, Int height, UnsignedShort buttonFlags,
- UnicodeString titleString, UnicodeString bodyString,
- GameWinMsgBoxFunc yesCallback,
- GameWinMsgBoxFunc noCallback,
- GameWinMsgBoxFunc okCallback,
- GameWinMsgBoxFunc cancelCallback )
-{
- return gogoMessageBox(x,y, width,height,buttonFlags,titleString,bodyString,yesCallback,noCallback,okCallback,cancelCallback, FALSE);
-}
-
-GameWindow *GameWindowManager::gogoMessageBox(Int x, Int y, Int width, Int height, UnsignedShort buttonFlags,
- UnicodeString titleString, UnicodeString bodyString,
- GameWinMsgBoxFunc yesCallback,
- GameWinMsgBoxFunc noCallback,
- GameWinMsgBoxFunc okCallback,
- GameWinMsgBoxFunc cancelCallback, Bool useLogo )
-
-{
- // first check to make sure we have some buttons to display
- if(buttonFlags == 0 )
- {
- return nullptr;
- }
- GameWindow *trueParent = nullptr;
- //Changed by Chris
- if(useLogo)
- trueParent = winCreateFromScript( "Menus/QuitMessageBox.wnd" );
- else
- trueParent = winCreateFromScript( "Menus/MessageBox.wnd" );
- //Added By Chris
- AsciiString menuName;
- if(useLogo)
- menuName.set("QuitMessageBox.wnd:");
- else
- menuName.set("MessageBox.wnd:");
-
- AsciiString tempName;
- GameWindow *parent = nullptr;
-
- tempName = menuName;
- tempName.concat("MessageBoxParent");
- parent = winGetWindowFromId(trueParent, TheNameKeyGenerator->nameToKey( tempName ));
- winSetModal( trueParent );
- winSetFocus( nullptr ); // make sure we lose focus from other windows even if we refuse focus ourselves
- winSetFocus( parent );
-
- // If the user wants the size to be different then the default
- float ratioX, ratioY = 1;
-
- if( width > 0 && height > 0 )
- {
- ICoord2D temp;
- //First grab the percent increase/decrease compared to the default size
- parent->winGetSize( &temp.x, &temp.y);
- ratioX = (float)width / (float)temp.x;
- ratioY = (float)height / (float)temp.y;
- //Set the window's new size
- parent->winSetSize( width, height);
-
- //Resize/reposition all the children windows based off the ratio
- GameWindow *child;
- for( child = parent->winGetChild(); child; child = child->winGetNext() )
- {
- child->winGetSize(&temp.x, &temp.y);
- temp.x =Int(temp.x * ratioX);
- temp.y =Int(temp.y * ratioY);
- child->winSetSize(temp.x, temp.y);
-
- child->winGetPosition(&temp.x, &temp.y);
- temp.x =Int(temp.x * ratioX);
- temp.y =Int(temp.y * ratioY);
- child->winSetPosition(temp.x, temp.y);
- }
- }
-
- // If the user wants to position the message box somewhere other then default
- if( x >= 0 && y >= 0)
- parent->winSetPosition(x, y);
-
- // Reposition the buttons
- Int buttonX[3], buttonY[3];
-
- //In the layout, buttonOk will be in the first button position
- NameKeyType buttonOkID = NAMEKEY_INVALID;
-
- tempName = menuName;
- tempName.concat("ButtonOk");
- buttonOkID = TheNameKeyGenerator->nameToKey( tempName );
- GameWindow *buttonOk = winGetWindowFromId(parent, buttonOkID);
- buttonOk->winGetPosition(&buttonX[0], &buttonY[0]);
-
- tempName = menuName;
- tempName.concat("ButtonYes");
- NameKeyType buttonYesID = TheNameKeyGenerator->nameToKey( tempName );
- GameWindow *buttonYes = winGetWindowFromId(parent, buttonYesID);
- //buttonNo in the second position
- tempName = menuName;
- tempName.concat("ButtonNo");
- NameKeyType buttonNoID = TheNameKeyGenerator->nameToKey(tempName);
- GameWindow *buttonNo = winGetWindowFromId(parent, buttonNoID);
- buttonNo->winGetPosition(&buttonX[1], &buttonY[1]);
-
- //and buttonCancel in the third
- tempName = menuName;
- tempName.concat("ButtonCancel");
- NameKeyType buttonCancelID = TheNameKeyGenerator->nameToKey( tempName );
- GameWindow *buttonCancel = winGetWindowFromId(parent, buttonCancelID);
- buttonCancel->winGetPosition(&buttonX[2], &buttonY[2]);
-
- //we shouldn't have button OK and Yes on the same dialog
- if((buttonFlags & (MSG_BOX_OK | MSG_BOX_YES)) == (MSG_BOX_OK | MSG_BOX_YES) )
- {
- DEBUG_CRASH(("Passed in MSG_BOX_OK and MSG_BOX_YES. Big No No."));
- }
-
- //Position the OK button if we have one
- if( (buttonFlags & MSG_BOX_OK) == MSG_BOX_OK)
- {
- buttonOk->winSetPosition(buttonX[0], buttonY[0]);
- buttonOk->winHide(FALSE);
- }
- else if( (buttonFlags & MSG_BOX_YES) == MSG_BOX_YES)
- {
- //Position the Yes if we have one
- buttonYes->winSetPosition(buttonX[0], buttonY[0]);
- buttonYes->winHide(FALSE);
- }
-
- if((buttonFlags & (MSG_BOX_NO | MSG_BOX_CANCEL)) == (MSG_BOX_NO | MSG_BOX_CANCEL) )
- {
- //If we have both the No and Cancel button, then the no should go in the middle position
- buttonNo->winSetPosition(buttonX[1], buttonY[1]);
- buttonCancel->winSetPosition(buttonX[2], buttonY[2]);
- buttonNo->winHide(FALSE);
- buttonCancel->winHide(FALSE);
- }
- else if( (buttonFlags & MSG_BOX_NO) == MSG_BOX_NO)
- {
- //if we just have the no button, then position it in the right most spot
- buttonNo->winSetPosition(buttonX[2], buttonY[2]);
- buttonNo->winHide(FALSE);
- }
- else if( (buttonFlags & MSG_BOX_CANCEL) == MSG_BOX_CANCEL)
- {
- //else if we just have the Cancel button, well, it should always go in the right spot
- buttonCancel->winSetPosition(buttonX[2], buttonY[2]);
- buttonCancel->winHide(FALSE);
- }
-
- // Fill the text into the text boxes
- tempName = menuName;
- tempName.concat("StaticTextTitle");
- NameKeyType staticTextTitleID = TheNameKeyGenerator->nameToKey( tempName );
- GameWindow *staticTextTitle = winGetWindowFromId(parent, staticTextTitleID);
- GadgetStaticTextSetText(staticTextTitle,titleString);
- tempName = menuName;
- tempName.concat("StaticTextMessage");
- NameKeyType staticTextMessageID = TheNameKeyGenerator->nameToKey( tempName );
- GameWindow *staticTextMessage = winGetWindowFromId(parent, staticTextMessageID);
- GadgetStaticTextSetText(staticTextMessage,bodyString);
-
- // create a structure that will pass the functions to
- WindowMessageBoxData *MsgBoxCallbacks = NEW WindowMessageBoxData;
- MsgBoxCallbacks->cancelCallback = cancelCallback;
- MsgBoxCallbacks->noCallback = noCallback;
- MsgBoxCallbacks->okCallback = okCallback;
- MsgBoxCallbacks->yesCallback = yesCallback;
- //pass the structure to the dialog
- trueParent->winSetUserData( MsgBoxCallbacks );
-
- //make sure the dialog is showing and bring it to the top
- parent->winHide(FALSE);
- parent->winBringToTop();
-
- //Changed By Chris
- return trueParent;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Create a button GUI control */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::gogoGadgetPushButton( GameWindow *parent,
- UnsignedInt status,
- Int x, Int y,
- Int width, Int height,
- WinInstanceData *instData,
- GameFont *defaultFont,
- Bool defaultVisual )
-{
- GameWindow *button;
-
- // we MUST have a push button style window to do this
- if( BitIsSet( instData->getStyle(), GWS_PUSH_BUTTON ) == FALSE )
- {
-
- DEBUG_LOG(( "Can't create button gadget, instance data not button type" ));
- assert( 0 );
- return nullptr;
-
- }
-
- // create the button window
- button = winCreate( parent, status,
- x, y, width, height,
- GadgetPushButtonSystem,
- instData );
- if( button == nullptr )
- {
-
- DEBUG_LOG(( "Unable to create button for push button gadget" ));
- assert( 0 );
- return nullptr;
-
- }
-
- // assign input function
- button->winSetInputFunc( GadgetPushButtonInput );
-
- //
- // assign draw function, the draw functions must actually be implemented
- // on the device level of the engine
- //
- if( BitIsSet( button->winGetStatus(), WIN_STATUS_IMAGE ) )
- button->winSetDrawFunc( getPushButtonImageDrawFunc() );
- else
- button->winSetDrawFunc( getPushButtonDrawFunc() );
-
- // set the owner to the parent, or if no parent it will be itself
- button->winSetOwner( parent );
-
- // Init the userdata to null
- button->winSetUserData(nullptr);
-
- // assign the default images/colors
- assignDefaultGadgetLook( button, defaultFont, defaultVisual );
-
- // assign text from label
- UnicodeString text = winTextLabelToText( instData->m_textLabelString );
- if( text.getLength() )
- GadgetButtonSetText( button, text );
-
- return button;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Create a checkbox UI element */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::gogoGadgetCheckbox( GameWindow *parent,
- UnsignedInt status,
- Int x, Int y,
- Int width, Int height,
- WinInstanceData *instData,
- GameFont *defaultFont,
- Bool defaultVisual )
-
-{
- GameWindow *checkbox;
-
- // we MUST have a push button style window to do this
- if( BitIsSet( instData->getStyle(), GWS_CHECK_BOX ) == FALSE )
- {
-
- DEBUG_LOG(( "Can't create checkbox gadget, instance data not checkbox type" ));
- assert( 0 );
- return nullptr;
-
- }
-
- // create the button window
- checkbox = winCreate( parent, status,
- x, y, width, height,
- GadgetCheckBoxSystem,
- instData );
- if( checkbox == nullptr )
- {
-
- DEBUG_LOG(( "Unable to create checkbox window" ));
- assert( 0 );
- return nullptr;
-
- }
-
- // assign input function
- checkbox->winSetInputFunc( GadgetCheckBoxInput );
-
- //
- // assign draw function, the draw functions must actually be implemented
- // on the device level of the engine
- //
- if( BitIsSet( checkbox->winGetStatus(), WIN_STATUS_IMAGE ) )
- checkbox->winSetDrawFunc( getCheckBoxImageDrawFunc() );
- else
- checkbox->winSetDrawFunc( getCheckBoxDrawFunc() );
-
- // set the owner to the parent, or if no parent it will be itself
- checkbox->winSetOwner( parent );
-
- // assign the default images/colors
- assignDefaultGadgetLook( checkbox, defaultFont, defaultVisual );
-
- // assign text from label
- UnicodeString text = winTextLabelToText( instData->m_textLabelString );
- if( text.getLength() )
- GadgetCheckBoxSetText( checkbox, text );
-
- return checkbox;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Create a radio button GUI element */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::gogoGadgetRadioButton( GameWindow *parent,
- UnsignedInt status,
- Int x, Int y,
- Int width, Int height,
- WinInstanceData *instData,
- RadioButtonData *rData,
- GameFont *defaultFont,
- Bool defaultVisual )
-
-{
- GameWindow *radioButton;
- RadioButtonData *radioData;
-
- // we MUST have a push button style window to do this
- if( BitIsSet( instData->getStyle(), GWS_RADIO_BUTTON ) == FALSE )
- {
-
- DEBUG_LOG(( "Can't create radioButton gadget, instance data not radioButton type" ));
- assert( 0 );
- return nullptr;
-
- }
-
- // create the button window
- radioButton = winCreate( parent, status,
- x, y, width, height,
- GadgetRadioButtonSystem,
- instData );
- if( radioButton == nullptr )
- {
-
- DEBUG_LOG(( "Unable to create radio button window" ));
- assert( 0 );
- return nullptr;
-
- }
-
- // allocate and store the radio button user data
- radioData = NEW RadioButtonData;
- memcpy( radioData, rData, sizeof( RadioButtonData ) );
- radioButton->winSetUserData( radioData );
-
- // assign input function
- radioButton->winSetInputFunc( GadgetRadioButtonInput );
-
- //
- // assign draw function, the draw functions must actually be implemented
- // on the device level of the engine
- //
- if( BitIsSet( radioButton->winGetStatus(), WIN_STATUS_IMAGE ) )
- radioButton->winSetDrawFunc( getRadioButtonImageDrawFunc() );
- else
- radioButton->winSetDrawFunc( getRadioButtonDrawFunc() );
-
- // set the owner to the parent, or if no parent it will be itself
- radioButton->winSetOwner( parent );
-
- // assign the default images/colors
- assignDefaultGadgetLook( radioButton, defaultFont, defaultVisual );
-
- // assign text from label
- UnicodeString text = winTextLabelToText( instData->m_textLabelString );
- if( text.getLength() )
- GadgetRadioSetText( radioButton, text );
-
- return radioButton;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Create a tab control GUI element */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::gogoGadgetTabControl( GameWindow *parent,
- UnsignedInt status,
- Int x, Int y,
- Int width, Int height,
- WinInstanceData *instData,
- TabControlData *tData,
- GameFont *defaultFont,
- Bool defaultVisual )
-
-{
- GameWindow *tabControl;
- TabControlData *tabData;
-
- // we MUST have a tab control style window to do this
- if( BitIsSet( instData->getStyle(), GWS_TAB_CONTROL ) == FALSE )
- {
-
- DEBUG_LOG(( "Can't create tabControl gadget, instance data not tabControl type" ));
- assert( 0 );
- return nullptr;
-
- }
-
- // create the tab control window
- tabControl = winCreate( parent, status,
- x, y, width, height,
- GadgetTabControlSystem,
- instData );
- if( tabControl == nullptr )
- {
-
- DEBUG_LOG(( "Unable to create tab control window" ));
- assert( 0 );
- return nullptr;
-
- }
-
- // allocate and store the tab control user data
- tabData = NEW TabControlData;
- memcpy( tabData, tData, sizeof( TabControlData ) );
- tabControl->winSetUserData( tabData );
-
- GadgetTabControlComputeTabRegion( tabControl );
- GadgetTabControlCreateSubPanes( tabControl );
- GadgetTabControlShowSubPane( tabControl, 0 );
-
- // assign input function
- tabControl->winSetInputFunc( GadgetTabControlInput );
-
- //
- // assign draw function, the draw functions must actually be implemented
- // on the device level of the engine
- //
- if( BitIsSet( tabControl->winGetStatus(), WIN_STATUS_IMAGE ) )
- tabControl->winSetDrawFunc( getTabControlImageDrawFunc() );
- else
- tabControl->winSetDrawFunc( getTabControlDrawFunc() );
-
- // set the owner to the parent, or if no parent it will be itself
- tabControl->winSetOwner( parent );
-
- // assign the default images/colors
- assignDefaultGadgetLook( tabControl, defaultFont, defaultVisual );
-
- return tabControl;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Create a list box GUI control */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::gogoGadgetListBox( GameWindow *parent,
- UnsignedInt status,
- Int x, Int y,
- Int width, Int height,
- WinInstanceData *instData,
- ListboxData *listboxDataTemplate,
- GameFont *defaultFont,
- Bool defaultVisual )
-
-{
- GameWindow *listbox;
- ListboxData *listboxData;
- Bool title = FALSE;
-
- // we MUST have a push button style window to do this
- if( BitIsSet( instData->getStyle(), GWS_SCROLL_LISTBOX ) == FALSE )
- {
-
- DEBUG_LOG(( "Can't create listbox gadget, instance data not listbox type" ));
- assert( 0 );
- return nullptr;
-
- }
-
- // create the listbox
- listbox = winCreate( parent, status, x, y, width, height,
- GadgetListBoxSystem, instData );
-
- if( listbox == nullptr )
- {
-
- DEBUG_LOG(( "Unable to create listbox window" ));
- assert( 0 );
- return nullptr;
-
- }
-
- // allocate the listbox data, copy template data over and set it into box
- listboxData = NEW ListboxData;
- DEBUG_ASSERTCRASH(listboxDataTemplate, ("listboxDataTemplate not initialized"));
- memcpy( listboxData, listboxDataTemplate, sizeof( ListboxData ) );
-
- // Add the list box data struct to the window's class data
- listbox->winSetUserData( listboxData );
-
- // set the owner to the parent, or if no parent it will be itself
- listbox->winSetOwner( parent );
-
- // Adjust for list title if present
- if( instData->getTextLength() )
- title = TRUE;
-
- // Set up list box redraw callbacks
- if( BitIsSet( listbox->winGetStatus(), WIN_STATUS_IMAGE ))
- listbox->winSetDrawFunc( getListBoxImageDrawFunc() );
- else
- listbox->winSetDrawFunc( getListBoxDrawFunc() );
-
- // Set up list box input callbacks
- if( listboxData->multiSelect )
- listbox->winSetInputFunc( GadgetListBoxMultiInput );
- else
- listbox->winSetInputFunc( GadgetListBoxInput );
-
-
-
- //
- // allocate and set the list length, note that setting the list length will
- // automatically allocate the selection entries that are needed for multi
- // select list boxes etc.
- //
- Int length = listboxData->listLength;
- listboxData->listLength = 0; // hacky!
- GadgetListBoxSetListLength( listbox, length );
-
- // store display height
- listboxData->displayHeight = height;
-
- if( title )
- listboxData->displayHeight -= winFontHeight( instData->getFont() );
-
- // Set display position to the top of the list
- listboxData->displayPos = 0;
- listboxData->selectPos = -1;
- listboxData->doubleClickTime = 0;
- listboxData->insertPos = 0;
- listboxData->endPos = 0;
- listboxData->totalHeight = 0;
-
- // if this listbox has multiple selections prep it
- //if( listboxData->multiSelect )
- // GadgetListBoxAddMultiSelect( listbox );
-
- // If ScrollBar was requested ... create it.
- if( listboxData->scrollBar )
- GadgetListboxCreateScrollbar( listbox );
- //
- // Setup listbox Columns
- //
- if( listboxData->columns == 1 )
- {
- listboxData->columnWidth = NEW Int[listboxData->columns];
- listboxData->columnWidth[0] = width;
- if( listboxData->slider )
- {
- ICoord2D sliderSize;
-
- listboxData->slider->winGetSize( &sliderSize.x, &sliderSize.y );
- listboxData->columnWidth[0] -= (sliderSize.x + 2);
-
- }
- }
- else
- {
- if( !listboxData->columnWidthPercentage )
- return nullptr;
- listboxData->columnWidth = NEW Int[listboxData->columns];
- if(!listboxData->columnWidth)
- return nullptr;
-
- Int totalWidth = width;
- if( listboxData->slider )
- {
- ICoord2D sliderSize;
-
- listboxData->slider->winGetSize( &sliderSize.x, &sliderSize.y );
- totalWidth -= (sliderSize.x + 2);
-
- }
- for(Int i = 0; i < listboxData->columns; i++ )
- {
- listboxData->columnWidth[i] = listboxData->columnWidthPercentage[i] * totalWidth / 100;
- }
- }
- // assign the default images/colors
- assignDefaultGadgetLook( listbox, defaultFont, defaultVisual );
-
- return listbox;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Does all generic window creation, calls appropriate slider create
- * function to set up slider-specific data */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::gogoGadgetSlider( GameWindow *parent,
- UnsignedInt status,
- Int x, Int y,
- Int width, Int height,
- WinInstanceData *instData,
- SliderData *sliderData,
- GameFont *defaultFont,
- Bool defaultVisual )
-
-{
- GameWindow *slider;
- GameWindow *button;
- SliderData *data;
-
- //
- // All sliders need to have the tab stop status in order for
- // the focus chain to work correctly.
- //
- BitSet( status, WIN_STATUS_TAB_STOP );
-
- if( BitIsSet( instData->getStyle(), GWS_HORZ_SLIDER ) )
- {
-
- slider = winCreate( parent, status, x, y, width, height,
- GadgetHorizontalSliderSystem, instData );
-
- // Set up horizontal slider callbacks
- slider->winSetInputFunc( GadgetHorizontalSliderInput );
- if( BitIsSet( slider->winGetStatus(), WIN_STATUS_IMAGE ) )
- slider->winSetDrawFunc( getHorizontalSliderImageDrawFunc() );
- else
- slider->winSetDrawFunc( getHorizontalSliderDrawFunc() );
-
- }
- else if ( BitIsSet( instData->getStyle(), GWS_VERT_SLIDER ) )
- {
-
- slider = winCreate( parent, status, x, y, width, height,
- GadgetVerticalSliderSystem, instData );
-
- // Set up vertical slider callbacks
- slider->winSetInputFunc( GadgetVerticalSliderInput );
-
- if( BitIsSet( slider->winGetStatus(), WIN_STATUS_IMAGE ) && !(parent && BitIsSet(parent->winGetStyle(), GWS_SCROLL_LISTBOX)))
- slider->winSetDrawFunc( getVerticalSliderImageDrawFunc() );
- else
- slider->winSetDrawFunc( getVerticalSliderDrawFunc() );
-
- }
- else
- {
-
- DEBUG_LOG(( "gogoGadgetSlider warning: unrecognized slider style." ));
- assert( 0 );
- return nullptr;
-
- }
-
- // sanity
- if( slider == nullptr )
- {
-
- DEBUG_LOG(( "Unable to create slider control window" ));
- assert( 0 );
- return nullptr;
-
- }
-
- // set the owner to the parent, or if no parent it will be itself
- slider->winSetOwner( parent );
-
- // create the slider thumb button
- WinInstanceData buttonInstData;
- UnsignedInt statusFlags = status | WIN_STATUS_ENABLED | WIN_STATUS_DRAGGABLE;
-
- buttonInstData.init();
-
- // if parent is hidden we don't need to be.
- BitClear( statusFlags, WIN_STATUS_HIDDEN );
-
- buttonInstData.m_owner = slider;
- buttonInstData.m_style = GWS_PUSH_BUTTON;
-
- // if slider tracks, so will this sub control
- if( BitIsSet( instData->getStyle(), GWS_MOUSE_TRACK ) )
- BitSet( buttonInstData.m_style, GWS_MOUSE_TRACK );
-
- if( BitIsSet( instData->getStyle(), GWS_HORZ_SLIDER ) )
- button = gogoGadgetPushButton( slider, statusFlags, 0, HORIZONTAL_SLIDER_THUMB_POSITION,
- HORIZONTAL_SLIDER_THUMB_WIDTH, HORIZONTAL_SLIDER_THUMB_HEIGHT, &buttonInstData, nullptr, TRUE );
- else
- button = gogoGadgetPushButton( slider, statusFlags, 0, 0,
- width, width+1, &buttonInstData, nullptr, TRUE );
-
- // Protect against divide by zero
- if( sliderData->maxVal == sliderData->minVal )
- sliderData->maxVal = sliderData->minVal + 1;
-
- if( BitIsSet( instData->getStyle(), GWS_HORZ_SLIDER ) )
- {
- sliderData->numTicks = (float)(width - HORIZONTAL_SLIDER_THUMB_WIDTH) /
- (float)(sliderData->maxVal - sliderData->minVal);
- } else
- {
- sliderData->numTicks = (float)(height - GADGET_SIZE) /
- (float)(sliderData->maxVal - sliderData->minVal);
- }
-
- data = NEW SliderData;
- memcpy( data, sliderData, sizeof(SliderData) );
-
- // Add the slider data struct to the window's class data
- slider->winSetUserData( data );
-
- // assign the default images/colors
- assignDefaultGadgetLook( slider, defaultFont, defaultVisual );
-
- return slider;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Create a Combo Box GUI element */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::gogoGadgetComboBox( GameWindow *parent,
- UnsignedInt status,
- Int x, Int y,
- Int width, Int height,
- WinInstanceData *instData,
- ComboBoxData *comboBoxDataTemplate,
- GameFont *defaultFont,
- Bool defaultVisual )
-{
- GameWindow *comboBox;
- ComboBoxData *comboBoxData;
- Bool title = FALSE;
-
- // we MUST have a push button style window to do this
- if( BitIsSet( instData->getStyle(), GWS_COMBO_BOX) == FALSE )
- {
-
- DEBUG_LOG(( "Can't create ComboBox gadget, instance data not ComboBox type" ));
- assert( 0 );
- return nullptr;
-
- }
-
- // create the listbox
- comboBox = winCreate( parent, status, x, y, width, height,
- GadgetComboBoxSystem, instData );
-
- if( comboBox == nullptr )
- {
-
- DEBUG_LOG(( "Unable to create ComboBox window" ));
- assert( 0 );
- return nullptr;
-
- }
-
-
-// begin here
- // allocate the listbox data, copy template data over and set it into box
- comboBoxData = NEW ComboBoxData;
- memcpy( comboBoxData, comboBoxDataTemplate, sizeof( ComboBoxData ) );
-
- // Add the list box data struct to the window's class data
- comboBox->winSetUserData( comboBoxData );
-
- // set the owner to the parent, or if no parent it will be itself
- comboBox->winSetOwner( parent );
-
- // Adjust for list title if present
- if( instData->getTextLength() )
- title = TRUE;
-
- // Set up list box redraw callbacks
- if( BitIsSet( comboBox->winGetStatus(), WIN_STATUS_IMAGE ))
- comboBox->winSetDrawFunc( getComboBoxImageDrawFunc() );
- else
- comboBox->winSetDrawFunc( getComboBoxDrawFunc() );
-
- // Set up list box input callbacks
- comboBox->winSetInputFunc( GadgetComboBoxInput );
-
- //Create the windows that make up
-
-
- WinInstanceData winInstData;
- Int buttonWidth, buttonHeight;
- Int fontHeight;
- Int top;
- Int bottom;
-
-
- // do we have a title
- if( comboBox->winGetTextLength() )
- title = TRUE;
-
- // remove unwanted status bits.
- status &= ~(WIN_STATUS_BORDER | WIN_STATUS_HIDDEN);
-
- fontHeight = winFontHeight( comboBox->winGetFont() );
- top = title ? (fontHeight + 1):0;
- bottom = title ? (height - (fontHeight + 1)):height;
-
- // initialize instData
- winInstData.init();
-
- // size of button
- buttonWidth = 21;
- buttonHeight = 22;
-
- // ----------------------------------------------------------------------
- // Create Drop Down Button
- // ----------------------------------------------------------------------
-
- winInstData.m_owner = comboBox;
- winInstData.m_style = GWS_PUSH_BUTTON;
-
- // if listbox tracks, so will this sub control
- if( BitIsSet( comboBox->winGetStyle(), GWS_MOUSE_TRACK ) )
- BitSet( winInstData.m_style, GWS_MOUSE_TRACK );
-
- comboBoxData->dropDownButton =
- gogoGadgetPushButton( comboBox,
- status | WIN_STATUS_ACTIVE | WIN_STATUS_ENABLED,
- width - buttonWidth, 0,
- buttonWidth, height,
- &winInstData, nullptr, TRUE );
- comboBoxData->dropDownButton->winSetTooltipFunc(comboBox->winGetTooltipFunc());
- comboBoxData->dropDownButton->winSetTooltip(instData->getTooltipText());
- comboBoxData->dropDownButton->setTooltipDelay(comboBox->getTooltipDelay());
- // ----------------------------------------------------------------------
- // Create text entry
- // ----------------------------------------------------------------------
- UnsignedInt statusTextEntry;
- winInstData.init();
-
- winInstData.m_owner = comboBox;
- winInstData.m_style |= GWS_ENTRY_FIELD;
- winInstData.m_textLabelString = "Entry";
- if( BitIsSet( comboBox->winGetStyle(), GWS_MOUSE_TRACK ) )
- BitSet( winInstData.m_style, GWS_MOUSE_TRACK );
- if( comboBoxData->isEditable)
- {
- statusTextEntry = status;
- }
- else
- {
- statusTextEntry = status | WIN_STATUS_NO_INPUT ;//| WIN_STATUS_NO_FOCUS;
- comboBoxData->entryData->drawTextFromStart = TRUE;
- }
- comboBoxData->editBox = gogoGadgetTextEntry( comboBox, statusTextEntry ,
- 0,0 ,
- width - buttonWidth , height ,
- &winInstData, comboBoxData->entryData,
- winInstData.m_font, FALSE );
- comboBoxData->editBox->winSetTooltipFunc(comboBox->winGetTooltipFunc());
- comboBoxData->editBox->winSetTooltip(instData->getTooltipText());
- comboBoxData->editBox->setTooltipDelay(comboBox->getTooltipDelay());
-
- delete (comboBoxData->entryData);
- comboBoxData->entryData = (EntryData *)comboBoxData->editBox->winGetUserData();
- // ----------------------------------------------------------------------
- // Create list box
- // ----------------------------------------------------------------------
- winInstData.init();
-
- winInstData.m_owner = comboBox;
- if( BitIsSet( comboBox->winGetStyle(), GWS_MOUSE_TRACK ) )
- BitSet( winInstData.m_style, GWS_MOUSE_TRACK );
- BitSet( winInstData.m_style, WIN_STATUS_HIDDEN );
- winInstData.m_style |= GWS_SCROLL_LISTBOX;
- status &= ~(WIN_STATUS_IMAGE);
- comboBoxData->listBox = gogoGadgetListBox( comboBox, status | WIN_STATUS_ABOVE | WIN_STATUS_ONE_LINE, 0, height,
- width, height,
- &winInstData, comboBoxData->listboxData,
- winInstData.m_font, FALSE );
- comboBoxData->listBox->winHide(TRUE);
- delete(comboBoxData->listboxData);
- comboBoxData->listboxData = (ListboxData *)comboBoxData->listBox->winGetUserData();
-
- comboBoxData->listBox->winSetTooltipFunc(comboBox->winGetTooltipFunc());
- comboBoxData->listBox->winSetTooltip(instData->getTooltipText());
- comboBoxData->listBox->setTooltipDelay(comboBox->getTooltipDelay());
- GadgetListBoxSetAudioFeedback(comboBoxData->listBox, TRUE);
-
- // Initialize the ComboBox's variables and the controls with them
- GadgetComboBoxSetIsEditable(comboBox, comboBoxData->isEditable);
- GadgetComboBoxSetMaxChars( comboBox, comboBoxData->maxChars );
- GadgetComboBoxSetMaxDisplay( comboBox, comboBoxData->maxDisplay );
-
- //Initialize the control's text colors
- Color color, border;
-
- color = comboBox->winGetEnabledTextColor();
- border = comboBox->winGetEnabledTextBorderColor();
- if(comboBoxData->listBox)
- comboBoxData->listBox->winSetEnabledTextColors( color,border);
- if(comboBoxData->editBox)
- comboBoxData->editBox->winSetEnabledTextColors(color,border);
-
- color = comboBox->winGetDisabledTextColor();
- border = comboBox->winGetDisabledTextBorderColor();
- if(comboBoxData->listBox)
- comboBoxData->listBox->winSetDisabledTextColors( color,border);
- if(comboBoxData->editBox)
- comboBoxData->editBox->winSetDisabledTextColors(color,border);
-
-
- color = comboBox->winGetHiliteTextColor();
- border = comboBox->winGetHiliteTextBorderColor();
- if(comboBoxData->listBox)
- comboBoxData->listBox->winSetHiliteTextColors( color,border);
- if(comboBoxData->editBox)
- comboBoxData->editBox->winSetHiliteTextColors(color,border);
-
- comboBoxData->dontHide = FALSE;
-
- // assign the default images/colors
- assignDefaultGadgetLook( comboBox, defaultFont, defaultVisual );
-
- return comboBox;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Create a progress bar GUI element */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::gogoGadgetProgressBar( GameWindow *parent,
- UnsignedInt status,
- Int x, Int y,
- Int width, Int height,
- WinInstanceData *instData,
- GameFont *defaultFont,
- Bool defaultVisual )
-
-{
- GameWindow *progressBar;
-
- // we MUST have a push button style window to do this
- if( BitIsSet( instData->getStyle(), GWS_PROGRESS_BAR ) == FALSE )
- {
-
- DEBUG_LOG(( "Can't create progressBar gadget, instance data not progressBar type" ));
- assert( 0 );
- return nullptr;
-
- }
-
- // create the button window
- progressBar = winCreate( parent, status,
- x, y, width, height,
- GadgetProgressBarSystem,
- instData );
- if( progressBar == nullptr )
- {
-
- DEBUG_LOG(( "Unable to create progress bar control" ));
- assert( 0 );
- return nullptr;
-
- }
-
- //
- // assign draw function, the draw functions must actually be implemented
- // on the device level of the engine
- //
- if( BitIsSet( progressBar->winGetStatus(), WIN_STATUS_IMAGE ) )
- progressBar->winSetDrawFunc( getProgressBarImageDrawFunc() );
- else
- progressBar->winSetDrawFunc( getProgressBarDrawFunc() );
-
- // set the owner to the parent, or if no parent it will be itself
- progressBar->winSetOwner( parent );
-
- // assign the default images/colors
- assignDefaultGadgetLook( progressBar, defaultFont, defaultVisual );
-
- return progressBar;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Does all generic window creation, calls appropriate text field create
- * function to set up specific data */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::gogoGadgetStaticText( GameWindow *parent,
- UnsignedInt status,
- Int x, Int y,
- Int width, Int height,
- WinInstanceData *instData,
- TextData *textData,
- GameFont *defaultFont,
- Bool defaultVisual )
-
-{
- GameWindow *textWin;
- TextData *data;
-
- // Static Text can not be a Tab Stop
- BitClear( instData->m_style, GWS_TAB_STOP );
-
- if( BitIsSet( instData->getStyle(), GWS_STATIC_TEXT ) )
- {
- textWin = winCreate( parent, status, x, y, width, height,
- GadgetStaticTextSystem, instData );
- }
- else
- {
- DEBUG_LOG(( "gogoGadgetText warning: unrecognized text style." ));
- return nullptr;
- }
-
- if( textWin != nullptr )
- {
-
- // set the owner to the parent, or if no parent it will be itself
- textWin->winSetOwner( parent );
-
- // assign callbacks
- textWin->winSetInputFunc( GadgetStaticTextInput );
- if( BitIsSet( textWin->winGetStatus(), WIN_STATUS_IMAGE ) )
- textWin->winSetDrawFunc( getStaticTextImageDrawFunc() );
- else
- textWin->winSetDrawFunc( getStaticTextDrawFunc() );
-
- data = NEW TextData;
- assert( textData != nullptr );
- memcpy( data, textData, sizeof(TextData) );
-
- // allocate a display string for the tet
- data->text = TheDisplayStringManager->newDisplayString();
- // set whether or not we center the wrapped text
- data->text->setWordWrapCentered( BitIsSet( instData->getStatus(), WIN_STATUS_WRAP_CENTERED ));
- // Add the entry field data struct to the window's class data
- textWin->winSetUserData( data );
-
- // assign the default images/colors
- assignDefaultGadgetLook( textWin, defaultFont, defaultVisual );
-
- // assign text from label
- UnicodeString text = winTextLabelToText( instData->m_textLabelString );
- if( text.getLength() )
- GadgetStaticTextSetText( textWin, text );
-
- }
-
- return textWin;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Does all generic window creation, calls appropriate entry field create
- * function to set up specific data */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::gogoGadgetTextEntry( GameWindow *parent,
- UnsignedInt status,
- Int x, Int y,
- Int width, Int height,
- WinInstanceData *instData,
- EntryData *entryData,
- GameFont *defaultFont,
- Bool defaultVisual )
-
-{
- GameWindow *entry;
- EntryData *data;
-
- if( BitIsSet( instData->getStyle(), GWS_ENTRY_FIELD ) == FALSE )
- {
-
- DEBUG_LOG(( "Unable to create text entry, style not entry type" ));
- assert( 0 );
- return nullptr;
-
- }
-
- // create the window
- entry = winCreate( parent, status, x, y, width, height,
- GadgetTextEntrySystem, instData );
- if( entry == nullptr )
- {
-
- DEBUG_LOG(( "Unable to create text entry window" ));
- assert( 0 );
- return nullptr;
-
- }
-
- // set owner of this control
- entry->winSetOwner( parent );
-
- // assign callbacks
- entry->winSetInputFunc( GadgetTextEntryInput );
- if( BitIsSet( entry->winGetStatus(), WIN_STATUS_IMAGE ) )
- entry->winSetDrawFunc( getTextEntryImageDrawFunc() );
- else
- entry->winSetDrawFunc( getTextEntryDrawFunc() );
-
- // zero entry data
-// memset( entryData->text, 0, ENTRY_TEXT_LEN );
-// memset( entryData->constructText, 0, ENTRY_TEXT_LEN );
-
- // initialize character positions, lengths etc
- if( entryData->text )
- entryData->charPos = entryData->text->getTextLength();
- else
- entryData->charPos = 0;
- entryData->conCharPos = 0;
- entryData->receivedUnichar = FALSE;
- if( entryData->maxTextLen > ENTRY_TEXT_LEN )
- entryData->maxTextLen = ENTRY_TEXT_LEN;
-
- // allocate entry data
- data = NEW EntryData;
-
- // copy over data control
- memcpy( data, entryData, sizeof(EntryData) );
-
- // allocate new text display string
- data->text = TheDisplayStringManager->newDisplayString();
- data->sText = TheDisplayStringManager->newDisplayString();
- data->constructText = TheDisplayStringManager->newDisplayString();
-
- // set the max for the text lengths
-// data->text->allocateFixed( ENTRY_TEXT_LEN );
-// data->sText->allocateFixed( ENTRY_TEXT_LEN );
-
- // do any real display string copies
- if( entryData->text )
- data->text->setText( entryData->text->getText() );
- if( entryData->sText )
- data->sText->setText( entryData->sText->getText() );
-
- // set data into window
- entry->winSetUserData( data );
-
- // asian languages get to have list box kanji character completion
- data->constructList = nullptr;
- if( OurLanguage == LANGUAGE_ID_KOREAN ||
- OurLanguage == LANGUAGE_ID_JAPANESE )
- {
- // we need to create the construct listbox
- WinInstanceData boxInstData;
- ListboxData lData;
-
- // initialize instData
- boxInstData.init();
-
- // define display region
- memset( &lData, 0, sizeof(ListboxData) );
- lData.listLength = 128;
- lData.autoScroll = FALSE;
- lData.scrollIfAtEnd = FALSE;
- lData.autoPurge = TRUE;
- lData.scrollBar = TRUE;
- lData.multiSelect = FALSE;
- lData.columns = 1;
- lData.columnWidth = nullptr;
-
- boxInstData.m_style = GWS_SCROLL_LISTBOX | GWS_MOUSE_TRACK;
-
- data->constructList = gogoGadgetListBox( nullptr,
- WIN_STATUS_ABOVE |
- WIN_STATUS_HIDDEN |
- WIN_STATUS_NO_FOCUS |
- WIN_STATUS_ONE_LINE,
- 0, height,
- 110, 119,
- &boxInstData,
- &lData,
- nullptr,
- TRUE );
-
- if( data->constructList == nullptr )
- {
-
- DEBUG_LOG(( "gogoGadgetEntry warning: Failed to create listbox." ));
- assert( 0 );
- winDestroy( entry );
- return nullptr;
-
- }
-
- }
-
- // assign the default images/colors
- assignDefaultGadgetLook( entry, defaultFont, defaultVisual );
-
- // assign text from label
- UnicodeString text = winTextLabelToText( instData->m_textLabelString );
- if( text.getLength() )
- GadgetTextEntrySetText( entry, text );
-
- return entry;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Use this method to assign the default images/colors to gadgets as
- * they area created */
-//-------------------------------------------------------------------------------------------------
-void GameWindowManager::assignDefaultGadgetLook( GameWindow *gadget,
- GameFont *defaultFont,
- Bool assignVisual )
-{
- UnsignedByte alpha = 255;
- static Color red = winMakeColor( 255, 0, 0, alpha );
- static Color darkRed = winMakeColor( 128, 0, 0, alpha );
- static Color lightRed = winMakeColor( 255, 128, 128, alpha );
- static Color green = winMakeColor( 0, 255, 0, alpha );
- static Color darkGreen = winMakeColor( 0, 128, 0, alpha );
- static Color lightGreen = winMakeColor( 128, 255, 128, alpha );
- static Color blue = winMakeColor( 0, 0, 255, alpha );
- static Color darkBlue = winMakeColor( 0, 0, 128, alpha );
- static Color lightBlue = winMakeColor( 128, 128, 255, alpha );
- static Color purple = winMakeColor( 255, 0, 255, alpha );
- static Color darkPurple = winMakeColor( 128, 0, 128, alpha );
- static Color lightPurple= winMakeColor( 255, 128, 255, alpha );
- static Color yellow = winMakeColor( 255, 255, 0, alpha );
- static Color darkYellow = winMakeColor( 128, 128, 0, alpha );
- static Color lightYellow= winMakeColor( 255, 255, 128, alpha );
- static Color cyan = winMakeColor( 0, 255, 255, alpha );
- static Color darkCyan = winMakeColor( 64, 128, 128, alpha );
- static Color lightCyan = winMakeColor( 128, 255, 255, alpha );
- static Color gray = winMakeColor( 128, 128, 128, alpha );
- static Color darkGray = winMakeColor( 64, 64, 64, alpha );
- static Color lightGray = winMakeColor( 192, 192, 192, alpha );
- static Color black = winMakeColor( 0, 0, 0, alpha );
- static Color white = winMakeColor( 254, 254, 254, alpha );
- static Color enabledText = white;
- static Color enabledTextBorder = darkGray;
- static Color disabledText = darkGray;
- static Color disabledTextBorder = black;
- static Color hiliteText = lightBlue;
- static Color hiliteTextBorder = blue;
- static Color imeCompositeText = green;
- static Color imeCompositeTextBorder = blue;
- WinInstanceData *instData;
-
- // sanity
- if( gadget == nullptr )
- return;
-
- // get instance data
- instData = gadget->winGetInstanceData();
-
- // set default font
- if( defaultFont )
- gadget->winSetFont( defaultFont );
- else
- {
- if (TheGlobalLanguageData && TheGlobalLanguageData->m_defaultWindowFont.name.isNotEmpty())
- { gadget->winSetFont( winFindFont(
- TheGlobalLanguageData->m_defaultWindowFont.name,
- TheGlobalLanguageData->m_defaultWindowFont.size,
- TheGlobalLanguageData->m_defaultWindowFont.bold) );
- }
- else
- gadget->winSetFont( winFindFont( "Times New Roman", 14, FALSE ) );
- }
-
- // if we don't want to assign default colors/images get out of here
- if( assignVisual == FALSE )
- return;
-
- // create images for the correct gadget type
- if( BitIsSet( instData->getStyle(), GWS_PUSH_BUTTON ) )
- {
-
- // enabled background
- GadgetButtonSetEnabledImage( gadget, winFindImage( "PushButtonEnabled" ) );
- GadgetButtonSetEnabledColor( gadget, red );
- GadgetButtonSetEnabledBorderColor( gadget, lightRed );
- // enabled selected button
- GadgetButtonSetEnabledSelectedImage( gadget, winFindImage( "PushButtonEnabledSelected" ) );
- GadgetButtonSetEnabledSelectedColor( gadget, yellow );
- GadgetButtonSetEnabledSelectedBorderColor( gadget, white );
-
- // Disabled background
- GadgetButtonSetDisabledImage( gadget, winFindImage( "PushButtonDisabled" ) );
- GadgetButtonSetDisabledColor( gadget, gray );
- GadgetButtonSetDisabledBorderColor( gadget, lightGray );
- // Disabled selected button
- GadgetButtonSetDisabledSelectedImage( gadget, winFindImage( "PushButtonDisabledSelected" ) );
- GadgetButtonSetDisabledSelectedColor( gadget, lightGray );
- GadgetButtonSetDisabledSelectedBorderColor( gadget, gray );
-
- // Hilite background
- GadgetButtonSetHiliteImage( gadget, winFindImage( "PushButtonHilite" ) );
- GadgetButtonSetHiliteColor( gadget, green );
- GadgetButtonSetHiliteBorderColor( gadget, darkGreen );
- // Hilite selected button
- GadgetButtonSetHiliteSelectedImage( gadget, winFindImage( "PushButtonHiliteSelected" ) );
- GadgetButtonSetHiliteSelectedColor( gadget, yellow );
- GadgetButtonSetHiliteSelectedBorderColor( gadget, white );
-
- // set default text colors for the gadget
- gadget->winSetEnabledTextColors( enabledText, enabledTextBorder );
- gadget->winSetDisabledTextColors( disabledText, disabledTextBorder );
- gadget->winSetHiliteTextColors( hiliteText, hiliteTextBorder );
- gadget->winSetIMECompositeTextColors( imeCompositeText, imeCompositeTextBorder );
-
- }
- else if( BitIsSet( instData->getStyle(), GWS_CHECK_BOX ) )
- {
-
- // enabled background
- GadgetCheckBoxSetEnabledImage( gadget, winFindImage( "CheckBoxEnabled" ) );
- GadgetCheckBoxSetEnabledColor( gadget, red );
- GadgetCheckBoxSetEnabledBorderColor( gadget, lightRed );
- // enabled CheckBox unselected
- GadgetCheckBoxSetEnabledUncheckedBoxImage( gadget, winFindImage( "CheckBoxEnabledBoxUnselected" ) );
- GadgetCheckBoxSetEnabledUncheckedBoxColor( gadget, WIN_COLOR_UNDEFINED );
- GadgetCheckBoxSetEnabledUncheckedBoxBorderColor( gadget, lightBlue );
- // enabled CheckBox selected
- GadgetCheckBoxSetEnabledCheckedBoxImage( gadget, winFindImage( "CheckBoxEnabledBoxSelected" ) );
- GadgetCheckBoxSetEnabledCheckedBoxColor( gadget, blue );
- GadgetCheckBoxSetEnabledCheckedBoxBorderColor( gadget, lightBlue );
-
- // disabled background
- GadgetCheckBoxSetDisabledImage( gadget, winFindImage( "CheckBoxDisabled" ) );
- GadgetCheckBoxSetDisabledColor( gadget, gray );
- GadgetCheckBoxSetDisabledBorderColor( gadget, lightGray );
- // Disabled CheckBox unselected
- GadgetCheckBoxSetDisabledUncheckedBoxImage( gadget, winFindImage( "CheckBoxDisabledBoxUnselected" ) );
- GadgetCheckBoxSetDisabledUncheckedBoxColor( gadget, WIN_COLOR_UNDEFINED );
- GadgetCheckBoxSetDisabledUncheckedBoxBorderColor( gadget, lightGray );
- // Disabled CheckBox selected
- GadgetCheckBoxSetDisabledCheckedBoxImage( gadget, winFindImage( "CheckBoxDisabledBoxSelected" ) );
- GadgetCheckBoxSetDisabledCheckedBoxColor( gadget, darkGray );
- GadgetCheckBoxSetDisabledCheckedBoxBorderColor( gadget, white );
-
- // Hilite background
- GadgetCheckBoxSetHiliteImage( gadget, winFindImage( "CheckBoxHilite" ) );
- GadgetCheckBoxSetHiliteColor( gadget, green );
- GadgetCheckBoxSetHiliteBorderColor( gadget, lightGreen );
- // Hilite CheckBox unselected
- GadgetCheckBoxSetHiliteUncheckedBoxImage( gadget, winFindImage( "CheckBoxHiliteBoxUnselected" ) );
- GadgetCheckBoxSetHiliteUncheckedBoxColor( gadget, WIN_COLOR_UNDEFINED );
- GadgetCheckBoxSetHiliteUncheckedBoxBorderColor( gadget, lightBlue );
- // Hilite CheckBox selected
- GadgetCheckBoxSetHiliteCheckedBoxImage( gadget, winFindImage( "CheckBoxHiliteBoxSelected" ) );
- GadgetCheckBoxSetHiliteCheckedBoxColor( gadget, yellow );
- GadgetCheckBoxSetHiliteCheckedBoxBorderColor( gadget, white );
-
- // set default text colors for the gadget
- gadget->winSetEnabledTextColors( enabledText, enabledTextBorder );
- gadget->winSetDisabledTextColors( disabledText, disabledTextBorder );
- gadget->winSetHiliteTextColors( hiliteText, hiliteTextBorder );
- gadget->winSetIMECompositeTextColors( imeCompositeText, imeCompositeTextBorder );
-
- }
- else if( BitIsSet( instData->getStyle(), GWS_RADIO_BUTTON ) )
- {
-
- // enabled background
- GadgetRadioSetEnabledImage( gadget, winFindImage( "RadioButtonEnabled" ) );
- GadgetRadioSetEnabledColor( gadget, red );
- GadgetRadioSetEnabledBorderColor( gadget, lightRed );
- // enabled radio unselected
- GadgetRadioSetEnabledUncheckedBoxImage( gadget, winFindImage( "RadioButtonEnabledBoxUnselected" ) );
- GadgetRadioSetEnabledUncheckedBoxColor( gadget, darkRed );
- GadgetRadioSetEnabledUncheckedBoxBorderColor( gadget, black );
- // enabled radio selected
- GadgetRadioSetEnabledCheckedBoxImage( gadget, winFindImage( "RadioButtonEnabledBoxSelected" ) );
- GadgetRadioSetEnabledCheckedBoxColor( gadget, blue );
- GadgetRadioSetEnabledCheckedBoxBorderColor( gadget, lightBlue );
-
- // disabled background
- GadgetRadioSetDisabledImage( gadget, winFindImage( "RadioButtonDisabled" ) );
- GadgetRadioSetDisabledColor( gadget, gray );
- GadgetRadioSetDisabledBorderColor( gadget, lightGray );
- // Disabled radio unselected
- GadgetRadioSetDisabledUncheckedBoxImage( gadget, winFindImage( "RadioButtonDisabledBoxUnselected" ) );
- GadgetRadioSetDisabledUncheckedBoxColor( gadget, gray );
- GadgetRadioSetDisabledUncheckedBoxBorderColor( gadget, lightGray );
- // Disabled radio selected
- GadgetRadioSetDisabledCheckedBoxImage( gadget, winFindImage( "RadioButtonDisabledBoxSelected" ) );
- GadgetRadioSetDisabledCheckedBoxColor( gadget, darkGray );
- GadgetRadioSetDisabledCheckedBoxBorderColor( gadget, white );
-
- // Hilite background
- GadgetRadioSetHiliteImage( gadget, winFindImage( "RadioButtonHilite" ) );
- GadgetRadioSetHiliteColor( gadget, green );
- GadgetRadioSetHiliteBorderColor( gadget, lightGreen );
- // Hilite radio unselected
- GadgetRadioSetHiliteUncheckedBoxImage( gadget, winFindImage( "RadioButtonHiliteBoxUnselected" ) );
- GadgetRadioSetHiliteUncheckedBoxColor( gadget, darkGreen );
- GadgetRadioSetHiliteUncheckedBoxBorderColor( gadget, lightGreen );
- // Hilite radio selected
- GadgetRadioSetHiliteCheckedBoxImage( gadget, winFindImage( "RadioButtonHiliteBoxSelected" ) );
- GadgetRadioSetHiliteCheckedBoxColor( gadget, yellow );
- GadgetRadioSetHiliteCheckedBoxBorderColor( gadget, white );
-
- // set default text colors for the gadget
- gadget->winSetEnabledTextColors( enabledText, enabledTextBorder );
- gadget->winSetDisabledTextColors( disabledText, disabledTextBorder );
- gadget->winSetHiliteTextColors( hiliteText, hiliteTextBorder );
- gadget->winSetIMECompositeTextColors( imeCompositeText, imeCompositeTextBorder );
-
- }
- else if( BitIsSet( instData->getStyle(), GWS_HORZ_SLIDER ) )
- {
-
- // enabled
- GadgetSliderSetEnabledImageLeft( gadget, winFindImage( "HSliderEnabledLeftEnd" ) );
- GadgetSliderSetEnabledImageRight( gadget, winFindImage( "HSliderEnabledRightEnd" ) );
- GadgetSliderSetEnabledImageCenter( gadget, winFindImage( "HSliderEnabledRepeatingCenter" ) );
- GadgetSliderSetEnabledImageSmallCenter( gadget, winFindImage( "HSliderEnabledSmallRepeatingCenter" ) );
- GadgetSliderSetEnabledColor( gadget, red );
- GadgetSliderSetEnabledBorderColor( gadget, lightRed );
-
- // disabled
- GadgetSliderSetDisabledImageLeft( gadget, winFindImage( "HSliderDisabledLeftEnd" ) );
- GadgetSliderSetDisabledImageRight( gadget, winFindImage( "HSliderDisabledRightEnd" ) );
- GadgetSliderSetDisabledImageCenter( gadget, winFindImage( "HSliderDisabledRepeatingCenter" ) );
- GadgetSliderSetDisabledImageSmallCenter( gadget, winFindImage( "HSliderDisabledSmallRepeatingCenter" ) );
- GadgetSliderSetDisabledColor( gadget, red );
- GadgetSliderSetDisabledBorderColor( gadget, lightRed );
-
- // hilite
- GadgetSliderSetHiliteImageLeft( gadget, winFindImage( "HSliderHiliteLeftEnd" ) );
- GadgetSliderSetHiliteImageRight( gadget, winFindImage( "HSliderHiliteRightEnd" ) );
- GadgetSliderSetHiliteImageCenter( gadget, winFindImage( "HSliderHiliteRepeatingCenter" ) );
- GadgetSliderSetHiliteImageSmallCenter( gadget, winFindImage( "HSliderHiliteSmallRepeatingCenter" ) );
- GadgetSliderSetHiliteColor( gadget, red );
- GadgetSliderSetHiliteBorderColor( gadget, lightRed );
-
- // set default text colors for the gadget
- gadget->winSetEnabledTextColors( enabledText, enabledTextBorder );
- gadget->winSetDisabledTextColors( disabledText, disabledTextBorder );
- gadget->winSetHiliteTextColors( hiliteText, hiliteTextBorder );
- gadget->winSetIMECompositeTextColors( imeCompositeText, imeCompositeTextBorder );
-
- //
- // set the default colors and images for the slider thumb
- //
- // enabled
- GadgetSliderSetEnabledThumbImage( gadget, winFindImage( "HSliderThumbEnabled" ) );
- GadgetSliderSetEnabledThumbColor( gadget, GadgetSliderGetEnabledColor( gadget ) );
- GadgetSliderSetEnabledThumbBorderColor( gadget, GadgetSliderGetEnabledBorderColor( gadget ) );
- GadgetSliderSetEnabledSelectedThumbImage( gadget, winFindImage( "HSliderThumbEnabled" ) );
- GadgetSliderSetEnabledSelectedThumbColor( gadget, GadgetSliderGetEnabledBorderColor( gadget ) );
- GadgetSliderSetEnabledSelectedThumbBorderColor( gadget, GadgetSliderGetEnabledColor( gadget ) );
-
- // disabled
- GadgetSliderSetDisabledThumbImage( gadget, winFindImage( "HSliderThumbDisabled" ) );
- GadgetSliderSetDisabledThumbColor( gadget, GadgetSliderGetDisabledColor( gadget ) );
- GadgetSliderSetDisabledThumbBorderColor( gadget, GadgetSliderGetDisabledBorderColor( gadget ) );
- GadgetSliderSetDisabledSelectedThumbImage( gadget, winFindImage( "HSliderThumbDisabled" ) );
- GadgetSliderSetDisabledSelectedThumbColor( gadget, GadgetSliderGetDisabledBorderColor( gadget ) );
- GadgetSliderSetDisabledSelectedThumbBorderColor( gadget, GadgetSliderGetDisabledColor( gadget ) );
-
- // hilite
- GadgetSliderSetHiliteThumbImage( gadget, winFindImage( "HSliderThumbHilite" ) );
- GadgetSliderSetHiliteThumbColor( gadget, GadgetSliderGetHiliteColor( gadget ) );
- GadgetSliderSetHiliteThumbBorderColor( gadget, GadgetSliderGetHiliteBorderColor( gadget ) );
- GadgetSliderSetHiliteSelectedThumbImage( gadget, winFindImage( "HSliderThumbHiliteSelected" ) );
- GadgetSliderSetHiliteSelectedThumbColor( gadget, GadgetSliderGetHiliteBorderColor( gadget ) );
- GadgetSliderSetHiliteSelectedThumbBorderColor( gadget, GadgetSliderGetHiliteColor( gadget ) );
-
-
- }
- else if( BitIsSet( instData->getStyle(), GWS_VERT_SLIDER ) )
- {
- // enabled
- GadgetSliderSetEnabledImageTop( gadget, winFindImage( "VSliderEnabledTopEnd" ) );
- GadgetSliderSetEnabledImageBottom( gadget, winFindImage( "VSliderEnabledBottomEnd" ) );
- GadgetSliderSetEnabledImageCenter( gadget, winFindImage( "VSliderEnabledRepeatingCenter" ) );
- GadgetSliderSetEnabledImageSmallCenter( gadget, winFindImage( "VSliderEnabledSmallRepeatingCenter" ) );
- GadgetSliderSetEnabledColor( gadget, red );
- GadgetSliderSetEnabledBorderColor( gadget, lightRed );
-
- // disabled
- GadgetSliderSetDisabledImageTop( gadget, winFindImage( "VSliderDisabledTopEnd" ) );
- GadgetSliderSetDisabledImageBottom( gadget, winFindImage( "VSliderDisabledBottomEnd" ) );
- GadgetSliderSetDisabledImageCenter( gadget, winFindImage( "VSliderDisabledRepeatingCenter" ) );
- GadgetSliderSetDisabledImageSmallCenter( gadget, winFindImage( "VSliderDisabledSmallRepeatingCenter" ) );
- GadgetSliderSetDisabledColor( gadget, red );
- GadgetSliderSetDisabledBorderColor( gadget, lightRed );
-
- // hilite
- GadgetSliderSetHiliteImageTop( gadget, winFindImage( "VSliderHiliteTopEnd" ) );
- GadgetSliderSetHiliteImageBottom( gadget, winFindImage( "VSliderHiliteBottomEnd" ) );
- GadgetSliderSetHiliteImageCenter( gadget, winFindImage( "VSliderHiliteRepeatingCenter" ) );
- GadgetSliderSetHiliteImageSmallCenter( gadget, winFindImage( "VSliderHiliteSmallRepeatingCenter" ) );
- GadgetSliderSetHiliteColor( gadget, red );
- GadgetSliderSetHiliteBorderColor( gadget, lightRed );
-
- // set default text colors for the gadget
- gadget->winSetEnabledTextColors( enabledText, enabledTextBorder );
- gadget->winSetDisabledTextColors( disabledText, disabledTextBorder );
- gadget->winSetHiliteTextColors( hiliteText, hiliteTextBorder );
- gadget->winSetIMECompositeTextColors( imeCompositeText, imeCompositeTextBorder );
-
- //
- // set the default colors and images for the slider thumb
- //
- // enabled
- GadgetSliderSetEnabledThumbImage( gadget, winFindImage( "VSliderThumbEnabled" ) );
- GadgetSliderSetEnabledThumbColor( gadget, GadgetSliderGetEnabledColor( gadget ) );
- GadgetSliderSetEnabledThumbBorderColor( gadget, GadgetSliderGetEnabledBorderColor( gadget ) );
- GadgetSliderSetEnabledSelectedThumbImage( gadget, winFindImage( "VSliderThumbEnabled" ) );
- GadgetSliderSetEnabledSelectedThumbColor( gadget, GadgetSliderGetEnabledBorderColor( gadget ) );
- GadgetSliderSetEnabledSelectedThumbBorderColor( gadget, GadgetSliderGetEnabledColor( gadget ) );
-
- // disabled
- GadgetSliderSetDisabledThumbImage( gadget, winFindImage( "VSliderThumbDisabled" ) );
- GadgetSliderSetDisabledThumbColor( gadget, GadgetSliderGetDisabledColor( gadget ) );
- GadgetSliderSetDisabledThumbBorderColor( gadget, GadgetSliderGetDisabledBorderColor( gadget ) );
- GadgetSliderSetDisabledSelectedThumbImage( gadget, winFindImage( "VSliderThumbDisabled" ) );
- GadgetSliderSetDisabledSelectedThumbColor( gadget, GadgetSliderGetDisabledBorderColor( gadget ) );
- GadgetSliderSetDisabledSelectedThumbBorderColor( gadget, GadgetSliderGetDisabledColor( gadget ) );
-
- // hilite
- GadgetSliderSetHiliteThumbImage( gadget, winFindImage( "VSliderThumbHilite" ) );
- GadgetSliderSetHiliteThumbColor( gadget, GadgetSliderGetHiliteColor( gadget ) );
- GadgetSliderSetHiliteThumbBorderColor( gadget, GadgetSliderGetHiliteBorderColor( gadget ) );
- GadgetSliderSetHiliteSelectedThumbImage( gadget, winFindImage( "VSliderThumbHiliteSelected" ) );
- GadgetSliderSetHiliteSelectedThumbColor( gadget, GadgetSliderGetHiliteBorderColor( gadget ) );
- GadgetSliderSetHiliteSelectedThumbBorderColor( gadget, GadgetSliderGetHiliteColor( gadget ) );
-
- }
- else if( BitIsSet( instData->getStyle(), GWS_SCROLL_LISTBOX ) )
- {
- ListboxData *listboxData = (ListboxData *)gadget->winGetUserData();
-
- // set the colors
- GadgetListBoxSetColors( gadget,
- red, // enabled
- lightRed, // enabled border
- yellow, // enabled selected item
- white, // enabled selected item border
- gray, // disabled
- lightGray, // disabled border
- lightGray, // disabled selected item
- white, // disabled selected item border
- green, // hilite
- darkGreen, // hilite border
- white, // hilite selected item
- darkGreen ); // hilite selected item border
-
- // now set the images
-
- // enabled
- GadgetListBoxSetEnabledImage( gadget, winFindImage( "ListBoxEnabled" ) );
- GadgetListBoxSetEnabledSelectedItemImageLeft( gadget, winFindImage( "ListBoxEnabledSelectedItemLeftEnd" ) );
- GadgetListBoxSetEnabledSelectedItemImageRight( gadget, winFindImage( "ListBoxEnabledSelectedItemRightEnd" ) );
- GadgetListBoxSetEnabledSelectedItemImageCenter( gadget, winFindImage( "ListBoxEnabledSelectedItemRepeatingCenter" ) );
- GadgetListBoxSetEnabledSelectedItemImageSmallCenter( gadget, winFindImage( "ListBoxEnabledSelectedItemSmallRepeatingCenter" ) );
-
- // disabled
- GadgetListBoxSetDisabledImage( gadget, winFindImage( "ListBoxDisabled" ) );
- GadgetListBoxSetDisabledSelectedItemImageLeft( gadget, winFindImage( "ListBoxDisabledSelectedItemLeftEnd" ) );
- GadgetListBoxSetDisabledSelectedItemImageRight( gadget, winFindImage( "ListBoxDisabledSelectedItemRightEnd" ) );
- GadgetListBoxSetDisabledSelectedItemImageCenter( gadget, winFindImage( "ListBoxDisabledSelectedItemRepeatingCenter" ) );
- GadgetListBoxSetDisabledSelectedItemImageSmallCenter( gadget, winFindImage( "ListBoxDisabledSelectedItemSmallRepeatingCenter" ) );
-
-
- // hilited
- GadgetListBoxSetHiliteImage( gadget, winFindImage( "ListBoxHilite" ) );
- GadgetListBoxSetHiliteSelectedItemImageLeft( gadget, winFindImage( "ListBoxHiliteSelectedItemLeftEnd" ) );
- GadgetListBoxSetHiliteSelectedItemImageRight( gadget, winFindImage( "ListBoxHiliteSelectedItemRightEnd" ) );
- GadgetListBoxSetHiliteSelectedItemImageCenter( gadget, winFindImage( "ListBoxHiliteSelectedItemRepeatingCenter" ) );
- GadgetListBoxSetHiliteSelectedItemImageSmallCenter( gadget, winFindImage( "ListBoxHiliteSelectedItemSmallRepeatingCenter" ) );
-
- // assign default slider colors and images as part of the list box
- GameWindow *slider = listboxData->slider;
- if( slider )
- {
- GameWindow *upButton = listboxData->upButton;
- GameWindow *downButton = listboxData->downButton;
-
- // slider and slider thumb ----------------------------------------------
-
- // enabled
- GadgetSliderSetEnabledImageTop( slider, winFindImage( "VSliderLargeEnabledTopEnd" ) );
- GadgetSliderSetEnabledImageBottom( slider, winFindImage( "VSliderLargeEnabledBottomEnd" ) );
- GadgetSliderSetEnabledImageCenter( slider, winFindImage( "VSliderLargeEnabledRepeatingCenter" ) );
- GadgetSliderSetEnabledImageSmallCenter( slider, winFindImage( "VSliderLargeEnabledSmallRepeatingCenter" ) );
- GadgetSliderSetEnabledThumbImage( slider, winFindImage( "VSliderLargeThumbEnabled" ) );
- GadgetSliderSetEnabledSelectedThumbImage( slider, winFindImage( "VSliderLargeThumbEnabled" ) );
-
- // disabled
- GadgetSliderSetDisabledImageTop( slider, winFindImage( "VSliderLargeDisabledTopEnd" ) );
- GadgetSliderSetDisabledImageBottom( slider, winFindImage( "VSliderLargeDisabledBottomEnd" ) );
- GadgetSliderSetDisabledImageCenter( slider, winFindImage( "VSliderLargeDisabledRepeatingCenter" ) );
- GadgetSliderSetDisabledImageSmallCenter( slider, winFindImage( "VSliderLargeDisabledSmallRepeatingCenter" ) );
- GadgetSliderSetDisabledThumbImage( slider, winFindImage( "VSliderLargeThumbDisabled" ) );
- GadgetSliderSetDisabledSelectedThumbImage( slider, winFindImage( "VSliderLargeThumbDisabled" ) );
-
- // hilite
- GadgetSliderSetHiliteImageTop( slider, winFindImage( "VSliderLargeHiliteTopEnd" ) );
- GadgetSliderSetHiliteImageBottom( slider, winFindImage( "VSliderLargeHiliteBottomEnd" ) );
- GadgetSliderSetHiliteImageCenter( slider, winFindImage( "VSliderLargeHiliteRepeatingCenter" ) );
- GadgetSliderSetHiliteImageSmallCenter( slider, winFindImage( "VSliderLargeHiliteSmallRepeatingCenter" ) );
- GadgetSliderSetHiliteThumbImage( slider, winFindImage( "VSliderLargeThumbHilite" ) );
- GadgetSliderSetHiliteSelectedThumbImage( slider, winFindImage( "VSliderLargeThumbHilite" ) );
-
- // up button ------------------------------------------------------------
-
- // enabled
- GadgetButtonSetEnabledImage( upButton, winFindImage( "VSliderLargeUpButtonEnabled" ) );
- GadgetButtonSetEnabledSelectedImage( upButton, winFindImage( "VSliderLargeUpButtonEnabled" ) );
-
- // disabled
- GadgetButtonSetDisabledImage( upButton, winFindImage( "VSliderLargeUpButtonDisabled" ) );
- GadgetButtonSetDisabledSelectedImage( upButton, winFindImage( "VSliderLargeUpButtonDisabled" ) );
-
- // hilite
- GadgetButtonSetHiliteImage( upButton, winFindImage( "VSliderLargeUpButtonHilite" ) );
- GadgetButtonSetHiliteSelectedImage( upButton, winFindImage( "VSliderLargeUpButtonHiliteSelected" ) );
-
- // down button ----------------------------------------------------------
-
- // enabled
- GadgetButtonSetEnabledImage( downButton, winFindImage( "VSliderLargeDownButtonEnabled" ) );
- GadgetButtonSetEnabledSelectedImage( downButton, winFindImage( "VSliderLargeDownButtonEnabled" ) );
-
- // disabled
- GadgetButtonSetDisabledImage( downButton, winFindImage( "VSliderLargeDownButtonDisabled" ) );
- GadgetButtonSetDisabledSelectedImage( downButton, winFindImage( "VSliderLargeDownButtonDisabled" ) );
-
- // hilite
- GadgetButtonSetHiliteImage( downButton, winFindImage( "VSliderLargeDownButtonHilite" ) );
- GadgetButtonSetHiliteSelectedImage( downButton, winFindImage( "VSliderLargeDownButtonHiliteSelected" ) );
-
- }
-
- }
- else if( BitIsSet( instData->getStyle(), GWS_COMBO_BOX ) )
- {
-// ComboBoxData *comboBoxData = (ComboBoxData *)gadget->winGetUserData();
-
- GadgetComboBoxSetColors( gadget,
- red, // enabled
- lightRed, // enabled border
- yellow, // enabled selected item
- white, // enabled selected item border
- gray, // disabled
- lightGray, // disabled border
- lightGray, // disabled selected item
- white, // disabled selected item border
- green, // hilite
- darkGreen, // hilite border
- white, // hilite selected item
- darkGreen ); // hilite selected item border
-
- // enabled
- GadgetComboBoxSetEnabledImage( gadget, winFindImage( "ListBoxEnabled" ) );
- GadgetComboBoxSetEnabledSelectedItemImageLeft( gadget, winFindImage( "ListBoxEnabledSelectedItemLeftEnd" ) );
- GadgetComboBoxSetEnabledSelectedItemImageRight( gadget, winFindImage( "ListBoxEnabledSelectedItemRightEnd" ) );
- GadgetComboBoxSetEnabledSelectedItemImageCenter( gadget, winFindImage( "ListBoxEnabledSelectedItemRepeatingCenter" ) );
- GadgetComboBoxSetEnabledSelectedItemImageSmallCenter( gadget, winFindImage( "ListBoxEnabledSelectedItemSmallRepeatingCenter" ) );
-
- // disabled
- GadgetComboBoxSetDisabledImage( gadget, winFindImage( "ListBoxDisabled" ) );
- GadgetComboBoxSetDisabledSelectedItemImageLeft( gadget, winFindImage( "ListBoxDisabledSelectedItemLeftEnd" ) );
- GadgetComboBoxSetDisabledSelectedItemImageRight( gadget, winFindImage( "ListBoxDisabledSelectedItemRightEnd" ) );
- GadgetComboBoxSetDisabledSelectedItemImageCenter( gadget, winFindImage( "ListBoxDisabledSelectedItemRepeatingCenter" ) );
- GadgetComboBoxSetDisabledSelectedItemImageSmallCenter( gadget, winFindImage( "ListBoxDisabledSelectedItemSmallRepeatingCenter" ) );
-
-
- // hilited
- GadgetComboBoxSetHiliteImage( gadget, winFindImage( "ListBoxHilite" ) );
- GadgetComboBoxSetHiliteSelectedItemImageLeft( gadget, winFindImage( "ListBoxHiliteSelectedItemLeftEnd" ) );
- GadgetComboBoxSetHiliteSelectedItemImageRight( gadget, winFindImage( "ListBoxHiliteSelectedItemRightEnd" ) );
- GadgetComboBoxSetHiliteSelectedItemImageCenter( gadget, winFindImage( "ListBoxHiliteSelectedItemRepeatingCenter" ) );
- GadgetComboBoxSetHiliteSelectedItemImageSmallCenter( gadget, winFindImage( "ListBoxHiliteSelectedItemSmallRepeatingCenter" ) );
-
- gadget->winSetEnabledTextColors( enabledText, enabledTextBorder );
- gadget->winSetDisabledTextColors( disabledText, disabledTextBorder );
- gadget->winSetHiliteTextColors( hiliteText, hiliteTextBorder );
- gadget->winSetIMECompositeTextColors( imeCompositeText, imeCompositeTextBorder );
-
- GameWindow *dropDownButton = GadgetComboBoxGetDropDownButton( gadget );
- if ( dropDownButton )
- {
- // enabled background
- GadgetButtonSetEnabledImage( dropDownButton, winFindImage( "PushButtonEnabled" ) );
- // enabled selected button
- GadgetButtonSetEnabledSelectedImage( dropDownButton, winFindImage( "PushButtonEnabledSelected" ) );
-
- // Disabled background
- GadgetButtonSetDisabledImage( dropDownButton, winFindImage( "PushButtonDisabled" ) );
- // Disabled selected button
- GadgetButtonSetDisabledSelectedImage( dropDownButton, winFindImage( "PushButtonDisabledSelected" ) );
-
- // Hilite background
- GadgetButtonSetHiliteImage( dropDownButton, winFindImage( "PushButtonHilite" ) );
- // Hilite selected button
- GadgetButtonSetHiliteSelectedImage( dropDownButton, winFindImage( "PushButtonHiliteSelected" ) );
-
- }
-
- GameWindow *editBox = GadgetComboBoxGetEditBox( gadget );
- if ( editBox )
- {
- // enabled
- GadgetTextEntrySetEnabledImageLeft( editBox, winFindImage( "TextEntryEnabledLeftEnd" ) );
- GadgetTextEntrySetEnabledImageRight( editBox, winFindImage( "TextEntryEnabledRightEnd" ) );
- GadgetTextEntrySetEnabledImageCenter( editBox, winFindImage( "TextEntryEnabledRepeatingCenter" ) );
- GadgetTextEntrySetEnabledImageSmallCenter( editBox, winFindImage( "TextEntryEnabledSmallRepeatingCenter" ) );
-
- // disabled
- GadgetTextEntrySetDisabledImageLeft( editBox, winFindImage( "TextEntryDisabledLeftEnd" ) );
- GadgetTextEntrySetDisabledImageRight( editBox, winFindImage( "TextEntryDisabledRightEnd" ) );
- GadgetTextEntrySetDisabledImageCenter( editBox, winFindImage( "TextEntryDisabledRepeatingCenter" ) );
- GadgetTextEntrySetDisabledImageSmallCenter( editBox, winFindImage( "TextEntryDisabledSmallRepeatingCenter" ) );
-
- // hilited
- GadgetTextEntrySetHiliteImageLeft( editBox, winFindImage( "TextEntryHiliteLeftEnd" ) );
- GadgetTextEntrySetHiliteImageRight( editBox, winFindImage( "TextEntryHiliteRightEnd" ) );
- GadgetTextEntrySetHiliteImageCenter( editBox, winFindImage( "TextEntryHiliteRepeatingCenter" ) );
- GadgetTextEntrySetHiliteImageSmallCenter( editBox, winFindImage( "TextEntryHiliteSmallRepeatingCenter" ) );
-
- }
-
- GameWindow * listBox = GadgetComboBoxGetListBox( gadget );
- if ( listBox )
- {
-
- // now set the images
-
- // enabled
- GadgetListBoxSetEnabledImage( listBox, winFindImage( "ListBoxEnabled" ) );
- GadgetListBoxSetEnabledSelectedItemImageLeft( listBox, winFindImage( "ListBoxEnabledSelectedItemLeftEnd" ) );
- GadgetListBoxSetEnabledSelectedItemImageRight( listBox, winFindImage( "ListBoxEnabledSelectedItemRightEnd" ) );
- GadgetListBoxSetEnabledSelectedItemImageCenter( listBox, winFindImage( "ListBoxEnabledSelectedItemRepeatingCenter" ) );
- GadgetListBoxSetEnabledSelectedItemImageSmallCenter( listBox, winFindImage( "ListBoxEnabledSelectedItemSmallRepeatingCenter" ) );
-
- // disabled
- GadgetListBoxSetDisabledImage( listBox, winFindImage( "ListBoxDisabled" ) );
- GadgetListBoxSetDisabledSelectedItemImageLeft( listBox, winFindImage( "ListBoxDisabledSelectedItemLeftEnd" ) );
- GadgetListBoxSetDisabledSelectedItemImageRight( listBox, winFindImage( "ListBoxDisabledSelectedItemRightEnd" ) );
- GadgetListBoxSetDisabledSelectedItemImageCenter( listBox, winFindImage( "ListBoxDisabledSelectedItemRepeatingCenter" ) );
- GadgetListBoxSetDisabledSelectedItemImageSmallCenter( listBox, winFindImage( "ListBoxDisabledSelectedItemSmallRepeatingCenter" ) );
-
-
- // hilited
- GadgetListBoxSetHiliteImage( listBox, winFindImage( "ListBoxHilite" ) );
- GadgetListBoxSetHiliteSelectedItemImageLeft( listBox, winFindImage( "ListBoxHiliteSelectedItemLeftEnd" ) );
- GadgetListBoxSetHiliteSelectedItemImageRight( listBox, winFindImage( "ListBoxHiliteSelectedItemRightEnd" ) );
- GadgetListBoxSetHiliteSelectedItemImageCenter( listBox, winFindImage( "ListBoxHiliteSelectedItemRepeatingCenter" ) );
- GadgetListBoxSetHiliteSelectedItemImageSmallCenter( listBox, winFindImage( "ListBoxHiliteSelectedItemSmallRepeatingCenter" ) );
-
- // assign default slider colors and images as part of the list box
- GameWindow *slider = GadgetListBoxGetSlider( listBox );
- if( slider )
- {
- GameWindow *upButton = GadgetListBoxGetUpButton( listBox );
- GameWindow *downButton = GadgetListBoxGetDownButton( listBox );
-
- // slider and slider thumb ----------------------------------------------
-
- // enabled
- GadgetSliderSetEnabledImageTop( slider, winFindImage( "VSliderLargeEnabledTopEnd" ) );
- GadgetSliderSetEnabledImageBottom( slider, winFindImage( "VSliderLargeEnabledBottomEnd" ) );
- GadgetSliderSetEnabledImageCenter( slider, winFindImage( "VSliderLargeEnabledRepeatingCenter" ) );
- GadgetSliderSetEnabledImageSmallCenter( slider, winFindImage( "VSliderLargeEnabledSmallRepeatingCenter" ) );
- GadgetSliderSetEnabledThumbImage( slider, winFindImage( "VSliderLargeThumbEnabled" ) );
- GadgetSliderSetEnabledSelectedThumbImage( slider, winFindImage( "VSliderLargeThumbEnabled" ) );
-
- // disabled
- GadgetSliderSetDisabledImageTop( slider, winFindImage( "VSliderLargeDisabledTopEnd" ) );
- GadgetSliderSetDisabledImageBottom( slider, winFindImage( "VSliderLargeDisabledBottomEnd" ) );
- GadgetSliderSetDisabledImageCenter( slider, winFindImage( "VSliderLargeDisabledRepeatingCenter" ) );
- GadgetSliderSetDisabledImageSmallCenter( slider, winFindImage( "VSliderLargeDisabledSmallRepeatingCenter" ) );
- GadgetSliderSetDisabledThumbImage( slider, winFindImage( "VSliderLargeThumbDisabled" ) );
- GadgetSliderSetDisabledSelectedThumbImage( slider, winFindImage( "VSliderLargeThumbDisabled" ) );
-
- // hilite
- GadgetSliderSetHiliteImageTop( slider, winFindImage( "VSliderLargeHiliteTopEnd" ) );
- GadgetSliderSetHiliteImageBottom( slider, winFindImage( "VSliderLargeHiliteBottomEnd" ) );
- GadgetSliderSetHiliteImageCenter( slider, winFindImage( "VSliderLargeHiliteRepeatingCenter" ) );
- GadgetSliderSetHiliteImageSmallCenter( slider, winFindImage( "VSliderLargeHiliteSmallRepeatingCenter" ) );
- GadgetSliderSetHiliteThumbImage( slider, winFindImage( "VSliderLargeThumbHilite" ) );
- GadgetSliderSetHiliteSelectedThumbImage( slider, winFindImage( "VSliderLargeThumbHilite" ) );
-
- // up button ------------------------------------------------------------
-
- // enabled
- GadgetButtonSetEnabledImage( upButton, winFindImage( "VSliderLargeUpButtonEnabled" ) );
- GadgetButtonSetEnabledSelectedImage( upButton, winFindImage( "VSliderLargeUpButtonEnabled" ) );
-
- // disabled
- GadgetButtonSetDisabledImage( upButton, winFindImage( "VSliderLargeUpButtonDisabled" ) );
- GadgetButtonSetDisabledSelectedImage( upButton, winFindImage( "VSliderLargeUpButtonDisabled" ) );
-
- // hilite
- GadgetButtonSetHiliteImage( upButton, winFindImage( "VSliderLargeUpButtonHilite" ) );
- GadgetButtonSetHiliteSelectedImage( upButton, winFindImage( "VSliderLargeUpButtonHiliteSelected" ) );
-
- // down button ----------------------------------------------------------
-
- // enabled
- GadgetButtonSetEnabledImage( downButton, winFindImage( "VSliderLargeDownButtonEnabled" ) );
- GadgetButtonSetEnabledSelectedImage( downButton, winFindImage( "VSliderLargeDownButtonEnabled" ) );
-
- // disabled
- GadgetButtonSetDisabledImage( downButton, winFindImage( "VSliderLargeDownButtonDisabled" ) );
- GadgetButtonSetDisabledSelectedImage( downButton, winFindImage( "VSliderLargeDownButtonDisabled" ) );
-
- // hilite
- GadgetButtonSetHiliteImage( downButton, winFindImage( "VSliderLargeDownButtonHilite" ) );
- GadgetButtonSetHiliteSelectedImage( downButton, winFindImage( "VSliderLargeDownButtonHiliteSelected" ) );
-
- }
- }
- }
- else if( BitIsSet( instData->getStyle(), GWS_PROGRESS_BAR ) )
- {
-
- // enabled
- GadgetProgressBarSetEnabledColor( gadget, red );
- GadgetProgressBarSetEnabledBorderColor( gadget, lightRed );
- GadgetProgressBarSetEnabledImageLeft( gadget, winFindImage( "ProgressBarEnabledLeftEnd" ) );
- GadgetProgressBarSetEnabledImageRight( gadget, winFindImage( "ProgressBarEnabledRightEnd" ) );
- GadgetProgressBarSetEnabledImageCenter( gadget, winFindImage( "ProgressBarEnabledRepeatingCenter" ) );
- GadgetProgressBarSetEnabledImageSmallCenter( gadget, winFindImage( "ProgressBarEnabledSmallRepeatingCenter" ) );
- GadgetProgressBarSetEnabledBarColor( gadget, yellow );
- GadgetProgressBarSetEnabledBarBorderColor( gadget, white );
- GadgetProgressBarSetEnabledBarImageLeft( gadget, winFindImage( "ProgressBarEnabledBarLeftEnd" ) );
- GadgetProgressBarSetEnabledBarImageRight( gadget, winFindImage( "ProgressBarEnabledBarRightEnd" ) );
- GadgetProgressBarSetEnabledBarImageCenter( gadget, winFindImage( "ProgressBarEnabledBarRepeatingCenter" ) );
- GadgetProgressBarSetEnabledBarImageSmallCenter( gadget, winFindImage( "ProgressBarEnabledBarSmallRepeatingCenter" ) );
-
- // disabled
- GadgetProgressBarSetDisabledColor( gadget, darkGray );
- GadgetProgressBarSetDisabledBorderColor( gadget, lightGray );
- GadgetProgressBarSetDisabledImageLeft( gadget, winFindImage( "ProgressBarDisabledLeftEnd" ) );
- GadgetProgressBarSetDisabledImageRight( gadget, winFindImage( "ProgressBarDisabledRightEnd" ) );
- GadgetProgressBarSetDisabledImageCenter( gadget, winFindImage( "ProgressBarDisabledRepeatingCenter" ) );
- GadgetProgressBarSetDisabledImageSmallCenter( gadget, winFindImage( "ProgressBarDisabledSmallRepeatingCenter" ) );
- GadgetProgressBarSetDisabledBarColor( gadget, lightGray );
- GadgetProgressBarSetDisabledBarBorderColor( gadget, white );
- GadgetProgressBarSetDisabledBarImageLeft( gadget, winFindImage( "ProgressBarDisabledBarLeftEnd" ) );
- GadgetProgressBarSetDisabledBarImageRight( gadget, winFindImage( "ProgressBarDisabledBarRightEnd" ) );
- GadgetProgressBarSetDisabledBarImageCenter( gadget, winFindImage( "ProgressBarDisabledBarRepeatingCenter" ) );
- GadgetProgressBarSetDisabledBarImageSmallCenter( gadget, winFindImage( "ProgressBarDisabledBarSmallRepeatingCenter" ) );
-
- // Hilite
- GadgetProgressBarSetHiliteColor( gadget, green );
- GadgetProgressBarSetHiliteBorderColor( gadget, darkGreen );
- GadgetProgressBarSetHiliteImageLeft( gadget, winFindImage( "ProgressBarHiliteLeftEnd" ) );
- GadgetProgressBarSetHiliteImageRight( gadget, winFindImage( "ProgressBarHiliteRightEnd" ) );
- GadgetProgressBarSetHiliteImageCenter( gadget, winFindImage( "ProgressBarHiliteRepeatingCenter" ) );
- GadgetProgressBarSetHiliteImageSmallCenter( gadget, winFindImage( "ProgressBarHiliteSmallRepeatingCenter" ) );
- GadgetProgressBarSetHiliteBarColor( gadget, yellow );
- GadgetProgressBarSetHiliteBarBorderColor( gadget, white );
- GadgetProgressBarSetHiliteBarImageLeft( gadget, winFindImage( "ProgressBarHiliteBarLeftEnd" ) );
- GadgetProgressBarSetHiliteBarImageRight( gadget, winFindImage( "ProgressBarHiliteBarRightEnd" ) );
- GadgetProgressBarSetHiliteBarImageCenter( gadget, winFindImage( "ProgressBarHiliteBarRepeatingCenter" ) );
- GadgetProgressBarSetHiliteBarImageSmallCenter( gadget, winFindImage( "ProgressBarHiliteBarSmallRepeatingCenter" ) );
-
- }
- else if( BitIsSet( instData->getStyle(), GWS_STATIC_TEXT ) )
- {
-
- // enabled
- GadgetStaticTextSetEnabledImage( gadget, winFindImage( "StaticTextEnabled" ) );
- GadgetStaticTextSetEnabledColor( gadget, red );
- GadgetStaticTextSetEnabledBorderColor( gadget, lightRed );
-
- // disabled
- GadgetStaticTextSetDisabledImage( gadget, winFindImage( "StaticTextDisabled" ) );
- GadgetStaticTextSetDisabledColor( gadget, darkGray );
- GadgetStaticTextSetDisabledBorderColor( gadget, lightGray );
-
- // hilite
- GadgetStaticTextSetHiliteImage( gadget, winFindImage( "StaticTextHilite" ) );
- GadgetStaticTextSetHiliteColor( gadget, darkGreen );
- GadgetStaticTextSetHiliteBorderColor( gadget, lightGreen );
-
- // set default text colors for the gadget
- gadget->winSetEnabledTextColors( enabledText, enabledTextBorder );
- gadget->winSetDisabledTextColors( disabledText, disabledTextBorder );
- gadget->winSetHiliteTextColors( hiliteText, hiliteTextBorder );
- gadget->winSetIMECompositeTextColors( imeCompositeText, imeCompositeTextBorder );
-
- }
- else if( BitIsSet( instData->getStyle(), GWS_ENTRY_FIELD ) )
- {
-
- // enabled
- GadgetTextEntrySetEnabledImageLeft( gadget, winFindImage( "TextEntryEnabledLeftEnd" ) );
- GadgetTextEntrySetEnabledImageRight( gadget, winFindImage( "TextEntryEnabledRightEnd" ) );
- GadgetTextEntrySetEnabledImageCenter( gadget, winFindImage( "TextEntryEnabledRepeatingCenter" ) );
- GadgetTextEntrySetEnabledImageSmallCenter( gadget, winFindImage( "TextEntryEnabledSmallRepeatingCenter" ) );
- GadgetTextEntrySetEnabledColor( gadget, red );
- GadgetTextEntrySetEnabledBorderColor( gadget, lightRed );
-
- // disabled
- GadgetTextEntrySetDisabledImageLeft( gadget, winFindImage( "TextEntryDisabledLeftEnd" ) );
- GadgetTextEntrySetDisabledImageRight( gadget, winFindImage( "TextEntryDisabledRightEnd" ) );
- GadgetTextEntrySetDisabledImageCenter( gadget, winFindImage( "TextEntryDisabledRepeatingCenter" ) );
- GadgetTextEntrySetDisabledImageSmallCenter( gadget, winFindImage( "TextEntryDisabledSmallRepeatingCenter" ) );
- GadgetTextEntrySetDisabledColor( gadget, gray );
- GadgetTextEntrySetDisabledBorderColor( gadget, black );
-
- // hilited
- GadgetTextEntrySetHiliteImageLeft( gadget, winFindImage( "TextEntryHiliteLeftEnd" ) );
- GadgetTextEntrySetHiliteImageRight( gadget, winFindImage( "TextEntryHiliteRightEnd" ) );
- GadgetTextEntrySetHiliteImageCenter( gadget, winFindImage( "TextEntryHiliteRepeatingCenter" ) );
- GadgetTextEntrySetHiliteImageSmallCenter( gadget, winFindImage( "TextEntryHiliteSmallRepeatingCenter" ) );
- GadgetTextEntrySetHiliteColor( gadget, green );
- GadgetTextEntrySetHiliteBorderColor( gadget, darkGreen );
-
- // set default text colors for the gadget
- gadget->winSetEnabledTextColors( enabledText, enabledTextBorder );
- gadget->winSetDisabledTextColors( disabledText, disabledTextBorder );
- gadget->winSetHiliteTextColors( hiliteText, hiliteTextBorder );
- gadget->winSetIMECompositeTextColors( imeCompositeText, imeCompositeTextBorder );
-
- }
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Given a text label, retreive the real localized text associated
- * with that label */
-//-------------------------------------------------------------------------------------------------
-UnicodeString GameWindowManager::winTextLabelToText( AsciiString label )
-{
-
- // sanity
- if( label.isEmpty() )
- return UnicodeString::TheEmptyString;
-
- /// @todo we need to write the string manager here, this is TEMPORARY!!!
- UnicodeString tmp;
- tmp.translate(label);
- return tmp;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** find the top window at the given coordinates */
-//-------------------------------------------------------------------------------------------------
-GameWindow *GameWindowManager::getWindowUnderCursor( Int x, Int y, Bool ignoreEnabled )
-{
- if( m_mouseCaptor )
- {
- // in what what window within the captured window are we?
- return m_mouseCaptor->winPointInChild( x, y, ignoreEnabled );
- }
-
- if( m_grabWindow )
- {
- // in what what window within the grabbed window are we?
- return m_grabWindow->winPointInChild( x, y, ignoreEnabled );
- }
-
- GameWindow *window = nullptr;
- if( m_modalHead && m_modalHead->window )
- {
- return m_modalHead->window->winPointInChild( x, y, ignoreEnabled );
- }
- else
- {
- // search for top-level window which contains pointer
- for( window = m_windowList; window; window = window->m_next )
- {
-
- if( BitIsSet( window->m_status, WIN_STATUS_ABOVE ) &&
- !BitIsSet( window->m_status, WIN_STATUS_HIDDEN ) &&
- x >= window->m_region.lo.x &&
- x <= window->m_region.hi.x &&
- y >= window->m_region.lo.y &&
- y <= window->m_region.hi.y)
- {
- if( BitIsSet( window->m_status, WIN_STATUS_ENABLED ) || ignoreEnabled )
- {
- // determine which child window the mouse is in
- window = window->winPointInChild( x, y, ignoreEnabled );
- break; // exit for
- }
- }
- }
-
- // check !above, below and hidden
- if( window == nullptr )
- {
- for( window = m_windowList; window; window = window->m_next )
- {
- if( !BitIsSet( window->m_status, WIN_STATUS_ABOVE |
- WIN_STATUS_BELOW |
- WIN_STATUS_HIDDEN ) &&
- x >= window->m_region.lo.x &&
- x <= window->m_region.hi.x &&
- y >= window->m_region.lo.y &&
- y <= window->m_region.hi.y)
- {
- if( BitIsSet( window->m_status, WIN_STATUS_ENABLED )|| ignoreEnabled)
- {
- // determine which child window the mouse is in
- window = window->winPointInChild( x, y, ignoreEnabled );
- break; // exit for
- }
- }
- }
- }
-
- // check below and !hidden
- if( window == nullptr )
- {
- for( window = m_windowList; window; window = window->m_next )
- {
- if( BitIsSet( window->m_status, WIN_STATUS_BELOW ) &&
- !BitIsSet( window->m_status, WIN_STATUS_HIDDEN ) &&
- x >= window->m_region.lo.x &&
- x <= window->m_region.hi.x &&
- y >= window->m_region.lo.y &&
- y <= window->m_region.hi.y)
- {
- if( BitIsSet( window->m_status, WIN_STATUS_ENABLED )|| ignoreEnabled)
- {
- // determine which child window the mouse is in
- window = window->winPointInChild( x, y, ignoreEnabled );
- break; // exit for
- }
- }
- }
- }
- }
-
- if( window )
- {
- if( BitIsSet( window->m_status, WIN_STATUS_NO_INPUT ))
- {
- // this window does not accept input, discard
- window = nullptr;
- }
- else if( ignoreEnabled && !( BitIsSet( window->m_status, WIN_STATUS_ENABLED ) ))
- {
- window = nullptr;
- }
- }
-
- return window;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-static WindowMsgHandledType testGrab( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
-
- switch( msg )
- {
-
- case GWM_LEFT_DOWN: return MSG_HANDLED; // use it
-
- }
-
- return MSG_IGNORED;
-
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Just for testing */
-//-------------------------------------------------------------------------------------------------
-Bool GameWindowManager::initTestGUI()
-{
-
-// winCreateFromScript( "_ATest.wnd" );
- return TRUE;
-
-// UnsignedByte alpha = 200;
- GameWindow *window;
- UnsignedInt statusFlags = WIN_STATUS_ENABLED | WIN_STATUS_DRAGGABLE | WIN_STATUS_IMAGE;
- WinInstanceData instData;
-
- // make some windows inside each other in the upper left
- window = winCreate( nullptr, statusFlags, 0, 0, 100, 100, nullptr, nullptr );
- window->winSetInputFunc( testGrab );
- window->winSetEnabledColor( 0, winMakeColor( 255, 254, 255, 255 ) );
- window->winSetEnabledBorderColor( 0 , winMakeColor( 0, 0, 0, 255 ) );
- window = winCreate( window, statusFlags, 10, 10, 50, 50, nullptr, nullptr );
- window->winSetInputFunc( testGrab );
- window->winSetEnabledColor( 0, winMakeColor( 128, 128, 128, 255 ) );
- window->winSetEnabledBorderColor( 0 , winMakeColor( 0, 0, 0, 255 ) );
-
- // make a push button
- instData.init();
- BitSet( instData.m_style, GWS_PUSH_BUTTON | GWS_MOUSE_TRACK );
- instData.m_textLabelString = "What Up?";
- window = gogoGadgetPushButton( nullptr,
- WIN_STATUS_ENABLED | WIN_STATUS_IMAGE,
- 200, 100,
- 100, 30,
- &instData, nullptr, TRUE );
-
- // make a push button
- instData.init();
- BitSet( instData.m_style, GWS_PUSH_BUTTON | GWS_MOUSE_TRACK );
- instData.m_textLabelString = "Enabled";
- window = gogoGadgetPushButton( nullptr,
- WIN_STATUS_ENABLED,
- 330, 100,
- 100, 30,
- &instData, nullptr, TRUE );
-
- // make a push button
- instData.init();
- BitSet( instData.m_style, GWS_PUSH_BUTTON | GWS_MOUSE_TRACK );
- instData.m_textLabelString = "Disabled";
- window = gogoGadgetPushButton( nullptr,
- 0,
- 450, 100,
- 100, 30,
- &instData, nullptr, TRUE );
-
- // make a check box
- instData.init();
- instData.m_style = GWS_CHECK_BOX | GWS_MOUSE_TRACK;
- instData.m_textLabelString = "Check";
- window = gogoGadgetCheckbox( nullptr,
- WIN_STATUS_ENABLED |
- WIN_STATUS_IMAGE,
- 200, 150,
- 100, 30,
- &instData, nullptr, TRUE );
-
- // make a check box
- instData.init();
- instData.m_style = GWS_CHECK_BOX | GWS_MOUSE_TRACK;
- instData.m_textLabelString = "Check";
- window = gogoGadgetCheckbox( nullptr,
- WIN_STATUS_ENABLED,
- 330, 150,
- 100, 30,
- &instData, nullptr, TRUE );
-
- // make window to hold radio buttons
- window = winCreate( nullptr, WIN_STATUS_ENABLED | WIN_STATUS_DRAGGABLE,
- 200, 200, 250, 45, nullptr );
- window->winSetInputFunc( testGrab );
- window->winSetEnabledColor( 0, winMakeColor( 50, 50, 50, 200 ) );
- window->winSetEnabledBorderColor( 0, winMakeColor( 254, 254, 254, 255 ) );
-
- // make a radio button
- GameWindow *radio;
- RadioButtonData rData;
- instData.init();
- instData.m_style = GWS_RADIO_BUTTON | GWS_MOUSE_TRACK;
- instData.m_textLabelString = "Mama Said!";
- rData.group = 1;
- radio = gogoGadgetRadioButton( window,
- WIN_STATUS_ENABLED | WIN_STATUS_IMAGE,
- 10, 10,
- 100, 30,
- &instData,
- &rData, nullptr, TRUE );
-
- // make a radio button
- instData.init();
- instData.m_style = GWS_RADIO_BUTTON | GWS_MOUSE_TRACK;
- instData.m_textLabelString = "On the Run";
- radio = gogoGadgetRadioButton( window,
- WIN_STATUS_ENABLED,
- 130, 10,
- 100, 30,
- &instData,
- &rData, nullptr, TRUE );
- GadgetRadioSetEnabledColor( radio, GameMakeColor( 0, 0, 255, 255 ) );
- GadgetRadioSetEnabledBorderColor( radio, GameMakeColor( 0, 0, 255, 255 ) );
-
- // make a listbox
- ListboxData listData;
- memset( &listData, 0, sizeof( ListboxData ) );
- listData.listLength = 8;
- listData.autoScroll = 1;
- listData.scrollIfAtEnd = FALSE;
- listData.autoPurge = 1;
- listData.scrollBar = 1;
- listData.multiSelect = 1;
- listData.forceSelect = 0;
- listData.columns = 1;
- listData.columnWidth = nullptr;
- instData.init();
- instData.m_style = GWS_SCROLL_LISTBOX | GWS_MOUSE_TRACK;
- window = gogoGadgetListBox( nullptr,
- WIN_STATUS_ENABLED,
- 200, 250,
- 100, 100,
- &instData,
- &listData, nullptr, TRUE );
- GadgetListBoxAddEntryText( window, L"Listbox text",
- winMakeColor( 255, 255, 255, 255 ), -1, 0 );
- GadgetListBoxAddEntryText( window, L"More text",
- winMakeColor( 105, 105, 255, 255 ), -1, 0 );
- GadgetListBoxAddEntryText( window, L"Nothing",
- winMakeColor( 105, 105, 255, 255 ), -1, 0 );
- GadgetListBoxAddEntryText( window, L"Seasons",
- winMakeColor( 105, 205, 255, 255 ), -1, 0 );
- GadgetListBoxAddEntryText( window, L"Misery",
- winMakeColor( 235, 105, 255, 255 ), -1, 0 );
- GadgetListBoxAddEntryText( window, L"Natural",
- winMakeColor( 105, 205, 45, 255 ), -1, 0 );
- window->winSetFont( TheFontLibrary->getFont( "Times New Roman", 12, FALSE ) );
-
- // make a listbox
- memset( &listData, 0, sizeof( ListboxData ) );
- listData.listLength = 8;
- listData.autoScroll = 1;
- listData.scrollIfAtEnd = FALSE;
- listData.autoPurge = 1;
- listData.scrollBar = 1;
- listData.multiSelect = 0;
- listData.forceSelect = 0;
- listData.columns = 1;
- listData.columnWidth = nullptr;
- instData.init();
- instData.m_style = GWS_SCROLL_LISTBOX | GWS_MOUSE_TRACK;
- window = gogoGadgetListBox( nullptr,
- WIN_STATUS_ENABLED | WIN_STATUS_IMAGE,
- 75, 250,
- 100, 100,
- &instData,
- &listData, nullptr, TRUE );
- GadgetListBoxAddEntryText( window, L"Listbox text",
- winMakeColor( 255, 255, 255, 255 ), -1, -1 );
- GadgetListBoxAddEntryText( window, L"More text",
- winMakeColor( 105, 105, 255, 255 ), -1, -1 );
- GadgetListBoxAddEntryText( window, L"Nothing",
- winMakeColor( 105, 105, 255, 255 ), -1, -1 );
- GadgetListBoxAddEntryText( window, L"Seasons",
- winMakeColor( 105, 205, 255, 255 ), -1, -1 );
- GadgetListBoxAddEntryText( window, L"Misery",
- winMakeColor( 235, 105, 255, 255 ), -1, -1 );
- GadgetListBoxAddEntryText( window, L"Natural",
- winMakeColor( 105, 205, 45, 255 ), -1, -1 );
-
- // make a vert slider
- SliderData sliderData;
- memset( &sliderData, 0, sizeof( sliderData ) );
- sliderData.maxVal = 100;
- sliderData.minVal = 0;
- sliderData.numTicks = 100;
- sliderData.position = 0;
- instData.init();
- instData.m_style = GWS_VERT_SLIDER | GWS_MOUSE_TRACK;
- window = gogoGadgetSlider( nullptr,
- WIN_STATUS_ENABLED,
- 360, 250,
- 11, 100,
- &instData,
- &sliderData, nullptr, TRUE );
-
- // make a vert slider
- memset( &sliderData, 0, sizeof( sliderData ) );
- sliderData.maxVal = 100;
- sliderData.minVal = 0;
- sliderData.numTicks = 100;
- sliderData.position = 0;
- instData.init();
- instData.m_style = GWS_VERT_SLIDER | GWS_MOUSE_TRACK;
- window = gogoGadgetSlider( nullptr,
- WIN_STATUS_ENABLED | WIN_STATUS_IMAGE,
- 400, 250,
- 11, 100,
- &instData,
- &sliderData, nullptr, TRUE );
-
- // make a horizontal slider
- memset( &sliderData, 0, sizeof( sliderData ) );
- sliderData.maxVal = 100;
- sliderData.minVal = 0;
- sliderData.numTicks = 100;
- sliderData.position = 0;
- instData.init();
- instData.m_style = GWS_HORZ_SLIDER | GWS_MOUSE_TRACK;
- window = gogoGadgetSlider( nullptr,
- WIN_STATUS_ENABLED,
- 200, 400,
- 200, 11,
- &instData,
- &sliderData, nullptr, TRUE );
-
- // make a horizontal slider
- memset( &sliderData, 0, sizeof( sliderData ) );
- sliderData.maxVal = 100;
- sliderData.minVal = 0;
- sliderData.numTicks = 100;
- sliderData.position = 0;
- instData.init();
- instData.m_style = GWS_HORZ_SLIDER | GWS_MOUSE_TRACK;
- window = gogoGadgetSlider( nullptr,
- WIN_STATUS_ENABLED | WIN_STATUS_IMAGE,
- 200, 420,
- 200, 11,
- &instData,
- &sliderData, nullptr, TRUE );
-
- // make a progress bar
- instData.init();
- instData.m_style = GWS_PROGRESS_BAR | GWS_MOUSE_TRACK;
- window = gogoGadgetProgressBar( nullptr,
- WIN_STATUS_ENABLED,
- 200, 450,
- 250, 15,
- &instData, nullptr, TRUE );
-
- // make a progress bar
- instData.init();
- instData.m_style = GWS_PROGRESS_BAR | GWS_MOUSE_TRACK;
- window = gogoGadgetProgressBar( nullptr,
- WIN_STATUS_ENABLED | WIN_STATUS_IMAGE,
- 200, 470,
- 250, 15,
- &instData, nullptr, TRUE );
-
- // make some static text
- TextData textData;
- textData.centered = 1;
- instData.init();
- instData.m_style = GWS_STATIC_TEXT | GWS_MOUSE_TRACK;
- instData.m_textLabelString = "Centered Static Text";
- window = gogoGadgetStaticText( nullptr,
- WIN_STATUS_ENABLED,
- 200, 490,
- 300, 25,
- &instData,
- &textData, nullptr, TRUE );
-
- // make some static text
- textData.centered = 0;
- instData.init();
- instData.m_style = GWS_STATIC_TEXT | GWS_MOUSE_TRACK;
- instData.m_textLabelString = "Not Centered Static Text";
- window = gogoGadgetStaticText( nullptr,
- WIN_STATUS_ENABLED | WIN_STATUS_IMAGE,
- 200, 520,
- 300, 25,
- &instData,
- &textData, nullptr, TRUE );
- window->winSetEnabledTextColors( winMakeColor( 128, 128, 255, 255 ),
- winMakeColor( 255, 255, 255, 255 ) );
-
- // make some entry text
- EntryData entryData;
- memset( &entryData, 0, sizeof( entryData ) );
- entryData.maxTextLen = 30;
- instData.init();
- instData.m_style = GWS_ENTRY_FIELD | GWS_MOUSE_TRACK;
- instData.m_textLabelString = "Entry";
- window = gogoGadgetTextEntry( nullptr,
- WIN_STATUS_ENABLED,
- 450, 270,
- 400, 30,
- &instData,
- &entryData, nullptr, TRUE );
-
- // make some entry text
- memset( &entryData, 0, sizeof( entryData ) );
- entryData.maxTextLen = 30;
- instData.init();
- instData.m_style = GWS_ENTRY_FIELD | GWS_MOUSE_TRACK;
- instData.m_textLabelString = "Entry";
- window = gogoGadgetTextEntry( nullptr,
- WIN_STATUS_ENABLED | WIN_STATUS_IMAGE,
- 450, 310,
- 400, 30,
- &instData,
- &entryData, nullptr, TRUE );
-
- return TRUE;
-
-}
-
-
-void GameWindowManager::winNextTab( GameWindow *window )
-{
- if(m_tabList.empty()|| m_modalHead)
- return;
-
- GameWindowList::iterator it = m_tabList.begin();
- while( it != m_tabList.end())
- {
- if(*it == window)
- {
- it++;
- break;
- }
- it++;
- }
- if(it != m_tabList.end())
- winSetFocus(*it);
- else
- {
- winSetFocus(*m_tabList.begin());
- }
- winSetLoneWindow(nullptr);
-}
-
-void GameWindowManager::winPrevTab( GameWindow *window )
-{
- if(m_tabList.empty() || m_modalHead)
- return;
-
- GameWindowList::reverse_iterator it = m_tabList.rbegin();
- while( it != m_tabList.rend())
- {
- if(*it == window)
- {
- it++;
- break;
- }
- it++;
- }
- if(it != m_tabList.rend())
- winSetFocus(*it);
- else
- {
- winSetFocus(*m_tabList.rbegin());
- }
- winSetLoneWindow(nullptr);
-}
-
-void GameWindowManager::registerTabList( GameWindowList tabList )
-{
- m_tabList.clear();
- m_tabList = tabList;
-}
-
-void GameWindowManager::clearTabList()
-{
- m_tabList.clear();
-}
-
-
-GameWindow *GameWindowManagerDummy::winGetWindowFromId(GameWindow *window, Int id)
-{
- window = GameWindowManager::winGetWindowFromId(window, id);
- if (window != nullptr)
- return window;
-
- // Just return any window, callers expect this to be non-null
- return m_windowList;
-}
-
-WindowMsgHandledType DummyWindowSystem(GameWindow *window, UnsignedInt msg, WindowMsgData mData1, WindowMsgData mData2)
-{
- return MSG_IGNORED;
-}
-
-GameWindow *GameWindowManagerDummy::winCreateFromScript(AsciiString filenameString, WindowLayoutInfo *info)
-{
- WindowLayoutInfo scriptInfo;
- GameWindow* dummyWindow = winCreate(nullptr, 0, 0, 0, 100, 100, DummyWindowSystem, nullptr);
- scriptInfo.windows.push_back(dummyWindow);
- if (info)
- *info = scriptInfo;
- return dummyWindow;
-}
-
-GameWindowDummy::~GameWindowDummy()
-{
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp
deleted file mode 100644
index 45dd45f9913..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp
+++ /dev/null
@@ -1,323 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: ShellMenuScheme.cpp /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Jul 2002
-//
-// Filename: ShellMenuScheme.cpp
-//
-// author: Chris Huybregts
-//
-// purpose:
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/INI.h"
-#include "GameClient/ShellMenuScheme.h"
-#include "GameClient/Shell.h"
-#include "GameClient/Display.h"
-//-----------------------------------------------------------------------------
-// DEFINES ////////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-const FieldParse ShellMenuSchemeManager::m_shellMenuSchemeFieldParseTable[] =
-{
-
- { "ImagePart", ShellMenuSchemeManager::parseImagePart, nullptr, 0 },
- { "LinePart", ShellMenuSchemeManager::parseLinePart, nullptr, 0 },
- { nullptr, nullptr, nullptr, 0 }
-
-};
-
-//-----------------------------------------------------------------------------
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-void INI::parseShellMenuSchemeDefinition( INI *ini )
-{
- AsciiString name;
- ShellMenuSchemeManager *SMSchemeManager;
- ShellMenuScheme *SMScheme;
-
- // read the name
- const char* c = ini->getNextToken();
- name.set( c );
-
- // find existing item if present
- SMSchemeManager = TheShell->getShellMenuSchemeManager();
- DEBUG_ASSERTCRASH( SMSchemeManager, ("parseShellMenuSchemeDefinition: Unable to Get SMSchemeManager") );
- if( !SMSchemeManager )
- return;
-
- // If we have a previously allocated control bar, this will return a cleared out pointer to it so we
- // can overwrite it
- SMScheme = SMSchemeManager->newShellMenuScheme( name );
-
- // sanity
- DEBUG_ASSERTCRASH( SMScheme, ("parseControlBarSchemeDefinition: Unable to allocate Scheme '%s'", name.str()) );
-
- // parse the ini definition
- ini->initFromINI( SMScheme, SMSchemeManager->getFieldParse() );
-
-}
-
-ShellMenuSchemeLine::ShellMenuSchemeLine()
-{
- m_startPos.x = m_startPos.y = 0;
- m_endPos.x = m_endPos.y = 0;
- m_color = GAME_COLOR_UNDEFINED;
- m_width = 1;
-}
-ShellMenuSchemeLine::~ShellMenuSchemeLine()
-{
-}
-
-ShellMenuSchemeImage::ShellMenuSchemeImage()
-{
- m_name.clear();
- m_position.x = m_position.y = 0;
- m_size.x = m_size.x = 0;
- m_image = nullptr;
-}
-
-ShellMenuSchemeImage::~ShellMenuSchemeImage()
-{
- m_image = nullptr;
-}
-
-ShellMenuScheme::ShellMenuScheme()
-{
-
-}
-
-ShellMenuScheme::~ShellMenuScheme()
-{
- ShellMenuSchemeImageListIt it = m_imageList.begin();
- while(it != m_imageList.end())
- {
- ShellMenuSchemeImage *image = *it;
- it = m_imageList.erase( it );
- delete image;
- }
-
- ShellMenuSchemeLineListIt lineIt = m_lineList.begin();
- while(lineIt != m_lineList.end())
- {
- ShellMenuSchemeLine *line = *lineIt;
- lineIt = m_lineList.erase( lineIt );
- delete line;
- }
-
-
-}
-
-void ShellMenuScheme::addLine( ShellMenuSchemeLine* schemeLine )
-{
- if(!schemeLine)
- return;
-
- m_lineList.push_back( schemeLine );
-}
-
-
-void ShellMenuScheme::addImage( ShellMenuSchemeImage* schemeImage )
-{
- if(!schemeImage)
- return;
-
- m_imageList.push_back( schemeImage );
-}
-
-void ShellMenuScheme::draw()
-{
-
- ShellMenuSchemeImageListIt imageIt = m_imageList.begin();
- while(imageIt != m_imageList.end())
- {
- ShellMenuSchemeImage *image = *imageIt;
- if(image && image->m_image)
- {
- TheDisplay->drawImage(image->m_image, image->m_position.x, image->m_position.y,
- image->m_position.x + image->m_size.x , image->m_position.y + image->m_size.y);
- }
- ++imageIt;
- }
-
- ShellMenuSchemeLineListIt it = m_lineList.begin();
- while(it != m_lineList.end())
- {
- ShellMenuSchemeLine *line = *it;
-
- if(line)
- {
- TheDisplay->drawLine(line->m_startPos.x, line->m_startPos.y, line->m_endPos.x,
- line->m_endPos.y,line->m_width, line->m_color);
- }
- ++it;
- }
-
-
-}
-
-ShellMenuSchemeManager::ShellMenuSchemeManager()
-{
- m_currentScheme = nullptr;
-}
-
-ShellMenuSchemeManager::~ShellMenuSchemeManager()
-{
- m_currentScheme = nullptr;
-
-
- ShellMenuSchemeListIt it = m_schemeList.begin();
- while(it != m_schemeList.end())
- {
- ShellMenuScheme *scheme = *it;
- it = m_schemeList.erase( it );
- delete scheme;
- }
-
-}
-
-void ShellMenuSchemeManager::parseImagePart(INI *ini, void *instance, void* /*store*/, const void* /*userData*/)
-{
- static const FieldParse myFieldParse[] =
- {
- { "Position", INI::parseICoord2D, nullptr, offsetof( ShellMenuSchemeImage, m_position ) },
- { "Size", INI::parseICoord2D, nullptr, offsetof( ShellMenuSchemeImage, m_size ) },
- { "ImageName", INI::parseMappedImage, nullptr, offsetof( ShellMenuSchemeImage, m_image ) },
- { nullptr, nullptr, nullptr, 0 }
- };
-
- ShellMenuSchemeImage *schemeImage = NEW ShellMenuSchemeImage;
- ini->initFromINI(schemeImage, myFieldParse);
- ((ShellMenuScheme*)instance)->addImage(schemeImage);
-
-}
-
-void ShellMenuSchemeManager::parseLinePart(INI *ini, void *instance, void* /*store*/, const void* /*userData*/)
-{
- static const FieldParse myFieldParse[] =
- {
- { "StartPosition", INI::parseICoord2D, nullptr, offsetof( ShellMenuSchemeLine, m_startPos ) },
- { "EndPosition", INI::parseICoord2D, nullptr, offsetof( ShellMenuSchemeLine, m_endPos ) },
- { "Color", INI::parseColorInt, nullptr, offsetof( ShellMenuSchemeLine, m_color ) },
- { "Width", INI::parseInt, nullptr, offsetof( ShellMenuSchemeLine, m_width ) },
-
- { nullptr, nullptr, nullptr, 0 }
- };
-
- ShellMenuSchemeLine *schemeLine = NEW ShellMenuSchemeLine;
- ini->initFromINI(schemeLine, myFieldParse);
- ((ShellMenuScheme*)instance)->addLine(schemeLine);
-
-}
-
-ShellMenuScheme *ShellMenuSchemeManager::newShellMenuScheme(AsciiString name)
-{
- ShellMenuSchemeListIt it;
- it = m_schemeList.begin();
- name.toLower();
- while(it != m_schemeList.end())
- {
- ShellMenuScheme *scheme = *it;
- if(scheme->m_name.compare(name) == 0)
- {
- m_schemeList.erase( it );
- delete scheme;
- break;
- }
- else
- ++it;
- }
- ShellMenuScheme *newScheme = NEW ShellMenuScheme;
- newScheme->m_name.set(name);
- m_schemeList.push_back(newScheme);
- return newScheme;
-}
-
-void ShellMenuSchemeManager::init()
-{
- INI ini;
- // Read from INI all the ControlBarSchemes
- ini.loadFileDirectory( "Data\\INI\\Default\\ShellMenuScheme", INI_LOAD_OVERWRITE, nullptr );
- ini.loadFileDirectory( "Data\\INI\\ShellMenuScheme", INI_LOAD_OVERWRITE, nullptr );
-
-}
-
-void ShellMenuSchemeManager::setShellMenuScheme( AsciiString name )
-{
- if(name.isEmpty())
- {
- m_currentScheme = nullptr;
- return;
- }
-
- ShellMenuSchemeListIt it;
- it = m_schemeList.begin();
- name.toLower();
- while(it != m_schemeList.end())
- {
- ShellMenuScheme *scheme = *it;
- if(scheme->m_name.compare(name) == 0)
- {
- m_currentScheme = scheme;
- break;
- }
- ++it;
- }
-}
-
-void ShellMenuSchemeManager::draw()
-{
- if(m_currentScheme)
- m_currentScheme->draw();
-}
-
-void ShellMenuSchemeManager::update()
-{
-
-}
-//-----------------------------------------------------------------------------
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
diff --git a/Generals/Code/GameEngine/Source/GameClient/GameClientDispatch.cpp b/Generals/Code/GameEngine/Source/GameClient/GameClientDispatch.cpp
deleted file mode 100644
index fb657816171..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/GameClientDispatch.cpp
+++ /dev/null
@@ -1,56 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: .cpp /////////////////////////////////////////////////////////////////////////////////////
-// Author: Colin Day
-// Description: Game Client message dispatcher
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-
-#include "Common/MessageStream.h"
-#include "GameClient/GameClient.h"
-
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-/** The Client message dispatcher, this is the last "translator" on the message
- * stream before the messages go to the network for processing. It gives
- * the client itself the opportunity to respond to any messages on the stream
- * or create new ones to pass along to the network and logic */
-GameMessageDisposition GameClientMessageDispatcher::translateGameMessage(const GameMessage *msg)
-{
- if (msg->getType() >= GameMessage::MSG_BEGIN_NETWORK_MESSAGES && msg->getType() <= GameMessage::MSG_END_NETWORK_MESSAGES)
- return KEEP_MESSAGE;
- if (msg->getType() == GameMessage::MSG_NEW_GAME || msg->getType() == GameMessage::MSG_CLEAR_GAME_DATA)
- return KEEP_MESSAGE;
-
- if (msg->getType() == GameMessage::MSG_FRAME_TICK)
- return KEEP_MESSAGE;
-
- //DEBUG_LOG(("GameClientMessageDispatcher::translateGameMessage() - eating a %s on frame %d",
- //((GameMessage *)msg)->getCommandAsString(), TheGameClient->getFrame()));
-
- return DESTROY_MESSAGE;
-}
diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp
deleted file mode 100644
index 63af29ea6fd..00000000000
--- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp
+++ /dev/null
@@ -1,231 +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. //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-// FILE: HotKey.cpp /////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-//
-// Electronic Arts Pacific.
-//
-// Confidential Information
-// Copyright (C) 2002 - All Rights Reserved
-//
-//-----------------------------------------------------------------------------
-//
-// created: Sep 2002
-//
-// Filename: HotKey.cpp
-//
-// author: Chris Huybregts
-//
-// purpose:
-//
-//-----------------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine
-//-----------------------------------------------------------------------------
-// USER INCLUDES //////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-#include "GameClient/HotKey.h"
-#include "GameClient/KeyDefs.h"
-#include "GameClient/MetaEvent.h"
-#include "GameClient/GameWindow.h"
-#include "GameClient/GameWindowManager.h"
-#include "GameClient/Keyboard.h"
-#include "GameClient/GameText.h"
-#include "Common/AudioEventRTS.h"
-//-----------------------------------------------------------------------------
-// DEFINES ////////////////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-GameMessageDisposition HotKeyTranslator::translateGameMessage(const GameMessage *msg)
-{
- GameMessageDisposition disp = KEEP_MESSAGE;
- GameMessage::Type t = msg->getType();
-
- if ( t == GameMessage::MSG_RAW_KEY_UP)
- {
-
- //char key = msg->getArgument(0)->integer;
- Int keyState = msg->getArgument(1)->integer;
-
- // for our purposes here, we don't care to distinguish between right and left keys,
- // so just fudge a little to simplify things.
- Int newModState = 0;
-
- if( keyState & KEY_STATE_CONTROL )
- {
- newModState |= CTRL;
- }
-
- if( keyState & KEY_STATE_SHIFT )
- {
- newModState |= SHIFT;
- }
-
- if( keyState & KEY_STATE_ALT )
- {
- newModState |= ALT;
- }
- if(newModState != 0)
- return disp;
- WideChar key = TheKeyboard->getPrintableKey((KeyDefType)msg->getArgument(0)->integer, 0);
- UnicodeString uKey;
- uKey.concat(key);
- AsciiString aKey;
- aKey.translate(uKey);
- if(TheHotKeyManager && TheHotKeyManager->executeHotKey(aKey))
- disp = DESTROY_MESSAGE;
- }
- return disp;
-}
-
-//-----------------------------------------------------------------------------
-HotKey::HotKey()
-{
- m_win = nullptr;
- m_key.clear();
-}
-
-//-----------------------------------------------------------------------------
-HotKeyManager::HotKeyManager()
-{
-
-}
-
-//-----------------------------------------------------------------------------
-HotKeyManager::~HotKeyManager()
-{
- m_hotKeyMap.clear();
-}
-
-//-----------------------------------------------------------------------------
-void HotKeyManager::init()
-{
- m_hotKeyMap.clear();
-}
-
-//-----------------------------------------------------------------------------
-void HotKeyManager::reset()
-{
- m_hotKeyMap.clear();
-}
-
-//-----------------------------------------------------------------------------
-void HotKeyManager::addHotKey( GameWindow *win, const AsciiString& keyIn)
-{
- AsciiString key = keyIn;
- key.toLower();
- HotKeyMap::iterator it = m_hotKeyMap.find(key);
- if( it != m_hotKeyMap.end() )
- {
- DEBUG_CRASH(("Hotkey %s is already mapped to window %s, current window is %s", key.str(), it->second.m_win->winGetInstanceData()->m_decoratedNameString.str(), win->winGetInstanceData()->m_decoratedNameString.str()));
- return;
- }
- HotKey newHK;
- newHK.m_key.set(key);
- newHK.m_win = win;
- m_hotKeyMap[key] = newHK;
-}
-
-//-----------------------------------------------------------------------------
-Bool HotKeyManager::executeHotKey( const AsciiString& keyIn )
-{
- AsciiString key = keyIn;
- key.toLower();
- HotKeyMap::iterator it = m_hotKeyMap.find(key);
- if( it == m_hotKeyMap.end() )
- return FALSE;
- GameWindow *win = it->second.m_win;
- if( !win )
- return FALSE;
- if( !BitIsSet( win->winGetStatus(), WIN_STATUS_HIDDEN ) )
- {
- if( BitIsSet( win->winGetStatus(), WIN_STATUS_ENABLED ) )
- {
- TheWindowManager->winSendSystemMsg( win->winGetParent(), GBM_SELECTED, (WindowMsgData)win, win->winGetWindowId() );
-
- // here we make the same click sound that the GUI uses when you click a button
- AudioEventRTS buttonClick("GUIClick");
-
- if( TheAudio )
- {
- TheAudio->addAudioEvent( &buttonClick );
- }
- return TRUE;
- }
-
- AudioEventRTS disabledClick( "GUIClickDisabled" );
- if( TheAudio )
- {
- TheAudio->addAudioEvent( &disabledClick );
- }
- }
- return FALSE;
-}
-
-//-----------------------------------------------------------------------------
-AsciiString HotKeyManager::searchHotKey( const AsciiString& label)
-{
- return searchHotKey(TheGameText->fetch(label));
-}
-
-//-----------------------------------------------------------------------------
-AsciiString HotKeyManager::searchHotKey( const UnicodeString& uStr )
-{
- if(uStr.isEmpty())
- return AsciiString::TheEmptyString;
-
- const WideChar *marker = (const WideChar *)uStr.str();
- while (marker && *marker)
- {
- if (*marker == L'&')
- {
- // found a '&' - now look for the next char
- UnicodeString tmp = UnicodeString::TheEmptyString;
- tmp.concat(*(marker+1));
- AsciiString retStr;
- retStr.translate(tmp);
- return retStr;
- }
- marker++;
- }
- return AsciiString::TheEmptyString;
-}
-
-//-----------------------------------------------------------------------------
-HotKeyManager *TheHotKeyManager = nullptr;
-
-//-----------------------------------------------------------------------------
-// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
-//-----------------------------------------------------------------------------
-
diff --git a/GeneralsMD/Code/GameEngine/CMakeLists.txt b/GeneralsMD/Code/GameEngine/CMakeLists.txt
index e397fe32d5b..b615a400bcf 100644
--- a/GeneralsMD/Code/GameEngine/CMakeLists.txt
+++ b/GeneralsMD/Code/GameEngine/CMakeLists.txt
@@ -135,7 +135,7 @@ set(GAMEENGINE_SRC
# Include/Common/XferLoad.h
# Include/Common/XferSave.h
# Include/GameClient/Anim2D.h
- Include/GameClient/AnimateWindowManager.h
+# Include/GameClient/AnimateWindowManager.h
Include/GameClient/CampaignManager.h
# Include/GameClient/ChallengeGenerals.h
# Include/GameClient/ClientInstance.h
@@ -143,11 +143,11 @@ set(GAMEENGINE_SRC
# Include/GameClient/Color.h
Include/GameClient/CommandXlat.h
Include/GameClient/ControlBar.h
- Include/GameClient/ControlBarResizer.h
+# Include/GameClient/ControlBarResizer.h
Include/GameClient/ControlBarScheme.h
# Include/GameClient/Credits.h
# Include/GameClient/DebugDisplay.h
- Include/GameClient/Diplomacy.h
+# Include/GameClient/Diplomacy.h
Include/GameClient/DisconnectMenu.h
# Include/GameClient/Display.h
# Include/GameClient/DisplayString.h
@@ -155,30 +155,30 @@ 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/ExtendedMessageBox.h
Include/GameClient/FontDesc.h
# Include/GameClient/FXList.h
Include/GameClient/Gadget.h
- Include/GameClient/GadgetCheckBox.h
- Include/GameClient/GadgetComboBox.h
- Include/GameClient/GadgetListBox.h
- Include/GameClient/GadgetProgressBar.h
- Include/GameClient/GadgetPushButton.h
- Include/GameClient/GadgetRadioButton.h
- Include/GameClient/GadgetSlider.h
- Include/GameClient/GadgetStaticText.h
- Include/GameClient/GadgetTabControl.h
- Include/GameClient/GadgetTextEntry.h
+# Include/GameClient/GadgetCheckBox.h
+# Include/GameClient/GadgetComboBox.h
+# Include/GameClient/GadgetListBox.h
+# Include/GameClient/GadgetProgressBar.h
+# Include/GameClient/GadgetPushButton.h
+# Include/GameClient/GadgetRadioButton.h
+# Include/GameClient/GadgetSlider.h
+# Include/GameClient/GadgetStaticText.h
+# Include/GameClient/GadgetTabControl.h
+# Include/GameClient/GadgetTextEntry.h
Include/GameClient/GameClient.h
# Include/GameClient/GameFont.h
Include/GameClient/GameInfoWindow.h
# Include/GameClient/GameText.h
# Include/GameClient/GameWindow.h
# Include/GameClient/GameWindowGlobal.h
- Include/GameClient/GameWindowID.h
- Include/GameClient/GameWindowManager.h
+# Include/GameClient/GameWindowID.h
+# Include/GameClient/GameWindowManager.h
# Include/GameClient/GameWindowTransitions.h
# Include/GameClient/GlobalLanguage.h
# Include/GameClient/GraphDraw.h
@@ -186,7 +186,7 @@ set(GAMEENGINE_SRC
Include/GameClient/GUICommandTranslator.h
# Include/GameClient/HeaderTemplate.h
Include/GameClient/HintSpy.h
- Include/GameClient/HotKey.h
+# Include/GameClient/HotKey.h
# Include/GameClient/Image.h
# Include/GameClient/IMEManager.h
Include/GameClient/InGameUI.h
@@ -197,7 +197,7 @@ set(GAMEENGINE_SRC
# Include/GameClient/LoadScreen.h
Include/GameClient/LookAtXlat.h
# Include/GameClient/MapUtil.h
- Include/GameClient/MessageBox.h
+# Include/GameClient/MessageBox.h
Include/GameClient/MetaEvent.h
# Include/GameClient/Module/AnimatedParticleSysBoneClientUpdate.h
# Include/GameClient/Module/BeaconClientUpdate.h
@@ -212,9 +212,9 @@ set(GAMEENGINE_SRC
# Include/GameClient/SelectionInfo.h
Include/GameClient/SelectionXlat.h
Include/GameClient/Shadow.h
- Include/GameClient/Shell.h
- Include/GameClient/ShellHooks.h
- Include/GameClient/ShellMenuScheme.h
+# Include/GameClient/Shell.h
+# Include/GameClient/ShellHooks.h
+# Include/GameClient/ShellMenuScheme.h
# Include/GameClient/Smudge.h
# Include/GameClient/Snow.h
# Include/GameClient/Statistics.h
@@ -690,101 +690,101 @@ set(GAMEENGINE_SRC
Source/GameClient/Eva.cpp
# Source/GameClient/FXList.cpp
Source/GameClient/GameClient.cpp
- Source/GameClient/GameClientDispatch.cpp
+# Source/GameClient/GameClientDispatch.cpp
# Source/GameClient/GameText.cpp
# Source/GameClient/GlobalLanguage.cpp
# Source/GameClient/GraphDraw.cpp
- Source/GameClient/GUI/AnimateWindowManager.cpp
+# Source/GameClient/GUI/AnimateWindowManager.cpp
# Source/GameClient/GUI/ChallengeGenerals.cpp
Source/GameClient/GUI/ControlBar/ControlBar.cpp
Source/GameClient/GUI/ControlBar/ControlBarBeacon.cpp
Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp
Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp
- Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp
- Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp
+# Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp
+# Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp
Source/GameClient/GUI/ControlBar/ControlBarOCLTimer.cpp
- Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp
- Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp
+# Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp
+# Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp
Source/GameClient/GUI/ControlBar/ControlBarScheme.cpp
Source/GameClient/GUI/ControlBar/ControlBarStructureInventory.cpp
- Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp
+# Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp
Source/GameClient/GUI/DisconnectMenu/DisconnectMenu.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
- Source/GameClient/GUI/Gadget/GadgetListBox.cpp
- Source/GameClient/GUI/Gadget/GadgetProgressBar.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
+# Source/GameClient/GUI/Gadget/GadgetListBox.cpp
+# Source/GameClient/GUI/Gadget/GadgetProgressBar.cpp
Source/GameClient/GUI/Gadget/GadgetPushButton.cpp
- Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp
- Source/GameClient/GUI/Gadget/GadgetStaticText.cpp
- Source/GameClient/GUI/Gadget/GadgetTabControl.cpp
- Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp
- Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp
+# Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp
+# Source/GameClient/GUI/Gadget/GadgetStaticText.cpp
+# Source/GameClient/GUI/Gadget/GadgetTabControl.cpp
+# Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp
+# Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp
# Source/GameClient/GUI/GameFont.cpp
# Source/GameClient/GUI/GameWindow.cpp
# Source/GameClient/GUI/GameWindowGlobal.cpp
- Source/GameClient/GUI/GameWindowManager.cpp
+# Source/GameClient/GUI/GameWindowManager.cpp
Source/GameClient/GUI/GameWindowManagerScript.cpp
# Source/GameClient/GUI/GameWindowTransitions.cpp
Source/GameClient/GUI/GameWindowTransitionsStyles.cpp
Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp
Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp
- Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp
- Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp
+# Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp
+# Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp
Source/GameClient/GUI/GUICallbacks/GeneralsExpPoints.cpp
Source/GameClient/GUI/GUICallbacks/IMECandidate.cpp
- Source/GameClient/GUI/GUICallbacks/InGameChat.cpp
- Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp
+# Source/GameClient/GUI/GUICallbacks/InGameChat.cpp
+# Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp
Source/GameClient/GUI/GUICallbacks/Menus/ChallengeMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp
Source/GameClient/GUI/GUICallbacks/Menus/DisconnectWindow.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/EstablishConnectionsWindow.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/EstablishConnectionsWindow.cpp
Source/GameClient/GUI/GUICallbacks/Menus/GameInfoWindow.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp
Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp
Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp
Source/GameClient/GUI/GUICallbacks/Menus/MapSelectMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp
Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp
Source/GameClient/GUI/GUICallbacks/Menus/PopupHostGame.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp
Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp
Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp
Source/GameClient/GUI/GUICallbacks/Menus/PopupSaveLoad.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp
Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp
Source/GameClient/GUI/GUICallbacks/Menus/SkirmishMapSelectMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp
Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp
Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/WOLLocaleSelectPopup.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/WOLLocaleSelectPopup.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp
Source/GameClient/GUI/GUICallbacks/Menus/WOLMapSelectMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp
Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp
- Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp
+# Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp
Source/GameClient/GUI/GUICallbacks/Menus/WOLWelcomeMenu.cpp
- Source/GameClient/GUI/GUICallbacks/MessageBox.cpp
- Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp
+# Source/GameClient/GUI/GUICallbacks/MessageBox.cpp
+# Source/GameClient/GUI/GUICallbacks/ReplayControls.cpp
# Source/GameClient/GUI/HeaderTemplate.cpp
# Source/GameClient/GUI/IMEManager.cpp
# Source/GameClient/GUI/LoadScreen.cpp
# Source/GameClient/GUI/ProcessAnimateWindow.cpp
Source/GameClient/GUI/Shell/Shell.cpp
- Source/GameClient/GUI/Shell/ShellMenuScheme.cpp
+# Source/GameClient/GUI/Shell/ShellMenuScheme.cpp
# Source/GameClient/GUI/WindowLayout.cpp
# Source/GameClient/GUI/WindowVideoManager.cpp
# Source/GameClient/GUI/WinInstanceData.cpp
@@ -797,7 +797,7 @@ set(GAMEENGINE_SRC
Source/GameClient/MessageStream/CommandXlat.cpp
Source/GameClient/MessageStream/GUICommandTranslator.cpp
Source/GameClient/MessageStream/HintSpy.cpp
- Source/GameClient/MessageStream/HotKey.cpp
+# Source/GameClient/MessageStream/HotKey.cpp
Source/GameClient/MessageStream/LookAtXlat.cpp
Source/GameClient/MessageStream/MetaEvent.cpp
Source/GameClient/MessageStream/PlaceEventTranslator.cpp
diff --git a/scripts/cpp/unify_move_files.py b/scripts/cpp/unify_move_files.py
index 1b03fd19f12..b37e6ff8e14 100644
--- a/scripts/cpp/unify_move_files.py
+++ b/scripts/cpp/unify_move_files.py
@@ -492,6 +492,82 @@ def main():
#unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/Drawable/Update/SwayClientUpdate.cpp", Game.CORE, "GameEngine/Source/GameClient/Drawable/Update/SwayClientUpdate.cpp")
#unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/Module/SwayClientUpdate.h", Game.CORE, "GameEngine/Include/GameClient/Module/SwayClientUpdate.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/AnimateWindowManager.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/AnimateWindowManager.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/AnimateWindowManager.h", Game.CORE, "GameEngine/Include/GameClient/AnimateWindowManager.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GameWindowManager.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GameWindowManager.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/GameWindowManager.h", Game.CORE, "GameEngine/Include/GameClient/GameWindowManager.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/Include/GameClient/MessageBox.h", Game.CORE, "GameEngine/Include/GameClient/MessageBox.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/ExtendedMessageBox.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/ExtendedMessageBox.h", Game.CORE, "GameEngine/Include/GameClient/ExtendedMessageBox.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GameClientDispatch.cpp", Game.CORE, "GameEngine/Source/GameClient/GameClientDispatch.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/MessageStream/HotKey.cpp", Game.CORE, "GameEngine/Source/GameClient/MessageStream/HotKey.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/HotKey.h", Game.CORE, "GameEngine/Include/GameClient/HotKey.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/GameWindowID.h", Game.CORE, "GameEngine/Include/GameClient/GameWindowID.h")
+
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/ControlBar/ControlBarObserver.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/ControlBar/ControlBarPrintPositions.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/ControlBar/ControlBarResizer.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/ControlBarResizer.h", Game.CORE, "GameEngine/Include/GameClient/ControlBarResizer.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/ControlBar/ControlBarUnderConstruction.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/Gadget/GadgetCheckBox.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/GadgetCheckBox.h", Game.CORE, "GameEngine/Include/GameClient/GadgetCheckBox.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/Gadget/GadgetComboBox.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/Gadget/GadgetComboBox.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/GadgetComboBox.h", Game.CORE, "GameEngine/Include/GameClient/GadgetComboBox.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/GadgetListBox.h", Game.CORE, "GameEngine/Include/GameClient/GadgetListBox.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/Gadget/GadgetProgressBar.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/Gadget/GadgetProgressBar.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/GadgetProgressBar.h", Game.CORE, "GameEngine/Include/GameClient/GadgetProgressBar.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/GadgetPushButton.h", Game.CORE, "GameEngine/Include/GameClient/GadgetPushButton.h")
+
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/Gadget/GadgetRadioButton.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/GadgetRadioButton.h", Game.CORE, "GameEngine/Include/GameClient/GadgetRadioButton.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/Gadget/GadgetStaticText.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/Gadget/GadgetStaticText.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/GadgetStaticText.h", Game.CORE, "GameEngine/Include/GameClient/GadgetStaticText.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/Gadget/GadgetTabControl.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/Gadget/GadgetTabControl.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/GadgetTabControl.h", Game.CORE, "GameEngine/Include/GameClient/GadgetTabControl.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/Gadget/GadgetTextEntry.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/GadgetTextEntry.h", Game.CORE, "GameEngine/Include/GameClient/GadgetTextEntry.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/Gadget/GadgetHorizontalSlider.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/Gadget/GadgetVerticalSlider.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/GadgetSlider.h", Game.CORE, "GameEngine/Include/GameClient/GadgetSlider.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/InGameChat.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/InGameChat.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/InGamePopupMessage.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupCommunicator.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupJoinGame.cpp")
+
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLMessageWindow.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLStatusMenu.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLCustomScoreScreen.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLadderScreen.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLocaleSelectPopup.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLocaleSelectPopup.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQMScoreScreen.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/NetworkDirectConnect.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanMapSelectMenu.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/EstablishConnectionsMenu/EstablishConnectionsMenu.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/GUICallbacks/Menus/EstablishConnectionsWindow.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/EstablishConnectionsWindow.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/Diplomacy.h", Game.CORE, "GameEngine/Include/GameClient/Diplomacy.h")
+
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SinglePlayerMenu.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/CreditsMenu.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DifficultySelect.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.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/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupReplay.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp", Game.CORE, "GameEngine/Source/GameClient/GUI/Shell/ShellMenuScheme.cpp")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/ShellMenuScheme.h", Game.CORE, "GameEngine/Include/GameClient/ShellMenuScheme.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/Shell.h", Game.CORE, "GameEngine/Include/GameClient/Shell.h")
+ #unify_file(Game.ZEROHOUR, "GameEngine/Include/GameClient/ShellHooks.h", Game.CORE, "GameEngine/Include/GameClient/ShellHooks.h")
+
return