Esempio n. 1
0
 private void ArmorSlot_OnItemDropped(object sender, UI_CharacterEquipmentSlot.OnItemDroppedEventArgs e)
 {
     // Item dropped in Armor slot
     CharacterEquipment.EquipSlot equipSlot = CharacterEquipment.EquipSlot.Armor;
     if (characterEquipment.IsEquipSlotEmpty(equipSlot) && characterEquipment.CanEquipItem(equipSlot, e.item))
     {
         e.item.RemoveFromItemHolder();
         characterEquipment.EquipItem(e.item);
     }
     //characterEquipment.TryEquipItem(CharacterEquipment.EquipSlot.Armor, e.item);
 }
Esempio n. 2
0
 public static void Postfix(Item takenItem, CharacterEquipment ___m_characterEquipment)
 {
     try
     {
         if (takenItem is Equipment equipment)
         {
             QuiverEquipFix.self.Logger.LogDebug("The 'takenItem' is " + takenItem);
             QuiverEquipFix.self.Logger.LogDebug("Running 'CharacterInventory_TakeItem' Postfix");
             if ((equipment.EquipSlot == EquipmentSlot.EquipmentSlotIDs.Quiver) &&
                 ___m_characterEquipment.GetEquippedAmmunition() &&
                 (___m_characterEquipment.GetEquippedAmmunition().ItemID
                  != takenItem.ItemID))
             {
                 ___m_characterEquipment.EquipItem(equipment, false);
             }
         }
     }
     catch (Exception e)
     {
         QuiverEquipFix.self.Logger.LogFatal(e.Message);
         throw e;
     }
 }