Example #1
0
        private void OnGUIThroneRoom()
        {
            using (new GUISubScope(Local["Menu_Tab_TRV"], "box"))
            {
                if (!HamHelpers.InThroneRoom())
                {
                    GL.Label(Local["Menu_Txt_NotInThrone"]);
                    return;
                }

                GL.Label(Local["Menu_Lbl_MoveVendor"], MenuHelpers.LabelStyleWrap, falseWidth);

                foreach (KeyValuePair <string, Vendors.Vendor> kvp in Vendors.VendorBlueprints.NewVendors.Where(n => n.Value.AreaId == Vendors.Vendor.Area.ThroneRoom))
                {
                    OnGUIVendors(kvp.Value);
                }

                GL.Label(Local["Menu_Txt_CleanOld"]);
                if (GL.Button(Local["Menu_Btn_CleanOld"], MenuHelpers.ButtonStyle, falseWidth))
                {
                    foreach (UnitEntityData unit in Game.Instance.State.Units)
                    {
                        if (oldVendors.Contains(unit.Blueprint.AssetGuid))
                        {
                            unit.Destroy();
                        }
                    }
                }
                GUI.enabled = true;
            }
        }
Example #2
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);
     }
 }
 public static void HandleSceneLoaded()
 {
     Main.Mod.Debug(MethodBase.GetCurrentMethod());
     InThroneRoom = HamHelpers.InThroneRoom();
     if ((InGuild = Game.Instance.CurrentlyLoadedArea.AssetGuid.Equals(merchGuildId)))
     {
         LibraryLoad();
     }
 }
 public static bool NotInThroneRoomMessage()
 {
     if (!HamHelpers.InThroneRoom())
     {
         GL.Label(Main.Local["Menu_Txt_NotInThrone"]);
         return(false);
     }
     else
     {
         return(true);
     }
 }
 public static bool NotInGameMessage()
 {
     if (!HamHelpers.InGame())
     {
         GL.Label(Main.Local["Menu_Lbl_NotInGame"]);
         return(false);
     }
     else
     {
         return(true);
     }
 }
Example #6
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;
     }
 }
Example #7
0
 private void OnGUIMerchant()
 {
     using (new GUISubScope("Merchant Guild", "box"))
     {
         GUI.enabled = (HamHelpers.InThroneRoom() || HamHelpers.InGuildHall());
         GL.Label(Local["Menu_Lbl_Teleport"], MenuHelpers.LabelStyleWrap, falseWidth);
         if (GL.Button(Local["Menu_Btn_Teleport"], MenuHelpers.ButtonStyle, falseWidth))
         {
             Vendors.MechantGuild.TP();
         }
         GUI.enabled = true;
     }
 }