public void AddHotkeyLabels(uGUI_QuickSlots instance) { if (instance == null || !Mod.config.ShowInputText) { tryAddLabels = true; return; } uGUI_ItemIcon[] icons = (uGUI_ItemIcon[])uGUI_QuickSlots_icons.GetValue(instance); if (icons == null || icons.Length == 0) { tryAddLabels = true; return; } Text textPrefab = GetTextPrefab(); if (textPrefab == null) { tryAddLabels = true; return; } for (int i = 0; i < icons.Length; ++i) { uGUI_ItemIcon icon = icons[i]; var text = CreateNewText(textPrefab, icon.transform, Mod.GetInputForSlot(i), i); } tryAddLabels = false; }
public void AddHotkeyLabels(uGUI_QuickSlots instance) { if (instance == null || !instance.gameObject.activeSelf || !instance.gameObject.activeInHierarchy) { return; } Text textPrefab = GetTextPrefab(); if (textPrefab == null) { return; } uGUI_ItemIcon[] icons = (uGUI_ItemIcon[])uGUI_QuickSlots_icons.GetValue(instance); if (icons == null || icons.Length == 0) { return; } for (int i = 0; i < icons.Length; ++i) { uGUI_ItemIcon icon = icons[i]; var text = CreateNewText(textPrefab, icon.transform, Mod.GetInputForSlot(i), i); } createdLabels = true; }
public static bool GetKeyDownForSlot(int slotID) { return(slotID >= Player.quickSlotButtonsCount && slotID < Mod.MaxSlots && Input.GetKeyDown(Mod.GetInputForSlot(slotID))); }