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(gameengine): add Legacy controls and an Order Lines option

Olcay Seygan5ba8e20dbcad
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 188d6375b..4e7b4b88c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -582,6 +582,9 @@ found and fixed — EA's own, not port damage.**
- The promotion screen closes when you press its key again, however fast you press it. The screen fades in, and the fade drives the window itself for several frames either way - so a second press during the fade read the screen as still shut and opened it again, and a press just after it was closed was undone by the fade's next frame.
- The command bar stops changing under you while you are using it. With nothing selected the bar shows one of your builders so you can place a structure without picking a dozer first, and it showed whichever one happened to be idle - so a dozer finishing a building on the far side of the base took the bar over, dropping a half-typed build hotkey and taking the structure off your cursor. The builder you are working with keeps the bar.
- The command bar's artwork moves with the command bar. Minimising it slid the buttons off the bottom of the screen and left the metal they sit on painted over the battlefield; the same painting stood still through the slide the bar makes when a match opens. It travels with the bar and goes with it.
+- Play it the way it shipped. Options > Controls has a Mouse and Keyboard box with two answers. Modern is this game as it is now. Legacy is the 2003 game: left click selects and orders, right click deselects, a right drag scrolls the map, a middle drag turns the camera, and the command bar answers the game's own letter for each button, painted in the button's corner the way the grid keys are. Those letters are the English game's even when the words are Turkish: the translation marks every label's first letter, which would have put K on three GLA structures and S on five. The promotion screen's number keys and the general's power keys are this game's additions, so under Legacy their labels are gone and the number keys pick your groups again. Every key comes from the game's own key map, so the grid keys, the two-key structures, Alt+Z signals, Ctrl+Z barracks, Tab, box select filters, formation lines, zoom to cursor and clickable health bars all stand down. It changes the moment you press Accept, even in the middle of a match, and it only changes your own screen.
+- The lines from your selection to where it is headed can be switched off. Options > Gameplay has an Order Lines box, on by default. Off, a selected unit shows no line to its goal and none through its shift queue; the line you draw while dragging a formation still shows, because that one is the order being given. It changes the moment you press Accept.
+- Click through the command bar wherever its metal is not. The bar is three shaped plates with sloped tops and cut corners, but it caught clicks over the whole rectangle each plate sits in, so a unit standing in the sky above the radar's slope, or in the notch beside the command grid, could not be clicked or ordered to. Between 3 and 22 percent of each plate's rectangle is empty, depending on the side and the panel. Those parts belong to the battlefield now, and the buttons and metal still take every click they did.
- Widescreen resolutions are back in the options menu, and the list works during a match. It was greyed out the moment a game started, because changing it rebuilt the menus and then pushed the main menu over whatever you were playing. It rebuilds the menus for later and leaves you on the battlefield with the command bar back up.
- Changing the resolution during a match no longer takes the game down. Two things were behind it. The old command bar's windows were handed back while the menu system still had them on its list, so the next thing that painted a button read whatever had since been written over it. And the bar itself was thrown away and built from scratch, which handed out fresh copies of every build button while your factories, your repair crews and the promotion screen went on pointing at the old ones. The bar's windows are rebuilt now and the bar keeps everything that is not a window.
- One command bar, not three. Changing the resolution during a match rebuilt the bar and left the old one behind, still drawn and still taking clicks at the size of the screen it was built for - and the confirmation box you answer afterwards rebuilds it a second time, so two mode changes in a row put three command bars on top of each other across the bottom of the battlefield. The code that was meant to throw the old one away asked the window system for a window called "ControlBar.wnd", and the bar's window is called "ControlBar.wnd:ControlBarParent", so it never found anything to throw away and never had.
diff --git a/GeneralsMD/Code/CMakeLists.txt b/GeneralsMD/Code/CMakeLists.txt
index 50bfd4a18..c9ea24327 100644
--- a/GeneralsMD/Code/CMakeLists.txt
+++ b/GeneralsMD/Code/CMakeLists.txt
@@ -750,7 +750,8 @@ set_target_properties(test_gameengine PROPERTIES CXX_STANDARD 17)
target_compile_definitions(test_gameengine PRIVATE
GAMEENGINE_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/GameEngine"
FXLIST_REFORGED_INI="${CMAKE_CURRENT_SOURCE_DIR}/Data/INI/FXListReforged.ini"
- OPTIONS_MENU_WND="${CMAKE_CURRENT_SOURCE_DIR}/Data/Window/Menus/OptionsMenu.wnd")
+ OPTIONS_MENU_WND="${CMAKE_CURRENT_SOURCE_DIR}/Data/Window/Menus/OptionsMenu.wnd"
+ PLATE_TEXTURE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/Data/Art/Textures")
# The three hand-written self-checks predate the harness; run them from ctest
# too so one command covers everything.
diff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.str
index ba47f7a11..80540abad 100644
--- a/GeneralsMD/Code/Data/Patch.str
+++ b/GeneralsMD/Code/Data/Patch.str
@@ -730,6 +730,34 @@ 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:OptionsGroupInput
+"Input"
+END
+
+GUI:InputScheme
+"Mouse and Keyboard"
+END
+
+GUI:InputScheme0
+"Modern"
+END
+
+GUI:InputScheme1
+"Legacy"
+END
+
+TOOLTIP:InputScheme
+"Modern: left selects, right orders, the middle button moves the camera and the grid keys run the command bar. Legacy: the mouse and keys the game shipped with, without any of the additions."
+END
+
+GUI:OrderLines
+"Order Lines"
+END
+
+TOOLTIP:OrderLines
+"A line from each selected unit to where it is going, and on through every point it has queued."
+END
+
GUI:PlayerColors
"Player Colors"
END
diff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.str
index 6bbc618c4..d9aa38482 100644
--- a/GeneralsMD/Code/Data/Turkish/Generals.str
+++ b/GeneralsMD/Code/Data/Turkish/Generals.str
@@ -15301,6 +15301,34 @@ TOOLTIP:HealthBars
"Akıllı; hasar almış her şeyin, seçili birliklerin ve imlecin altındakinin üzerinde çubuk gösterir. Yalnızca seçili, orijinal oyunun davranışıdır."
END
+GUI:OptionsGroupInput
+"Kontrol Düzeni"
+END
+
+GUI:InputScheme
+"Fare ve Klavye"
+END
+
+GUI:InputScheme0
+"Modern"
+END
+
+GUI:InputScheme1
+"Legacy"
+END
+
+TOOLTIP:InputScheme
+"Modern: sol tık seçer, sağ tık emir verir, orta tuş kamerayı gezdirir, komut çubuğu ızgara tuşlarıyla kullanılır. Legacy: oyunun çıktığı hâldeki fare ve tuşlar, sonradan eklenenlerin hiçbiri olmadan."
+END
+
+GUI:OrderLines
+"Emir Çizgileri"
+END
+
+TOOLTIP:OrderLines
+"Seçili her birimden gittiği yere, oradan da sıraya aldığı her noktaya bir çizgi çeker."
+END
+
GUI:PlayerColors
"Oyuncu Renkleri"
END
diff --git a/GeneralsMD/Code/Data/Window/Menus/OptionsMenu.wnd b/GeneralsMD/Code/Data/Window/Menus/OptionsMenu.wnd
index 0037051cd..bd3b165df 100644
--- a/GeneralsMD/Code/Data/Window/Menus/OptionsMenu.wnd
+++ b/GeneralsMD/Code/Data/Window/Menus/OptionsMenu.wnd
@@ -5969,6 +5969,339 @@ WINDOW
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: 530 150, BOTTOMRIGHT: 754 174, CREATIONRESOLUTION: 800 600;
+ NAME = "OptionsMenu.wnd:GroupHeadingControls2";
+ STATUS = ENABLED;
+ STYLE = STATICTEXT+MOUSETRACK;
+ SYSTEMCALLBACK = "[None]";
+ INPUTCALLBACK = "[None]";
+ TOOLTIPCALLBACK = "[None]";
+ DRAWCALLBACK = "[None]";
+ FONT = NAME: "Generals", SIZE: 15, BOLD: 0;
+ HEADERTEMPLATE = "MainButton";
+ TOOLTIPDELAY = -1;
+ TEXT = "GUI:OptionsGroupInput";
+ TEXTCOLOR = ENABLED: 186 255 12 255, ENABLEDBORDER: 0 2 0 255, DISABLED: 186 255 12 255, DISABLEDBORDER: 0 2 0 255, HILITE: 186 255 12 255, HILITEBORDER: 0 2 0 255;
+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 0, BORDERCOLOR: 0 0 0 0,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;
+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 64 64 64 255, BORDERCOLOR: 192 192 192 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;
+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 128 0 255, BORDERCOLOR: 128 255 128 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;
+ STATICTEXTDATA = CENTERED: 0;
+ END
+ CHILD
+ WINDOW
+ WINDOWTYPE = STATICTEXT;
+ SCREENRECT = UPPERLEFT: 530 182, BOTTOMRIGHT: 754 206, CREATIONRESOLUTION: 800 600;
+ NAME = "OptionsMenu.wnd:LabelInputScheme";
+ TOOLTIPTEXT = "TOOLTIP:InputScheme";
+ STATUS = ENABLED;
+ STYLE = STATICTEXT+MOUSETRACK;
+ SYSTEMCALLBACK = "[None]";
+ INPUTCALLBACK = "[None]";
+ TOOLTIPCALLBACK = "[None]";
+ DRAWCALLBACK = "[None]";
+ FONT = NAME: "Arial", SIZE: 14, BOLD: 0;
+ HEADERTEMPLATE = "MinorTitle";
+ TOOLTIPDELAY = -1;
+ TEXT = "GUI:InputScheme";
+ TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,
+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,
+ HILITE: 128 128 255 255, HILITEBORDER: 0 0 128 255;
+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 0, BORDERCOLOR: 0 0 0 0,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;
+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 64 64 64 255, BORDERCOLOR: 192 192 192 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;
+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 128 0 255, BORDERCOLOR: 128 255 128 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255,
+ IMAGE: NoImage, COLOR: 255 255 255 255, BORDERCOLOR: 255 255 255 255;
+ STATICTEXTDATA = CENTERED: 0;
+ END
+ CHILD
+ WINDOW
+ WINDOWTYPE = COMBOBOX;
+ SCREENRECT = UPPERLEFT: 536 206, BOTTOMRIGHT: 760 230, CREATIONRESOLUTION: 800 600;
+ NAME = "OptionsMenu.wnd:ComboBoxInputScheme";
+ TOOLTIPTEXT = "TOOLTIP:InputScheme";
+ STATUS = ENABLED+IMAGE;
+ STYLE = MOUSETRACK+COMBOBOX;
+ SYSTEMCALLBACK = "[None]";
+ INPUTCALLBACK = "[None]";
+ TOOLTIPCALLBACK = "[None]";
+ DRAWCALLBACK = "[None]";
+ FONT = NAME: "Arial", SIZE: 10, BOLD: 0;
+ HEADERTEMPLATE = "ComboBoxEntry";
+ TOOLTIPDELAY = -1;
+ TEXTCOLOR = ENABLED: 254 254 254 255, ENABLEDBORDER: 0 0 0 255,
+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,
+ HILITE: 128 128 255 255, HILITEBORDER: 0 0 128 255;
+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 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;
+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,
+ IMAGE: NoImage, COLOR: 192 192 192 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 255 0 255, BORDERCOLOR: 0 128 0 255,
+ IMAGE: ListBoxHiliteSelectedItemLeftEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,
+ IMAGE: ListBoxHiliteSelectedItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
+ IMAGE: ListBoxHiliteSelectedItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
+ IMAGE: ListBoxHiliteSelectedItemSmallRepeatingCenter, 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;
+ COMBOBOXDATA = ISEDITABLE: 0,
+ MAXCHARS: 16,
+ MAXDISPLAY: 5,
+ ASCIIONLY: 0,
+ LETTERSANDNUMBERS: 0;
+ COMBOBOXDROPDOWNBUTTONENABLEDDRAWDATA = IMAGE: VSliderDownButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,
+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 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;
+ COMBOBOXDROPDOWNBUTTONDISABLEDDRAWDATA = IMAGE: VSliderDownButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,
+ IMAGE: NoImage, COLOR: 192 192 192 255, BORDERCOLOR: 128 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;
+ COMBOBOXDROPDOWNBUTTONHILITEDRAWDATA = IMAGE: VSliderDownButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,
+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 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;
+ COMBOBOXEDITBOXENABLEDDRAWDATA = IMAGE: TextEntryEnabledLeftEnd, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,
+ IMAGE: TextEntryEnabledRightEnd, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,
+ IMAGE: TextEntryEnabledRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
+ IMAGE: TextEntryEnabledSmallRepeatingCenter, 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;
+ COMBOBOXEDITBOXDISABLEDDRAWDATA = IMAGE: TextEntryDisabledLeftEnd, COLOR: 128 128 128 255, BORDERCOLOR: 0 0 0 255,
+ IMAGE: TextEntryDisabledRightEnd, COLOR: 192 192 192 255, BORDERCOLOR: 254 254 254 255,
+ IMAGE: TextEntryDisabledRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
+ IMAGE: TextEntryDisabledSmallRepeatingCenter, 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;
+ COMBOBOXEDITBOXHILITEDRAWDATA = IMAGE: TextEntryHiliteLeftEnd, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,
+ IMAGE: TextEntryHiliteRightEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,
+ IMAGE: TextEntryHiliteRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
+ IMAGE: TextEntryHiliteSmallRepeatingCenter, 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;
+ COMBOBOXLISTBOXENABLEDDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,
+ IMAGE: ListBoxHiliteItemLeftEnd, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,
+ IMAGE: ListBoxHiliteItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
+ IMAGE: ListBoxHiliteItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
+ IMAGE: ListBoxHiliteItemSmallRepeatingCenter, 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;
+ COMBOBOXLISTBOXDISABLEDDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,
+ IMAGE: NoImage, COLOR: 192 192 192 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;
+ COMBOBOXLISTBOXHILITEDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 255, BORDERCOLOR: 49 55 168 255,
+ IMAGE: ListBoxHiliteSelectedItemLeftEnd, COLOR: 254 254 254 255, BORDERCOLOR: 0 128 0 255,
+ IMAGE: ListBoxHiliteSelectedItemRightEnd, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
+ IMAGE: ListBoxHiliteSelectedItemRepeatingCenter, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,
+ IMAGE: ListBoxHiliteSelectedItemSmallRepeatingCenter, 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;
+ LISTBOXENABLEDUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,
+ IMAGE: VSliderUpButtonHiliteSelected, COLOR: 255 255 0 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;
+ LISTBOXDISABLEDUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,
+ IMAGE: NoImage, COLOR: 192 192 192 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;
+ LISTBOXHILITEUPBUTTONDRAWDATA = IMAGE: VSliderUpButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,
+ IMAGE: VSliderUpButtonHiliteSelected, COLOR: 254 254 254 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;
+ LISTBOXENABLEDDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonEnabled, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,
+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 255 255 0 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;
+ LISTBOXDISABLEDDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,
+ IMAGE: NoImage, COLOR: 192 192 192 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;
+ LISTBOXHILITEDOWNBUTTONDRAWDATA = IMAGE: VSliderDownButtonHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,
+ IMAGE: VSliderDownButtonHiliteSelected, COLOR: 254 254 254 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;
+ LISTBOXENABLEDSLIDERDRAWDATA = IMAGE: NoImage, COLOR: 168 255 12 0, 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;
+ LISTBOXDISABLEDSLIDERDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 0, BORDERCOLOR: 148 112 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;
+ LISTBOXHILITESLIDERDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 0, BORDERCOLOR: 49 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;
+ SLIDERTHUMBENABLEDDRAWDATA = IMAGE: ScrollBarThumbEnabled, COLOR: 255 4 0 0, BORDERCOLOR: 255 243 28 255,
+ IMAGE: ScrollBarThumbHiliteSelected, COLOR: 255 255 0 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;
+ SLIDERTHUMBDISABLEDDRAWDATA = IMAGE: ScrollBarThumbDisabled, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,
+ IMAGE: NoImage, COLOR: 192 192 192 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;
+ SLIDERTHUMBHILITEDRAWDATA = IMAGE: ScrollBarThumbHilite, COLOR: 0 255 0 255, BORDERCOLOR: 0 128 0 255,
+ IMAGE: ScrollBarThumbHiliteSelected, COLOR: 254 254 254 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;
+ END
ENDALLCHILDREN
END
CHILD
@@ -6637,6 +6970,53 @@ WINDOW
IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;
END
CHILD
+ WINDOW
+ WINDOWTYPE = CHECKBOX;
+ SCREENRECT = UPPERLEFT: 40 294, BOTTOMRIGHT: 264 318, CREATIONRESOLUTION: 800 600;
+ NAME = "OptionsMenu.wnd:CheckOrderLines";
+ STATUS = ENABLED+IMAGE+BORDER;
+ STYLE = CHECKBOX+MOUSETRACK;
+ SYSTEMCALLBACK = "[None]";
+ INPUTCALLBACK = "[None]";
+ TOOLTIPCALLBACK = "[None]";
+ DRAWCALLBACK = "[None]";
+ FONT = NAME: "Arial", SIZE: 14, BOLD: 0;
+ HEADERTEMPLATE = "MinorTitle";
+ TOOLTIPTEXT = "TOOLTIP:OrderLines";
+ TOOLTIPDELAY = -1;
+ TEXT = "GUI:OrderLines";
+ TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,
+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,
+ HILITE: 186 255 12 255, HILITEBORDER: 0 0 0 255;
+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,
+ IMAGE: Active-Unchecked, COLOR: 255 255 255 0, BORDERCOLOR: 128 128 255 255,
+ IMAGE: Active-Checked, COLOR: 0 0 255 255, BORDERCOLOR: 128 128 255 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;
+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,
+ IMAGE: Disabled-Unchecked, COLOR: 255 255 255 0, BORDERCOLOR: 192 192 192 255,
+ IMAGE: Disabled-Checked, COLOR: 64 64 64 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;
+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 255, BORDERCOLOR: 128 255 128 255,
+ IMAGE: Active-HiLighted, COLOR: 255 255 255 0, BORDERCOLOR: 128 128 255 255,
+ IMAGE: Active-Checked, COLOR: 255 255 0 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;
+ END
+ CHILD
WINDOW
WINDOWTYPE = STATICTEXT;
SCREENRECT = UPPERLEFT: 282 150, BOTTOMRIGHT: 506 174, CREATIONRESOLUTION: 800 600;
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
index 7598b5f1d..48deee289 100644
--- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
+++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
@@ -72,6 +72,17 @@ enum HealthBarModeType
HEALTH_BAR_MODE_COUNT = 4,
};
+/** How the mouse and the keyboard give orders. Modern is this fork's: left selects, right orders, the
+ * middle button drives the camera and the grid keys run the command bar. Legacy is the game as it
+ * shipped, keys and all, with none of what this fork added to either. */
+enum InputSchemeType
+{
+ INPUT_SCHEME_MODERN = 0,
+ INPUT_SCHEME_LEGACY = 1,
+
+ INPUT_SCHEME_COUNT = 2,
+};
+
/** The language the game's words are shown in. English is the string table EA shipped; every other
* entry names a translation GameText lays over it. Speech and video stay what the install has. */
enum TextLanguageType
@@ -296,6 +307,9 @@ public:
Int m_healthBarMode; ///< HealthBarModeType: which units wear a bar at all
Int m_playerColorScheme; ///< PlayerColorSchemeType: whose colour the client draws (client only)
Int m_textLanguage; ///< TextLanguageType: the translation GameText lays over the CSF, read once at startup (client only)
+ Int m_inputScheme; ///< InputSchemeType: which mouse and keyboard the client answers to, read on every click and key (client only)
+ Bool isLegacyInput( void ) const { return m_inputScheme == INPUT_SCHEME_LEGACY; }
+ Bool m_showOrderLines; ///< draw a line from each selected unit to where it is going, and its queue (client only)
Bool m_scriptDebug; ///< Should we attempt to load the script debugger window (.DLL)
Bool m_particleEdit; ///< Should we attempt to load the particle editor (.DLL)
Bool m_displayDebug; ///< Used to display display debug info
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
index 464204613..cb5962d87 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
@@ -942,6 +942,13 @@ public:
/// how far down that panel has slid, in pixels - the plate art travels with its windows
Int getPanelSlideOffset( Int panel ) const;
+ /** TRUE when a click at this screen point, over this window, belongs to the world after all: the
+ * window is one of the bar's input-blocking panes or CenterBackground, no window inside it is
+ * under the point, and every plate painted there is transparent at that texel. The panes are
+ * rectangles and the plates are not, so without this a click on the sky above a sloped edge
+ * went nowhere. GameWindow::winPointInChild asks, so clicking and unit picking agree. */
+ Bool letsClickThrough( GameWindow *window, Int x, Int y );
+
/// the same journey as a fraction, 0 home and 1 gone. Needs no display, which is why the test
/// for the rebuild ordering asks this one; see clearPanelSlide
Real getPanelSlideFraction( Int panel ) const
@@ -1373,6 +1380,12 @@ struct ControlBarPlate
* like "ChinaTankGeneral", so the match is on the front of the name. NULL when nothing fits. */
extern const ControlBarPlate *ControlBarPlateForSide( const AsciiString& side, Int panel );
+/** One flag per texel of a plate's painting, read out of its targa (32 bits, plain or run-length
+ * encoded), row 0 at the top: 1 where the painting is solid enough to catch a click. FALSE, and
+ * nothing to rely on in 'mask', for anything that is not a 32-bit targa at least artW by artH. */
+extern Bool ControlBarPlateMaskFromTarga( const UnsignedByte *data, Int length, Int artW, Int artH,
+ std::vector<UnsignedByte> &mask );
+
/** Where a design rectangle belonging to 'panel' lands on a display this size. This is the one
* piece of arithmetic the whole layout is built out of: one uniform scale, and an anchor that
* pins the left panel to the left edge, the right panel to the right edge and the middle one to
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GameText.h b/GeneralsMD/Code/GameEngine/Include/GameClient/GameText.h
index 462427df3..c5b09903e 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/GameText.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/GameText.h
@@ -78,6 +78,12 @@ class GameTextInterface : public SubsystemInterface
virtual UnicodeString fetch( const Char *label, Bool *exists = NULL ) = 0; ///< Returns the associated labeled unicode text
virtual UnicodeString fetch( AsciiString label, Bool *exists = NULL ) = 0; ///< Returns the associated labeled unicode text
+
+ /** The text a label had before the player's translation was laid over it: the CSF, or this
+ * fork's own English in Patch.str. Legacy input reads its '&' hot keys from here, because a
+ * translation marks letters of its own and those are not the keys the game shipped with. */
+ virtual UnicodeString fetchUntranslated( const Char *label ) = 0;
+
// This function is not performance tuned.. Its really only for Worldbuilder. jkmcd
virtual AsciiStringVec& getStringsWithLabelPrefix(AsciiString label) = 0;
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/LookAtXlat.h b/GeneralsMD/Code/GameEngine/Include/GameClient/LookAtXlat.h
index eda4a0d0d..ba9e67399 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/LookAtXlat.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/LookAtXlat.h
@@ -68,14 +68,15 @@ private:
{
MAX_VIEW_LOCS = 8
};
- // The right button used to be in here as SCROLL_RMB. It is not any more: the right button
- // gives orders now, and the camera drag lives on the middle one.
+ // Modern drags the camera with the middle button and gives orders with the right one; Legacy
+ // drags it with the right button, the way the game shipped.
enum
{
SCROLL_NONE = 0,
SCROLL_KEY,
SCROLL_SCREENEDGE,
- SCROLL_MMB // middle-button drag pan
+ SCROLL_MMB, // middle-button drag pan, Modern
+ SCROLL_RMB // right-button drag pan, Legacy
};
ICoord2D m_anchor;
ICoord2D m_originalAnchor;
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/MetaEvent.h b/GeneralsMD/Code/GameEngine/Include/GameClient/MetaEvent.h
index e8cca93de..453a13778 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/MetaEvent.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/MetaEvent.h
@@ -30,6 +30,7 @@
#ifndef _H_MetaEvent
#define _H_MetaEvent
+#include "Common/GlobalData.h"
#include "Common/SubsystemInterface.h"
#include "GameClient/InGameUI.h"
#include "GameClient/KeyDownInfo.h"
@@ -365,14 +366,15 @@ class MetaMap : public SubsystemInterface
friend class MetaEventTranslator;
private:
- MetaMapRec *m_metaMaps;
+ MetaMapRec *m_metaMaps[ INPUT_SCHEME_COUNT ]; ///< one list of bindings per InputSchemeType
+ Int m_parseScheme; ///< the list parseMetaMap is filling
protected:
GameMessage::Type findGameMessageMetaType(const char* name);
MetaMapRec *getMetaMapRec(GameMessage::Type t);
public:
-
+
MetaMap();
~MetaMap();
@@ -381,7 +383,15 @@ public:
void update() { }
static void parseMetaMap(INI* ini);
- const MetaMapRec *getFirstMetaMapRec() const { return m_metaMaps; }
+
+ /** Fill the Legacy list from the language's CommandMap.ini alone, which is the game's own map out
+ * of its own archives. Everything this fork binds is in Data\INI\CommandMap.ini, and only the
+ * Modern list reads that. */
+ void loadLegacyBindings( const AsciiString& languageMapFile );
+
+ /// the bindings the player's InputScheme answers to
+ const MetaMapRec *getFirstMetaMapRec() const;
+ const MetaMapRec *getFirstMetaMapRec( Int scheme ) const { return m_metaMaps[ scheme ]; }
};
extern MetaMap *TheMetaMap;
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/SelectionXlat.h b/GeneralsMD/Code/GameEngine/Include/GameClient/SelectionXlat.h
index 4452d9e04..d7272bb8c 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/SelectionXlat.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/SelectionXlat.h
@@ -53,6 +53,12 @@ private:
ICoord2D m_selectFeedbackAnchor; // Note: Used for drawing feedback only.
Bool m_displayedMaxWarning; // did we already display a warning about selecting too many units?
+ // where and when the right button went down, and where the camera was, so a Legacy release can
+ // tell a click, which deselects, from the drag that scrolled the camera
+ ICoord2D m_rightDownPixel;
+ UnsignedInt m_rightDownTime;
+ Coord3D m_rightDownCamera;
+
SelectCountMap m_selectCountMap;
Bool selectFriends( Drawable *draw, GameMessage *createTeamMsg, Bool dragSelecting );
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp
index 6b5aece50..b749f387f 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp
@@ -885,6 +885,8 @@ void GameEngine::init( int argc, char *argv[] )
AsciiString fname;
fname.format("Data\\%s\\CommandMap.ini", GetRegistryLanguage().str());
initSubsystem(TheMetaMap,"TheMetaMap", MSGNEW("GameEngineSubsystem") MetaMap(), NULL, fname.str(), "Data\\INI\\CommandMap.ini");
+ // Legacy mouse and keyboard answers to the game's own map and to nothing this fork binds
+ TheMetaMap->loadLegacyBindings(fname);
#if defined(_DEBUG) || defined(_INTERNAL)
ini.load("Data\\INI\\CommandMapDebug.ini", INI_LOAD_MULTIFILE, NULL);
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
index e5d2c6f9d..2acafad04 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
@@ -916,6 +916,10 @@ GlobalData::GlobalData()
m_playerColorScheme = PLAYER_COLORS_ORIGINAL;
// the words the game shipped with until somebody picks a translation
m_textLanguage = TEXT_LANGUAGE_ENGLISH;
+ // the mouse and keys this fork plays with until somebody asks for the ones the game shipped with
+ m_inputScheme = INPUT_SCHEME_MODERN;
+ // the lines have been on since they were added, so nobody loses them until they say so
+ m_showOrderLines = TRUE;
m_particleEdit = FALSE;
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp b/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp
index 4004ab145..f2cc3e7c6 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp
@@ -57,6 +57,8 @@ OPTION_BOOL_ACCESSORS( m_vsync )
OPTION_INT_ACCESSORS( m_healthBarMode )
OPTION_INT_ACCESSORS( m_playerColorScheme )
OPTION_INT_ACCESSORS( m_textLanguage )
+OPTION_INT_ACCESSORS( m_inputScheme )
+OPTION_BOOL_ACCESSORS( m_showOrderLines )
//-----------------------------------------------------------------------------
static const unsigned TheMsaaSamples[ OPTION_MSAA_LEVEL_COUNT ] = { 0, 2, 4, 8, 16 };
@@ -269,6 +271,20 @@ const OptionDef TheOptionCatalog[] =
OPTION_ENUM, APPLY_LIVE, 0, PLAYER_COLOR_SCHEME_COUNT - 1,
get_m_playerColorScheme, set_m_playerColorScheme },
+ // Modern or Legacy. Legacy is the mouse and the keys the game shipped with and switches off what
+ // this fork added to both. Every click and key asks, so it changes the moment Accept is pressed,
+ // and it is local: two players in one match can give orders two different ways.
+ // The line from each selected unit to where it is going, with every point of a shift queue after
+ // it. The list is rebuilt from the units every frame, so turning it off takes the lines away at
+ // once and turning it back on shows the orders already given.
+ { "OrderLines", OPT_WND( "CheckOrderLines" ), "GUI:OrderLines",
+ OPTION_BOOL, APPLY_LIVE, 0, 1,
+ get_m_showOrderLines, set_m_showOrderLines },
+
+ { "InputScheme", OPT_WND( "ComboBoxInputScheme" ), "GUI:InputScheme",
+ OPTION_ENUM, APPLY_LIVE, 0, INPUT_SCHEME_COUNT - 1,
+ get_m_inputScheme, set_m_inputScheme },
+
// Which language the words are in. English is the string table the game shipped with, and every
// other entry is a translation laid over it, so a line the translation lacks stays English. The
// table is built once while the game starts: a new language is on screen from the next launch.
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
index aea6cb2e7..b17fa2fea 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
@@ -38,6 +38,8 @@
#define DEFINE_RADIUSCURSOR_NAMES
#include "Common/ActionManager.h"
+#include "Common/file.h"
+#include "Common/FileSystem.h"
#include "Common/GameAudio.h"
#include "Common/GameType.h"
#include "Common/MultiplayerSettings.h"
@@ -1627,6 +1629,165 @@ static const char *shortWindowName( GameWindow *win )
return colon ? colon + 1 : name;
}
+//-------------------------------------------------------------------------------------------------
+// Where a plate is transparent ---------------------------------------------------------------------
+//-------------------------------------------------------------------------------------------------
+
+static const Int TARGA_HEADER_SIZE = 18;
+static const UnsignedByte TARGA_TRUE_COLOR = 2;
+static const UnsignedByte TARGA_TRUE_COLOR_RLE = 10;
+static const UnsignedByte TARGA_BITS_PER_PIXEL = 32;
+static const UnsignedByte TARGA_TOP_ORIGIN = 0x20;
+static const UnsignedByte TARGA_RLE_REPEAT = 0x80;
+static const UnsignedByte TARGA_RLE_COUNT = 0x7f;
+static const Int TARGA_BYTES_PER_PIXEL = 4;
+static const Int TARGA_ALPHA_OFFSET = 3;
+
+/// half-covered or more catches a click; the soft rim of a sloped edge below that lets it through
+static const UnsignedByte PLATE_SOLID_ALPHA = 128;
+
+//-------------------------------------------------------------------------------------------------
+Bool ControlBarPlateMaskFromTarga( const UnsignedByte *data, Int length, Int artW, Int artH,
+ std::vector<UnsignedByte> &mask )
+{
+ if( data == NULL || length < TARGA_HEADER_SIZE || artW <= 0 || artH <= 0 )
+ return FALSE;
+
+ const UnsignedByte imageType = data[ 2 ];
+ const Int width = data[ 12 ] | ( data[ 13 ] << 8 );
+ const Int height = data[ 14 ] | ( data[ 15 ] << 8 );
+ if( data[ 1 ] != 0 || ( imageType != TARGA_TRUE_COLOR && imageType != TARGA_TRUE_COLOR_RLE ) )
+ return FALSE;
+ if( data[ 16 ] != TARGA_BITS_PER_PIXEL || width < artW || height < artH )
+ return FALSE;
+ const Bool topOrigin = ( data[ 17 ] & TARGA_TOP_ORIGIN ) != 0;
+
+ mask.assign( artW * artH, 0 );
+ Int cursor = TARGA_HEADER_SIZE + data[ 0 ];
+ const Int pixelCount = width * height;
+ Int pixel = 0;
+ UnsignedByte alpha = 0;
+ while( pixel < pixelCount )
+ {
+ Int run = 1;
+ Bool repeated = FALSE;
+ if( imageType == TARGA_TRUE_COLOR_RLE )
+ {
+ if( cursor >= length )
+ return FALSE;
+ const UnsignedByte packet = data[ cursor++ ];
+ repeated = ( packet & TARGA_RLE_REPEAT ) != 0;
+ run = ( packet & TARGA_RLE_COUNT ) + 1;
+ }
+
+ for( Int i = 0; i < run && pixel < pixelCount; i++, pixel++ )
+ {
+ if( repeated == FALSE || i == 0 )
+ {
+ if( cursor + TARGA_BYTES_PER_PIXEL > length )
+ return FALSE;
+ alpha = data[ cursor + TARGA_ALPHA_OFFSET ];
+ cursor += TARGA_BYTES_PER_PIXEL;
+ }
+
+ const Int x = pixel % width;
+ const Int fileRow = pixel / width;
+ const Int y = topOrigin ? fileRow : height - 1 - fileRow;
+ if( x < artW && y < artH )
+ mask[ y * artW + x ] = alpha >= PLATE_SOLID_ALPHA;
+ }
+ }
+ return TRUE;
+}
+
+//
+// A plate's mask is read off its targa the first time a click lands on one of its panes, and kept for
+// the session. A targa that does not read leaves the mask empty, and an empty mask counts as solid
+// everywhere, so that pane goes back to catching every click over its rectangle.
+//
+typedef std::map< const ControlBarPlate *, std::vector<UnsignedByte> > ControlBarPlateMaskMap;
+static ControlBarPlateMaskMap thePlateMasks;
+
+static const std::vector<UnsignedByte> &plateMask( const ControlBarPlate *plate )
+{
+ ControlBarPlateMaskMap::iterator it = thePlateMasks.find( plate );
+ if( it != thePlateMasks.end() )
+ return it->second;
+
+ std::vector<UnsignedByte> &mask = thePlateMasks[ plate ];
+ AsciiString path;
+ path.format( "Art\\Textures\\%s", plate->filename );
+ File *file = TheFileSystem ? TheFileSystem->openFile( path.str(), File::READ | File::BINARY ) : NULL;
+ if( file == NULL )
+ {
+ DEBUG_LOG(( "CONTROLBAR PLATE MASK %s did not open, its panes catch every click\n", path.str() ));
+ return mask;
+ }
+
+ const Int length = file->size();
+ char *bytes = file->readEntireAndClose();
+ if( ControlBarPlateMaskFromTarga( (const UnsignedByte *)bytes, length, plate->artW, plate->artH, mask ) == FALSE )
+ {
+ DEBUG_LOG(( "CONTROLBAR PLATE MASK %s is not a 32-bit targa of at least %dx%d, its panes catch every click\n",
+ path.str(), plate->artW, plate->artH ));
+ mask.clear();
+ }
+ delete [] bytes;
+ return mask;
+}
+
+//-------------------------------------------------------------------------------------------------
+Bool ControlBar::letsClickThrough( GameWindow *window, Int x, Int y )
+{
+ GameWindow *frame = window->winGetParent();
+ if( frame == NULL || m_controlBarSchemeManager == NULL || TheDisplay == NULL )
+ return FALSE;
+ if( frame->winGetWindowId() != (Int)TheNameKeyGenerator->nameToKey( "ControlBar.wnd:ControlBarParent" ) )
+ return FALSE;
+
+ const char *shortName = shortWindowName( window );
+ if( shortName[ 0 ] != 0 && strcmp( shortName, "CenterBackground" ) != 0 )
+ return FALSE;
+
+ // a command button or anything else inside the pane is its own window and keeps its click
+ if( window->winPointInChild( x, y, TRUE ) != window )
+ return FALSE;
+
+ // the plates are drawn from design rectangles and travel with the frame and the slide, the same
+ // arithmetic W3DCommandBarBackgroundDraw paints them with
+ ICoord2D now;
+ frame->winGetScreenPosition( &now.x, &now.y );
+ for( Int p = 0; p < CB_PANEL_COUNT; p++ )
+ {
+ if( m_panelHidden[ p ] )
+ continue;
+
+ const ControlBarPlate *plate = ControlBarPlateForSide( m_controlBarSchemeManager->getCurrentSide(), p );
+ if( plate == NULL )
+ plate = ControlBarPlateForSide( m_controlBarSchemeManager->getCurrentArtTwinSide(), p );
+ IRegion2D rect;
+ if( plate == NULL ||
+ ControlBarPanelDesignToScreen( p, &plate->design, TheDisplay->getWidth(), TheDisplay->getHeight(), &rect ) == FALSE )
+ continue;
+
+ const Int left = rect.lo.x + now.x - m_panelOrigin.x;
+ const Int top = rect.lo.y + now.y - m_panelOrigin.y + getPanelSlideOffset( p );
+ const Int width = rect.width();
+ const Int height = rect.height();
+ if( width <= 0 || height <= 0 || x < left || y < top || x >= left + width || y >= top + height )
+ continue;
+
+ const std::vector<UnsignedByte> &mask = plateMask( plate );
+ if( mask.empty() )
+ return FALSE;
+ const Int texelX = ( x - left ) * plate->artW / width;
+ const Int texelY = ( y - top ) * plate->artH / height;
+ if( mask[ texelY * plate->artW + texelX ] )
+ return FALSE;
+ }
+ return TRUE;
+}
+
//-------------------------------------------------------------------------------------------------
/** Place 'win' and everything under it inside 'panel'. Positions are relative to the parent, so
* both the parent's old and new screen origins travel down the recursion: the old one to work out
@@ -2122,6 +2283,10 @@ void ControlBar::layoutPanels( void )
parent->winSetPosition( 0, parentTop );
parent->winSetSize( REAL_TO_INT_CEIL( dispW ), REAL_TO_INT_CEIL( dispH ) - parentTop );
+ // A click that passes a transparent part of a plate lands on the frame, and a unit under it can
+ // only be picked if the frame says it can be seen through; see letsClickThrough.
+ parent->winSetStatus( WIN_STATUS_SEE_THRU );
+
// the plates are drawn from design rectangles rather than from a window, so they need to be told
// where the frame they belong to started out - see getPanelOrigin
m_panelOrigin.x = 0;
@@ -4433,6 +4598,25 @@ static UnicodeString getGridHotKeyLabel( Int slot )
return getMetaKeyLabel( (GameMessage::Type)(GameMessage::MSG_META_COMMAND_SLOT01 + slot) );
}
+//-------------------------------------------------------------------------------------------------
+/** The letter a button's label marks with '&', in capitals: the key HotKeyManager presses that
+ * button with under Legacy input. Read from the untranslated label, because a translation marks
+ * letters of its own - the Turkish one marks every label's first letter, which put K on three
+ * GLA structures and S on five. */
+//-------------------------------------------------------------------------------------------------
+static UnicodeString getLabelHotKeyLabel( const AsciiString& textLabel )
+{
+ UnicodeString label;
+ const UnicodeString text = TheGameText->fetchUntranslated( textLabel.str() );
+ const WideChar *marker = wcschr( text.str(), L'&' );
+ if( marker && marker[ 1 ] )
+ {
+ const WideChar letter[ 2 ] = { (WideChar)towupper( marker[ 1 ] ), 0 };
+ label.set( letter );
+ }
+ return label;
+}
+
//-------------------------------------------------------------------------------------------------
void ControlBar::setControlCommand( GameWindow *button, const CommandButton *commandButton )
{
@@ -4521,20 +4705,32 @@ void ControlBar::setControlCommand( GameWindow *button, const CommandButton *com
// The '&' letter buried in each localized button label and the grid keys are two rival input
// schemes for the same buttons: the letter fires on KEY_UP out of HotKeyTranslator, the grid
// keys on KEY_DOWN out of MetaEventTranslator, so leaving both live makes one keystroke do two
- // things. The grid is the scheme, and the letters are not registered at all.
+ // things. Modern is the grid and registers no letters. Legacy is the letters, which is what the
+ // game shipped with, and each button wears its own letter the way a Modern one wears its grid key.
//
- // paint the grid letter in the button's top left corner. Only the real command bar
- // slots get one - the communicator, options and science buttons are not on the grid.
+ const Bool legacyInput = TheGlobalData->isLegacyInput();
+ if( legacyInput && TheHotKeyManager )
+ {
+ AsciiString hotKey = TheHotKeyManager->searchHotKey(
+ TheGameText->fetchUntranslated( commandButton->getTextLabel().str() ) );
+ if( hotKey.isNotEmpty() )
+ TheHotKeyManager->addHotKey( button, hotKey );
+ }
+
+ // paint the key in the button's top left corner. Only the real command bar slots get one -
+ // the communicator, options and science buttons are not on the grid.
for( Int slot = 0; slot < MAX_COMMANDS_PER_SET; slot++ )
{
if( m_commandWindows[ slot ] != button )
continue;
- UnicodeString label = getGridHotKeyLabel( slot );
+ UnicodeString label = legacyInput ? getLabelHotKeyLabel( commandButton->getTextLabel() )
+ : getGridHotKeyLabel( slot );
// structures are reached by a chord: Q or W picks the group (columns 1-4 or 5-7), then
// the key of the cell's own position inside that group - paint both, "QQ", "QZ", "WQ" ...
- if( commandButton->getCommandType() == GUI_COMMAND_DOZER_CONSTRUCT && !label.isEmpty() )
+ // Legacy has no chords, and a structure is its one letter.
+ if( commandButton->getCommandType() == GUI_COMMAND_DOZER_CONSTRUCT && !label.isEmpty() && !legacyInput )
{
Int base = ( slot < CHORD_GROUP_SIZE ) ? 0 : CHORD_GROUP_SIZE;
UnicodeString chord = getGridHotKeyLabel( base == 0 ? CHORD_SLOT_Q : CHORD_SLOT_W );
@@ -4557,7 +4753,8 @@ void ControlBar::setControlCommand( GameWindow *button, const CommandButton *com
//
if( commandButton->getCommandType() == GUI_COMMAND_STOP )
{
- UnicodeString stopKey = getMetaKeyLabel( GameMessage::MSG_META_STOP );
+ UnicodeString stopKey = legacyInput ? getLabelHotKeyLabel( commandButton->getTextLabel() )
+ : getMetaKeyLabel( GameMessage::MSG_META_STOP );
if( stopKey.isEmpty() )
button->winClearStatus( WIN_STATUS_SHORTCUT_BUTTON );
@@ -5196,8 +5393,10 @@ void ControlBar::updatePurchaseScienceHotKeys( void )
{
GameWindow *candidate = purchaseScienceCandidate( column );
+ // Legacy's number keys pick groups, as they did in the game as shipped, so its columns wear no key
UnicodeString label;
- if( m_purchaseScienceColumn < 0 || m_purchaseScienceColumn == column )
+ if( !TheGlobalData->isLegacyInput() &&
+ ( m_purchaseScienceColumn < 0 || m_purchaseScienceColumn == column ) )
label = getMetaKeyLabel( (GameMessage::Type)( GameMessage::MSG_META_SELECT_TEAM1 + column ) );
for( Int depth = 0; depth < PURCHASE_SCIENCE_COLUMN_DEPTH; depth++ )
@@ -6139,7 +6338,8 @@ void ControlBar::drawSpecialPowerShortcutMultiplierText()
else if( i / SPECIAL_POWER_SHORTCUT_COLS == m_specialPowerShortcutRow )
keySlot = i % SPECIAL_POWER_SHORTCUT_COLS;
- if( keySlot >= 0 && keySlot < MAX_SPECIAL_POWER_SHORTCUTS )
+ // the power keys are this fork's; Legacy's powers are clicked, and wear only their ready count
+ if( keySlot >= 0 && keySlot < MAX_SPECIAL_POWER_SHORTCUTS && !TheGlobalData->isLegacyInput() )
text = getMetaKeyLabel( (GameMessage::Type)(GameMessage::MSG_META_SHORTCUT_SLOT01 + keySlot) );
const SpecialPowerTemplate *spTemplate = command->getSpecialPowerTemplate();
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp
index 363ae805c..4936c0c1b 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp
@@ -264,9 +264,10 @@ WindowMsgHandledType LeftHUDInput( GameWindow *window, UnsignedInt msg,
const DrawableList *drawableList = TheInGameUI->getAllSelectedLocalDrawables(); // locally-owned only
// see if the user wants to move the tactical view
- // Left on the radar looks, right on the radar orders - the same division the world
- // has. It used to depend on UseAlternateMouse, which no longer exists.
- if( drawableList->empty() || msg == GWM_LEFT_DOWN )
+ // Left on the radar looks and right orders, the same division the world has. Legacy
+ // divides the world the other way round, and so did the radar in the game as shipped.
+ const UnsignedInt lookButton = TheGlobalData->isLegacyInput() ? GWM_RIGHT_DOWN : GWM_LEFT_DOWN;
+ if( drawableList->empty() || msg == lookButton )
{
TheTacticalView->lookAt( &world );
break;
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 0ce1b84b6..75eb2c8d7 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
@@ -42,6 +42,7 @@
#include "Common/Registry.h"
#include "Common/Version.h"
+#include "GameClient/ControlBar.h"
#include "GameClient/GameClient.h"
#include "GameClient/InGameUI.h"
#include "GameClient/WindowLayout.h"
@@ -2655,6 +2656,11 @@ WindowMsgHandledType OptionsMenuSystem( GameWindow *window, UnsignedInt msg,
{
saveOptions();
+ // the command bar's hot keys belong to the input scheme, so it rebuilds them on its next
+ // update: grid letters for Modern, the labels' own letters for Legacy
+ if( TheControlBar )
+ TheControlBar->markUIDirty();
+
if (pref)
{
pref->write();
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp
index f8b401fa9..e68d1a086 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindow.cpp
@@ -50,6 +50,7 @@
// USER INCLUDES //////////////////////////////////////////////////////////////
#include "Common/AudioEventRTS.h"
#include "Common/Language.h"
+#include "GameClient/ControlBar.h"
#include "GameClient/WindowLayout.h"
#include "GameClient/GameWindow.h"
#include "GameClient/GameWindowManager.h"
@@ -1413,6 +1414,10 @@ GameWindow *GameWindow::winPointInChild( Int x, Int y, Bool ignoreEnableCheck, B
if( x >= origin.x && x <= origin.x + child->m_size.x &&
y >= origin.y && y <= origin.y + child->m_size.y )
{
+ // the command bar's panes are rectangles over plates that are not
+ if( TheControlBar && TheControlBar->letsClickThrough( child, x, y ) )
+ continue;
+
Bool enabled = ignoreEnableCheck || BitTest( child->m_status, WIN_STATUS_ENABLED );
Bool hidden = BitTest( child->m_status, WIN_STATUS_HIDDEN );
if( !hidden )
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp
index d65089268..de5aa27ae 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GameText.cpp
@@ -151,6 +151,7 @@ class GameTextManager : public GameTextInterface
virtual UnicodeString fetch( const Char *label, Bool *exists = NULL ); ///< Returns the associated labeled unicode text
virtual UnicodeString fetch( AsciiString label, Bool *exists = NULL ); ///< Returns the associated labeled unicode text
+ virtual UnicodeString fetchUntranslated( const Char *label );
virtual AsciiStringVec& getStringsWithLabelPrefix(AsciiString label);
virtual void initMapStringFile( const AsciiString& filename );
@@ -158,6 +159,7 @@ class GameTextManager : public GameTextInterface
protected:
Int m_textCount;
+ Int m_untranslatedCount; ///< entries at the front of m_stringInfo that came before the language overlay
Int m_maxLabelLen;
Char m_buffer[MAX_UITEXT_LENGTH];
Char m_buffer2[MAX_UITEXT_LENGTH];
@@ -251,6 +253,7 @@ GameTextInterface* CreateGameTextInterface( void )
GameTextManager::GameTextManager()
: m_textCount(0),
+ m_untranslatedCount(0),
m_maxLabelLen(0),
m_stringInfo(NULL),
m_stringLUT(NULL),
@@ -393,6 +396,7 @@ void GameTextManager::init( void )
// the tail in turn and restore afterwards.
StringInfo *wholeTable = m_stringInfo;
Int filled = mainCount;
+ m_untranslatedCount = mainCount;
for ( Int overlay = 0; overlay < OVERLAY_COUNT; ++overlay )
{
if ( overlayCounts[ overlay ] == 0 )
@@ -403,6 +407,11 @@ void GameTextManager::init( void )
if ( parseStringFile( overlays[ overlay ] ) )
{
filled += overlayCounts[ overlay ];
+ // Patch.str is English; everything from the next overlay on is the translation
+ if ( overlay == 0 )
+ {
+ m_untranslatedCount = filled;
+ }
}
}
m_stringInfo = wholeTable;
@@ -1410,6 +1419,26 @@ UnicodeString GameTextManager::fetch( AsciiString label, Bool *exists )
return fetch(label.str(), exists);
}
+//============================================================================
+// *GameTextManager::fetchUntranslated
+//============================================================================
+
+UnicodeString GameTextManager::fetchUntranslated( const Char *label )
+{
+ // The lookup table keeps only the winning copy of a label, but the table under it keeps every
+ // file's copy in load order, so the last one ahead of the language overlay is the English.
+ // ponytail: a linear scan, fine for the command bar's handful of labels a selection; build a
+ // second lookup table if anything ever asks this every frame.
+ for ( Int i = ( m_stringInfo != NULL ) ? m_untranslatedCount - 1 : -1; i >= 0; --i )
+ {
+ if ( m_stringInfo[i].label.compareNoCase( label ) == 0 )
+ {
+ return m_stringInfo[i].text;
+ }
+ }
+ return fetch( label );
+}
+
//============================================================================
// GameTextManager::getStringsWithLabelPrefix
//============================================================================
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index 3849ebf07..7d562806c 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -3095,6 +3095,14 @@ void InGameUI::updateOrderHints( void )
return;
}
+ // the player turned the lines off in the options; the formation line above is the drag itself and
+ // still draws
+ if( !TheGlobalData->m_showOrderLines )
+ {
+ m_orderHints.clear();
+ return;
+ }
+
// last frame's markers, kept only so this frame's can inherit their age (see addOrderHint)
std::vector<OrderHint> previous;
previous.swap( m_orderHints );
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
index 87106a8e0..13b742213 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
@@ -170,6 +170,10 @@ SignalKind Command_signalKindForMeta( GameMessage::Type meta )
static Bool isFormationDragArmed( void )
{
+ // a Legacy right drag is the camera scroll it always was
+ if( TheGlobalData->isLegacyInput() )
+ return FALSE;
+
return Command_formationDragArmed( TheGlobalData->m_formationDrag,
TheInGameUI->getSelectCount() > 0
&& TheInGameUI->areSelectedObjectsControllable(),
@@ -4111,7 +4115,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
//-----------------------------------------------------------------------------
case GameMessage::MSG_MOUSE_RIGHT_DOUBLE_CLICK:
{
- if( TheGlobalData->m_doubleClickAttackMove )
+ if( TheGlobalData->m_doubleClickAttackMove && !TheGlobalData->isLegacyInput() )
{
// create the message and append arguments for a guard location
GameMessage *newMsg = TheMessageStream->appendMessage( GameMessage::MSG_DO_GUARD_POSITION );
@@ -4136,6 +4140,12 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
//
// The one exception is the attack, attack move or guard key. Those orders are aimed with the
// left button, so a right click while one is armed puts the key down and gives no order.
+ //
+ // A Legacy right button never orders at all: it scrolls and deselects, which LookAtXlat and
+ // SelectionXlat do.
+ if( TheGlobalData->isLegacyInput() )
+ break;
+
if( TheInGameUI->isOrderKeyArmed() )
{
TheInGameUI->clearAttackMoveToMode();
@@ -4193,9 +4203,23 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
//-----------------------------------------------------------------------------
case GameMessage::MSG_MOUSE_LEFT_DOUBLE_CLICK:
{
- // The double-click attack move used to sit here as well, for the classic mouse. There is
- // only one mouse now and its orders are on the right button, so this case does nothing of
- // its own.
+ // Legacy's orders are on the left button, so its double-click guard is here. Modern's is on
+ // the right button, and this case does nothing of its own.
+ if( TheGlobalData->isLegacyInput() && TheGlobalData->m_doubleClickAttackMove )
+ {
+ // create the message and append arguments for a guard location
+ GameMessage *newMsg = TheMessageStream->appendMessage( GameMessage::MSG_DO_GUARD_POSITION );
+ Coord3D pos;
+ TheTacticalView->screenToTerrain( &msg->getArgument( 0 )->pixel, &pos );
+ newMsg->appendLocationArgument(pos);
+ newMsg->appendIntegerArgument(GUARDMODE_NORMAL);
+
+ ThePlayerList->getLocalPlayer()->getAcademyStats()->recordDoubleClickAttackMoveOrderGiven();
+
+ TheInGameUI->triggerDoubleClickAttackMoveGuardHint();
+
+ break;
+ }
//intentional fall through
}
case GameMessage::MSG_MOUSE_LEFT_CLICK:
@@ -4225,9 +4249,10 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
// The left button selects and nothing else. The exceptions are a GUI command that is
// already armed and waiting for a target, and the attack, attack move and guard keys: all of
- // them are aimed with the left button, because the right one cancels them.
+ // them are aimed with the left button, because the right one cancels them. In Legacy the left
+ // button is the order button as well, as it was in the game as shipped.
const Bool isOrderKey = TheInGameUI->isOrderKeyArmed();
- if( !isFiringGUICommand && !isOrderKey )
+ if( !isFiringGUICommand && !isOrderKey && !TheGlobalData->isLegacyInput() )
break;
Bool controllable = TheInGameUI->areSelectedObjectsControllable()
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp
index 7fb6abc72..5c856c095 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp
@@ -139,7 +139,7 @@ LookAtTranslator::~LookAtTranslator()
const ICoord2D* LookAtTranslator::getScrollAnchor(void)
{
- if (m_isScrolling && m_scrollType == SCROLL_MMB)
+ if (m_isScrolling && (m_scrollType == SCROLL_MMB || m_scrollType == SCROLL_RMB))
{
return &m_anchor;
}
@@ -285,13 +285,32 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
}
//-----------------------------------------------------------------------------
- // The right button belongs to the order layer now - a click commands, a drag draws a
- // formation line - so nothing here touches the camera. Both cases stay only to keep the
- // idle timer honest: a player who is right-clicking is not away from the keyboard.
+ // Modern's right button belongs to the order layer - a click commands, a drag draws a
+ // formation line - so here it only keeps the idle timer honest: a player who is
+ // right-clicking is not away from the keyboard. Legacy's right drag scrolls the camera, as
+ // the game shipped.
case GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_DOWN:
+ {
+ m_lastMouseMoveFrame = TheGameLogic->getFrame();
+
+ if (TheGlobalData->isLegacyInput())
+ {
+ m_anchor = msg->getArgument( 0 )->pixel;
+ m_currentPos = msg->getArgument( 0 )->pixel;
+
+ if (!TheInGameUI->isSelecting() && !m_isScrolling)
+ setScrolling(SCROLL_RMB);
+ }
+ break;
+ }
+
+ //-----------------------------------------------------------------------------
case GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_UP:
{
m_lastMouseMoveFrame = TheGameLogic->getFrame();
+
+ if (m_scrollType == SCROLL_RMB)
+ stopScrolling();
break;
}
@@ -309,8 +328,9 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
// the drag turns the camera instead. It used to be the other way round, with a
// MiddleMousePans switch in Options.ini deciding; there is no switch now because the
// right button no longer scrolls anything and the pan has to live somewhere. The
- // click-to-reset below works either way.
- if( !TheKeyboard->isCtrl() )
+ // click-to-reset below works either way. Legacy's middle drag only ever turns the camera,
+ // because its right button is the one that scrolls.
+ if( !TheKeyboard->isCtrl() && !TheGlobalData->isLegacyInput() )
{
m_isRotating = false;
if (!TheInGameUI->isSelecting() && !m_isScrolling)
@@ -403,7 +423,7 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
Real angle = FACTOR * (m_currentPos.x - m_anchor.x);
- if (TheGlobalData->m_snapCameraRotateTo45)
+ if (TheGlobalData->m_snapCameraRotateTo45 && !TheGlobalData->isLegacyInput())
{
// discrete heading: the drag turns an angle we keep to ourselves and the camera
// jumps to the eighth it is nearest, as the mouse crosses each halfway point.
@@ -459,7 +479,8 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
//
// Whole notches only: half a touchpad swipe is not a 45 degree turn.
const Int rotateSteps = (Int)spin;
- if (TheKeyboard->isCtrl() && rotateSteps != 0 && TheInGameUI->rotatePendingPlacement( rotateSteps ))
+ if (!TheGlobalData->isLegacyInput() && TheKeyboard->isCtrl() && rotateSteps != 0 &&
+ TheInGameUI->rotatePendingPlacement( rotateSteps ))
return DESTROY_MESSAGE;
//
@@ -472,7 +493,7 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
// updateZoomToCursor() for as long as that easing lasts, which also keeps it correct
// whatever the pitch and the field of view are.
//
- if (TheGlobalData->m_zoomToCursor && TheInGameUI->getInputEnabled())
+ if (TheGlobalData->m_zoomToCursor && !TheGlobalData->isLegacyInput() && TheInGameUI->getInputEnabled())
{
m_zoomAnchorPixel = msg->getArgument( 0 )->pixel;
m_zoomAnchorWorld.zero();
@@ -523,6 +544,7 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
{
switch (m_scrollType)
{
+ case SCROLL_RMB:
case SCROLL_MMB:
{
// The anchor stays where the button went down and the camera runs away from it,
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp
index 048005376..49d9232e9 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp
@@ -451,7 +451,8 @@ static const char * findGameMessageNameByType(GameMessage::Type type)
//-------------------------------------------------------------------------------------------------
static Bool metaIgnoresShift(const MetaMapRec *map)
{
- return map->m_meta >= GameMessage::MSG_META_COMMAND_SLOT01 &&
+ return !TheGlobalData->isLegacyInput() &&
+ map->m_meta >= GameMessage::MSG_META_COMMAND_SLOT01 &&
map->m_meta <= GameMessage::MSG_META_COMMAND_SLOT14 &&
(map->m_modState & SHIFT) == 0;
}
@@ -500,9 +501,10 @@ GameMessageDisposition MetaEventTranslator::translateGameMessage(const GameMessa
//
// a half-typed structure chord (Q or W pressed on a builder) takes the next plain key:
// the group's own eight cell keys pick a cell, anything else drops the chord and goes
- // on as usual
+ // on as usual. Legacy has no chords: its structures are the letters on their labels.
//
- if( t == GameMessage::MSG_RAW_KEY_DOWN && ( newModState & ( CTRL | ALT ) ) == 0 &&
+ if( !TheGlobalData->isLegacyInput() &&
+ t == GameMessage::MSG_RAW_KEY_DOWN && ( newModState & ( CTRL | ALT ) ) == 0 &&
!( keyState & KEY_STATE_AUTOREPEAT ) &&
TheControlBar && TheControlBar->isChordArmed() &&
!( TheShell && TheShell->isShellActive() ) )
@@ -517,9 +519,10 @@ GameMessageDisposition MetaEventTranslator::translateGameMessage(const GameMessa
//
// Tab / Shift-Tab walks the focus through a multi-selection's units on the control bar.
// Handled here rather than through the MetaMap because CommandMap.ini lives in the
- // shipped game data and has no slot for it.
+ // shipped game data and has no slot for it. The game as it shipped did nothing with Tab.
//
- if( t == GameMessage::MSG_RAW_KEY_DOWN && key == MK_TAB &&
+ if( !TheGlobalData->isLegacyInput() &&
+ t == GameMessage::MSG_RAW_KEY_DOWN && key == MK_TAB &&
( newModState & ( CTRL | ALT ) ) == 0 &&
!( keyState & KEY_STATE_AUTOREPEAT ) &&
TheGameClient->getFrame() >= 1 &&
@@ -537,13 +540,14 @@ GameMessageDisposition MetaEventTranslator::translateGameMessage(const GameMessa
// the key came up while the modifier was still held. Letting go of Ctrl first meant the
// key's own release carried no Ctrl, the record no longer matched, and whatever the DOWN
// had switched on stayed on. Every key remembers the combinations it was pressed with, so
- // a modifier release can finish them off in whatever order the player let go.
+ // a modifier release can finish them off in whatever order the player let go. Legacy keeps
+ // the game's own rule, where the order of letting go mattered.
//
const Bool isModifierKey = ( key == KEY_LCTRL || key == KEY_RCTRL ||
key == KEY_LSHIFT || key == KEY_RSHIFT ||
key == KEY_LALT || key == KEY_RALT );
- if( isModifierKey && ( keyState & KEY_STATE_UP ) )
+ if( isModifierKey && ( keyState & KEY_STATE_UP ) && !TheGlobalData->isLegacyInput() )
{
for( Int keyIndex = 0; keyIndex < NUM_MAPPABLE_KEYS; ++keyIndex )
{
@@ -620,7 +624,10 @@ GameMessageDisposition MetaEventTranslator::translateGameMessage(const GameMessa
disp = DESTROY_MESSAGE;
// every record on this modifier fires, not the first one found: shift is both "add to
// the selection" on the left button and "queue the order" on the right, and the two
- // are separate records that have to come on and go off together
+ // are separate records that have to come on and go off together. Legacy stops at the
+ // first, as the game did.
+ if( TheGlobalData->isLegacyInput() )
+ break;
continue;
}
@@ -810,22 +817,42 @@ GameMessageDisposition MetaEventTranslator::translateGameMessage(const GameMessa
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
-MetaMap::MetaMap() :
- m_metaMaps(NULL)
+MetaMap::MetaMap() :
+ m_parseScheme(INPUT_SCHEME_MODERN)
{
+ for (Int scheme = 0; scheme < INPUT_SCHEME_COUNT; ++scheme)
+ m_metaMaps[scheme] = NULL;
}
//-------------------------------------------------------------------------------------------------
MetaMap::~MetaMap()
{
- while (m_metaMaps)
+ for (Int scheme = 0; scheme < INPUT_SCHEME_COUNT; ++scheme)
{
- MetaMapRec *next = m_metaMaps->m_next;
- m_metaMaps->deleteInstance();
- m_metaMaps = next;
+ while (m_metaMaps[scheme])
+ {
+ MetaMapRec *next = m_metaMaps[scheme]->m_next;
+ m_metaMaps[scheme]->deleteInstance();
+ m_metaMaps[scheme] = next;
+ }
}
}
+//-------------------------------------------------------------------------------------------------
+const MetaMapRec *MetaMap::getFirstMetaMapRec() const
+{
+ return m_metaMaps[ TheGlobalData->isLegacyInput() ? INPUT_SCHEME_LEGACY : INPUT_SCHEME_MODERN ];
+}
+
+//-------------------------------------------------------------------------------------------------
+void MetaMap::loadLegacyBindings( const AsciiString& languageMapFile )
+{
+ m_parseScheme = INPUT_SCHEME_LEGACY;
+ INI ini;
+ ini.load( languageMapFile, INI_LOAD_OVERWRITE, NULL );
+ m_parseScheme = INPUT_SCHEME_MODERN;
+}
+
//-------------------------------------------------------------------------------------------------
GameMessage::Type MetaMap::findGameMessageMetaType(const char* name)
{
@@ -840,7 +867,7 @@ GameMessage::Type MetaMap::findGameMessageMetaType(const char* name)
//-------------------------------------------------------------------------------------------------
MetaMapRec *MetaMap::getMetaMapRec(GameMessage::Type t)
{
- for (MetaMapRec *map = m_metaMaps; map; map = map->m_next)
+ for (MetaMapRec *map = m_metaMaps[m_parseScheme]; map; map = map->m_next)
{
if (map->m_meta == t)
return map;
@@ -856,8 +883,8 @@ MetaMapRec *MetaMap::getMetaMapRec(GameMessage::Type t)
m->m_category = CATEGORY_MISC;
m->m_description.clear();
m->m_displayName.clear();
- m->m_next = m_metaMaps;
- m_metaMaps = m;
+ m->m_next = m_metaMaps[m_parseScheme];
+ m_metaMaps[m_parseScheme] = m;
return m;
}
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp
index 5e5e88742..ab66dcddc 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp
@@ -274,6 +274,10 @@ SelectionTranslator::SelectionTranslator()
m_selectFeedbackAnchor.x = 0;
m_selectFeedbackAnchor.y = 0;
m_displayedMaxWarning = FALSE;
+ m_rightDownPixel.x = 0;
+ m_rightDownPixel.y = 0;
+ m_rightDownTime = 0;
+ m_rightDownCamera.zero();
m_selectCountMap.clear();
TheSelectionTranslator = this;
@@ -463,7 +467,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
// click - the same fallback, in the same order, as the point pick in
// W3DView::iterateDrawablesInRegion
//
- if( underCursor == NULL )
+ if( underCursor == NULL && !TheGlobalData->isLegacyInput() )
underCursor = TheGameClient->pickDrawableByHealthBar( &pixel );
Object *objUnderCursor = underCursor ? underCursor->getObject() : NULL;
@@ -684,8 +688,8 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
was a way to take things back out and a way to leave the base staff behind: Alt keeps
only what can shoot, Ctrl removes the box from the selection instead of replacing it.
Both are drag-only. A point click has to stay exactly what it was - a filter that eats
- single clicks reads as a broken mouse. */
- if (!isPoint)
+ single clicks reads as a broken mouse. Legacy has neither: its Ctrl is force fire. */
+ if (!isPoint && !TheGlobalData->isLegacyInput())
{
if (TheKeyboard->isAlt())
{
@@ -1114,8 +1118,9 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
if( !TheInGameUI->getGUICommand() && !TheInGameUI->isOrderKeyArmed()
&& !TheKeyboard->isShift() && !TheKeyboard->isCtrl() && !TheKeyboard->isAlt() )
{
- //No GUI command mode, so a click on empty ground deselects everyone.
- if( TheInGameUI->getPendingPlaceSourceObjectID() == INVALID_ID )
+ //No GUI command mode, so a click on empty ground deselects everyone. Not in Legacy,
+ //where that click is a move order and the right button is what deselects.
+ if( TheInGameUI->getPendingPlaceSourceObjectID() == INVALID_ID && !TheGlobalData->isLegacyInput() )
{
if( !TheInGameUI->getPreventLeftClickDeselectionInAlternateMouseModeForOneClick() )
{
@@ -1134,9 +1139,39 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
break;
}
+ //-----------------------------------------------------------------------------
+ case GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_DOWN:
+ case GameMessage::MSG_RAW_MOUSE_RIGHT_DOUBLE_CLICK:
+ {
+ m_rightDownPixel = msg->getArgument( 0 )->pixel;
+ m_rightDownTime = (UnsignedInt)msg->getArgument( 2 )->integer;
+ TheTacticalView->getPosition( &m_rightDownCamera );
+ break;
+ }
+
//-----------------------------------------------------------------------------
case GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_UP:
{
+ //
+ // Legacy is the game as shipped: a right drag scrolled the camera and did nothing else, and
+ // a right click cancelled whatever was armed or, with nothing armed, deselected everyone.
+ //
+ if( TheGlobalData->isLegacyInput() )
+ {
+ const ICoord2D lift = msg->getArgument( 0 )->pixel;
+ Coord3D cameraNow;
+ TheTacticalView->getPosition( &cameraNow );
+ if( !TheMouse->isClick( &m_rightDownPixel, &lift, &m_rightDownCamera, &cameraNow,
+ m_rightDownTime, (UnsignedInt)msg->getArgument( 2 )->integer ) )
+ break;
+
+ if( TheInGameUI->getGUICommand() == NULL && TheInGameUI->getPendingPlaceType() == NULL )
+ {
+ deselectAll();
+ break;
+ }
+ }
+
//
// The right button drops whatever is armed, and it does so on a drag as well as on a
// click. A dozer placing a row of structures with shift held is the case that made this
@@ -1219,7 +1254,7 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
// A screen that fills the middle of the display and answers nothing on the keyboard is
// the thing being fixed, so group selection gives way for as long as it is up.
//
- if( TheControlBar && TheControlBar->isPurchaseScienceVisible()
+ if( TheControlBar && TheControlBar->isPurchaseScienceVisible() && !TheGlobalData->isLegacyInput()
&& group >= 1 && group <= PURCHASE_SCIENCE_COLUMNS )
{
TheControlBar->pressPurchaseScienceColumn( group - 1 );
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/SelectionInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/SelectionInfo.cpp
index 0c2393057..72dcab606 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/SelectionInfo.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/SelectionInfo.cpp
@@ -28,6 +28,7 @@
#include "GameLogic/Module/ContainModule.h"
#include "Common/ActionManager.h"
+#include "Common/GlobalData.h"
#include "Common/ThingTemplate.h"
#include "Common/PlayerList.h"
#include "Common/Player.h"
@@ -37,6 +38,7 @@
#include "GameClient/ControlBar.h"
#include "GameClient/GameClient.h"
#include "GameClient/Drawable.h"
+#include "GameClient/InGameUI.h"
#include "GameClient/KeyDefs.h"
#ifdef _INTERNAL
@@ -195,11 +197,60 @@ extern Bool contextCommandForNewSelection(const DrawableList *currentlySelectedD
return FALSE;
}
- // Everything below this line used to work out whether a left click on an enemy, an ally, a
- // garrisonable building or a crate should command instead of select. It cannot any more: the
- // left button selects and the right button orders, so the answer is always no. The counting
- // above is still wanted - the caller reads the counts for the cursor and the selection filters.
- return FALSE;
+ // In Modern the left button selects and the right button orders, so a left click never commands.
+ // The counting above is still wanted - the caller reads the counts for the cursor and the
+ // selection filters.
+ if (!TheGlobalData->isLegacyInput()) {
+ return FALSE;
+ }
+
+ // In Legacy the left button is both, and this is the game's own rule for which one a click on an
+ // enemy, an ally, a garrisonable building or a crate is.
+ if (outSelectionInfo->currentCountMine > 0) {
+ if (outSelectionInfo->newCountEnemies > 0) {
+ if (outSelectionInfo->newCountEnemies == 1 && selectionIsPoint) {
+ return TheGameClient->evaluateContextCommand(newEnemy, newEnemy->getPosition(), CommandTranslator::EVALUATE_ONLY) != GameMessage::MSG_INVALID;
+ }
+
+ return selectionIsPoint;
+ }
+
+ if (outSelectionInfo->newCountMine > 0) {
+ if (outSelectionInfo->newCountMine == 1 && selectionIsPoint && !TheInGameUI->isInPreferSelectionMode()) {
+ return TheGameClient->evaluateContextCommand(newMine, newMine->getPosition(), CommandTranslator::EVALUATE_ONLY) != GameMessage::MSG_INVALID;
+ }
+
+ return FALSE;
+ }
+
+ if (outSelectionInfo->newCountFriends > 0) {
+ if (outSelectionInfo->newCountFriends == 1 && selectionIsPoint) {
+ return TheGameClient->evaluateContextCommand(newFriendly, newFriendly->getPosition(), CommandTranslator::EVALUATE_ONLY) != GameMessage::MSG_INVALID;
+ }
+ return FALSE;
+ }
+
+ if (outSelectionInfo->currentCountMineInfantry > 0 && outSelectionInfo->newCountGarrisonableBuildings == 1) {
+ return TRUE;
+ }
+
+ if (outSelectionInfo->newCountCivilians > 0) {
+ if (outSelectionInfo->newCountCivilians == 1 && selectionIsPoint) {
+ return TheGameClient->evaluateContextCommand(newCivilian, newCivilian->getPosition(), CommandTranslator::EVALUATE_ONLY) != GameMessage::MSG_INVALID;
+ }
+ return FALSE;
+ }
+
+ if (outSelectionInfo->newCountCrates > 0) {
+ return (outSelectionInfo->newCountCrates == 1 && selectionIsPoint);
+ }
+ }
+
+ if (outSelectionInfo->currentCountMine == 0) {
+ return FALSE;
+ }
+
+ return selectionIsPoint;
}
//-------------------------------------------------------------------------------------------------
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
index 70e6afc06..45547d3d4 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
@@ -2434,9 +2434,10 @@ Int W3DView::iterateDrawablesInRegion( IRegion2D *screenRegion,
// hidden behind a building or lost in a crowd - and infantry at full zoom out is a handful of
// pixels of model under a bar that is easier to hit than the man. Fallback order matters: a
// bar hangs in the air above its own unit and so overlaps whatever stands behind it, so it may
- // only answer a click that would otherwise have missed everything.
+ // only answer a click that would otherwise have missed everything. Legacy input is the game
+ // as shipped, where a bar was only ever a picture.
//
- if (onlyDrawableToTest == NULL)
+ if (onlyDrawableToTest == NULL && !TheGlobalData->isLegacyInput())
onlyDrawableToTest = TheGameClient->pickDrawableByHealthBar(&screenRegion->lo);
if (onlyDrawableToTest == NULL) {
diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cpp
index 706278c7b..6ebf34ec4 100644
--- a/GeneralsMD/Code/Tests/test_gameengine.cpp
+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp
@@ -9645,6 +9645,66 @@ TEST(the_options_menu_buttons_all_wear_one_font)
CHECK_EQ( agreed, found );
}
+TEST(a_plates_mask_is_solid_under_its_windows_and_open_where_it_paints_nothing)
+{
+ /* A click on the bar reaches the world where the plate is transparent, and the mask saying where
+ that is comes out of the targa. So every tracked targa has to decode, the windows a player
+ clicks have to stand on solid art, and every plate has to have some open texels - a mask read
+ off the wrong channel or upside down fails one of those three. */
+ struct Seated { Int panel; Int x, y; };
+ static const Seated seated[] =
+ {
+ { ControlBar::CB_PANEL_LEFT, 90, 519 }, // radar
+ { ControlBar::CB_PANEL_CENTER, 413, 541 }, // command grid
+ { ControlBar::CB_PANEL_RIGHT, 690, 537 }, // selection portrait
+ { -1, 0, 0 }
+ };
+ static const char *const sides[] = { "America", "China", "GLA", NULL };
+
+ for( const char *const *s = sides; *s; s++ )
+ for( Int p = 0; p < ControlBar::CB_PANEL_COUNT; p++ )
+ {
+ const ControlBarPlate *plate = ControlBarPlateForSide( AsciiString( *s ), p );
+ CHECK( plate != NULL );
+
+ char path[ _MAX_PATH ];
+ sprintf( path, "%s/%s", PLATE_TEXTURE_DIR, plate->filename );
+ FILE *fp = fopen( path, "rb" );
+ CHECK( fp != NULL );
+ if( fp == NULL )
+ continue;
+ std::vector<UnsignedByte> bytes;
+ UnsignedByte chunk[ 4096 ];
+ for( size_t got; ( got = fread( chunk, 1, sizeof( chunk ), fp ) ) > 0; )
+ bytes.insert( bytes.end(), chunk, chunk + got );
+ fclose( fp );
+
+ std::vector<UnsignedByte> mask;
+ CHECK( ControlBarPlateMaskFromTarga( &bytes[ 0 ], (Int)bytes.size(), plate->artW, plate->artH, mask ) );
+ if( (Int)mask.size() != plate->artW * plate->artH )
+ continue;
+
+ Int open = 0;
+ for( size_t i = 0; i < mask.size(); i++ )
+ open += mask[ i ] ? 0 : 1;
+ CHECK( open > 0 );
+ CHECK( open < (Int)mask.size() );
+
+ for( const Seated *w = seated; w->panel >= 0; w++ )
+ {
+ if( w->panel != p )
+ continue;
+ const Int texelX = ( w->x - plate->design.lo.x ) * plate->artW / plate->design.width();
+ const Int texelY = ( w->y - plate->design.lo.y ) * plate->artH / plate->design.height();
+ CHECK( mask[ texelY * plate->artW + texelX ] != 0 );
+ }
+
+ // and a file cut short is refused rather than read past its end
+ std::vector<UnsignedByte> scratch;
+ CHECK( ControlBarPlateMaskFromTarga( &bytes[ 0 ], (Int)bytes.size() / 2, plate->artW, plate->artH, scratch ) == FALSE );
+ }
+}
+
TEST(every_plate_that_touches_a_design_edge_touches_the_screen_edge)
{
/* The plate rectangles were measured against the paintings, and a painting stops a pixel or two
@@ -9950,6 +10010,60 @@ TEST(gameplay_conveniences_are_forced_on_and_left_the_catalog)
delete scratch;
}
+TEST(the_input_scheme_is_a_live_menu_choice_that_starts_modern)
+{
+ /* Legacy is read on every click and key, so the row has to say APPLY_LIVE - a restart note on a
+ setting that already took would send the player looking for a change that is not coming. A
+ player who never opens the menu keeps the game they already had. */
+ const OptionDef *def = findOptionDef( "InputScheme" );
+ CHECK( def != NULL );
+ if( def == NULL )
+ return;
+ CHECK_EQ( def->kind, OPTION_ENUM );
+ CHECK_EQ( def->apply, APPLY_LIVE );
+ CHECK_EQ( def->lo, 0 );
+ CHECK_EQ( def->hi, (Int)INPUT_SCHEME_COUNT - 1 );
+ CHECK( def->widgetName != NULL && def->widgetName[ 0 ] != '\0' );
+
+ GlobalData *saved = TheWritableGlobalData;
+ GlobalData *scratch = NEW GlobalData;
+ TheWritableGlobalData = scratch;
+
+ CHECK_EQ( scratch->m_inputScheme, (Int)INPUT_SCHEME_MODERN );
+ CHECK( !scratch->isLegacyInput() );
+ def->set( INPUT_SCHEME_LEGACY );
+ CHECK( scratch->isLegacyInput() );
+ CHECK_EQ( def->get(), (Int)INPUT_SCHEME_LEGACY );
+
+ TheWritableGlobalData = saved;
+ delete scratch;
+}
+
+TEST(order_lines_are_a_live_check_box_that_starts_on)
+{
+ /* The lines are rebuilt from the units every frame, so the box takes effect at Accept, and a player
+ who never opens the menu keeps the lines the game has drawn since they were added. */
+ const OptionDef *def = findOptionDef( "OrderLines" );
+ CHECK( def != NULL );
+ if( def == NULL )
+ return;
+ CHECK_EQ( def->kind, OPTION_BOOL );
+ CHECK_EQ( def->apply, APPLY_LIVE );
+ CHECK( def->widgetName != NULL && def->widgetName[ 0 ] != '\0' );
+
+ GlobalData *saved = TheWritableGlobalData;
+ GlobalData *scratch = NEW GlobalData;
+ TheWritableGlobalData = scratch;
+
+ CHECK( scratch->m_showOrderLines );
+ def->set( 0 );
+ CHECK( !scratch->m_showOrderLines );
+ CHECK_EQ( def->get(), 0 );
+
+ TheWritableGlobalData = saved;
+ delete scratch;
+}
+
TEST(option_catalog_round_trips_every_key_through_options_ini)
{
/* Every row has to survive the trip out to Options.ini and back, at both ends of its range.
diff --git a/GeneralsMD/Code/Tools/optionsmenu_layout.py b/GeneralsMD/Code/Tools/optionsmenu_layout.py
index 2242c4a2d..f7c1fcb42 100644
--- a/GeneralsMD/Code/Tools/optionsmenu_layout.py
+++ b/GeneralsMD/Code/Tools/optionsmenu_layout.py
@@ -105,7 +105,8 @@ NAME_THE_UNNAMED = [
]
# Controls that are in the shipped file and are not wanted at all. CheckAlternateMouse chose
-# between the classic mouse and the alternate one; there is one mouse now, so the choice is gone.
+# between the classic mouse and the alternate one; ComboBoxInputScheme is that choice now, and it
+# takes the keyboard along with the mouse.
DELETE = ["CheckAlternateMouse"]
# The templates new controls are cloned from, and whose lettering the moved ones take.
@@ -133,6 +134,9 @@ NEW_CONTROLS = [
(COMBO, "ComboBoxPlayerColors", None),
(LABEL, "LabelLanguage", "GUI:Language"),
(COMBO, "ComboBoxLanguage", None),
+ (CHECK, "CheckOrderLines", "GUI:OrderLines"),
+ (LABEL, "LabelInputScheme", "GUI:InputScheme"),
+ (COMBO, "ComboBoxInputScheme", None),
]
# A slider on its own says nothing about where it stands, so each one has a readout beside it that
@@ -215,10 +219,13 @@ GROUP_LAYOUT = [
("PageControls", 1, "GUI:OptionsGroupOrders", [
("check", "Retaliation"),
("check", "CheckDoubleClickAttackMove")]),
+ ("PageControls", 2, "GUI:OptionsGroupInput", [
+ setting("LabelInputScheme", "ComboBoxInputScheme")]),
("PageGameplay", 0, "GUI:OptionsGroupBattlefield", [
setting("LabelHealthBars", "ComboBoxHealthBars"),
- setting("LabelPlayerColors", "ComboBoxPlayerColors")]),
+ setting("LabelPlayerColors", "ComboBoxPlayerColors"),
+ ("check", "CheckOrderLines")]),
("PageGameplay", 1, "GUI:OptionsGroupLanguage", [
setting("LabelLanguage", "ComboBoxLanguage")]),