3enum EConsoleButtonsControls
32 protected int m_CurrentTabIdx = -1;
33 protected int m_CurrentPresetVariant = -1;
50 protected const int AREA_LEFT = 1;
51 protected const int AREA_RIGHT = 2;
52 protected const int PLATFORM_ADJUST_X1 = 1000;
53 protected const int PLATFORM_ADJUST_PS = 2000;
60 PPERequesterBank.GetRequester(PPERequesterBank.REQ_MENUEFFECTS).Stop();
65 #ifdef PLATFORM_CONSOLE
73 bool mk =
GetGame().GetInput().IsEnabledMouseAndKeyboard();
74 bool mkServer =
GetGame().GetInput().IsEnabledMouseAndKeyboardEvenOnServer();
76 switch (pInputDeviceType)
81 GetGame().GetUIManager().ShowUICursor(
false);
86 if (
GetGame().GetInput().IsEnabledMouseAndKeyboard())
88 GetGame().GetUIManager().ShowUICursor(
true);
98 GetGame().GetUIManager().Back();
105 if (m_CurrentTabIdx != -1)
107 m_VariantWidget.Show(
false);
108 while (m_VariantWidget.GetParent())
110 m_VariantWidget = m_VariantWidget.GetParent();
111 m_VariantWidget.Show(
false);
120 while (w.GetParent())
127 m_CurrentTabIdx = tab_index;
135 m_CanvasWidget.Clear();
143 wid_side = m_VariantWidget.GetChildren();
144 typename t = EConsoleButtonsControls;
154 side_idx = wid_side.GetUserID();
155 wid_spacer = wid_side.GetChildren();
157 for (
int i = 1; i <
EnumTools.GetEnumSize(EConsoleButtonsControls); i++)
161 t.GetVariableValue(null, i, enum_value);
166 button_mapping.Insert(enum_value,items_filtered);
169 m_AreasLR.Insert(side_idx,button_mapping);
171 wid_side = wid_side.GetSibling();
183 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/xbox/Controls_Screen.layout");
185 m_ControlsImage = layoutRoot.FindAnyWidget(
"XboxControlsImage");
188 m_ControlsImage = layoutRoot.FindAnyWidget(
"PSControlsImage");
191 m_ControlsImage.Show(
true);
192 m_TabberWidget = layoutRoot.FindAnyWidget(
"Tabber");
194 m_TabScript.m_OnTabSwitch.Insert(UpdateTabContent);
195 m_CanvasWidget = CanvasWidget.Cast(layoutRoot.FindAnyWidget(
"CanvasUniversal"));
196 m_Back = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"back"));
202 PPERequester_MenuEffects requester;
203 Class.CastTo(requester,PPERequesterBank.GetRequester(PPERequesterBank.REQ_MENUEFFECTS));
204 requester.SetVignetteIntensity(0.6);
223 override bool OnClick(Widget w,
int x,
int y,
int button)
278 return (w && w ==
m_Back);
283 if (
GetUApi().GetInputByID(UAUITabLeft).LocalPress())
288 if (
GetUApi().GetInputByID(UAUITabRight).LocalPress())
293 if (
GetUApi().GetInputByID(UAUIBack).LocalPress())
298 if (
GetUApi().GetInputByID(UASwitchPreset).LocalPress())
308 if (m_CategoryStructure)
310 m_CategoryStructure = null;
314 if (m_ImageMarkerStructure)
316 m_ImageMarkerStructure = null;
320 Widget w = m_ControlsImage.GetChildren();
321 m_ImageMarkerStructure.Set(w.GetUserID(),w);
323 while (w.GetSibling())
326 m_ImageMarkerStructure.Set(w.GetUserID(),w);
332 m_PlatformHolder =
FindChildByID(layoutRoot,PLATFORM_ADJUST_X1);
334 m_PlatformHolder =
FindChildByID(layoutRoot,PLATFORM_ADJUST_PS);
338 Widget category_widget = m_PlatformHolder.GetChildren();
339 m_CategoryStructure.Set(category_widget.GetUserID(),category_widget);
341 while (category_widget.GetSibling())
343 category_widget = category_widget.GetSibling();
344 m_CategoryStructure.Set(category_widget.GetUserID(),category_widget);
350 Print(
"PerformSwitchPreset - 1");
355 index = inputAPI.PresetCurrent() + 1;
356 if (index >= inputAPI.PresetCount())
361 inputAPI.SupressNextFrame(
true);
362 inputAPI.PresetSelect(index);
365 GetGame().GetMission().GetOnInputPresetChanged().Invoke();
367 #ifdef PLATFORM_WINDOWS
370 GetUApi().SaveInputPresetMiscData();
380 int target_idx = inputAPI.PresetCurrent() + 1;
381 int count = inputAPI.PresetCount();
382 if (target_idx >= inputAPI.PresetCount())
387 m_NextPresetText = inputAPI.PresetName(target_idx);
388 if (m_NextPresetText ==
InputUtils.PRESET_OLD)
390 m_NextPresetText =
"#STR_UAPRESET_ChangeTo_0";
392 else if (m_NextPresetText ==
InputUtils.PRESET_NEW)
394 m_NextPresetText =
"#STR_UAPRESET_ChangeTo_1";
405 Widget ret = wid.GetChildren();
408 if (ret.GetUserID() == user_id)
412 ret = ret.GetSibling();
420 Widget child = wid.GetChildren();
423 if (child.GetUserID() == user_id)
425 results.Insert(child);
427 child = child.GetSibling();
429 return (results && results.Count() > 0);
435 for (
int i = 0; i < input.Count(); i++)
437 if (input[i].IsVisible())
439 filtered.Insert(input[i]);
443 return filtered.Count();
451 int color_pnl =
ARGB(255, 0, 0, 0);
452 int color_lbl =
ARGB(255, 255, 0, 0);
454 #ifdef PLATFORM_CONSOLE
455 color_pnl =
ARGB(255, 200, 0, 0);
456 color_lbl =
ARGB(255, 255, 255, 255);
468 int color_pnl =
ARGB(0, 0, 0, 0);
469 int color_lbl =
ARGB(255, 255, 255, 255);
480 TextWidget label = TextWidget.Cast(w.FindWidget(w.GetName() +
"_label"));
494 Widget panel = w.FindWidget(w.GetName() +
"_panel");
498 panel.SetColor(color);
507 TextWidget label = TextWidget.Cast(w.FindAnyWidget(w.GetName() +
"_label"));
508 TextWidget text = TextWidget.Cast(w.FindAnyWidget(w.GetName() +
"_text"));
509 TextWidget text2 = TextWidget.Cast(w.FindAnyWidget(w.GetName() +
"_text_1"));
513 label.SetColor(color);
518 text.SetColor(color);
523 text2.SetColor(color);
534 toolbar_text.SetText(text);
542 bool toolbarShow =
false;
543 #ifdef PLATFORM_CONSOLE
544 toolbarShow = !
GetGame().GetInput().IsEnabledMouseAndKeyboardEvenOnServer() ||
GetGame().GetInput().GetCurrentInputDevice() ==
EInputDeviceType.CONTROLLER;
547 layoutRoot.FindAnyWidget(
"toolbar_bg").Show(toolbarShow);
548 layoutRoot.FindAnyWidget(
"play_panel_root").Show(!toolbarShow);
void OnInputPresetChanged()
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
Super root of all classes in Enforce script.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
enum map TButtonPairingInfo
@ BUTTON_GROUP_PAD_COMMON
@ BUTTON_GROUP_RIGHT_SIDE_COMMON
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
int ARGB(int a, int r, int g, int b)