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): smaller two-line wireframe notice
Olcay Seygand4cf5e073c69
diff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.strindex 7d1fe948d..7f24144a9 100644--- a/GeneralsMD/Code/Data/Patch.str+++ b/GeneralsMD/Code/Data/Patch.str@@ -1315,7 +1315,11 @@ GUI:PeaceTimeHudLabelENDGUI:WireframeNotice-"UI is wireframe, will be updated."+"Reforged HUD: early preview"+END++GUI:WireframeNotice2+"Final artwork is on the way"ENDGUI:LobbyTabChatdiff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.strindex 7c1fed3b1..9de8c0263 100644--- a/GeneralsMD/Code/Data/Turkish/Generals.str+++ b/GeneralsMD/Code/Data/Turkish/Generals.str@@ -15642,7 +15642,11 @@ GUI:PeaceTimeHudLabelENDGUI:WireframeNotice-"Arayüz taslak, güncellenecek."+"Reforged arayüz: ön sürüm"+END++GUI:WireframeNotice2+"Son tasarım yolda"ENDGUI:LobbyTabChatdiff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.hindex 32c5a226f..76477ed32 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h@@ -1784,7 +1784,8 @@ protected:UnsignedInt m_hudRealClockBaseMs; ///< wall clock the two elapsed-time readouts were aligned atUnsignedInt m_hudLastDrawMs; ///< wall clock of the previous overlay draw, so a pause can be taken back out of itInt m_hudOverlayBottom; ///< bottom of everything drawn in the top right corner, so the superweapon timers start under it- DisplayString * m_wireframeNotice; ///< the draft notice drawWireframeNotice bounces+ enum { WIREFRAME_LINES = 2 };+ DisplayString * m_wireframeNotice[ WIREFRAME_LINES ]; ///< the draft notice drawWireframeNotice bounces, a string a lineCoord2D m_wireframePos; ///< its top left corner on screenCoord2D m_wireframeDir; ///< which way it is going, each axis +1 or -1UnsignedInt m_wireframeLastMs; ///< wall clock of its previous draw, 0 before the firstdiff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex 0ab9d9beb..909734022 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -1233,7 +1233,7 @@ InGameUI::InGameUI()m_hudRealClockBaseMs = 0;m_hudLastDrawMs = 0;m_hudOverlayBottom = 0;- m_wireframeNotice = NULL;+ m_wireframeNotice[ 0 ] = m_wireframeNotice[ 1 ] = NULL;m_wireframePos.x = m_wireframePos.y = 0.0f;m_wireframeDir.x = m_wireframeDir.y = 1.0f;m_wireframeLastMs = 0;@@ -11633,18 +11633,30 @@ void InGameUI::drawWireframeNotice( void )}box.hi.y = min( box.hi.y, (Int)TheDisplay->getHeight() );- if( m_wireframeNotice == NULL )+ // two strings, one a line: the text renderer has no concept of a newline+ static const char *const LINES[ WIREFRAME_LINES ] = { "GUI:WireframeNotice", "GUI:WireframeNotice2" };+ if( m_wireframeNotice[ 0 ] == NULL ){- m_wireframeNotice = TheDisplayStringManager->newDisplayString();- m_wireframeNotice->setFont( TheFontLibrary->getFont( m_superweaponNormalFont,- TheGlobalLanguageData->adjustFontSize( 16 ), TRUE ) );- m_wireframeNotice->setText( TheGameText->fetch( "GUI:WireframeNotice" ) );+ for( Int i = 0; i < WIREFRAME_LINES; i++ )+ {+ m_wireframeNotice[ i ] = TheDisplayStringManager->newDisplayString();+ m_wireframeNotice[ i ]->setFont( TheFontLibrary->getFont( m_superweaponNormalFont,+ TheGlobalLanguageData->adjustFontSize( 11 ), TRUE ) );+ m_wireframeNotice[ i ]->setText( TheGameText->fetch( LINES[ i ] ) );+ }m_wireframePos.x = (Real)box.lo.x;m_wireframePos.y = (Real)box.lo.y;}+ // the block is as wide as its wider line and as tall as both+ Int lineWidth[ WIREFRAME_LINES ], lineHeight[ WIREFRAME_LINES ];Int width = 0, height = 0;- m_wireframeNotice->getSize( &width, &height );+ for( Int i = 0; i < WIREFRAME_LINES; i++ )+ {+ m_wireframeNotice[ i ]->getSize( &lineWidth[ i ], &lineHeight[ i ] );+ width = max( width, lineWidth[ i ] );+ height += lineHeight[ i ];+ }// a tenth of the screen's height a second; a frame after a stall or a pause moves at most 100 ms// worth, rather than jumping the text across the bar@@ -11662,8 +11674,13 @@ void InGameUI::drawWireframeNotice( void )if( m_wireframePos.y >= bottom ) { m_wireframePos.y = bottom; m_wireframeDir.y = -1.0f; }if( m_wireframePos.y <= box.lo.y ) { m_wireframePos.y = (Real)box.lo.y; m_wireframeDir.y = 1.0f; }- m_wireframeNotice->draw( REAL_TO_INT( m_wireframePos.x ), REAL_TO_INT( m_wireframePos.y ),- GameMakeColor( 255, 220, 120, 170 ), GameMakeColor( 0, 0, 0, 170 ) );+ Int y = REAL_TO_INT( m_wireframePos.y );+ for( Int i = 0; i < WIREFRAME_LINES; i++ )+ {+ m_wireframeNotice[ i ]->draw( REAL_TO_INT( m_wireframePos.x ) + ( width - lineWidth[ i ] ) / 2, y,+ GameMakeColor( 255, 220, 120, 170 ), GameMakeColor( 0, 0, 0, 170 ) );+ y += lineHeight[ i ];+ }}//-------------------------------------------------------------------------------------------------