30 m_PrimaryClear =
m_Root.FindAnyWidget(
"primary_clear");
31 m_AlternativeClear =
m_Root.FindAnyWidget(
"alternative_clear");
42 return "gui/layouts/new_ui/options/keybindings_selectors/keybinding_option.layout";
71 for (a = 0; a <
pInput.AlternativeCount(); a++)
73 pInput.SelectAlternative(a);
76 if (
pInput.BindingCount() > 0)
86 for (
i = 1;
i <
pInput.BindingCount();
i++)
100 if (
pInput.BindingCount() > 0)
126 m_IsAlternateEdited =
false;
128 m_CustomAlternateBind =
null;
130 if (
input.IsLimited())
132 if (
input.IsPressLimit())
133 m_ElementModifier.SetText(
"#keybind_press");
134 if (
input.IsReleaseLimit())
135 m_ElementModifier.SetText(
"#keybind_release");
136 if (
input.IsHoldLimit())
137 m_ElementModifier.SetText(
"#keybind_hold");
138 if (
input.IsHoldBeginLimit())
139 m_ElementModifier.SetText(
"#keybind_holdbegin");
140 if (
input.IsClickLimit())
141 m_ElementModifier.SetText(
"#keybind_click");
142 if (
input.IsDoubleClickLimit())
143 m_ElementModifier.SetText(
"#keybind_doubletap");
146 m_ElementModifier.SetText(
"");
183 m_IsAlternateEdited =
true;
184 m_AlternativeBindButton.SetText(
output);
190 m_PrimaryBindButton.SetText(
output);
196 m_Group.StartEnteringKeybind(m_ElementIndex);
197 m_PrimaryBindButton.SetText(
"#layout_keybinding_new_keybind");
207 m_Group.StartEnteringAlternateKeybind(m_ElementIndex);
208 m_AlternativeBindButton.SetText(
"#layout_keybinding_new_keybind");
218 if (!m_Group.IsEnteringKeyBind())
220 if (
w == m_PrimaryBindButton)
221 m_EntryTimer.Run(0.01,
this,
"StartEnteringKeybind");
222 if (
w == m_AlternativeBindButton)
223 m_EntryTimer.Run(0.01,
this,
"StartEnteringAlternateKeybind");
230 if (
w == m_PrimaryClear)
234 m_PrimaryBindButton.SetText(
"");
235 m_Group.ClearKeybind(m_ElementIndex);
237 if (
w == m_AlternativeClear)
239 m_IsAlternateEdited =
true;
241 m_AlternativeBindButton.SetText(
"");
242 m_Group.ClearAlternativeKeybind(m_ElementIndex);
249 if (
w == m_PrimaryBindButton ||
w == m_PrimaryClear)
251 m_PrimaryBindButton.SetColor(
ARGBF(1, 1, 0, 0));
252 m_PrimaryClear.Show(
true);
253 m_PrimaryClear.Update();
254 m_AlternativeClear.Show(
false);
257 else if (
w == m_AlternativeBindButton ||
w == m_AlternativeClear)
259 m_AlternativeBindButton.SetColor(
ARGBF(1, 1, 0, 0));
260 m_PrimaryClear.Show(
false);
261 m_AlternativeClear.Show(
true);
262 m_AlternativeClear.Update();
267 m_PrimaryBindButton.SetColor(
ARGBF(0, 0, 0, 0));
268 m_AlternativeBindButton.SetColor(
ARGBF(1, 0, 0, 0));
269 m_PrimaryClear.Show(
false);
270 m_AlternativeClear.Show(
false);
277 if (
w == m_PrimaryClear ||
w == m_PrimaryBindButton)
279 if (
enterW != m_PrimaryClear &&
enterW != m_PrimaryBindButton)
281 m_PrimaryClear.Show(
false);
282 m_PrimaryBindButton.SetColor(
ARGBF(1, 0, 0, 0));
285 if (
w == m_AlternativeClear ||
w == m_AlternativeBindButton)
287 if (
enterW != m_AlternativeClear &&
enterW != m_AlternativeBindButton)
289 m_AlternativeClear.Show(
false);
290 m_AlternativeBindButton.SetColor(
ARGBF(1, 0, 0, 0));
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
proto native CGame GetGame()
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.