29 m_PrimaryClear =
m_Root.FindAnyWidget(
"primary_clear");
30 m_AlternativeClear =
m_Root.FindAnyWidget(
"alternative_clear");
41 return "gui/layouts/new_ui/options/keybindings_selectors/keybinding_option.layout";
70 for (a = 0; a <
pInput.AlternativeCount(); a++)
72 pInput.SelectAlternative(a);
75 if (
pInput.BindingCount() > 0)
85 for (
i = 1;
i <
pInput.BindingCount();
i++)
99 if (
pInput.BindingCount() > 0)
124 m_IsAlternateEdited =
false;
126 m_CustomAlternateBind =
null;
128 if (
input.IsLimited())
130 if (
input.IsPressLimit())
131 m_ElementModifier.SetText(
"#keybind_press");
132 if (
input.IsReleaseLimit())
133 m_ElementModifier.SetText(
"#keybind_release");
134 if (
input.IsHoldLimit())
135 m_ElementModifier.SetText(
"#keybind_hold");
136 if (
input.IsHoldBeginLimit())
137 m_ElementModifier.SetText(
"#keybind_holdbegin");
138 if (
input.IsClickLimit())
139 m_ElementModifier.SetText(
"#keybind_click");
140 if (
input.IsDoubleClickLimit())
141 m_ElementModifier.SetText(
"#keybind_doubletap");
144 m_ElementModifier.SetText(
"");
181 m_IsAlternateEdited =
true;
182 m_AlternativeBindButton.SetText(
output);
188 m_PrimaryBindButton.SetText(
output);
194 m_Container.StartEnteringKeybind(m_ElementIndex);
195 m_PrimaryBindButton.SetText(
"#layout_keybinding_new_keybind");
205 m_Container.StartEnteringAlternateKeybind(m_ElementIndex);
206 m_AlternativeBindButton.SetText(
"#layout_keybinding_new_keybind");
216 if (!m_Container.IsEnteringKeyBind())
218 if (
w == m_PrimaryBindButton)
219 m_EntryTimer.Run(0.01,
this,
"StartEnteringKeybind");
220 if (
w == m_AlternativeBindButton)
221 m_EntryTimer.Run(0.01,
this,
"StartEnteringAlternateKeybind");
228 if (
w == m_PrimaryClear)
232 m_PrimaryBindButton.SetText(
"");
233 m_Container.ClearKeybind(m_ElementIndex);
235 if (
w == m_AlternativeClear)
237 m_IsAlternateEdited =
true;
239 m_AlternativeBindButton.SetText(
"");
240 m_Container.ClearAlternativeKeybind(m_ElementIndex);
247 if (
w == m_PrimaryBindButton ||
w == m_PrimaryClear)
249 m_PrimaryBindButton.SetColor(
ARGBF(1, 1, 0, 0));
250 m_PrimaryClear.Show(
true);
251 m_PrimaryClear.Update();
252 m_AlternativeClear.Show(
false);
255 else if (
w == m_AlternativeBindButton ||
w == m_AlternativeClear)
257 m_AlternativeBindButton.SetColor(
ARGBF(1, 1, 0, 0));
258 m_PrimaryClear.Show(
false);
259 m_AlternativeClear.Show(
true);
260 m_AlternativeClear.Update();
265 m_PrimaryBindButton.SetColor(
ARGBF(0, 0, 0, 0));
266 m_AlternativeBindButton.SetColor(
ARGBF(1, 0, 0, 0));
267 m_PrimaryClear.Show(
false);
268 m_AlternativeClear.Show(
false);
275 if (
w == m_PrimaryClear ||
w == m_PrimaryBindButton)
277 if (
enterW != m_PrimaryClear &&
enterW != m_PrimaryBindButton)
279 m_PrimaryClear.Show(
false);
280 m_PrimaryBindButton.SetColor(
ARGBF(1, 0, 0, 0));
283 if (
w == m_AlternativeClear ||
w == m_AlternativeBindButton)
285 if (
enterW != m_AlternativeClear &&
enterW != m_AlternativeBindButton)
287 m_AlternativeClear.Show(
false);
288 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.