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.

fix(gameclient): skip a missing label in the portrait upgrade tooltip

Olcay Seygan5926299c0ca4
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9f16f6d14..3eeb788d4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1153,6 +1153,7 @@ A third pass went through the generals' powers, promotions and unit abilities.
- 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. An upgrade you already own still says what it does: its card keeps the description and puts the already-purchased note under it. 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.
- The readout in the top right corner is a box of its own: the time of day, the match time and the real time beside it, the logic rate and the frame rate, the renderer and the frame number. In a network game it adds how many frames are ready out of the input delay, the room's frame rate and the traffic in and out, and under a unit limit your count against it. It is on unless you switch it off: untick Info Box on Options > Interface and the superweapon timers move up into the corner it left.
- The steel between the build buttons, the portrait's grid and the promotion screen's cells is half as wide as it was, so the pictures take the room. The queue's tray has a thinner rim. The portrait and its upgrade icons sit under the portrait's grid, framed the same way as every other picture on the bar.
+- Point at Camo Netting's icon beside a GLA unit's portrait and its card used to say MISSING where the description belongs. EA left a second Camo Netting button in the data that no building offers, its text name mistyped, and the card read that one first. It reads the button you buy it from now.
- 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.
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp
index c52a376ba..b8dd5f1ab 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp
@@ -300,14 +300,20 @@ Bool ControlBar::describePortraitBarWindow( GameWindow *window, UnicodeString &n
continue;
name = TheGameText->fetch( shown->getDisplayNameLabel().str() );
- // the description is the one on the button that buys it, when there is such a button
+ // the description is the one on the button that buys it, when there is such a button;
+ // retail's unused Command_UpgradeCamoNetting has a typo'd label, so skip labels the string table lacks
description.clear();
for( const CommandButton *button = TheCommandStore->getCommandButtons(); button; button = button->getNext() )
{
if( button->getUpgradeTemplate() == shown && button->getDescriptionLabel().isNotEmpty() )
{
- description = TheGameText->fetch( button->getDescriptionLabel() );
- break;
+ Bool exists = FALSE;
+ UnicodeString text = TheGameText->fetch( button->getDescriptionLabel(), &exists );
+ if( exists )
+ {
+ description = text;
+ break;
+ }
}
}
return TRUE;