mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
- Added Ultra Dynamic Tooltips by Telpscorei (to see the changes, search the code for //SCORE)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2896 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -639,6 +639,10 @@ void LoadGameExternalOptions()
|
|||||||
|
|
||||||
// Soldier tool tips
|
// Soldier tool tips
|
||||||
gGameExternalOptions.gfAllowSoldierToolTips = iniReader.ReadBoolean("JA2 Tactical Settings","ALLOW_SOLDIER_TOOL_TIPS",0);
|
gGameExternalOptions.gfAllowSoldierToolTips = iniReader.ReadBoolean("JA2 Tactical Settings","ALLOW_SOLDIER_TOOL_TIPS",0);
|
||||||
|
//SCORE: Settings for UDT
|
||||||
|
gGameExternalOptions.gfAllowUDTRange = iniReader.ReadBoolean("JA2 Tactical Settings","ALLOW_UDT_RANGE",0);
|
||||||
|
gGameExternalOptions.gfAllowUDTDetail = iniReader.ReadBoolean("JA2 Tactical Settings","ALLOW_UDT_DETAIL",0);
|
||||||
|
gGameExternalOptions.ubUDTModifier = (UINT8) iniReader.ReadInteger("JA2 Tactical Settings", "UDT_MODIFIER", 50);
|
||||||
|
|
||||||
// ShadoWarrior: Tooltip changes (start)
|
// ShadoWarrior: Tooltip changes (start)
|
||||||
gGameExternalOptions.ubSoldierTooltipDetailLevel = (UINT8) iniReader.ReadInteger("JA2 Tactical Settings", "SOLDIER_TOOLTIP_DETAIL_LEVEL", 1, 0, 4);
|
gGameExternalOptions.ubSoldierTooltipDetailLevel = (UINT8) iniReader.ReadInteger("JA2 Tactical Settings", "SOLDIER_TOOLTIP_DETAIL_LEVEL", 1, 0, 4);
|
||||||
|
|||||||
@@ -464,6 +464,10 @@ typedef struct
|
|||||||
BOOLEAN fEnableSoldierTooltipBigSlot6;
|
BOOLEAN fEnableSoldierTooltipBigSlot6;
|
||||||
BOOLEAN fEnableSoldierTooltipBigSlot7;
|
BOOLEAN fEnableSoldierTooltipBigSlot7;
|
||||||
// ShadoWarrior: Tooltip changes (end)
|
// ShadoWarrior: Tooltip changes (end)
|
||||||
|
//SCORE: UDT related
|
||||||
|
BOOLEAN gfAllowUDTRange;
|
||||||
|
BOOLEAN gfAllowUDTDetail;
|
||||||
|
INT8 ubUDTModifier;
|
||||||
|
|
||||||
//Kaiden MERC Deaths Externalized:
|
//Kaiden MERC Deaths Externalized:
|
||||||
BOOLEAN gfMercsDieOnAssignment;
|
BOOLEAN gfMercsDieOnAssignment;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include "local.h"
|
#include "local.h"
|
||||||
#include "vsurface.h"
|
#include "vsurface.h"
|
||||||
#include "line.h"
|
#include "line.h"
|
||||||
|
#include "los.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//forward declarations of common classes to eliminate includes
|
//forward declarations of common classes to eliminate includes
|
||||||
@@ -88,7 +89,14 @@ void SoldierTooltip( SOLDIERTYPE* pSoldier )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( gGameExternalOptions.fEnableDynamicSoldierTooltips )
|
// SCORE: If UDT range, we work it out as half actual LOS
|
||||||
|
if ( gGameExternalOptions.gfAllowUDTRange )
|
||||||
|
{
|
||||||
|
uiMaxTooltipDistance = (UINT32)( MercPtrs[ gusSelectedSoldier ]->GetMaxDistanceVisible(MercPtrs[ gusUIFullTargetID ]->sGridNo, 0, CALC_FROM_WANTED_DIR) * (gGameExternalOptions.ubUDTModifier));
|
||||||
|
uiMaxTooltipDistance /= 100;
|
||||||
|
}
|
||||||
|
//SCORE: Otherwise if we're using dynamics then do this
|
||||||
|
else if ( gGameExternalOptions.fEnableDynamicSoldierTooltips )
|
||||||
{
|
{
|
||||||
OBJECTTYPE* pObject = &(MercPtrs[gusSelectedSoldier]->inv[HANDPOS]);
|
OBJECTTYPE* pObject = &(MercPtrs[gusSelectedSoldier]->inv[HANDPOS]);
|
||||||
for (attachmentList::iterator iter = (*pObject)[0]->attachments.begin(); iter != (*pObject)[0]->attachments.end(); ++iter) {
|
for (attachmentList::iterator iter = (*pObject)[0]->attachments.begin(); iter != (*pObject)[0]->attachments.end(); ++iter) {
|
||||||
@@ -104,8 +112,13 @@ void SoldierTooltip( SOLDIERTYPE* pSoldier )
|
|||||||
// set detail level to (at least) Full
|
// set detail level to (at least) Full
|
||||||
ubTooltipDetailLevel = MAX(DL_Full,ubTooltipDetailLevel);
|
ubTooltipDetailLevel = MAX(DL_Full,ubTooltipDetailLevel);
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
//SCORE: removed to enable scopes to affect range of tooltips.
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
//If we're using original settings and no scope, we do this
|
||||||
|
if (gGameExternalOptions.fEnableDynamicSoldierTooltips && fMercIsUsingScope == 0 && !gGameExternalOptions.gfAllowUDTRange)
|
||||||
|
{
|
||||||
// add 10% to max tooltip viewing distance per level of the merc
|
// add 10% to max tooltip viewing distance per level of the merc
|
||||||
uiMaxTooltipDistance *= 1 + (MercPtrs[ gusSelectedSoldier ]->stats.bExpLevel / 10);
|
uiMaxTooltipDistance *= 1 + (MercPtrs[ gusSelectedSoldier ]->stats.bExpLevel / 10);
|
||||||
|
|
||||||
@@ -119,7 +132,31 @@ void SoldierTooltip( SOLDIERTYPE* pSoldier )
|
|||||||
// if night reduce max tooltip viewing distance by a factor of 4 if merc is not wearing NVG
|
// if night reduce max tooltip viewing distance by a factor of 4 if merc is not wearing NVG
|
||||||
uiMaxTooltipDistance >>= 2;
|
uiMaxTooltipDistance >>= 2;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
//SCORE: Dynamic detail, otherwise do what we usually do
|
||||||
|
if ( gGameExternalOptions.gfAllowUDTDetail )
|
||||||
|
{
|
||||||
|
//Check range. Less than a third? Full. Less than 2 thirds? Basic. Otherwise Limited.
|
||||||
|
if ( iRangeToTarget <= (INT32)(uiMaxTooltipDistance / 3) )
|
||||||
|
{
|
||||||
|
ubTooltipDetailLevel = DL_Full;
|
||||||
|
}
|
||||||
|
else if ( iRangeToTarget <= (INT32)((uiMaxTooltipDistance / 3)*2) )
|
||||||
|
{
|
||||||
|
ubTooltipDetailLevel = DL_Basic;
|
||||||
|
}
|
||||||
|
else if ( iRangeToTarget <= (INT32)uiMaxTooltipDistance )
|
||||||
|
{
|
||||||
|
ubTooltipDetailLevel = DL_Limited;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if ( iRangeToTarget <= (INT32)(uiMaxTooltipDistance / 2) )
|
if ( iRangeToTarget <= (INT32)(uiMaxTooltipDistance / 2) )
|
||||||
{
|
{
|
||||||
// at under half the maximum view distance set tooltip detail to (at least) Basic
|
// at under half the maximum view distance set tooltip detail to (at least) Basic
|
||||||
@@ -136,8 +173,10 @@ void SoldierTooltip( SOLDIERTYPE* pSoldier )
|
|||||||
if ( ubTooltipDetailLevel < DL_Full )
|
if ( ubTooltipDetailLevel < DL_Full )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} // fMercIsUsingScope is false
|
}
|
||||||
} // gGameExternalOptions.fEnableDynamicSoldierTooltips
|
//} // fMercIsUsingScope is false
|
||||||
|
// gGameExternalOptions.fEnableDynamicSoldierTooltips
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// WANNE: Check if enemy soldier is in line of sight but only if player has not choosen debug details
|
// WANNE: Check if enemy soldier is in line of sight but only if player has not choosen debug details
|
||||||
|
|||||||
Reference in New Issue
Block a user