@@ -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,25 @@ InGameUI::InGameUI()
1001
1016
m_replayWindow = NULL ;
1002
1017
m_messagesOn = TRUE ;
1003
1018
1019
+ m_systemTimeString = NULL ;
1020
+ m_systemTimeFont = " Tahoma" ;
1021
+ m_systemTimePointSize = 8 ;
1022
+ m_systemTimeBold = TRUE ;
1023
+ m_systemTimePosition.x = 5 ; // TheSuperHackers @info relative to the left of the screen
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_simulationTimerFrameString = NULL ;
1030
+ m_simulationTimerFont = " Tahoma" ;
1031
+ m_simulationTimerPointSize = 8 ;
1032
+ m_simulationTimerBold = TRUE ;
1033
+ m_simulationTimerPosition.x = 5 ; // TheSuperHackers @info relative to the right of the screen
1034
+ m_simulationTimerPosition.y = 0 ;
1035
+ m_simulationTimerColor = GameMakeColor ( 255 , 255 , 255 , 255 );
1036
+ m_simulationTimerDropColor = GameMakeColor ( 0 , 0 , 0 , 255 );
1037
+
1004
1038
m_superweaponPosition.x = 0 .7f ;
1005
1039
m_superweaponPosition.y = 0 .7f ;
1006
1040
m_superweaponFlashDuration = 1 .0f ;
@@ -1082,6 +1116,9 @@ InGameUI::~InGameUI()
1082
1116
// delete the message resources
1083
1117
freeMessageResources ();
1084
1118
1119
+ // free custom ui strings
1120
+ freeCustomUiResources ();
1121
+
1085
1122
// delete the array for the drawbles
1086
1123
delete [] m_placeIcon;
1087
1124
m_placeIcon = NULL ;
@@ -1924,6 +1961,9 @@ void InGameUI::reset( void )
1924
1961
// free any message resources allocated
1925
1962
freeMessageResources ();
1926
1963
1964
+ // free custom ui strings
1965
+ freeCustomUiResources ();
1966
+
1927
1967
Int i;
1928
1968
for (i=0 ; i<MAX_PLAYER_COUNT; ++i)
1929
1969
{
@@ -2009,6 +2049,19 @@ void InGameUI::freeMessageResources( void )
2009
2049
2010
2050
} // end freeMessageResources
2011
2051
2052
+ void InGameUI::freeCustomUiResources ( void )
2053
+ {
2054
+
2055
+ // release system time and simulation timer strings then set them to empty
2056
+ TheDisplayStringManager->freeDisplayString (m_systemTimeString);
2057
+ m_systemTimeString = NULL ;
2058
+ TheDisplayStringManager->freeDisplayString (m_simulationTimerString);
2059
+ m_simulationTimerString = NULL ;
2060
+ TheDisplayStringManager->freeDisplayString (m_simulationTimerFrameString);
2061
+ m_simulationTimerFrameString = NULL ;
2062
+
2063
+ } // end freeCustomUiResources
2064
+
2012
2065
// -------------------------------------------------------------------------------------------------
2013
2066
/* * Same as the unicode message method, but this takes an ascii string which is assumed
2014
2067
* to me a string manager label */
@@ -3465,6 +3518,67 @@ void InGameUI::disregardDrawable( Drawable *draw )
3465
3518
void InGameUI::postDraw ( void )
3466
3519
{
3467
3520
3521
+ // TheSuperHackers @info render the system time and simulation timer first, this way other text will render over them if they overlap
3522
+ // draw the current system time
3523
+ if (TheGlobalData->m_showSystemTime && !TheGameLogic->isInShellGame ())
3524
+ {
3525
+ if (!m_systemTimeString) {
3526
+ m_systemTimeString = TheDisplayStringManager->newDisplayString ();
3527
+ }
3528
+
3529
+ // current system time
3530
+ SYSTEMTIME systemTime;
3531
+ GetLocalTime ( &systemTime );
3532
+
3533
+ UnicodeString TimeString;
3534
+ TimeString.format (L" %2.2d:%2.2d:%2.2d" , systemTime.wHour , systemTime.wMinute , systemTime.wSecond );
3535
+ m_systemTimeString->setFont (TheWindowManager->winFindFont ( m_systemTimeFont,
3536
+ TheGlobalLanguageData->adjustFontSize (m_systemTimePointSize), m_systemTimeBold ));
3537
+ m_systemTimeString->setText (TimeString);
3538
+
3539
+ m_systemTimeString->draw (m_systemTimePosition.x , m_systemTimePosition.y , m_systemTimeColor, m_systemTimeDropColor);
3540
+ }
3541
+
3542
+ // draw the simulation timer
3543
+ if (TheGlobalData->m_showSimulationTimer && !TheGameLogic->isInShellGame ())
3544
+ {
3545
+ if (!m_simulationTimerString) {
3546
+ m_simulationTimerString = TheDisplayStringManager->newDisplayString ();
3547
+ }
3548
+
3549
+ if (!m_simulationTimerFrameString) {
3550
+ m_simulationTimerFrameString = TheDisplayStringManager->newDisplayString ();
3551
+ }
3552
+
3553
+ Int currentFrame = TheGameLogic->getFrame ();
3554
+ Int currentSimulationTime = (Int) (SECONDS_PER_LOGICFRAME_REAL * currentFrame );
3555
+ Int hours = currentSimulationTime / 3600 ;
3556
+ Int minutes = (currentSimulationTime / 60 ) - (hours * 60 );
3557
+ Int seconds = currentSimulationTime - (minutes * 60 ) - (hours * 3600 );
3558
+ Int frame = currentFrame % 30 ;
3559
+
3560
+ // Handle the simulation time string
3561
+ UnicodeString simulationTimeString;
3562
+ simulationTimeString.format (L" %2.2d:%2.2d:%2.2d" , hours, minutes, seconds);
3563
+ m_simulationTimerString->setFont (TheWindowManager->winFindFont ( m_simulationTimerFont,
3564
+ TheGlobalLanguageData->adjustFontSize (m_simulationTimerPointSize), m_simulationTimerBold ));
3565
+ m_simulationTimerString->setText (simulationTimeString);
3566
+
3567
+ // Handle the current frame string
3568
+ UnicodeString simulationTimeFrameString;
3569
+ simulationTimeFrameString.format (L" .%2.2d" , frame);
3570
+ m_simulationTimerFrameString->setFont (TheWindowManager->winFindFont ( m_simulationTimerFont,
3571
+ TheGlobalLanguageData->adjustFontSize (m_simulationTimerPointSize), m_simulationTimerBold ));
3572
+ m_simulationTimerFrameString->setText (simulationTimeFrameString);
3573
+
3574
+ // TheSuperHackers @info this implicitly offsets the simulation timer from the right instead of left of the screen
3575
+ int horizontalTimerOffset = TheDisplay->getWidth () - (Int)m_simulationTimerPosition.x - m_simulationTimerString->getWidth () - m_simulationTimerFrameString->getWidth ();
3576
+ int horizontalFrameOffset = TheDisplay->getWidth () - (Int)m_simulationTimerPosition.x - m_simulationTimerFrameString->getWidth ();
3577
+
3578
+ m_simulationTimerString->draw (horizontalTimerOffset, m_simulationTimerPosition.y , m_simulationTimerColor, m_simulationTimerDropColor);
3579
+ m_simulationTimerFrameString->draw (horizontalFrameOffset, m_simulationTimerPosition.y , GameMakeColor (180 ,180 ,180 ,255 ), m_simulationTimerDropColor);
3580
+ }
3581
+
3468
3582
// render our display strings for the messages if on
3469
3583
if ( m_messagesOn )
3470
3584
{
0 commit comments