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_CheckboxEditorAttributeUIComponent.c
Go to the documentation of this file.
1
3
class
SCR_CheckboxEditorAttributeUIComponent
:
SCR_BaseEditorAttributeUIComponent
4
{
5
protected
SCR_SelectionWidgetComponent
m_SelectionBoxComponent
;
6
7
override
void
Init
(
Widget
w,
SCR_BaseEditorAttribute
attribute)
8
{
9
Widget
checkboxWidget = w.FindAnyWidget(
m_sUiComponentName
);
10
if
(!checkboxWidget)
11
return
;
12
13
m_SelectionBoxComponent
=
SCR_SelectionWidgetComponent
.Cast(checkboxWidget.FindHandler(
SCR_SelectionWidgetComponent
));
14
if
(!
m_SelectionBoxComponent
)
15
return
;
16
17
m_SelectionBoxComponent
.m_OnChanged.Insert(
OnChangeCheckbox
);
18
19
super.Init(w, attribute);
20
}
21
22
//Sets a default state for the UI and var value if conflicting attribute
23
override
void
SetVariableToDefaultValue
(
SCR_BaseEditorAttributeVar
var)
24
{
25
m_SelectionBoxComponent
.SetCurrentItem(0);
26
27
if
(var)
28
var.
SetBool
(
false
);
29
}
30
31
override
void
SetFromVar
(
SCR_BaseEditorAttributeVar
var)
32
{
33
super.SetFromVar(var);
34
35
if
(!var)
36
return
;
37
38
m_SelectionBoxComponent
.SetCurrentItem((
int
)var.
GetBool
(),
false
,
false
);
39
}
40
41
protected
void
OnChangeCheckbox
(
SCR_SelectionWidgetComponent
selectionBox,
bool
value)
42
{
43
OnChangeInternal
(selectionBox.GetRootWidget(), value, 0,
false
);
44
}
45
46
override
bool
OnChangeInternal
(
Widget
w,
int
x,
int
y,
bool
finished)
47
{
48
if
(!
m_SelectionBoxComponent
)
49
return
false
;
50
51
SCR_BaseEditorAttribute
attribute =
GetAttribute
();
52
if
(!attribute)
return
false
;
53
54
SCR_BaseEditorAttributeVar
var = attribute.
GetVariable
(
true
);
55
56
if
(var.
GetBool
() == x)
57
return
false
;
58
59
var.
SetBool
(x);
60
super.OnChangeInternal(w, x, y, finished);
61
return
false
;
62
}
63
64
override
void
HandlerDeattached
(
Widget
w)
65
{
66
if
(
m_SelectionBoxComponent
)
67
m_SelectionBoxComponent
.m_OnChanged.Remove(
OnChangeCheckbox
);
68
}
69
};
SCR_BaseEditorAttribute
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
Definition
SCR_BaseEditorAttribute.c:4
SCR_BaseEditorAttribute::GetVariable
sealed SCR_BaseEditorAttributeVar GetVariable(bool createWhenNull=false)
Definition
SCR_BaseEditorAttribute.c:307
SCR_BaseEditorAttributeUIComponent
Definition
SCR_BaseEditorAttributeUIComponent.c:4
SCR_BaseEditorAttributeUIComponent::GetAttribute
Get attribute this component represents return Editor attribute *SCR_BaseEditorAttribute GetAttribute()
Definition
SCR_BaseEditorAttributeUIComponent.c:59
SCR_BaseEditorAttributeUIComponent::m_sUiComponentName
string m_sUiComponentName
Definition
SCR_BaseEditorAttributeUIComponent.c:6
SCR_BaseEditorAttributeVar
Definition
SCR_BaseEditorAttributeVar.c:2
SCR_BaseEditorAttributeVar::GetBool
bool GetBool()
Definition
SCR_BaseEditorAttributeVar.c:56
SCR_BaseEditorAttributeVar::SetBool
void SetBool(bool value)
Definition
SCR_BaseEditorAttributeVar.c:48
SCR_CheckboxEditorAttributeUIComponent
Definition
SCR_CheckboxEditorAttributeUIComponent.c:4
SCR_CheckboxEditorAttributeUIComponent::m_SelectionBoxComponent
SCR_SelectionWidgetComponent m_SelectionBoxComponent
Definition
SCR_CheckboxEditorAttributeUIComponent.c:5
SCR_CheckboxEditorAttributeUIComponent::OnChangeCheckbox
void OnChangeCheckbox(SCR_SelectionWidgetComponent selectionBox, bool value)
Definition
SCR_CheckboxEditorAttributeUIComponent.c:41
SCR_CheckboxEditorAttributeUIComponent::SetFromVar
override void SetFromVar(SCR_BaseEditorAttributeVar var)
Definition
SCR_CheckboxEditorAttributeUIComponent.c:31
SCR_CheckboxEditorAttributeUIComponent::Init
override void Init(Widget w, SCR_BaseEditorAttribute attribute)
Definition
SCR_CheckboxEditorAttributeUIComponent.c:7
SCR_CheckboxEditorAttributeUIComponent::OnChangeInternal
override bool OnChangeInternal(Widget w, int x, int y, bool finished)
Definition
SCR_CheckboxEditorAttributeUIComponent.c:46
SCR_CheckboxEditorAttributeUIComponent::HandlerDeattached
override void HandlerDeattached(Widget w)
Definition
SCR_CheckboxEditorAttributeUIComponent.c:64
SCR_CheckboxEditorAttributeUIComponent::SetVariableToDefaultValue
override void SetVariableToDefaultValue(SCR_BaseEditorAttributeVar var)
Definition
SCR_CheckboxEditorAttributeUIComponent.c:23
SCR_SelectionWidgetComponent
Definition
SCR_SelectionWidgetComponent.c:2
Widget
Definition
Widget.c:13
scripts
Game
Editor
UI
Components
Attributes
SCR_CheckboxEditorAttributeUIComponent.c
Generated by
1.17.0