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.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
feat(gameclient): Classic trainer in EA's diplomacy frame
Olcay Seyganc4a6a2c3abc3
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 9ae49e54d..2acd5c8cf 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1060,6 +1060,7 @@ A third pass went through the generals' powers, promotions and unit abilities.- It opens in the main menu as well as in a match, and in the Classic interface the same way it does in Reforged. Classic used to keep it shut, which left every setting and cheat behind a key that did nothing for anyone who starts the game without the launcher.- Cheats for campaign and skirmish, listed by `cheats`: `money` and `points` hand over cash and general's points, `rankup` raises the general's rank, `heroic` makes every unit you own heroic and `reveal` lifts the shroud for good. `power`, `nocooldown`, `god`, `instantbuild` and `onehitkill` switch on and off: power that never runs short, general's powers and superweapons always ready, your side taking no damage, anything built or trained in an instant, and every hit you land a kill. `money 50000` takes an amount. They are recorded in the replay like any order. In a LAN or online game, a replay or the main menu the console does not offer them at all.- `trainer` puts every cheat on a steel panel down the left of the screen, the way a trainer would. The on-and-off ones light up green while they are on, cash comes in 1,000, 10,000 and 100,000 at a click, general's points in 1, 5 and 10. A click counts exactly like typing the cheat, replay included. `trainer` again, the X in its corner or Escape puts it away.+- In the Classic interface the trainer comes up in the frame of EA's own Tab screen, in the top left corner where diplomacy opens: the same see-through black with the blue edge, a list with a row for every click and a Close button under it. Click a row to fire it, as often as you like. A switch that is on turns its row green. The console drops down in the same black and blue there.- With `god` on, an EMP no longer blows your helicopters out of the sky and drops the pilot. The helicopter goes dark, sinks to the ground, sits there until the EMP wears off and lifts back up to where it was. A plane that needs a runway flies straight through the blast instead, since it would have nowhere to take off from.- The general's promotion screen moved off that key onto the backslash beside it.- One press is one letter. Holding a key repeats it, and the game timed that wait in frames: a third of a second at the 30 frames a second it was written for, 70 milliseconds on a 144 Hz screen, which is shorter than an ordinary keypress. It waits 0.4 seconds now whatever the frame rate, in the console, the chat box and every text field.diff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.strindex 982923084..9ba1732cb 100644--- a/GeneralsMD/Code/Data/Patch.str+++ b/GeneralsMD/Code/Data/Patch.str@@ -1535,6 +1535,10 @@ GUI:CheatPanelTitle"Cheats"END+GUI:CheatPanelClose+"Close"+END+GUI:CheatMoney"Cash"ENDdiff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.strindex 4b3da0eff..c445baa25 100644--- a/GeneralsMD/Code/Data/Turkish/Generals.str+++ b/GeneralsMD/Code/Data/Turkish/Generals.str@@ -15937,6 +15937,10 @@ GUI:CheatPanelTitle"Hileler"END+GUI:CheatPanelClose+"Kapat"+END+GUI:CheatMoney"Para"ENDdiff --git a/GeneralsMD/Code/Data/Window/Trainer.wnd b/GeneralsMD/Code/Data/Window/Trainer.wndnew file mode 100644index 000000000..51f53b930--- /dev/null+++ b/GeneralsMD/Code/Data/Window/Trainer.wnd@@ -0,0 +1,315 @@+FILE_VERSION = 2;+STARTLAYOUTBLOCK+ LAYOUTINIT = [None];+ LAYOUTUPDATE = [None];+ LAYOUTSHUTDOWN = [None];+ENDLAYOUTBLOCK+WINDOW+ WINDOWTYPE = USER;+ SCREENRECT = UPPERLEFT: 4 4,+ BOTTOMRIGHT: 404 401,+ CREATIONRESOLUTION: 800 600;+ NAME = "Trainer.wnd:Parent";+ STATUS = DRAGABLE+ENABLED;+ STYLE = USER;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Arial", SIZE: 10, BOLD: 0;+ HEADERTEMPLATE = "[NONE]";+ TOOLTIPDELAY = -1;+ TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 255 255 255 255,+ DISABLED: 255 255 255 255, DISABLEDBORDER: 255 255 255 255,+ HILITE: 255 255 255 255, HILITEBORDER: 255 255 255 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 0 0 0 190, BORDERCOLOR: 47 55 168 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;+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 64 64 64 255, BORDERCOLOR: 254 254 254 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: 128 128 255 255, BORDERCOLOR: 254 254 254 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;+ CHILD+ WINDOW+ WINDOWTYPE = STATICTEXT;+ SCREENRECT = UPPERLEFT: 16 10,+ BOTTOMRIGHT: 392 34,+ CREATIONRESOLUTION: 800 600;+ NAME = "Trainer.wnd:StaticTextTitle";+ STATUS = ENABLED;+ STYLE = STATICTEXT;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Arial", SIZE: 12, BOLD: 1;+ HEADERTEMPLATE = "[NONE]";+ TOOLTIPDELAY = -1;+ TEXT = "GUI:CheatPanelTitle";+ TEXTCOLOR = ENABLED: 254 254 254 255, ENABLEDBORDER: 0 0 0 255,+ DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,+ HILITE: 254 254 254 255, HILITEBORDER: 0 0 0 255;+ ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 2 0 0 0, BORDERCOLOR: 2 1 1 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 64 64 64 0, BORDERCOLOR: 192 192 192 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ HILITEDRAWDATA = IMAGE: NoImage, COLOR: 2 0 0 0, BORDERCOLOR: 2 1 1 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,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;+ STATICTEXTDATA = CENTERED: 0;+ END+ CHILD+ WINDOW+ WINDOWTYPE = PUSHBUTTON;+ SCREENRECT = UPPERLEFT: 304 370,+ BOTTOMRIGHT: 396 397,+ CREATIONRESOLUTION: 800 600;+ NAME = "Trainer.wnd:ButtonHide";+ STATUS = ENABLED+IMAGE+NOFOCUS;+ STYLE = PUSHBUTTON+MOUSETRACK;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Generals", SIZE: 15, BOLD: 0;+ HEADERTEMPLATE = "MainButton";+ TOOLTIPDELAY = -1;+ TEXT = "GUI:CheatPanelClose";+ TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,+ DISABLED: 62 64 92 255, DISABLEDBORDER: 31 32 47 255,+ HILITE: 186 255 12 255, HILITEBORDER: 0 2 0 255;+ ENABLEDDRAWDATA = IMAGE: Buttons-Left, 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: Buttons-Middle, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: Buttons-Right, 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: Buttons-Disabled-Left, 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: Buttons-Disabled-Middle, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: Buttons-Disabled-Right, 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: Buttons-HiLite-Left, COLOR: 209 253 4 255, BORDERCOLOR: 59 60 52 255,+ IMAGE: Buttons-Pushed-Left, COLOR: 47 55 168 255, BORDERCOLOR: 254 254 254 255,+ IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: Buttons-Pushed-Middle, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: Buttons-Pushed-Right, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: Buttons-HiLite-Middle, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,+ IMAGE: Buttons-HiLite-Right, 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 = SCROLLLISTBOX;+ SCREENRECT = UPPERLEFT: 16 42,+ BOTTOMRIGHT: 392 362,+ CREATIONRESOLUTION: 800 600;+ NAME = "Trainer.wnd:ListboxCheats";+ STATUS = ENABLED;+ STYLE = SCROLLLISTBOX+MOUSETRACK;+ SYSTEMCALLBACK = "[None]";+ INPUTCALLBACK = "[None]";+ TOOLTIPCALLBACK = "[None]";+ DRAWCALLBACK = "[None]";+ FONT = NAME: "Arial", SIZE: 10, BOLD: 0;+ HEADERTEMPLATE = "LabelRegular";+ 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: BlackSquare, COLOR: 0 0 0 126, 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;+ DISABLEDDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 126, 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;+ HILITEDRAWDATA = IMAGE: BlackSquare, COLOR: 0 0 0 126, 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;+ LISTBOXDATA = LENGTH: 32,+ AUTOSCROLL: 0,+ SCROLLIFATEND: 0,+ AUTOPURGE: 0,+ SCROLLBAR: 1,+ MULTISELECT: 0,+ COLUMNS: 2,+ COLUMNSWIDTH: 62,+ COLUMNSWIDTH: 38,+ FORCESELECT: 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: 255 190 0 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+ENDdiff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/GameConsole.h b/GeneralsMD/Code/GameEngine/Include/GameClient/GameConsole.hindex 37ee89205..c72fbf165 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/GameConsole.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/GameConsole.h@@ -37,6 +37,8 @@class DisplayString;class GameFont;class HtmlOverlay;+class GameWindow;+class WindowLayout;/*** The console's own scrollback, input line and command table. One global, TheGameConsole,@@ -63,11 +65,18 @@ public:/// Draw the panel. Called from the display's 2D overlay pass.void render( void );- /// The cheat panel, Window/Html/Cheats.html, that "trainer" opens: every cheat a click away.+ /// The cheat panel that "trainer" opens: every cheat a click away. Window/Html/Cheats.html in+ /// Reforged; in Classic Window/Trainer.wnd, drawn like EA's diplomacy screen.Bool isCheatPanelOpen( void ) const { return m_cheatPanelOpen; }void closeCheatPanel( void ) { m_cheatPanelOpen = FALSE; }/// TRUE when the pointer is on the panel; with `act`, a click there runs what it was on.Bool handleCheatPanelMouse( const ICoord2D &mouse, Bool act );+ /// What a key or a row of the panel sends: "close", or a cheat and its amount as typed.+ void runCheatPanelAction( const std::string &action );+ /// Row `row` of the Classic panel's list was clicked.+ void runCheatWindowRow( Int row );+ /// Throw the Classic panel's windows away now, where diplomacy's are thrown away.+ void resetCheatWindow( void );private:@@ -75,6 +84,7 @@ private:void runCommand( AsciiString commandLine );void recallHistory( Int direction );void renderCheatPanel( void );+ void updateCheatWindow( void );typedef std::deque<UnicodeString> ScrollbackLines;typedef std::vector<AsciiString> CommandHistory;@@ -94,6 +104,9 @@ private:Bool m_cheatPanelLogged; ///< its keys' places written to the log once for each openingstd::string m_cheatPage; ///< Window/Html/Cheats.html as read, empty until the first openingHtmlOverlay *m_cheatOverlay;+ WindowLayout *m_cheatLayout; ///< the Classic panel while it is up+ GameWindow *m_cheatList; ///< its list, one row for each thing a click does+ Int m_cheatListState; ///< the toggles' bits its rows were last written for, -1 for none};extern GameConsole *TheGameConsole;diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cppindex f703791cf..e96485168 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GameWindowManagerScript.cpp@@ -559,6 +559,7 @@ static Coord2D classicLayoutAnchor( const char *filename ){ "controlbarpopupdescription.wnd", 0.0f, 1.0f },{ "ingamechat.wnd", 0.0f, 1.0f },{ "diplomacy.wnd", 0.0f, 0.0f },+ { "trainer.wnd", 0.0f, 0.0f }, // the console's cheat panel, drawn as diplomacy is{ "replaycontrol.wnd", 0.5f, 1.0f },};Coord2D anchor = { 0.5f, 0.5f };diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GameConsole.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GameConsole.cppindex 65f18801e..81e6c6933 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GameConsole.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GameConsole.cpp@@ -45,6 +45,12 @@#include "GameClient/DisplayString.h"#include "GameClient/DisplayStringManager.h"#include "GameClient/GameFont.h"+#include "GameClient/Gadget.h"+#include "GameClient/GadgetListBox.h"+#include "GameClient/GameWindowManager.h"+#include "GameClient/WindowLayout.h"+#include "Common/GlobalData.h"+#include "Common/NameKeyGenerator.h"#include "GameClient/GameText.h"#include "GameClient/HtmlOverlay.h"#include "GameClient/HtmlTemplate.h"@@ -74,6 +80,8 @@ static const WideChar CONSOLE_FIRST_PRINTABLE_CHAR = u' ';static const Color CONSOLE_PANEL_COLOR = GameMakeColor( 0, 0, 0, 225 );static const Color CONSOLE_EDGE_COLOR = GameMakeColor( 90, 90, 90, 255 );+static const Color CONSOLE_CLASSIC_PANEL_COLOR = GameMakeColor( 0, 0, 0, 190 ); ///< Diplomacy.wnd's parent+static const Color CONSOLE_CLASSIC_EDGE_COLOR = GameMakeColor( 47, 55, 168, 255 );static const Color CONSOLE_INPUT_COLOR = GameMakeColor( 255, 255, 255, 255 );static const Color CONSOLE_TEXT_COLOR = GameMakeColor( 190, 190, 190, 255 );static const Color CONSOLE_SHADOW_COLOR = GameMakeColor( 0, 0, 0, 0 );@@ -311,7 +319,10 @@ GameConsole::GameConsole()m_cheatPanelOpen( FALSE ),m_cheatPanelShown( FALSE ),m_cheatPanelLogged( FALSE ),- m_cheatOverlay( NULL )+ m_cheatOverlay( NULL ),+ m_cheatLayout( NULL ),+ m_cheatList( NULL ),+ m_cheatListState( -1 ){m_font = TheFontLibrary->getFont( AsciiString( CONSOLE_FONT_NAME ),CONSOLE_FONT_POINT_SIZE,@@ -348,6 +359,7 @@ void GameConsole::toggle( void )m_isOpen = !m_isOpen;if( !m_isOpen )m_inputLine.clear();+ DEBUG_LOG(( "Console: %s\n", m_isOpen ? "open" : "shut" ));}//-------------------------------------------------------------------------------------------------@@ -588,9 +600,11 @@ void GameConsole::render( void )const Int panelHeight = REAL_TO_INT( TheDisplay->getHeight() * CONSOLE_HEIGHT_FRACTION );const Int lineHeight = m_font->height + CONSOLE_LINE_GAP;- TheDisplay->drawFillRect( 0, 0, screenWidth, panelHeight, CONSOLE_PANEL_COLOR );+ // Classic wears EA's diplomacy and chat frame: its see-through black over a blue edge+ const Bool classic = TheGlobalData->isClassicUI();+ TheDisplay->drawFillRect( 0, 0, screenWidth, panelHeight, classic ? CONSOLE_CLASSIC_PANEL_COLOR : CONSOLE_PANEL_COLOR );TheDisplay->drawFillRect( 0, panelHeight - CONSOLE_EDGE_THICKNESS,- screenWidth, CONSOLE_EDGE_THICKNESS, CONSOLE_EDGE_COLOR );+ screenWidth, CONSOLE_EDGE_THICKNESS, classic ? CONSOLE_CLASSIC_EDGE_COLOR : CONSOLE_EDGE_COLOR );Int y = panelHeight - CONSOLE_EDGE_THICKNESS - CONSOLE_PADDING - lineHeight;@@ -698,13 +712,15 @@ static void fillCheatPanelCells( std::vector< HtmlValues > &cells, std::vector<void GameConsole::renderCheatPanel( void ){m_cheatPanelShown = FALSE;- if( !m_cheatPanelOpen )- return;- if( !areCheatsAvailable() )- {+ if( m_cheatPanelOpen && !areCheatsAvailable() )m_cheatPanelOpen = FALSE;+ if( TheGlobalData->isClassicUI() )+ {+ updateCheatWindow();return;}+ if( !m_cheatPanelOpen )+ return;if( m_cheatPage.empty() ){@@ -757,11 +773,17 @@ Bool GameConsole::handleCheatPanelMouse( const ICoord2D &mouse, Bool act )if( !act )return TRUE;- const std::string action = m_cheatOverlay->click( mouse );+ runCheatPanelAction( m_cheatOverlay->click( mouse ) );+ return TRUE;+}++//-------------------------------------------------------------------------------------------------+void GameConsole::runCheatPanelAction( const std::string &action )+{if( action == CHEAT_PANEL_CLOSE ){closeCheatPanel();- return TRUE;+ return;}AsciiString arguments( action.c_str() );@@ -777,7 +799,164 @@ Bool GameConsole::handleCheatPanelMouse( const ICoord2D &mouse, Bool act )DEBUG_LOG(( "Cheat panel: %s\n", result.str() ));}}- return TRUE;+}++//-------------------------------------------------------------------------------------------------+/** The Classic panel's rows: a toggle is one row, an amount cheat one row for each ready amount. */+//-------------------------------------------------------------------------------------------------+struct CheatWindowRow+{+ Int cheat;+ Int amount; ///< zero for a toggle+};++static const Int CHEAT_WINDOW_MAX_ROWS = CONSOLE_CHEAT_COUNT * CHEAT_PANEL_AMOUNTS;++static Int cheatWindowRows( CheatWindowRow *rows )+{+ Int count = 0;+ for( Int i = 0; i < CONSOLE_CHEAT_COUNT; ++i )+ {+ const ConsoleCheat &cheat = CONSOLE_CHEATS[ i ];+ for( Int each = 0; each < CHEAT_PANEL_AMOUNTS && ( each == 0 || cheat.amounts[ each ] != 0 ); ++each )+ {+ rows[ count ].cheat = i;+ rows[ count ].amount = cheat.amounts[ each ];+ ++count;+ if( cheat.defaultAmount == 0 )+ break;+ }+ }+ return count;+}++static std::string cheatWindowAction( const CheatWindowRow &row )+{+ const ConsoleCheat &cheat = CONSOLE_CHEATS[ row.cheat ];+ if( row.amount == 0 )+ return cheat.name;+ char text[ 64 ];+ sprintf( text, "%s %d", cheat.name, row.amount );+ return text;+}++/// EA's diplomacy text colours: white, and the green its rows light in+static const Color CHEAT_WINDOW_TEXT_COLOR = GameMakeColor( 254, 254, 254, 255 );+static const Color CHEAT_WINDOW_ON_COLOR = GameMakeColor( 3, 196, 0, 255 );++static WindowMsgHandledType cheatWindowSystem( GameWindow *window, UnsignedInt msg, WindowMsgData mData1, WindowMsgData mData2 )+{+ static const NameKeyType buttonHideID = NAMEKEY( "Trainer.wnd:ButtonHide" );+ switch( msg )+ {+ case GBM_SELECTED:+ if( ((GameWindow *)mData1)->winGetWindowId() == buttonHideID )+ TheGameConsole->closeCheatPanel();+ return MSG_HANDLED;+ case GLM_SELECTED:+ TheGameConsole->runCheatWindowRow( (Int)mData2 );+ return MSG_HANDLED;+ }+ return MSG_IGNORED;+}++//-------------------------------------------------------------------------------------------------+void GameConsole::runCheatWindowRow( Int row )+{+ CheatWindowRow rows[ CHEAT_WINDOW_MAX_ROWS ];+ if( row < 0 || row >= cheatWindowRows( rows ) )+ return;+ runCheatPanelAction( cheatWindowAction( rows[ row ] ) );+ GadgetListBoxSetSelected( m_cheatList, -1 ); // so a second click on the same row runs it again+}++//-------------------------------------------------------------------------------------------------+void GameConsole::resetCheatWindow( void )+{+ if( m_cheatLayout )+ {+ m_cheatLayout->destroyWindows();+ m_cheatLayout->deleteInstance();+ }+ m_cheatLayout = NULL;+ m_cheatList = NULL;+ m_cheatListState = -1;+}++//-------------------------------------------------------------------------------------------------+/** The Classic interface's panel: Window/Trainer.wnd, EA's diplomacy frame with one list row for+ * each click, and a toggle's row green while it is on. The windows are thrown away when it+ * shuts, never from inside their own callback. */+//-------------------------------------------------------------------------------------------------+void GameConsole::updateCheatWindow( void )+{+ if( !m_cheatPanelOpen )+ {+ resetCheatWindow();+ return;+ }++ CheatWindowRow rows[ CHEAT_WINDOW_MAX_ROWS ];+ const Int rowCount = cheatWindowRows( rows );+ if( m_cheatLayout == NULL )+ {+ m_cheatLayout = TheWindowManager->winCreateLayout( AsciiString( "Trainer.wnd" ) );+ GameWindow *parent = m_cheatLayout ? m_cheatLayout->getFirstWindow() : NULL;+ m_cheatList = parent ? TheWindowManager->winGetWindowFromId( parent, NAMEKEY( "Trainer.wnd:ListboxCheats" ) ) : NULL;+ if( m_cheatList == NULL )+ {+ printLine( AsciiString( "trainer: Window/Trainer.wnd is missing" ) );+ resetCheatWindow();+ m_cheatPanelOpen = FALSE;+ return;+ }+ parent->winSetSystemFunc( cheatWindowSystem );+ for( Int row = 0; row < rowCount; ++row )+ GadgetListBoxAddEntryText( m_cheatList, TheGameText->fetch( CONSOLE_CHEATS[ rows[ row ].cheat ].label ),+ CHEAT_WINDOW_TEXT_COLOR, -1, 0 );+ m_cheatLayout->hide( FALSE );+ }++ const Player *local = ThePlayerList->getLocalPlayer();+ Int state = 0;+ for( Int i = 0; i < CONSOLE_CHEAT_COUNT; ++i )+ if( CONSOLE_CHEATS[ i ].defaultAmount == 0 && local->hasCheat( CONSOLE_CHEATS[ i ].kind ) )+ state |= 1 << i;+ if( state == m_cheatListState )+ return;+ const Bool firstFill = m_cheatListState < 0;+ m_cheatListState = state;++ for( Int row = 0; row < rowCount; ++row )+ {+ const ConsoleCheat &cheat = CONSOLE_CHEATS[ rows[ row ].cheat ];+ const Bool on = rows[ row ].amount == 0 && ( state & ( 1 << rows[ row ].cheat ) ) != 0;+ UnicodeString text;+ if( rows[ row ].amount == 0 )+ text = TheGameText->fetch( on ? "GUI:CheatOn" : "GUI:CheatOff" );+ else if( cheat.amounts[ 1 ] == 0 )+ text = TheGameText->fetch( "GUI:CheatApply" );+ else+ text.format( u"+%d", rows[ row ].amount );+ const Color color = on ? CHEAT_WINDOW_ON_COLOR : CHEAT_WINDOW_TEXT_COLOR;+ GadgetListBoxAddEntryText( m_cheatList, TheGameText->fetch( cheat.label ), color, row, 0 );+ GadgetListBoxAddEntryText( m_cheatList, text, color, row, 1 );+ }++ // where each row landed, so a script driving the game over -control knows where to click+ if( firstFill )+ {+ const ListboxData *list = (const ListboxData *)m_cheatList->winGetUserData();+ Int x, y, width, height;+ m_cheatList->winGetScreenPosition( &x, &y );+ m_cheatList->winGetSize( &width, &height );+ for( Int row = 0; list && row < rowCount && row < list->endPos; ++row )+ {+ const Int top = row > 0 ? list->listData[ row - 1 ].listHeight : 0;+ DEBUG_LOG(( "Cheat window: \"%s\" at %d %d\n", cheatWindowAction( rows[ row ] ).c_str(),+ x + width / 2, y + ( top + list->listData[ row ].listHeight ) / 2 ));+ }+ }}//-------------------------------------------------------------------------------------------------diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex 0c7987086..1e3e71caa 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -81,6 +81,7 @@#include "GameClient/Drawable.h"#include "GameClient/GadgetPushButton.h"#include "GameClient/GameClient.h"+#include "GameClient/GameConsole.h"#include "GameClient/GameWindowGlobal.h"#include "GameClient/GameWindowID.h"#include "GameClient/GUICallbacks.h"@@ -15495,6 +15496,8 @@ void InGameUI::notifyResolutionChange( void )ResetDiplomacy();ResetInGameChat();+ if( TheGameConsole )+ TheGameConsole->resetCheatWindow();if( m_replayWindow ){diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cppindex 756bc1bfa..d3e22c40b 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp@@ -136,6 +136,7 @@ static void considerBuilderProc( Object *obj, void *userData )#include "GameClient/ControlBar.h"#include "GameClient/Drawable.h"#include "GameClient/Eva.h"+#include "GameClient/GameConsole.h"#include "GameClient/GameText.h"#include "GameClient/GameWindowTransitions.h"#include "GameClient/GameWindowManager.h"@@ -342,6 +343,8 @@ void GameLogic::closeWindows( void ){HideDiplomacy();ResetDiplomacy();+ if( TheGameConsole )+ TheGameConsole->resetCheatWindow();HideInGameChat();ResetInGameChat();TheControlBar->hidePurchaseScience();