mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
New option AUTO_HIDE_PB (TRUE) enables auto hiding of the progress bar when mouse cursor is on the top map row.
AI soldiers will now avoid staying at top map row. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8723 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+5
-2
@@ -919,8 +919,11 @@ void LoadGameExternalOptions()
|
|||||||
// Are enemy females restricted to Blackshirts only?
|
// Are enemy females restricted to Blackshirts only?
|
||||||
gGameExternalOptions.fRestrictFemaleEnemiesExceptElite = iniReader.ReadBoolean("Graphics Settings","RESTRICT_FEMALE_ENEMIES_EXCEPT_ELITE",FALSE);
|
gGameExternalOptions.fRestrictFemaleEnemiesExceptElite = iniReader.ReadBoolean("Graphics Settings","RESTRICT_FEMALE_ENEMIES_EXCEPT_ELITE",FALSE);
|
||||||
|
|
||||||
// New setting to allow thin progressbar
|
// New setting to allow thin progress bar
|
||||||
gGameExternalOptions.fSmallSizeProgressbar = iniReader.ReadBoolean("Graphics Settings", "SMALL_SIZE_PB", FALSE);
|
gGameExternalOptions.fSmallSizeProgressBar = iniReader.ReadBoolean("Graphics Settings", "SMALL_SIZE_PB", FALSE);
|
||||||
|
|
||||||
|
// New setting to allow auto hiding progress bar
|
||||||
|
gGameExternalOptions.fAutoHideProgressBar = iniReader.ReadBoolean("Graphics Settings", "AUTO_HIDE_PB", TRUE);
|
||||||
|
|
||||||
// anv: hide stuff on roof in explored rooms at ground level view (sandbags and other crap)
|
// anv: hide stuff on roof in explored rooms at ground level view (sandbags and other crap)
|
||||||
gGameExternalOptions.fHideExploredRoomRoofStructures = iniReader.ReadBoolean("Graphics Settings", "HIDE_EXPLORED_ROOM_ROOF_STRUCTURES", TRUE);
|
gGameExternalOptions.fHideExploredRoomRoofStructures = iniReader.ReadBoolean("Graphics Settings", "HIDE_EXPLORED_ROOM_ROOF_STRUCTURES", TRUE);
|
||||||
|
|||||||
+2
-1
@@ -870,7 +870,8 @@ typedef struct
|
|||||||
INT32 iQuickItem0;
|
INT32 iQuickItem0;
|
||||||
|
|
||||||
// for small progress bar
|
// for small progress bar
|
||||||
BOOLEAN fSmallSizeProgressbar;
|
BOOLEAN fSmallSizeProgressBar;
|
||||||
|
BOOLEAN fAutoHideProgressBar;
|
||||||
// anv: hide stuff on roof in explored rooms at ground level view (sandbags and other crap)
|
// anv: hide stuff on roof in explored rooms at ground level view (sandbags and other crap)
|
||||||
BOOLEAN fHideExploredRoomRoofStructures;
|
BOOLEAN fHideExploredRoomRoofStructures;
|
||||||
//enable ext mouse key
|
//enable ext mouse key
|
||||||
|
|||||||
+7
-2
@@ -3469,7 +3469,7 @@ BOOLEAN InitSaveDir()
|
|||||||
|
|
||||||
// WDS - Automatically try to save when an assertion failure occurs
|
// WDS - Automatically try to save when an assertion failure occurs
|
||||||
extern bool alreadySaving = false;
|
extern bool alreadySaving = false;
|
||||||
|
extern bool bHideTopMessage;
|
||||||
|
|
||||||
BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
||||||
{
|
{
|
||||||
@@ -3786,8 +3786,13 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
|
|||||||
FileWrite( hFile, &gGameOptions, sizeof( GAME_OPTIONS ), &uiNumBytesWritten );
|
FileWrite( hFile, &gGameOptions, sizeof( GAME_OPTIONS ), &uiNumBytesWritten );
|
||||||
|
|
||||||
//
|
//
|
||||||
//Save the gTactical Status array, plus the curent secotr location
|
//Save the gTactical Status array, plus the current sector location
|
||||||
//
|
//
|
||||||
|
|
||||||
|
// sevenfm: enable fInTopMessage if top bar is hidden, to correctly show it after loading game
|
||||||
|
if (bHideTopMessage)
|
||||||
|
gTacticalStatus.fInTopMessage = TRUE;
|
||||||
|
|
||||||
if( !SaveTacticalStatusToSavedGame( hFile ) )
|
if( !SaveTacticalStatusToSavedGame( hFile ) )
|
||||||
{
|
{
|
||||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_ERROR, L"ERROR writing tactical status");
|
ScreenMsg( FONT_MCOLOR_WHITE, MSG_ERROR, L"ERROR writing tactical status");
|
||||||
|
|||||||
@@ -786,6 +786,9 @@ UINT32 HandleTacticalUI( void )
|
|||||||
return( ReturnVal );
|
return( ReturnVal );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool bHideTopMessage = false;
|
||||||
|
extern INT32 HEIGHT_PROGRESSBAR;
|
||||||
|
|
||||||
void SetUIMouseCursor( )
|
void SetUIMouseCursor( )
|
||||||
{
|
{
|
||||||
UINT32 uiCursorFlags;
|
UINT32 uiCursorFlags;
|
||||||
@@ -794,6 +797,28 @@ void SetUIMouseCursor( )
|
|||||||
BOOLEAN fUpdateNewCursor = TRUE;
|
BOOLEAN fUpdateNewCursor = TRUE;
|
||||||
static INT32 sOldExitGridNo = NOWHERE;
|
static INT32 sOldExitGridNo = NOWHERE;
|
||||||
static BOOLEAN fOkForExit = FALSE;
|
static BOOLEAN fOkForExit = FALSE;
|
||||||
|
INT32 usGridNo;
|
||||||
|
|
||||||
|
// sevenfm: hide top bar
|
||||||
|
if (gusMouseYPos <= HEIGHT_PROGRESSBAR &&
|
||||||
|
GetMouseMapPos(&usGridNo) &&
|
||||||
|
!TileIsOutOfBounds(usGridNo) &&
|
||||||
|
NorthSpot(usGridNo, gsInterfaceLevel) &&
|
||||||
|
!bHideTopMessage &&
|
||||||
|
gTacticalStatus.fInTopMessage)
|
||||||
|
{
|
||||||
|
bHideTopMessage = true;
|
||||||
|
EndTopMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
// sevenfm: reveal top bar
|
||||||
|
if (gusMouseYPos > HEIGHT_PROGRESSBAR &&
|
||||||
|
!gfUIFullTargetFound &&
|
||||||
|
bHideTopMessage)
|
||||||
|
{
|
||||||
|
gTacticalStatus.fInTopMessage = TRUE;
|
||||||
|
bHideTopMessage = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if we moved from confirm mode on exit arrows
|
// Check if we moved from confirm mode on exit arrows
|
||||||
// If not in move mode, return!
|
// If not in move mode, return!
|
||||||
|
|||||||
+13
-13
@@ -418,7 +418,7 @@ BOOLEAN InitializeTacticalInterface( )
|
|||||||
}
|
}
|
||||||
|
|
||||||
//*ddd{
|
//*ddd{
|
||||||
if( gGameExternalOptions.fSmallSizeProgressbar )
|
if( gGameExternalOptions.fSmallSizeProgressBar )
|
||||||
{
|
{
|
||||||
HEIGHT_PROGRESSBAR = 7;
|
HEIGHT_PROGRESSBAR = 7;
|
||||||
PROG_BAR_START_Y = 0;
|
PROG_BAR_START_Y = 0;
|
||||||
@@ -4688,7 +4688,7 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
|
|||||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||||
{
|
{
|
||||||
iProgBarLength = 640 - 13;
|
iProgBarLength = 640 - 13;
|
||||||
if (gGameExternalOptions.fSmallSizeProgressbar)
|
if (gGameExternalOptions.fSmallSizeProgressBar)
|
||||||
fn = "INTERFACE\\rect_Thin.sti";
|
fn = "INTERFACE\\rect_Thin.sti";
|
||||||
else
|
else
|
||||||
fn = "INTERFACE\\rect.sti";
|
fn = "INTERFACE\\rect.sti";
|
||||||
@@ -4696,7 +4696,7 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
|
|||||||
else if (iResolution < _1024x768)
|
else if (iResolution < _1024x768)
|
||||||
{
|
{
|
||||||
iProgBarLength = 800 - 13;
|
iProgBarLength = 800 - 13;
|
||||||
if (gGameExternalOptions.fSmallSizeProgressbar)
|
if (gGameExternalOptions.fSmallSizeProgressBar)
|
||||||
fn = "INTERFACE\\rect_800x600Thin.sti";
|
fn = "INTERFACE\\rect_800x600Thin.sti";
|
||||||
else
|
else
|
||||||
fn = "INTERFACE\\rect_800x600.sti";
|
fn = "INTERFACE\\rect_800x600.sti";
|
||||||
@@ -4704,7 +4704,7 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
iProgBarLength = 1024 - 13;
|
iProgBarLength = 1024 - 13;
|
||||||
if (gGameExternalOptions.fSmallSizeProgressbar)
|
if (gGameExternalOptions.fSmallSizeProgressBar)
|
||||||
fn = "INTERFACE\\rect_1024x768Thin.sti";
|
fn = "INTERFACE\\rect_1024x768Thin.sti";
|
||||||
else
|
else
|
||||||
fn = "INTERFACE\\rect_1024x768.sti";
|
fn = "INTERFACE\\rect_1024x768.sti";
|
||||||
@@ -4720,21 +4720,21 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
|
|||||||
|
|
||||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||||
{
|
{
|
||||||
if (gGameExternalOptions.fSmallSizeProgressbar)
|
if (gGameExternalOptions.fSmallSizeProgressBar)
|
||||||
fn = "INTERFACE\\timebargreen_Thin.sti";
|
fn = "INTERFACE\\timebargreen_Thin.sti";
|
||||||
else
|
else
|
||||||
fn = "INTERFACE\\timebargreen.sti";
|
fn = "INTERFACE\\timebargreen.sti";
|
||||||
}
|
}
|
||||||
else if (iResolution < _1024x768)
|
else if (iResolution < _1024x768)
|
||||||
{
|
{
|
||||||
if (gGameExternalOptions.fSmallSizeProgressbar)
|
if (gGameExternalOptions.fSmallSizeProgressBar)
|
||||||
fn = "INTERFACE\\timebargreen_800x600Thin.sti";
|
fn = "INTERFACE\\timebargreen_800x600Thin.sti";
|
||||||
else
|
else
|
||||||
fn = "INTERFACE\\timebargreen_800x600.sti";
|
fn = "INTERFACE\\timebargreen_800x600.sti";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (gGameExternalOptions.fSmallSizeProgressbar)
|
if (gGameExternalOptions.fSmallSizeProgressBar)
|
||||||
fn = "INTERFACE\\timebargreen_1024x768Thin.sti";
|
fn = "INTERFACE\\timebargreen_1024x768Thin.sti";
|
||||||
else
|
else
|
||||||
fn = "INTERFACE\\timebargreen_1024x768.sti";
|
fn = "INTERFACE\\timebargreen_1024x768.sti";
|
||||||
@@ -4749,21 +4749,21 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
|
|||||||
|
|
||||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||||
{
|
{
|
||||||
if (gGameExternalOptions.fSmallSizeProgressbar)
|
if (gGameExternalOptions.fSmallSizeProgressBar)
|
||||||
fn = "INTERFACE\\timebaryellow_Thin.sti";
|
fn = "INTERFACE\\timebaryellow_Thin.sti";
|
||||||
else
|
else
|
||||||
fn = "INTERFACE\\timebaryellow.sti";
|
fn = "INTERFACE\\timebaryellow.sti";
|
||||||
}
|
}
|
||||||
else if (iResolution < _1024x768)
|
else if (iResolution < _1024x768)
|
||||||
{
|
{
|
||||||
if (gGameExternalOptions.fSmallSizeProgressbar)
|
if (gGameExternalOptions.fSmallSizeProgressBar)
|
||||||
fn = "INTERFACE\\timebaryellow_800x600Thin.sti";
|
fn = "INTERFACE\\timebaryellow_800x600Thin.sti";
|
||||||
else
|
else
|
||||||
fn = "INTERFACE\\timebaryellow_800x600.sti";
|
fn = "INTERFACE\\timebaryellow_800x600.sti";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (gGameExternalOptions.fSmallSizeProgressbar)
|
if (gGameExternalOptions.fSmallSizeProgressBar)
|
||||||
fn = "INTERFACE\\timebaryellow_1024x768Thin.sti";
|
fn = "INTERFACE\\timebaryellow_1024x768Thin.sti";
|
||||||
else
|
else
|
||||||
fn = "INTERFACE\\timebaryellow_1024x768.sti";
|
fn = "INTERFACE\\timebaryellow_1024x768.sti";
|
||||||
@@ -4878,7 +4878,7 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
|
|||||||
DeleteVideoObjectFromIndex( uiPLAYERBAR );
|
DeleteVideoObjectFromIndex( uiPLAYERBAR );
|
||||||
|
|
||||||
// Draw text....
|
// Draw text....
|
||||||
if(gGameExternalOptions.fSmallSizeProgressbar)
|
if(gGameExternalOptions.fSmallSizeProgressBar)
|
||||||
FindFontCenterCoordinates( SCREEN_WIDTH/2, 2, 1, 1, psString, TINYFONT1, &sX, &sY );
|
FindFontCenterCoordinates( SCREEN_WIDTH/2, 2, 1, 1, psString, TINYFONT1, &sX, &sY );
|
||||||
else
|
else
|
||||||
FindFontCenterCoordinates( SCREEN_WIDTH/2, 7, 1, 1, psString, TINYFONT1, &sX, &sY );
|
FindFontCenterCoordinates( SCREEN_WIDTH/2, 7, 1, 1, psString, TINYFONT1, &sX, &sY );
|
||||||
@@ -5047,7 +5047,7 @@ void HandleTopMessages( )
|
|||||||
// Redner!
|
// Redner!
|
||||||
BltFx.SrcRect.iLeft = 0;
|
BltFx.SrcRect.iLeft = 0;
|
||||||
//* ddd BltFx.SrcRect.iTop = 20 - gTopMessage.bYPos;
|
//* ddd BltFx.SrcRect.iTop = 20 - gTopMessage.bYPos;
|
||||||
if(gGameExternalOptions.fSmallSizeProgressbar)
|
if(gGameExternalOptions.fSmallSizeProgressBar)
|
||||||
BltFx.SrcRect.iTop = 0;
|
BltFx.SrcRect.iTop = 0;
|
||||||
else
|
else
|
||||||
BltFx.SrcRect.iTop = 20 - gTopMessage.bYPos;
|
BltFx.SrcRect.iTop = 20 - gTopMessage.bYPos;
|
||||||
@@ -5063,7 +5063,7 @@ void HandleTopMessages( )
|
|||||||
// Save to save buffer....
|
// Save to save buffer....
|
||||||
BltFx.SrcRect.iLeft = 0;
|
BltFx.SrcRect.iLeft = 0;
|
||||||
//* ddd BltFx.SrcRect.iTop = 0;
|
//* ddd BltFx.SrcRect.iTop = 0;
|
||||||
if(gGameExternalOptions.fSmallSizeProgressbar)
|
if(gGameExternalOptions.fSmallSizeProgressBar)
|
||||||
BltFx.SrcRect.iTop = 0;
|
BltFx.SrcRect.iTop = 0;
|
||||||
else
|
else
|
||||||
BltFx.SrcRect.iTop = 20 - gTopMessage.bYPos;
|
BltFx.SrcRect.iTop = 20 - gTopMessage.bYPos;
|
||||||
|
|||||||
@@ -4131,3 +4131,22 @@ UINT8 CountSeenEnemiesLastTurn( SOLDIERTYPE* pSoldier )
|
|||||||
|
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOLEAN NorthSpot(INT32 sSpot, INT8 bLevel)
|
||||||
|
{
|
||||||
|
if (TileIsOutOfBounds(sSpot))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (bLevel > 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
INT32 sNextSpot = NewGridNo(sSpot, DirectionInc(NORTHWEST));
|
||||||
|
|
||||||
|
if (gubWorldMovementCosts[sSpot + DirectionInc(NORTHWEST)][NORTHWEST][0] == TRAVELCOST_OFF_MAP ||
|
||||||
|
gubWorldMovementCosts[sNextSpot + DirectionInc(NORTHWEST)][NORTHWEST][0] == TRAVELCOST_OFF_MAP)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1032,6 +1032,12 @@ INT32 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentB
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sevenfm: avoid staying at north edge
|
||||||
|
if (NorthSpot(sGridNo, pSoldier->pathing.bLevel))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
iPathCost = gubAIPathCosts[AI_PATHCOST_RADIUS + sXOffset][AI_PATHCOST_RADIUS + sYOffset];
|
iPathCost = gubAIPathCosts[AI_PATHCOST_RADIUS + sXOffset][AI_PATHCOST_RADIUS + sYOffset];
|
||||||
/*
|
/*
|
||||||
// water is OK, if the only good hiding place requires us to get wet, OK
|
// water is OK, if the only good hiding place requires us to get wet, OK
|
||||||
@@ -1475,6 +1481,13 @@ INT32 FindSpotMaxDistFromOpponents(SOLDIERTYPE *pSoldier)
|
|||||||
if ( InLightAtNight( sGridNo, pSoldier->pathing.bLevel ) )
|
if ( InLightAtNight( sGridNo, pSoldier->pathing.bLevel ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// sevenfm: avoid staying at north edge
|
||||||
|
if (!gGameExternalOptions.fAITacticalRetreat &&
|
||||||
|
NorthSpot(sGridNo, pSoldier->pathing.bLevel))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// OK, this place shows potential. How useful is it as cover?
|
// OK, this place shows potential. How useful is it as cover?
|
||||||
//NumMessage("Promising seems gridno #",gridno);
|
//NumMessage("Promising seems gridno #",gridno);
|
||||||
|
|
||||||
@@ -1615,6 +1628,12 @@ INT32 FindNearestUngassedLand(SOLDIERTYPE *pSoldier)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sevenfm: avoid staying at north edge
|
||||||
|
if (NorthSpot(sGridNo, pSoldier->pathing.bLevel))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// CJC: here, unfortunately, we must calculate a path so we have an AP cost
|
// CJC: here, unfortunately, we must calculate a path so we have an AP cost
|
||||||
|
|
||||||
// obviously, we're looking for LAND, so water is out!
|
// obviously, we're looking for LAND, so water is out!
|
||||||
@@ -1728,6 +1747,12 @@ INT32 FindNearbyDarkerSpot( SOLDIERTYPE *pSoldier )
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sevenfm: avoid staying at north edge
|
||||||
|
if (NorthSpot(sGridNo, pSoldier->pathing.bLevel))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// require this character to stay within their roam range
|
// require this character to stay within their roam range
|
||||||
if ( PythSpacesAway( sOrigin, sGridNo ) > iRoamRange )
|
if ( PythSpacesAway( sOrigin, sGridNo ) > iRoamRange )
|
||||||
{
|
{
|
||||||
@@ -2663,6 +2688,12 @@ INT32 FindFlankingSpot(SOLDIERTYPE *pSoldier, INT32 sPos, INT8 bAction )
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sevenfm: avoid staying at north edge
|
||||||
|
if (NorthSpot(sGridNo, pSoldier->pathing.bLevel))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// sevenfm: penalize locations near fresh corpses
|
// sevenfm: penalize locations near fresh corpses
|
||||||
if( GetNearestRottingCorpseAIWarning( sGridNo ) > 0 )
|
if( GetNearestRottingCorpseAIWarning( sGridNo ) > 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -300,6 +300,8 @@ BOOLEAN FindBombNearby( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 ubDistance )
|
|||||||
BOOLEAN AnyCoverFromSpot( INT32 sSpot, INT8 bLevel, INT32 sThreatLoc, INT8 bThreatLevel );
|
BOOLEAN AnyCoverFromSpot( INT32 sSpot, INT8 bLevel, INT32 sThreatLoc, INT8 bThreatLevel );
|
||||||
UINT8 CountSeenEnemiesLastTurn( SOLDIERTYPE *pSoldier );
|
UINT8 CountSeenEnemiesLastTurn( SOLDIERTYPE *pSoldier );
|
||||||
|
|
||||||
|
BOOLEAN NorthSpot(INT32 sSpot, INT8 bLevel);
|
||||||
|
|
||||||
#define MAX_FLANKS_RED 25
|
#define MAX_FLANKS_RED 25
|
||||||
#define MAX_FLANKS_YELLOW 25
|
#define MAX_FLANKS_YELLOW 25
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user