4 protected Widget m_DetailsRoot;
6 protected TutorialsMenu
m_Menu;
8 void TutorialKeybinds(
Widget parent, TutorialsMenu menu)
10 m_Root =
GetGame().GetWorkspace().CreateWidgets(GetLayoutName(), parent);
20 string option_text =
"";
22 GetUApi().GetActiveInputs(actions);
24 actionCount = actions.Count();
25 for (
int i = 0; i < actionCount; i++)
30 if (item_index < actionMax)
34 GetGame().GetInput().GetActionDesc(actions.Get(i), option_text);
35 if (SetElementTitle(input, EUAINPUT_DEVICE_KEYBOARDMOUSE, output))
37 column_index =
Math.Floor(item_index / 21);
38 Widget w =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/tutorials/xbox/keybindings_panels/keybinding_panel.layout",
m_Root.FindAnyWidget(
"container" + column_index));
39 Widget spacer = w.FindWidget(
"Spacer");
44 string modifier_text =
"";
45 name.SetText(option_text);
46 value.SetText(output);
48 if (SetElementModifier(input, modifier_text))
50 mod.SetText(modifier_text);
64 GetGame().GetInput().GetActionDesc(actions[i], option_text);
74 bool SetElementTitle(
UAInput pInput,
int iDeviceFlags, out
string output)
76 int a, i, countbind = 0;
78 for (a = 0; a < pInput.AlternativeCount(); a++)
80 pInput.SelectAlternative(a);
83 if (pInput.BindingCount() > 0)
85 if (pInput.Binding(0) != 0 && pInput.CheckBindDevice(0,iDeviceFlags))
90 output +=
GetUApi().GetButtonName(pInput.Binding(0));
93 for (i = 1; i < pInput.BindingCount(); i++)
95 if (pInput.Binding(i) != 0)
97 output +=
" + " +
GetUApi().GetButtonName(pInput.Binding(i));
107 if (pInput.BindingCount() > 0)
109 if (pInput.Binding(0) != 0 && pInput.CheckBindDevice(0,iDeviceFlags))
114 output +=
GetUApi().GetButtonName(pInput.Binding(0));
122 return (countbind > 0);
126 bool SetElementModifier(
UAInput pInput, out
string output)
128 if (pInput.IsLimited())
130 if (pInput.IsPressLimit())
132 output =
"#keybind_press";
134 if (pInput.IsReleaseLimit())
136 output =
"#keybind_release";
138 if (pInput.IsHoldLimit())
140 output =
"#keybind_hold";
142 if (pInput.IsHoldBeginLimit())
144 output =
"#keybind_holdbegin";
146 if (pInput.IsClickLimit())
148 output =
"#keybind_click";
150 if (pInput.IsDoubleClickLimit())
152 output =
"#keybind_doubletap";
163 void ~TutorialKeybinds()
168 string GetLayoutName()
170 return "gui/layouts/new_ui/tutorials/xbox/keybinds_tab.layout";