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.

refactor(gameclient): drop the keyboard options screen

Olcay Seygan04ecc764de23
diff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.str
index 0109e0be5..5c1ed3951 100644
--- a/GeneralsMD/Code/Data/Patch.str
+++ b/GeneralsMD/Code/Data/Patch.str
@@ -560,50 +560,6 @@ TOOLTIP:HealthBars
"Smart shows a bar over anything hurt, plus the selection and whatever is under the cursor. Selection only is what retail did."
END
-GUI:Assign
-"Assign"
-END
-
-GUI:ResetAll
-"Reset All"
-END
-
-GUI:PressAKey
-"Click a command, then press the key you want"
-END
-
-GUI:CONTROL
-"Unit control"
-END
-
-GUI:INFORMATION
-"Information"
-END
-
-GUI:INTERFACE
-"Interface"
-END
-
-GUI:SELECTION
-"Selection"
-END
-
-GUI:TAUNT
-"Taunts"
-END
-
-GUI:TEAM
-"Teams"
-END
-
-GUI:MISC
-"Miscellaneous"
-END
-
-GUI:DEBUG
-"Debug"
-END
-
// Peace time - the lobby combo box, its tooltip, the corner countdown and the three things the game
// says while the clock runs. Tools/peacetime_layout.py selfcheck fails if any of these goes missing.
diff --git a/GeneralsMD/Code/Data/Window/Menus/KeyboardOptionsMenu.wnd b/GeneralsMD/Code/Data/Window/Menus/KeyboardOptionsMenu.wnd
deleted file mode 100644
index 3d0f145a4..000000000
--- a/GeneralsMD/Code/Data/Window/Menus/KeyboardOptionsMenu.wnd
+++ /dev/null
@@ -1,366 +0,0 @@
-FILE_VERSION = 2;
-STARTLAYOUTBLOCK
- LAYOUTINIT = KeyboardOptionsMenuInit;
- LAYOUTUPDATE = KeyboardOptionsMenuUpdate;
- LAYOUTSHUTDOWN = KeyboardOptionsMenuShutdown;
-ENDLAYOUTBLOCK
-WINDOW
- WINDOWTYPE = USER;
- SCREENRECT = UPPERLEFT: 120 40,
- BOTTOMRIGHT: 680 560,
- CREATIONRESOLUTION: 800 600;
- NAME = "KeyboardOptionsMenu.wnd:ParentKeyboardOptionsMenu";
- STATUS = ENABLED+BORDER;
- STYLE = USER;
- SYSTEMCALLBACK = "KeyboardOptionsMenuSystem";
- INPUTCALLBACK = "KeyboardOptionsMenuInput";
- TOOLTIPCALLBACK = "[None]";
- DRAWCALLBACK = "[None]";
- FONT = NAME: "Arial", SIZE: 14, BOLD: 0;
- HEADERTEMPLATE = "[NONE]";
- TOOLTIPDELAY = -1;
- TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,
- DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,
- HILITE: 255 255 255 255, HILITEBORDER: 0 0 0 255;
- ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255;
- DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255;
- HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 200, BORDERCOLOR: 49 55 168 255;
- CHILD
- WINDOW
- WINDOWTYPE = STATICTEXT;
- SCREENRECT = UPPERLEFT: 136 52,
- BOTTOMRIGHT: 400 76,
- CREATIONRESOLUTION: 800 600;
- NAME = "KeyboardOptionsMenu.wnd:StaticTextTitle";
- STATUS = ENABLED;
- STYLE = STATICTEXT;
- SYSTEMCALLBACK = "[None]";
- INPUTCALLBACK = "[None]";
- TOOLTIPCALLBACK = "[None]";
- DRAWCALLBACK = "[None]";
- FONT = NAME: "Arial", SIZE: 14, BOLD: 1;
- HEADERTEMPLATE = "MinorTitle";
- TOOLTIPDELAY = -1;
- TEXT = "GUI:KeyboardOptions";
- TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,
- DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,
- HILITE: 255 255 255 255, HILITEBORDER: 0 0 0 255;
- END
- CHILD
- WINDOW
- WINDOWTYPE = SCROLLLISTBOX;
- SCREENRECT = UPPERLEFT: 136 84,
- BOTTOMRIGHT: 664 380,
- CREATIONRESOLUTION: 800 600;
- NAME = "KeyboardOptionsMenu.wnd:ListBoxCommandList";
- STATUS = ENABLED+BORDER;
- STYLE = SCROLLLISTBOX+MOUSETRACK;
- SYSTEMCALLBACK = "[None]";
- INPUTCALLBACK = "[None]";
- TOOLTIPCALLBACK = "[None]";
- DRAWCALLBACK = "[None]";
- FONT = NAME: "Arial", SIZE: 10, BOLD: 0;
- HEADERTEMPLATE = "[NONE]";
- TOOLTIPDELAY = -1;
- TEXTCOLOR = ENABLED: 254 254 254 255, ENABLEDBORDER: 0 0 0 255,
- DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,
- HILITE: 255 255 128 255, HILITEBORDER: 0 0 0 255;
- ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 220, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 47 55 168 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 220, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 90 100 210 255, BORDERCOLOR: 254 254 254 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- LISTBOXDATA = LENGTH: 512,
- AUTOSCROLL: 0,
- SCROLLIFATEND: 0,
- AUTOPURGE: 0,
- SCROLLBAR: 1,
- MULTISELECT: 0,
- COLUMNS: 1,
- FORCESELECT: 1;
- LISTBOXENABLEDUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- LISTBOXHILITEUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- LISTBOXENABLEDDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- LISTBOXHILITEDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- LISTBOXENABLEDSLIDERDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 160, BORDERCOLOR: 47 55 168 255,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
- END
- CHILD
- WINDOW
- WINDOWTYPE = STATICTEXT;
- SCREENRECT = UPPERLEFT: 136 388,
- BOTTOMRIGHT: 664 428,
- CREATIONRESOLUTION: 800 600;
- NAME = "KeyboardOptionsMenu.wnd:StaticTextDescription";
- STATUS = ENABLED+WRAP_CENTERED;
- STYLE = STATICTEXT;
- SYSTEMCALLBACK = "[None]";
- INPUTCALLBACK = "[None]";
- TOOLTIPCALLBACK = "[None]";
- DRAWCALLBACK = "[None]";
- FONT = NAME: "Arial", SIZE: 10, BOLD: 0;
- HEADERTEMPLATE = "[NONE]";
- TOOLTIPDELAY = -1;
- TEXTCOLOR = ENABLED: 220 220 220 255, ENABLEDBORDER: 0 0 0 255,
- DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,
- HILITE: 220 220 220 255, HILITEBORDER: 0 0 0 255;
- END
- CHILD
- WINDOW
- WINDOWTYPE = STATICTEXT;
- SCREENRECT = UPPERLEFT: 136 436,
- BOTTOMRIGHT: 320 460,
- CREATIONRESOLUTION: 800 600;
- NAME = "KeyboardOptionsMenu.wnd:StaticTextCurrentHotkey";
- STATUS = ENABLED;
- STYLE = STATICTEXT;
- SYSTEMCALLBACK = "[None]";
- INPUTCALLBACK = "[None]";
- TOOLTIPCALLBACK = "[None]";
- DRAWCALLBACK = "[None]";
- FONT = NAME: "Arial", SIZE: 12, BOLD: 1;
- HEADERTEMPLATE = "[NONE]";
- TOOLTIPDELAY = -1;
- TEXTCOLOR = ENABLED: 255 255 128 255, ENABLEDBORDER: 0 0 0 255,
- DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,
- HILITE: 255 255 128 255, HILITEBORDER: 0 0 0 255;
- END
- CHILD
- WINDOW
- WINDOWTYPE = ENTRYFIELD;
- SCREENRECT = UPPERLEFT: 336 436,
- BOTTOMRIGHT: 520 460,
- CREATIONRESOLUTION: 800 600;
- NAME = "KeyboardOptionsMenu.wnd:TextEntryAssignHotkey";
- STATUS = ENABLED+BORDER;
- STYLE = ENTRYFIELD+MOUSETRACK;
- SYSTEMCALLBACK = "[None]";
- INPUTCALLBACK = "[None]";
- TOOLTIPCALLBACK = "[None]";
- DRAWCALLBACK = "[None]";
- FONT = NAME: "Arial", SIZE: 10, BOLD: 0;
- HEADERTEMPLATE = "[NONE]";
- TOOLTIPDELAY = -1;
- TEXT = "Entry";
- TEXTCOLOR = ENABLED: 254 254 254 255, ENABLEDBORDER: 0 0 0 255,
- DISABLED: 128 128 128 255, DISABLEDBORDER: 64 64 64 255,
- HILITE: 255 255 128 255, HILITEBORDER: 0 0 0 255;
- ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 220, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 220, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 220, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 220, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 220, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 220, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 220, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 220, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 0 0 0 220, BORDERCOLOR: 49 55 168 255;
- DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 120, BORDERCOLOR: 60 60 60 255,
- IMAGE: NoImage, COLOR: 0 0 0 120, BORDERCOLOR: 60 60 60 255,
- IMAGE: NoImage, COLOR: 0 0 0 120, BORDERCOLOR: 60 60 60 255,
- IMAGE: NoImage, COLOR: 0 0 0 120, BORDERCOLOR: 60 60 60 255,
- IMAGE: NoImage, COLOR: 0 0 0 120, BORDERCOLOR: 60 60 60 255,
- IMAGE: NoImage, COLOR: 0 0 0 120, BORDERCOLOR: 60 60 60 255,
- IMAGE: NoImage, COLOR: 0 0 0 120, BORDERCOLOR: 60 60 60 255,
- IMAGE: NoImage, COLOR: 0 0 0 120, BORDERCOLOR: 60 60 60 255,
- IMAGE: NoImage, COLOR: 0 0 0 120, BORDERCOLOR: 60 60 60 255;
- TEXTENTRYDATA = MAXLEN: 24,
- SECRETTEXT: 0,
- NUMERICALONLY: 0,
- ALPHANUMERICALONLY: 0,
- ASCIIONLY: 0;
- END
- CHILD
- WINDOW
- WINDOWTYPE = PUSHBUTTON;
- SCREENRECT = UPPERLEFT: 536 436,
- BOTTOMRIGHT: 664 460,
- CREATIONRESOLUTION: 800 600;
- NAME = "KeyboardOptionsMenu.wnd:ButtonAssign";
- STATUS = ENABLED+BORDER;
- STYLE = PUSHBUTTON+MOUSETRACK;
- SYSTEMCALLBACK = "[None]";
- INPUTCALLBACK = "[None]";
- TOOLTIPCALLBACK = "[None]";
- DRAWCALLBACK = "[None]";
- FONT = NAME: "Arial", SIZE: 10, BOLD: 0;
- HEADERTEMPLATE = "[NONE]";
- TOOLTIPDELAY = -1;
- TEXT = "GUI:Assign";
- TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,
- DISABLED: 128 128 128 255, DISABLEDBORDER: 64 64 64 255,
- HILITE: 255 255 128 255, HILITEBORDER: 0 0 0 255;
- ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255;
- HILITEDRAWDATA = IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255;
- END
- CHILD
- WINDOW
- WINDOWTYPE = PUSHBUTTON;
- SCREENRECT = UPPERLEFT: 136 500,
- BOTTOMRIGHT: 300 532,
- CREATIONRESOLUTION: 800 600;
- NAME = "KeyboardOptionsMenu.wnd:ButtonResetAll";
- STATUS = ENABLED+BORDER;
- STYLE = PUSHBUTTON+MOUSETRACK;
- SYSTEMCALLBACK = "[None]";
- INPUTCALLBACK = "[None]";
- TOOLTIPCALLBACK = "[None]";
- DRAWCALLBACK = "[None]";
- FONT = NAME: "Arial", SIZE: 12, BOLD: 0;
- HEADERTEMPLATE = "[NONE]";
- TOOLTIPDELAY = -1;
- TEXT = "GUI:ResetAll";
- TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,
- DISABLED: 128 128 128 255, DISABLEDBORDER: 64 64 64 255,
- HILITE: 255 255 128 255, HILITEBORDER: 0 0 0 255;
- ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255;
- HILITEDRAWDATA = IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255;
- END
- CHILD
- WINDOW
- WINDOWTYPE = PUSHBUTTON;
- SCREENRECT = UPPERLEFT: 500 500,
- BOTTOMRIGHT: 664 532,
- CREATIONRESOLUTION: 800 600;
- NAME = "KeyboardOptionsMenu.wnd:ButtonBack";
- STATUS = ENABLED+BORDER;
- STYLE = PUSHBUTTON+MOUSETRACK;
- SYSTEMCALLBACK = "[None]";
- INPUTCALLBACK = "[None]";
- TOOLTIPCALLBACK = "[None]";
- DRAWCALLBACK = "[None]";
- FONT = NAME: "Arial", SIZE: 12, BOLD: 0;
- HEADERTEMPLATE = "[NONE]";
- TOOLTIPDELAY = -1;
- TEXT = "GUI:Cancel";
- TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,
- DISABLED: 128 128 128 255, DISABLEDBORDER: 64 64 64 255,
- HILITE: 255 255 128 255, HILITEBORDER: 0 0 0 255;
- ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255,
- IMAGE: NoImage, COLOR: 30 36 110 255, BORDERCOLOR: 49 55 168 255;
- HILITEDRAWDATA = IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255,
- IMAGE: NoImage, COLOR: 60 70 190 255, BORDERCOLOR: 209 253 4 255;
- END
- ENDALLCHILDREN
-END
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GUICallbacks.h b/GeneralsMD/Code/GameEngine/Include/GameClient/GUICallbacks.h
index 14863fcb2..1da9e870f 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/GUICallbacks.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/GUICallbacks.h
@@ -127,22 +127,6 @@ extern void ChallengeMenuShutdown( WindowLayout *layout, void *userData );
extern WindowMsgHandledType ChallengeMenuSystem( GameWindow *window, UnsignedInt msg, WindowMsgData mData1, WindowMsgData mData2 );
extern WindowMsgHandledType ChallengeMenuInput( GameWindow *window, UnsignedInt msg, WindowMsgData mData1, WindowMsgData mData2 );
-// Keyboard Options Menu ---------------------------------------------------------------------------
-extern void KeyboardOptionsMenuInit( WindowLayout *layout, void *userData );
-extern void KeyboardOptionsMenuUpdate( WindowLayout *layout, void *userData );
-extern void KeyboardOptionsMenuShutdown( WindowLayout *layout, void *userData );
-extern WindowMsgHandledType KeyboardOptionsMenuSystem( GameWindow *window, UnsignedInt msg, WindowMsgData mData1, WindowMsgData mData2 );
-extern WindowMsgHandledType KeyboardOptionsMenuInput( GameWindow *window, UnsignedInt msg, WindowMsgData mData1, WindowMsgData mData2 );
-//
-// The keyboard screen is a layout of its own laid over whatever is underneath, the way the options
-// menu is, and not a shell screen. Pushing it on the shell stack shut down whatever screen the
-// shell was parked on, so opening it from a running game brought the skirmish lobby back up over
-// the battlefield and left the quit menu and the options menu drawn on top of it.
-//
-extern void OpenKeyboardOptionsMenu( void );
-extern void CloseKeyboardOptionsMenu( void );
-extern Bool IsKeyboardOptionsMenuOpen( void );
-
// Lan Lobby Menu ----------------------------------------------------------------------------------
extern void LanLobbyMenuInit( WindowLayout *layout, void *userData );
extern void LanLobbyMenuUpdate( WindowLayout *layout, void *userData );
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/MetaEvent.h b/GeneralsMD/Code/GameEngine/Include/GameClient/MetaEvent.h
index a158107de..2bab4ac00 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/MetaEvent.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/MetaEvent.h
@@ -331,10 +331,6 @@ public:
MappableKeyCategories m_category; ///< This is the catagory the key falls under
UnicodeString m_description; ///< The description string for the keys
UnicodeString m_displayName; ///< The display name of our command
-
- // What CommandMap.ini said, kept so Reset can put it back after the player has rebound it
- MappableKeyType m_defaultKey;
- MappableKeyModState m_defaultModState;
};
EMPTY_DTOR(MetaMapRec)
@@ -380,24 +376,6 @@ public:
static void parseMetaMap(INI* ini);
const MetaMapRec *getFirstMetaMapRec() const { return m_metaMaps; }
-
- //
- // Rebinding. CommandMap.ini is the default set and is in the multiplayer checksum, so a player
- // who moves a key does not edit it: the change goes into Keybinds.ini beside Options.ini, and is
- // applied over the defaults every time the game starts. A binding is a key plus the state of
- // ctrl, alt and shift; the transition, the category and what the command actually does stay the
- // data's business.
- //
- MetaMapRec *findByName( const char *name ); ///< the record a command name belongs to
- const char *getName( const MetaMapRec *rec ) const; ///< ...and back the other way
-
- /** Point one command at a different key. Answers the record that was already on that key and had
- * to give it up, or NULL - a key can only mean one thing, and the screen says which one moved. */
- MetaMapRec *rebind( MetaMapRec *rec, MappableKeyType key, MappableKeyModState mods );
-
- void resetBindingsToDefault( void ); ///< back to what CommandMap.ini says, all of them
- void loadUserBindings( void ); ///< read Keybinds.ini over the defaults, at startup
- void saveUserBindings( void ); ///< write out everything that is not on its default key
};
extern MetaMap *TheMetaMap;
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp
index 122071c56..07c8a1ca4 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp
@@ -819,14 +819,6 @@ void GameEngine::init( int argc, char *argv[] )
ini.load("Data\\INI\\CommandMapDemo.ini", INI_LOAD_MULTIFILE, NULL);
#endif
- //
- // ... and last, whatever the player has moved. Keybinds.ini sits next to Options.ini and
- // holds only the commands that are not on the key the data gave them, so it survives a patch
- // that adds commands and it is not part of the INI checksum: two players in one match can
- // hold completely different keyboards.
- //
- TheMetaMap->loadUserBindings();
-
initSubsystem(TheActionManager,"TheActionManager", MSGNEW("GameEngineSubsystem") ActionManager(), NULL);
//initSubsystem((CComObject<WebBrowser> *)TheWebBrowser,"(CComObject<WebBrowser> *)TheWebBrowser", (CComObject<WebBrowser> *)createWebBrowser(), NULL);
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp
index 2f6a9569d..8da109f8b 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/System/FunctionLexicon.cpp
@@ -111,7 +111,6 @@ static FunctionLexicon::TableEntry gameWinSystemTable[] =
{ NAMEKEY_INVALID, "PopupCommunicatorSystem", PopupCommunicatorSystem },
{ NAMEKEY_INVALID, "PopupBuddyNotificationSystem", PopupBuddyNotificationSystem },
{ NAMEKEY_INVALID, "PopupReplaySystem", PopupReplaySystem },
- { NAMEKEY_INVALID, "KeyboardOptionsMenuSystem", KeyboardOptionsMenuSystem },
{ NAMEKEY_INVALID, "WOLLadderScreenSystem", WOLLadderScreenSystem },
{ NAMEKEY_INVALID, "WOLLoginMenuSystem", WOLLoginMenuSystem },
{ NAMEKEY_INVALID, "WOLLocaleSelectSystem", WOLLocaleSelectSystem },
@@ -178,7 +177,6 @@ static FunctionLexicon::TableEntry gameWinInputTable[] =
{ NAMEKEY_INVALID, "LanLobbyMenuInput", LanLobbyMenuInput },
{ NAMEKEY_INVALID, "ReplayMenuInput", ReplayMenuInput },
{ NAMEKEY_INVALID, "CreditsMenuInput", CreditsMenuInput },
- { NAMEKEY_INVALID, "KeyboardOptionsMenuInput", KeyboardOptionsMenuInput },
{ NAMEKEY_INVALID, "PopupCommunicatorInput", PopupCommunicatorInput },
{ NAMEKEY_INVALID, "LanGameOptionsMenuInput", LanGameOptionsMenuInput },
{ NAMEKEY_INVALID, "LanMapSelectMenuInput", LanMapSelectMenuInput },
@@ -246,7 +244,6 @@ static FunctionLexicon::TableEntry winLayoutInitTable[] =
{ NAMEKEY_INVALID, "SaveLoadMenuFullScreenInit", SaveLoadMenuFullScreenInit },
{ NAMEKEY_INVALID, "PopupCommunicatorInit", PopupCommunicatorInit },
- { NAMEKEY_INVALID, "KeyboardOptionsMenuInit", KeyboardOptionsMenuInit },
{ NAMEKEY_INVALID, "SinglePlayerMenuInit", SinglePlayerMenuInit },
{ NAMEKEY_INVALID, "MapSelectMenuInit", MapSelectMenuInit },
{ NAMEKEY_INVALID, "LanLobbyMenuInit", LanLobbyMenuInit },
@@ -337,7 +334,6 @@ static FunctionLexicon::TableEntry winLayoutShutdownTable[] =
{ NAMEKEY_INVALID, "OptionsMenuShutdown", OptionsMenuShutdown },
{ NAMEKEY_INVALID, "SaveLoadMenuShutdown", SaveLoadMenuShutdown },
{ NAMEKEY_INVALID, "PopupCommunicatorShutdown", PopupCommunicatorShutdown },
- { NAMEKEY_INVALID, "KeyboardOptionsMenuShutdown", KeyboardOptionsMenuShutdown },
{ NAMEKEY_INVALID, "SinglePlayerMenuShutdown", SinglePlayerMenuShutdown },
{ NAMEKEY_INVALID, "MapSelectMenuShutdown", MapSelectMenuShutdown },
{ NAMEKEY_INVALID, "LanLobbyMenuShutdown", LanLobbyMenuShutdown },
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp
deleted file mode 100644
index 4a04f8bb1..000000000
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/KeyboardOptionsMenu.cpp
+++ /dev/null
@@ -1,1428 +0,0 @@
-/*
-** Command & Conquer Generals Zero Hour(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 <http://www.gnu.org/licenses/>.
-*/
-
-////////////////////////////////////////////////////////////////////////////////
-// //
-// (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 int 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/GUICallbacks.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 = NULL;
-
-static NameKeyType parentKeyboardOptionsMenuID = NAMEKEY_INVALID;
-static GameWindow *parentKeyboardOptionsMenu = NULL;
-
-static NameKeyType comboBoxCategoryListID = NAMEKEY_INVALID;
-static GameWindow *comboBoxCategoryList = NULL;
-
-static NameKeyType listBoxCommandListID = NAMEKEY_INVALID;
-static GameWindow *listBoxCommandList = NULL;
-
-static NameKeyType staticTextDescriptionID = NAMEKEY_INVALID;
-static GameWindow *staticTextDescription = NULL;
-
-static NameKeyType staticTextCurrentHotkeyID = NAMEKEY_INVALID;
-static GameWindow *staticTextCurrentHotkey = NULL;
-
-static NameKeyType buttonResetAllID = NAMEKEY_INVALID;
-static GameWindow *buttonResetAll = NULL;
-
-static NameKeyType textEntryAssignHotkeyID = NAMEKEY_INVALID;
-static GameWindow *textEntryAssignHotkey = NULL;
-
-static NameKeyType buttonAssignID = NAMEKEY_INVALID;
-static GameWindow *buttonAssign = NULL;
-
-//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;
-
-//
-// What the screen is working on: the command whose row is selected, and the key the player has
-// pressed into the box but not yet accepted. The box captures a keystroke whole - key and
-// modifiers together, on the way down - rather than assembling a string out of the letters typed
-// into it, which is what it used to do and which could never produce a binding at the end.
-//
-static MetaMapRec *theSelectedRec = NULL;
-static MappableKeyType thePendingKey = MK_NONE;
-static MappableKeyModState thePendingMods = NONE;
-
-//
-// The screen is one layout laid over whatever is underneath. It used to be a shell screen, pushed
-// with TheShell->push, and the shell stack is not somewhere an in-game menu can go: pushing shut
-// down the screen the shell was parked on and popping brought it back, so opening this from a
-// running game put the skirmish lobby back on screen with the quit menu and the options menu still
-// drawn over it.
-//
-static WindowLayout *theKeyboardOptionsLayout = NULL;
-
-static UnicodeString bindingText( const MetaMapRec *rec );
-static UnicodeString bindingTextFor( MappableKeyType key, MappableKeyModState mods );
-static Bool catchBindingKey( WindowMsgData mData1, WindowMsgData mData2 );
-
-// initialize these, they will be used a lot
-UnicodeString alt;
-UnicodeString ctrl;
-UnicodeString shift;
-
-
-
-//-------------------------------------------------------------------------------------------------
-/** There is no category dropdown any more.
- *
- * It was a filter over a list, on a screen whose whole job is to answer "what is bound to what" -
- * so it hid seven eighths of the answer behind a control you had to work. Every command is in
- * the one list now, in category order, with the category written across the row above its
- * commands. This is kept as a no-op because the screen's message handler still names it. */
-//-------------------------------------------------------------------------------------------------
-void populateCategoryBox()
-{
-}
-
-// 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;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** A binding as a player reads it: "Ctrl+A", "F9", or nothing at all. */
-//-------------------------------------------------------------------------------------------------
-static UnicodeString bindingTextFor( MappableKeyType key, MappableKeyModState mods )
-{
- if( key == MK_NONE )
- return TheGameText->fetch( "GUI:NULL" );
-
- UnicodeString out;
- if( mods & CTRL )
- out.concat( TheGameText->fetch( "KEYBOARD:Ctrl+" ) );
- if( mods & ALT )
- out.concat( TheGameText->fetch( "KEYBOARD:Alt+" ) );
- if( mods & SHIFT )
- out.concat( TheGameText->fetch( "KEYBOARD:Shift+" ) );
-
- // the KEY_ names are what the INI spells, and the "KEY_" in front of them is noise on a screen
- for( const LookupListRec *keyName = KeyNames; keyName->name; keyName++ )
- {
- if( keyName->value != (Int)key )
- continue;
-
- const char *bare = keyName->name;
- if( strncmp( bare, "KEY_", 4 ) == 0 )
- bare += 4;
-
- UnicodeString uStr;
- uStr.translate( AsciiString( bare ) );
- out.concat( uStr );
- break;
- }
-
- return out;
-}
-
-//-------------------------------------------------------------------------------------------------
-static UnicodeString bindingText( const MetaMapRec *rec )
-{
- if( rec == NULL )
- return TheGameText->fetch( "GUI:NULL" );
- return bindingTextFor( rec->m_key, rec->m_modState );
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Take one keystroke as the binding the player wants, and show it in the box.
- *
- * Whole, on the way down: the key and whatever of ctrl, alt and shift was held with it. Both the
- * box and the screen behind it offer their keystrokes here, because which of the two has the
- * keyboard focus is not something a player should have to know - clicking a row is the whole
- * interaction, and the next key you press is the answer to it. */
-//-------------------------------------------------------------------------------------------------
-static Bool catchBindingKey( WindowMsgData mData1, WindowMsgData mData2 )
-{
- if( theSelectedRec == NULL || textEntryAssignHotkey == NULL )
- return FALSE;
-
- const UnsignedByte key = (UnsignedByte)mData1;
- const UnsignedShort state = (UnsignedShort)mData2;
-
- if( !BitTest( state, KEY_STATE_DOWN ) || BitTest( state, KEY_STATE_AUTOREPEAT ) )
- return FALSE;
-
- // escape leaves the screen; the modifier keys are what you hold, not what you bind
- if( key == KEY_ESC )
- return FALSE;
- if( key == KEY_LCTRL || key == KEY_RCTRL || key == KEY_LALT || key == KEY_RALT ||
- key == KEY_LSHIFT || key == KEY_RSHIFT )
- return TRUE;
-
- Int mods = 0;
- if( BitTest( state, KEY_STATE_CONTROL ) ) mods |= CTRL;
- if( BitTest( state, KEY_STATE_ALT ) ) mods |= ALT;
- if( BitTest( state, KEY_STATE_SHIFT ) ) mods |= SHIFT;
-
- thePendingKey = (MappableKeyType)key;
- thePendingMods = (MappableKeyModState)mods;
-
- EntryData *e = (EntryData *)textEntryAssignHotkey->winGetUserData();
- if( e && e->text )
- {
- e->text->setText( bindingTextFor( thePendingKey, thePendingMods ) );
- e->charPos = e->text->getTextLength();
- }
-
- return TRUE;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** The category the combo box is showing. Its rows are the CategoryListName table in order, and
- * the row's *value* is the category - not its index, which is only the same by luck. */
-//-------------------------------------------------------------------------------------------------
-static MappableKeyCategories currentCategory( void )
-{
- // every category is in the one list; the argument is only there because the signature is
- return CATEGORY_CONTROL;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Every command in this category, each with the key it is on right now.
- *
- * The key is in the row rather than only in the box below, so the screen answers "what is bound
- * to what" at a glance - which is the question somebody opens it with - and the record itself is
- * the row's data, so a selection is exact instead of matched back by display name. */
-//-------------------------------------------------------------------------------------------------
-void fillCommandListBox( MappableKeyCategories cat )
-{
- if(!listBoxCommandList)
- return;
-
- GadgetListBoxReset(listBoxCommandList);
-
- const Color color = GameMakeColor( 255, 255, 255, 255 );
- const Color heading = GameMakeColor( 255, 220, 120, 255 );
-
- for( Int c = 0; c < CATEGORY_NUM_CATEGORIES; ++c )
- {
- const MappableKeyCategories thisCat = (MappableKeyCategories)CategoryListName[ c ].value;
-
- //
- // The debug commands are compiled out of a shipping build, so binding one would be binding a
- // key to nothing at all. Everything else the game answers to is here.
- //
- if( thisCat == CATEGORY_DEBUG )
- continue;
-
- Bool wroteHeading = FALSE;
-
- for(const MetaMapRec *rec = TheMetaMap->getFirstMetaMapRec(); rec; rec = rec->m_next)
- {
- if( rec->m_category != thisCat || rec->m_displayName.isEmpty() )
- continue;
-
- if( !wroteHeading )
- {
- AsciiString key;
- key.format( "GUI:%s", CategoryListName[ c ].name );
- Int head = GadgetListBoxAddEntryText( listBoxCommandList,
- TheGameText->fetch( key ), heading, -1, -1 );
- // a heading is not a command: no record, so a click on it selects nothing
- if( head >= 0 )
- GadgetListBoxSetItemData( listBoxCommandList, NULL, head );
- wroteHeading = TRUE;
- }
-
- UnicodeString row( L" " );
- row.concat( rec->m_displayName );
- row.concat( UnicodeString( L" - " ) );
- row.concat( bindingText( rec ) );
-
- Int at = GadgetListBoxAddEntryText(listBoxCommandList, row, color, -1, -1 );
- if( at >= 0 )
- GadgetListBoxSetItemData( listBoxCommandList, (void *)rec, at );
- }
- }
-}
-
-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 reseting 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 );
- }
-
- }
-
- }
- }
-}
-
-
-//-------------------------------------------------------------------------------------------------
-Bool IsKeyboardOptionsMenuOpen( void )
-{
- return theKeyboardOptionsLayout != NULL;
-}
-
-//-------------------------------------------------------------------------------------------------
-/** Put the keyboard screen up over whatever is already there, and stand the options menu it was
- * opened from down while it is up. */
-//-------------------------------------------------------------------------------------------------
-void OpenKeyboardOptionsMenu( void )
-{
- if( theKeyboardOptionsLayout != NULL )
- return;
-
- theKeyboardOptionsLayout = TheWindowManager->winCreateLayout( AsciiString( "Menus/KeyboardOptionsMenu.wnd" ) );
- DEBUG_ASSERTCRASH( theKeyboardOptionsLayout, ("Unable to create the keyboard options layout\n") );
- if( theKeyboardOptionsLayout == NULL )
- return;
-
- WindowLayout *optLayout = TheShell ? TheShell->getOptionsLayout( FALSE ) : NULL;
- if( optLayout )
- optLayout->hide( TRUE );
-
- theKeyboardOptionsLayout->runInit();
- theKeyboardOptionsLayout->hide( FALSE );
- theKeyboardOptionsLayout->bringForward();
-}
-
-//-------------------------------------------------------------------------------------------------
-void CloseKeyboardOptionsMenu( void )
-{
- if( theKeyboardOptionsLayout == NULL )
- return;
-
- theKeyboardOptionsLayout->destroyWindows();
- theKeyboardOptionsLayout->deleteInstance();
- theKeyboardOptionsLayout = NULL;
-
- parentKeyboardOptionsMenu = NULL;
- comboBoxCategoryList = NULL;
- listBoxCommandList = NULL;
- staticTextDescription = NULL;
- staticTextCurrentHotkey = NULL;
- buttonResetAll = NULL;
- textEntryAssignHotkey = NULL;
- buttonAssign = NULL;
- buttonBack = NULL;
- theSelectedRec = NULL;
- thePendingKey = MK_NONE;
- thePendingMods = NONE;
-
- // the options menu was hidden rather than destroyed, so it comes back where it was
- WindowLayout *optLayout = TheShell ? TheShell->getOptionsLayout( FALSE ) : NULL;
- if( optLayout )
- {
- optLayout->hide( FALSE );
- optLayout->bringForward();
- }
-}
-
-//-------------------------------------------------------------------------------------------------
-/** 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( NULL, parentKeyboardOptionsMenuID );
-
- // get ids for our children controls
- buttonBackID = TheNameKeyGenerator->nameToKey( AsciiString("KeyboardOptionsMenu.wnd:ButtonBack") );
- buttonBack = TheWindowManager->winGetWindowFromId( parentKeyboardOptionsMenu, buttonBackID );
-
- comboBoxCategoryListID = TheNameKeyGenerator->nameToKey( "KeyboardOptionsMenu.wnd:ComboBoxCategoryList" );
- comboBoxCategoryList = TheWindowManager->winGetWindowFromId( /*parentKeyboardOptionsMenu*/NULL, comboBoxCategoryListID );
-
- listBoxCommandListID = TheNameKeyGenerator->nameToKey( "KeyboardOptionsMenu.wnd:ListBoxCommandList" );
- listBoxCommandList = TheWindowManager->winGetWindowFromId( NULL, listBoxCommandListID );
-
- staticTextDescriptionID = TheNameKeyGenerator->nameToKey( "KeyboardOptionsMenu.wnd:StaticTextDescription" );
- staticTextDescription = TheWindowManager->winGetWindowFromId( NULL, staticTextDescriptionID );
-
- staticTextCurrentHotkeyID = TheNameKeyGenerator->nameToKey( "KeyboardOptionsMenu.wnd:StaticTextCurrentHotkey" );
- staticTextCurrentHotkey = TheWindowManager->winGetWindowFromId( NULL, staticTextCurrentHotkeyID );
-
- buttonResetAllID = TheNameKeyGenerator->nameToKey( "KeyboardOptionsMenu.wnd:ButtonResetAll" );
- buttonResetAll = TheWindowManager->winGetWindowFromId( NULL, buttonResetAllID );
-
- textEntryAssignHotkeyID = TheNameKeyGenerator->nameToKey( "KeyboardOptionsMenu.wnd:TextEntryAssignHotkey" );
- textEntryAssignHotkey = TheWindowManager->winGetWindowFromId( NULL, textEntryAssignHotkeyID );
-
- buttonAssignID = TheNameKeyGenerator->nameToKey( "KeyboardOptionsMenu.wnd:ButtonAssign" );
- buttonAssign = TheWindowManager->winGetWindowFromId( NULL, 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 );
-
- // nothing is selected yet, so say what to do rather than showing an empty panel
- GadgetStaticTextSetText( staticTextDescription, TheGameText->fetch( "GUI:PressAKey" ) );
- GadgetStaticTextSetText( staticTextCurrentHotkey, TheGameText->fetch( "GUI:NULL" ) );
- theSelectedRec = NULL;
- thePendingKey = MK_NONE;
- thePendingMods = NONE;
-
- //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 )
-{
- //
- // This is not a shell screen, so there is no shell stack waiting on a shutdownComplete - saying
- // there was would pop whatever the shell really is parked on. CloseKeyboardOptionsMenu is what
- // takes the screen down.
- //
- layout->hide( TRUE );
-}
-
-//-------------------------------------------------------------------------------------------------
-/** options menu update method */
-//-------------------------------------------------------------------------------------------------
-void KeyboardOptionsMenuUpdate( WindowLayout *layout, void *userData )
-{
-
-} // end OptionsMenuUpdate
-
-//-------------------------------------------------------------------------------------------------
-/** 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( BitTest( state, KEY_STATE_UP ) )
- {
- AsciiString buttonName( "KeyboardOptionsMenu.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 )
-
- // with a command picked, the next key you press is the one you want it on
- if( catchBindingKey( mData1, mData2 ) )
- return MSG_HANDLED;
-
- } // end char
-
- } // end switch( msg )
-
- return MSG_IGNORED;
-
-} // end KeyboardOptionsMenuInput
-
-//-------------------------------------------------------------------------------------------------
-/** options menu window system callback */
-//-------------------------------------------------------------------------------------------------
-WindowMsgHandledType KeyboardOptionsMenuSystem( GameWindow *window, UnsignedInt msg,
- WindowMsgData mData1, WindowMsgData mData2 )
-{
- switch( msg )
- {
-
- // --------------------------------------------------------------------------------------------
- case GWM_CREATE:
- {
-
- break;
-
- } // end create
-
- //---------------------------------------------------------------------------------------------
- case GWM_DESTROY:
- {
-
- break;
-
- } // end case
-
- // --------------------------------------------------------------------------------------------
- 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;
-
- } // end input
-
- //---------------------------------------------------------------------------------------------
- case GCM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if( comboBoxCategoryList != NULL && controlID == comboBoxCategoryListID )
- {
- // the category dropdown is gone; if a layout still carries one, it just refills the list
- fillCommandListBox( currentCategory() );
-
- //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;
-
- } // end selected
-
- // ---------------------------------------------------------------------------------------------
- case GLM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if( controlID == listBoxCommandListID )
- {
- Int selected = -1;
- GadgetListBoxGetSelected( listBoxCommandList, &selected );
-
- // the record is the row's own data, so this is exact rather than matched by name -
- // two commands sharing a display name used to both answer to the first one's row
- theSelectedRec = ( selected >= 0 )
- ? (MetaMapRec *)GadgetListBoxGetItemData( listBoxCommandList, selected )
- : NULL;
-
- thePendingKey = MK_NONE;
- thePendingMods = NONE;
-
- EntryData *entry = (EntryData *)textEntryAssignHotkey->winGetUserData();
- if( entry )
- {
- entry->text->setText( UnicodeString::TheEmptyString );
- entry->charPos = 0;
- }
-
- if( theSelectedRec )
- {
- GadgetStaticTextSetText( staticTextDescription, theSelectedRec->m_description );
- GadgetStaticTextSetText( staticTextCurrentHotkey, bindingText( theSelectedRec ) );
- textEntryAssignHotkey->winEnable( true );
- TheWindowManager->winSetFocus( textEntryAssignHotkey );
- }
- else
- {
- textEntryAssignHotkey->winEnable( false );
- }
-
- } // end selected
-
- break;
-
- } // end case
-
- // ---------------------------------------------------------------------------------------------
- case GBM_SELECTED:
- {
- GameWindow *control = (GameWindow *)mData1;
- Int controlID = control->winGetWindowId();
-
- if( controlID == buttonBackID )
- {
-
- // take this screen down and give back whatever it was laid over
- CloseKeyboardOptionsMenu();
-
- } // end if
- else if( controlID == buttonAssignID )
- {
- //
- // Put the command on the key the box caught. Whatever else was on that key gives it
- // up - a key can only mean one thing - and the list is rebuilt so both the command
- // that moved and the one that was displaced show what they answer to now.
- //
- if( theSelectedRec && thePendingKey != MK_NONE )
- {
- MetaMapRec *displaced = TheMetaMap->rebind( theSelectedRec, thePendingKey, thePendingMods );
-
- fillCommandListBox( currentCategory() );
-
- GadgetStaticTextSetText( staticTextCurrentHotkey, bindingText( theSelectedRec ) );
-
- // say which command just went quiet, rather than leaving it to be found in a game
- if( displaced )
- {
- UnicodeString note = displaced->m_displayName;
- note.concat( UnicodeString( L" - " ) );
- note.concat( TheGameText->fetch( "GUI:NULL" ) );
- GadgetStaticTextSetText( staticTextDescription, note );
- }
-
- thePendingKey = MK_NONE;
- thePendingMods = NONE;
- EntryData *entry = (EntryData *)textEntryAssignHotkey->winGetUserData();
- if( entry )
- {
- entry->text->setText( UnicodeString::TheEmptyString );
- entry->charPos = 0;
- }
- }
- }
- else if( controlID == buttonResetAllID )
- {
- // every key back to what the game shipped with, and the file written out empty
- TheMetaMap->resetBindingsToDefault();
-
- fillCommandListBox( currentCategory() );
-
- theSelectedRec = NULL;
- thePendingKey = MK_NONE;
- thePendingMods = NONE;
-
- //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 text entry
- textEntryAssignHotkey->winEnable( false );
-
- }
-
- break;
-
- } // end selected
-
- default:
- return MSG_IGNORED;
-
- } // end switch
-
- return MSG_HANDLED;
-
-} // end KeyboardOptionsMenuSystem
-
-// 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;
- }
-
- //
- // This box does not take text. It takes one keystroke, whole: the key and whatever of ctrl,
- // alt and shift were held with it, on the way down, and it shows what it caught. The several
- // hundred lines below used to assemble a display string out of the characters typed into it,
- // character by character, and never arrived at a key and a modifier that anything could be
- // bound to - which is why the Assign button had nothing to do and said so in a comment.
- //
- // The mouse cases further down still matter (the box highlights and takes focus like any
- // other), so this sits in front of the keyboard ones rather than replacing the function.
- //
- if( msg == GWM_CHAR )
- return catchBindingKey( mData1, mData2 ) ? MSG_HANDLED : MSG_IGNORED;
-
- if( msg == GWM_IME_CHAR )
- return MSG_HANDLED; // a keystroke is not a character here
-
- 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 persent
- 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( BitTest( 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( BitTest( mData2, KEY_STATE_DOWN ) )
- {
- UnicodeString mod = ctrl;
- doKeyDown( e, mod );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
-
- return MSG_HANDLED;
- }
- if( BitTest(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( BitTest( mData2, KEY_STATE_DOWN ) )
- {
- UnicodeString mod = shift;
- doKeyDown( e, mod );
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
-
- return MSG_HANDLED;
-
- }
- if( BitTest( 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( BitTest( mData2, KEY_STATE_DOWN ) )
- {
- UnicodeString mod = alt;
- doKeyDown( e, mod );
-
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GEM_UPDATE_TEXT,
- (WindowMsgData)window,
- 0 );
-
- return MSG_HANDLED;
-
- }
- if( BitTest(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( BitTest( mData2, KEY_STATE_DOWN ) )
- window->winNextTab();
- break;
-
- // --------------------------------------------------------------------
- case KEY_UP:
- case KEY_LEFT:
-
- if( BitTest( 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( BitTest( 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 );
- } // end if
- }
- }
- break;
- }
-
- // ----------------------------------------------------------------------------------------
- // doing research to see if this will fix the keyboard stuff
- /*default:
- {
- char ch = mData1;
- if( ch && ( BitTest( 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 persent
- 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;
- }
- }
-
-
- }
- }*/
-
-
- } // end switch( mData1 )
-
- break;
-
- // ------------------------------------------------------------------------
- case GWM_LEFT_DOWN:
- BitSet( instData->m_state, WIN_STATE_HILITED );
- TheWindowManager->winSetFocus( window );
- break;
-
- // ------------------------------------------------------------------------
- case GWM_MOUSE_ENTERING:
-
- if (BitTest( 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( BitTest( 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( BitTest( instData->getStyle(), GWS_MOUSE_TRACK ) )
- TheWindowManager->winSendSystemMsg( window->winGetOwner(),
- GGM_LEFT_DRAG,
- (WindowMsgData)window, 0 );
- break;
-
- // ------------------------------------------------------------------------
- default:
- return MSG_IGNORED;
-
- } // end switch( msg )
-
- return MSG_HANDLED;
-
-} // end GadgetTextEntryInput
-
-
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 3c1793c3b..aa344eb1e 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
@@ -273,22 +273,6 @@ static void showOptionsPage( Int which )
if( optionsTab[ i ] )
optionsTab[ i ]->winEnable( i != which );
}
-
- //
- // The keyboard button belongs on the controls page and is drawn over it, but it is not one of
- // its children - it predates the pages and lives on the old flat panel with the rest of the
- // leftovers - so it is shown and hidden by hand rather than with its page.
- //
- GameWindow *keys = TheWindowManager->winGetWindowFromId(
- NULL, TheNameKeyGenerator->nameToKey( AsciiString( "OptionsMenu.wnd:ButtonKeyboardOptions" ) ) );
- if( keys )
- {
- keys->winHide( which != OPTIONS_PAGE_CONTROLS );
-
- // the page's own panel is painted over that old one, so the button has to come up through it
- if( which == OPTIONS_PAGE_CONTROLS )
- keys->winBringToTop();
- }
}
enum Detail
@@ -1558,9 +1542,6 @@ static void saveOptions( void )
static void DestroyOptionsLayout() {
- // the keyboard screen is laid over this one; leaving it up would leave it over nothing
- CloseKeyboardOptionsMenu();
-
SignalUIInteraction(SHELL_SCRIPT_HOOK_OPTIONS_CLOSED);
TheShell->destroyOptionsLayout();
@@ -2212,7 +2193,6 @@ WindowMsgHandledType OptionsMenuSystem( GameWindow *window, UnsignedInt msg,
static NameKeyType buttonDefaults = NAMEKEY_INVALID;
static NameKeyType buttonAccept = NAMEKEY_INVALID;
static NameKeyType buttonReplayMenu = NAMEKEY_INVALID;
- static NameKeyType buttonKeyboardOptionsMenu = NAMEKEY_INVALID;
switch( msg )
{
@@ -2225,7 +2205,6 @@ WindowMsgHandledType OptionsMenuSystem( GameWindow *window, UnsignedInt msg,
buttonBack = TheNameKeyGenerator->nameToKey( AsciiString("OptionsMenu.wnd:ButtonBack") );
buttonDefaults = TheNameKeyGenerator->nameToKey( AsciiString("OptionsMenu.wnd:ButtonDefaults") );
buttonAccept = TheNameKeyGenerator->nameToKey( AsciiString("OptionsMenu.wnd:ButtonAccept") );
- buttonKeyboardOptionsMenu = TheNameKeyGenerator->nameToKey( AsciiString( "OptionsMenu.wnd:ButtonKeyboardOptions" ) );
break;
@@ -2353,10 +2332,6 @@ WindowMsgHandledType OptionsMenuSystem( GameWindow *window, UnsignedInt msg,
{
cancelAdvancedOptions();
}
- else if ( controlID == buttonKeyboardOptionsMenu )
- {
- OpenKeyboardOptionsMenu();
- }
else if(controlID == checkDrawAnchorID )
{
if( GadgetCheckBoxIsChecked( control ) )
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
index 42e844c75..3df988332 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/QuitMenu.cpp
@@ -305,11 +305,6 @@ void ToggleQuitMenu()
// 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.
- // the keyboard screen sits over the options menu, so escape has to take it first
- if (IsKeyboardOptionsMenuOpen()) {
- CloseKeyboardOptionsMenu();
- return;
- }
if (TheShell->getOptionsLayout(FALSE) != FALSE) {
WindowLayout *optLayout = TheShell->getOptionsLayout(FALSE);
GameWindow *optionsParent = optLayout->getFirstWindow();
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp
index 22feb30a8..80fd310cf 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp
@@ -125,9 +125,6 @@ Shell::~Shell( void )
} //end if
- // the keyboard screen is laid over the options menu, so it goes first
- CloseKeyboardOptionsMenu();
-
// delete the options menu if present.
if (m_optionsLayout != NULL) {
m_optionsLayout->destroyWindows();
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp
index 3d7ba0d8b..246943a81 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp
@@ -36,7 +36,6 @@
#include "Common/PlayerList.h"
#include "Common/Team.h"
#include "Common/ThingTemplate.h"
-#include "Common/UserPreferences.h"
#include "GameClient/ControlBar.h"
#include "GameClient/Drawable.h"
@@ -816,177 +815,6 @@ MetaMapRec *MetaMap::getMetaMapRec(GameMessage::Type t)
throw INI_INVALID_DATA;
ini->initFromINI(map, TheMetaMapFieldParseTable);
-
- // what the data says, kept so Reset can put it back after a player has moved the key
- map->m_defaultKey = map->m_key;
- map->m_defaultModState = map->m_modState;
-}
-
-//-------------------------------------------------------------------------------------------------
-// Rebinding ///////////////////////////////////////////////////////////////////////////////////////
-//
-// CommandMap.ini is the default set and is in the INI checksum every machine in a network game has
-// to agree on, so a player who moves a key does not edit it. The change goes in Keybinds.ini next
-// to Options.ini, holds only the commands that are not on their default key, and is applied over
-// the defaults on the way in. Nothing about the game's rules changes, so nothing here reaches the
-// checksum: two players can hold entirely different keyboards and play the same match.
-//-------------------------------------------------------------------------------------------------
-
-/// the file, kept open for the life of the game so a rebind is a write and not a reload
-static UserPreferences *theKeybindPrefs = NULL;
-
-//-------------------------------------------------------------------------------------------------
-const char *MetaMap::getName( const MetaMapRec *rec ) const
-{
- return rec ? findGameMessageNameByType( rec->m_meta ) : NULL;
-}
-
-//-------------------------------------------------------------------------------------------------
-MetaMapRec *MetaMap::findByName( const char *name )
-{
- if( name == NULL )
- return NULL;
-
- for( MetaMapRec *map = m_metaMaps; map; map = map->m_next )
- if( stricmp( findGameMessageNameByType( map->m_meta ), name ) == 0 )
- return map;
-
- return NULL;
-}
-
-//-------------------------------------------------------------------------------------------------
-MetaMapRec *MetaMap::rebind( MetaMapRec *rec, MappableKeyType key, MappableKeyModState mods )
-{
- if( rec == NULL )
- return NULL;
-
- //
- // One key, one meaning. Whoever else was on it in the same place loses it - answering with that
- // record is how the screen can say which command just went quiet, rather than leaving the player
- // to discover it in a game.
- //
- MetaMapRec *displaced = NULL;
- if( key != MK_NONE )
- {
- for( MetaMapRec *other = m_metaMaps; other; other = other->m_next )
- {
- if( other == rec || other->m_key != key || other->m_modState != mods )
- continue;
- if( other->m_usableIn != rec->m_usableIn && !( other->m_usableIn & rec->m_usableIn ) )
- continue; // one is a menu key and the other is a game key: they never meet
-
- other->m_key = MK_NONE;
- displaced = other;
- break;
- }
- }
-
- rec->m_key = key;
- rec->m_modState = mods;
-
- saveUserBindings();
- return displaced;
-}
-
-//-------------------------------------------------------------------------------------------------
-void MetaMap::resetBindingsToDefault( void )
-{
- for( MetaMapRec *map = m_metaMaps; map; map = map->m_next )
- {
- map->m_key = map->m_defaultKey;
- map->m_modState = map->m_defaultModState;
- }
-
- saveUserBindings();
-}
-
-//-------------------------------------------------------------------------------------------------
-/** "KEY_A CTRL" - the same two words CommandMap.ini spells a binding with, so the file can be read
- * and hand-edited by anybody who already knows the INI. */
-//-------------------------------------------------------------------------------------------------
-static AsciiString spellBinding( MappableKeyType key, MappableKeyModState mods )
-{
- const char *keyName = "KEY_NONE";
- for( const LookupListRec *k = KeyNames; k->name; k++ )
- if( k->value == (Int)key ) { keyName = k->name; break; }
-
- const char *modName = "NONE";
- for( const LookupListRec *m = ModifierNames; m->name; m++ )
- if( m->value == (Int)mods ) { modName = m->name; break; }
-
- AsciiString out;
- out.format( "%s %s", keyName, modName );
- return out;
-}
-
-//-------------------------------------------------------------------------------------------------
-static Bool readBinding( const AsciiString& text, MappableKeyType *key, MappableKeyModState *mods )
-{
- char keyName[ 64 ], modName[ 64 ];
- keyName[ 0 ] = modName[ 0 ] = 0;
- if( sscanf( text.str(), "%63s %63s", keyName, modName ) < 1 )
- return FALSE;
-
- Bool gotKey = FALSE;
- for( const LookupListRec *k = KeyNames; k->name; k++ )
- if( stricmp( k->name, keyName ) == 0 ) { *key = (MappableKeyType)k->value; gotKey = TRUE; break; }
- if( !gotKey )
- return FALSE;
-
- *mods = NONE;
- for( const LookupListRec *m = ModifierNames; m->name; m++ )
- if( stricmp( m->name, modName ) == 0 ) { *mods = (MappableKeyModState)m->value; break; }
-
- return TRUE;
-}
-
-//-------------------------------------------------------------------------------------------------
-void MetaMap::loadUserBindings( void )
-{
- if( theKeybindPrefs == NULL )
- theKeybindPrefs = NEW UserPreferences;
-
- if( !theKeybindPrefs->load( "Keybinds.ini" ) )
- return; // nobody has moved a key yet
-
- for( UserPreferences::const_iterator it = theKeybindPrefs->begin(); it != theKeybindPrefs->end(); ++it )
- {
- MetaMapRec *rec = findByName( it->first.str() );
- if( rec == NULL )
- continue; // a command from a version that had it, or a typo: leave the default alone
-
- MappableKeyType key;
- MappableKeyModState mods;
- if( readBinding( it->second, &key, &mods ) )
- {
- rec->m_key = key;
- rec->m_modState = mods;
- }
- }
-}
-
-//-------------------------------------------------------------------------------------------------
-void MetaMap::saveUserBindings( void )
-{
- if( theKeybindPrefs == NULL )
- {
- theKeybindPrefs = NEW UserPreferences;
- theKeybindPrefs->load( "Keybinds.ini" );
- }
-
- theKeybindPrefs->clear();
-
- for( MetaMapRec *map = m_metaMaps; map; map = map->m_next )
- {
- if( map->m_key == map->m_defaultKey && map->m_modState == map->m_defaultModState )
- continue; // still where the data put it: nothing to remember
-
- const char *name = findGameMessageNameByType( map->m_meta );
- if( name )
- (*theKeybindPrefs)[ AsciiString( name ) ] = spellBinding( map->m_key, map->m_modState );
- }
-
- theKeybindPrefs->write();
}
//-------------------------------------------------------------------------------------------------
diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cpp
index 72385b4c6..86307101e 100644
--- a/GeneralsMD/Code/Tests/test_gameengine.cpp
+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp
@@ -8208,9 +8208,8 @@ TEST(the_minimised_panel_stops_on_the_tab_its_plate_paints)
}
}
-/* The keyboard screen is opened by a button on the options menu, and that button was the only one
- in the layout still wearing Times New Roman while every other button on the screen wears the
- game's own face. It read as a different program's dialog dropped into the menu. */
+/* Every button on the options screen wears the game's own face. One authored in Times New Roman
+ reads as a different program's dialog dropped into the menu, and nothing at build time notices. */
TEST(the_options_menu_buttons_all_wear_one_font)
{
FILE *fp = fopen( OPTIONS_MENU_WND, "rb" );
@@ -8222,7 +8221,7 @@ TEST(the_options_menu_buttons_all_wear_one_font)
static const char *const buttons[] =
{
"OptionsMenu.wnd:ButtonBack", "OptionsMenu.wnd:ButtonAccept",
- "OptionsMenu.wnd:ButtonDefaults", "OptionsMenu.wnd:ButtonKeyboardOptions", NULL
+ "OptionsMenu.wnd:ButtonDefaults", NULL
};
char line[ 1024 ], name[ 256 ];
@@ -8262,7 +8261,7 @@ TEST(the_options_menu_buttons_all_wear_one_font)
fclose( fp );
// a scan that matched nothing would pass silently
- CHECK_EQ( found, 4 );
+ CHECK_EQ( found, 3 );
CHECK_EQ( agreed, found );
}
diff --git a/GeneralsMD/Code/Tools/optionsmenu_layout.py b/GeneralsMD/Code/Tools/optionsmenu_layout.py
index 17f219a71..8799085e0 100644
--- a/GeneralsMD/Code/Tools/optionsmenu_layout.py
+++ b/GeneralsMD/Code/Tools/optionsmenu_layout.py
@@ -68,6 +68,11 @@ GROUPS = [
HEADINGS = ["GUI:DisplayOptions", "GUI:AudioOptions", "GUI:ControlOptions", "GUI:NetworkOptions"]
RULES = ["Line1", "Line2", "Line3", "Line4"]
+# The keyboard button opens a screen that no longer exists, so it goes out here rather than being
+# deleted from the output by hand every time this runs. It shipped HIDDEN and off the right edge
+# with nothing behind it: the layout its code wanted was never in any .big.
+DROP = ["ButtonKeyboardOptions"]
+
# The antialiasing label is the one control in the file EA left unnamed that still has to be
# positioned by hand, so it gets a name on the way through.
NAME_THE_UNNAMED = [("GUI:AntiAliasing", "AntiAliasingLabel")]
@@ -224,7 +229,7 @@ def build(layout):
node.name = _named(name)
drop_by_text(layout.root, HEADINGS)
- for name in RULES:
+ for name in RULES + DROP:
detach(old, name)
pages = {}