Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_LoadoutSavingClearOnChangeEditorAttribute.c
Go to the documentation of this file.
1 
6 {
7  //------------------------------------------------------------------------------------------------
8  override bool IsSerializable()
9  {
10  return false;
11  }
12 
13  //------------------------------------------------------------------------------------------------
14  override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
15  {
16  if (!IsGameMode(item))
17  return null;
18 
19  SCR_ArsenalManagerComponent arsenalManager;
20  if (!SCR_ArsenalManagerComponent.GetArsenalManager(arsenalManager))
21  return null;
22 
23  SCR_LoadoutSaveBlackListHolder saveBlackList = arsenalManager.GetLoadoutSaveBlackListHolder();
24  int blackListCount = saveBlackList.GetBlackListsCount();
25  if (!saveBlackList || blackListCount == 0 || blackListCount > SCR_LoadoutSavingBlackListEditorAttribute.MAX_ENTRIES)
26  return null;
27 
28 
29  return SCR_BaseEditorAttributeVar.CreateBool(false);
30  }
31 
32  //------------------------------------------------------------------------------------------------
33  override void UpdateInterlinkedVariables(SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, bool isInit = false)
34  {
35  if (isInit || !var)
36  return;
37 
38  //~ On update value set the third value in the Vector of SCR_LoadoutSavingBlackListEditorAttribute to the value if the change should clear existing loadouts or not
39  SCR_BaseEditorAttributeVar savingBlackListVar;
40  if (!manager.GetAttributeVariable(SCR_LoadoutSavingBlackListEditorAttribute, savingBlackListVar))
41  return;
42 
43  vector SavingBlacklistValue = savingBlackListVar.GetVector();
44 
45  SavingBlacklistValue[2] = var.GetInt();
46  savingBlackListVar.SetVector(SavingBlacklistValue);
47 
48  manager.SetAttributeVariable(SCR_LoadoutSavingBlackListEditorAttribute, savingBlackListVar);
49  }
50 };
SCR_LoadoutSavingBlackListEditorAttribute
Definition: SCR_LoadoutSavingBlackListEditorAttribute.c:2
SCR_BaseEditorAttributeCustomTitle
Definition: SCR_BaseEditorAttribute.c:868
SCR_LoadoutSaveBlackListHolder
Definition: SCR_LoadoutSaveBlackListHolder.c:2
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
SCR_LoadoutSavingClearOnChangeEditorAttribute
Definition: SCR_LoadoutSavingClearOnChangeEditorAttribute.c:5
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