Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static function bool CanAddItemToInventory_CH(out int bCanAddItem, const EInventorySlot Slot, const X2ItemTemplate ItemTemplate, int Quantity, XComGameState_Unit UnitState, optional XComGameState CheckGameState, optional out string DisabledReason)
- {
- // do the filtering only if trying to...
- if(UnitState.GetSoldierClassTemplateName() == 'YourMedicClassName' && // equip something on your medic class
- Slot == eInvSlot_Utility) // into the utility slot
- {
- if (ItemTemplate.DataName == 'SmokeGrenade' || ItemTemplate.DataName == 'MedKit')
- {
- return true; // smoke grenades and med kits can be equipped
- }
- else
- {
- // if we're trying to equip something other than a med kit or a smoke grenade
- // we build a message that will be shown to the player stating that this item is not available to your medic class
- LocTag = XGParamTag(`XEXPANDCONTEXT.FindTag("XGParam"));
- LocTag.StrValue0 = class'X2SoldierClassTemplateManager'.static.GetSoldierClassTemplateManager().FindSoldierClassTemplate('YourMedicClassName').DisplayName;
- DisabledReason = class'UIUtilities_Text'.static.CapsCheckForGermanScharfesS(`XEXPAND.ExpandString(class'UIArmory_Loadout'.default.m_strNeedsSoldierClass));
- return false; // and disallow equipping the item
- }
- }
- // in all other cases don't do any filtering.
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement