Esempio n. 1
0
 protected void HandleItemRightClick(DaggerfallUnityItem item, bool remote = false)
 {
     // Info
     if (selectedActionMode == ActionModes.Info)
     {
         ShowInfoPopup(item);
     }
     // Use unequippable items
     else if (item.IsLightSource || item.IsParchment || item.IsIngredient || item.IsPotion || item.ItemGroup == ItemGroups.Books ||
              (item.ItemGroup != ItemGroups.Weapons &&
               item.ItemGroup != ItemGroups.Armor &&
               item.ItemGroup != ItemGroups.MensClothing &&
               item.ItemGroup != ItemGroups.WomensClothing &&
               item.ItemGroup != ItemGroups.Jewellery &&
               !item.IsPotion && !item.IsPotionRecipe && !item.IsIngredient))
     {
         if (!item.UseItem(localItems))
         {
             UseItem(item, localItems);
         }
         Refresh(false);
     }
     // Display recipe in a message box
     else if (item.IsPotionRecipe)
     {
         DaggerfallMessageBox messageBoxRecipe = new DaggerfallMessageBox(uiManager, this);
         messageBoxRecipe.SetTextTokens(item.GetMacroDataSource().PotionRecipeIngredients(TextFile.Formatting.JustifyCenter));
         messageBoxRecipe.ClickAnywhereToClose = true;
         messageBoxRecipe.Show();
     }
     // Equip apparel/weapon
     else
     {
         if (remote)
         {
             // Transfer to local items
             if (localItems != null)
             {
                 TransferItem(item, remoteItems, localItems, CanCarryAmount(item), equip: true);
             }
             if (theftBasket != null && lootTarget != null && lootTarget.houseOwned)
             {
                 theftBasket.AddItem(item);
             }
         }
         else
         {
             EquipItem(item);
         }
     }
     DaggerfallUI.Instance.PlayOneShot(SoundClips.ButtonClick);
 }