Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_SetPerceivedCharacterFactionEditorAttribute.c
Go to the documentation of this file.
3{
4 //------------------------------------------------------------------------------------------------
5 override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
6 {
7 if (!IsGameMode(item))
8 return null;
9
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
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}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
void SCR_PerceivedFactionManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
static SCR_BaseEditorAttributeVar CreateInt(int value)
Attribute base for Name, icon and float value for other attributes to inherent from.