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_SetPerceivedCharacterFactionEditorAttribute.c
Go to the documentation of this file.
1
[
BaseContainerProps
(),
SCR_BaseEditorAttributeCustomTitle
()]
2
class
SCR_SetPerceivedCharacterFactionEditorAttribute
:
SCR_BaseFloatValueHolderEditorAttribute
3
{
4
//------------------------------------------------------------------------------------------------
5
override
SCR_BaseEditorAttributeVar
ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
6
{
7
if
(!
IsGameMode
(item))
8
return
null;
9
10
SCR_PerceivedFactionManagerComponent
perceivedManager =
SCR_PerceivedFactionManagerComponent
.GetInstance();
11
if
(!perceivedManager)
12
return
null;
13
14
return
SCR_BaseEditorAttributeVar
.
CreateInt
(
ConvertValueToIndex
(perceivedManager.GetCharacterPerceivedFactionOutfitType()));
15
}
16
17
//------------------------------------------------------------------------------------------------
18
override
void
UpdateInterlinkedVariables(
SCR_BaseEditorAttributeVar
var, SCR_AttributesManagerEditorComponent manager,
bool
isInit =
false
)
19
{
20
//~ Set sub labels
21
if
(isInit)
22
manager.SetAttributeAsSubAttribute(
SCR_PunishKillingWhenDesguisedEditorAttribute
);
23
24
int
value;
25
26
if
(!
ConvertIndexToValue
(var.
GetInt
(), value))
27
return
;
28
29
bool
perceivedFactionEnabled = value !=
SCR_EPerceivedFactionOutfitType
.DISABLED;
30
31
SCR_BaseEditorAttributeVar
punishTeamKillingVar;
32
manager.GetAttributeVariable(
SCR_EnableTeamKillingPunishmentEditorAttribute
, punishTeamKillingVar);
33
34
bool
punishTeamKilling =
true
;
35
36
if
(punishTeamKillingVar)
37
punishTeamKilling = punishTeamKillingVar.
GetBool
();
38
39
manager.SetAttributeEnabled(
SCR_PunishKillingWhenDesguisedEditorAttribute
, perceivedFactionEnabled && punishTeamKilling);
40
}
41
42
//------------------------------------------------------------------------------------------------
43
override
void
WriteVariable(Managed item,
SCR_BaseEditorAttributeVar
var, SCR_AttributesManagerEditorComponent manager,
int
playerID)
44
{
45
if
(!var)
46
return
;
47
48
SCR_PerceivedFactionManagerComponent
perceivedManager =
SCR_PerceivedFactionManagerComponent
.GetInstance();
49
if
(!perceivedManager)
50
return
;
51
52
int
value;
53
54
if
(!
ConvertIndexToValue
(var.
GetInt
(), value))
55
return
;
56
57
perceivedManager.SetCharacterPerceivedFactionOutfitType_S(value, playerID);
58
}
59
}
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
SCR_EPerceivedFactionOutfitType
SCR_EPerceivedFactionOutfitType
Definition
SCR_PerceivedFactionManagerComponent.c:445
SCR_PerceivedFactionManagerComponent
void SCR_PerceivedFactionManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_PerceivedFactionManagerComponent.c:269
SCR_BaseEditorAttributeCustomTitle
Definition
SCR_BaseEditorAttribute.c:876
SCR_BaseEditorAttribute::IsGameMode
bool IsGameMode(Managed item)
Definition
SCR_BaseEditorAttribute.c:466
SCR_BaseEditorAttributeVar
Definition
SCR_BaseEditorAttributeVar.c:2
SCR_BaseEditorAttributeVar::GetBool
bool GetBool()
Definition
SCR_BaseEditorAttributeVar.c:56
SCR_BaseEditorAttributeVar::CreateInt
static SCR_BaseEditorAttributeVar CreateInt(int value)
Definition
SCR_BaseEditorAttributeVar.c:107
SCR_BaseEditorAttributeVar::GetInt
int GetInt()
Definition
SCR_BaseEditorAttributeVar.c:20
SCR_BaseFloatValueHolderEditorAttribute
Attribute base for Name, icon and float value for other attributes to inherent from.
Definition
SCR_BaseFloatValueHolderEditorAttribute.c:4
SCR_BaseFloatValueHolderEditorAttribute::ConvertIndexToValue
bool ConvertIndexToValue(int index, out float outValue)
Definition
SCR_BaseFloatValueHolderEditorAttribute.c:28
SCR_BaseFloatValueHolderEditorAttribute::ConvertValueToIndex
int ConvertValueToIndex(float value)
Definition
SCR_BaseFloatValueHolderEditorAttribute.c:16
SCR_EnableTeamKillingPunishmentEditorAttribute
Definition
SCR_EnableTeamKillingPunishmentEditorAttribute.c:3
SCR_PunishKillingWhenDesguisedEditorAttribute
Definition
SCR_PunishKillingWhenDesguisedEditorAttribute.c:3
SCR_SetPerceivedCharacterFactionEditorAttribute
Definition
SCR_SetPerceivedCharacterFactionEditorAttribute.c:3
scripts
Game
Editor
Containers
Attributes
SCR_SetPerceivedCharacterFactionEditorAttribute.c
Generated by
1.17.0