Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
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))]
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 //------------------------------------------------------------------------------------------------
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}
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Widget GetWidget()
void OnStateChanged(EEditorState state, EEditorState statePrev)
SCR_FieldOfViewSettings Attribute
EEditorState
Unique editor state.
Definition EEditorState.c:6