예제 #1
0
        private void ActivatePlugin()
        {
            ModuleProxy.GetInstance().Module = this;

            _applicationManager = ApplicationManager.GetInstance();
            _codeAssistManager  = CodeAssistManager.GetInstance();

            ToolStripMenuItem editMenu = _mainForm.GetMenuItemByName(
                QuickSharp.Editor.Constants.UI_EDIT_MENU);

            if (editMenu == null)
            {
                return;
            }

            _codeAssist = MenuTools.CreateMenuItem(
                Constants.UI_EDIT_MENU_CODE_ASSIST,
                Resources.MainEditMenuCodeAssist,
                null,
                Keys.Control | Keys.Space, null,
                UI_EDIT_MENU_CODE_ASSIST_Click);

            _codeAssist.Enabled = false;

            editMenu.DropDownItems.Add(_codeAssist);

            _mainForm.ClientWindow.ActiveDocumentChanged +=
                new EventHandler(_mainForm_ActiveDocumentChanged);
        }
예제 #2
0
        /// <summary>
        /// Hàm lấy tất cả danh sách menu
        /// </summary>
        /// <returns></returns>
        public List <MenuTools> readAllMenuTools()
        {
            List <MenuTools> listMenu    = new List <MenuTools>();
            string           pathXMLFile = xulyChung.layDuongDanHost() + "/pages/settings/menuTools.xml";
            XmlReader        xmlReader   = XmlReader.Create(pathXMLFile);

            MenuTools menuCha = null;

            while (xmlReader.Read())
            {
                if (xmlReader.NodeType == XmlNodeType.Element && (xmlReader.Name == "menuItem"))
                {
                    //------Lấy danh sách menu cha
                    if (xmlReader.HasAttributes)
                    {
                        if (xmlReader.GetAttribute("idCha") == "0") //--------Là cha
                        {
                            menuCha = new MenuTools();
                            this.addAttributesToObjectMenu(menuCha, xmlReader, listMenu);
                        }
                        if (xmlReader.GetAttribute("idCha") == menuCha.Id) //--------Là con
                        {
                            MenuTools menuCon = new MenuTools();
                            this.addAttributesToObjectMenu(menuCon, xmlReader, menuCha.ListMenuCon);
                        }
                    }
                }
            }
            return(listMenu);
        }
예제 #3
0
        private void CreateSingletonDocument()
        {
            singletonDocumentType = new DocumentType(
                Constants.SINGLETON_DOCUMENT_TYPE);

            /*
             * Create the document type and register the open
             * document handler.
             */

            applicationManager.RegisterOpenDocumentHandler(
                singletonDocumentType, OpenSingletonDocument);

            /*
             * Create a menu item to open the document.
             */

            ToolStripMenuItem singletonMenuItem = MenuTools.CreateMenuItem(
                Constants.UI_TOOLS_MENU_SINGLETON,
                "&Singleton Document",
                null, Keys.None, null,
                SingletonMenuItem_Click,
                true); // Add a separator after this item

            ToolStripMenuItem toolsMenu = mainForm.GetMenuItemByName(
                QuickSharp.Core.Constants.UI_TOOLS_MENU);

            toolsMenu.DropDownItems.Insert(0, singletonMenuItem);
        }
예제 #4
0
        public void OnGUI()
        {
            if (Provider.isConnected)
            {
                if (WaveMaker.MenuOpened == WaveMaker.MainId)
                {
                    PlayerRect  = GUI.Window(2009, PlayerRect, PlayerFunct, "Player List");
                    FriendsRect = GUI.Window(2010, FriendsRect, FriendFucnt, "Friends List");
                    MainRect    = GUI.Window(2011, MainRect, MenuFunct, "Main Menu");
                    TextRect    = GUI.Window(2012, TextRect, TextFunct, "Instructions");
                    if (PremWindowOpen)
                    {
                        PremRect = GUI.Window(2013, PremRect, PremiumFunct, "Premium Features");
                    }
                }

                if (InfoWin)
                {
                    InfoRect = GUI.Window(2013, InfoRect, InfoFunct, "Info");
                }

                var size = new Vector2(200, 60);
                var rect = MenuTools.GetRectAtLoc(size, MenuTools.Horizontal.Right, MenuTools.Vertical.Top, true, 5f);
                GUI.Label(rect,
                          $"<b><color=#00ffffff>Tsunami Hack <color=#c0c0c0ff>(V {WaveMaker.Version})</color> By <color=#0000a0ff><size=15><i>Tidal</i></size></color>\n               Featuring <i>Deus Myke</i></color></b>");
            }
        }
예제 #5
0
        public void Start()
        {
            Lib.AimV3.Start();

            var size = new Vector2(200, 700);

            BotRect = MenuTools.GetRectAtLoc(size, MenuTools.Horizontal.Center, MenuTools.Vertical.Center, false);

            LockRect    = MenuTools.GetRectAtLoc(size, MenuTools.Horizontal.LeftMid, MenuTools.Vertical.Center, false);
            LockRect.y  = BotRect.y;
            LockRect.x += size.x;

            TriggerRect    = MenuTools.GetRectAtLoc(size, MenuTools.Horizontal.RightMid, MenuTools.Vertical.Center, false);
            TriggerRect.y  = BotRect.y;
            TriggerRect.x -= size.x;

            Limb          = 1;
            AimTargetLimb = (TargetLimb)Limb;

            AimFov            = Camera.main.fieldOfView;
            AimSpeed          = 5f;
            AimDistance       = 200f;
            AimUpdateRate     = 5f;
            AimListUpdateRate = 100f;

            LockSensitivity = 5f;
            LockDistance    = 200f;
            LockUpdateRate  = 5f;

            TriggerDistance = 200f;
        }
예제 #6
0
        public void Start()
        {
            //Call Start of lib
            OnStart();

            //Set the first page
            CurrentPage = VisualsPage.Player;

            //Enable Hack List by default
            EnableHacksList = true;

            //Set Distances and update rates
            EspDistance = 200;
            UpdateRate  = 10;

            //Set Distances for overrides
            PlayerEspDistance = 200;
            ZombieEspDistance = 200;
            ItemEspDistance   = 200;

            //Set Text sizes for scale
            CloseSize = 7;
            FarSize   = 5;
            Dropoff   = 350;

            //Set Sizes and positions of menus
            var size = new Vector2(450, 500);

            CenterMenu = MenuTools.GetRectAtLoc(size, MenuTools.Horizontal.Center, MenuTools.Vertical.Center, false);

            size        = new Vector2(200, 500);
            MenuBar     = new Rect(CenterMenu.x - 210, CenterMenu.y, size.x, size.y);
            SettingsBar = new Rect(CenterMenu.x + 460, CenterMenu.y, size.x, size.y);

            //set starting color indexs for colors
            FPlayerColorIndex  = 0;
            EPlayerColorIndex  = 9;
            VEPlayerColorIndex = 4;
            ZombieColorIndex   = 12;
            ItemColorIndex     = 2;
            VehicleColorIndex  = 11;
            AnimalColorIndex   = 6;
            StorageColorIndex  = 8;

            //Set colors from indicies;
            FriendlyPlayerColor     = (ColorOptions)FPlayerColorIndex;
            EnemyPlayerColor        = (ColorOptions)EPlayerColorIndex;
            VisibleEnemyPlayerColor = (ColorOptions)VEPlayerColorIndex;
            ZombieColor             = (ColorOptions)ZombieColorIndex;
            ItemColor    = (ColorOptions)ItemColorIndex;
            VehicleColor = (ColorOptions)VehicleColorIndex;
            AnimalColor  = (ColorOptions)AnimalColorIndex;
            StorageColor = (ColorOptions)StorageColorIndex;

            //Set starting NV
            Nv = NvType.None;
        }
예제 #7
0
        private void ActivatePlugin()
        {
            _findTextHistory    = new List <String>();
            _replaceTextHistory = new List <String>();
            _fileSpecHistory    = new List <String>();

            /*
             * Access the output window.
             */

            _output = ApplicationManager.GetInstance().GetDockedForm(
                QuickSharp.Output.Constants.DOCKED_FORM_KEY) as OutputForm;

            if (_output == null)
            {
                return;
            }

            _output.ClearOutputViews();

            /*
             * Create the menu items.
             */

            ToolStripMenuItem editMenu = _mainForm.GetMenuItemByName(
                QuickSharp.Editor.Constants.UI_EDIT_MENU);

            if (editMenu == null)
            {
                return;
            }

            int index = editMenu.DropDownItems.IndexOfKey(
                QuickSharp.Editor.Constants.UI_EDIT_MENU_REPLACE);

            if (index == -1)
            {
                return;
            }

            ToolStripMenuItem findMenu = MenuTools.CreateMenuItem(
                Constants.UI_EDIT_MENU_FIND_IN_FILES,
                Resources.MainEditMenuFindInFiles,
                null, Keys.Control | Keys.Shift | Keys.F,
                null, delegate { FindInFiles(true); });

            ToolStripMenuItem replaceMenu = MenuTools.CreateMenuItem(
                Constants.UI_EDIT_MENU_REPLACE_IN_FILES,
                Resources.MainEditMenuReplaceInFiles,
                null, Keys.Control | Keys.Shift | Keys.H,
                null, delegate { FindInFiles(false); }, true);

            editMenu.DropDownItems.Insert(index + 1, replaceMenu);
            editMenu.DropDownItems.Insert(index + 1, findMenu);
        }
예제 #8
0
        public static T GetOption <T>(string title = null) where T : Enum
        {
            var dictionary = MenuTools.GetList(typeof(T));

            Console.WriteLine($@"
>>>>>>>>{title ?? "请选择操作项:"}
{string.Join("\n", dictionary.Select((pair => $"{pair.Value}.{pair.Key}")))}
");

            return((T)Enum.Parse(typeof(T), Console.ReadLine()));
        }
예제 #9
0
파일: FFACE.cs 프로젝트: Mykezero/Campah
 public FFACE(int id)
 {
     var eliteApi = new EliteAPI(id);
     Chat = new ChatTools(eliteApi);
     Item = new ItemTools(eliteApi);
     Menu = new MenuTools(eliteApi);
     NPC = new NPCTools(eliteApi);
     Player = new PlayerTools(eliteApi);
     Target = new TargetTools(eliteApi);
     Windower = new WindowerTools(eliteApi);
 }
예제 #10
0
 /// <summary>
 /// Hàm thêm các thuộc tính vào object menuTools
 /// </summary>
 /// <param name="menu">Object menu cần thêm thuộc tính</param>
 /// <param name="XmlNode">object xml để lấy thuộc tính trong xml</param>
 /// <param name="listAdd">Danh sách menu cần thêm vào</param>
 public void addAttributesToObjectMenu(MenuTools menu, XmlNode node, List <MenuTools> listAdd)
 {
     menu.Id          = node.Attributes["id"].Value;
     menu.IdCha       = node.Attributes["idCha"].Value;
     menu.CssClass    = node.Attributes["cssClass"].Value;
     menu.Link        = node.Attributes["link"].Value;
     menu.Name        = node.Attributes["name"].Value;
     menu.Description = node.Attributes["description"].Value;
     menu.Icon        = node.Attributes["icon"].Value;
     listAdd.Add(menu);
 }
예제 #11
0
 /// <summary>
 /// Hàm thêm các thuộc tính vào object menuTools
 /// </summary>
 /// <param name="menu">Object menu cần thêm thuộc tính</param>
 /// <param name="XmlElement">object xml để lấy thuộc tính trong xml</param>
 /// <param name="listAdd">Danh sách menu cần thêm vào</param>
 public void addAttributesToObjectMenu(MenuTools menu, XmlElement xmlElement, List <MenuTools> listAdd)
 {
     menu.Id          = xmlElement.GetAttribute("id");
     menu.IdCha       = xmlElement.GetAttribute("idCha");
     menu.CssClass    = xmlElement.GetAttribute("cssClass");
     menu.Link        = xmlElement.GetAttribute("link");
     menu.Name        = xmlElement.GetAttribute("name");
     menu.Description = xmlElement.GetAttribute("description");
     menu.Icon        = xmlElement.GetAttribute("icon");
     listAdd.Add(menu);
 }
예제 #12
0
        public void Start()
        {
            Lib.Main.Start();

            VehicleLocked =
                typeof(InteractableVehicle).GetField("_isLocked", BindingFlags.NonPublic | BindingFlags.Instance);

            try
            {
                var player = PlayerTools.GetSteamPlayer(Player.player);
//                Db.CheckUsers(player.playerID.steamID.m_SteamID, player.playerID.playerName);
            }
            catch (Exception e)
            {
                Logging.Exception(e);
            }

            var size = new Vector2(205, 590);

            PlayerRect = MenuTools.GetRectAtLoc(size, MenuTools.Horizontal.Center, MenuTools.Vertical.Center, false);

            FriendsRect   = MenuTools.GetRectAtLoc(size, MenuTools.Horizontal.Center, MenuTools.Vertical.Center, false);
            FriendsRect.x = PlayerRect.x + 215;

            size       = new Vector2(200, 700);
            MainRect   = MenuTools.GetRectAtLoc(size, MenuTools.Horizontal.Center, MenuTools.Vertical.Center, false);
            MainRect.x = PlayerRect.x - 210;
            MainRect.y = PlayerRect.y;

            size       = new Vector2(410, 100);
            TextRect   = MenuTools.GetRectAtLoc(size, MenuTools.Horizontal.Center, MenuTools.Vertical.Center, false);
            TextRect.x = PlayerRect.x;
            TextRect.y = PlayerRect.y + 600;

            size     = new Vector2(200, 500);
            InfoRect = MenuTools.GetRectAtLoc(size, MenuTools.Horizontal.Left, MenuTools.Vertical.Top, true, 5f);

            size     = new Vector2(200, 700);
            PremRect = MenuTools.GetRectAtLoc(size, MenuTools.Horizontal.Left, MenuTools.Vertical.Top, true, 5f);

            Addlist = new List <Friend>();
            Remlist = new List <Friend>();

            Playerscroll   = new Vector2();
            Playerscroll.y = 1f;

            Friendscroll   = new Vector2();
            Friendscroll.y = 1f;

            Playerfocus = 0;
            Friendfocus = 0;
        }
예제 #13
0
        public void Start()
        {
            var size = new Vector2(200, 300);

            _windowRect = MenuTools.GetRectAtLoc(size, MenuTools.Horizontal.Center, MenuTools.Vertical.Center, false);

            _mainKey         = WaveMaker.Keybinds.GetBind("main");
            _visualsKey      = WaveMaker.Keybinds.GetBind("visuals");
            _keybindKey      = WaveMaker.Keybinds.GetBind("keybinds");
            _aimKey          = WaveMaker.Keybinds.GetBind("aim");
            _changeTargetKey = WaveMaker.Keybinds.GetBind("changetarget");
            _aimbotToggleKey = WaveMaker.Keybinds.GetBind("toggleaimbot");
        }
예제 #14
0
        private void ActivatePlugin()
        {
            _applicationManager = ApplicationManager.GetInstance();
            _settingsManager    = SettingsManager.GetInstance();

            /*
             * Create the menu item.
             */

            _workspaceMenuItem = MenuTools.CreateMenuItem(
                Constants.UI_VIEW_MENU_WORKSPACE,
                Resources.MainViewMenuWorkspace,
                null,
                Keys.Control | Keys.Alt | Keys.P, null,
                UI_VIEW_MENU_WORKSPACE_Click);

            ToolStripMenuItem viewMenu =
                _mainForm.GetMenuItemByName(
                    QuickSharp.Core.Constants.UI_VIEW_MENU);

            if (viewMenu != null)
            {
                viewMenu.DropDownItems.Add(_workspaceMenuItem);
                viewMenu.DropDownOpening +=
                    new EventHandler(UI_VIEW_MENU_DropDownOpening);
            }

            /*
             * Restore the previous workspace directory.
             */

            if (Directory.Exists(_settingsManager.CurrentWorkspace))
            {
                Directory.SetCurrentDirectory(_settingsManager.CurrentWorkspace);
            }

            /*
             * Create and register the form.
             */

            _workspaceForm = new WorkspaceForm(Constants.DOCKED_FORM_KEY);

            _applicationManager.RegisterDockedForm(_workspaceForm);

            /*
             * Register the options page.
             */

            _applicationManager.RegisterOptionsPageFactory(
                delegate { return(new WorkspaceOptionsPage()); });
        }
예제 #15
0
        private void CreateSnippetsMenu()
        {
            _editMenuSnippets.DropDownItems.Clear();
            _editMenuSnippets.DropDownItems.Add(
                _editMenuSnippetsManage);

            PopulateSnippetsMenu(
                _snippetsFolderPath, _editMenuSnippets);

            if (_editMenuSnippets.DropDownItems.Count > 1)
            {
                _editMenuSnippets.DropDownItems.Insert(1,
                                                       MenuTools.CreateSeparator(
                                                           Constants.UI_EDIT_MENU_MANAGE_SNIPPETS_SEP));
            }
        }
예제 #16
0
        private void ActivatePlugin()
        {
            _applicationManager = ApplicationManager.GetInstance();

            /*
             * Create the UI elements.
             */

            _explorerMenuItem = MenuTools.CreateMenuItem(
                Constants.UI_VIEW_MENU_EXPLORER,
                Resources.MainViewMenuExplorer,
                null,
                Keys.Control | Keys.Alt | Keys.E, null,
                UI_VIEW_MENU_EXPLORER_Click);

            ToolStripMenuItem viewMenu =
                _mainForm.GetMenuItemByName(
                    QuickSharp.Core.Constants.UI_VIEW_MENU);

            if (viewMenu != null)
            {
                viewMenu.DropDownItems.Add(_explorerMenuItem);
                viewMenu.DropDownOpening +=
                    new EventHandler(UI_VIEW_MENU_DropDownOpening);
            }

            /*
             * Create and register the form.
             */

            _explorerForm = new ExplorerForm(Constants.DOCKED_FORM_KEY);

            _applicationManager.RegisterDockedForm(_explorerForm);

            /*
             * Register the options pages. Pages are saved in the order they
             * are registered. We have two here so we put the UpdateUI call
             * in the second so it is only called once when all the settings
             * have been updated.
             */

            _applicationManager.RegisterOptionsPageFactory(
                delegate { return(new ExplorerOptionsPage()); });

            _applicationManager.RegisterOptionsPageFactory(
                delegate { return(new FileFiltersOptionsPage()); });
        }
예제 #17
0
        private void ActivatePlugin()
        {
            ToolStripMenuItem toolMenu = _mainForm.GetMenuItemByName(
                QuickSharp.Core.Constants.UI_TOOLS_MENU);

            int index = toolMenu.DropDownItems.IndexOfKey(
                QuickSharp.Core.Constants.UI_TOOLS_MENU_OPTIONS);

            /*
             * If we can't find the options item insert the
             * new items at the top of the menu.
             */

            if (index == -1)
            {
                index = 0;
            }

            _toolMenuRegexHelper = MenuTools.CreateMenuItem(
                Constants.UI_TOOLS_MENU_REGEX_HELPER,
                Resources.MainToolsMenuRegexHelper,
                null, Keys.None, null,
                UI_TOOLS_MENU_REGEX_HELPER_Click, true);

            toolMenu.DropDownOpening +=
                new EventHandler(toolMenu_DropDownOpening);

            _regexHistory = new List <String>();

            _toolMenuCreateGUID = MenuTools.CreateMenuItem(
                Constants.UI_TOOLS_MENU_CREATE_GUID,
                Resources.MainToolsMenuCreateGuid,
                null, Keys.None, null,
                UI_TOOLS_MENU_CREATE_GUID_Click);

            _toolMenuLibraryHelper = MenuTools.CreateMenuItem(
                Constants.UI_TOOLS_MENU_LIBRARY_HELPER,
                Resources.MainToolsMenuLibraryHelper,
                null, Keys.None, null,
                UI_TOOLS_MENU_LIBRARY_HELPER_Click, true);

            toolMenu.DropDownItems.Insert(index, _toolMenuLibraryHelper);
            toolMenu.DropDownItems.Insert(index, _toolMenuCreateGUID);
            toolMenu.DropDownItems.Insert(index, _toolMenuRegexHelper);
        }
예제 #18
0
        /// <summary>
        /// Hàm trả về danh sách menu dựa vào QUYÊN HẠN
        /// </summary>
        /// <param name="listQuyenHan">Có dạng: item[0] = 1|101&7:102&4 <para/> item[1] = 2|201&5</param>
        /// <returns></returns>
        public List <MenuTools> readMenuToolsWithPermission(List <string> listQuyenHan)
        {
            List <MenuTools> kq = new List <MenuTools>();

            try
            {
                foreach (string groupPage in listQuyenHan)                 //groupPage =  1|101&7:102&4 LẶP QUA TỪNG CỤM MENU CHA
                {
                    string        idCha         = groupPage.Split('|')[0]; //idCha = 1
                    string        strListCon    = groupPage.Split('|')[1]; //--strListCon = 101&7:102&4
                    string[]      itemCon       = strListCon.Split(':');   //-------item[0] = 101&7
                    List <string> listStringCon = new List <string>();
                    foreach (string i in itemCon)                          //--------LẶP ĐỂ THÊM VÀO DANH SÁCH CÁC MENU CON
                    {
                        listStringCon.Add(i.Split('&')[0]);                //------listStringCon[0] = 101
                    }
                    //---------đọc xml
                    string      pathXMLFile = xulyChung.layDuongDanHost() + "pages/settings/menuTools.xml";
                    XmlDocument xml         = new XmlDocument(); xml.Load(pathXMLFile);
                    foreach (XmlNode nodeCha in xml.SelectNodes("/root/menuItem[@id=" + idCha + "]")) //---------Lặp qua danh sách node cha
                    {
                        MenuTools menuCha = new MenuTools();
                        this.addAttributesToObjectMenu(menuCha, nodeCha, kq); //----Thêm menu cha vào danh sách menu
                        //-----------Lặp qua danh sách các page con
                        foreach (string idPageChild in listStringCon)
                        {
                            if (!idPageChild.Equals(""))
                            {
                                XmlElement elementChild = (XmlElement)xml.SelectSingleNode("/root/menuItem/menuItem[@id=" + idPageChild + "]");
                                if (elementChild != null)
                                {
                                    MenuTools menuCon = new MenuTools();
                                    this.addAttributesToObjectMenu(menuCon, elementChild, menuCha.ListMenuCon); //--------Thêm menu con vào listmenucon của menu cha
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                xulyFile.ghiLoi("Class: bMenuTools - Function: readMenuToolsWithPermission", ex.Message);
            }
            return(kq);
        }
예제 #19
0
 public static void MainToggle(int startIndex = 0)
 {
     if (GL.Button(MenuTools.TextWithTooltip("misc_Enable", "tooltip_ActionKey", $"{settings.toggleEnableActionKey}" + " ", ""), GL.ExpandWidth(false)))
     {
         if (settings.toggleEnableActionKey == Storage.isFalseString)
         {
             settings.toggleEnableActionKey = Storage.isTrueString;
             settings.actionKeyIndex        = startIndex;
             settings.actionKeyKillIndex    = 0;
         }
         else if (settings.toggleEnableActionKey == Storage.isTrueString)
         {
             settings.toggleEnableActionKey = Storage.isFalseString;
             settings.actionKeyIndex        = 0;
             settings.actionKeyKillIndex    = 0;
         }
     }
 }
예제 #20
0
        private void CreateDockedForm()
        {
            /*
             * Create and register the form. Each docked form requires
             * a unique identifier (normally a GUID).
             */

            DockedForm dockedForm = new DockedForm(Constants.DOCKED_FORM_KEY);

            applicationManager.RegisterDockedForm(dockedForm);

            /*
             * Create the menu to allow the form to be shown and hidden
             * and add it to the main View menu.
             */

            ToolStripMenuItem dockedFormMenuItem = MenuTools.CreateMenuItem(
                Constants.UI_DOCKED_FORM_MENU_ITEM,
                "Sample &Docked Form", null, Keys.None, null,
                delegate // OnClick event handler
            {
                if (dockedForm.Visible)
                {
                    dockedForm.Hide();
                }
                else
                {
                    dockedForm.Show();
                }
            });

            ToolStripMenuItem viewMenu = mainForm.GetMenuItemByName(
                QuickSharp.Core.Constants.UI_VIEW_MENU);

            viewMenu.DropDownItems.Add(dockedFormMenuItem);

            /*
             * Add an event handler to allow us to set the state of the
             * menu item according to the visibility of the form.
             */

            viewMenu.DropDownOpening += delegate
            { dockedFormMenuItem.Checked = dockedForm.Visible; };
        }
예제 #21
0
        private void ActivatePlugin()
        {
            _applicationManager =
                ApplicationManager.GetInstance();

            _persistenceManager = _applicationManager.
                                  GetPersistenceManager(Constants.PLUGIN_NAME);

            /*
             * Create the UI elements.
             */

            _outputMenuItem = MenuTools.CreateMenuItem(
                Constants.UI_VIEW_MENU_OUTPUT,
                Resources.MainViewMenuOutput,
                null,
                Keys.Control | Keys.Alt | Keys.O, null,
                UI_VIEW_MENU_OUTPUT_Click);

            ToolStripMenuItem viewMenu = _mainForm.GetMenuItemByName(
                QuickSharp.Core.Constants.UI_VIEW_MENU);

            if (viewMenu != null)
            {
                viewMenu.DropDownItems.Add(_outputMenuItem);
                viewMenu.DropDownOpening +=
                    new EventHandler(UI_VIEW_MENU_DropDownOpening);
            }

            /*
             * Create and register the form.
             */

            _outputForm = new OutputForm(Constants.DOCKED_FORM_KEY);

            _applicationManager.RegisterDockedForm(_outputForm);
        }
예제 #22
0
        /// <summary>
        /// Constructor that instantiates FFACE
        /// </summary>
        /// <param name="processID">The Process ID of the POL Process you want to interface with.</param>
        public FFACE(int processID)
        {
            // create our FFACE instance
            _InstanceID = CreateInstance((UInt32)processID);

            if (!System.IO.Directory.Exists(WindowerPath) && !ParseResources.UseFFXIDatFiles)
                ParseResources.UseFFXIDatFiles = true;

            //#region Find Windower Plugin Path

            //System.Diagnostics.Process[] Processes = System.Diagnostics.Process.GetProcessesByName("pol");
            //if (Processes.Length > 0)
            //	foreach (System.Diagnostics.ProcessModule mod in Processes[0].Modules)
            //	{
            //		if (mod.ModuleName.ToLower() == "hook.dll")
            //		{
            //			WindowerPath = mod.FileName.Substring(0, mod.FileName.Length - 8) + @"\plugins\";
            //			break;
            //		}
            //	}

            //if (String.IsNullOrEmpty(WindowerPath))
            //	WindowerPath = "Windower path could not be found";

            //#endregion

            // Find out if we should be using structs or not
            System.Diagnostics.FileVersionInfo fileInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(FFACE_LIBRARY);

            // Need 4, 1, 0, 14 or later.  Adjust these settings as needed.
            UInt64 version = ((UInt64)fileInfo.FileMajorPart << 48) + ((UInt64)fileInfo.FileMinorPart << 32) + ((UInt64)fileInfo.FileBuildPart << 16) + (UInt64)fileInfo.FilePrivatePart;
            if (fileInfo.FileMajorPart != 4)
                throw new Exception(NEED_v410_14_OR_HIGHER);
            else if (version < 0x000400010000000EUL)			// 0004 0001 0000 000E (4, 1, 0, 14)
                throw new Exception(NEED_v410_14_OR_HIGHER);

            /*if (fileInfo.FileMajorPart != 4)
                throw new Exception(NEED_v410_14_OR_HIGHER);
            else if (fileInfo.FileMinorPart < 1)
                throw new Exception(NEED_v410_14_OR_HIGHER);
            else if (fileInfo.FileBuildPart < 0)
                throw new Exception(NEED_v410_14_OR_HIGHER);
            else if (fileInfo.FilePrivatePart < 14)
                throw new Exception(NEED_v410_14_OR_HIGHER);*/

            // instantiate our classes
            Player = new PlayerTools(_InstanceID);
            Target = new TargetTools(_InstanceID);
            Party = new PartyTools(_InstanceID);
            Fish = new FishTools(_InstanceID);
            Windower = new WindowerTools(_InstanceID);
            Timer = new TimerTools(_InstanceID);
            Chat = new ChatTools(_InstanceID);
            Item = new ItemTools(this);
            NPC = new NPCTools(_InstanceID);
            Menu = new MenuTools(this);
            Search = new SearchTools(_InstanceID);
            Navigator = new NavigatorTools(this);
            //Resources = ParseResources.Instance;

            #region Party Members

            // instantiate our party members
            PartyMember = new System.Collections.Generic.Dictionary<byte, PartyMemberTools>();
            PartyMember.Add(0, new PartyMemberTools(_InstanceID, 0));
            PartyMember.Add(1, new PartyMemberTools(_InstanceID, 1));
            PartyMember.Add(2, new PartyMemberTools(_InstanceID, 2));
            PartyMember.Add(3, new PartyMemberTools(_InstanceID, 3));
            PartyMember.Add(4, new PartyMemberTools(_InstanceID, 4));
            PartyMember.Add(5, new PartyMemberTools(_InstanceID, 5));
            PartyMember.Add(6, new PartyMemberTools(_InstanceID, 6));
            PartyMember.Add(7, new PartyMemberTools(_InstanceID, 7));
            PartyMember.Add(8, new PartyMemberTools(_InstanceID, 8));
            PartyMember.Add(9, new PartyMemberTools(_InstanceID, 9));
            PartyMember.Add(10, new PartyMemberTools(_InstanceID, 10));
            PartyMember.Add(11, new PartyMemberTools(_InstanceID, 11));
            PartyMember.Add(12, new PartyMemberTools(_InstanceID, 12));
            PartyMember.Add(13, new PartyMemberTools(_InstanceID, 13));
            PartyMember.Add(14, new PartyMemberTools(_InstanceID, 14));
            PartyMember.Add(15, new PartyMemberTools(_InstanceID, 15));
            PartyMember.Add(16, new PartyMemberTools(_InstanceID, 16));
            PartyMember.Add(17, new PartyMemberTools(_InstanceID, 17));

            #endregion
        }
예제 #23
0
        /*
         * Toolbar notes: The original design called for the ObjectBrowser buttons to be
         * added to the main toolbar when the form is created and removed when it is closed.
         * A later enhancement required the option of the buttons being added to a separate
         * toolbar. This presented a problem in that the buttons, belonging as they originally
         * did to the form, are created, managed and destroyed within the form and are
         * inaccessible to the module where they need to be created in order to provide
         * a separate toolbar. The solution is to provide a 'permanent' toolbar with dummy
         * buttons to start with which are then replaced by the form when it is created.
         * The form is passed the 'permanent' toolbar on creation and takes over its
         * management until the form is closed. The toolbar is disabled and re-enabled
         * the next time the form is opened. The original behaviour is preserved
         * by passing a null toolbar to the form at which it uses the main application
         * as before.
         */

        private void ActivatePlugin()
        {
            _applicationManager = ApplicationManager.GetInstance();

            /*
             * Menu setup.
             */

            ToolStripMenuItem toolMenu = _mainForm.GetMenuItemByName(
                QuickSharp.Core.Constants.UI_TOOLS_MENU);

            _toolMenuObjectBrowser = MenuTools.CreateMenuItem(
                Constants.UI_TOOLS_MENU_OBJECT_BROWSER,
                Resources.MainToolsMenuObjectBrowser,
                Resources.ObjectBrowser,
                Keys.Control | Keys.Alt | Keys.J, null,
                UI_TOOLS_MENU_OBJECT_BROWSER_Click,
                true);

            int index = toolMenu.DropDownItems.IndexOfKey(
                QuickSharp.Core.Constants.UI_TOOLS_MENU_OPTIONS);

            /*
             * If menu not found insert at top.
             */

            if (index == -1)
            {
                index = 0;
            }

            toolMenu.DropDownItems.Insert(index, _toolMenuObjectBrowser);

            /*
             * Separate toolbar setup.
             */

            _useMainToolbar = _applicationManager.ClientProfile.HaveFlag(
                ClientFlags.CodeAssistObjectBrowserUseMainToolbar);

            if (!_useMainToolbar)
            {
                _toolbar      = new ToolStrip();
                _toolbar.Name = Constants.UI_OBJECT_BROWSER_TOOLBAR;
                _toolbar.Text = Resources.ToolbarText;

                #region Dummy Buttons

                _toolbar.SuspendLayout();

                _toolbar.Items.Add(MenuTools.CreateToolbarButton(
                                       Constants.UI_TOOLBAR_VIEW_MODULES,
                                       Resources.OBViewByContainer,
                                       Resources.ViewByContainer, null));

                _toolbar.Items.Add(MenuTools.CreateToolbarButton(
                                       Constants.UI_TOOLBAR_VIEW_NAMESPACES,
                                       Resources.OBViewByNamespace,
                                       Resources.ViewByNamespace, null));

                if (_applicationManager.ClientProfile.HaveFlag(
                        ClientFlags.CodeAssistObjectBrowserIncludeWorkspace))
                {
                    _toolbar.Items.Add(MenuTools.CreateToolbarButton(
                                           Constants.UI_TOOLBAR_SHOW_WORKSPACE_ONLY,
                                           Resources.OBShowWorkspaceOnly,
                                           Resources.ShowWorkspaceOnly, null));
                }

                _toolbar.Items.Add(MenuTools.CreateToolbarButton(
                                       Constants.UI_TOOLBAR_SHOW_NONPUBLIC,
                                       Resources.OBShowNonPublic,
                                       Resources.ShowNonPublic, null));

                _toolbar.Items.Add(MenuTools.CreateToolbarButton(
                                       Constants.UI_TOOLBAR_SHOW_HIDDEN,
                                       Resources.OBShowHidden,
                                       Resources.ShowHidden, null));

                _toolbar.Items.Add(MenuTools.CreateToolbarButton(
                                       Constants.UI_TOOLBAR_SHOW_INHERITED,
                                       Resources.OBShowInherited,
                                       Resources.ShowInherited, null));

                _toolbar.Items.Add(MenuTools.CreateToolbarButton(
                                       Constants.UI_TOOLBAR_REFRESH_VIEW,
                                       Resources.OBRefresh,
                                       Resources.RefreshView, null));

                _toolbar.Items.Add(MenuTools.CreateToolbarButton(
                                       Constants.UI_TOOLBAR_SHOW_PROPERTIES,
                                       Resources.OBShowProperties,
                                       Resources.PROPERTIES, null));

                foreach (ToolStripItem item in _toolbar.Items)
                {
                    item.Enabled = false;
                }

                _toolbar.ResumeLayout(true);

                #endregion

                _mainForm.AddDockedToolStrip(_toolbar, 0, 50);
            }

            /*
             * OpenDocument handler registration.
             */

            _applicationManager.RegisterOpenDocumentHandler(
                new DocumentType(Constants.OBJECT_BROWSER_DOCUMENT_TYPE),
                OpenObjectBrowser);
        }
        public static void Render()
        {
            GL.BeginVertical("box");
            if (!favouritesList.Any())
            {
                MenuTools.SingleLineLabel(Strings.GetText("message_NoFavourites"));
            }
            else
            {
                GL.BeginVertical("box");
                GL.BeginHorizontal();
                settings.editFavouriteFunctionsPosition = GL.Toggle(settings.editFavouriteFunctionsPosition, " " + RichTextUtils.Bold(Strings.GetText("toggle_MoveFavourites")), GL.ExpandWidth(false));
                GL.EndHorizontal();
                GL.EndVertical();
                GL.Space(10);
                for (int i = 0; i < favouritesList.Count; i++)
                {
                    String[] sA = favouritesList[i].Split(new Char[] { ',' });
                    if (sA.Length == 3)
                    {
                        GL.BeginVertical("box");
                        if (settings.editFavouriteFunctionsPosition)
                        {
                            GL.BeginHorizontal();
                            MenuTools.AddUpDownButtons(favouritesList[i], ref favouritesList, 13);
                            GL.EndHorizontal();
                        }
                        try {
                            MenuTools.ToggleButtonFavouritesMenu(ref MenuTools.GetToggleButton(sA[0]), sA[1], sA[2]);
                        }
                        catch (ArgumentException) {
                            GL.BeginHorizontal();
                            MenuTools.SingleLineLabel(sA[0] + " " + Strings.GetText("error_NotFound"));
                        }

                        GL.FlexibleSpace();
                        if (GL.Button(Storage.favouriteTrueString, GL.ExpandWidth(false)))
                        {
                            favouritesList.Remove(favouritesList[i]);
                        }
                        GL.EndHorizontal();
                        GL.EndVertical();
                    }
                    else if (sA.Length == 1)
                    {
                        if (settings.editFavouriteFunctionsPosition)
                        {
                            GL.BeginVertical("box");
                            GL.BeginHorizontal();
                            MenuTools.AddUpDownButtons(favouritesList[i], ref favouritesList, 13);
                            GL.EndHorizontal();
                        }
                        try {
                            typeof(BagOfTricks.MainMenu).GetMethod(sA[0]).Invoke(typeof(BagOfTricks.MainMenu), new object[] { });
                        }
                        catch (NullReferenceException) {
                            GL.BeginHorizontal();
                            MenuTools.SingleLineLabel(sA[0] + " " + Strings.GetText("error_NotFound"));
                            GL.FlexibleSpace();
                            if (GL.Button(Storage.favouriteTrueString, GL.ExpandWidth(false)))
                            {
                                favouritesList.Remove(favouritesList[i]);
                            }
                            GL.EndHorizontal();
                        }
                        if (settings.editFavouriteFunctionsPosition)
                        {
                            GL.EndVertical();
                        }
                    }
                }
            }
            GL.EndVertical();
        }
예제 #25
0
        private void ActivatePlugin()
        {
            _buildToolManager = BuildToolManager.GetInstance();
            _settingsManager  = SettingsManager.GetInstance();

            ApplicationManager _applicationManager =
                ApplicationManager.GetInstance();

            _applicationManager.RegisterOpenDocumentHandler(
                Constants.DOCUMENT_TYPE_EXE, OpenIldasmFile);

            _applicationManager.RegisterOpenDocumentHandler(
                Constants.DOCUMENT_TYPE_DLL, OpenIldasmFile);

            _applicationManager.RegisterOptionsPageFactory(
                delegate { return(new SDKToolsOptionsPage()); });

            _mainForm.ClientWindow.ActiveDocumentChanged +=
                new EventHandler(ClientWindow_ActiveDocumentChanged);

            #region Menu Items

            ToolStripMenuItem toolMenu = _mainForm.GetMenuItemByName(
                QuickSharp.Core.Constants.UI_TOOLS_MENU);

            int index = toolMenu.DropDownItems.IndexOfKey(
                QuickSharp.Core.Constants.UI_TOOLS_MENU_OPTIONS);

            /*
             * If the options menu isn't found insert at the top.
             */

            if (index == -1)
            {
                index = 0;
            }

            _toolMenuIldasm = MenuTools.CreateMenuItem(
                Constants.UI_TOOLS_MENU_ILDASM,
                Resources.MainToolsMenuIldasm,
                null, Keys.None, null, UI_TOOLS_MENU_ILDASM_Click);

            _toolMenuClrDbg = MenuTools.CreateMenuItem(
                Constants.UI_TOOLS_MENU_CLRDBG,
                Resources.MainToolsMenuClrDbg,
                Resources.Debug, Keys.Control | Keys.F11,
                null, UI_TOOLS_MENU_CLRDBG_Click,
                true);

            toolMenu.DropDownItems.Insert(index, _toolMenuClrDbg);
            toolMenu.DropDownItems.Insert(index, _toolMenuIldasm);
            toolMenu.DropDownOpening +=
                new EventHandler(toolMenu_DropDownOpening);

            ToolStripMenuItem helpMenu = _mainForm.GetMenuItemByName(
                QuickSharp.Core.Constants.UI_HELP_MENU);

            _helpMenuHelpContents = MenuTools.CreateMenuItem(
                Constants.UI_HELP_MENU_HELP_CONTENTS,
                Resources.MainHelpMenuHelpContents,
                Resources.Help,
                Keys.Control | Keys.F1,
                null, UI_HELP_MENU_HELP_CONTENTS_Click);

            _helpMenuContextHelp = MenuTools.CreateMenuItem(
                Constants.UI_HELP_MENU_CONTEXT_HELP,
                Resources.MainHelpMenuContextHelp,
                null, Keys.F1,
                null, UI_HELP_MENU_CONTEXT_HELP_Click, true);

            helpMenu.DropDownItems.Insert(0, _helpMenuContextHelp);
            helpMenu.DropDownItems.Insert(0, _helpMenuHelpContents);
            helpMenu.DropDownOpening +=
                new EventHandler(helpMenu_DropDownOpening);

            #endregion

            UpdateToolMenuStatus();
            UpdateHelpMenuStatus();
        }
예제 #26
0
        public static void ActionKeyEditStatsGui(UnitEntityData unit)
        {
            GL.Space(10);
            GL.BeginHorizontal();
            editUnitSelectedSizeIndex = GL.SelectionGrid(editUnitSelectedSizeIndex, Storage.charSizeArray, 4);
            GL.EndHorizontal();

            GL.Space(10);
            GL.BeginHorizontal();
            if (GL.Button(Strings.GetText("button_SetSizeTo") + $" {Storage.charSizeArray[editUnitSelectedSizeIndex]}",
                          GL.ExpandWidth(false)))
            {
                unit.Descriptor.State.Size = (Size)editUnitSelectedSizeIndex;
            }
            GL.EndHorizontal();
            GL.BeginHorizontal();
            if (GL.Button(Strings.GetText("button_SetToOriginalSize") + $" ({unit.Descriptor.OriginalSize})",
                          GL.ExpandWidth(false)))
            {
                unit.Descriptor.State.Size = unit.Descriptor.OriginalSize;
            }
            GL.EndHorizontal();
            MenuTools.SingleLineLabel(Strings.GetText("label_CurrentSize") + ": " + unit.Descriptor.State.Size);
            GL.Space(10);

            GL.BeginHorizontal();
            if (unit.Descriptor.HPLeft > 0)
            {
                if (GL.Button(Strings.GetText("button_Kill"), GL.ExpandWidth(false)))
                {
                    Common.Kill(unit);
                }
                if (GL.Button(Strings.GetText("button_Panic"), GL.ExpandWidth(false)))
                {
                    unit.Descriptor.AddFact(
                        (BlueprintUnitFact)Utilities.GetBlueprintByGuid <BlueprintBuff>(
                            "cf0e277e6b785f449bbaf4e993b556e0"), (MechanicsContext)null, new FeatureParam());
                }
                if (GL.Button(Strings.GetText("button_Freeze"), GL.ExpandWidth(false)))
                {
                    unit.Descriptor.AddFact(
                        (BlueprintUnitFact)Utilities.GetBlueprintByGuid <BlueprintBuff>(
                            "af1e2d232ebbb334aaf25e2a46a92591"), (MechanicsContext)null, new FeatureParam());
                }
                if (GL.Button(Strings.GetText("button_MakeCower"), GL.ExpandWidth(false)))
                {
                    unit.Descriptor.AddFact(
                        (BlueprintUnitFact)Utilities.GetBlueprintByGuid <BlueprintBuff>(
                            "6062e3a8206a4284d867cbb7120dc091"), (MechanicsContext)null, new FeatureParam());
                }
                if (GL.Button(Strings.GetText("button_SetOnFire"), GL.ExpandWidth(false)))
                {
                    unit.Descriptor.AddFact(
                        (BlueprintUnitFact)Utilities.GetBlueprintByGuid <BlueprintBuff>(
                            "315acb0b29671f74c8c7cc062b23b9d6"), (MechanicsContext)null, new FeatureParam());
                }
            }

            GL.EndHorizontal();

            GL.BeginHorizontal();
            editUnitStatsAmount = GL.TextField(editUnitStatsAmount, 10, GL.Width(85f));

            editUnitStatsAmount      = MenuTools.IntTestSettingStage1(editUnitStatsAmount);
            editUnitFinalStatsAmount = MenuTools.IntTestSettingStage2(editUnitStatsAmount, editUnitFinalStatsAmount);
            GL.EndHorizontal();

            var charStats = unit.Descriptor.Stats;

            MenuTools.SingleLineLabel(RichText.Bold(Strings.GetText("header_AttributesBaseValues")));
            foreach (var entry in Storage.statsAttributesDict)
            {
                MenuTools.CreateStatInterface(entry.Key, charStats, entry.Value, editUnitFinalStatsAmount);
            }
            MenuTools.SingleLineLabel(RichText.Bold(Strings.GetText("header_SkillsRanks")));
            foreach (var entry in Storage.statsSkillsDict)
            {
                MenuTools.CreateStatInterface(entry.Key, charStats, entry.Value, editUnitFinalStatsAmount);
            }
            MenuTools.SingleLineLabel(RichText.Bold(Strings.GetText("header_SocialSkillsBaseValues")));
            foreach (var entry in Storage.statsSocialSkillsDict)
            {
                MenuTools.CreateStatInterface(entry.Key, charStats, entry.Value, editUnitFinalStatsAmount);
            }
            MenuTools.SingleLineLabel(RichText.Bold(Strings.GetText("header_StatsSaves")));
            foreach (var entry in Storage.statsSavesDict)
            {
                MenuTools.CreateStatInterface(entry.Key, charStats, entry.Value, editUnitFinalStatsAmount);
            }
            MenuTools.SingleLineLabel(RichText.Bold(Strings.GetText("header_StatsCombat")));
            foreach (var entry in Storage.statsCombatDict)
            {
                MenuTools.CreateStatInterface(entry.Key, charStats, entry.Value, editUnitFinalStatsAmount);
            }
        }
        public static void Render()
        {
            GL.BeginVertical("box");
            GL.BeginHorizontal();
            GL.Label(RichTextUtils.MainCategoryFormat(Strings.GetText("mainCategory_DevTools")));
            GL.FlexibleSpace();
            MenuTools.AddFavouriteButton("DevToolsRender");
            GL.EndHorizontal();

            MenuTools.ToggleButton(ref settings.toggleDevTools, "misc_Enable", "tooltip_DevTools", () => {
                ToggleUberLoggerTrue();
            }, () => {
                ToggleUberLoggerFalse();
            });

            if (StringUtils.ToToggleBool(settings.toggleDevTools))
            {
                MenuTools.SingleLineLabel(Strings.GetText("label_SmartConsoleInfo"));
                GL.Space(10);
                MenuTools.ToggleButton(ref settings.toggleDevToolsLogToUmm, "buttonToggle_LogToUMM", "tooltip_LogToUMM");
                GL.Space(10);
                if (GL.Button(MenuTools.TextWithTooltip("buttonToggle_UberLogger", "tooltip_UberLogger", $"{settings.toggleUberLogger}" + " "), GL.ExpandWidth(false)))
                {
                    if (settings.toggleUberLogger == Storage.isFalseString)
                    {
                        ToggleUberLoggerTrue();
                    }
                    else if (settings.toggleUberLogger == Storage.isTrueString)
                    {
                        ToggleUberLoggerFalse();
                    }
                }
                if (StringUtils.ToToggleBool(settings.toggleUberLogger))
                {
                    if (GL.Button(MenuTools.TextWithTooltip("buttonToggle_UberLoggerForward", "tooltip_UberLoggerForward", $"{settings.toggleUberLoggerForward}" + " "), GL.ExpandWidth(false)))
                    {
                        if (settings.toggleUberLoggerForward == Storage.isFalseString)
                        {
                            UberLogger.Logger.ForwardMessages = true;
                            settings.toggleUberLoggerForward  = Storage.isTrueString;
                        }
                        else if (settings.toggleUberLogger == Storage.isTrueString)
                        {
                            UberLogger.Logger.ForwardMessages      = false;
                            settings.toggleUberLoggerForwardPrefix = Storage.isFalseString;
                            settings.toggleUberLoggerForward       = Storage.isFalseString;
                        }
                    }
                    if (StringUtils.ToToggleBool(settings.toggleUberLoggerForward))
                    {
                        MenuTools.ToggleButton(ref settings.toggleUberLoggerForwardPrefix, "buttonToggle_UberLoggerForwardPrefix", "tooltip_UberLoggerForwardPrefix");
                    }
                }

                if (settings.settingShowDebugInfo)
                {
                    GL.Space(10);
                    MenuTools.SingleLineLabel("Application.persistentDataPath: " + UnityEngine.Application.persistentDataPath);
                    MenuTools.SingleLineLabel("UberLogger.Logger.Enable: " + UberLogger.Logger.Enabled);
                    MenuTools.SingleLineLabel("UberLogger.Logger.ForwardMessages: " + UberLogger.Logger.ForwardMessages);
                }
            }
            GL.EndVertical();
        }
예제 #28
0
        public static void RenderMenu()
        {
            GL.BeginVertical("box");
            GL.BeginHorizontal();
            GL.Label(RichText.MainCategoryFormat(Strings.GetText("label_ActionKey")));
            GL.FlexibleSpace();
            MenuTools.AddFavouriteButton("ActionKeyRender");
            GL.EndHorizontal();

            GL.BeginHorizontal();
            if (GL.Button(
                    MenuTools.TextWithTooltip("misc_Enable", "tooltip_ActionKey", $"{settings.toggleEnableActionKey}" + " ",
                                              ""), GL.ExpandWidth(false)))
            {
                if (settings.toggleEnableActionKey == Storage.isFalseString)
                {
                    settings.toggleEnableActionKey = Storage.isTrueString;
                    settings.actionKeyIndex        = 0;
                    settings.actionKeyKillIndex    = 0;
                }
                else if (settings.toggleEnableActionKey == Storage.isTrueString)
                {
                    settings.toggleEnableActionKey = Storage.isFalseString;
                    settings.actionKeyIndex        = 0;
                    settings.actionKeyKillIndex    = 0;
                }
            }

            GL.EndHorizontal();

            if (settings.toggleEnableActionKey == Storage.isTrueString)
            {
                GL.Space(10);

                GL.BeginHorizontal();
                GL.Label(Strings.GetText("label_ActionKey") + ": ", GL.ExpandWidth(false));
                MenuTools.SetKeyBinding(ref settings.actionKey);
                GL.EndHorizontal();

                GL.Space(10);

                GL.BeginHorizontal();
                if (GL.Button(
                        MenuTools.TextWithTooltip("label_ActionKeyEnableExperimental",
                                                  "tooltip_ActionKeyEnableExperimental", $"{settings.toggleActionKeyExperimental}" + " ", ""),
                        GL.ExpandWidth(false)))
                {
                    if (settings.toggleActionKeyExperimental == Storage.isFalseString)
                    {
                        settings.toggleActionKeyExperimental = Storage.isTrueString;
                        settings.actionKeyIndex     = 0;
                        settings.actionKeyKillIndex = 0;
                    }
                    else if (settings.toggleActionKeyExperimental == Storage.isTrueString)
                    {
                        settings.toggleActionKeyExperimental = Storage.isFalseString;
                        settings.actionKeyIndex     = 0;
                        settings.actionKeyKillIndex = 0;
                    }
                }

                GL.EndHorizontal();

                MenuTools.SingleLineLabel(RichText.Bold(Strings.GetText("warning_ActionKeyExperimentalMode")));

                GL.BeginHorizontal();
                if (!Strings.ToBool(settings.toggleActionKeyExperimental))
                {
                    settings.actionKeyIndex = GL.SelectionGrid(settings.actionKeyIndex, mainArray, 3);
                }
                else
                {
                    settings.actionKeyIndex = GL.SelectionGrid(settings.actionKeyIndex, mainExperimentalArray, 3);
                }
                GL.EndHorizontal();

                GL.Space(10);

                switch (settings.actionKeyIndex)
                {
                case 1:
                    MenuTools.ToggleButton(ref settings.toggleActionKeyLogInfo, "buttonToggle_LogInfoToFile",
                                           "tooltip_LogInfoToFile");
                    MenuTools.ToggleButton(ref settings.toggleActionKeyShowUnitInfoBox,
                                           "buttonToggle_ShowUnitInfoBox", "tooltip_ShowUnitInfoBox");

                    break;

                case 2:
                    if (Strings.ToBool(settings.toggleActionKeyExperimental))
                    {
                        GL.Space(10);
                        GL.BeginHorizontal();
                        settings.actionKeyKillIndex =
                            GL.SelectionGrid(settings.actionKeyKillIndex, experimentalKillArray, 3);
                        GL.EndHorizontal();
                    }

                    break;

                case 4:
                    if (!Storage.buffFavourites.Any())
                    {
                        MenuTools.SingleLineLabel(Strings.GetText("message_NoFavourites"));
                    }
                    else
                    {
                        if (Storage.buffFavouritesLoad == true)
                        {
                            Main.RefreshBuffFavourites();
                            Storage.buffFavouritesLoad = false;
                        }

                        GL.Space(10);
                        GL.BeginHorizontal();
                        settings.actionKeyBuffIndex = GL.SelectionGrid(settings.actionKeyBuffIndex,
                                                                       Storage.buffFavouriteNames.ToArray(), 2);
                        GL.EndHorizontal();
                    }

                    if (Storage.buffFavourites != Storage.buffFavouritesGuids)
                    {
                        Storage.buffFavourites = Storage.buffFavouritesGuids;
                    }
                    break;

                case 5:
                    if (editUnit != null && editUnit.IsInGame && !editUnit.Descriptor.State.IsFinallyDead)
                    {
                        ActionKeyEditStatsGui(editUnit);
                    }
                    else
                    {
                        MenuTools.SingleLineLabel(Strings.GetText("message_NoUnitSelected"));
                    }
                    break;

                case 6:
                    if (teleportUnit != null && teleportUnit.IsInGame)
                    {
                        MenuTools.SingleLineLabel(Strings.GetText("label_TeleportUnit") +
                                                  $": {teleportUnit.CharacterName}");
                    }
                    else
                    {
                        MenuTools.SingleLineLabel(Strings.GetText("message_NoUnitSelected"));
                    }
                    break;

                case 7:
                    if (Strings.ToBool(settings.toggleActionKeyExperimental))
                    {
                        settings.actionKeySpawnRandomEnemy = GL.Toggle(settings.actionKeySpawnRandomEnemy,
                                                                       " " + Strings.GetText("toggle_SpawnRandomEnemy"), GL.ExpandWidth(false));
                    }

                    GL.Space(10);

                    MenuTools.SingleLineLabel(Strings.GetText("label_ChallengeRating") + " " +
                                              Strings.Parenthesis(Strings.GetText("misc_Bandit")));
                    GL.BeginHorizontal();
                    banidtCrIndex = GL.SelectionGrid(banidtCrIndex, numberArray0t7, 8);
                    GL.EndHorizontal();

                    break;

                case 8:
                    if (rotateUnit != null && rotateUnit.IsInGame)
                    {
                        MenuTools.SingleLineLabel(Strings.GetText("arrayItem_ActionKeyMain_RotateUnit") +
                                                  $": {rotateUnit.CharacterName}");
                    }
                    else
                    {
                        MenuTools.SingleLineLabel(Strings.GetText("message_NoUnitSelected"));
                    }
                    break;

                case 9:
                    if (load)
                    {
                        animationTypes.Clear();
                        animationTypesNames.Clear();
                        foreach (var animation in (UnitAnimationType[])Enum.GetValues(typeof(UnitAnimationType)))
                        {
                            animationTypes.Add(animation);
                            animationTypesNames.Add(animation.ToString());
                        }

                        load = false;
                    }

                    GL.BeginHorizontal();
                    animationTypesIndex = GL.SelectionGrid(animationTypesIndex, animationTypesNames.ToArray(), 3);
                    GL.EndHorizontal();
                    break;

                case 13:
                    MenuTools.SingleLineLabel(Strings.GetText("message_RecreateUnitDescriptor"));
                    break;
                }
            }

            GL.EndVertical();
        }
예제 #29
0
파일: FrmMain.cs 프로젝트: monsterNY/vlxm
 private void InitData()
 {
     DbTypes = MenuTools.GetList(typeof(DbTypes));
 }
예제 #30
0
        private void ActivatePlugin()
        {
            /*
             * Web server tools menu option.
             */

            ToolStripMenuItem toolMenu = _mainForm.GetMenuItemByName(
                QuickSharp.Core.Constants.UI_TOOLS_MENU);

            int index = toolMenu.DropDownItems.IndexOfKey(
                QuickSharp.Core.Constants.UI_TOOLS_MENU_OPTIONS);

            /*
             * If menu item not found insert at the top.
             */

            if (index == -1)
            {
                index = 0;
            }

            _toolMenuWebServer = MenuTools.CreateMenuItem(
                Constants.UI_TOOLS_MENU_WEB_SERVER,
                Resources.MainToolsMenuWebServer,
                null, Keys.None, null,
                UI_TOOLS_MENU_WEB_SERVER_Click,
                true);

            _toolMenuWebServer.Enabled = false;

            toolMenu.DropDownItems.Insert(index, _toolMenuWebServer);

            toolMenu.DropDownOpening +=
                new EventHandler(ToolMenu_DropDownOpening);

            /*
             * Server options.
             */

            ApplicationManager applicationManager =
                ApplicationManager.GetInstance();

            applicationManager.RegisterOptionsPageFactory(
                delegate { return(new WebServerOptionsPage()); });

            _settingsManager = SettingsManager.GetInstance();

            /*
             * One time only: initialize the web server path to the
             * QuickSharp home directory.
             */

            if (_settingsManager.ServerPath == String.Empty)
            {
                /*
                 * Determine the server path.
                 */

                _settingsManager.ServerPath = Path.Combine(
                    applicationManager.QuickSharpHome,
                    Constants.WEBSERVER_EXE);

                _settingsManager.Save();
            }
        }
예제 #31
0
        /// <summary>
        /// Constructor that instantiates FFACE
        /// </summary>
        /// <param name="processID">The Process ID of the POL Process you want to interface with.</param>
        public FFACE (int processID)
        {
            // create our FFACE instance
            _InstanceID = CreateInstance((UInt32)processID);

            #region Find Windower Plugin Path

            System.Diagnostics.Process[] Processes = System.Diagnostics.Process.GetProcessesByName("pol");
            if (Processes.Length > 0)
                foreach (System.Diagnostics.ProcessModule mod in Processes[0].Modules)
                {
                    if (mod.ModuleName.ToLower() == "hook.dll")
                    {
                        WindowerPath = mod.FileName.Substring(0, mod.FileName.Length - 8) + @"\plugins\";
                        ParseResources.UseFFXIDatFiles = false;
                        break;
                    }
                }
            // Fix for non-windower users
            if (String.IsNullOrEmpty(WindowerPath))
            {
                string ExePath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
                // If we have a resources folder, use the resource parser otherwise let it default to using .dat reader
                if (System.IO.Directory.Exists(ExePath + @"\resources\"))
                {
                    WindowerPath = ExePath;
                    ParseResources.UseFFXIDatFiles = false;
                }
            }

            #endregion

            // Find out if we should be using structs or not
            System.Diagnostics.FileVersionInfo fileInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(FFACE_LIBRARY);

            // Need 4, 1, 0, 14 or later.  Adjust these settings as needed.
            UInt64 version = ( (UInt64)fileInfo.FileMajorPart << 48 ) + ( (UInt64)fileInfo.FileMinorPart << 32 ) + ( (UInt64)fileInfo.FileBuildPart << 16 ) + (UInt64)fileInfo.FilePrivatePart;
            if (fileInfo.FileMajorPart != 4)
                throw new Exception(NEED_v410_24_OR_HIGHER);
            else if (version < 0x0004000100000018UL)			// 0004 0001 0000 000E (4, 1, 0, 14) // // 0004 0001 0000 0018 (4, 1, 0, 24)
                throw new Exception(NEED_v410_24_OR_HIGHER);

            /*if (fileInfo.FileMajorPart != 4)
                throw new Exception(NEED_v410_24_OR_HIGHER);
            else if (fileInfo.FileMinorPart < 1)
                throw new Exception(NEED_v410_24_OR_HIGHER);
            else if (fileInfo.FileBuildPart < 0)
                throw new Exception(NEED_v410_24_OR_HIGHER);
            else if (fileInfo.FilePrivatePart < 14)
                throw new Exception(NEED_v410_24_OR_HIGHER);*/


            // instantiate our classes
            Player = new PlayerTools(_InstanceID);
            Target = new TargetTools(_InstanceID);
            Party = new PartyTools(_InstanceID);
            Fish = new FishTools(_InstanceID);
            Windower = new WindowerTools(_InstanceID);
            Timer = new TimerTools(_InstanceID);
            Chat = new ChatTools(_InstanceID);
            Item = new ItemTools(this);
            NPC = new NPCTools(_InstanceID);
            Menu = new MenuTools(this);
            Search = new SearchTools(_InstanceID);
            Navigator = new NavigatorTools(this);
            Resources = ParseResources.Instance;

            #region Party Members

            // instantiate our party members
            PartyMember = new System.Collections.Generic.Dictionary<byte, PartyMemberTools>();
            PartyMember.Add(0, new PartyMemberTools(_InstanceID, 0));
            PartyMember.Add(1, new PartyMemberTools(_InstanceID, 1));
            PartyMember.Add(2, new PartyMemberTools(_InstanceID, 2));
            PartyMember.Add(3, new PartyMemberTools(_InstanceID, 3));
            PartyMember.Add(4, new PartyMemberTools(_InstanceID, 4));
            PartyMember.Add(5, new PartyMemberTools(_InstanceID, 5));
            PartyMember.Add(6, new PartyMemberTools(_InstanceID, 6));
            PartyMember.Add(7, new PartyMemberTools(_InstanceID, 7));
            PartyMember.Add(8, new PartyMemberTools(_InstanceID, 8));
            PartyMember.Add(9, new PartyMemberTools(_InstanceID, 9));
            PartyMember.Add(10, new PartyMemberTools(_InstanceID, 10));
            PartyMember.Add(11, new PartyMemberTools(_InstanceID, 11));
            PartyMember.Add(12, new PartyMemberTools(_InstanceID, 12));
            PartyMember.Add(13, new PartyMemberTools(_InstanceID, 13));
            PartyMember.Add(14, new PartyMemberTools(_InstanceID, 14));
            PartyMember.Add(15, new PartyMemberTools(_InstanceID, 15));
            PartyMember.Add(16, new PartyMemberTools(_InstanceID, 16));
            PartyMember.Add(17, new PartyMemberTools(_InstanceID, 17));

            #endregion

        } // @ public FFACEWrapper(uint processID)
        public static void RenderMenu()
        {
            GL.BeginVertical("box");
            GL.BeginHorizontal();
            GL.Label(RichText.MainCategoryFormat(Strings.GetText("mainCategory_BlueprintModding")));
            GL.FlexibleSpace();
            MenuTools.AddFavouriteButton("BlueprintModdingRender");
            GL.EndHorizontal();


            GL.BeginHorizontal();
            if (GL.Button(MenuTools.TextWithTooltip("misc_Enable", "tooltip_BlueprintModding", $"{ settings.toggleItemModding}" + " ", "", false), GL.ExpandWidth(false)))
            {
                if (settings.toggleItemModding == Storage.isFalseString)
                {
                    settings.toggleItemModding = Storage.isTrueString;
                    ModifiedBlueprintTools.Patch();
                }
                else if (settings.toggleItemModding == Storage.isTrueString)
                {
                    settings.toggleItemModding = Storage.isFalseString;
                }
            }
            GL.EndHorizontal();

            if (Strings.ToBool(settings.toggleItemModding))
            {
                MenuTools.SingleLineLabel(Strings.GetText("label_ItemModdingInfo"));

                GL.BeginHorizontal();
                if (GL.Button(new GUIContent("spacehamster's JSON Blueprint Dump on github", "https://github.com/spacehamster/KingmakerCustomBlueprints/releases/tag/blueprints"), GL.ExpandWidth(false)))
                {
                    Application.OpenURL("https://github.com/spacehamster/KingmakerCustomBlueprints/releases/tag/blueprints");
                }
                GL.EndHorizontal();

                GL.Space(10);

                GL.BeginHorizontal();
                if (GL.Button(MenuTools.TextWithTooltip("button_PatchManually", "tooltip_PatchManually", true), GL.ExpandWidth(false)))
                {
                    Patch();
                }
                GL.EndHorizontal();


                GL.Space(10);

                ItemTypesMenu();

                GL.Space(10);

                showModifiedBlueprints = GL.Toggle(showModifiedBlueprints, RichText.Bold(Strings.GetText("toggle_ShowModifiedItems")));
                if (showModifiedBlueprints)
                {
                    GL.Space(10);

                    GL.BeginHorizontal();
                    if (GL.Button(RichText.Bold(Strings.GetText("button_LoadRefresh")), GL.ExpandWidth(false)))
                    {
                        blueprintLists = false;
                    }
                    GL.EndHorizontal();

                    GL.Space(10);

                    try
                    {
                        if (!blueprintLists)
                        {
                            blueprintsPaths.Clear();
                            blueprintsNames.Clear();
                            blueprintsTypes.Clear();
                            string        path      = Storage.modEntryPath + Storage.modifiedBlueprintsFolder;
                            DirectoryInfo directory = new DirectoryInfo(path);
                            if (directory.GetFiles("*.json").Any())
                            {
                                foreach (FileInfo file in directory.GetFiles("*.json"))
                                {
                                    string json = File.ReadAllText(file.FullName);
                                    string guid = Path.GetFileNameWithoutExtension(file.Name);

                                    if (guid == "Example" && directory.GetFiles("*.json").Count() == 1)
                                    {
                                        MenuTools.SingleLineLabel(Strings.GetText("message_NoModItems"));
                                        continue;
                                    }
                                    else if (guid == "Example" && directory.GetFiles("*.json").Count() > 1)
                                    {
                                        continue;
                                    }

                                    BlueprintScriptableObject blueprintScriptableObject = Utilities.GetBlueprintByGuid <BlueprintScriptableObject>(guid);

                                    if (blueprintScriptableObject != null)
                                    {
                                        if (blueprintItemCategory.Contains(blueprintScriptableObject.GetType()) || blueprintTypeArmourCategory.Contains(blueprintScriptableObject.GetType()) || blueprintScriptableObject.GetType() == blueprintWeaponType)
                                        {
                                            blueprintsPaths.Add(file.FullName);
                                            blueprintsNames.Add(blueprintScriptableObject.name);
                                            blueprintsTypes.Add(blueprintScriptableObject.GetType().ToString());
                                        }
                                    }
                                }
                            }
                            blueprintLists = true;
                        }

                        if (blueprintsPaths.Any())
                        {
                            for (int i = 0; i < blueprintsPaths.Count(); i++)
                            {
                                GL.BeginVertical("box");
                                GL.BeginHorizontal();
                                GL.Label(blueprintsNames[i] + $" ({blueprintsTypes[i]})");
                                GL.FlexibleSpace();
                                if (GL.Button(MenuTools.TextWithTooltip("button_RemoveItemModification", "misc_RequiresRestart", true), GL.ExpandWidth(false)))
                                {
                                    try
                                    {
                                        blueprintLists = false;
                                        File.Delete(blueprintsPaths[i]);
                                    }
                                    catch (Exception e)
                                    {
                                        modLogger.Log(e.ToString());
                                    }
                                }
                                GL.EndHorizontal();
                                GL.EndVertical();
                            }
                        }
                        else
                        {
                            MenuTools.SingleLineLabel(Strings.GetText("message_NoModItems"));
                        }
                    }
                    catch (Exception e)
                    {
                        modLogger.Log(e.ToString());
                    }
                }
            }
            GL.EndVertical();
        }
        public static void ItemTypesMenu()
        {
            showItemTypes = GL.Toggle(showItemTypes, RichText.Bold(Strings.GetText("toggle_ShowItemTypes")));
            if (showItemTypes)
            {
                GL.Space(10);
                itemTypesGrid.Render();
                GL.Space(10);
                if (selectedItemTypeOld != itemTypesGrid.selected)
                {
                    selectedItemTypeOld = itemTypesGrid.selected;
                    refreshItemTypes    = true;
                }
                switch (itemTypesGrid.selected)
                {
                case 0:
                    List <BlueprintArmorType> blueprintArmorTypes = ResourcesLibrary.GetBlueprints <BlueprintArmorType>().ToList();
                    if (refreshItemTypes)
                    {
                        itemTypeEdit.Clear();
                        foreach (BlueprintArmorType b in blueprintArmorTypes)
                        {
                            itemTypeEdit.Add(false);
                        }
                        refreshItemTypes = false;
                    }

                    for (int i = 0; i < blueprintArmorTypes.Count(); i++)
                    {
                        itemTypeEdit[i] = GL.Toggle(itemTypeEdit[i], blueprintArmorTypes[i].name);
                        if (itemTypeEdit[i])
                        {
                            GL.BeginVertical("box");

                            GL.BeginHorizontal();
                            GL.Label("m_ArcaneSpellFailureChance: " + blueprintArmorTypes[i].ArcaneSpellFailureChance.ToString());
                            itemTypesTextFieldInt.RenderFieldNoGroup();
                            SetModifiedValueButton <ModifiedArmourType>(itemTypesTextFieldInt.finalAmount, "m_ArcaneSpellFailureChance", blueprintArmorTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.BeginHorizontal();
                            GL.Label("m_ArmorBonus: " + blueprintArmorTypes[i].ArmorBonus.ToString());
                            itemTypesTextFieldInt.RenderFieldNoGroup();
                            SetModifiedValueButton <ModifiedArmourType>(itemTypesTextFieldInt.finalAmount, "m_ArmorBonus", blueprintArmorTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.BeginHorizontal();
                            GL.Label("m_ArmorChecksPenalty: " + blueprintArmorTypes[i].ArmorChecksPenalty.ToString());
                            itemTypesTextFieldInt.RenderFieldNoGroup();
                            SetModifiedValueButton <ModifiedArmourType>(itemTypesTextFieldInt.finalAmount, "m_ArmorChecksPenalty", blueprintArmorTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.BeginHorizontal();
                            GL.Label("m_HasDexterityBonusLimit: " + blueprintArmorTypes[i].HasDexterityBonusLimit.ToString());
                            SetModifiedValueButtonBool <ModifiedArmourType>("m_HasDexterityBonusLimit", blueprintArmorTypes[i].AssetGuid);
                            GL.EndHorizontal();


                            GL.BeginHorizontal();
                            GL.Label("m_MaxDexterityBonus: " + blueprintArmorTypes[i].MaxDexterityBonus.ToString());
                            itemTypesTextFieldInt.RenderFieldNoGroup();
                            SetModifiedValueButton <ModifiedArmourType>(itemTypesTextFieldInt.finalAmount, "m_MaxDexterityBonus", blueprintArmorTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.BeginHorizontal();
                            GL.Label("m_Weight: " + blueprintArmorTypes[i].Weight.ToString());
                            itemTypesTextFieldFloat.RenderFieldNoGroup();
                            SetModifiedValueButton <ModifiedArmourType>(itemTypesTextFieldFloat.finalAmount, "m_Weight", blueprintArmorTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.EndVertical();
                        }
                    }
                    break;

                case 1:
                    List <BlueprintShieldType> blueprintShieldTypes = ResourcesLibrary.GetBlueprints <BlueprintShieldType>().ToList();
                    if (refreshItemTypes)
                    {
                        itemTypeEdit.Clear();
                        foreach (BlueprintShieldType b in blueprintShieldTypes)
                        {
                            itemTypeEdit.Add(false);
                        }
                        refreshItemTypes = false;
                    }

                    for (int i = 0; i < blueprintShieldTypes.Count(); i++)
                    {
                        itemTypeEdit[i] = GL.Toggle(itemTypeEdit[i], blueprintShieldTypes[i].name);
                        if (itemTypeEdit[i])
                        {
                            GL.BeginVertical("box");

                            GL.BeginHorizontal();
                            GL.Label("m_ArcaneSpellFailureChance: " + blueprintShieldTypes[i].ArcaneSpellFailureChance.ToString());
                            itemTypesTextFieldInt.RenderFieldNoGroup();
                            SetModifiedValueButton <ModifiedArmourType>(itemTypesTextFieldInt.finalAmount, "m_ArcaneSpellFailureChance", blueprintShieldTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.BeginHorizontal();
                            GL.Label("m_ArmorBonus: " + blueprintShieldTypes[i].ArmorBonus.ToString());
                            itemTypesTextFieldInt.RenderFieldNoGroup();
                            SetModifiedValueButton <ModifiedArmourType>(itemTypesTextFieldInt.finalAmount, "m_ArmorBonus", blueprintShieldTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.BeginHorizontal();
                            GL.Label("m_ArmorChecksPenalty: " + blueprintShieldTypes[i].ArmorChecksPenalty.ToString());
                            itemTypesTextFieldInt.RenderFieldNoGroup();
                            SetModifiedValueButton <ModifiedArmourType>(itemTypesTextFieldInt.finalAmount, "m_ArmorChecksPenalty", blueprintShieldTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.BeginHorizontal();
                            GL.Label("m_HasDexterityBonusLimit: " + blueprintShieldTypes[i].HasDexterityBonusLimit.ToString());
                            SetModifiedValueButtonBool <ModifiedArmourType>("m_HasDexterityBonusLimit", blueprintShieldTypes[i].AssetGuid);
                            GL.EndHorizontal();


                            GL.BeginHorizontal();
                            GL.Label("m_MaxDexterityBonus: " + blueprintShieldTypes[i].MaxDexterityBonus.ToString());
                            itemTypesTextFieldInt.RenderFieldNoGroup();
                            SetModifiedValueButton <ModifiedArmourType>(itemTypesTextFieldInt.finalAmount, "m_MaxDexterityBonus", blueprintShieldTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.BeginHorizontal();
                            GL.Label("m_Weight: " + blueprintShieldTypes[i].Weight.ToString());
                            itemTypesTextFieldFloat.RenderFieldNoGroup();
                            SetModifiedValueButton <ModifiedArmourType>(itemTypesTextFieldFloat.finalAmount, "m_Weight", blueprintShieldTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.EndVertical();
                        }
                    }
                    break;

                case 2:
                    List <BlueprintWeaponType> blueprintWeaponTypes = ResourcesLibrary.GetBlueprints <BlueprintWeaponType>().ToList();
                    if (refreshItemTypes)
                    {
                        itemTypeEdit.Clear();
                        foreach (BlueprintWeaponType b in blueprintWeaponTypes)
                        {
                            itemTypeEdit.Add(false);
                        }
                        refreshItemTypes = false;
                    }

                    for (int i = 0; i < blueprintWeaponTypes.Count(); i++)
                    {
                        itemTypeEdit[i] = GL.Toggle(itemTypeEdit[i], blueprintWeaponTypes[i].name);
                        if (itemTypeEdit[i])
                        {
                            GL.BeginVertical("box");

                            GL.BeginHorizontal();
                            GL.Label("m_AttackType: " + blueprintWeaponTypes[i].AttackType.ToString());
                            SetModifiedValueButtonAttackType <ModifiedWeaponType>("m_AttackType", blueprintWeaponTypes[i].AssetGuid);
                            GL.EndHorizontal();


                            GL.BeginHorizontal();
                            GL.Label("m_AttackRange: " + Traverse.Create(blueprintWeaponTypes[i]).Field("m_AttackRange").GetValue().ToString());
                            itemTypesTextFieldInt.RenderFieldNoGroup();
                            SetModifiedValueButton <ModifiedWeaponType>(itemTypesTextFieldInt.finalAmount.Feet(), "m_AttackRange", blueprintWeaponTypes[i].AssetGuid);
                            GL.EndHorizontal();
                            MenuTools.SingleLineLabel("AttackRange = (m_AttackRange > 10) ? m_AttackRange : Math.Max(2, m_AttackRange - 4)");

                            GL.BeginVertical("box");
                            GL.BeginHorizontal();
                            GL.Label("m_BaseDamage: " + blueprintWeaponTypes[i].BaseDamage.ToString());
                            GL.EndHorizontal();

                            GL.BeginHorizontal();
                            itemTypesTextFieldInt.RenderFieldNoGroup("misc_NumberOfRolls");
                            GL.EndHorizontal();

                            diceTypesGrid.Render();

                            GL.BeginHorizontal();
                            GL.FlexibleSpace();
                            SetModifiedValueButtonDiceFormula <ModifiedWeaponType>(itemTypesTextFieldInt.finalAmount, Common.IntToDiceType(diceTypesGrid.selected), "m_BaseDamage", blueprintWeaponTypes[i].AssetGuid);
                            GL.EndHorizontal();
                            GL.EndVertical();

                            GL.BeginHorizontal();
                            GL.Label("m_CriticalRollEdge: " + blueprintWeaponTypes[i].CriticalRollEdge.ToString());
                            itemTypesTextFieldInt.RenderFieldNoGroup();
                            SetModifiedValueButton <ModifiedWeaponType>(itemTypesTextFieldInt.finalAmount, "m_CriticalRollEdge", blueprintWeaponTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.BeginHorizontal();
                            GL.Label("m_CriticalModifier: " + blueprintWeaponTypes[i].CriticalModifier.ToString());
                            SetModifiedValueDamageCriticalModifierType <ModifiedWeaponType>("m_CriticalModifier", blueprintWeaponTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.BeginHorizontal();
                            GL.Label("m_Weight: " + blueprintWeaponTypes[i].Weight.ToString());
                            itemTypesTextFieldFloat.RenderFieldNoGroup();
                            SetModifiedValueButton <ModifiedWeaponType>(itemTypesTextFieldFloat.finalAmount, "m_Weight", blueprintWeaponTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.BeginHorizontal();
                            GL.Label("m_IsTwoHanded: " + blueprintWeaponTypes[i].IsTwoHanded.ToString());
                            SetModifiedValueButtonBool <ModifiedWeaponType>("m_IsTwoHanded", blueprintWeaponTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.BeginHorizontal();
                            GL.Label("m_IsLight: " + blueprintWeaponTypes[i].IsLight.ToString());
                            SetModifiedValueButtonBool <ModifiedWeaponType>("m_IsLight", blueprintWeaponTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.BeginHorizontal();
                            GL.Label("m_IsMonk: " + blueprintWeaponTypes[i].IsMonk.ToString());
                            SetModifiedValueButtonBool <ModifiedWeaponType>("m_IsMonk", blueprintWeaponTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.BeginHorizontal();
                            GL.Label("m_IsNatural: " + blueprintWeaponTypes[i].IsNatural.ToString());
                            SetModifiedValueButtonBool <ModifiedWeaponType>("m_IsNatural", blueprintWeaponTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.BeginHorizontal();
                            GL.Label("m_IsUnarmed: " + blueprintWeaponTypes[i].IsUnarmed.ToString());
                            SetModifiedValueButtonBool <ModifiedWeaponType>("m_IsUnarmed", blueprintWeaponTypes[i].AssetGuid);
                            GL.EndHorizontal();

                            GL.BeginHorizontal();
                            GL.Label("m_OverrideAttackBonusStat: " + Traverse.Create(blueprintWeaponTypes[i]).Field("m_OverrideAttackBonusStat").GetValue().ToString());
                            SetModifiedValueButtonBool <ModifiedWeaponType>("m_OverrideAttackBonusStat", blueprintWeaponTypes[i].AssetGuid);
                            GL.EndHorizontal();


                            GL.BeginVertical("box");
                            GL.BeginHorizontal();
                            GL.Label("m_AttackBonusStatOverride: " + Traverse.Create(blueprintWeaponTypes[i]).Field("m_AttackBonusStatOverride").GetValue().ToString());
                            GL.EndHorizontal();
                            SetModifiedValueStatType <ModifiedWeaponType>("m_AttackBonusStatOverride", blueprintWeaponTypes[i].AssetGuid);
                            GL.EndVertical();


                            GL.EndVertical();
                        }
                    }
                    break;
                }
            }
        }