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(gameengine): take the beacon button off the command bar
Olcay Seygane13cba30f517
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 4db4b67c2..04f450c9f 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -506,7 +506,7 @@ found and fixed — EA's own, not port damage.**- A minimised command bar stays minimised. Changing seats, or clicking another player's unit while watching, put the whole bar back up over the battlefield you had just cleared. A new match still opens with the bar up.- The command bar's frame is drawn new, in the same steel as the boards. Each panel holds one thing and is exactly its size, the radar, the command grid, the portrait with the experience bar, and wears a steel border outside it. Grey for America, red for China, sand for GLA. It slides and minimises with the bar, and like the boards it is a page in the Window folder; take the page away and the old painted bar comes back.- Every panel of the bar is only as big as what it holds now, and stands on the bottom of the screen. The radar's border runs out to the screen's left edge, the portrait's to the right edge, and the middle is built up like bricks laid flush: the command grid's panel at the bottom, the power bar standing on its border in a steel frame of its own, a row of forty cells that light up from the left with your production and fill the frame from edge to edge when full, the consumption marked by a white needle, and on top of that a narrower block no taller than the money written on it. Everything the old painting filled round them is battlefield again, and a click there lands on the battlefield.-- The bar's own buttons are drawn to match, steel caps lit gold under the pointer and pressed in when pushed. The menu is a small square with three bars in the screen's top left corner. The idle worker button is a key like the smoke signals', a hard hat on it, in a steel step against the middle panel's bottom left corner, where it no longer hides the end of the power bar, and the build buttons sit down level with it, a few pixels over the bottom of the screen. Each of the fourteen build places is its own dark cell with steel running between them, so an empty place reads as a slot waiting for a button, and the steel is laid over the edge of every picture the way a frame holds a card, the whole picture showing inside it. The production queue and the general's powers are framed the same way. The power bar is sunk into the same steel plate as the build grid, the plate carried on upward as wide as it, and the money's block sits on top of that plate with no seam between them: the build grid, the power and the money read as one piece. The power bar is as long as the build grid on every side, where it used to change length from one faction to the next, and the money sits over the grid's middle. The build grid's panel no longer carries an empty strip down its left side. There is no chat button any more: Enter opens the chat as it always did. The portrait sits in the radar's lit steel too. The experience bar beside it is ten gold rungs in a sunk groove, climbing from the bottom as you earn your way to the next rank, and your rank stands in a steel tab on the portrait's top right corner, a key sunk in it like the idle worker's with one star for every rank there is, gold up to the one you hold. The portrait's grid is steel between dark cells on every side, where America's was drawn in blue lines that matched nothing else on the bar. That key is the promotions button: point at it and it comes up with a gold rim, it blinks bright in your side's own steel while you have a promotion to spend, and a click opens the promotion screen. That screen is rebuilt in the same steel and half its old size: each rank's promotions stand in a grid of build-button cells five wide, like the command grid, an empty place a dark hole, each rank in a steel well of its own with its heading, the wells a plate's thickness apart, the grid's steel laid over the edge of every picture so the picture sits in its cell like a card in a frame, your rank and the points to spend on one line over the experience bar, and Done in the last row's spare place. A gold rim marks what you have bought and a light one what you can buy now. The bar has no minimise arrow any more: it is only as big as what it holds. The radar sits sunk in a bezel of lit steel, bright along the top and shadowed down the right, and the build grid and the money wear the same steel, the figure in a dark window of its own, and the under-attack light is a long red lamp set in a steel tab on its top left corner, dark until you are hit and then blinking. No words on it, so it reads the same in any language.+- The bar's own buttons are drawn to match, steel caps lit gold under the pointer and pressed in when pushed. The menu is a small square with three bars in the screen's top left corner. The idle worker button is a key like the smoke signals', a hard hat on it, in a steel step against the middle panel's bottom left corner, where it no longer hides the end of the power bar, and the build buttons sit down level with it, a few pixels over the bottom of the screen. Each of the fourteen build places is its own dark cell with steel running between them, so an empty place reads as a slot waiting for a button, and the steel is laid over the edge of every picture the way a frame holds a card, the whole picture showing inside it. The production queue and the general's powers are framed the same way. The power bar is sunk into the same steel plate as the build grid, the plate carried on upward as wide as it, and the money's block sits on top of that plate with no seam between them: the build grid, the power and the money read as one piece. The power bar is as long as the build grid on every side, where it used to change length from one faction to the next, and the money sits over the grid's middle. The build grid's panel no longer carries an empty strip down its left side. There is no chat button any more: Enter opens the chat as it always did. The beacon button is gone from the bar too; the smoke signals over the radar are how you point your team at a spot. The portrait sits in the radar's lit steel too. The experience bar beside it is ten gold rungs in a sunk groove, climbing from the bottom as you earn your way to the next rank, and your rank stands in a steel tab on the portrait's top right corner, a key sunk in it like the idle worker's with one star for every rank there is, gold up to the one you hold. The portrait's grid is steel between dark cells on every side, where America's was drawn in blue lines that matched nothing else on the bar. That key is the promotions button: point at it and it comes up with a gold rim, it blinks bright in your side's own steel while you have a promotion to spend, and a click opens the promotion screen. That screen is rebuilt in the same steel and half its old size: each rank's promotions stand in a grid of build-button cells five wide, like the command grid, an empty place a dark hole, each rank in a steel well of its own with its heading, the wells a plate's thickness apart, the grid's steel laid over the edge of every picture so the picture sits in its cell like a card in a frame, your rank and the points to spend on one line over the experience bar, and Done in the last row's spare place. A gold rim marks what you have bought and a light one what you can buy now. The bar has no minimise arrow any more: it is only as big as what it holds. The radar sits sunk in a bezel of lit steel, bright along the top and shadowed down the right, and the build grid and the money wear the same steel, the figure in a dark window of its own, and the under-attack light is a long red lamp set in a steel tab on its top left corner, dark until you are hit and then blinking. No words on it, so it reads the same in any language.- The general's powers you have bought and can fire, the column that climbed the right edge of the screen, stand over the portrait now in a tray of the bar's own steel. The first sits in the corner against the right edge of the screen, and each one you gain takes the place to the left of the last, three to a row before a new row starts above, so the tray is only ever as big as what you hold and an empty one takes no room at all. Each power sits on a dark cell three quarters the size of a build button, where the side's old tray art used to frame it. It is always out; there is no button to fold it away.- Three buttons sit in a step of the radar's own steel, on its right: the smoke signals Alt+Z, X and C send, placed in the middle of your view for your allies to see. Each is a key sunk into the steel with a sharp white picture on it instead of a word: a crosshair to attack, a shield to defend, an eye to look. Point at one and it comes up out of its well as lit steel with a gold rim, and it sinks in darker while you hold the button down. They rise into place one after another from the bottom of the screen when the match starts. A game with nobody on your side to see the smoke, a skirmish against the computer or a replay, has no signal buttons at all.- Tooltips wear the bar's steel. Point at a build button and a card opens right above it rather than in a fixed box at the side: the name on a steel header in your side's colour with the price in gold at its end, every "Power Supplied: 5" or "Strong: infantry" line of the description laid out as a label and a bold figure, then the unit's health, damage, attacks a second, damage a second, range and build time in gold, counted with the upgrades you own. Under them every upgrade that touches the unit and what it does to it: a Gattling Tank's card says Chain Guns takes its damage from 15 to 18 and its damage a second from 37 to 46, a Humvee's that TOW adds a 50 damage missile with a range of 317, and an upgrade you already bought turns gold. Point at the upgrade itself and the card lists the units it changes, Composite Armor putting a Crusader from 480 health to 680. At the bottom, "not enough money" or what you still need in a sunk red note at the bottom. Point at something on the battlefield and a small dark box beside the pointer names it, its owner's colour in a stripe down the left edge.diff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.strindex ccf444eec..0659eca0a 100644--- a/GeneralsMD/Code/Data/Patch.str+++ b/GeneralsMD/Code/Data/Patch.str@@ -1246,10 +1246,6 @@ GUI:BarIdleWorker"Worker"END-GUI:BarBeacon-"Beacon"-END-// the network box in the top right corner: frames ready out of the input delay, the room's frame// rate, and the traffic in and out in kilobytes a secondGUI:BarNetReadydiff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.strindex 42f849abb..425928b83 100644--- a/GeneralsMD/Code/Data/Turkish/Generals.str+++ b/GeneralsMD/Code/Data/Turkish/Generals.str@@ -15757,10 +15757,6 @@ GUI:BarIdleWorker"İşçi"END-GUI:BarBeacon-"İşaret"-END-GUI:BarNetReady"hazır"ENDdiff --git a/GeneralsMD/Code/Data/Window/Html/ControlBar.html b/GeneralsMD/Code/Data/Window/Html/ControlBar.htmlindex 46dfd117a..2757708dd 100644--- a/GeneralsMD/Code/Data/Window/Html/ControlBar.html+++ b/GeneralsMD/Code/Data/Window/Html/ControlBar.html@@ -2,7 +2,7 @@<!--The command bar's frame, drawn where its three plates used to be, and the bar's own buttons. Thecommand buttons, the radar, the money and the portrait are still the bar's windows and paint over- this page. The promotion and beacon buttons, the under-attack light, the power bar and the+ this page. The promotion button, the under-attack light, the power bar and theexperience bar are the page's to draw: their windows take the clicks and draw nothing. The menu and idle workerbuttons are the page's altogether, pressed through data-click="press:Name"; the chat button isgone and Enter still opens the chat. Same materials as Window/Html/Spectator.html, whose header@@ -71,7 +71,7 @@and {{Name.state}} any of "disabled", "hilite", "pushed", for LeftHUD (theradar), RightHUD (the portrait's box), CameoWindow (the portrait),CommandWindow, MoneyDisplay, PowerWindow, GeneralsExp, ButtonGeneral,- ButtonLarge (the minimise button, stood down), ButtonOptions, ButtonIdleWorker, ButtonPlaceBeacon,+ ButtonLarge (the minimise button, stood down), ButtonOptions, ButtonIdleWorker,PopupCommunicator and WinUAttack (the under-attack light: "disabled" whileit is lit, which is how the bar blinks it)All in the page's pixels, a pixel of an 800x600 screen. Without this page the plates draw.@@ -396,8 +396,6 @@<div class="key"><div class="star {{lit}}" data-each="rankstars" style="left: {{x}}px"></div><div class="veil"></div></div></div>- <div class="piece button {{ButtonPlaceBeacon.shown}} {{ButtonPlaceBeacon.state}}" style="left: {{ButtonPlaceBeacon.x}}px; top: {{ButtonPlaceBeacon.y}}px; width: {{ButtonPlaceBeacon.w}}px; height: {{ButtonPlaceBeacon.h}}px"><div class="cap">{{text:GUI:BarBeacon}}</div></div>-<div class="piece step signals solid {{signals.shown}}" style="left: {{signals.x}}px; top: {{signals.y}}px; width: {{signals.w}}px; height: {{signals.h}}px"><div class="joint"></div><div class="key signal attack" data-click="signal:attack" style="top: 2px; margin-top: {{signal0.drop}}px"><div class="icon"></div></div>diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cppindex aee0611c6..f206525d1 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp@@ -2871,12 +2871,9 @@ void ControlBar::initWindows( void )setControlCommand(win, findCommandButton("NonCommand_IdleWorker") );win->winSetTooltipFunc(commandButtonTooltip);}+ // the bar carries no beacon button; nothing below shows it againwin = TheWindowManager->winGetWindowFromId(NULL,TheNameKeyGenerator->nameToKey("ControlBar.wnd:ButtonPlaceBeacon"));- if(win)- {- setControlCommand(win, findCommandButton("NonCommand_Beacon") );- win->winSetTooltipFunc(commandButtonTooltip);- }+ win->winHide(TRUE);win = TheWindowManager->winGetWindowFromId(NULL,TheNameKeyGenerator->nameToKey("ControlBar.wnd:ButtonGeneral"));if(win){@@ -5340,10 +5337,8 @@ void ControlBar::setControlBarSchemeByPlayer(Player *p)if(m_controlBarSchemeManager)m_controlBarSchemeManager->setControlBarSchemeByPlayer(p);- static NameKeyType buttonPlaceBeaconID = NAMEKEY( "ControlBar.wnd:ButtonPlaceBeacon" );static NameKeyType buttonIdleWorkerID = NAMEKEY("ControlBar.wnd:ButtonIdleWorker");static NameKeyType buttonGeneralID = NAMEKEY("ControlBar.wnd:ButtonGeneral");- GameWindow *buttonPlaceBeacon = TheWindowManager->winGetWindowFromId( NULL, buttonPlaceBeaconID );GameWindow *buttonIdleWorker = TheWindowManager->winGetWindowFromId( NULL, buttonIdleWorkerID );GameWindow *buttonGeneral = TheWindowManager->winGetWindowFromId( NULL, buttonGeneralID );@@ -5353,8 +5348,6 @@ void ControlBar::setControlBarSchemeByPlayer(Player *p)switchToContext( CB_CONTEXT_OBSERVER_LIST, NULL );DEBUG_LOG(("We're loading the Observer Command Bar\n"));- if (buttonPlaceBeacon)- buttonPlaceBeacon->winHide(TRUE);if (buttonIdleWorker)buttonIdleWorker->winHide(TRUE);if (buttonGeneral)@@ -5365,10 +5358,6 @@ void ControlBar::setControlBarSchemeByPlayer(Player *p)switchToContext( CB_CONTEXT_NONE, NULL );m_isObserverCommandBar = FALSE;- if (buttonPlaceBeacon)- buttonPlaceBeacon->winHide(- (TheGameLogic->getGameMode() != GAME_LAN && TheGameLogic->getGameMode() != GAME_INTERNET) ||- !TheGameInfo->isMultiPlayer());if (buttonIdleWorker)buttonIdleWorker->winHide(FALSE);if (buttonGeneral)@@ -5397,10 +5386,8 @@ void ControlBar::setControlBarSchemeByPlayerTemplate( const PlayerTemplate *pt)if(m_controlBarSchemeManager)m_controlBarSchemeManager->setControlBarSchemeByPlayerTemplate(pt);- static NameKeyType buttonPlaceBeaconID = NAMEKEY( "ControlBar.wnd:ButtonPlaceBeacon" );static NameKeyType buttonIdleWorkerID = NAMEKEY("ControlBar.wnd:ButtonIdleWorker");static NameKeyType buttonGeneralID = NAMEKEY("ControlBar.wnd:ButtonGeneral");- GameWindow *buttonPlaceBeacon = TheWindowManager->winGetWindowFromId( NULL, buttonPlaceBeaconID );GameWindow *buttonIdleWorker = TheWindowManager->winGetWindowFromId( NULL, buttonIdleWorkerID );GameWindow *buttonGeneral = TheWindowManager->winGetWindowFromId( NULL, buttonGeneralID );@@ -5410,8 +5397,6 @@ void ControlBar::setControlBarSchemeByPlayerTemplate( const PlayerTemplate *pt)switchToContext( CB_CONTEXT_OBSERVER_LIST, NULL );DEBUG_LOG(("We're loading the Observer Command Bar\n"));- if (buttonPlaceBeacon)- buttonPlaceBeacon->winHide(TRUE);if (buttonIdleWorker)buttonIdleWorker->winHide(TRUE);if (buttonGeneral)@@ -5422,10 +5407,6 @@ void ControlBar::setControlBarSchemeByPlayerTemplate( const PlayerTemplate *pt)switchToContext( CB_CONTEXT_NONE, NULL );m_isObserverCommandBar = FALSE;- if (buttonPlaceBeacon)- buttonPlaceBeacon->winHide(- (TheGameLogic->getGameMode() != GAME_LAN && TheGameLogic->getGameMode() != GAME_INTERNET) ||- !TheGameInfo->isMultiPlayer());if (buttonIdleWorker)buttonIdleWorker->winHide(FALSE);if (buttonGeneral)diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex 660d7a2e2..6d9b23965 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -10404,16 +10404,16 @@ static void standDownPromotionScreen( void );static const char *const CONTROL_BAR_WINDOWS[] ={"LeftHUD", "RightHUD", "CameoWindow", "CommandWindow", "MoneyDisplay", "PowerWindow", "GeneralsExp",- "ButtonGeneral", "ButtonLarge", "ButtonOptions", "ButtonIdleWorker", "ButtonPlaceBeacon", "PopupCommunicator",+ "ButtonGeneral", "ButtonLarge", "ButtonOptions", "ButtonIdleWorker", "PopupCommunicator","WinUAttack"};/** The bar's windows the page draws instead of letting them paint themselves: the promotion and- * minimise buttons, the beacon button and the radar's under-attack light. They still take their- * clicks; only their pictures are the page's. */+ * minimise buttons and the radar's under-attack light. They still take their clicks; only their+ * pictures are the page's. */static const char *const CONTROL_BAR_CUSTOM[] ={- "ButtonGeneral", "ButtonLarge", "ButtonPlaceBeacon", "WinUAttack", "PowerWindow", "GeneralsExp", "ExpBarForeground", "RightHUD",+ "ButtonGeneral", "ButtonLarge", "WinUAttack", "PowerWindow", "GeneralsExp", "ExpBarForeground", "RightHUD","WinUnitSelected"};@@ -10596,7 +10596,7 @@ static void placeSignalAtView( const std::string &kind )* each list. */static const char *const CONTROL_BAR_LEFT[] = { "LeftHUD", NULL };static const char *const CONTROL_BAR_RIGHT[] = { "RightHUD", "GeneralsExp", "ExpBarForeground", NULL };-static const char *const CONTROL_BAR_CENTRE[] = { "ObserverPlayerListWindow", "ButtonPlaceBeacon", NULL };+static const char *const CONTROL_BAR_CENTRE[] = { "ObserverPlayerListWindow", NULL };static const char *const CONTROL_BAR_EXPERIENCE[] = { "GeneralsExp", "ExpBarForeground", NULL };static const Int COMMAND_BUTTONS = 14; ///< ButtonCommand01 to 14, the grid a player seesstatic const Int QUEUE_BUTTONS = 9; ///< ButtonQueue01 to 09, the production queue's three by three over the portrait's place@@ -10905,14 +10905,11 @@ static void lowerControlBarWindow( const char *name, Int shift )static void stackCentre( HtmlValues &values, Bool shown, const ICoord2D &grow, IRegion2D ¢re ){// the command buttons stand as low as the idle worker's key beside them, GRID_BOTTOM_GAP over the- // screen's bottom edge, wherever the side's layout put them; the beacon button goes down with them+ // screen's bottom edge, wherever the side's layout put themconst Real scale = ControlBarUniformScale();const Int shift = barBottom() - REAL_TO_INT( GRID_BOTTOM_GAP * scale ) - commandButtonsBox().hi.y - grow.y;if( shift != 0 )- {lowerControlBarWindow( "CommandWindow", shift );- lowerControlBarWindow( "ButtonPlaceBeacon", shift );- }IRegion2D grid, power, money;const Bool othersFound = controlBarUnion( CONTROL_BAR_CENTRE, grid );@@ -10920,7 +10917,7 @@ static void stackCentre( HtmlValues &values, Bool shown, const ICoord2D &grow, I// with nothing selected the bar hides the command grid, and the panel must not go with it: the// money and the power bar stood over bare battlefield. The grid's place holds whether it is up,// and it is the fourteen buttons' place rather than CommandWindow's: the window reaches 34 pixels- // further left, over where the beacon button stands, and left an empty strip in the panel+ // further left, over where retail's beacon button stood, and left an empty strip in the panel// It is the cells', which reach `grow` past the buttons' placesIRegion2D buttons = reachedBy( commandButtonsBox(), grow.x, grow.y );if( othersFound )