@@ -876,6 +876,21 @@ const FieldParse InGameUI::s_fieldParseTable[] =
876
876
{ " ClearMinesRadiusCursor" , RadiusDecalTemplate::parseRadiusDecalTemplate, NULL , offsetof ( InGameUI, m_radiusCursors[ RADIUSCURSOR_CLEARMINES] ) },
877
877
{ " AmbulanceRadiusCursor" , RadiusDecalTemplate::parseRadiusDecalTemplate, NULL , offsetof ( InGameUI, m_radiusCursors[ RADIUSCURSOR_AMBULANCE] ) },
878
878
879
+ // TheSuperHackers @info ui enhancement configuration
880
+ { " SystemTimeFont" , INI::parseAsciiString, NULL , offsetof ( InGameUI, m_systemTimeFont ) },
881
+ { " SystemTimePointSize" , INI::parseInt, NULL , offsetof ( InGameUI, m_systemTimePointSize ) },
882
+ { " SystemTimeBold" , INI::parseBool, NULL , offsetof ( InGameUI, m_systemTimeBold ) },
883
+ { " SystemTimePosition" , INI::parseCoord2D, NULL , offsetof ( InGameUI, m_systemTimePosition ) },
884
+ { " SystemTimeColor" , INI::parseColorInt, NULL , offsetof ( InGameUI, m_systemTimeColor ) },
885
+ { " SystemTimeDropColor" , INI::parseColorInt, NULL , offsetof ( InGameUI, m_systemTimeDropColor ) },
886
+
887
+ { " SimulationTimerFont" , INI::parseAsciiString, NULL , offsetof ( InGameUI, m_simulationTimerFont ) },
888
+ { " SimulationTimerPointSize" , INI::parseInt, NULL , offsetof ( InGameUI, m_simulationTimerPointSize ) },
889
+ { " SimulationTimerBold" , INI::parseBool, NULL , offsetof ( InGameUI, m_simulationTimerBold ) },
890
+ { " SimulationTimerPosition" , INI::parseCoord2D, NULL , offsetof ( InGameUI, m_simulationTimerPosition ) },
891
+ { " SimulationTimerColor" , INI::parseColorInt, NULL , offsetof ( InGameUI, m_simulationTimerColor ) },
892
+ { " SimulationTimerDropColor" , INI::parseColorInt, NULL , offsetof ( InGameUI, m_simulationTimerDropColor ) },
893
+
879
894
{ NULL , NULL , NULL , 0 } // keep this last
880
895
};
881
896
@@ -1001,6 +1016,24 @@ InGameUI::InGameUI()
1001
1016
m_replayWindow = NULL ;
1002
1017
m_messagesOn = TRUE ;
1003
1018
1019
+ m_systemTimeString = NULL ;
1020
+ m_systemTimeFont = " Arial" ;
1021
+ m_systemTimePointSize = 10 ;
1022
+ m_systemTimeBold = FALSE ;
1023
+ m_systemTimePosition.x = 5 ;
1024
+ m_systemTimePosition.y = 0 ;
1025
+ m_systemTimeColor = GameMakeColor ( 255 , 255 , 255 , 255 );
1026
+ m_systemTimeDropColor = GameMakeColor ( 0 , 0 , 0 , 255 );
1027
+
1028
+ m_simulationTimerString = NULL ;
1029
+ m_simulationTimerFont = " Arial" ;
1030
+ m_simulationTimerPointSize = 10 ;
1031
+ m_simulationTimerBold = FALSE ;
1032
+ m_simulationTimerPosition.x = 0 .92f ;
1033
+ m_simulationTimerPosition.y = 0 ;
1034
+ m_simulationTimerColor = GameMakeColor ( 255 , 255 , 255 , 255 );
1035
+ m_simulationTimerDropColor = GameMakeColor ( 0 , 0 , 0 , 255 );
1036
+
1004
1037
m_superweaponPosition.x = 0 .7f ;
1005
1038
m_superweaponPosition.y = 0 .7f ;
1006
1039
m_superweaponFlashDuration = 1 .0f ;
@@ -2007,6 +2040,12 @@ void InGameUI::freeMessageResources( void )
2007
2040
2008
2041
} // end for i
2009
2042
2043
+ // release timer strings then set them to empty
2044
+ TheDisplayStringManager->freeDisplayString (m_systemTimeString);
2045
+ m_systemTimeString = NULL ;
2046
+ TheDisplayStringManager->freeDisplayString (m_simulationTimerString);
2047
+ m_simulationTimerString = NULL ;
2048
+
2010
2049
} // end freeMessageResources
2011
2050
2012
2051
// -------------------------------------------------------------------------------------------------
@@ -3465,6 +3504,50 @@ void InGameUI::disregardDrawable( Drawable *draw )
3465
3504
void InGameUI::postDraw ( void )
3466
3505
{
3467
3506
3507
+ // TheSuperHackers @info render the system time and simulation timer first, this way other text will render over them if they overlap
3508
+ // draw the current system time
3509
+ if (TheGlobalData->m_showSystemTime && !TheGameLogic->isInShellGame ())
3510
+ {
3511
+ if (!m_systemTimeString) {
3512
+ m_systemTimeString = TheDisplayStringManager->newDisplayString ();
3513
+ }
3514
+
3515
+ // current system time
3516
+ SYSTEMTIME systemTime;
3517
+ GetLocalTime ( &systemTime );
3518
+
3519
+ UnicodeString TimeString;
3520
+ TimeString.format (L" %2.2d:%2.2d:%2.2d" , systemTime.wHour , systemTime.wMinute , systemTime.wSecond );
3521
+ m_systemTimeString->setFont (TheWindowManager->winFindFont ( m_systemTimeFont,
3522
+ TheGlobalLanguageData->adjustFontSize (m_systemTimePointSize), m_systemTimeBold ));
3523
+ m_systemTimeString->setText (TimeString);
3524
+
3525
+ m_systemTimeString->draw (m_systemTimePosition.x , m_systemTimePosition.y , m_systemTimeColor, m_systemTimeDropColor);
3526
+ }
3527
+
3528
+ // draw the simulation timer
3529
+ if (TheGlobalData->m_showSimulationTimer && !TheGameLogic->isInShellGame ())
3530
+ {
3531
+ if (!m_simulationTimerString) {
3532
+ m_simulationTimerString = TheDisplayStringManager->newDisplayString ();
3533
+ }
3534
+
3535
+ Int currentFrame = TheGameLogic->getFrame ();
3536
+ Int currentSimulationTime = (Int) (SECONDS_PER_LOGICFRAME_REAL * currentFrame );
3537
+ Int hours = currentSimulationTime / 3600 ;
3538
+ Int minutes = (currentSimulationTime / 60 ) - (hours * 60 );
3539
+ Int seconds = currentSimulationTime - (minutes * 60 ) - (hours * 3600 );
3540
+ Int frame = currentFrame % 30 ;
3541
+
3542
+ UnicodeString simulationTimeString;
3543
+ simulationTimeString.format (L" %2.2d:%2.2d:%2.2d.%2.2d" , hours, minutes, seconds, frame);
3544
+ m_simulationTimerString->setFont (TheWindowManager->winFindFont ( m_simulationTimerFont,
3545
+ TheGlobalLanguageData->adjustFontSize (m_simulationTimerPointSize), m_simulationTimerBold ));
3546
+ m_simulationTimerString->setText (simulationTimeString);
3547
+
3548
+ m_simulationTimerString->draw (TheDisplay->getWidth () * m_simulationTimerPosition.x , m_simulationTimerPosition.y , m_simulationTimerColor, m_simulationTimerDropColor);
3549
+ }
3550
+
3468
3551
// render our display strings for the messages if on
3469
3552
if ( m_messagesOn )
3470
3553
{
0 commit comments