Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

feat(gameclient): main menu options again, volumes only on windows

Olcay Seygan5112e28ad55c
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 93bc34037..2223bb307 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1179,7 +1179,7 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same
## The options screen has pages
-- On Windows every setting lives in the launcher now, where you set it before the game starts. The main menu has no Options button any more, and Credits and Exit move up into its place. In a match, Esc and then Options still opens the sound: music, effects, voices and ambience, nothing else. Accept there saves those four and leaves the rest of your settings file alone, so the resolution or detail preset you picked in the launcher stays exactly as you left it. On a Mac and on Linux, which have no launcher, the options screen is the whole of what follows.
+- On Windows every setting lives in the launcher now, where you set it before the game starts. Options is back in its old place on the main menu, between Load and Credits, and it opens the same page Esc and then Options opens in a match: the sound, music, effects, voices and ambience, nothing else. Accept there saves those four and leaves the rest of your settings file alone, so the resolution or detail preset you picked in the launcher stays exactly as you left it. On a Mac and on Linux, which have no launcher, the options screen is the whole of what follows.
- Display, graphics, effects, audio, controls, interface and network, behind seven buttons across the top. The original screen was one panel with everything on it at once, and it was already full the day it shipped: the language filter, the keyboard button and four camera checkboxes are all still in there, parked off the right edge where nobody can reach them, because there was nowhere left to put them.
- Every setting sits with the ones that do the same kind of job. Display is the screen and its brightness. Graphics is what the picture costs and how sharp it is, with the glow and the lighting in a group of their own instead of mixed in with the anti-aliasing. Effects is what stands in the world: all seven shadow boxes together, cloud shadows included, then the scenery, then smoke. Controls splits the camera, the orders, building placement and the mouse into four groups, and Interface holds the command bar size, the income readout, the health bars, the colours, the order lines and the language. In Classic the screen leaves out the few boxes Classic ignores anyway, from smooth motion to the HUD size and the order lines, and closes the gaps they leave, so a box on that screen always does something.
- Classic Graphics, on the Graphics page, puts the game back the way it looked in 2003 in one click: its own textures and ground in place of the upscaled ones, the old hard shadows, the round dark patch under every tree where Reforged lays the tree's own outline on the ground, and no glow or sharpening over the picture. Leave it off and you have Reforged. The rest of the options stay yours either way, and the box takes effect the next time the game starts.
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp
index 27b5eadd3..dad58c3b7 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/MainMenu.cpp
@@ -571,33 +571,6 @@ void MainMenuInit( WindowLayout *layout, void *userData )
initialHide();
-#if defined(_WIN32)
- //
- // The launcher owns every setting on Windows, so the main menu has no Options button. It is
- // destroyed rather than hidden because the menu's transitions show every window they name; a
- // destroyed one is not found and they skip it. Credits and Exit move up into the gap and the
- // panel behind them gives up the row. The shell runs this init again on the same windows each
- // time a screen above the main menu is popped, and then the button is already gone.
- //
- if( buttonOptions )
- {
- Int x, optionsY, creditsY, exitY, width, height;
- buttonOptions->winGetPosition( &x, &optionsY );
- buttonCredits->winGetPosition( &x, &creditsY );
- buttonExit->winGetPosition( &x, &exitY );
- const Int row = creditsY - optionsY;
- buttonCredits->winSetPosition( x, optionsY );
- buttonExit->winSetPosition( x, creditsY );
- GameWindow *panel = buttonExit->winGetParent();
- panel->winGetSize( &width, &height );
- panel->winSetSize( width, height - row );
- dropDownWindows[DROPDOWN_MAIN]->winGetSize( &width, &height );
- dropDownWindows[DROPDOWN_MAIN]->winSetSize( width, height - row );
- TheWindowManager->winDestroy( buttonOptions );
- buttonOptions = NULL;
- }
-#endif
-
showSelectiveButtons(SHOW_NONE);
// Set up the version number
#if defined _DEBUG || defined _INTERNAL || defined _PROFILE
@@ -1528,12 +1501,16 @@ WindowMsgHandledType MainMenuSystem( GameWindow *window, UnsignedInt msg,
//buttonPushed = TRUE;
TheScriptEngine->signalUIInteract(TheShellHookNames[SHELL_SCRIPT_HOOK_MAIN_MENU_OPTIONS_SELECTED]);
- // load the options menu
+ // load the options menu; on Windows the launcher owns the rest, so the volumes alone
+#if defined(_WIN32)
+ OpenVolumeOptions();
+#else
WindowLayout *optLayout = TheShell->getOptionsLayout(TRUE);
DEBUG_ASSERTCRASH(optLayout != NULL, ("unable to get options menu layout"));
optLayout->runInit();
optLayout->hide(FALSE);
optLayout->bringForward();
+#endif
} // end else if
else if( controlID == worldBuilderID )
{
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
index 1042c959c..95cdda327 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
@@ -1313,8 +1313,8 @@ static void saveVolumeOptions( OptionPreferences &out )
#if defined(_WIN32)
//-------------------------------------------------------------------------------------------------
-// The volume view. On Windows the launcher owns every setting but the four volumes, so the quit
-// menu's Options button opens the Audio page alone (OpenVolumeOptions), and its Accept writes those
+// The volume view. On Windows the launcher owns every setting but the four volumes, so the main
+// menu's and the quit menu's Options buttons open the Audio page alone (OpenVolumeOptions), and its Accept writes those
// four onto Options.ini as it is on disk right now. Nothing the menu loaded for the other pages is
// written back, so a resolution or a detail preset the launcher saved stays what the launcher said.
// -optionsmenu and -resdrill still open the whole menu; they are how a script reaches it.