Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkActionMoveIntoInventory.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Target entity to move into inventory)")]
5 ref SCR_ScenarioFrameworkGet m_EntityGetter;
6
7 [Attribute(desc: "Target entity with inventory)")]
8 ref SCR_ScenarioFrameworkGet m_TargetGetter;
9
10 //------------------------------------------------------------------------------------------------
11 override void OnActivate(IEntity object)
12 {
13 if (!CanActivate())
14 return;
15
16 IEntity entity;
17 if (!ValidateInputEntity(object, m_EntityGetter, entity))
18 return;
19
20 IEntity targetEntity;
21 if (!ValidateInputEntity(object, m_TargetGetter, targetEntity))
22 return;
23
24 if (entity == targetEntity)
25 {
26 Print(string.Format("SCR_ScenarioFrameworkActionMoveIntoInventory: Entity is same as target for action %1", this), LogLevel.ERROR);
27 return;
28 }
29
30 ScriptedInventoryStorageManagerComponent storageManager = ScriptedInventoryStorageManagerComponent.Cast(targetEntity.FindComponent(ScriptedInventoryStorageManagerComponent));
31 if (!storageManager)
32 {
33 Print(string.Format("SCR_ScenarioFrameworkActionMoveIntoInventory: Target Entity %2 doesn't have storage StorageManagerComponent for action %1", this, m_TargetGetter), LogLevel.ERROR);
34 return;
35 }
36
37 if (!storageManager.TryInsertItem(entity))
38 Print(string.Format("SCR_ScenarioFrameworkActionMoveIntoInventory: Insertion of entity %2 for action %1 failed.", this, m_TargetGetter), LogLevel.WARNING);
39 }
40}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
override void OnActivate()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute