Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_PlayableFactionEditorAttribute.c
Go to the documentation of this file.
3 {
4  override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
5  {
6  SCR_EditableFactionComponent editableFaction = SCR_EditableFactionComponent.Cast(item);
7  if (!editableFaction)
8  return null;
9 
10  Faction faction = editableFaction.GetFaction();
11  SCR_Faction scrFaction = SCR_Faction.Cast(faction);
12  if(!scrFaction)
13  return null;
14 
15  SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
16  if (!factionManager || !factionManager.CanChangeFactionsPlayable())
17  return null;
18 
19  vector value = Vector(scrFaction.IsPlayable(), factionManager.GetFactionIndex(faction), 0);
20  return SCR_BaseEditorAttributeVar.CreateVector(value);
21  }
22 
23  override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
24  {
25  if (!var)
26  return;
27 
28  SCR_EditableFactionComponent editableFaction = SCR_EditableFactionComponent.Cast(item);
29  if (!editableFaction)
30  return;
31 
32  editableFaction.SetFactionPlayableServer(var.GetBool());
33 
34  if (item)
35  SCR_NotificationsComponent.SendToEveryone(ENotification.EDITOR_ATTRIBUTES_FACTION_CHANGED, playerID);
36  }
37 };
SCR_PlayableFactionEditorAttribute
Definition: SCR_PlayableFactionEditorAttribute.c:2
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_BaseEditorAttributeCustomTitle
Definition: SCR_BaseEditorAttribute.c:868
ENotification
ENotification
Definition: ENotification.c:4
SCR_BaseEditorAttributeVar
Definition: SCR_BaseEditorAttributeVar.c:1
SCR_BaseEditorAttribute
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
Definition: SCR_BaseEditorAttribute.c:3
Faction
Definition: Faction.c:12
SCR_FactionManager
void SCR_FactionManager(IEntitySource src, IEntity parent)
Definition: SCR_FactionManager.c:461
SCR_Faction
Definition: SCR_Faction.c:6
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