Example #1
0
        public bool SellItem(Item item)
        {
            if (item.BuyPrice() <= 0 || item.GetSellPrice().Key == null)
            {
                messageFeedManager.WriteMessage("The vendor does not want to buy the " + item.DisplayName);
                return(false);
            }
            KeyValuePair <Currency, int> sellAmount = item.GetSellPrice();

            playerManager.MyCharacter.CharacterCurrencyManager.AddCurrency(sellAmount.Key, sellAmount.Value);
            AddToBuyBackCollection(item);
            item.Slot.RemoveItem(item);

            if (systemConfigurationManager.VendorAudioProfile?.AudioClip != null)
            {
                audioManager.PlayEffect(systemConfigurationManager.VendorAudioProfile.AudioClip);
            }
            string priceString = currencyConverter.GetCombinedPriceString(sellAmount.Key, sellAmount.Value);

            messageFeedManager.WriteMessage("Sold " + item.DisplayName + " for " + priceString);


            if (dropDownIndex == 0)
            {
                /*
                 * CreatePages(vendorCollections[dropDownIndex].MyVendorItems);
                 * LoadPage(pageIndex);
                 * OnPageCountUpdate(false);
                 */
                RefreshPage();
            }
            return(true);
        }
 public void SaveGame()
 {
     //Debug.Log("MainMenuController.SaveGame()");
     currentNavigationController?.CurrentNavigableElement?.DeSelect();
     if (saveManager.SaveGame())
     {
         uIManager.CloseAllSystemWindows();
         messageFeedManager.WriteMessage("Game Saved");
     }
 }