5 protected ref array<ref SCR_FieldManualPiece_Keybind> m_aKeybinds;
7 [
Attribute(defvalue:
"{3D06849921063735}UI/layouts/Menus/FieldManual/Pieces/FieldManual_Piece_KeybindList.layout", uiwidget: UIWidgets.EditBoxWithButton,
params:
"layout")]
8 protected ResourceName m_Layout;
10 protected ref Widget m_KeybindsLayout;
13 override void CreateWidget(notnull Widget parent)
15 WorkspaceWidget workspace =
GetGame().GetWorkspace();
17 Widget createdWidget = workspace.CreateWidgets(
m_Layout, parent);
20 Print(
"could not create Keybind List widget | " + FilePath.StripPath(__FILE__) +
":" + __LINE__, LogLevel.WARNING);
24 Widget keybindsLayout =
SCR_WidgetHelper.GetWidgetOrChild(createdWidget,
"KeybindsLayout");
28 m_KeybindsLayout = keybindsLayout;
31 GetGame().OnInputDeviceIsGamepadInvoker().Insert(CreateKeybinds);
35 protected void CreateKeybinds(
bool isGamepad)
39 if (!m_aKeybinds || m_aKeybinds.IsEmpty())
49 array<ref SCR_FieldManualPiece_Keybind> arrayCopy = {};
52 if (conditions.Contains(keybind.m_eInputDisplayCondition))
53 arrayCopy.Insert(keybind);
56 if (arrayCopy.IsEmpty())
59 int countMinus1 = arrayCopy.Count() - 1;
60 for (
int i; i < countMinus1; i++)
62 arrayCopy[i].CreateWidget(m_KeybindsLayout,
false);
64 arrayCopy[countMinus1].CreateWidget(m_KeybindsLayout,
true);
80 GetGame().OnInputDeviceIsGamepadInvoker().Remove(CreateKeybinds);