Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditorStateConditionUIComponent.c
Go to the documentation of this file.
2 {
3  [Attribute(desc: "Show the widget only when this editor state is active.", uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(EEditorState))]
4  protected EEditorState m_State;
5 
6  [Attribute(desc: "When enabled, given editor state must *not* be active.")]
7  protected bool m_bInverted;
8 
9  //------------------------------------------------------------------------------------------------
10  protected void OnStateChanged(EEditorState state, EEditorState statePrev)
11  {
12  bool show = state == m_State;
13  if (m_bInverted)
14  show = !show;
15 
16  GetWidget().SetVisible(show);
17  }
18 
19  //------------------------------------------------------------------------------------------------
20  override bool IsUnique()
21  {
22  return false;
23  }
24 
25  //------------------------------------------------------------------------------------------------
26  override void HandlerAttachedScripted(Widget w)
27  {
29  if (!stateManager)
30  return;
31 
32  stateManager.GetOnStateChange().Insert(OnStateChanged);
33  OnStateChanged(stateManager.GetState(), -1);
34  }
35 
36  //------------------------------------------------------------------------------------------------
37  override void HandlerDeattached(Widget w)
38  {
40  if (!stateManager)
41  return;
42 
43  stateManager.GetOnStateChange().Remove(OnStateChanged);
44  }
45 }
SCR_EditorStateConditionUIComponent
Definition: SCR_EditorStateConditionUIComponent.c:1
EEditorState
EEditorState
Unique editor state.
Definition: EEditorState.c:5
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_BaseEditorUIComponent
Definition: SCR_BaseEditorUIComponent.c:3
m_State
private EEditableEntityState m_State
Definition: SCR_BaseEntitiesEditorUIEffect.c:3
SCR_StatesEditorComponent
Definition: SCR_StatesEditorComponent.c:9
GetWidget
protected Widget GetWidget()
Definition: SCR_VonDisplay.c:155