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): say what each figure on the build card means
Olcay Seygan14dd2bd67c47
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex dbd5ce905..86f0147ab 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1158,6 +1158,7 @@ A third pass went through the generals' powers, promotions and unit abilities.- The command bar slides up from the bottom of the screen again when a match starts. The new steel frame had been drawn at its final place from the first frame, so the buttons rose into a frame that was already standing.- A building that is still going up shows Cancel on S, and the seconds it has left across the top of the grid. A map building that hands out units shows that countdown there too, with the bar under it. Sell stands on N. One that sets a rally point puts that on B instead. Both used to stay where the old command panel had drawn them, off the new grid.- The Escape menu is Zero Hour's own again, the window, the logo, the buttons and the way it opens, along with the box that asks whether you really want to leave. The steel plate that replaced it for a while, and ControlBar Pro's version after that, are gone. Options on it opens the whole options screen. The promotion screen opens across the middle of the screen.+- Every figure on a build card says in brackets what it counts. Damage is one shot of the main weapon before the target's armour, attack speed has the reload counted in, damage a second is the two multiplied, a range of 10 is one square of the placement grid, and the build time is what your power and factories give you right now. The upgrade list says which side of the arrow is without the upgrade and which is with it, and an armour upgrade such as Composite Armor says that less of each hit gets through instead of a bare "stronger". English and Turkish.- Watching, click a player's button on the observer bar and you see through his eyes: his fog and his camera. The same button again, the cancel button or Esc gives you the whole map and the camera you had before.## Placing buildingsdiff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.strindex 6ba1f4ab5..65bfe9a19 100644--- a/GeneralsMD/Code/Data/Patch.str+++ b/GeneralsMD/Code/Data/Patch.str@@ -892,7 +892,7 @@ TOOLTIP:StatArmorENDTOOLTIP:StatArmorStronger-"stronger"+"stronger, less of each hit gets through"ENDTOOLTIP:StatNewWeapon@@ -916,6 +916,35 @@ ENDTOOLTIP:Upgrades"UPGRADES"END+// The gloss after each figure on the card: what it counts, as the card computes it. Damage is the+// main weapon's primary damage a shot, the weapon that does the most a second; attack speed spreads+// a clip's reload over its shots; range is in world units, 10 to a pathfinding cell, the square the+// placement grid draws; build time counts the player's power and how many factories make the unit.++TOOLTIP:StatHealthHint+"(damage it can take after armor)"+END++TOOLTIP:StatDamageHint+"(main weapon, one shot, before armor)"+END++TOOLTIP:StatAttackSpeedHint+"(shots a second, reloads counted)"+END++TOOLTIP:StatDamagePerSecondHint+"(damage × attack speed)"+END++TOOLTIP:StatRangeHint+"(10 is one square of the placement grid)"+END++TOOLTIP:StatTimeHint+"(with your power and factories now)"+END+TOOLTIP:UpgradeChanges"CHANGES"@@ -926,6 +955,14 @@ TOOLTIP:UpgradeOwnedEND// Peace time - the lobby combo box, its tooltip, the corner countdown and the three things the game+TOOLTIP:UpgradesHint+"(without it → with it)"+END++TOOLTIP:UpgradeChangesHint+"(plain unit → with this)"+END+// says while the clock runs. Tools/peacetime_layout.py selfcheck fails if any of these goes missing.GUI:PeaceTimeOffdiff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.strindex 43fbda144..3196ac934 100644--- a/GeneralsMD/Code/Data/Turkish/Generals.str+++ b/GeneralsMD/Code/Data/Turkish/Generals.str@@ -15506,7 +15506,7 @@ TOOLTIP:StatArmorENDTOOLTIP:StatArmorStronger-"güçlenir"+"güçlenir, her vuruşun daha azı geçer"ENDTOOLTIP:StatNewWeapon@@ -15529,6 +15529,30 @@ TOOLTIP:Upgrades"GELİŞTİRMELER"END+TOOLTIP:StatHealthHint+"(zırhtan sonra kaldırabileceği hasar)"+END++TOOLTIP:StatDamageHint+"(ana silah, atış başına, zırhtan önce)"+END++TOOLTIP:StatAttackSpeedHint+"(saniyedeki atış, şarjör doldurma dahil)"+END++TOOLTIP:StatDamagePerSecondHint+"(hasar × atış hızı)"+END++TOOLTIP:StatRangeHint+"(10, yerleştirme ızgarasının bir karesi)"+END++TOOLTIP:StatTimeHint+"(şu anki enerjiniz ve fabrikalarınızla)"+END+TOOLTIP:UpgradeChanges"ETKİLEDİKLERİ"END@@ -15537,6 +15561,14 @@ TOOLTIP:UpgradeOwned"alındı"END+TOOLTIP:UpgradesHint+"(onsuz → onunla)"+END++TOOLTIP:UpgradeChangesHint+"(yalın birlik → bununla)"+END+GUI:HudStatArmy"Ordu değeri"ENDdiff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cppindex d6c9ac7a3..f768c338e 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp@@ -1064,13 +1064,16 @@ void ControlBar::populateBuildTooltipLayout( const CommandButton *commandButton,// it still needsif( card.hasStats ){+ // each figure ends in a short gloss of what it counts, so the card reads without a manualUnicodeString figures;- auto row = [&]( const char *label, const UnicodeString &value )+ auto row = [&]( const char *label, const UnicodeString &value, const char *hint ){figures.concat( u"\n" );figures.concat( TheGameText->fetch( label ) );figures.concat( u": " );figures.concat( value );+ figures.concat( u" " );+ figures.concat( TheGameText->fetch( hint ) );};auto number = []( Int value ){@@ -1079,19 +1082,20 @@ void ControlBar::populateBuildTooltipLayout( const CommandButton *commandButton,return text;};if( card.health > 0 )- row( "TOOLTIP:StatHealth", number( card.health ) );+ row( "TOOLTIP:StatHealth", number( card.health ), "TOOLTIP:StatHealthHint" );if( card.damage > 0 ){// a bomb that kills its carrier goes off once, so it has no rateconst Bool once = card.attacksPerSecond <= 0.0f;- row( "TOOLTIP:StatDamage", number( card.damage ) );- row( "TOOLTIP:StatAttackSpeed", once ? UnicodeString( u"-" ) : UnicodeString( MultiByteToWideCharSingleLine( rateFigure( card.attacksPerSecond ).c_str() ).c_str() ) );- row( "TOOLTIP:StatDamagePerSecond", once ? UnicodeString( u"-" ) : number( card.damagePerSecond ) );- row( "TOOLTIP:StatRange", number( card.range ) );+ row( "TOOLTIP:StatDamage", number( card.damage ), "TOOLTIP:StatDamageHint" );+ row( "TOOLTIP:StatAttackSpeed", once ? UnicodeString( u"-" ) : UnicodeString( MultiByteToWideCharSingleLine( rateFigure( card.attacksPerSecond ).c_str() ).c_str() ),+ "TOOLTIP:StatAttackSpeedHint" );+ row( "TOOLTIP:StatDamagePerSecond", once ? UnicodeString( u"-" ) : number( card.damagePerSecond ), "TOOLTIP:StatDamagePerSecondHint" );+ row( "TOOLTIP:StatRange", number( card.range ), "TOOLTIP:StatRangeHint" );}UnicodeString seconds;seconds.format( TheGameText->fetch( "TOOLTIP:StatSeconds" ), card.buildSeconds );- row( "TOOLTIP:StatTime", seconds );+ row( "TOOLTIP:StatTime", seconds, "TOOLTIP:StatTimeHint" );if( !descrip.isEmpty() )descrip.concat( u"\n" );descrip.concat( figures );@@ -1100,6 +1104,8 @@ void ControlBar::populateBuildTooltipLayout( const CommandButton *commandButton,{descrip.concat( u"\n\n" );descrip.concat( TheGameText->fetch( card.hasStats ? "TOOLTIP:Upgrades" : "TOOLTIP:UpgradeChanges" ) );+ descrip.concat( u" " );+ descrip.concat( TheGameText->fetch( card.hasStats ? "TOOLTIP:UpgradesHint" : "TOOLTIP:UpgradeChangesHint" ) );for( size_t each = 0; each < card.upgrades.size(); ++each ){const BuildTooltipUpgrade &upgrade = card.upgrades[ each ];