コード例 #1
0
        public void HandleSlotClick(Kingmaker.UI.ServiceWindow.ItemSlot slot)
        {
            Mod.Debug(MethodBase.GetCurrentMethod());

            bool control = Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl);

            if (control && ToggleVendorTrash && Mod.Enabled)
            {
                if (!slot.Item.IsNonRemovable && VendorTrashItems.Contains(slot.Item.Blueprint.AssetGuid) && slot.Index != -1)
                {
                    VendorTrashItems.Remove(slot.Item.Blueprint.AssetGuid);
                    Mod.Debug(string.Format("{0} removed from trash list.", slot.Item.Blueprint.Name));

                    foreach (ItemTypicalSlot itp in slot.ParentGroup.Slots)
                    {
                        ItemSlotHelper.HighlightSlots(itp);
                    }
                }
                else
                {
                    if (!slot.Item.IsNonRemovable && !VendorInject.invalidItems.Contains(slot.Item.Blueprint.AssetGuid) && slot.Index != -1)
                    {
                        VendorTrashItems.Add(slot.Item.Blueprint.AssetGuid);
                        Mod.Debug(string.Format("{0} added to trash list.", slot.Item.Blueprint.Name));
                        foreach (ItemTypicalSlot itp in slot.ParentGroup.Slots)
                        {
                            ItemSlotHelper.HighlightSlots(itp);
                        }
                    }
                }
            }
        }
コード例 #2
0
            private static void Postfix(Kingmaker.UI.ServiceWindow.ItemSlot __instance, ref string __result)
            {
                var currentCharacter = UIUtility.GetCurrentCharacter();
                var component        = __instance.Item.Blueprint.GetComponent <CopyItem>();
                var actionName       = component?.GetActionName(currentCharacter) ?? string.Empty;

                if (!string.IsNullOrWhiteSpace(actionName))
                {
                    actionName = GetSpellbookActionName(actionName, __instance.Item, currentCharacter);
                }
                __result = actionName;
            }
コード例 #3
0
 public static void HighlightSlots(Kingmaker.UI.ServiceWindow.ItemSlot itemSlot)
 {
     if (itemSlot.Index != -1 && itemSlot.HasItem && VendorTrashItems.Contains(itemSlot.Item.Blueprint.AssetGuid) && ToggleVendorTrash && Mod.Enabled)
     {
         itemSlot.ItemImage.color = TrashColor;
     }
     else if (itemSlot.Index != -1 && itemSlot.HasItem && itemSlot.IsScroll && ToggleHighlightScrolls && Mod.Enabled)
     {
         itemSlot.ItemImage.color = ScrollColor;
     }
     else
     {
         if (itemSlot.HasItem)
         {
             itemSlot.ItemImage.color = Color.white;
         }
         else
         {
             itemSlot.ItemImage.color = Color.clear;
         }
     }
 }
コード例 #4
0
 public void HandleSlotSplit(Kingmaker.UI.ServiceWindow.ItemSlot from, Kingmaker.UI.ServiceWindow.ItemSlot to, int count = 0)
 {
 }
コード例 #5
0
 public void HandleSlotHoverStart(Kingmaker.UI.ServiceWindow.ItemSlot slot)
 {
 }
コード例 #6
0
 public void HandleSlotDrop(Kingmaker.UI.ServiceWindow.ItemSlot slot)
 {
 }
コード例 #7
0
 public void HandleSlotDragEnd(Kingmaker.UI.ServiceWindow.ItemSlot from, Kingmaker.UI.ServiceWindow.ItemSlot to)
 {
 }
コード例 #8
0
 public void HandleSlotDoubleClick(Kingmaker.UI.ServiceWindow.ItemSlot slot)
 {
 }
コード例 #9
0
 public static void Postfix(Kingmaker.UI.ServiceWindow.ItemSlot __instance)
 {
     ItemSlotHelper.HighlightSlots(__instance);
     __instance.UpdateCount();
 }