Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ResupplyContextAction.c
Go to the documentation of this file.
3 {
4 
5  [Attribute("4", desc: "Amount of magazines the action will ensure are in the inventory (fill to this amount)")]
6  private int m_MagazineQuantityInInventory;
7 
8  override bool CanBeShown(SCR_EditableEntityComponent selectedEntity, vector cursorWorldPosition, int flags)
9  {
10  if (selectedEntity == null || selectedEntity.GetEntityType() != EEditableEntityType.CHARACTER)
11  return false;
12 
13  return true;
14  }
15 
16  //------------------------------------------------------------------------------------------------
17  override bool CanBePerformed(SCR_EditableEntityComponent selectedEntity, vector cursorWorldPosition, int flags)
18  {
19  ChimeraCharacter character = ChimeraCharacter.Cast(selectedEntity.GetOwner());
20 
21  if (!character)
22  return false;
23 
24  SCR_InventoryStorageManagerComponent inventoryManager = SCR_InventoryStorageManagerComponent.Cast(character.FindComponent(SCR_InventoryStorageManagerComponent));
25  if (!inventoryManager)
26  return false;
27 
28  return inventoryManager.IsResupplyMagazinesAvailable(m_MagazineQuantityInInventory);
29  }
30 
31  override void Perform(SCR_EditableEntityComponent selectedEntity, vector cursorWorldPosition)
32  {
33  ChimeraCharacter character = ChimeraCharacter.Cast(selectedEntity.GetOwner());
34  if (!character)
35  return;
36 
37  SCR_InventoryStorageManagerComponent inventoryManager = SCR_InventoryStorageManagerComponent.Cast(character.FindComponent(SCR_InventoryStorageManagerComponent));
38  if (!inventoryManager)
39  return;
40 
41  inventoryManager.ResupplyMagazines(m_MagazineQuantityInInventory);
42  }
43 };
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
EEditableEntityType
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
Definition: EEditableEntityType.c:5
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
SCR_SelectedEntitiesContextAction
Definition: SCR_SelectedEntitiesContextAction.c:10
SCR_BaseContainerCustomTitleUIInfo
void SCR_BaseContainerCustomTitleUIInfo(string propertyName, string format="%1")
Definition: Attributes.c:788
SCR_ResupplyContextAction
Definition: SCR_ResupplyContextAction.c:2
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468