DayZ 1.24
Loading...
Searching...
No Matches
OptionSelectorBase Class Reference
Collaboration diagram for OptionSelectorBase:
[legend]

Protected Member Functions

void OptionSelector (Widget parent, int current_index, ScriptedWidgetEventHandler parent_c, bool disabled)
 
void ~OptionSelector ()
 
override bool OnMouseButtonUp (Widget w, int x, int y, int button)
 
override bool OnClick (Widget w, int x, int y, int button)
 
override bool OnMouseEnter (Widget w, int x, int y)
 
override bool OnMouseLeave (Widget w, Widget enterW, int x, int y)
 
void Reset ()
 
void SetNextOption ()
 
void SetPrevOption ()
 
array< stringGetOptions ()
 
bool IsSet ()
 
bool IsEnabled ()
 Returns 'true' if current index == 1 (default 'enabled' value). Take care, as different selectors may follow different logic!
 
bool IsSelectorEnabled ()
 Returns false for the selector in 'disabled' states.
 
string GetStringValue ()
 
void SetStringOption (string option, bool fire_event=true)
 
void ColorOption ()
 
override bool IsFocusable (Widget w)
 
override void Enable ()
 
override void Disable ()
 
override void ColorNormalConsole (Widget w)
 
override void ColorDisabledConsole (Widget w)
 
void OptionSelectorEditbox (Widget parent, string value, ScriptedWidgetEventHandler parent_menu, bool disabled)
 
void ~OptionSelectorEditbox ()
 
override void Enable ()
 
override void Disable ()
 
override bool OnMouseEnter (Widget w, int x, int y)
 
override bool OnMouseLeave (Widget w, Widget enterW, int x, int y)
 
override bool OnChange (Widget w, int x, int y, bool finished)
 
override bool IsFocusable (Widget w)
 
override bool OnFocus (Widget w, int x, int y)
 
override bool OnFocusLost (Widget w, int x, int y)
 
void SetValue (string value, bool update=true)
 
string GetValue ()
 
override void ColorHighlight (Widget w)
 
override void ColorNormal (Widget w)
 
void ~OptionSelectorSliderSetup ()
 
override void Enable ()
 
override void Disable ()
 
override bool OnMouseEnter (Widget w, int x, int y)
 
override bool OnMouseLeave (Widget w, Widget enterW, int x, int y)
 
override bool OnMouseButtonUp (Widget w, int x, int y, int button)
 
override bool OnChange (Widget w, int x, int y, bool finished)
 
override bool IsFocusable (Widget w)
 
override bool OnFocus (Widget w, int x, int y)
 
override bool OnFocusLost (Widget w, int x, int y)
 
float NormalizeInput (float value)
 
void SetStep (float step)
 
void SetValue (float value, bool update=true)
 
float GetValue ()
 
void SetMax (float max)
 
override void ColorHighlight (Widget w)
 
override void ColorNormal (Widget w)
 

Protected Attributes

Widget m_PreviousOption
 
Widget m_NextOption
 
TextWidget m_SelectedOption
 
int m_SelectedOptionIndex
 
ref array< stringm_Options
 
EditBoxWidget m_EditBox
 
SliderWidget m_Slider
 
float m_MinValue
 
float m_MaxValue
 

Detailed Description

Definition at line 1 of file OptionSelector.c.

Constructor & Destructor Documentation

◆ ~OptionSelector()

void OptionSelectorBase::~OptionSelector ( )
inlineprotected

Definition at line 48 of file OptionSelector.c.

49 {
50 delete m_Root;
51 }
Widget m_Root
Definition SizeToChild.c:85

References m_Root.

◆ ~OptionSelectorEditbox()

void OptionSelectorBase::~OptionSelectorEditbox ( )
inlineprotected

Definition at line 26 of file OptionSelectorEditbox.c.

27 {
28 delete m_Root;
29 }

References m_Root.

◆ ~OptionSelectorSliderSetup()

void OptionSelectorBase::~OptionSelectorSliderSetup ( )
inlineprotected

Definition at line 7 of file OptionSelectorSliderSetup.c.

8 {
9 delete m_Root;
10 }

References m_Root.

Member Function Documentation

◆ ColorDisabledConsole()

override void OptionSelectorBase::ColorDisabledConsole ( Widget w)
inlineprotected

Definition at line 232 of file OptionSelector.c.

233 {
234 super.ColorDisabledConsole(w);
235
236 if (!w)
237 return;
238
240 m_SelectedOption.SetColor(ARGB(120, 255, 255, 255));
241 }
TextWidget m_SelectedOption
int ARGB(int a, int r, int g, int b)
Definition proto.c:322

References ARGB().

Referenced by ScriptedWidgetEventHandler::Disable().

◆ ColorHighlight() [1/2]

override void OptionSelectorBase::ColorHighlight ( Widget w)
inlineprotected

Definition at line 143 of file OptionSelectorEditbox.c.

144 {
145 if (!w)
146 return;
147
148 if (m_EditBox)
149 {
151 m_EditBox.SetColor(ARGB(255, 200, 0, 0));
152 }
153
154 super.ColorHighlight(w);
155 }
proto native void SetFocus(Widget w)

References ARGB(), and SetFocus().

Referenced by ScriptedWidgetEventHandler::OnMouseEnter(), and OnMouseEnter().

◆ ColorHighlight() [2/2]

override void OptionSelectorBase::ColorHighlight ( Widget w)
inlineprotected

Definition at line 137 of file OptionSelectorSliderSetup.c.

138 {
139 if (!w)
140 return;
141
142 if (m_Slider)
143 {
145 m_Slider.SetColor(ARGB(255, 200, 0, 0));
146 }
147
148 super.ColorHighlight(w);
149 }

References ARGB(), and SetFocus().

◆ ColorNormal() [1/2]

override void OptionSelectorBase::ColorNormal ( Widget w)
inlineprotected

Definition at line 157 of file OptionSelectorEditbox.c.

158 {
159 if (!w)
160 return;
161
162 if (m_EditBox)
163 m_EditBox.SetColor(ARGB(140, 255, 255, 255));
164
165 super.ColorNormal(w);
166 }

References ARGB().

Referenced by ScriptedWidgetEventHandler::Enable(), ScriptedWidgetEventHandler::OnMouseLeave(), and OnMouseLeave().

◆ ColorNormal() [2/2]

override void OptionSelectorBase::ColorNormal ( Widget w)
inlineprotected

Definition at line 151 of file OptionSelectorSliderSetup.c.

152 {
153 if (!w)
154 return;
155
156 if (m_Slider)
157 m_Slider.SetColor(ARGB(140, 255, 255, 255));
158
159 super.ColorNormal(w);
160 }

References ARGB().

◆ ColorNormalConsole()

override void OptionSelectorBase::ColorNormalConsole ( Widget w)
inlineprotected

Definition at line 221 of file OptionSelector.c.

222 {
223 super.ColorNormalConsole(w);
224
225 if (!w)
226 return;
227
229 m_SelectedOption.SetColor(ARGB(255, 255, 255, 255));
230 }

References ARGB().

Referenced by ScriptedWidgetEventHandler::Enable(), ScriptedWidgetEventHandler::OnFocusLost(), and ScriptedWidgetEventHandler::OnMouseLeave().

◆ ColorOption()

void OptionSelectorBase::ColorOption ( )
inlineprotected

Definition at line 164 of file OptionSelector.c.

165 {
166 switch (m_SelectedOptionIndex)
167 {
168 case 0:
169 {
170 m_SelectedOption.SetColor(ARGB(255, 255, 255, 255));
171 break;
172 }
173 case 1:
174 {
175 m_SelectedOption.SetColor(ARGB(255, 0, 255, 0));
176 break;
177 }
178 case 2:
179 {
180 m_SelectedOption.SetColor(ARGB(255, 255, 0, 0));
181 break;
182 }
183 }
184 }

References ARGB().

◆ Disable() [1/3]

override void OptionSelectorBase::Disable ( )
inlineprotected

Definition at line 207 of file OptionSelector.c.

208 {
209 super.Disable();
210#ifndef PLATFORM_CONSOLE
211 m_NextOption.SetFlags(WidgetFlags.IGNOREPOINTER);
212 m_NextOption.Show(false);
213 m_PreviousOption.SetFlags(WidgetFlags.IGNOREPOINTER);
214 m_PreviousOption.Show(false);
215#else
216 m_Parent.SetFlags(WidgetFlags.NOFOCUS);
217 m_Parent.SetFlags(WidgetFlags.IGNOREPOINTER);
218#endif
219 }
Widget m_Parent
Definition SizeToChild.c:86
WidgetFlags
Definition EnWidgets.c:58

References m_Parent.

◆ Disable() [2/3]

override void OptionSelectorBase::Disable ( )
inlineprotected

Definition at line 38 of file OptionSelectorEditbox.c.

39 {
40 super.Disable();
41
42 m_EditBox.SetFlags(WidgetFlags.IGNOREPOINTER);
43 }

◆ Disable() [3/3]

override void OptionSelectorBase::Disable ( )
inlineprotected

Definition at line 19 of file OptionSelectorSliderSetup.c.

20 {
21 super.Disable();
22
23 m_Slider.SetFlags(WidgetFlags.IGNOREPOINTER);
24 }

◆ Enable() [1/3]

override void OptionSelectorBase::Enable ( )
inlineprotected

Definition at line 193 of file OptionSelector.c.

194 {
195 super.Enable();
196#ifndef PLATFORM_CONSOLE
197 m_NextOption.ClearFlags(WidgetFlags.IGNOREPOINTER);
198 m_NextOption.Show(true);
199 m_PreviousOption.ClearFlags(WidgetFlags.IGNOREPOINTER);
200 m_PreviousOption.Show(true);
201#else
202 m_Parent.ClearFlags(WidgetFlags.NOFOCUS);
203 m_Parent.ClearFlags(WidgetFlags.IGNOREPOINTER);
204#endif
205 }

References m_Parent.

Referenced by OptionSelectorEditbox().

◆ Enable() [2/3]

override void OptionSelectorBase::Enable ( )
inlineprotected

Definition at line 31 of file OptionSelectorEditbox.c.

32 {
33 super.Enable();
34
35 m_EditBox.ClearFlags(WidgetFlags.IGNOREPOINTER);
36 }

◆ Enable() [3/3]

override void OptionSelectorBase::Enable ( )
inlineprotected

Definition at line 12 of file OptionSelectorSliderSetup.c.

13 {
14 super.Enable();
15
16 m_Slider.ClearFlags(WidgetFlags.IGNOREPOINTER);
17 }

◆ GetOptions()

array< string > OptionSelectorBase::GetOptions ( )
inlineprotected

Definition at line 123 of file OptionSelector.c.

124 {
125 return m_Options;
126 }
ref array< string > m_Options

◆ GetStringValue()

string OptionSelectorBase::GetStringValue ( )
inlineprotected

Definition at line 146 of file OptionSelector.c.

147 {
149 }

◆ GetValue() [1/2]

string OptionSelectorBase::GetValue ( )
inlineprotected

Definition at line 138 of file OptionSelectorEditbox.c.

139 {
140 return m_EditBox.GetText();
141 }

Referenced by OnChange(), and SetValue().

◆ GetValue() [2/2]

float OptionSelectorBase::GetValue ( )
inlineprotected

Definition at line 126 of file OptionSelectorSliderSetup.c.

127 {
128 float ret = (m_Slider.GetCurrent() * (m_MaxValue - m_MinValue)) + m_MinValue;
129 return ret;
130 }

References m_MaxValue, and m_MinValue.

◆ IsEnabled()

bool OptionSelectorBase::IsEnabled ( )
inlineprotected

Returns 'true' if current index == 1 (default 'enabled' value). Take care, as different selectors may follow different logic!

Definition at line 135 of file OptionSelector.c.

136 {
137 return m_SelectedOptionIndex == 1;
138 }

◆ IsFocusable() [1/3]

override bool OptionSelectorBase::IsFocusable ( Widget w)
inlineprotected

Definition at line 186 of file OptionSelector.c.

187 {
188 if (w)
189 return (w == m_Parent || w == m_NextOption || w == m_PreviousOption);
190 return false;
191 }

References m_Parent.

Referenced by ScriptedWidgetEventHandler::OnFocus(), ScriptedWidgetEventHandler::OnMouseEnter(), OnMouseEnter(), ScriptedWidgetEventHandler::OnMouseLeave(), and OnMouseLeave().

◆ IsFocusable() [2/3]

override bool OptionSelectorBase::IsFocusable ( Widget w)
inlineprotected

Definition at line 103 of file OptionSelectorEditbox.c.

104 {
105 if (w)
106 return (w == m_Parent || w == m_EditBox);
107 return false;
108 }

References m_Parent.

◆ IsFocusable() [3/3]

override bool OptionSelectorBase::IsFocusable ( Widget w)
inlineprotected

Definition at line 75 of file OptionSelectorSliderSetup.c.

76 {
77 if (w)
78 return (w == m_Parent || w == m_Slider);
79 return false;
80 }

References m_Parent.

◆ IsSelectorEnabled()

bool OptionSelectorBase::IsSelectorEnabled ( )
inlineprotected

Returns false for the selector in 'disabled' states.

Definition at line 141 of file OptionSelector.c.

142 {
143 return m_Enabled;
144 }
bool m_Enabled
Definition TrapTrigger.c:65

References m_Enabled.

◆ IsSet()

bool OptionSelectorBase::IsSet ( )
inlineprotected

Definition at line 129 of file OptionSelector.c.

130 {
131 return m_SelectedOptionIndex != 0;
132 }

◆ NormalizeInput()

float OptionSelectorBase::NormalizeInput ( float value)
inlineprotected

Definition at line 108 of file OptionSelectorSliderSetup.c.

109 {
110 float ret = (value - m_MinValue) / (m_MaxValue - m_MinValue);
111 return ret;
112 }

References m_MaxValue, and m_MinValue.

◆ OnChange() [1/2]

override bool OptionSelectorBase::OnChange ( Widget w,
int x,
int y,
bool finished )
inlineprotected

Definition at line 93 of file OptionSelectorEditbox.c.

94 {
95 if (w == m_EditBox)
96 {
97 m_OptionChanged.Invoke(GetValue());
98 return true;
99 }
100 return false;
101 }

References GetValue().

◆ OnChange() [2/2]

override bool OptionSelectorBase::OnChange ( Widget w,
int x,
int y,
bool finished )
inlineprotected

Definition at line 65 of file OptionSelectorSliderSetup.c.

66 {
67 if (w == m_Slider)
68 {
69 m_OptionChanged.Invoke(GetValue());
70 return true;
71 }
72 return false;
73 }

References GetValue().

◆ OnClick()

override bool OptionSelectorBase::OnClick ( Widget w,
int x,
int y,
int button )
inlineprotected

Definition at line 71 of file OptionSelector.c.

72 {
73 if (button == MouseState.LEFT)
74 {
75 if (w == m_Parent)
77 }
78 return true;
79 }
MouseState
Definition EnSystem.c:311

References m_Parent, and OptionSelector::SetNextOption().

◆ OnFocus() [1/2]

override bool OptionSelectorBase::OnFocus ( Widget w,
int x,
int y )
inlineprotected

Definition at line 110 of file OptionSelectorEditbox.c.

111 {
112 if (GetFocus() != m_EditBox)
113 {
115 m_Parent.Enable(false);
116 }
117
118 return super.OnFocus(m_Parent, x, y);
119 }
Icon x
Icon y
proto native Widget GetFocus()

References GetFocus(), m_Parent, SetFocus(), x, and y.

◆ OnFocus() [2/2]

override bool OptionSelectorBase::OnFocus ( Widget w,
int x,
int y )
inlineprotected

Definition at line 82 of file OptionSelectorSliderSetup.c.

83 {
84#ifdef PLATFORM_CONSOLE
85 if (GetFocus() != m_Slider)
86 {
88 m_Parent.Enable(false);
89 }
90
91 return super.OnFocus(m_Parent, x, y);
92
93#else
94 return false;
95#endif
96 }

References GetFocus(), m_Parent, SetFocus(), x, and y.

◆ OnFocusLost() [1/2]

override bool OptionSelectorBase::OnFocusLost ( Widget w,
int x,
int y )
inlineprotected

Definition at line 121 of file OptionSelectorEditbox.c.

122 {
123 if (w == m_EditBox)
124 {
125 m_Parent.Enable(true);
126 return super.OnFocusLost(m_Parent, x, y);
127 }
128 return false;
129 }

References m_Parent, x, and y.

◆ OnFocusLost() [2/2]

override bool OptionSelectorBase::OnFocusLost ( Widget w,
int x,
int y )
inlineprotected

Definition at line 98 of file OptionSelectorSliderSetup.c.

99 {
100 if (w == m_Slider)
101 {
102 m_Parent.Enable(true);
103 return super.OnFocusLost(m_Parent, x, y);
104 }
105 return false;
106 }

References m_Parent, x, and y.

◆ OnMouseButtonUp() [1/2]

override bool OptionSelectorBase::OnMouseButtonUp ( Widget w,
int x,
int y,
int button )
inlineprotected

Definition at line 53 of file OptionSelector.c.

54 {
55 if (button == MouseState.LEFT)
56 {
57 if (w == m_NextOption)
58 {
60 return true;
61 }
62 else if (w == m_PreviousOption)
63 {
65 return true;
66 }
67 }
68 return false;
69 }

References OptionSelector::SetNextOption(), and OptionSelector::SetPrevOption().

◆ OnMouseButtonUp() [2/2]

override bool OptionSelectorBase::OnMouseButtonUp ( Widget w,
int x,
int y,
int button )
inlineprotected

Definition at line 57 of file OptionSelectorSliderSetup.c.

58 {
59 if (button == MouseState.LEFT && w == m_Slider)
60 {
61 }
62 return false;
63 }

◆ OnMouseEnter() [1/3]

override bool OptionSelectorBase::OnMouseEnter ( Widget w,
int x,
int y )
inlineprotected

Definition at line 82 of file OptionSelector.c.

83 {
84 return super.OnMouseEnter(w, x, y);
85 }

References x, and y.

◆ OnMouseEnter() [2/3]

override bool OptionSelectorBase::OnMouseEnter ( Widget w,
int x,
int y )
inlineprotected

Definition at line 45 of file OptionSelectorEditbox.c.

46 {
47 if (!IsFocusable(w))
48 return true;
49
50 if (m_ParentClass)
51 {
52 m_ParentClass.OnFocus(m_Root.GetParent(), -1, m_SelectorType);
53 m_ParentClass.OnMouseEnter(m_Root.GetParent().GetParent(), x, y);
54 }
55
56 UIScriptedMenu menu = GetGame().GetUIManager().GetMenu();
57
58 if (menu && menu.IsInherited(CharacterCreationMenu))
59 {
60 menu.OnFocus(m_Root.GetParent(), -1, m_SelectorType);
61 menu.OnMouseEnter(m_Root.GetParent().GetParent(), x, y);
62 }
63
65
66 return true;
67 }
override bool IsFocusable(Widget w)
override void ColorHighlight(Widget w)
proto native CGame GetGame()

References ColorHighlight(), GetGame(), IsFocusable(), m_Root, x, and y.

◆ OnMouseEnter() [3/3]

override bool OptionSelectorBase::OnMouseEnter ( Widget w,
int x,
int y )
inlineprotected

Definition at line 26 of file OptionSelectorSliderSetup.c.

27 {
28 if (m_ParentClass)
29 {
30 OnFocus(w, x, y);
31 m_ParentClass.OnFocus(m_Root.GetParent(), -1, m_SelectorType);
32#ifdef PLATFORM_WINDOWS
33 m_ParentClass.OnMouseEnter(m_Root.GetParent().GetParent(), x, y);
35#endif
36 }
37
38 return true;
39 }
override bool OnFocus(Widget w, int x, int y)

References ColorHighlight(), m_Root, OnFocus(), x, and y.

◆ OnMouseLeave() [1/3]

override bool OptionSelectorBase::OnMouseLeave ( Widget w,
Widget enterW,
int x,
int y )
inlineprotected

Definition at line 87 of file OptionSelector.c.

88 {
89 return super.OnMouseLeave(w, enterW, x, y);
90 }

References x, and y.

◆ OnMouseLeave() [2/3]

override bool OptionSelectorBase::OnMouseLeave ( Widget w,
Widget enterW,
int x,
int y )
inlineprotected

Definition at line 69 of file OptionSelectorEditbox.c.

70 {
72 return true;
73
74 if (m_ParentClass)
75 {
76 m_ParentClass.OnFocus(null, x, y);
77 m_ParentClass.OnMouseLeave(m_Root.GetParent().GetParent(), enterW, x, y);
78 }
79
80 UIScriptedMenu menu = GetGame().GetUIManager().GetMenu();
81
82 if (menu && menu.IsInherited(CharacterCreationMenu))
83 {
84 menu.OnFocus(null, x, y);
85 menu.OnMouseLeave(m_Root.GetParent().GetParent(), enterW, x, y);
86 }
87
89
90 return true;
91 }
override void ColorNormal(Widget w)

References ColorNormal(), GetGame(), IsFocusable(), m_Root, x, and y.

◆ OnMouseLeave() [3/3]

override bool OptionSelectorBase::OnMouseLeave ( Widget w,
Widget enterW,
int x,
int y )
inlineprotected

Definition at line 41 of file OptionSelectorSliderSetup.c.

42 {
43 if (m_ParentClass)
44 {
45 m_ParentClass.OnFocus(null, x, y);
46#ifdef PLATFORM_WINDOWS
47 m_ParentClass.OnMouseLeave(m_Root.GetParent().GetParent(), enterW, x, y);
49#endif
50 OnFocusLost(w, x, y);
52 }
53
54 return true;
55 }
override bool OnFocusLost(Widget w, int x, int y)

References ColorNormal(), m_Root, OnFocusLost(), SetFocus(), x, and y.

◆ OptionSelector()

void OptionSelectorBase::OptionSelector ( Widget parent,
int current_index,
ScriptedWidgetEventHandler parent_c,
bool disabled )
inlineprotected

Definition at line 9 of file OptionSelector.c.

10 {
11 m_Options = { "#server_browser_disabled", "#server_browser_show", "#server_browser_hide" };
12 m_ParentClass = parent_c;
13 m_SelectorType = 2;
16 else
18
19 m_Root = GetGame().GetWorkspace().CreateWidgets("gui/layouts/new_ui/option_selector.layout", parent);
20#ifdef PLATFORM_CONSOLE
21 m_Parent = parent.GetParent().GetParent();
22#else
23#ifdef PLATFORM_WINDOWS
24 m_Parent = parent.GetParent();
25#endif
26#endif
27
28 m_SelectedOption = TextWidget.Cast(m_Root.FindAnyWidget("option_label"));
29 m_PreviousOption = m_Root.FindAnyWidget("prev_option");
30 m_NextOption = m_Root.FindAnyWidget("next_option");
31
32#ifdef PLATFORM_CONSOLE
33 m_NextOption.Show(false);
34 m_PreviousOption.Show(false);
35#endif
36
38
40 if (m_Enabled)
41 Enable();
42 else
43 Disable();
44
45 m_Parent.SetHandler(this);
46 }
override void Enable()
override void Disable()

References Enable(), GetGame(), m_Enabled, m_Parent, and m_Root.

◆ OptionSelectorEditbox()

void OptionSelectorBase::OptionSelectorEditbox ( Widget parent,
string value,
ScriptedWidgetEventHandler parent_menu,
bool disabled )
inlineprotected

Definition at line 5 of file OptionSelectorEditbox.c.

6 {
7 m_Root = GetGame().GetWorkspace().CreateWidgets("gui/layouts/new_ui/option_editbox.layout", parent);
8#ifdef PLATFORM_CONSOLE
9 m_Parent = parent.GetParent().GetParent();
10#else
11#ifdef PLATFORM_WINDOWS
12 m_Parent = parent.GetParent();
13#endif
14#endif
15
16 m_SelectorType = 1;
17 m_ParentClass = parent_menu;
18 m_EditBox = EditBoxWidget.Cast(m_Root.FindAnyWidget("option_value"));
19
21 Enable();
22
23 m_Parent.SetHandler(this);
24 }
void SetValue(string value, bool update=true)

References Enable(), GetGame(), m_Parent, m_Root, and SetValue().

◆ Reset()

void OptionSelectorBase::Reset ( )
inlineprotected

Definition at line 92 of file OptionSelector.c.

93 {
95
97
98 m_OptionChanged.Invoke(m_SelectedOptionIndex);
99 }

◆ SetMax()

void OptionSelectorBase::SetMax ( float max)
inlineprotected

Definition at line 132 of file OptionSelectorSliderSetup.c.

133 {
134 m_MaxValue = max;
135 }

References m_MaxValue.

◆ SetNextOption()

void OptionSelectorBase::SetNextOption ( )
inlineprotected

Definition at line 101 of file OptionSelector.c.

102 {
104 if (m_SelectedOptionIndex >= m_Options.Count())
106
108
109 m_OptionChanged.Invoke(m_SelectedOptionIndex);
110 }

◆ SetPrevOption()

void OptionSelectorBase::SetPrevOption ( )
inlineprotected

Definition at line 112 of file OptionSelector.c.

113 {
115 if (m_SelectedOptionIndex < 0)
116 m_SelectedOptionIndex = m_Options.Count() - 1;
117
119
120 m_OptionChanged.Invoke(m_SelectedOptionIndex);
121 }

◆ SetStep()

void OptionSelectorBase::SetStep ( float step)
inlineprotected

Definition at line 114 of file OptionSelectorSliderSetup.c.

115 {
116 m_Slider.SetStep(step);
117 }

◆ SetStringOption()

void OptionSelectorBase::SetStringOption ( string option,
bool fire_event = true )
inlineprotected

Definition at line 151 of file OptionSelector.c.

152 {
153 int index = m_Options.Find(option);
154 if (index > -1)
155 {
158
159 if (fire_event)
160 m_OptionChanged.Invoke(m_SelectedOptionIndex);
161 }
162 }

◆ SetValue() [1/2]

void OptionSelectorBase::SetValue ( float value,
bool update = true )
inlineprotected

Definition at line 119 of file OptionSelectorSliderSetup.c.

120 {
121 m_Slider.SetCurrent(NormalizeInput(value));
122 if (update)
123 m_OptionChanged.Invoke(GetValue());
124 }
float NormalizeInput(float value)

References GetValue().

◆ SetValue() [2/2]

void OptionSelectorBase::SetValue ( string value,
bool update = true )
inlineprotected

Definition at line 131 of file OptionSelectorEditbox.c.

132 {
133 m_EditBox.SetText(value);
134 if (update)
135 m_OptionChanged.Invoke(GetValue());
136 }

References GetValue().

Referenced by OptionSelectorEditbox().

Member Data Documentation

◆ m_EditBox

EditBoxWidget OptionSelectorBase::m_EditBox
protected

Definition at line 3 of file OptionSelectorEditbox.c.

◆ m_MaxValue

float OptionSelectorBase::m_MaxValue
protected

Definition at line 5 of file OptionSelectorSliderSetup.c.

◆ m_MinValue

float OptionSelectorBase::m_MinValue
protected

Definition at line 4 of file OptionSelectorSliderSetup.c.

◆ m_NextOption

Widget OptionSelectorBase::m_NextOption
protected

Definition at line 4 of file OptionSelector.c.

◆ m_Options

ref array<string> OptionSelectorBase::m_Options
protected

Definition at line 7 of file OptionSelector.c.

◆ m_PreviousOption

Widget OptionSelectorBase::m_PreviousOption
protected

Definition at line 3 of file OptionSelector.c.

◆ m_SelectedOption

TextWidget OptionSelectorBase::m_SelectedOption
protected

Definition at line 5 of file OptionSelector.c.

◆ m_SelectedOptionIndex

int OptionSelectorBase::m_SelectedOptionIndex
protected

Definition at line 6 of file OptionSelector.c.

◆ m_Slider

SliderWidget OptionSelectorBase::m_Slider
protected

Definition at line 3 of file OptionSelectorSliderSetup.c.


The documentation for this class was generated from the following files: