mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Added Right Click to time compression to fast forward a single hour
This commit is contained in:
@@ -45,6 +45,9 @@ BOOLEAN fClockMouseRegionCreated = FALSE;
|
|||||||
|
|
||||||
BOOLEAN fTimeCompressHasOccured = FALSE;
|
BOOLEAN fTimeCompressHasOccured = FALSE;
|
||||||
|
|
||||||
|
// run time compression till next hour
|
||||||
|
bool stopTimeCompressionNextHour = false;
|
||||||
|
|
||||||
//This value represents the time that the sector was loaded. If you are in sector A9, and leave
|
//This value represents the time that the sector was loaded. If you are in sector A9, and leave
|
||||||
//the game clock at that moment will get saved into the temp file associated with it. The next time you
|
//the game clock at that moment will get saved into the temp file associated with it. The next time you
|
||||||
//enter A9, this value will contain that time. Used for scheduling purposes.
|
//enter A9, this value will contain that time. Used for scheduling purposes.
|
||||||
@@ -525,6 +528,9 @@ void SetGameTimeCompressionLevel( UINT32 uiCompressionRate )
|
|||||||
{
|
{
|
||||||
Assert( uiCompressionRate < NUM_TIME_COMPRESS_SPEEDS );
|
Assert( uiCompressionRate < NUM_TIME_COMPRESS_SPEEDS );
|
||||||
|
|
||||||
|
if( uiCompressionRate == TIME_COMPRESS_X0 )
|
||||||
|
stopTimeCompressionNextHour = false;
|
||||||
|
|
||||||
if( guiCurrentScreen == GAME_SCREEN )
|
if( guiCurrentScreen == GAME_SCREEN )
|
||||||
{
|
{
|
||||||
if( uiCompressionRate != TIME_COMPRESS_X1 )
|
if( uiCompressionRate != TIME_COMPRESS_X1 )
|
||||||
|
|||||||
@@ -109,6 +109,9 @@ extern INT32 giTimeCompressSpeeds[ NUM_TIME_COMPRESS_SPEEDS ];
|
|||||||
// compress mode now in use
|
// compress mode now in use
|
||||||
extern INT32 giTimeCompressMode;
|
extern INT32 giTimeCompressMode;
|
||||||
|
|
||||||
|
// run time compression till next hour
|
||||||
|
extern bool stopTimeCompressionNextHour;
|
||||||
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -86,6 +86,11 @@ CHAR16 zString[128];
|
|||||||
if(is_networked)
|
if(is_networked)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (stopTimeCompressionNextHour)
|
||||||
|
{
|
||||||
|
SetGameTimeCompressionLevel( TIME_COMPRESS_X0);
|
||||||
|
}
|
||||||
|
|
||||||
// hourly update of town loyalty
|
// hourly update of town loyalty
|
||||||
HandleTownLoyalty();
|
HandleTownLoyalty();
|
||||||
|
|
||||||
|
|||||||
@@ -713,6 +713,27 @@ void BtnTimeCompressMoreMapScreenCallback( GUI_BUTTON *btn,INT32 reason )
|
|||||||
{
|
{
|
||||||
if ( CommonTimeCompressionChecks() == TRUE )
|
if ( CommonTimeCompressionChecks() == TRUE )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// redraw region
|
||||||
|
if( btn->uiFlags & MSYS_HAS_BACKRECT )
|
||||||
|
{
|
||||||
|
fMapScreenBottomDirty = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
||||||
|
}
|
||||||
|
// Start time compression which stops at the next hour
|
||||||
|
// Button down removes the pop up/tooltip, Button up calls the functionality
|
||||||
|
else if(reason & MSYS_CALLBACK_REASON_RBUTTON_UP )
|
||||||
|
{
|
||||||
|
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
||||||
|
{
|
||||||
|
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
||||||
|
fMapScreenBottomDirty = TRUE;
|
||||||
|
|
||||||
|
stopTimeCompressionNextHour = true;
|
||||||
|
SetGameTimeCompressionLevel( TIME_COMPRESS_60MINS );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4453,7 +4453,7 @@ STR16 pMapScreenBottomFastHelp[] =
|
|||||||
L"|Laptop",
|
L"|Laptop",
|
||||||
L"Tactical (|E|s|c)",
|
L"Tactical (|E|s|c)",
|
||||||
L"|Options",
|
L"|Options",
|
||||||
L"Time Compress (|+)", // time compress more
|
L"Time Compress (|+)\nRight Click to fast forward one hour", // time compress more
|
||||||
L"Time Compress (|-)", // time compress less
|
L"Time Compress (|-)", // time compress less
|
||||||
L"Previous Message (|U|p)\nPrevious Page (|P|g|U|p)", // previous message in scrollable list
|
L"Previous Message (|U|p)\nPrevious Page (|P|g|U|p)", // previous message in scrollable list
|
||||||
L"Next Message (|D|o|w|n)\nNext Page (|P|g|D|n)", // next message in the scrollable list
|
L"Next Message (|D|o|w|n)\nNext Page (|P|g|D|n)", // next message in the scrollable list
|
||||||
|
|||||||
Reference in New Issue
Block a user