6 ResourceName m_sPrimarySecondaryWeapon =
"{F565C4A388964DBE}UI/Textures/InventoryIcons/InventorySlot_gadget.edds";
8 protected ImageWidget m_wGamepadHintSmall;
9 protected ImageWidget m_wGamepadHintLarge;
10 protected RichTextWidget m_wKeybindText;
18 GetGame().OnInputDeviceIsGamepadInvoker().Insert(UpdateHints);
23 override void SetSlotVisible(
bool bVisible )
25 super.SetSlotVisible( bVisible );
27 m_wKeybindText = RichTextWidget.Cast(m_widget.FindAnyWidget(
"KeybindRichText"));
28 if (m_wKeybindText && !GetStorageUI().GetInventoryMenuHandler())
30 EInputDeviceType currentDevice =
GetGame().GetInputManager().GetLastUsedInputDevice();
31 InputBinding binding =
GetGame().GetInputManager().CreateUserBinding();
33 string deviceString =
"keyboard";
34 if (currentDevice == EInputDeviceType.GAMEPAD)
35 deviceString =
"gamepad";
37 string name =
string.Format(
"%1%2",
"SwitchWeaponCategory", (m_iQuickSlotIndex + 1));
39 array<string> bindings = {};
40 if (deviceString ==
"gamepad" &&
41 !binding.GetBindings(name, bindings, currentDevice))
44 if (name ==
"SwitchWeaponCategory10")
45 name =
"SwitchWeaponCategory0";
47 m_wKeybindText.SetText(
string.Format(
"<action name='%1' preset='%2' device='" + deviceString +
"' scale='1.25'/>", name,
""));
52 m_wSelectedEffect = m_widget.FindAnyWidget(
"SelectedFrame");
56 m_wTextQuickSlotLarge = TextWidget.Cast( m_widget.FindAnyWidget(
"TextQuickSlotLarge" ) );
57 SetQuickSlotIndexVisible( m_wTextQuickSlotLarge,
true );
58 SetQuickSlotHintVisible(m_wKeybindText);
62 SetQuickSlotIndexVisible( m_wTextQuickSlot, m_pStorageUI.GetInventoryMenuHandler() !=
null );
63 SetQuickSlotHintVisible(m_wKeybindText);
68 m_wSelectedEffect =
null;
69 m_wTextQuickSlotLarge =
null;
74 override string SetSlotSize()
79 if ( m_iQuickSlotIndex < 2 )
100 void SetQuickSlotHintVisible(RichTextWidget hintWidget)
103 hintWidget.SetVisible(
true);
111 m_iQuickSlotIndex = iSlotIndex;