Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_BasePlayerBudgetEnableEditorAttribute.c
Go to the documentation of this file.
1
2
[
BaseContainerProps
(),
SCR_BaseEditorAttributeCustomTitle
()]
3
class
SCR_BasePlayerBudgetEnableEditorAttribute
:
SCR_BaseEditorAttribute
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
12
protected
SCR_EditorManagerEntity
m_EditorManager
;
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
22
SCR_EditorManagerCore
core =
SCR_EditorManagerCore
.Cast(
SCR_EditorManagerCore
.GetInstance(
SCR_EditorManagerCore
));
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
35
SCR_BudgetEditorComponent
budgetComponent =
SCR_BudgetEditorComponent
.Cast(
m_EditorManager
.FindComponent(
SCR_BudgetEditorComponent
));
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
60
SCR_BudgetEditorComponent
budgetComponent =
SCR_BudgetEditorComponent
.Cast(
m_EditorManager
.FindComponent(
SCR_BudgetEditorComponent
));
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
83
protected
EEditableEntityBudget
GetBudgetType
()
84
{
85
return
EEditableEntityBudget
.SYSTEMS;
86
}
87
88
protected
ENotification
GetEnableNotification
()
89
{
90
return
ENotification
.UNKNOWN;
91
}
92
93
protected
ENotification
GetDisableNotification
()
94
{
95
return
ENotification
.UNKNOWN;
96
}
97
};
EEditableEntityBudget
EEditableEntityBudget
Definition
EEditableEntityBudget.c:2
ENotification
ENotification
Definition
ENotification.c:5
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
SCR_EditorManagerEntity
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
Definition
SCR_EditorManagerEntity.c:2211
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
Replication
Main replication API.
Definition
Replication.c:14
SCR_BaseEditorAttributeCustomTitle
Definition
SCR_BaseEditorAttribute.c:876
SCR_BaseEditorAttribute
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
Definition
SCR_BaseEditorAttribute.c:4
SCR_BaseEditorAttributeVar
Definition
SCR_BaseEditorAttributeVar.c:2
SCR_BaseEditorAttributeVar::CreateBool
static SCR_BaseEditorAttributeVar CreateBool(bool value)
Definition
SCR_BaseEditorAttributeVar.c:119
SCR_BaseEditorAttributeVar::GetBool
bool GetBool()
Definition
SCR_BaseEditorAttributeVar.c:56
SCR_BasePlayerBudgetEnableEditorAttribute
Definition
SCR_BasePlayerBudgetEnableEditorAttribute.c:4
SCR_BasePlayerBudgetEnableEditorAttribute::ReadVariable
override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
Definition
SCR_BasePlayerBudgetEnableEditorAttribute.c:29
SCR_BasePlayerBudgetEnableEditorAttribute::GetDisableNotification
ENotification GetDisableNotification()
Definition
SCR_BasePlayerBudgetEnableEditorAttribute.c:93
SCR_BasePlayerBudgetEnableEditorAttribute::m_iBudgetValueMP
int m_iBudgetValueMP
Definition
SCR_BasePlayerBudgetEnableEditorAttribute.c:7
SCR_BasePlayerBudgetEnableEditorAttribute::GetEnableNotification
ENotification GetEnableNotification()
Definition
SCR_BasePlayerBudgetEnableEditorAttribute.c:88
SCR_BasePlayerBudgetEnableEditorAttribute::m_iBudgetValueSP
int m_iBudgetValueSP
Definition
SCR_BasePlayerBudgetEnableEditorAttribute.c:10
SCR_BasePlayerBudgetEnableEditorAttribute::GetBudgetType
EEditableEntityBudget GetBudgetType()
Definition
SCR_BasePlayerBudgetEnableEditorAttribute.c:83
SCR_BasePlayerBudgetEnableEditorAttribute::WriteVariable
override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
Definition
SCR_BasePlayerBudgetEnableEditorAttribute.c:45
SCR_BasePlayerBudgetEnableEditorAttribute::SetEditorManager
void SetEditorManager(Managed item)
Definition
SCR_BasePlayerBudgetEnableEditorAttribute.c:14
SCR_BasePlayerBudgetEnableEditorAttribute::m_EditorManager
SCR_EditorManagerEntity m_EditorManager
Definition
SCR_BasePlayerBudgetEnableEditorAttribute.c:12
SCR_BudgetEditorComponent
Definition
SCR_BudgetEditorComponent.c:22
SCR_BudgetEditorComponent::SetMaxBudgetValue
void SetMaxBudgetValue(EEditableEntityBudget type, int newValue)
Definition
SCR_BudgetEditorComponent.c:402
SCR_BudgetEditorComponent::GetMaxBudgetValue
bool GetMaxBudgetValue(EEditableEntityBudget type, out int maxBudget)
Definition
SCR_BudgetEditorComponent.c:387
SCR_EditorManagerCore
Core component to manage SCR_EditorManagerEntity.
Definition
SCR_EditorManagerCore.c:6
SCR_EditorManagerCore::GetEditorManager
SCR_EditorManagerEntity GetEditorManager()
Definition
SCR_EditorManagerCore.c:229
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
Editor
Containers
Attributes
SCR_BasePlayerBudgetEnableEditorAttribute.c
Generated by
1.17.0