13 [
Attribute(
"false",
UIWidgets.CheckBox,
"use light grey arrows instead of big yellow ones")]
16 [
Attribute(
"false",
UIWidgets.CheckBox,
"On last item and pressing right arrow, it will go to the start of the list")]
19 [
Attribute(
"true",
UIWidgets.CheckBox,
"Show bar of available elements and which one is selected.")]
28 [
Attribute(
"1",
UIWidgets.EditBox,
"How much wider should be the selected hint element")]
43 [
Attribute(
"HintBarElement",
UIWidgets.EditBox,
"Name for generated Hint bar widgets")]
60 super.HandlerAttached(w);
66 Widget left = w.FindAnyWidget(
"ButtonLeft");
67 Widget right = w.FindAnyWidget(
"ButtonRight");
97 super.OnFocus(w, x, y);
108 super.OnFocusLost(w, x, y);
119 override int AddItem(
string item,
bool last =
false, Managed
data = null)
121 int i = super.AddItem(item, last,
data);
130 super.RemoveItem(item, last);
142 override bool SetCurrentItem(
int i,
bool playSound =
false,
bool animate =
false)
152 if (!super.SetCurrentItem(i, playSound, animate))
156 m_wText.SetText(m_aElementNames[i]);
175 w.RemoveFromHierarchy();
181 for (
int i = 0, len = m_aElementNames.Count(); i < len; i++)
214 bool focused =
GetGame().GetWorkspace().GetFocusedWidget() ==
m_wRoot;
217 if (oldIndex > -1 && oldIndex < count)
224 if (currentIndex > -1 && currentIndex < count)
236 if (realIndex < 0 || realIndex >= m_aElementNames.Count())
255 bool enabled = m_aElementNames.Count() > 1;
262 m_ButtonRight.SetEnabled(selected != (m_aElementNames.Count() - 1), animate);
ArmaReforgerScripted GetGame()
Get all prefabs that have the spawner data
ref ScriptInvoker m_OnChanged
ref ScriptInvoker m_OnRightArrowClick
ref array< Widget > m_aHintElements
void AddActionListeners()
float m_fHintSelectedWidthMultiplier
override bool OnFocus(Widget w, int x, int y)
float m_fHintElementWidth
override void RemoveItem(int item, bool last=false)
float m_fHintElementHeight
string m_sHintBarElementName
void SetInitialState(bool invokeOnChanged=true)
ref ScriptInvoker m_OnLeftArrowClick
override bool OnFocusLost(Widget w, int x, int y)
void UpdateHintBar(int currentIndex, int oldIndex)
SCR_PagingButtonComponent m_ButtonRight
SCR_PagingButtonComponent m_ButtonLeft
static const ref Color COLOR_HINT_SELECTED
static const ref Color COLOR_HINT_DESELECTED
void RemoveActionListeners()
ResourceName m_sHintElementTexture
ResourceName m_sHintElementImage
ScriptInvoker GetOnRightArrowClick()
ScriptInvoker GetOnLeftArrowClick()
bool m_bHasActionListeners
bool SetCurrentItem_Internal(int i, bool playSound, bool animate, bool invokeOnChanged)
static SCR_SpinBoxComponent GetSpinBoxComponent(string name, Widget parent, bool searchAllChildren=true)
override bool SetCurrentItem(int i, bool playSound=false, bool animate=false)
void EnableArrows(int selected, bool animate)
Based on cycle mode set which arrow should be enabled at given selection.
override int AddItem(string item, bool last=false, Managed data=null)
void SetCycleMode(bool cycle)
override void HandlerAttached(Widget w)
void SetKeepActionListeners(bool keep)
bool m_bAllowSwitchingWithoutFocus
static bool SetTexture(ImageWidget widget, ResourceName texture, string image="")
SCR_FieldOfViewSettings Attribute
WidgetFlags
Widget flags. See enf::Widget::SetFlags().