示例#1
0
        private static void Postfix(Player __instance, bool __result, ItemDrop.ItemData item)
        {
            if (!Configuration.Current.Player.IsEnabled || !Configuration.Current.Player.queueWeaponChanges)
            {
                return;
            }

            if (!__result || !item.IsEquipable())
            {
                // Item is not equipable (second case should never happen as the original always returns false if not equipable)
                return;
            }
            if (__instance.InAttack())
            {
                // Store the item(s) to equip when the attack is finished
                if (EquipPatchState.items == null)
                {
                    EquipPatchState.items = new List <ItemDrop.ItemData>();
                }

                if (!EquipPatchState.items.Contains(item))
                {
                    EquipPatchState.items.Add(item);
                }

                EquipPatchState.shouldEquipItemsAfterAttack = true;
            }
        }
示例#2
0
        public static bool ShouldBeDeleted(ItemDrop.ItemData item)
        {
            return((Settings.Grave.DeleteHotbar.Value && item.m_gridPos.y == 0)

                   || (Settings.Grave.DeleteEquipped.Value && item.m_equiped)

                   || (Settings.Grave.DeleteEquipment.Value && item.IsEquipable())

                   // These 12 categories below is what the game considers Equip-able
                   || (Settings.Grave.DeleteOneHandedWeapons.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.OneHandedWeapon) ||
                   (Settings.Grave.DeleteTwoHandedWeapons.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.TwoHandedWeapon) ||
                   (Settings.Grave.DeleteShields.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Shield) ||
                   (Settings.Grave.DeleteBows.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Bow) ||
                   (Settings.Grave.DeleteHelmets.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Helmet) ||
                   (Settings.Grave.DeleteChests.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Chest) ||
                   (Settings.Grave.DeleteLegs.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Legs) ||
                   (Settings.Grave.DeleteHands.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Hands) ||
                   (Settings.Grave.DeleteShoulders.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Shoulder) ||
                   (Settings.Grave.DeleteUtility.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Utility) ||
                   (Settings.Grave.DeleteTorchs.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Torch) ||
                   (Settings.Grave.DeleteAmmo.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Ammo)

                   || (Settings.Grave.DeleteMaterials.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Material) ||
                   (Settings.Grave.DeleteConsumables.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Consumable) ||
                   (Settings.Grave.DeleteTrophies.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Trophie) ||
                   (Settings.Grave.DeleteMisc.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Misc) ||
                   (Settings.Grave.DeleteTools.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Tool));
        }
示例#3
0
        public static bool ShouldKeepItem(ItemDrop.ItemData item)
        {
            return((Settings.KeepInventory.KeepHotbar.Value && item.m_gridPos.y == 0)

                   || (Settings.KeepInventory.KeepEquipped.Value && item.m_equiped)

                   || (Settings.KeepInventory.KeepEquipment.Value && item.IsEquipable())

                   // These 12 categories below is what the game considers Equip-able
                   || (Settings.KeepInventory.KeepOneHandedWeapons.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.OneHandedWeapon) ||
                   (Settings.KeepInventory.KeepTwoHandedWeapons.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.TwoHandedWeapon) ||
                   (Settings.KeepInventory.KeepShields.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Shield) ||
                   (Settings.KeepInventory.KeepBows.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Bow) ||
                   (Settings.KeepInventory.KeepHelmets.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Helmet) ||
                   (Settings.KeepInventory.KeepChests.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Chest) ||
                   (Settings.KeepInventory.KeepLegs.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Legs) ||
                   (Settings.KeepInventory.KeepHands.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Hands) ||
                   (Settings.KeepInventory.KeepShoulders.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Shoulder) ||
                   (Settings.KeepInventory.KeepUtility.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Utility) ||
                   (Settings.KeepInventory.KeepTorchs.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Torch) ||
                   (Settings.KeepInventory.KeepAmmo.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Ammo)

                   || (Settings.KeepInventory.KeepMaterials.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Material) ||
                   (Settings.KeepInventory.KeepConsumables.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Consumable) ||
                   (Settings.KeepInventory.KeepTrophies.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Trophie) ||
                   (Settings.KeepInventory.KeepMisc.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Misc) ||
                   (Settings.KeepInventory.KeepTools.Value && item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Tool) ||
                   item.m_shared.m_questItem);
        }
        public static bool Prefix(ItemDrop.ItemData item, UITooltip tooltip)
        {
            string tooltipText;

            if (item.IsEquipable() && !item.m_equiped && Player.m_localPlayer != null && Player.m_localPlayer.HasEquipmentOfType(item.m_shared.m_itemType) && Input.GetKey(KeyCode.LeftControl))
            {
                var otherItem = Player.m_localPlayer.GetEquipmentOfType(item.m_shared.m_itemType);
                tooltipText = item.GetTooltip() + $"\n\n<color=#AAA><i>Currently Equipped:</i></color>\n<size=18>{otherItem.GetDecoratedName()}</size>\n" + otherItem.GetTooltip();
            }
            else
            {
                tooltipText = item.GetTooltip();
            }
            tooltip.Set(item.GetDecoratedName(), tooltipText);
            return(false);
        }