Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BasePlayerBudgetEnableEditorAttribute.c
Go to the documentation of this file.
1
4{
5 //~ ToDo: this is temporary for when the budgets get a Init value function
6 [Attribute(desc: "The budget Value if in Multiplayer when budget is enabled")]
7 protected int m_iBudgetValueMP;
8
9 [Attribute(desc: "The budget Value if in Singleplayer when budget is enabled")]
10 protected int m_iBudgetValueSP;
11
13
14 protected void SetEditorManager(Managed item)
15 {
16 m_EditorManager = null;
17
18 SCR_EditablePlayerDelegateComponent delegate = SCR_EditablePlayerDelegateComponent.Cast(item);
19 if (!delegate)
20 return;
21
23 if (!core)
24 return;
25
26 m_EditorManager = core.GetEditorManager(delegate.GetPlayerID());
27 }
28
29 override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
30 {
31 SetEditorManager(item);
32 if (!m_EditorManager)
33 return null;
34
36 if (!budgetComponent)
37 return null;
38
39 int maxBudget;
40 budgetComponent.GetMaxBudgetValue(GetBudgetType(), maxBudget);
41
42 return SCR_BaseEditorAttributeVar.CreateBool(maxBudget > 0);
43 }
44
45 override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
46 {
47 if (!var)
48 return;
49
50 if (!m_EditorManager)
51 SetEditorManager(item);
52
53 SCR_EditablePlayerDelegateComponent delegate = SCR_EditablePlayerDelegateComponent.Cast(item);
54 if (!delegate)
55 return;
56
57 if (!m_EditorManager)
58 return;
59
61 if (!budgetComponent)
62 return;
63
64 if (var.GetBool())
65 {
66 int budgetValue;
67
68 if (Replication.IsRunning())
69 budgetValue = m_iBudgetValueMP;
70 else
71 budgetValue = m_iBudgetValueSP;
72
73 budgetComponent.SetMaxBudgetValue(GetBudgetType(), budgetValue);
74 SCR_NotificationsComponent.SendToUnlimitedEditorPlayersAndPlayer(playerID, GetEnableNotification(), playerID, delegate.GetPlayerID());
75 }
76 else
77 {
78 budgetComponent.SetMaxBudgetValue(GetBudgetType(), 0);
79 SCR_NotificationsComponent.SendToUnlimitedEditorPlayersAndPlayer(playerID, GetDisableNotification(), playerID, delegate.GetPlayerID());
80 }
81 }
82
84 {
85 return EEditableEntityBudget.SYSTEMS;
86 }
87
89 {
90 return ENotification.UNKNOWN;
91 }
92
94 {
95 return ENotification.UNKNOWN;
96 }
97};
EEditableEntityBudget
ENotification
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Main replication API.
Definition Replication.c:14
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
static SCR_BaseEditorAttributeVar CreateBool(bool value)
override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
void SetMaxBudgetValue(EEditableEntityBudget type, int newValue)
bool GetMaxBudgetValue(EEditableEntityBudget type, out int maxBudget)
Core component to manage SCR_EditorManagerEntity.
SCR_EditorManagerEntity GetEditorManager()
SCR_FieldOfViewSettings Attribute