4 static const string SLOT_LAYOUT_SUPPLY =
"{AF25F325D2730142}UI/layouts/Menus/Inventory/SupplyInventoryItemSlot.layout";
48 string slotLayout = SLOT_LAYOUT_SUPPLY;
80 super.SetSlotVisible(bVisible);
91 resourceStored.SetVisible(
false);
95 if (resourceAvailable)
96 resourceAvailable.SetVisible(
false);
106 SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.FindResourceComponent(
m_pItem.GetOwner());
109 if (resourceComponent)
110 resourceContainer = resourceComponent.GetContainer(
EResourceType.SUPPLIES);
147 rankIcon.SetVisible(
false);
154 if (rankIconImageSet.IsEmpty())
163 rankIcon.SetVisible(
true);
177 rankIcon.LoadImageFromSet(0, rankIconImageSet, rank.
GetRankInsignia());
189 PlayerController playerController =
GetGame().GetPlayerController();
190 if (!playerController)
193 SCR_PlayerSupplyAllocationComponent playerSupplyAllocationComponent = SCR_PlayerSupplyAllocationComponent.Cast(playerController.FindComponent(SCR_PlayerSupplyAllocationComponent));
194 if (!playerSupplyAllocationComponent)
197 int msarBalance = playerSupplyAllocationComponent.GetPlayerAvailableAllocatedSupplies() - cost;
209 SCR_ArsenalManagerComponent arsenalManagerComponent;
210 SCR_ArsenalManagerComponent.GetArsenalManager(arsenalManagerComponent);
211 if (!arsenalManagerComponent || !arsenalManagerComponent.IsMilitarySupplyAllocationEnabled())
223 if (!arsenalComponent)
233 return arsenalManagerComponent.GetItemMilitarySupplyAllocationCost(
resourceName, arsenalComponent,
true);
242 if (totalResources < 0)
302 SCR_EntityCatalogManagerComponent entityCatalogManager = SCR_EntityCatalogManagerComponent.GetInstance();
303 if (!entityCatalogManager)
307 if (arsenalComponent)
314 entry = entityCatalogManager.GetEntryWithPrefabFromFactionCatalog(
EEntityCatalogType.ITEM, resource.GetResource().GetResourceName(), faction);
316 entry = entityCatalogManager.GetEntryWithPrefabFromCatalog(
EEntityCatalogType.ITEM, resource.GetResource().GetResourceName());
325 if (arsenalComponent)
371 SCR_ArsenalManagerComponent arsenalManager;
372 if (!SCR_ArsenalManagerComponent.GetArsenalManager(arsenalManager) || !arsenalManager.AreItemsRankLocked())
376 SCR_EntityCatalogManagerComponent entityCatalogManager = SCR_EntityCatalogManagerComponent.GetInstance();
377 if (!entityCatalogManager)
384 if (arsenalComponent)
388 if (!resource.IsValid())
393 entry = entityCatalogManager.GetEntryWithPrefabFromFactionCatalog(
EEntityCatalogType.ITEM, resource.GetResource().GetResourceName(), faction);
395 entry = entityCatalogManager.GetEntryWithPrefabFromAnyCatalog(
EEntityCatalogType.ITEM, resource.GetResource().GetResourceName());
425 PlayerController playerController =
GetGame().GetPlayerController();
426 if (!playerController)
429 SCR_PlayerSupplyAllocationComponent playerSupplyAllocationComponent = SCR_PlayerSupplyAllocationComponent.Cast(playerController.FindComponent(SCR_PlayerSupplyAllocationComponent));
430 if (!playerSupplyAllocationComponent)
441 PlayerController playerController =
GetGame().GetPlayerController();
442 if (!playerController)
445 SCR_PlayerSupplyAllocationComponent playerSupplyAllocationComponent = SCR_PlayerSupplyAllocationComponent.Cast(playerController.FindComponent(SCR_PlayerSupplyAllocationComponent));
446 if (!playerSupplyAllocationComponent)
ArmaReforgerScripted GetGame()
ResourceName resourceName
void SCR_CharacterRankComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Get all prefabs that have the spawner data
proto external Managed FindComponent(typename typeName)
Object holding reference to resource. In destructor release the resource.
SCR_Faction GetAssignedFaction()
bool IsArsenalUsingSupplies()
SCR_EArsenalSupplyCostType GetSupplyCostType()
override void SetSlotVisible(bool bVisible)
void UpdateTotalResources(float totalResources)
TextWidget m_CostResourceHolderText
override bool IsDraggable()
SCR_ECharacterRank m_eRequiredRank
void SCR_ArsenalInventorySlotUI(InventoryItemComponent pComponent=null, SCR_InventoryStorageBaseUI pStorageUI=null, bool bVisible=true, int iSlotIndex=-1, SCR_ItemAttributeCollection pAttributes=null)
const string STORED_RESOURCES_WIDGET_NAME
const string RANK_ICON_WIDGET_NAME
void SetStorageUI(SCR_InventoryStorageBaseUI storageUI)
int GetPersonalResourceCost()
void CheckPersonalResources(int cost)
float GetTotalResources()
SCR_ResourceComponent GetArsenalResourceComponent()
Widget m_wResourceDisplay
const string RESOURCES_TEXT_WIDGET_NAME
Widget m_CostResourceHolder
float GetItemSupplyCost()
const string AMMOTYPE_WIDGET_NAME
void SetItemAvailability(bool isAvailable)
void OnPlayerSupplyAllocationChanged(int amount)
void SetArsenalResourceComponent(SCR_ResourceComponent component)
SCR_ECharacterRank GetRequiredRank()
SCR_ResourceContainer m_ResourceContainer
SCR_ResourceComponent m_ArsenalResourceComponent
const string AVAILABLE_RESOURCES_WIDGET_NAME
const string COST_RESOURCES_WIDGET_NAME
const string MSAR_ICON_WIDGET_NAME
TextWidget m_wResourceText
void ~SCR_ArsenalInventorySlotUI()
Get prefab entity Data of type Ignores disabled Data s param dataType class of Data type you with to obtain return Entity Data of given type Null if not found *SCR_BaseEntityCatalogData GetEntityDataOfType(typename dataType)
SCR_RankContainer GetRanks()
void SCR_InventorySlotUI(InventoryItemComponent pComponent=null, SCR_InventoryStorageBaseUI pStorageUI=null, bool bVisible=true, int iSlotIndex=-1, SCR_ItemAttributeCollection pAttributes=null)
ref SCR_ItemAttributeCollection m_Attributes
SCR_InventoryStorageBaseUI GetStorageUI()
InventoryItemComponent m_pItem
SCR_InventoryStorageBaseUI m_pStorageUI
static IEntity GetLocalControlledEntity()
SCR_RankInfo GetRankByID(SCR_ECharacterRank rankIdentifier)
static ResourceName GetRankIconImageSet()