- 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:
Wanne
2009-05-27 12:43:45 +00:00
parent 128e7e7647
commit 6bf05babcb
3 changed files with 52 additions and 5 deletions
+4
View File
@@ -639,6 +639,10 @@ void LoadGameExternalOptions()
// Soldier tool tips
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)
gGameExternalOptions.ubSoldierTooltipDetailLevel = (UINT8) iniReader.ReadInteger("JA2 Tactical Settings", "SOLDIER_TOOLTIP_DETAIL_LEVEL", 1, 0, 4);
+4
View File
@@ -464,6 +464,10 @@ typedef struct
BOOLEAN fEnableSoldierTooltipBigSlot6;
BOOLEAN fEnableSoldierTooltipBigSlot7;
// ShadoWarrior: Tooltip changes (end)
//SCORE: UDT related
BOOLEAN gfAllowUDTRange;
BOOLEAN gfAllowUDTDetail;
INT8 ubUDTModifier;
//Kaiden MERC Deaths Externalized:
BOOLEAN gfMercsDieOnAssignment;
+44 -5
View File
@@ -20,6 +20,7 @@
#include "local.h"
#include "vsurface.h"
#include "line.h"
#include "los.h"
#endif
//forward declarations of common classes to eliminate includes
@@ -88,7 +89,14 @@ void SoldierTooltip( SOLDIERTYPE* pSoldier )
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]);
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
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
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
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) )
{
// 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 )
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