Example #1
0
 public static void Trash()
 {
     if (HamHelpers.InValidSellArea() &&
         ToggleAutoSell && ToggleVendorTrash && Mod.Enabled)
     {
         long gold = 0;
         foreach (ItemEntity item in ItemSlotHelper.ItemsToRemove(out gold))
         {
             if (TrashItemsKeep.ContainsKey(item.Blueprint.AssetGuid))
             {
                 Game.Instance.Player.Inventory.Remove(item, item.Count - TrashItemsKeep[item.Blueprint.AssetGuid]);
             }
             else
             {
                 Game.Instance.Player.Inventory.Remove(item, item.Count);
             }
         }
         Game.Instance.Player.GainMoney(gold);
         LogItemData data = new LogItemData($"{gold} gold made from autoselling trash loot!", GameLogStrings.Instance.DefaultColor, null, PrefixIcon.None, new List <LogChannel>
         {
             LogChannel.None
         });
         Game.Instance.UI.BattleLogManager.LogView.AddLogEntry(data, false);
     }
 }
Example #2
0
 private void OnGUITrash()
 {
     using (new GUISubScope("Vendor Trash", "box"))
     {
         GUI.enabled = HamHelpers.InValidSellArea();
         GL.Label(Local["Menu_Lbl_TrashIt"], MenuHelpers.LabelStyleWrap, falseWidth);
         if (GL.Button(Local["Menu_Btn_TrashIt"], MenuHelpers.ButtonStyle, falseWidth))
         {
             VendorTrashController.Trash();
         }
         GUI.enabled = true;
     }
 }