Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_BoolAttributeDynamicDescription.c
Go to the documentation of this file.
1 
4 [BaseContainerProps(), BaseContainerCustomCheckIntTitleField("m_bShowDescriptionOnBool", "Bool condition True", "Bool condition False", 1)]
6 {
7  [Attribute("0", desc: "If bool equals this value than the condition is shown")]
8  protected bool m_bShowDescriptionOnBool;
9 
10  [Attribute("0", desc: "If true it will only show the description if the condition was false before and is now true (meaning if you save the attributes and open it again it will not show the warning), else it will always set the warning if the condition is true wether it was changed or not")]
11  protected bool m_bOnlyShowIfConditionChanged;
12 
13  protected bool m_bStartingValue;
14 
15  //------------------------------------------------------------------------------------------------
16  override void InitDynamicDescription(notnull SCR_BaseEditorAttribute attribute, notnull SCR_BaseEditorAttributeUIComponent attributeUi)
17  {
18  super.InitDynamicDescription(attribute);
19 
20  //~ No need to set starting value if always checks if condition true
21  if (!m_bOnlyShowIfConditionChanged)
22  return;
23 
24  SCR_BaseEditorAttributeVar var = attribute.GetVariableOrCopy();
25  if (!var)
26  return;
27 
28  m_bStartingValue = var.GetBool();
29  }
30 
31  //------------------------------------------------------------------------------------------------
32  override bool IsValid(notnull SCR_BaseEditorAttribute attribute, notnull SCR_BaseEditorAttributeUIComponent attributeUi)
33  {
34  if (!super.IsValid(attribute, attributeUi))
35  return false;
36 
37  SCR_BaseEditorAttributeVar var = attribute.GetVariableOrCopy();
38  if (!var)
39  return false;
40 
41  if (!m_bOnlyShowIfConditionChanged)
42  return m_bShowDescriptionOnBool == var.GetBool();
43  else
44  return m_bShowDescriptionOnBool == var.GetBool() && m_bStartingValue != var.GetBool();
45  }
46 };
SCR_BaseAttributeDynamicDescription
Definition: SCR_BaseAttributeDynamicDescription.c:5
SCR_BoolAttributeDynamicDescription
Definition: SCR_BoolAttributeDynamicDescription.c:5
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_BaseEditorAttributeVar
Definition: SCR_BaseEditorAttributeVar.c:1
Attribute
typedef Attribute
Post-process effect of scripted camera.
BaseContainerCustomCheckIntTitleField
Attribute for setting a custom format if the given checkVar is equal to checkVarEqual....
Definition: Attributes.c:659
SCR_BaseEditorAttribute
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
Definition: SCR_BaseEditorAttribute.c:3
SCR_BaseEditorAttributeUIComponent
Definition: SCR_BaseEditorAttributeUIComponent.c:3
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468