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_RespawnEnabledEditorAttribute.c
Go to the documentation of this file.
1
4
// Script File
5
[
BaseContainerProps
(),
SCR_BaseEditorAttributeCustomTitle
()]
6
class
SCR_RespawnEnabledEditorAttribute
:
SCR_BaseEditorAttribute
7
{
8
override
SCR_BaseEditorAttributeVar
ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
9
{
10
//If opened in global attributes
11
if
(!
IsGameMode
(item))
return
null;
12
13
SCR_RespawnSystemComponent respawnSystem = SCR_RespawnSystemComponent.GetInstance();
14
if
(!respawnSystem)
return
null;
15
16
bool
value = respawnSystem.IsRespawnEnabled();
17
return
SCR_BaseEditorAttributeVar
.
CreateBool
(value);
18
}
19
20
//Disable respawn time if respawning is disabled
21
override
void
UpdateInterlinkedVariables(
SCR_BaseEditorAttributeVar
var, SCR_AttributesManagerEditorComponent manager,
bool
isInit =
false
)
22
{
23
//Set sub labels
24
if
(isInit)
25
{
26
manager.SetAttributeAsSubAttribute(
SCR_RespawnTimeEditorAttribute
);
27
manager.SetAttributeAsSubAttribute(
SCR_SpawnAtPlayersEditorAttribute
);
28
manager.SetAttributeAsSubAttribute(
SCR_SpawnAtRadioVehicleAttribute
);
29
manager.SetAttributeAsSubAttribute(
SCR_LoadoutSupplyCostMultiplierEditorAttribute
);
30
}
31
32
manager.SetAttributeEnabled(
SCR_RespawnTimeEditorAttribute
, var && var.
GetBool
());
33
manager.SetAttributeEnabled(
SCR_SpawnAtPlayersEditorAttribute
, var && var.
GetBool
());
34
manager.SetAttributeEnabled(
SCR_SpawnAtRadioVehicleAttribute
, var && var.
GetBool
());
35
36
SCR_BaseEditorAttributeVar
globalVar;
37
manager.GetAttributeVariable(
SCR_EnableGlobalResourceTypeEditorAttribute
, globalVar);
38
bool
suppliesEnabled =
true
;
39
40
if
(globalVar)
41
suppliesEnabled = globalVar.
GetBool
();
42
43
manager.SetAttributeEnabled(
SCR_LoadoutSupplyCostMultiplierEditorAttribute
, var && var.
GetBool
() && suppliesEnabled);
44
}
45
46
override
void
WriteVariable(Managed item,
SCR_BaseEditorAttributeVar
var, SCR_AttributesManagerEditorComponent manager,
int
playerID)
47
{
48
if
(!var)
49
return
;
50
SCR_RespawnSystemComponent respawnSystem = SCR_RespawnSystemComponent.GetInstance();
51
if
(!respawnSystem)
52
return
;
53
54
bool
value = var.
GetBool
();
55
56
//Notification
57
if
(item)
58
{
59
if
(value != respawnSystem.IsRespawnEnabled())
60
{
61
if
(value ==
true
)
62
{
63
SCR_NotificationsComponent.SendToEveryone(
ENotification
.EDITOR_ATTRIBUTES_RESPAWN_ENABLED, playerID);
64
}
65
else
{
66
SCR_NotificationsComponent.SendToEveryone(
ENotification
.EDITOR_ATTRIBUTES_RESPAWN_DISABLED, playerID);
67
}
68
}
69
}
70
71
respawnSystem.ServerSetEnableRespawn(value);
72
}
73
};
ENotification
ENotification
Definition
ENotification.c:5
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.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_BaseEditorAttribute::IsGameMode
bool IsGameMode(Managed item)
Definition
SCR_BaseEditorAttribute.c:466
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_EnableGlobalResourceTypeEditorAttribute
Definition
SCR_EnableGlobalResourceTypeEditorAttribute.c:3
SCR_LoadoutSupplyCostMultiplierEditorAttribute
Definition
SCR_LoadoutSupplyCostMultiplierEditorAttribute.c:3
SCR_RespawnEnabledEditorAttribute
Definition
SCR_RespawnEnabledEditorAttribute.c:7
SCR_RespawnTimeEditorAttribute
Definition
SCR_RespawnTimeEditorAttribute.c:7
SCR_SpawnAtPlayersEditorAttribute
Definition
SCR_SpawnAtPlayersAttribute.c:7
SCR_SpawnAtRadioVehicleAttribute
Definition
SCR_SpawnAtRadioVehicleAttribute.c:3
scripts
Game
Editor
Containers
Attributes
SCR_RespawnEnabledEditorAttribute.c
Generated by
1.17.0