Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_BasePlayerBudgetEditorAttribute.c
Go to the documentation of this file.
1 
6 {
7  protected SCR_EditorManagerEntity m_EditorManager;
8 
9  protected void SetEditorManager(Managed item)
10  {
11  m_EditorManager = null;
12 
13  SCR_EditablePlayerDelegateComponent delegate = SCR_EditablePlayerDelegateComponent.Cast(item);
14  if (!delegate)
15  return;
16 
18  if (!core)
19  return;
20 
21  m_EditorManager = core.GetEditorManager(delegate.GetPlayerID());
22  }
23 
24  override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
25  {
26  //~ Todo: Disabled for now until serverwide budgets can be set
27  return null;
28 
29  SetEditorManager(item);
30  if (!m_EditorManager)
31  return null;
32 
34  if (!budgetComponent)
35  return null;
36 
37  int maxBudget;
38  budgetComponent.GetMaxBudgetValue(GetBudgetType(), maxBudget);
39 
40  return SCR_BaseEditorAttributeVar.CreateFloat(maxBudget);
41  }
42 
43  override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
44  {
45  if (!var)
46  return;
47 
48  if (!m_EditorManager)
49  SetEditorManager(item);
50  if (!m_EditorManager)
51  return;
52 
54  if (!budgetComponent)
55  return;
56 
57  budgetComponent.DelayedSetMaxBudgetSetup(GetBudgetType(), var.GetFloat(), playerID);
58  }
59 
60  protected EEditableEntityBudget GetBudgetType()
61  {
62  return EEditableEntityBudget.SYSTEMS;
63  }
64 };
EEditableEntityBudget
EEditableEntityBudget
Definition: EEditableEntityBudget.c:1
SCR_BudgetEditorComponent
Definition: SCR_BudgetEditorComponent.c:18
SCR_BaseEditorAttributeCustomTitle
Definition: SCR_BaseEditorAttribute.c:868
SCR_BaseEditorAttributeVar
Definition: SCR_BaseEditorAttributeVar.c:1
SCR_BaseValueListEditorAttribute
Definition: SCR_BaseValueListEditorAttribute.c:5
SCR_EditorManagerCore
Core component to manage SCR_EditorManagerEntity.
Definition: SCR_EditorManagerCore.c:5
SCR_BasePlayerBudgetEditorAttribute
Definition: SCR_BasePlayerBudgetEditorAttribute.c:5
m_EditorManager
protected SCR_EditorManagerEntity m_EditorManager
Definition: SCR_VotingEditor.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
SCR_EditorManagerEntity
Definition: SCR_EditorManagerEntity.c:26