New option BOBBY_RAY_TOOLTIPS_SHOW_LBE_DETAILS.
Stop Speck from spamming your email when multiple new mercs are available on the same day.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8926 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2021-02-01 08:25:59 +00:00
parent f8768a557d
commit 0abc2bf31f
14 changed files with 325 additions and 16 deletions
+2 -4
View File
@@ -1975,16 +1975,14 @@ void LoadGameExternalOptions()
// HEADROCK HAM 3: If enabled, tooltipping over Bobby Ray's weapons will show a list of possible attachments to those weapons.
gGameExternalOptions.fBobbyRayTooltipsShowAttachments = iniReader.ReadBoolean("Bobby Ray Settings","BOBBY_RAY_TOOLTIPS_SHOW_POSSIBLE_ATTACHMENTS", FALSE);
//JMich - Maximum Purchase Amount for Bobby Ray
gGameExternalOptions.ubBobbyRayMaxPurchaseAmount = iniReader.ReadInteger("Bobby Ray Settings", "BOBBY_RAY_MAX_PURCHASE_AMOUNT", 10, 10, 100);
// WDS - Option to turn off stealing
gGameExternalOptions.fStealingDisabled = iniReader.ReadBoolean("Bobby Ray Settings","STEALING_FROM_SHIPMENTS_DISABLED",FALSE);
// WANNE - Chance of shipment lost
gGameExternalOptions.gubChanceOfShipmentLost = iniReader.ReadInteger("Bobby Ray Settings","CHANCE_OF_SHIPMENT_LOSS", 10, 0, 100);
// HEADROCK HAM 3: If enabled, tooltipping over Bobby Ray's weapons will show a list of possible attachments to those weapons.
gGameExternalOptions.fBobbyRayTooltipsShowLBEDetails = iniReader.ReadBoolean("Bobby Ray Settings", "BOBBY_RAY_TOOLTIPS_SHOW_LBE_DETAILS", FALSE);
//################# Item Property Settings ##################
+3
View File
@@ -1142,6 +1142,9 @@ typedef struct
// HEADROCK HAM 3: If enabled, tooltipping over Bobby Ray's weapons will show a list of possible attachments to those weapons.
BOOLEAN fBobbyRayTooltipsShowAttachments;
// sevenfm: show LBE details in tooltip
BOOLEAN fBobbyRayTooltipsShowLBEDetails;
//JMich Externalized gGameExternalOptions.ubBobbyRayMaxPurchaseAmount for BobbyRay
UINT8 ubBobbyRayMaxPurchaseAmount;
+132
View File
@@ -4329,6 +4329,138 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
}
break;
// rftr: better LBE tooltips
case IC_LBEGEAR:
if(gGameExternalOptions.fBobbyRayTooltipsShowLBEDetails)
{
CHAR16 lbeStr[1000];
CHAR16 temp[1000];
swprintf(lbeStr, L"");
swprintf(temp, L"");
if (UsingNewInventorySystem())
{
INVTYPE item = Item[usItemNumber];
LBETYPE lbe = LoadBearingEquipment[item.ubClassIndex];
if (lbe.lbeAvailableVolume > 0) // if this item is a MOLLE carrier (thigh rig, vest, combat pack, backpack)
{
swprintf(temp, L"\n \n%s\n%s %d", gLbeStatsDesc[6 + lbe.lbeClass], gLbeStatsDesc[0], lbe.lbeAvailableVolume);
wcscat(lbeStr, temp);
UINT8 molleSmallCount = 0;
UINT8 molleMediumCount = 0;
for (UINT32 sCount = 1; sCount < gMAXITEMS_READ; ++sCount)
{
AttachmentSlotStruct attachmentSlot = AttachmentSlots[sCount];
if (attachmentSlot.uiSlotIndex == 0)
break;
// count MOLLE slots for this carrier
if (attachmentSlot.nasLayoutClass == ((UINT64)1 << (lbe.lbeClass + 1)))
{
if (lbe.lbePocketsAvailable & (1 << (attachmentSlot.ubPocketMapping - 1)))
{
// seems to be equivalent to checking attachmentSlot.fBigSlot
if (attachmentSlot.nasAttachmentClass == MOLLE_SMALL)
{
molleSmallCount++;
}
else if (attachmentSlot.nasAttachmentClass == MOLLE_MEDIUM)
{
molleMediumCount++;
}
}
}
}
if (molleSmallCount > 0)
{
swprintf(temp, L"\n%s %d", gLbeStatsDesc[2], molleSmallCount);
wcscat(lbeStr, temp);
}
if (molleMediumCount > 0)
{
swprintf(temp, L"\n%s %d", gLbeStatsDesc[3], molleMediumCount);
wcscat(lbeStr, temp);
}
}
else if (item.nasAttachmentClass == MOLLE_SMALL)
{
swprintf(temp, L"\n \n%s\n%s\n%s %d", gLbeStatsDesc[11], gLbeStatsDesc[4], gLbeStatsDesc[1], LBEPocketType[GetFirstPocketOnItem(usItemNumber)].pVolume);
wcscat(lbeStr, temp);
}
else if (item.nasAttachmentClass == MOLLE_MEDIUM)
{
// special case for hydration pack (see AttachmentPoint.xml)
swprintf(temp, L"\n \n%s\n%s\n%s %d", gLbeStatsDesc[11], item.ulAttachmentPoint == 4 ? gLbeStatsDesc[6] : gLbeStatsDesc[5], gLbeStatsDesc[1], LBEPocketType[GetFirstPocketOnItem(usItemNumber)].pVolume);
wcscat(lbeStr, temp);
}
else // non-MOLLE LBE
{
swprintf(temp, L"\n \n%s", gLbeStatsDesc[6 + lbe.lbeClass]);
wcscat(lbeStr, temp);
}
// check for combat pack/backpack combos
if (lbe.lbeCombo > 0)
{
bool foundCombo = false;
CHAR16 lbeComboStr[1000];
swprintf(lbeComboStr, L"");
for (UINT32 itemIndex = 0; itemIndex < gMAXITEMS_READ; ++itemIndex)
{
INVTYPE otherItem = Item[itemIndex];
if (otherItem.usItemClass != IC_LBEGEAR)
continue;
if (itemIndex == usItemNumber)
continue;
LBETYPE otherLbe = LoadBearingEquipment[otherItem.ubClassIndex];
if (lbe.lbeClass == otherLbe.lbeClass)
continue;
if (lbe.lbeCombo == otherLbe.lbeCombo)
{
foundCombo = true;
if (wcslen(lbeComboStr) + wcslen(otherItem.szBRName) < 800)
{
swprintf(temp, L"\n%s", otherItem.szBRName);
wcscat(lbeComboStr, temp);
}
else
{
wcscat(lbeComboStr, L"\n...");
break;
}
}
}
if (foundCombo)
{
// only combat packs and backpacks will have lbeCombo
swprintf(temp, L"\n \n%s\n%s", gLbeStatsDesc[lbe.lbeClass == COMBAT_PACK ? 12 : 13], lbeComboStr);
wcscat(lbeStr, temp);
}
}
}
swprintf(pzStr, L"%s\n%s %1.1f %s%s",
ItemNames[usItemNumber], //Item long name
gWeaponStatsDesc[12], //Weight String
fWeight, //Weight
GetWeightUnitString(), //Weight units
lbeStr
);
}
break;
case IC_MISC:
case IC_MEDKIT:
case IC_KIT:
+23 -12
View File
@@ -3172,25 +3172,28 @@ BOOLEAN CanMercBeAvailableYet( UINT8 ubMercToCheck )
return( FALSE );
}
void NewMercsAvailableAtMercSiteCallBack( )
void NewMercsAvailableAtMercSiteCallBack()
{
for(UINT8 i=0; i<NUM_PROFILES; i++)
{
if ( gConditionsForMercAvailability[i].ProfilId != 0 && gConditionsForMercAvailability[i].NewMercsAvailable == FALSE && gConditionsForMercAvailability[i].StartMercsAvailable == FALSE )
// rftr: don't spam the user's email when MERC has multiple new personnel available on the same day
bool sentNewMercsEmail = false;
for (UINT8 i = 0; i < NUM_PROFILES; i++)
{
if (gConditionsForMercAvailability[i].ProfilId != 0 && gConditionsForMercAvailability[i].NewMercsAvailable == FALSE && gConditionsForMercAvailability[i].StartMercsAvailable == FALSE)
{
if( CanMercBeAvailableYet( gConditionsForMercAvailability[i].uiIndex ) )
if (CanMercBeAvailableYet(gConditionsForMercAvailability[i].uiIndex))
{
gConditionsForMercAvailability[i].NewMercsAvailable = TRUE;
//if ( gConditionsForMercAvailability[ gConditionsForMercAvailability[i].uiIndex ].Drunk == TRUE )
if ( gConditionsForMercAvailability[i].Drunk == TRUE )
if (gConditionsForMercAvailability[i].Drunk == TRUE)
{
LaptopSaveInfo.gubLastMercIndex = gConditionsForMercAvailability[gConditionsForMercAvailability[i].uiAlternateIndex].uiIndex;
}
else
{
// If Previous merc has alternate index
if (i > 0 && gConditionsForMercAvailability[ gConditionsForMercAvailability[i - 1].uiIndex ].uiAlternateIndex != 255)
if (i > 0 && gConditionsForMercAvailability[gConditionsForMercAvailability[i - 1].uiIndex].uiAlternateIndex != 255)
{
// Previous merc has alternate (drunk) merc, skip his one!
//LaptopSaveInfo.gubLastMercIndex = LaptopSaveInfo.gubLastMercIndex + 2;
@@ -3205,14 +3208,22 @@ void NewMercsAvailableAtMercSiteCallBack( )
gConditionsForMercAvailability[i].StartMercsAvailable = TRUE;
#ifdef JA2UB
AddEmail( NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
if (!sentNewMercsEmail)
{
sentNewMercsEmail = true;
AddEmail(NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
}
//new mercs are available
LaptopSaveInfo.fNewMercsAvailableAtMercSite = TRUE;
#else
if( IsSpeckComAvailable() )
if (IsSpeckComAvailable())
{
AddEmail( NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
if (!sentNewMercsEmail)
{
sentNewMercsEmail = true;
AddEmail(NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
}
//new mercs are available
LaptopSaveInfo.fNewMercsAvailableAtMercSite = TRUE;
@@ -3220,7 +3231,7 @@ void NewMercsAvailableAtMercSiteCallBack( )
else
{
// anv: Have speck inform player personally
TacticalCharacterDialogue( FindSoldierByProfileID( SPECK_PLAYABLE, TRUE ), SPECK_PLAYABLE_QUOTE_NEW_MERCS_AVAILABLE );
TacticalCharacterDialogue(FindSoldierByProfileID(SPECK_PLAYABLE, TRUE), SPECK_PLAYABLE_QUOTE_NEW_MERCS_AVAILABLE);
}
#endif
}
+4
View File
@@ -1937,4 +1937,8 @@ enum
extern IMP_ITEM_CHOICE_TYPE gIMPItemChoices[MAX_IMP_ITEM_TYPES];
// rftr: better LBE tooltips. see NasAttachmentClass.xml
#define MOLLE_SMALL 4096
#define MOLLE_MEDIUM 8192
#endif
+3
View File
@@ -2619,6 +2619,9 @@ enum
};
extern STR16 gszPocketPopupText[];
// rftr: better LBE tooltips
extern STR16 gLbeStatsDesc[14];
// Flugente: backgrounds
extern STR16 szBackgroundText_Flags[];
extern STR16 szBackgroundText_Value[];
+20
View File
@@ -11628,6 +11628,26 @@ STR16 szTurncoatText[] =
L"%d 变节者出现了", //L"%d turncoats present",
};
// rftr: better lbe tooltips
// TODO.Translate
STR16 gLbeStatsDesc[14] =
{
L"MOLLE Space Available:",
L"MOLLE Space Required:",
L"MOLLE Small Slot Count:",
L"MOLLE Medium Slot Count:",
L"MOLLE Pouch Size: Small",
L"MOLLE Pouch Size: Medium",
L"MOLLE Pouch Size: Medium (Hydration)",
L"Thigh Rig",
L"Vest",
L"Combat Pack",
L"Backpack", // 10
L"MOLLE Pouch",
L"Compatible backpacks:",
L"Compatible combat packs:",
};
// WANNE: Some Chinese specific strings that needs to be in unicode!
STR16 ChineseSpecString1 = L"%"; //defined in _ChineseText.cpp as this file is already unicode
STR16 ChineseSpecString2 = L"*%3d%%%"; //defined in _ChineseText.cpp as this file is already unicode
+20
View File
@@ -11644,4 +11644,24 @@ STR16 szTurncoatText[] =
L"%d turncoats present",
};
// rftr: better lbe tooltips
// TODO.Translate
STR16 gLbeStatsDesc[14] =
{
L"MOLLE Space Available:",
L"MOLLE Space Required:",
L"MOLLE Small Slot Count:",
L"MOLLE Medium Slot Count:",
L"MOLLE Pouch Size: Small",
L"MOLLE Pouch Size: Medium",
L"MOLLE Pouch Size: Medium (Hydration)",
L"Thigh Rig",
L"Vest",
L"Combat Pack",
L"Backpack", // 10
L"MOLLE Pouch",
L"Compatible backpacks:",
L"Compatible combat packs:",
};
#endif //DUTCH
+19
View File
@@ -11643,4 +11643,23 @@ STR16 szTurncoatText[] =
L"%d turncoats present",
};
// rftr: better lbe tooltips
STR16 gLbeStatsDesc[14] =
{
L"MOLLE Space Available:",
L"MOLLE Space Required:",
L"MOLLE Small Slot Count:",
L"MOLLE Medium Slot Count:",
L"MOLLE Pouch Size: Small",
L"MOLLE Pouch Size: Medium",
L"MOLLE Pouch Size: Medium (Hydration)",
L"Thigh Rig",
L"Vest",
L"Combat Pack",
L"Backpack", // 10
L"MOLLE Pouch",
L"Compatible backpacks:",
L"Compatible combat packs:",
};
#endif //ENGLISH
+20
View File
@@ -11626,4 +11626,24 @@ STR16 szTurncoatText[] =
L"%d turncoats present",
};
// rftr: better lbe tooltips
// TODO.Translate
STR16 gLbeStatsDesc[14] =
{
L"MOLLE Space Available:",
L"MOLLE Space Required:",
L"MOLLE Small Slot Count:",
L"MOLLE Medium Slot Count:",
L"MOLLE Pouch Size: Small",
L"MOLLE Pouch Size: Medium",
L"MOLLE Pouch Size: Medium (Hydration)",
L"Thigh Rig",
L"Vest",
L"Combat Pack",
L"Backpack", // 10
L"MOLLE Pouch",
L"Compatible backpacks:",
L"Compatible combat packs:",
};
#endif //FRENCH
+20
View File
@@ -11548,4 +11548,24 @@ STR16 szTurncoatText[] =
L"%d turncoats present",
};
// rftr: better lbe tooltips
// TODO.Translate
STR16 gLbeStatsDesc[14] =
{
L"MOLLE Space Available:",
L"MOLLE Space Required:",
L"MOLLE Small Slot Count:",
L"MOLLE Medium Slot Count:",
L"MOLLE Pouch Size: Small",
L"MOLLE Pouch Size: Medium",
L"MOLLE Pouch Size: Medium (Hydration)",
L"Thigh Rig",
L"Vest",
L"Combat Pack",
L"Backpack", // 10
L"MOLLE Pouch",
L"Compatible backpacks:",
L"Compatible combat packs:",
};
#endif //GERMAN
+20
View File
@@ -11635,4 +11635,24 @@ STR16 szTurncoatText[] =
L"%d turncoats present",
};
// rftr: better lbe tooltips
// TODO.Translate
STR16 gLbeStatsDesc[14] =
{
L"MOLLE Space Available:",
L"MOLLE Space Required:",
L"MOLLE Small Slot Count:",
L"MOLLE Medium Slot Count:",
L"MOLLE Pouch Size: Small",
L"MOLLE Pouch Size: Medium",
L"MOLLE Pouch Size: Medium (Hydration)",
L"Thigh Rig",
L"Vest",
L"Combat Pack",
L"Backpack", // 10
L"MOLLE Pouch",
L"Compatible backpacks:",
L"Compatible combat packs:",
};
#endif //ITALIAN
+20
View File
@@ -11648,4 +11648,24 @@ STR16 szTurncoatText[] =
L"%d turncoats present",
};
// rftr: better lbe tooltips
// TODO.Translate
STR16 gLbeStatsDesc[14] =
{
L"MOLLE Space Available:",
L"MOLLE Space Required:",
L"MOLLE Small Slot Count:",
L"MOLLE Medium Slot Count:",
L"MOLLE Pouch Size: Small",
L"MOLLE Pouch Size: Medium",
L"MOLLE Pouch Size: Medium (Hydration)",
L"Thigh Rig",
L"Vest",
L"Combat Pack",
L"Backpack", // 10
L"MOLLE Pouch",
L"Compatible backpacks:",
L"Compatible combat packs:",
};
#endif //POLISH
+19
View File
@@ -11628,4 +11628,23 @@ STR16 szTurncoatText[] =
L"%d turncoats present",
};
// rftr: better lbe tooltips
STR16 gLbeStatsDesc[14] =
{
L"MOLLE Доступный объем:",
L"MOLLE Требуемый объем:",
L"MOLLE Маленьких слотов:",
L"MOLLE Средних слотов:",
L"MOLLE Маленький",
L"MOLLE Средний",
L"MOLLE Средний (питьевая система)",
L"Набедренная платформа",
L"Жилет",
L"Ранец",
L"Рюкзак", // 10
L"MOLLE Карман",
L"Совместимые рюкзаки:",
L"Совместимые ранцы:",
};
#endif //RUSSIAN