diff --git a/GameSettings.cpp b/GameSettings.cpp index 6a0e50ae..91ffc4ab 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -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 ################## diff --git a/GameSettings.h b/GameSettings.h index b7b50440..caa0b6ef 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -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; diff --git a/Laptop/BobbyRGuns.cpp b/Laptop/BobbyRGuns.cpp index 5983fbb2..2e6557db 100644 --- a/Laptop/BobbyRGuns.cpp +++ b/Laptop/BobbyRGuns.cpp @@ -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: diff --git a/Laptop/mercs.cpp b/Laptop/mercs.cpp index 899ffe02..c05fc362 100644 --- a/Laptop/mercs.cpp +++ b/Laptop/mercs.cpp @@ -3172,25 +3172,28 @@ BOOLEAN CanMercBeAvailableYet( UINT8 ubMercToCheck ) return( FALSE ); } -void NewMercsAvailableAtMercSiteCallBack( ) +void NewMercsAvailableAtMercSiteCallBack() { - for(UINT8 i=0; 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 } diff --git a/Tactical/Item Types.h b/Tactical/Item Types.h index 94783116..dfe3bd19 100644 --- a/Tactical/Item Types.h +++ b/Tactical/Item Types.h @@ -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 diff --git a/Utils/Text.h b/Utils/Text.h index 4a9755b4..c317ad6f 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -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[]; diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp index bf3193cd..8e4e52a9 100644 --- a/Utils/_ChineseText.cpp +++ b/Utils/_ChineseText.cpp @@ -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 diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index d5c31dd0..742cb46b 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -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 diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index e4ad0dbe..6f5b3f81 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -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 diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 7088dc76..16661bf9 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -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 diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index 63b9fb2a..41c5490d 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -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 diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index 72566686..61ab06cc 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -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 diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index 22cd75d1..7049a1ae 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -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 diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index 69f700f5..985a1e4a 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -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