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
fix(gameclient): draw superweapon and named timers under the info strip
Olcay Seygan423ae84e13a4
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 605c7d618..649d52865 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -64,6 +64,7 @@ found and fixed — EA's own, not port damage.**- The match clock hangs from the middle of the top edge with your money in its own box under it. Superweapon countdowns in the top right corner are as big as your general's power buttons.- Tab is Zero Hour's again. It opens and closes the diplomacy screen the game shipped with, in its own art and layout, players, teams and mute buttons where you remember them. With a group selected, Tab used to step through the unit types in your selection instead, and the diplomacy screen wore ControlBar Pro's paint.- Peace time counts down in red at the end of the info strip in the top right corner, PEACE 4:59, down to the last second, and nothing pops up over the middle of the battlefield any more. It stays there with Info Box switched off, alone on the strip, because the truce is a rule of the match. The strip itself was missing from the released game; it is on for everyone now.+- Superweapon countdowns and a map's named timers no longer sit on top of that strip. They started at the very top of the corner, so the strip's clock and money were written over the first countdown; they now begin under the strip whenever it is showing.- A superweapon built, charged or fired anywhere on the map flashes its name in big letters under the clock: "Nuclear Missile launched". Yours are white, an ally's blue, an enemy's red. Each line stays four seconds and fades out. When several land at once they queue and hurry through, two seconds each with one more waiting and one second with a pile behind it, so the last news never sits stale.- Your production queue stands on the console over your selection, five to a row, each row only as long as what is in it. The event feed runs down from the menu key in the top left corner, and the chat sits under it.- Point at the attack, hold position or move key and a card says what it does, in English or Turkish. Those three are painted onto the grid rather than given to a unit, so the game had no card for them and showed nothing. The card stands on top of the command bar like every other button's.diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.hindex 2d7e948c1..eddaf123f 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h@@ -1386,6 +1386,7 @@ protected:enum { HUD_CLOCK_POINT_SIZE = 7 }; ///< smaller still, and bold: the clock/rate plate is a glance, not a readvoid drawHudOverlay( void ); ///< the top right info strip (ShowNetBox), peace time at its end+ Int hudStripBottom( void ) const; ///< first screen row below that strip, 0 while it is not drawnvoid drawKickVoteBanner( void ); ///< the open vote kick, top middle, while there is onevoid drawProductionList( void ); ///< the production list, lines on the left above the control bardiff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex e135b9ddb..a9b84d142 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -6406,7 +6406,8 @@ void InGameUI::postDraw( void )const Int screenH = TheDisplay->getHeight();const Int x = hudEdgeX( m_superweaponPosition.x );- Int y = REAL_TO_INT( m_superweaponPosition.y * screenH );+ // under the info strip whenever it is up: the strip is drawn last and would cover them+ Int y = max( REAL_TO_INT( m_superweaponPosition.y * screenH ), hudStripBottom() );const Int bottom = REAL_TO_INT( screenH * 0.8f * 0.82f ); // EA's: the view above its barsize_t drawn = 0;for( ; drawn < listed.size() && drawn < SUPERWEAPON_LIST_LINES && y < bottom; drawn++ )@@ -6439,7 +6440,7 @@ void InGameUI::postDraw( void )Bool reverseXDir = (m_namedTimerPosition.x >= 0.5f);// EA's column as far in from the right edge as EA had it, at the HUD's scaleInt startX = hudEdgeX( m_namedTimerPosition.x );- Int startY = (Int)(m_namedTimerPosition.y * TheDisplay->getHeight());+ Int startY = max( (Int)(m_namedTimerPosition.y * TheDisplay->getHeight()), hudStripBottom() );Color bgColor = GameMakeColor( 0, 0, 0, 255 );for (NamedTimerMapIt mapIt = m_namedTimers.begin(); mapIt != m_namedTimers.end(); ++mapIt){@@ -9066,6 +9067,20 @@ void InGameUI::drawDirectorIntroPlate( void )drawBroadcastPlate( under, underLeft, top + nameHeight, shown );}+//-------------------------------------------------------------------------------------------------+/** Where the info strip ends, for the timers that start in the same corner. The strip draws after+ * them, on top of everything, so its height cannot be read from the last draw; it is one line of+ * the strip's font at the strip's own offsets, which is what drawHudOverlay lays out. */+//-------------------------------------------------------------------------------------------------+Int InGameUI::hudStripBottom( void ) const+{+ if( !TheGlobalData->m_showNetBox && !TheGameLogic->isPeaceTime() )+ return 0;+ const GameFont *font = TheFontLibrary->getFont( m_superweaponNormalFont,+ TheGlobalLanguageData->adjustFontSize( HUD_CLOCK_POINT_SIZE ), TRUE );+ return TheUIRect().y + stripPixels( 2 ) + font->height + 1 + stripPixels( 4 );+}+//-------------------------------------------------------------------------------------------------void InGameUI::drawHudOverlay( void ){