public void Sell() { Faction.Economy.CurrentMoney += SellCart.ComputeTotal(); List <ResourceAmount> removals = new List <ResourceAmount>(); foreach (GItem item in SellCart.Items) { removals.Add(new ResourceAmount(item.Name) { NumResources = item.CurrentAmount }); } Faction.RemoveResources(removals, Microsoft.Xna.Framework.Vector3.Zero); }
void sellButton_OnClicked() { float total = SellCart.ComputeTotal(); if (!(total > 0)) { Dialog.Popup(GUI, "Nothing to sell!", "Nothing to sell. Select something from the left panel.", Dialog.ButtonType.OK); return; } SoundManager.PlaySound(ContentPaths.Audio.cash); Sell(); SellCart.Items.Clear(); SellCart.ReCreateItems(); SellCart.UpdateItems(); SellTotal.Text = "Order Total: " + 0.0f.ToString("C"); }
void SellCart_OnItemChanged(GItem item) { SellTotal.Text = "Order Total: " + SellCart.ComputeTotal().ToString("C"); }