Inheritance: MonoBehaviour
Exemplo n.º 1
0
 private void HandleOpenHelp(MenuItem menu, PopupTargetInfo pti)
 {
     using (JaneScript js = WrapperManager.GetJaneScript()) {
         FileInfo fi = new FileInfo(js.ExeName());
         Process.Start(Path.Combine(fi.Directory.FullName, "NJSP_CN.txt"));
     }
 }
Exemplo n.º 2
0
        public RandomiserMenu(Menu rootMenu)
        {
            var menu = new Menu("Randomiser", "randomiser");

            var enabled =
                new MenuItem("enabled", "Enabled").SetValue(false)
                    .SetTooltip("Will intentionally fail to counter abilities");
            menu.AddItem(enabled);
            enabled.ValueChanged += (sender, args) => Enabled = args.GetNewValue<bool>();
            Enabled = enabled.IsActive();

            var nukesOnly =
                new MenuItem("nukesOnly", "Nukes only").SetValue(true)
                    .SetTooltip(
                        "If enabled, only nukes will be randomised and disable abilities will always be countered");
            menu.AddItem(nukesOnly);
            nukesOnly.ValueChanged += (sender, args) => NukesOnly = args.GetNewValue<bool>();
            NukesOnly = nukesOnly.IsActive();

            var failChance = new MenuItem("failChance", "Fail chance").SetValue(new Slider(20, 5, 50));
            menu.AddItem(failChance);
            failChance.ValueChanged += (sender, args) => FailChance = args.GetNewValue<Slider>().Value;
            FailChance = failChance.GetValue<Slider>().Value;

            rootMenu.AddSubMenu(menu);
        }
Exemplo n.º 3
0
 private void InitializeHeaderContextMenuItems()
 {
     ObservableCollection<MenuItem> headerItems = new ObservableCollection<MenuItem>();
     ObservableCollection<MenuItem> sortItems = new ObservableCollection<MenuItem>();
     MenuItem sortAscItem = new MenuItem();
     sortAscItem.Text = "Ascending";
     sortItems.Add( sortAscItem );
     MenuItem sortDescItem = new MenuItem();
     sortDescItem.Text = "Descending";
     sortItems.Add( sortDescItem );
     MenuItem sortNoneItem = new MenuItem();
     sortNoneItem.Text = "None";
     sortItems.Add( sortNoneItem );
     MenuItem sortItem = new MenuItem();
     sortItem.Text = "Sort";
     sortItem.SubItems = sortItems;
     headerItems.Add( sortItem );
     MenuItem moveLeftItem = new MenuItem();
     moveLeftItem.Text = "Move Left";
     headerItems.Add( moveLeftItem );
     MenuItem moveRightItem = new MenuItem();
     moveRightItem.Text = "Move Right";
     headerItems.Add( moveRightItem );
     this.HeaderContextMenuItems = headerItems;
 }
Exemplo n.º 4
0
 private void HandleFindId(MenuItem mi, PopupTargetInfo pti)
 {
     using (JaneScript js = WrapperManager.GetJaneScript())
     using (ViewItem view = pti.PopupObject.ConvertToConcreteWrapper<ViewItem>())
     using (ThreadItem thread = view.Thread()) {
         if (null == thread) {
             js.Log("通常のスレッドのタブから実行してください。");
             return;
         }
         string id;
         int resNumber = pti.Number;
         if (resNumber > 0) {
             //日付中ID
             using (ResItem res = thread.GetRes(resNumber)) {
                 id = res.Id;
             }
         } else {
             id = pti.InfoText;
         }
         if (string.IsNullOrEmpty(id)) {
             js.Log("IDが取得できませんでした。");
         }
         try {
             this.DoFindId(js, thread, id);
         } catch (Exception ex) {
             js.Log(ex.Message);
             js.Log(ex.StackTrace);
         }
     }
 }
Exemplo n.º 5
0
        private static Menu DrawingMenu()
        {
            var drawMenu = new Menu("Drawing Settings", "Drawings");
            drawMenu
                .AddItem(
                    new MenuItem("drawoptions", "Drawing Mode Mode").SetValue(
                        new StringList(new[] { "Normal Mode", "Colorblind Mode" })));
            drawMenu.SubMenu("Drawings").AddItem(new MenuItem("Draw", "Display Drawings").SetValue(true));
            drawMenu.SubMenu("Drawings").AddItem(new MenuItem("qDraw", "Draw Q").SetValue(true));
            drawMenu.SubMenu("Drawings").AddItem(new MenuItem("eDraw", "Draw E").SetValue(true));
            drawMenu.SubMenu("Drawings").AddItem(new MenuItem("wDraw", "Draw W").SetValue(true));
            drawMenu.SubMenu("Drawings").AddItem(new MenuItem("stackDraw", "Stack Count").SetValue(true));
            drawMenu.SubMenu("Drawings").AddItem(new MenuItem("notdraw", "Draw Floating Text").SetValue(true));
            drawMenu.SubMenu("Drawings").AddItem(new MenuItem("keyBindDisplay", "Display Keybinds").SetValue(true));  

            var drawDamageMenu = new MenuItem("RushDrawEDamage", "Combo Damage").SetValue(true);
            var drawFill =
                new MenuItem("RushDrawWDamageFill", "Draw Damage Fill").SetValue(new Circle(true, Color.SeaGreen));
            drawMenu.SubMenu("Drawings").AddItem(drawDamageMenu);
            drawMenu.SubMenu("Drawings").AddItem(drawFill);

            //GlobalManager.EnableDrawingDamage = drawDamageMenu.GetValue<bool>();
            //GlobalManager.EnableFillDamage = drawFill.GetValue<Circle>().Active;
            //GlobalManager.DamageFillColor = drawFill.GetValue<Circle>().Color;

            return drawMenu;
        }
Exemplo n.º 6
0
 public ActionResult Creat(MenuItem menuItem)
 {
     //menuItem.EncodedCatagory = EscapeUrl.UnicodeParse(menuItem.EncodedCatagory);
     if (ModelState.IsValid)
     {
         if (menuItem.Url == null)
         {
             switch (menuItem.Type)
             {
                 case 1: menuItem.RewriterUrl = "/tin-tuc/";
                     break;
                 case 2: menuItem.RewriterUrl = "/san-pham/";
                     break;
                 case 3: menuItem.RewriterUrl = "/khach-hang/";
                     break;
                 case 4: menuItem.RewriterUrl = "/download/";
                     break;
                 case 5: menuItem.RewriterUrl = "/lien-he/";
                     break;
             }
         }
         else
         {
             menuItem.RewriterUrl = menuItem.Url;
         }
         dbContext.MenuItems.Add(menuItem);
         dbContext.SaveChanges();
         int index = 0;
         index = dbContext.MenuItems.OrderBy(x => x.Name).ToList().IndexOf(menuItem);
         return Json(index, JsonRequestBehavior.AllowGet);
     }
     return new HttpStatusCodeResult(400, "Custom Error Message 3");
 }
Exemplo n.º 7
0
        public MainForm(MenuItem menuItem, Options options)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            onTopToolStripMenuItem.Checked = options.onTop;
            this.TopMost = onTopToolStripMenuItem.Checked;

            centerOnScreenToolStripMenuItem.Checked = options.centerScreen;
            if (centerOnScreenToolStripMenuItem.Checked) {
                this.StartPosition = FormStartPosition.CenterScreen;
            } else if (options.mousePosition) {
                this.StartPosition = FormStartPosition.Manual;
                this.Top = Cursor.Position.Y - 10;
                this.Left = Cursor.Position.X - 10;
            } else {
                this.StartPosition = FormStartPosition.Manual;
                this.Top = options.top;
                this.Left = options.left;
            }

            setNewPath(menuItem);

            this.Text = menuItem.caption;

            setMouseCursor ();

            closeAfterExecuteToolStripMenuItem.Checked = options.closeExec;
            closeOnLostFocusToolStripMenuItem.Checked = options.closeOnLost;
        }
Exemplo n.º 8
0
        public MenuManager()
        {
            menu = new Menu("Vision Control", "visionControl", true);

            var unitsMenu = new Menu("Enabeld", "enabled");
            var rangesMenu = new Menu("Show ranges", "showRanges");
            var timersMenu = new Menu("Show timers", "showTimers");

            var units = Variables.Units.ToDictionary(x => x.Key, x => true);
            var ranges = new Dictionary<string, bool>(units);
            var timers = new Dictionary<string, bool>
            {
                { "techies_stasis_trap", true },
                { "techies_remote_mines", true },
                { "pugna_nether_ward", true },
                { "undying_tombstone", true },
                { "venomancer_plague_ward", true },
                { "item_ward_sentry", true },
                { "item_ward_observer", true }
            };

            unitsMenu.AddItem(enabled = new MenuItem("enabled", "For:").SetValue(new AbilityToggler(units)));

            rangesMenu.AddItem(
                enabledRanges = new MenuItem("enabledRanges", "For:").SetValue(new AbilityToggler(ranges)));

            timersMenu.AddItem(
                enabledTimers = new MenuItem("enabledTimers", "For:").SetValue(new AbilityToggler(timers)));

            menu.AddSubMenu(unitsMenu);
            menu.AddSubMenu(rangesMenu);
            menu.AddSubMenu(timersMenu);
            menu.AddToMainMenu();
        }
Exemplo n.º 9
0
        public ObservableCollection<MenuItem> GetMenuItems()
        {
            ObservableCollection<MenuItem> items = new ObservableCollection<MenuItem>();

            MenuItem copyItem = new MenuItem()
            {
                IconUrl = new Uri("Images/copy.png", UriKind.Relative),
                Text = "Copy",
                Command = new CopyCommand()
            };
            items.Add(copyItem);

            MenuItem pasteItem = new MenuItem()
            {
                IconUrl = new Uri("Images/paste.png", UriKind.Relative),
                Text = "Paste",
                Command = new PasteCommand()
            };
            items.Add(pasteItem);

            MenuItem cutItem = new MenuItem()
            {
                IconUrl = new Uri("Images/cut.png", UriKind.Relative),
                Text = "Cut",
                Command = new CutCommand()
            };
            items.Add(cutItem);

            return items;
        }
Exemplo n.º 10
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Application.Init ();

            this.Resize(640,480);
            //menu bar very top
            MenuBar mb = new MenuBar ();
            Menu fileMenu = new Menu ();
            MenuItem menuItem = new MenuItem ("_File");
            menuItem.Submenu = fileMenu;
            mb.Append(menuItem);
            MenuItem menuFileQuit = new MenuItem("Quit");
            fileMenu.Append(menuFileQuit);
            vboxMain.PackStart(mb,false,false,0);

            //toolbar
            Toolbar tbTop = new Toolbar ();
            //toolbutton Staff
            ToolButton tbStaff = new ToolButton (Gtk.Stock.OrientationPortrait);
            tbStaff.Label="Staff";
            tbStaff.IsImportant=true;
            tbStaff.Clicked += HandleTbStaffClicked;
            tbTop.Insert(tbStaff,0);
            //toolbutton Clients
            ToolButton tbClients = new ToolButton (Gtk.Stock.About);
            tbClients.Label="Clients";
            tbClients.IsImportant=true;
            tbClients.Clicked+= HandleTbClientsClicked;
            tbTop.Insert(tbClients,1);
            //media bar
            Label lbMediaTemp = new Label ();
            lbMediaTemp.Text="Media holder";
            lbMediaTemp.Show();
            //pack the toolbar and media bar in the top hbox//
            hbTop.PackStart(tbTop);
            hbTop.PackStart(lbMediaTemp);
            //pack the top hbox in the main vbox
            vboxMain.PackStart(hbTop,false,false,1);
            // horizontal pane
            verticalPane.Position=200;
            verticalPane.Pack1(scrollWindowLeft,false,false);
            verticalPane.Pack2(scrollWindowRight,false,false);
            vboxMain.PackStart(verticalPane);
            scrollWindowLeft.Add(viewPortLeft);

            scrollWindowRight.Add(viewPortRight);
            Label lbMain = new Label ();
            lbMain.Text= "main";
            viewPortRight.Add(lbMain);
            verticalPane.ShowAll();
            //status bar very bottom
            Statusbar sb = new Statusbar ();
            vboxMain.PackStart(sb,false,false,1);

            this.Add(vboxMain);
            //hb1.Add(tbTop);
            this.ShowAll ();
        Build ();
    }
 protected override void OnLoad(EventArgs e)
 {
     Assert.ArgumentNotNull((object)e, "e");
     base.OnLoad(e);
     if (!Context.ClientPage.IsEvent)
     {
         Item currentItem = GalleryPublishedTargetsForm.GetCurrentItem();
         if (currentItem != null)
         {
             var targets = new PublishingHelper().ListTargets(currentItem);
             foreach (var target in targets.Keys)
             {
                 var menuItem = new MenuItem();
                 menuItem.Header = target;
                 if(targets[target].Equals(PublishingHelper.PublishState.Published))
                 {
                     menuItem.Icon = "Other/32x32/bullet_ball_glass_green.png";
                 }
                 else if (targets[target].Equals(PublishingHelper.PublishState.Changed))
                 {
                     menuItem.Icon = "Other/32x32/bullet_ball_glass_yellow.png";
                 }
                 else
                 {
                     menuItem.Icon = "Other/32x32/bullet_ball_glass_red.png";
                 }
                 this.Targets.Controls.Add(menuItem);
             }
         }
     }
 }
Exemplo n.º 12
0
        public void addItem(string category, MenuItem item)
        {
            if (!m_menu.ContainsKey(category))
                m_menu[category] = new List<MenuItem>();

            m_menu[category].Add(item);
        }
Exemplo n.º 13
0
        public static void Main(string[] args)
        {
            MenuItem item;

            item = new MenuItem("heroes", "Check allied heroes").SetValue(true);
            item.ValueChanged += Item_ValueChanged;
            Menu.AddItem(item);

            item = new MenuItem("wards", "Check wards").SetValue(true);
            item.ValueChanged += Item_ValueChanged;
            Menu.AddItem(item);

            item = new MenuItem("mines", "Check techies mines").SetValue(true);
            item.ValueChanged += Item_ValueChanged;
            Menu.AddItem(item);

            item = new MenuItem("units", "Check controlled units (not lane creeps)").SetValue(true);
            item.ValueChanged += Item_ValueChanged;
            Menu.AddItem(item);

            item = new MenuItem("buildings", "Check buildings").SetValue(true);
            item.ValueChanged += Item_ValueChanged;
            Menu.AddItem(item);

            Menu.AddToMainMenu();

            Game.OnIngameUpdate += Game_OnUpdate;
        }
Exemplo n.º 14
0
    public MForm2()
    {
        Text = "Check menu item";

        sb = new StatusBar();
        sb.Parent = this;
        sb.Text = "Ready";

        MainMenu mainMenu = new MainMenu();

        MenuItem file = mainMenu.MenuItems.Add("&File");
        file.MenuItems.Add(new MenuItem("E&xit",
            new EventHandler(OnExit), Shortcut.CtrlX));

        MenuItem view = mainMenu.MenuItems.Add("&View");
        viewStatusBar = new MenuItem("View StatusBar");
        viewStatusBar.Checked = true;
        viewStatusBar.Click += new EventHandler(ToggleStatusBar);
        view.MenuItems.Add(viewStatusBar);

        Menu = mainMenu;
        Size = new Size(250, 200);

        CenterToScreen();
    }
Exemplo n.º 15
0
 private static void Game_OnUpdate(EventArgs args)
 {
     if (!Game.IsInGame)
     {
         loaded = false;
         return;
     }
     if (loaded)
     {
         return;
     }
     Game.GetConsoleVar("fog_enable").SetValue(0);
     var player = ObjectMgr.LocalPlayer;
     if ((player == null) || (player.Team == Team.Observer))
         return;
     Game.PrintMessage("<font color='#aaaaaa'>Zoom Improved </font><font color='#33ff66'>Loaded</font>", MessageType.LogMessage);
     var slider = new MenuItem("distance", "Camera Distance").SetValue(new Slider(1550, 1134, 2500));
     slider.ValueChanged += Slider_ValueChanged;
     Menu.AddItem(slider);
     Menu.AddToMainMenu();
     ZoomVar.RemoveFlags(ConVarFlags.Cheat);
     renderVar.RemoveFlags(ConVarFlags.Cheat);
     ZoomVar.SetValue(slider.GetValue<Slider>().Value);
     renderVar.SetValue(2*(slider.GetValue<Slider>().Value));
     loaded = true;
 }
Exemplo n.º 16
0
        public static void Initialize()
        {
            menuItem =
                new MenuItem("Activator.ExecuteTime", "Show Executed Time").SetValue(new KeyBind("N".ToCharArray()[0],KeyBindType.Toggle));

            Program.MenuActivator.AddItem(menuItem);

            Game.OnUpdate += args =>
            {
                foreach (var b in ObjectManager.Player.Buffs)
                {
                    if (b.Caster.IsEnemy && b.EndTime > time)
                    {
                        time = Game.Time;
                    }
                }
            };

            //Obj_AI_Base.OnProcessSpellCast += (sender, args) =>
            //{
            //    if (sender != null && sender.IsEnemy && args.Target.IsMe && sender is Obj_AI_Hero)
            //    {
            //        time = Game.Time;
            //    }
            //};
            Drawing.OnDraw += Drawing_OnDraw;
        }
Exemplo n.º 17
0
        public Ahri()
        {
            if (ObjectManager.Player.ChampionName != "Ahri")
                return;

            (_menu = new Menu("AhriSharp", "AhriSharp", true)).AddToMainMenu();

            var targetSelectorMenu = new Menu("Target Selector", "TargetSelector");
            TargetSelector.AddToMenu(targetSelectorMenu);
            _menu.AddSubMenu(targetSelectorMenu);

            _orbwalker = new Orbwalking.Orbwalker(_menu.AddSubMenu(new Menu("Orbwalking", "Orbwalking")));

            var comboMenu = _menu.AddSubMenu(new Menu("Combo", "Combo"));
            comboMenu.AddItem(new MenuItem("comboQ", "Use Q").SetValue(true));
            comboMenu.AddItem(new MenuItem("comboW", "Use W").SetValue(true));
            comboMenu.AddItem(new MenuItem("comboE", "Use E").SetValue(true));
            comboMenu.AddItem(new MenuItem("comboR", "Use R").SetValue(true));
            comboMenu.AddItem(new MenuItem("comboROnlyUserInitiate", "Use R only if user initiated").SetValue(false));

            var harassMenu = _menu.AddSubMenu(new Menu("Harass", "Harass"));
            harassMenu.AddItem(new MenuItem("harassQ", "Use Q").SetValue(true));
            harassMenu.AddItem(new MenuItem("harassE", "Use E").SetValue(true));
            harassMenu.AddItem(new MenuItem("harassPercent", "Skills until Mana %").SetValue(new Slider(20)));

            var farmMenu = _menu.AddSubMenu(new Menu("Lane Clear", "LaneClear"));
            farmMenu.AddItem(new MenuItem("farmQ", "Use Q").SetValue(true));
            farmMenu.AddItem(new MenuItem("farmW", "Use W").SetValue(false));
            farmMenu.AddItem(new MenuItem("farmPercent", "Skills until Mana %").SetValue(new Slider(20)));
            farmMenu.AddItem(new MenuItem("farmStartAtLevel", "Only AA until Level").SetValue(new Slider(8, 1, 18)));

            var drawMenu = _menu.AddSubMenu(new Menu("Drawing", "Drawing"));
            drawMenu.AddItem(new MenuItem("drawQE", "Draw Q, E range").SetValue(new Circle(true, System.Drawing.Color.FromArgb(125, 0, 255, 0))));
            drawMenu.AddItem(new MenuItem("drawW", "Draw W range").SetValue(new Circle(false, System.Drawing.Color.FromArgb(125, 0, 0, 255))));
            var dmgAfterComboItem = new MenuItem("DamageAfterCombo", "Draw Combo Damage").SetValue(true); //copied from esk0r Syndra
            drawMenu.AddItem(dmgAfterComboItem);

            var miscMenu = _menu.AddSubMenu(new Menu("Misc", "Misc"));
            miscMenu.AddItem(new MenuItem("packetCast", "Packet Cast").SetValue(true));

            _itemDFG = Utility.Map.GetMap().Type == Utility.Map.MapType.TwistedTreeline ? new Items.Item(3188, 750) : new Items.Item(3128, 750);

            _spellQ = new Spell(SpellSlot.Q, 990);
            _spellW = new Spell(SpellSlot.W, 795 - 95);
            _spellE = new Spell(SpellSlot.E, 1000 - 10);
            _spellR = new Spell(SpellSlot.R, 1000 - 100);

            _spellQ.SetSkillshot(.215f, 100, 1600f, false, SkillshotType.SkillshotLine);
            _spellW.SetSkillshot(.71f, _spellW.Range, float.MaxValue, false, SkillshotType.SkillshotLine);
            _spellE.SetSkillshot(.23f, 60, 1500f, true, SkillshotType.SkillshotLine);

            Utility.HpBarDamageIndicator.DamageToUnit = GetComboDamage;
            Utility.HpBarDamageIndicator.Enabled = dmgAfterComboItem.GetValue<bool>();
            dmgAfterComboItem.ValueChanged += delegate(object sender, OnValueChangeEventArgs eventArgs) { Utility.HpBarDamageIndicator.Enabled = eventArgs.GetNewValue<bool>(); };

            Drawing.OnDraw += Drawing_OnDraw;
            Game.OnUpdate += Game_OnUpdate;

            Game.PrintChat("<font color=\"#1eff00\">AhriSharp by Beaving</font> - <font color=\"#00BFFF\">Loaded</font>");
        }
Exemplo n.º 18
0
 public void SetMenuItem(KebabMenuController kebabMenuControllerReference, MenuItem newMenuItem)
 {
     this.kebabMenuControllerReference = kebabMenuControllerReference;
     menuItem = newMenuItem;
     CopyModelDataToGUI();
     SetupInputs();
 }
Exemplo n.º 19
0
        private static void drawMenu(int x, int y, MenuItem menuItem)
        {
            #region	Get all values

            var menuItems		= menuItem.ChildMenuItems;
            var options			= menuItem.Options;
            var frameOptions	= options.FrameOptions;
            var colorScheme		= options.ColorScheme ?? DefaultColorScheme;

            frameOptions.ColorScheme.FrameForeColor   = colorScheme.FrameForeColor;
            frameOptions.ColorScheme.FrameForeColor   = colorScheme.FrameForeColor;
            frameOptions.ColorScheme.CaptionForeColor = colorScheme.CaptionForeColor;
            frameOptions.ColorScheme.CaptionBackColor = colorScheme.CaptionBackColor;

            #endregion

            #region	Draw the frame

            var frameHeight		= menuItem.GetCalculatedHeight;
            var frameWidth		= menuItem.GetCalculatedWidth;
            ZBuffer.ReadBuffer("Menu_" + menuItem.Caption, x, y, frameWidth, frameHeight);
            frameOptions.Caption = menuItem.Caption;
            frameOptions.IsFilled = true;
            ZFrame.DrawFrame(x, y, frameOptions, frameWidth, frameHeight);

            var frameSpacingX	= options.FrameSpacingHorizontal;
            var frameSpacingY	= options.FrameSpacingVertical;
            var linerPerItem	= options.ItemSpacing + 1;
            var numberOffset	= options.Mode != MenuMode.ArrowsOnly ? 4 : 0;

            #endregion

            #region	Draw menu items

            for (var i = 0; i < menuItems.Count; i++)
            {
                var item = menuItems[i];
                var xPos = x + 1 + frameSpacingX;
                var yPos = y + 1 + frameSpacingY + i*linerPerItem;
                if (options.Mode != MenuMode.ArrowsOnly)
                {
                    var itemNumber = (i + 1).ToString();
                    ZOutput.Print(xPos,     yPos, options.Brackets[0] + " " + options.Brackets[1], colorScheme.BracketsForeColor,	colorScheme.BracketsBackColor);
                    ZOutput.Print(xPos + 1, yPos, itemNumber, colorScheme.NumberForeColor, colorScheme.NumberBackColor);
                }

                ZOutput.Print(xPos + numberOffset, yPos, item.Caption,
                    item.IsActive ? colorScheme.TextForeColor : colorScheme.InactiveForeColor,
                    item.IsActive ? colorScheme.TextBackColor : colorScheme.InactiveBackColor);

                if (item.HasChilds)
                {
                    ZOutput.Print(x + frameWidth - 2, yPos, ">",
                        item.IsActive ? colorScheme.NumberForeColor : colorScheme.InactiveForeColor,
                        item.IsActive ? colorScheme.NumberBackColor : colorScheme.InactiveBackColor);
                }
            }

            #endregion
        }
Exemplo n.º 20
0
 /// <summary>
 /// This function adds a given layer to the tree. 
 /// </summary>
 /// <param name="layer">The layer that is being added. </param>
 public void AddLayerToTree(Layer layer)
 {
     MenuItem root = new MenuItem() { Title = "Location" };
     root.Items.Add(new MenuItem() { Title = "Time" });
     //TreeViewItems.Add(root);
     //LayerView.Items.Add(root);
 }
Exemplo n.º 21
0
 public MenuItemControl(MenuItem menuItem)
 {
     InitializeComponent();
       this.Btn_1.Content = menuItem.Header;
       this.Btn_2.Content = menuItem.Info;
       this.text_1.Text = menuItem.VideoPath;
 }
Exemplo n.º 22
0
 void spellItem_Validated(MenuItem sender, ValidationEventArgs e)
 {
     Combat.ChangeState(BlazeraLib.Combat.EState.SpellCellSelection, new Phase.StartInfo(new Dictionary<string,object>()
     {
         { "Spell", sender.GetText() }
     }));
 }
Exemplo n.º 23
0
        private static void Game_OnGameLoad()
        {
            //Notifications.AddNotification("CS Counter loaded.", 10);

            _menu2 = new Menu("CS Counter", "menu2", false);
            //var drawings2 = new Menu("Drawings", "drawings2");
            //_menu2.AddSubMenu(drawings2);

            _menuenable2 = new MenuItem("menu.drawings.enable2", "CS Count").SetValue(true);
            _menu2.AddItem(_menuenable2);
            _menuenable3 = new MenuItem("menu.drawings.enable3", "My CS Count").SetValue(true);
            _menu2.AddItem(_menuenable3);
            _menuenable4 = new MenuItem("menu.drawings.enable4", "Allies CS Count").SetValue(true);
            _menu2.AddItem(_menuenable4);
            advanced = new MenuItem("menu.drawings.advanced", "Advanced Farminfo (ME)").SetValue(false);
            _menu2.AddItem(advanced);
            _xPos = new MenuItem("menu.Calc.calc5", "X - Position").SetValue(new Slider(47));
            _menu2.AddItem(_xPos);
            _yPos = new MenuItem("menu.Calc.calc6", "Y - Position").SetValue(new Slider(-10));
            _menu2.AddItem(_yPos);

            UtilityAIO.Program.MainMenuOp.AddSubMenu(_menu2);

            minionspawn = new TimeSpan(0,0,1,30);
            countminionwave = 3;
            timeplus = new TimeSpan(0, 0, 0, 30);
            waveone = 0;
            wavetwo = 1;
            wavethree = 2;
            minionsgesamt = 0;
            Drawing.OnDraw += Drawing_OnDraw;
        }
Exemplo n.º 24
0
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!Page.IsPostBack)
		{
			DataSet ds = GetProductsAndCategories();

			// Loop through the category records.
			foreach (DataRow row in ds.Tables["Categories"].Rows)
			{
				// Use the constructor that requires just text
				// and a non-displayed value.
				MenuItem itemCategory = new MenuItem(
					row["CategoryName"].ToString(),
					row["CategoryID"].ToString());

				Menu1.Items.Add(itemCategory);

				// Get the children (products) for this parent (category).
				DataRow[] childRows = row.GetChildRows(ds.Relations[0]);

				// Loop through all the products in this category.
				foreach (DataRow childRow in childRows)
				{
					MenuItem itemProduct = new MenuItem(
						childRow["ProductName"].ToString(),
						childRow["ProductID"].ToString());
					itemCategory.ChildItems.Add(itemProduct);

				}
			}
		}
	}
Exemplo n.º 25
0
        internal static void Initialize()
        {
            var manaBarItem = new MenuItem("DrawManaBarIndicator", "Draw Combo ManaBar Indicator").SetValue(true);
            Program.DrawMenu.AddItem(manaBarItem);

            DxLine = new Line(DxDevice) { Width = 4 };

            Drawing.OnPreReset += DrawingOnOnPreReset;
            Drawing.OnPostReset += DrawingOnOnPostReset;
            AppDomain.CurrentDomain.DomainUnload += CurrentDomainOnDomainUnload;
            AppDomain.CurrentDomain.ProcessExit += CurrentDomainOnDomainUnload;

            Drawing.OnEndScene += eventArgs =>
                {
                    var color = new ColorBGRA(255, 255, 255, 255);

                    var qMana = new[] { 0, 40, 50, 60, 70, 80 };
                    var wMana = new[] { 0, 60, 70, 80, 90, 100 }; // W Mana Cost doesnt works :/
                    var eMana = new[] { 0, 50, 50, 50, 50, 50 };
                    var rMana = new[] { 0, 100, 100, 100 };

                    if (manaBarItem.GetValue<bool>())
                    {
                        var totalCostMana = qMana[Program.Q.Level] + wMana[Program.W.Level] + eMana[Program.E.Level]
                                            + rMana[Program.R.Level];
                        DrawManaPercent(
                            totalCostMana,
                            totalCostMana > ObjectManager.Player.Mana ? new ColorBGRA(255, 0, 0, 255) : new ColorBGRA(255, 255, 255, 255));
                    }

                };
        }
Exemplo n.º 26
0
	public MainForm ()
	{
		// 
		// _mainMenu
		// 
		_mainMenu = new MainMenu ();

		// 
		// _fileMenu
		// 
		_fileMenuItem = new MenuItem ();
		_fileMenuItem.Text = "&File";
		_mainMenu.MenuItems.Add (_fileMenuItem);
		// 
		// openToolStripMenuItem
		// 
		_openMenuItem = new MenuItem ();
		_openMenuItem.Text = "&Open";
		_openMenuItem.Click += new EventHandler (OpenMenuItem_Click);
		_fileMenuItem.MenuItems.Add (_openMenuItem);
		// 
		// MainForm
		// 
		ClientSize = new Size (400, 300);
		IsMdiContainer = true;
		Location = new Point (200, 100);
		Menu = _mainMenu;
		StartPosition = FormStartPosition.Manual;
		Text = "bug #81651";
		Load += new EventHandler (MainForm_Load);
	}
	public PhotoVersionMenu (Photo photo)
	{
		version_id = photo.DefaultVersionId;

		uint [] version_ids = photo.VersionIds;
		item_infos = new MenuItemInfo [version_ids.Length];

		int i = 0;
		foreach (uint id in version_ids) {
			MenuItem menu_item = new MenuItem (photo.GetVersionName (id));
			menu_item.Show ();
			menu_item.Sensitive = true;
			menu_item.Activated += new EventHandler (HandleMenuItemActivated);

			item_infos [i ++] = new MenuItemInfo (menu_item, id);

			Append (menu_item);
		}

		if (version_ids.Length == 1) {
			MenuItem no_edits_menu_item = new MenuItem (Mono.Unix.Catalog.GetString ("(No Edits)"));
			no_edits_menu_item.Show ();
			no_edits_menu_item.Sensitive = false;
			Append (no_edits_menu_item);
		}
	}
Exemplo n.º 28
0
		private static void Game_OnUpdate(EventArgs args)
		{
			if (!Game.IsInGame)
			{
				loaded = false;
				return;
			}
			if (loaded)
			{
				return;
			}
			var slider = new MenuItem("distance", "Camera Distance").SetValue(new Slider(1550, 1134, 2500));
			slider.ValueChanged += Slider_ValueChanged;
			Menu.AddItem(slider);
			Menu.AddToMainMenu();
			ZoomVar.RemoveFlags(ConVarFlags.Cheat);
			ZoomVar.SetValue(slider.GetValue<Slider>().Value);
			Game.GetConsoleVar("r_farz").SetValue(18000);
			Game.GetConsoleVar("fog_enable").SetValue(0);
			Game.GetConsoleVar("dota_camera_disable_zoom").SetValue(0);
			// This section makes MapHack Working
			var list = new Dictionary<string, float>
			{
			{ "sv_cheats", 1 }
			};
			foreach (var data in list)
			{
				var var = Game.GetConsoleVar(data.Key);
				var.RemoveFlags(ConVarFlags.Cheat);
				var.SetValue(data.Value);
			}
			// Thats it
			loaded = true;
		}
Exemplo n.º 29
0
 /// <summary>
 ///     Calculate the item's width.
 /// </summary>
 /// <param name="menuItem">The <see cref="MenuItem" /></param>
 /// <returns>The width</returns>
 public static int CalcWidthItem(MenuItem menuItem)
 {
     return
         (int)
         (MeasureString(MultiLanguage.Translation(menuItem.DisplayName)).Width
          + (MenuSettings.ContainerTextOffset * 2));
 }
    public void ListaMenu()
    {
        MenuItem menu = new MenuItem();
        BEMenu eMenu = new BEMenu();
        BERolMenu eRolMenu = new BERolMenu();
        DataTable dt = new DataTable();

        eRolUsuario.Cod_Personal = Session["IDPERSONAL"].ToString();

        try
        {
            eRolMenu.Id_Rol = Convert.ToInt32(Session["RolElegido"].ToString());
            eMenu.Id_Padre = 0;

            dt = objMenu.ConsultarMenu(eMenu, eRolMenu);
            if (dt.Rows.Count > 0)
            {
                Session["NewRol"] = Convert.ToInt32(Session["RolElegido"].ToString());
                CargaMenu(dt);
            }
        }
        catch (Exception ex)
        {
            NetAjax.JsMensajeAlert(this.Page, ex.Message);
        }
    }
Exemplo n.º 31
0
 public void DeleteFromMenuItemRepository(MenuItem menuItem)
 {
     MenuItemSingletonRepository.Instance.DeleteFromRepository(menuItem);
 }
Exemplo n.º 32
0
        private void Start(string[] args)
        {
            var version     = Assembly.GetExecutingAssembly().GetName().Version;
            var buildTime   = Utils.RetrieveLinkerTimestamp(Assembly.GetExecutingAssembly().Location);
            var programName = $"DNSAgent {version.Major}.{version.Minor}.{version.Build}";

            logger.Info($"{programName} (built on {buildTime.ToString(CultureInfo.CurrentCulture)})");
            logger.Info("Starting DNSAgent...");

            var rules           = LoadRules();
            var listenEndpoints = AppConf.ListenOn.Split(',');
            var startedEvent    = new CountdownEvent(listenEndpoints.Length);

            lock (DnsAgents)
            {
                foreach (var listenOn in listenEndpoints)
                {
                    var agent = new DnsAgent(AppConf, rules, listenOn.Trim(), AgentCommonCache);
                    agent.Started += () => startedEvent.Signal();
                    DnsAgents.Add(agent);
                }
            }
            if (Environment.UserInteractive)
            {
                lock (DnsAgents)
                {
                    if (DnsAgents.Any(agent => !agent.Start()))
                    {
                        Console.WriteLine("Press any key to continue ...");
                        Console.ReadKey(true);
                        return;
                    }
                }
                startedEvent.Wait();
                logger.Info("DNSAgent has been started.");
                Console.WriteLine("Press Ctrl-R to reload rules and clear global cache, Ctrl-Q to stop and quit.");

                Task.Run(() =>
                {
                    var exit = false;
                    while (!exit)
                    {
                        var keyInfo = Console.ReadKey(true);
                        if (keyInfo.Modifiers != ConsoleModifiers.Control)
                        {
                            continue;
                        }
                        switch (keyInfo.Key)
                        {
                        case ConsoleKey.R:     // Reload options.cfg and rules.cfg
                            Reload();
                            break;

                        case ConsoleKey.Q:
                            exit = true;
                            Stop();
                            break;
                        }
                    }
                });

                var hideMenuItem = new MenuItem(AppConf.HideOnStart ? "Show" : "Hide");
                if (AppConf.HideOnStart)
                {
                    ShowWindow(GetConsoleWindow(), SwHide);
                }
                hideMenuItem.Click += (sender, eventArgs) =>
                {
                    if (hideMenuItem.Text == "Hide")
                    {
                        ShowWindow(GetConsoleWindow(), SwHide);
                        hideMenuItem.Text = "Show";
                    }
                    else
                    {
                        ShowWindow(GetConsoleWindow(), SwShow);
                        hideMenuItem.Text = "Hide";
                    }
                };
                _contextMenu = new ContextMenu(new[]
                {
                    hideMenuItem,
                    new MenuItem("Reload", (sender, eventArgs) => Reload()),
                    new MenuItem("Exit", (sender, eventArgs) => Stop(false))
                });
                _notifyIcon = new NotifyIcon
                {
                    Icon        = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location),
                    ContextMenu = _contextMenu,
                    Text        = programName,
                    Visible     = true
                };
                _notifyIcon.MouseClick += (sender, eventArgs) =>
                {
                    if (eventArgs.Button == MouseButtons.Left)
                    {
                        hideMenuItem.PerformClick();
                    }
                };
                Application.Run();
            }
            else
            {
                lock (DnsAgents)
                {
                    foreach (var agent in DnsAgents)
                    {
                        agent.Start();
                    }
                }
                logger.Info("DNSAgent has been started.");
            }
        }
Exemplo n.º 33
0
        /// <summary>
        /// Creates the menu.
        /// </summary>
        private void CreateMenu()
        {
            #region create main weapon options menu and add items
            // Create the menu.
            menu = new Menu(Game.Player.Name, "Weapon Options");

            MenuItem         getAllWeapons    = new MenuItem("Get All Weapons", "Get all weapons.");
            MenuItem         removeAllWeapons = new MenuItem("Remove All Weapons", "Removes all weapons in your inventory.");
            MenuCheckboxItem unlimitedAmmo    = new MenuCheckboxItem("Unlimited Ammo", "Unlimited ammonition supply.", UnlimitedAmmo);
            MenuCheckboxItem noReload         = new MenuCheckboxItem("No Reload", "Never reload.", NoReload);
            MenuItem         setAmmo          = new MenuItem("Set All Ammo Count", "Set the amount of ammo in all your weapons.");
            MenuItem         refillMaxAmmo    = new MenuItem("Refill All Ammo", "Give all your weapons max ammo.");
            MenuItem         spawnByName      = new MenuItem("Spawn Weapon By Name", "Enter a weapon mode name to spawn.");

            // Add items based on permissions
            if (IsAllowed(Permission.WPGetAll))
            {
                menu.AddMenuItem(getAllWeapons);
            }
            if (IsAllowed(Permission.WPRemoveAll))
            {
                menu.AddMenuItem(removeAllWeapons);
            }
            if (IsAllowed(Permission.WPUnlimitedAmmo))
            {
                menu.AddMenuItem(unlimitedAmmo);
            }
            if (IsAllowed(Permission.WPNoReload))
            {
                menu.AddMenuItem(noReload);
            }
            if (IsAllowed(Permission.WPSetAllAmmo))
            {
                menu.AddMenuItem(setAmmo);
                menu.AddMenuItem(refillMaxAmmo);
            }
            if (IsAllowed(Permission.WPSpawnByName))
            {
                menu.AddMenuItem(spawnByName);
            }
            #endregion

            #region addonweapons submenu
            MenuItem addonWeaponsBtn  = new MenuItem("Addon Weapons", "Equip / remove addon weapons available on this server.");
            Menu     addonWeaponsMenu = new Menu("Addon Weapons", "Equip/Remove Addon Weapons");
            menu.AddMenuItem(addonWeaponsBtn);

            #region manage creating and accessing addon weapons menu
            if (IsAllowed(Permission.WPSpawn) && AddonWeapons != null && AddonWeapons.Count > 0)
            {
                MenuController.BindMenuItem(menu, addonWeaponsMenu, addonWeaponsBtn);
                foreach (KeyValuePair <string, uint> weapon in AddonWeapons)
                {
                    string name  = weapon.Key.ToString();
                    uint   model = weapon.Value;
                    var    item  = new MenuItem(name, $"Click to add/remove this weapon ({name}) to/from your inventory.");
                    addonWeaponsMenu.AddMenuItem(item);
                    if (!IsWeaponValid(model))
                    {
                        item.Enabled     = false;
                        item.LeftIcon    = MenuItem.Icon.LOCK;
                        item.Description = "This model is not available. Please ask the server owner to verify it's being streamed correctly.";
                    }
                }
                addonWeaponsMenu.OnItemSelect += (sender, item, index) =>
                {
                    var weapon = AddonWeapons.ElementAt(index);
                    if (HasPedGotWeapon(Game.PlayerPed.Handle, weapon.Value, false))
                    {
                        RemoveWeaponFromPed(Game.PlayerPed.Handle, weapon.Value);
                    }
                    else
                    {
                        var maxAmmo = 200;
                        GetMaxAmmo(Game.PlayerPed.Handle, weapon.Value, ref maxAmmo);
                        GiveWeaponToPed(Game.PlayerPed.Handle, weapon.Value, maxAmmo, false, true);
                    }
                };
                addonWeaponsBtn.Label = "→→→";
            }
            else
            {
                addonWeaponsBtn.LeftIcon    = MenuItem.Icon.LOCK;
                addonWeaponsBtn.Enabled     = false;
                addonWeaponsBtn.Description = "This option is not available on this server because you don't have permission to use it, or it is not setup correctly.";
            }
            #endregion
            addonWeaponsMenu.RefreshIndex();
            #endregion

            #region parachute options menu

            if (IsAllowed(Permission.WPParachute))
            {
                // main parachute options menu setup
                Menu     parachuteMenu = new Menu("Parachute Options", "Parachute Options");
                MenuItem parachuteBtn  = new MenuItem("Parachute Options", "All parachute related options can be changed here.")
                {
                    Label = "→→→"
                };

                MenuController.AddSubmenu(menu, parachuteMenu);
                menu.AddMenuItem(parachuteBtn);
                MenuController.BindMenuItem(menu, parachuteMenu, parachuteBtn);

                List <string> chutes = new List <string>()
                {
                    GetLabelText("PM_TINT0"),
                    GetLabelText("PM_TINT1"),
                    GetLabelText("PM_TINT2"),
                    GetLabelText("PM_TINT3"),
                    GetLabelText("PM_TINT4"),
                    GetLabelText("PM_TINT5"),
                    GetLabelText("PM_TINT6"),
                    GetLabelText("PM_TINT7"),

                    // broken in FiveM for some weird reason:
                    GetLabelText("PS_CAN_0"),
                    GetLabelText("PS_CAN_1"),
                    GetLabelText("PS_CAN_2"),
                    GetLabelText("PS_CAN_3"),
                    GetLabelText("PS_CAN_4"),
                    GetLabelText("PS_CAN_5")
                };
                List <string> chuteDescriptions = new List <string>()
                {
                    GetLabelText("PD_TINT0"),
                    GetLabelText("PD_TINT1"),
                    GetLabelText("PD_TINT2"),
                    GetLabelText("PD_TINT3"),
                    GetLabelText("PD_TINT4"),
                    GetLabelText("PD_TINT5"),
                    GetLabelText("PD_TINT6"),
                    GetLabelText("PD_TINT7"),

                    // broken in FiveM for some weird reason:
                    GetLabelText("PSD_CAN_0") + " ~r~For some reason this one doesn't seem to work in FiveM.",
                    GetLabelText("PSD_CAN_1") + " ~r~For some reason this one doesn't seem to work in FiveM.",
                    GetLabelText("PSD_CAN_2") + " ~r~For some reason this one doesn't seem to work in FiveM.",
                    GetLabelText("PSD_CAN_3") + " ~r~For some reason this one doesn't seem to work in FiveM.",
                    GetLabelText("PSD_CAN_4") + " ~r~For some reason this one doesn't seem to work in FiveM.",
                    GetLabelText("PSD_CAN_5") + " ~r~For some reason this one doesn't seem to work in FiveM."
                };

                MenuItem         togglePrimary       = new MenuItem("Toggle Primary Parachute", "Equip or remove the primary parachute");
                MenuItem         toggleReserve       = new MenuItem("Enable Reserve Parachute", "Enables the reserve parachute. Only works if you enabled the primary parachute first. Reserve parachute can not be removed from the player once it's activated.");
                MenuListItem     primaryChutes       = new MenuListItem("Primary Chute Style", chutes, 0, $"Primary chute: {chuteDescriptions[0]}");
                MenuListItem     secondaryChutes     = new MenuListItem("Reserve Chute Style", chutes, 0, $"Reserve chute: {chuteDescriptions[0]}");
                MenuCheckboxItem unlimitedParachutes = new MenuCheckboxItem("Unlimited Parachutes", "Enable unlimited parachutes and reserve parachutes.", UnlimitedParachutes);
                MenuCheckboxItem autoEquipParachutes = new MenuCheckboxItem("Auto Equip Parachutes", "Automatically equip a parachute and reserve parachute when entering planes/helicopters.", AutoEquipChute);

                // smoke color list
                List <string> smokeColorsList = new List <string>()
                {
                    GetLabelText("PM_TINT8"),  // no smoke
                    GetLabelText("PM_TINT9"),  // red
                    GetLabelText("PM_TINT10"), // orange
                    GetLabelText("PM_TINT11"), // yellow
                    GetLabelText("PM_TINT12"), // blue
                    GetLabelText("PM_TINT13"), // black
                };
                List <int[]> colors = new List <int[]>()
                {
                    new int[3] {
                        255, 255, 255
                    },
                    new int[3] {
                        255, 0, 0
                    },
                    new int[3] {
                        255, 165, 0
                    },
                    new int[3] {
                        255, 255, 0
                    },
                    new int[3] {
                        0, 0, 255
                    },
                    new int[3] {
                        20, 20, 20
                    },
                };

                MenuListItem smokeColors = new MenuListItem("Smoke Trail Color", smokeColorsList, 0, "Choose a smoke trail color, then press select to change it. Changing colors takes 4 seconds, you can not use your smoke while the color is being changed.");

                parachuteMenu.AddMenuItem(togglePrimary);
                parachuteMenu.AddMenuItem(toggleReserve);
                parachuteMenu.AddMenuItem(autoEquipParachutes);
                parachuteMenu.AddMenuItem(unlimitedParachutes);
                parachuteMenu.AddMenuItem(smokeColors);
                parachuteMenu.AddMenuItem(primaryChutes);
                parachuteMenu.AddMenuItem(secondaryChutes);

                parachuteMenu.OnItemSelect += (sender, item, index) =>
                {
                    if (item == togglePrimary)
                    {
                        if (HasPedGotWeapon(Game.PlayerPed.Handle, (uint)GetHashKey("gadget_parachute"), false))
                        {
                            Subtitle.Custom("Primary parachute removed.");
                            RemoveWeaponFromPed(Game.PlayerPed.Handle, (uint)GetHashKey("gadget_parachute"));
                        }
                        else
                        {
                            Subtitle.Custom("Primary parachute added.");
                            GiveWeaponToPed(Game.PlayerPed.Handle, (uint)GetHashKey("gadget_parachute"), 0, false, false);
                        }
                    }
                    else if (item == toggleReserve)
                    {
                        SetPlayerHasReserveParachute(Game.Player.Handle);
                        Subtitle.Custom("Reserve parachute has been added.");
                    }
                };

                parachuteMenu.OnCheckboxChange += (sender, item, index, _checked) =>
                {
                    if (item == unlimitedParachutes)
                    {
                        UnlimitedParachutes = _checked;
                    }
                    else if (item == autoEquipParachutes)
                    {
                        AutoEquipChute = _checked;
                    }
                };

                bool switching = false;
                async void IndexChangedEventHandler(Menu sender, MenuListItem item, int oldIndex, int newIndex, int itemIndex)
                {
                    if (item == smokeColors && oldIndex == -1)
                    {
                        if (!switching)
                        {
                            switching = true;
                            SetPlayerCanLeaveParachuteSmokeTrail(Game.Player.Handle, false);
                            await Delay(4000);

                            int[] color = colors[newIndex];
                            SetPlayerParachuteSmokeTrailColor(Game.Player.Handle, color[0], color[1], color[2]);
                            SetPlayerCanLeaveParachuteSmokeTrail(Game.Player.Handle, newIndex != 0);
                            switching = false;
                        }
                    }
                    else if (item == primaryChutes)
                    {
                        item.Description = $"Primary chute: {chuteDescriptions[newIndex]}";
                        SetPlayerParachuteTintIndex(Game.Player.Handle, newIndex);
                    }
                    else if (item == secondaryChutes)
                    {
                        item.Description = $"Reserve chute: {chuteDescriptions[newIndex]}";
                        SetPlayerReserveParachuteTintIndex(Game.Player.Handle, newIndex);
                    }
                }

                parachuteMenu.OnListItemSelect  += (sender, item, index, itemIndex) => IndexChangedEventHandler(sender, item, -1, index, itemIndex);
                parachuteMenu.OnListIndexChange += IndexChangedEventHandler;
            }
            #endregion

            #region Create Weapon Category Submenus
            MenuItem spacer = GetSpacerMenuItem("↓ Weapon Categories ↓");
            menu.AddMenuItem(spacer);

            Menu     handGuns    = new Menu("Weapons", "Handguns");
            MenuItem handGunsBtn = new MenuItem("Handguns");

            Menu     rifles    = new Menu("Weapons", "Assault Rifles");
            MenuItem riflesBtn = new MenuItem("Assault Rifles");

            Menu     shotguns    = new Menu("Weapons", "Shotguns");
            MenuItem shotgunsBtn = new MenuItem("Shotguns");

            Menu     smgs    = new Menu("Weapons", "Sub-/Light Machine Guns");
            MenuItem smgsBtn = new MenuItem("Sub-/Light Machine Guns");

            Menu     throwables    = new Menu("Weapons", "Throwables");
            MenuItem throwablesBtn = new MenuItem("Throwables");

            Menu     melee    = new Menu("Weapons", "Melee");
            MenuItem meleeBtn = new MenuItem("Melee");

            Menu     heavy    = new Menu("Weapons", "Heavy Weapons");
            MenuItem heavyBtn = new MenuItem("Heavy Weapons");

            Menu     snipers    = new Menu("Weapons", "Sniper Rifles");
            MenuItem snipersBtn = new MenuItem("Sniper Rifles");

            MenuController.AddSubmenu(menu, handGuns);
            MenuController.AddSubmenu(menu, rifles);
            MenuController.AddSubmenu(menu, shotguns);
            MenuController.AddSubmenu(menu, smgs);
            MenuController.AddSubmenu(menu, throwables);
            MenuController.AddSubmenu(menu, melee);
            MenuController.AddSubmenu(menu, heavy);
            MenuController.AddSubmenu(menu, snipers);
            #endregion

            #region Setup weapon category buttons and submenus.
            handGunsBtn.Label = "→→→";
            menu.AddMenuItem(handGunsBtn);
            MenuController.BindMenuItem(menu, handGuns, handGunsBtn);

            riflesBtn.Label = "→→→";
            menu.AddMenuItem(riflesBtn);
            MenuController.BindMenuItem(menu, rifles, riflesBtn);

            shotgunsBtn.Label = "→→→";
            menu.AddMenuItem(shotgunsBtn);
            MenuController.BindMenuItem(menu, shotguns, shotgunsBtn);

            smgsBtn.Label = "→→→";
            menu.AddMenuItem(smgsBtn);
            MenuController.BindMenuItem(menu, smgs, smgsBtn);

            throwablesBtn.Label = "→→→";
            menu.AddMenuItem(throwablesBtn);
            MenuController.BindMenuItem(menu, throwables, throwablesBtn);

            meleeBtn.Label = "→→→";
            menu.AddMenuItem(meleeBtn);
            MenuController.BindMenuItem(menu, melee, meleeBtn);

            heavyBtn.Label = "→→→";
            menu.AddMenuItem(heavyBtn);
            MenuController.BindMenuItem(menu, heavy, heavyBtn);

            snipersBtn.Label = "→→→";
            menu.AddMenuItem(snipersBtn);
            MenuController.BindMenuItem(menu, snipers, snipersBtn);
            #endregion

            #region Loop through all weapons, create menus for them and add all menu items and handle events.
            foreach (ValidWeapon weapon in ValidWeapons.WeaponList)
            {
                uint cat = (uint)GetWeapontypeGroup(weapon.Hash);
                if (!string.IsNullOrEmpty(weapon.Name) && (IsAllowed(weapon.Perm) || IsAllowed(Permission.WPGetAll)))
                {
                    //Log($"[DEBUG LOG] [WEAPON-BUG] {weapon.Name} - {weapon.Perm} = {IsAllowed(weapon.Perm)} & All = {IsAllowed(Permission.WPGetAll)}");
                    #region Create menu for this weapon and add buttons
                    Menu     weaponMenu = new Menu("Weapon Options", weapon.Name);
                    MenuItem weaponItem = new MenuItem(weapon.Name, $"Open the options for ~y~{weapon.Name.ToString()}~s~.")
                    {
                        Label    = "→→→",
                        LeftIcon = MenuItem.Icon.GUN
                    };

                    weaponInfo.Add(weaponMenu, weapon);

                    MenuItem getOrRemoveWeapon = new MenuItem("Equip/Remove Weapon", "Add or remove this weapon to/form your inventory.")
                    {
                        LeftIcon = MenuItem.Icon.GUN
                    };
                    weaponMenu.AddMenuItem(getOrRemoveWeapon);
                    if (!IsAllowed(Permission.WPSpawn))
                    {
                        getOrRemoveWeapon.Enabled     = false;
                        getOrRemoveWeapon.Description = "You do not have permission to use this option.";
                        getOrRemoveWeapon.LeftIcon    = MenuItem.Icon.LOCK;
                    }

                    MenuItem fillAmmo = new MenuItem("Re-fill Ammo", "Get max ammo for this weapon.")
                    {
                        LeftIcon = MenuItem.Icon.AMMO
                    };
                    weaponMenu.AddMenuItem(fillAmmo);

                    List <string> tints = new List <string>();
                    if (weapon.Name.Contains(" Mk II"))
                    {
                        foreach (var tint in ValidWeapons.WeaponTintsMkII)
                        {
                            tints.Add(tint.Key);
                        }
                    }
                    else
                    {
                        foreach (var tint in ValidWeapons.WeaponTints)
                        {
                            tints.Add(tint.Key);
                        }
                    }

                    MenuListItem weaponTints = new MenuListItem("Tints", tints, 0, "Select a tint for your weapon.");
                    weaponMenu.AddMenuItem(weaponTints);
                    #endregion

                    #region Handle weapon specific list changes
                    weaponMenu.OnListIndexChange += (sender, item, oldIndex, newIndex, itemIndex) =>
                    {
                        if (item == weaponTints)
                        {
                            if (HasPedGotWeapon(Game.PlayerPed.Handle, weaponInfo[sender].Hash, false))
                            {
                                SetPedWeaponTintIndex(Game.PlayerPed.Handle, weaponInfo[sender].Hash, newIndex);
                            }
                            else
                            {
                                Notify.Error("You need to get the weapon first!");
                            }
                        }
                    };
                    #endregion

                    #region Handle weapon specific button presses
                    weaponMenu.OnItemSelect += (sender, item, index) =>
                    {
                        var  info = weaponInfo[sender];
                        uint hash = info.Hash;

                        SetCurrentPedWeapon(Game.PlayerPed.Handle, hash, true);

                        if (item == getOrRemoveWeapon)
                        {
                            if (HasPedGotWeapon(Game.PlayerPed.Handle, hash, false))
                            {
                                RemoveWeaponFromPed(Game.PlayerPed.Handle, hash);
                                Subtitle.Custom("Weapon removed.");
                            }
                            else
                            {
                                var ammo = 255;
                                GetMaxAmmo(Game.PlayerPed.Handle, hash, ref ammo);
                                GiveWeaponToPed(Game.PlayerPed.Handle, hash, ammo, false, true);
                                Subtitle.Custom("Weapon added.");
                            }
                        }
                        else if (item == fillAmmo)
                        {
                            if (HasPedGotWeapon(Game.PlayerPed.Handle, hash, false))
                            {
                                var ammo = 900;
                                GetMaxAmmo(Game.PlayerPed.Handle, hash, ref ammo);
                                SetPedAmmo(Game.PlayerPed.Handle, hash, ammo);
                            }
                            else
                            {
                                Notify.Error("You need to get the weapon first before re-filling ammo!");
                            }
                        }
                    };
                    #endregion

                    #region load components
                    if (weapon.Components != null)
                    {
                        if (weapon.Components.Count > 0)
                        {
                            foreach (var comp in weapon.Components)
                            {
                                //Log($"{weapon.Name} : {comp.Key}");
                                MenuItem compItem = new MenuItem(comp.Key, "Click to equip or remove this component.");
                                weaponComponents.Add(compItem, comp.Key);
                                weaponMenu.AddMenuItem(compItem);

                                #region Handle component button presses
                                weaponMenu.OnItemSelect += (sender, item, index) =>
                                {
                                    if (item == compItem)
                                    {
                                        var Weapon        = weaponInfo[sender];
                                        var componentHash = Weapon.Components[weaponComponents[item]];
                                        if (HasPedGotWeapon(Game.PlayerPed.Handle, Weapon.Hash, false))
                                        {
                                            SetCurrentPedWeapon(Game.PlayerPed.Handle, Weapon.Hash, true);
                                            if (HasPedGotWeaponComponent(Game.PlayerPed.Handle, Weapon.Hash, componentHash))
                                            {
                                                RemoveWeaponComponentFromPed(Game.PlayerPed.Handle, Weapon.Hash, componentHash);

                                                Subtitle.Custom("Component removed.");
                                            }
                                            else
                                            {
                                                int ammo = GetAmmoInPedWeapon(Game.PlayerPed.Handle, Weapon.Hash);

                                                int clipAmmo = GetMaxAmmoInClip(Game.PlayerPed.Handle, Weapon.Hash, false);
                                                GetAmmoInClip(Game.PlayerPed.Handle, Weapon.Hash, ref clipAmmo);

                                                GiveWeaponComponentToPed(Game.PlayerPed.Handle, Weapon.Hash, componentHash);

                                                SetAmmoInClip(Game.PlayerPed.Handle, Weapon.Hash, clipAmmo);

                                                SetPedAmmo(Game.PlayerPed.Handle, Weapon.Hash, ammo);
                                                Subtitle.Custom("Component equiped.");
                                            }
                                        }
                                        else
                                        {
                                            Notify.Error("You need to get the weapon first before you can modify it.");
                                        }
                                    }
                                };
                                #endregion
                            }
                        }
                    }
                    #endregion

                    // refresh and add to menu.
                    weaponMenu.RefreshIndex();

                    if (cat == 970310034) // 970310034 rifles
                    {
                        MenuController.AddSubmenu(rifles, weaponMenu);
                        MenuController.BindMenuItem(rifles, weaponMenu, weaponItem);
                        rifles.AddMenuItem(weaponItem);
                    }
                    else if (cat == 416676503 || cat == 690389602) // 416676503 hand guns // 690389602 stun gun
                    {
                        MenuController.AddSubmenu(handGuns, weaponMenu);
                        MenuController.BindMenuItem(handGuns, weaponMenu, weaponItem);
                        handGuns.AddMenuItem(weaponItem);
                    }
                    else if (cat == 860033945) // 860033945 shotguns
                    {
                        MenuController.AddSubmenu(shotguns, weaponMenu);
                        MenuController.BindMenuItem(shotguns, weaponMenu, weaponItem);
                        shotguns.AddMenuItem(weaponItem);
                    }
                    else if (cat == 3337201093 || cat == 1159398588) // 3337201093 sub machine guns // 1159398588 light machine guns
                    {
                        MenuController.AddSubmenu(smgs, weaponMenu);
                        MenuController.BindMenuItem(smgs, weaponMenu, weaponItem);
                        smgs.AddMenuItem(weaponItem);
                    }
                    else if (cat == 1548507267 || cat == 4257178988 || cat == 1595662460) // 1548507267 throwables // 4257178988 fire extinghuiser // jerry can
                    {
                        MenuController.AddSubmenu(throwables, weaponMenu);
                        MenuController.BindMenuItem(throwables, weaponMenu, weaponItem);
                        throwables.AddMenuItem(weaponItem);
                    }
                    else if (cat == 3566412244 || cat == 2685387236) // 3566412244 melee weapons // 2685387236 knuckle duster
                    {
                        MenuController.AddSubmenu(melee, weaponMenu);
                        MenuController.BindMenuItem(melee, weaponMenu, weaponItem);
                        melee.AddMenuItem(weaponItem);
                    }
                    else if (cat == 2725924767) // 2725924767 heavy weapons
                    {
                        MenuController.AddSubmenu(heavy, weaponMenu);
                        MenuController.BindMenuItem(heavy, weaponMenu, weaponItem);
                        heavy.AddMenuItem(weaponItem);
                    }
                    else if (cat == 3082541095) // 3082541095 sniper rifles
                    {
                        MenuController.AddSubmenu(snipers, weaponMenu);
                        MenuController.BindMenuItem(snipers, weaponMenu, weaponItem);
                        snipers.AddMenuItem(weaponItem);
                    }
                }
            }
            #endregion

            #region Disable submenus if no weapons in that category are allowed.
            if (handGuns.Size == 0)
            {
                handGunsBtn.LeftIcon    = MenuItem.Icon.LOCK;
                handGunsBtn.Description = "The server owner removed the permissions for all weapons in this category.";
                handGunsBtn.Enabled     = false;
            }
            if (rifles.Size == 0)
            {
                riflesBtn.LeftIcon    = MenuItem.Icon.LOCK;
                riflesBtn.Description = "The server owner removed the permissions for all weapons in this category.";
                riflesBtn.Enabled     = false;
            }
            if (shotguns.Size == 0)
            {
                shotgunsBtn.LeftIcon    = MenuItem.Icon.LOCK;
                shotgunsBtn.Description = "The server owner removed the permissions for all weapons in this category.";
                shotgunsBtn.Enabled     = false;
            }
            if (smgs.Size == 0)
            {
                smgsBtn.LeftIcon    = MenuItem.Icon.LOCK;
                smgsBtn.Description = "The server owner removed the permissions for all weapons in this category.";
                smgsBtn.Enabled     = false;
            }
            if (throwables.Size == 0)
            {
                throwablesBtn.LeftIcon    = MenuItem.Icon.LOCK;
                throwablesBtn.Description = "The server owner removed the permissions for all weapons in this category.";
                throwablesBtn.Enabled     = false;
            }
            if (melee.Size == 0)
            {
                meleeBtn.LeftIcon    = MenuItem.Icon.LOCK;
                meleeBtn.Description = "The server owner removed the permissions for all weapons in this category.";
                meleeBtn.Enabled     = false;
            }
            if (heavy.Size == 0)
            {
                heavyBtn.LeftIcon    = MenuItem.Icon.LOCK;
                heavyBtn.Description = "The server owner removed the permissions for all weapons in this category.";
                heavyBtn.Enabled     = false;
            }
            if (snipers.Size == 0)
            {
                snipersBtn.LeftIcon    = MenuItem.Icon.LOCK;
                snipersBtn.Description = "The server owner removed the permissions for all weapons in this category.";
                snipersBtn.Enabled     = false;
            }
            #endregion

            #region Handle button presses
            menu.OnItemSelect += (sender, item, index) =>
            {
                Ped ped = new Ped(Game.PlayerPed.Handle);
                if (item == getAllWeapons)
                {
                    foreach (ValidWeapon vw in ValidWeapons.WeaponList)
                    {
                        if (IsAllowed(vw.Perm))
                        {
                            GiveWeaponToPed(Game.PlayerPed.Handle, vw.Hash, vw.GetMaxAmmo, false, true);

                            int ammoInClip = GetMaxAmmoInClip(Game.PlayerPed.Handle, vw.Hash, false);
                            SetAmmoInClip(Game.PlayerPed.Handle, vw.Hash, ammoInClip);
                            int ammo = 0;
                            GetMaxAmmo(Game.PlayerPed.Handle, vw.Hash, ref ammo);
                            SetPedAmmo(Game.PlayerPed.Handle, vw.Hash, ammo);
                        }
                    }

                    SetCurrentPedWeapon(Game.PlayerPed.Handle, (uint)GetHashKey("weapon_unarmed"), true);
                }
                else if (item == removeAllWeapons)
                {
                    ped.Weapons.RemoveAll();
                }
                else if (item == setAmmo)
                {
                    SetAllWeaponsAmmo();
                }
                else if (item == refillMaxAmmo)
                {
                    foreach (ValidWeapon vw in ValidWeapons.WeaponList)
                    {
                        if (HasPedGotWeapon(Game.PlayerPed.Handle, vw.Hash, false))
                        {
                            int ammoInClip = GetMaxAmmoInClip(Game.PlayerPed.Handle, vw.Hash, false);
                            SetAmmoInClip(Game.PlayerPed.Handle, vw.Hash, ammoInClip);
                            int ammo = 0;
                            GetMaxAmmo(Game.PlayerPed.Handle, vw.Hash, ref ammo);
                            SetPedAmmo(Game.PlayerPed.Handle, vw.Hash, ammo);
                        }
                    }
                }
                else if (item == spawnByName)
                {
                    SpawnCustomWeapon();
                }
            };
            #endregion

            #region Handle checkbox changes
            menu.OnCheckboxChange += (sender, item, index, _checked) =>
            {
                if (item == noReload)
                {
                    NoReload = _checked;
                    Subtitle.Custom($"No reload is now {(_checked ? "enabled" : "disabled")}.");
                }
                else if (item == unlimitedAmmo)
                {
                    UnlimitedAmmo = _checked;
                    Subtitle.Custom($"Unlimited ammo is now {(_checked ? "enabled" : "disabled")}.");
                }
            };
            #endregion
        }
        private async void DecompileCode(UndertaleCode code)
        {
            LoaderDialog dialog = new LoaderDialog("Decompiling", "Decompiling, please wait... This can take a while on complex scripts");

            dialog.Owner = Window.GetWindow(this);

            FlowDocument document = new FlowDocument();

            document.PagePadding = new Thickness(0);
            document.FontFamily  = new FontFamily("Lucida Console");
            Paragraph par = new Paragraph();

            UndertaleCode gettextCode = null;

            if (gettext == null)
            {
                gettextCode = (Application.Current.MainWindow as MainWindow).Data.Code.ByName("gml_Script_textdata_en");
            }

            string gettextJsonPath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName((Application.Current.MainWindow as MainWindow).FilePath), "lang/lang_en.json");

            var  dataa = (Application.Current.MainWindow as MainWindow).Data;
            Task t     = Task.Run(() =>
            {
                string decompiled = null;
                Exception e       = null;
                try
                {
                    decompiled = Decompiler.Decompile(code, dataa).Replace("\r\n", "\n");
                }
                catch (Exception ex)
                {
                    e = ex;
                }

                if (gettextCode != null)
                {
                    UpdateGettext(gettextCode);
                }

                if (gettextJSON == null && File.Exists(gettextJsonPath))
                {
                    UpdateGettextJSON(File.ReadAllText(gettextJsonPath));
                }

                Dispatcher.Invoke(() =>
                {
                    if (e != null)
                    {
                        Brush exceptionBrush = new SolidColorBrush(Color.FromRgb(255, 0, 0));
                        par.Inlines.Add(new Run("EXCEPTION!\n")
                        {
                            Foreground = exceptionBrush, FontWeight = FontWeights.Bold
                        });
                        par.Inlines.Add(new Run(e.ToString())
                        {
                            Foreground = exceptionBrush
                        });
                    }
                    else if (decompiled != null)
                    {
                        string[] lines = decompiled.Split('\n');
                        if (lines.Length > 5000)
                        {
                            par.Inlines.Add(new Run(decompiled));
                        }
                        else
                        {
                            Brush keywordBrush = new SolidColorBrush(Color.FromRgb(0, 0, 150));
                            Brush stringBrush  = new SolidColorBrush(Color.FromRgb(0, 0, 200));
                            Brush commentBrush = new SolidColorBrush(Color.FromRgb(0, 150, 0));
                            Brush funcBrush    = new SolidColorBrush(Color.FromRgb(100, 100, 0));
                            Brush assetBrush   = new SolidColorBrush(Color.FromRgb(0, 150, 100));

                            Dictionary <string, UndertaleFunction> funcs = new Dictionary <string, UndertaleFunction>();
                            foreach (var x in (Application.Current.MainWindow as MainWindow).Data.Functions)
                            {
                                funcs.Add(x.Name.Content, x);
                            }

                            foreach (var line in lines)
                            {
                                char[] special = { '.', ',', ')', '(', '[', ']', '>', '<', ':', ';', '=', '"' };
                                Func <char, bool> IsSpecial = (c) => Char.IsWhiteSpace(c) || special.Contains(c);
                                List <string> split         = new List <string>();
                                string tok         = "";
                                bool readingString = false;
                                for (int i = 0; i < line.Length; i++)
                                {
                                    if (tok == "//")
                                    {
                                        tok += line.Substring(i);
                                        break;
                                    }
                                    if (!readingString && tok.Length > 0 && (
                                            (Char.IsWhiteSpace(line[i]) != Char.IsWhiteSpace(tok[tok.Length - 1])) ||
                                            (special.Contains(line[i]) != special.Contains(tok[tok.Length - 1])) ||
                                            (special.Contains(line[i]) && special.Contains(tok[tok.Length - 1])) ||
                                            line[i] == '"'
                                            ))
                                    {
                                        split.Add(tok);
                                        tok = "";
                                    }
                                    tok += line[i];
                                    if (line[i] == '"')
                                    {
                                        if (readingString)
                                        {
                                            split.Add(tok);
                                            tok = "";
                                        }
                                        readingString = !readingString;
                                    }
                                }
                                if (tok != "")
                                {
                                    split.Add(tok);
                                }

                                Dictionary <string, object> usedObjects = new Dictionary <string, object>();
                                for (int i = 0; i < split.Count; i++)
                                {
                                    string token = split[i];
                                    if (token == "if" || token == "else" || token == "return" || token == "break" || token == "continue" || token == "while" || token == "with" || token == "switch" || token == "case" || token == "default")
                                    {
                                        par.Inlines.Add(new Run(token)
                                        {
                                            Foreground = keywordBrush, FontWeight = FontWeights.Bold
                                        });
                                    }
                                    else if (token == "self" || token == "global" || token == "local" || token == "other" || token == "noone" || token == "true" || token == "false")
                                    {
                                        par.Inlines.Add(new Run(token)
                                        {
                                            Foreground = keywordBrush
                                        });
                                    }
                                    else if (token.StartsWith("\""))
                                    {
                                        par.Inlines.Add(new Run(token)
                                        {
                                            Foreground = stringBrush
                                        });
                                    }
                                    else if (token.StartsWith("//"))
                                    {
                                        par.Inlines.Add(new Run(token)
                                        {
                                            Foreground = commentBrush
                                        });
                                    }
                                    else if (token.StartsWith("@") && split[i - 1][0] == '"' && split[i - 1][split[i - 1].Length - 1] == '"')
                                    {
                                        par.Inlines.LastInline.Cursor     = Cursors.Hand;
                                        par.Inlines.LastInline.MouseDown += (sender, ev) =>
                                        {
                                            MainWindow mw = Application.Current.MainWindow as MainWindow;
                                            mw.ChangeSelection(mw.Data.Strings[Int32.Parse(token.Substring(1))]);
                                        };
                                    }
                                    else if (dataa.ByName(token) != null)
                                    {
                                        par.Inlines.Add(new Run(token)
                                        {
                                            Foreground = assetBrush, Cursor = Cursors.Hand
                                        });
                                        par.Inlines.LastInline.MouseDown += (sender, ev) => (Application.Current.MainWindow as MainWindow).ChangeSelection(dataa.ByName(token));
                                        if (token == "scr_gettext" && gettext != null)
                                        {
                                            if (split[i + 1] == "(" && split[i + 2].StartsWith("\"") && split[i + 3].StartsWith("@") && split[i + 4] == ")")
                                            {
                                                string id = split[i + 2].Substring(1, split[i + 2].Length - 2);
                                                if (!usedObjects.ContainsKey(id))
                                                {
                                                    usedObjects.Add(id, (Application.Current.MainWindow as MainWindow).Data.Strings[gettext[id]]);
                                                }
                                            }
                                        }
                                        if (token == "scr_84_get_lang_string" && gettextJSON != null)
                                        {
                                            if (split[i + 1] == "(" && split[i + 2].StartsWith("\"") && split[i + 3].StartsWith("@") && split[i + 4] == ")")
                                            {
                                                string id = split[i + 2].Substring(1, split[i + 2].Length - 2);
                                                if (!usedObjects.ContainsKey(id))
                                                {
                                                    usedObjects.Add(id, gettextJSON[id]);
                                                }
                                            }
                                        }
                                    }
                                    else if (funcs.ContainsKey(token))
                                    {
                                        par.Inlines.Add(new Run(token)
                                        {
                                            Foreground = funcBrush, Cursor = Cursors.Hand
                                        });
                                        par.Inlines.LastInline.MouseDown += (sender, ev) => (Application.Current.MainWindow as MainWindow).ChangeSelection(funcs[token]);
                                    }
                                    else if (Char.IsDigit(token[0]))
                                    {
                                        par.Inlines.Add(new Run(token)
                                        {
                                            Cursor = Cursors.Hand
                                        });
                                        par.Inlines.LastInline.MouseDown += (sender, ev) =>
                                        {
                                            // TODO: Add type resolving to the decompiler so that this is handled mostly automatically

                                            UndertaleData data = (Application.Current.MainWindow as MainWindow).Data;
                                            int id             = Int32.Parse(token);
                                            List <UndertaleObject> possibleObjects = new List <UndertaleObject>();
                                            if (id < data.Sprites.Count)
                                            {
                                                possibleObjects.Add(data.Sprites[id]);
                                            }
                                            if (id < data.Rooms.Count)
                                            {
                                                possibleObjects.Add(data.Rooms[id]);
                                            }
                                            if (id < data.GameObjects.Count)
                                            {
                                                possibleObjects.Add(data.GameObjects[id]);
                                            }
                                            if (id < data.Backgrounds.Count)
                                            {
                                                possibleObjects.Add(data.Backgrounds[id]);
                                            }
                                            if (id < data.Scripts.Count)
                                            {
                                                possibleObjects.Add(data.Scripts[id]);
                                            }
                                            if (id < data.Paths.Count)
                                            {
                                                possibleObjects.Add(data.Paths[id]);
                                            }
                                            if (id < data.Fonts.Count)
                                            {
                                                possibleObjects.Add(data.Fonts[id]);
                                            }
                                            if (id < data.Sounds.Count)
                                            {
                                                possibleObjects.Add(data.Sounds[id]);
                                            }
                                            if (id < data.Shaders.Count)
                                            {
                                                possibleObjects.Add(data.Shaders[id]);
                                            }
                                            // if (id < data.Extensions.Count)
                                            //    possibleObjects.Add(data.Extensions[id]);
                                            if (id < data.Timelines.Count)
                                            {
                                                possibleObjects.Add(data.Timelines[id]);
                                            }

                                            ContextMenu contextMenu = new ContextMenu();
                                            foreach (UndertaleObject obj in possibleObjects)
                                            {
                                                MenuItem item = new MenuItem();
                                                item.Header   = obj.ToString().Replace("_", "__");
                                                item.Click   += (sender2, ev2) => (Application.Current.MainWindow as MainWindow).ChangeSelection(obj);
                                                contextMenu.Items.Add(item);
                                            }
                                            if (id > 0x00050000)
                                            {
                                                contextMenu.Items.Add(new MenuItem()
                                                {
                                                    Header = "#" + id.ToString("X6") + " (color)", IsEnabled = false
                                                });
                                            }
                                            contextMenu.Items.Add(new MenuItem()
                                            {
                                                Header = id + " (number)", IsEnabled = false
                                            });
                                            (sender as Run).ContextMenu = contextMenu;
                                            contextMenu.IsOpen          = true;
                                            ev.Handled = true;
                                        };
                                    }
                                    else
                                    {
                                        par.Inlines.Add(new Run(token));
                                    }

                                    if (token == "." && (Char.IsLetter(split[i + 1][0]) || split[i + 1][0] == '_'))
                                    {
                                        int id;
                                        if (Int32.TryParse(split[i - 1], out id))
                                        {
                                            var gos = (Application.Current.MainWindow as MainWindow).Data.GameObjects;
                                            if (!usedObjects.ContainsKey(split[i - 1]) && id >= 0 && id < gos.Count)
                                            {
                                                usedObjects.Add(split[i - 1], gos[id]);
                                            }
                                        }
                                    }
                                }
                                foreach (var gt in usedObjects)
                                {
                                    par.Inlines.Add(new Run(" // ")
                                    {
                                        Foreground = commentBrush
                                    });
                                    par.Inlines.Add(new Run(gt.Key)
                                    {
                                        Foreground = commentBrush
                                    });
                                    par.Inlines.Add(new Run(" = ")
                                    {
                                        Foreground = commentBrush
                                    });
                                    par.Inlines.Add(new Run(gt.Value is string? "\"" + (string)gt.Value + "\"" : gt.Value.ToString())
                                    {
                                        Foreground = commentBrush, Cursor = Cursors.Hand
                                    });
                                    if (gt.Value is UndertaleObject)
                                    {
                                        par.Inlines.LastInline.MouseDown += (sender, ev) => (Application.Current.MainWindow as MainWindow).ChangeSelection(gt.Value);
                                    }
                                }
                                par.Inlines.Add(new Run("\n"));
                            }
                        }
                    }

                    document.Blocks.Add(par);
                    DecompiledView.Document = document;
                    CurrentDecompiled       = code;
                    dialog.Hide();
                });
            });

            dialog.ShowDialog();
            await t;
        }
Exemplo n.º 35
0
        void InitializeMainMenu()
        {
            //
            // miFile
            //
            miFile = new MenuItem("ファイル(&F)");
            miBrouse = new MenuItem("参照(&R)...", Brouse);
            miExit = new MenuItem("終了(&X)", Exit, Shortcut.AltF4);
            miFile.MenuItems.AddRange(new MenuItem[]
            {
                miBrouse, miExit
            });
            //
            // miEdit
            //
            miEdit = new MenuItem("編集(&E)");
            miUndo = new MenuItem("元に戻す(&U)", Undo, Shortcut.CtrlZ);
            miRedo = new MenuItem("やり直し(&R)", Redo, Shortcut.CtrlY);
            miCut = new MenuItem("切り取り(&T)", Cut, Shortcut.CtrlX);
            miCopy = new MenuItem("コピー(&C)", Copy, Shortcut.CtrlC);
            miPaste = new MenuItem("貼り付け(&P)", Paste, Shortcut.CtrlV);
            //miDelete = new MenuItem("削除(&D)", Delete, Shortcut.Del);
            miSelectAll = new MenuItem("すべて選択(&A)", SelectAll, Shortcut.CtrlA);
            miEdit.Popup += (object sender, EventArgs eventArgs) =>
            {
                miUndo.Enabled = CanUndo();
                miRedo.Enabled = CanRedo();
                miCut.Enabled = CanCut();
                miCopy.Enabled = CanCopy();
                miPaste.Enabled = CanPaste();
                miSelectAll.Enabled = CanSelectAll();

            };
            miEdit.MenuItems.AddRange(new MenuItem[]
            {
                miUndo, miRedo, new MenuItem("-"),
                miCut, miCopy, miPaste, new MenuItem("-"),
                miSelectAll
            });
            //
            // miOperation
            //
            miOperation = new MenuItem("操作(&O)");
            miFind = new MenuItem("検索(&F)", Find, Shortcut.F3);
            miReplace = new MenuItem("置換(&R)", Replace, Shortcut.F4);
            miOperation.Popup += delegate(object sender, EventArgs eventArgs)
            {
                miReplace.Enabled = btnReplace.Enabled;
            };
            miOperation.MenuItems.AddRange(new MenuItem[]
            {
                miFind, miReplace
            });

            //
            // miSettings
            //
            miSettings = new MenuItem("設定(&S)");
            miSettings.Popup += delegate(object sender, EventArgs eventArgs)
            {
                miRegEx.Checked = cbRegex.Checked;
            };
            miRegEx = new MenuItem("正規表現(&R)");
            miRegEx.Click += delegate(object sender, EventArgs eventArgs)
            {
                cbRegex.Checked = cbRegex.Checked ? false : true;
            };

            miOptions = new MenuItem("オプション(&O)...", OptionDlg);
            miSettings.MenuItems.AddRange(new MenuItem[]
            {
                 miRegEx, miOptions
            });

            //
            // miHelp
            //
            miHelp = new MenuItem("ヘルプ(&H)");
            miAbout = new MenuItem("バージョン情報(&A)...", About);
            miViewHelp = new MenuItem("ヘルプの表示(&H)", ViewHelp, Shortcut.F1);
            miHelp.MenuItems.AddRange(new MenuItem[]
            {
                miViewHelp, miAbout
            });
            //
            // mainMenu
            //
            mainMenu.MenuItems.AddRange(new MenuItem[]
            {
                miFile, miEdit, miOperation, miSettings, miHelp
            });
            //
            // MainForm
            //
            this.Menu = mainMenu;

        }
Exemplo n.º 36
0
        void ShowMenu(object parameter, InstructionOperandVM opvm, MenuCommandFlags flags)
        {
            var ctxMenu = new ContextMenu();

            ctxMenu.SetResourceReference(DsImage.BackgroundBrushProperty, "ContextMenuRectangleFill");

            MenuItem menuItem;

            if ((flags & (MenuCommandFlags.TypeDef | MenuCommandFlags.TypeRef)) != 0)
            {
                ctxMenu.Items.Add(menuItem = new MenuItem()
                {
                    Header  = dnSpy_AsmEditor_Resources.EditOperand_Type,
                    Command = new RelayCommand(a => AddType(opvm)),
                });
                Add16x16Image(menuItem, DsImages.ClassPublic, true);
            }
            if ((flags & MenuCommandFlags.TypeSpec) != 0)
            {
                ctxMenu.Items.Add(menuItem = new MenuItem()
                {
                    Header  = dnSpy_AsmEditor_Resources.EditOperand_TypeSpec,
                    Command = new RelayCommand(a => AddTypeSpec(opvm)),
                });
                Add16x16Image(menuItem, DsImages.Template, true);
            }
            if ((flags & MenuCommandFlags.MethodDef) != 0)
            {
                ctxMenu.Items.Add(menuItem = new MenuItem()
                {
                    Header  = dnSpy_AsmEditor_Resources.EditOperand_Method,
                    Command = new RelayCommand(a => AddMethodDef(opvm)),
                });
                Add16x16Image(menuItem, DsImages.MethodPublic, true);
            }
            if ((flags & MenuCommandFlags.MethodMemberRef) != 0)
            {
                ctxMenu.Items.Add(new MenuItem()
                {
                    Header  = dnSpy_AsmEditor_Resources.EditOperand_Method_MemberRef,
                    Command = new RelayCommand(a => AddMethodMemberRef(opvm)),
                });
            }
            if ((flags & MenuCommandFlags.MethodSpec) != 0)
            {
                ctxMenu.Items.Add(new MenuItem()
                {
                    Header  = dnSpy_AsmEditor_Resources.EditOperand_MethodSpec,
                    Command = new RelayCommand(a => AddMethodSpec(opvm)),
                });
            }
            if ((flags & MenuCommandFlags.FieldDef) != 0)
            {
                ctxMenu.Items.Add(menuItem = new MenuItem()
                {
                    Header  = dnSpy_AsmEditor_Resources.EditOperand_Field,
                    Command = new RelayCommand(a => AddFieldDef(opvm)),
                });
                Add16x16Image(menuItem, DsImages.FieldPublic, true);
            }
            if ((flags & MenuCommandFlags.FieldMemberRef) != 0)
            {
                ctxMenu.Items.Add(new MenuItem()
                {
                    Header  = dnSpy_AsmEditor_Resources.EditOperand_Field_MemberRef,
                    Command = new RelayCommand(a => AddFieldMemberRef(opvm)),
                });
            }

            ctxMenu.Placement       = PlacementMode.Bottom;
            ctxMenu.PlacementTarget = parameter as UIElement;
            ctxMenu.IsOpen          = true;
        }
Exemplo n.º 37
0
 public EntityStates GetMenuItemEntityState(MenuItem menuItem)
 {
     return(MenuItemSingletonRepository.Instance.GetMenuItemEntityState(menuItem));
 }
Exemplo n.º 38
0
 public void UpdateMenuItemRepository(MenuItem menuItem)
 {
     MenuItemSingletonRepository.Instance.UpdateRepository(menuItem);
 }
Exemplo n.º 39
0
        /// <summary>
        /// Creates the menu.
        /// </summary>
        private void CreateMenu()
        {
            // Create the menu.
            menu = new Menu(Game.Player.Name, "Online Players")
            {
            };
            menu.CounterPreText = "Players: ";

            MenuController.AddSubmenu(menu, playerMenu);

            MenuItem sendMessage      = new MenuItem("Send Private Message", "Sends a private message to this player. ~r~Note: staff may be able to see all PM's.");
            MenuItem teleport         = new MenuItem("Teleport To Player", "Teleport to this player.");
            MenuItem teleportVeh      = new MenuItem("Teleport Into Player Vehicle", "Teleport into the vehicle of the player.");
            MenuItem summon           = new MenuItem("Summon Player", "Teleport the player to you.");
            MenuItem toggleGPS        = new MenuItem("Toggle GPS", "Enables or disables the GPS route on your radar to this player.");
            MenuItem spectate         = new MenuItem("Spectate Player", "Spectate this player. Click this button again to stop spectating.");
            MenuItem printIdentifiers = new MenuItem("Print Identifiers", "This will print the player's identifiers to the client console (F8). And also save it to the CitizenFX.log file.");
            MenuItem kill             = new MenuItem("~r~Kill Player", "Kill this player, note they will receive a notification saying that you killed them. It will also be logged in the Staff Actions log.");
            MenuItem kick             = new MenuItem("~r~Kick Player", "Kick the player from the server.");
            MenuItem ban     = new MenuItem("~r~Ban Player Permanently", "Ban this player permanently from the server. Are you sure you want to do this? You can specify the ban reason after clicking this button.");
            MenuItem tempban = new MenuItem("~r~Ban Player Temporarily", "Give this player a tempban of up to 30 days (max). You can specify duration and ban reason after clicking this button.");

            // always allowed
            playerMenu.AddMenuItem(sendMessage);
            // permissions specific
            if (IsAllowed(Permission.OPTeleport))
            {
                playerMenu.AddMenuItem(teleport);
                playerMenu.AddMenuItem(teleportVeh);
            }
            if (IsAllowed(Permission.OPSummon))
            {
                playerMenu.AddMenuItem(summon);
            }
            if (IsAllowed(Permission.OPSpectate))
            {
                playerMenu.AddMenuItem(spectate);
            }
            if (IsAllowed(Permission.OPWaypoint))
            {
                playerMenu.AddMenuItem(toggleGPS);
            }
            if (IsAllowed(Permission.OPIdentifiers))
            {
                playerMenu.AddMenuItem(printIdentifiers);
            }
            if (IsAllowed(Permission.OPKill))
            {
                playerMenu.AddMenuItem(kill);
            }
            if (IsAllowed(Permission.OPKick))
            {
                playerMenu.AddMenuItem(kick);
            }
            if (IsAllowed(Permission.OPTempBan))
            {
                playerMenu.AddMenuItem(tempban);
            }
            if (IsAllowed(Permission.OPPermBan))
            {
                playerMenu.AddMenuItem(ban);
                ban.LeftIcon = MenuItem.Icon.WARNING;
            }

            playerMenu.OnMenuClose += (sender) =>
            {
                playerMenu.RefreshIndex();
                ban.Label = "";
            };

            playerMenu.OnIndexChange += (sender, oldItem, newItem, oldIndex, newIndex) =>
            {
                ban.Label = "";
            };

            // handle button presses for the specific player's menu.
            playerMenu.OnItemSelect += async(sender, item, index) =>
            {
                // send message
                if (item == sendMessage)
                {
                    if (MainMenu.MiscSettingsMenu != null && !MainMenu.MiscSettingsMenu.MiscDisablePrivateMessages)
                    {
                        string message = await GetUserInput($"Private Message To {currentPlayer.Name}", 200);

                        if (string.IsNullOrEmpty(message))
                        {
                            Notify.Error(CommonErrors.InvalidInput);
                        }
                        else
                        {
                            TriggerServerEvent("vMenu:SendMessageToPlayer", currentPlayer.ServerId, message);
                            PrivateMessage(currentPlayer.ServerId.ToString(), message, true);
                        }
                    }
                    else
                    {
                        Notify.Error("You can't send a private message if you have private messages disabled yourself. Enable them in the Misc Settings menu and try again.");
                    }
                }
                // teleport (in vehicle) button
                else if (item == teleport || item == teleportVeh)
                {
                    if (!currentPlayer.IsLocal)
                    {
                        _ = TeleportToPlayer(currentPlayer, item == teleportVeh); // teleport to the player. optionally in the player's vehicle if that button was pressed.
                    }
                    else
                    {
                        Notify.Error("You can not teleport to yourself!");
                    }
                }
                // summon button
                else if (item == summon)
                {
                    if (Game.Player.Handle != currentPlayer.Handle)
                    {
                        SummonPlayer(currentPlayer);
                    }
                    else
                    {
                        Notify.Error("You can't summon yourself.");
                    }
                }
                // spectating
                else if (item == spectate)
                {
                    SpectatePlayer(currentPlayer);
                }
                // kill button
                else if (item == kill)
                {
                    KillPlayer(currentPlayer);
                }
                // manage the gps route being clicked.
                else if (item == toggleGPS)
                {
                    bool selectedPedRouteAlreadyActive = false;
                    if (PlayersWaypointList.Count > 0)
                    {
                        if (PlayersWaypointList.Contains(currentPlayer.Handle))
                        {
                            selectedPedRouteAlreadyActive = true;
                        }
                        foreach (int playerId in PlayersWaypointList)
                        {
                            int playerPed = GetPlayerPed(playerId);
                            if (DoesEntityExist(playerPed) && DoesBlipExist(GetBlipFromEntity(playerPed)))
                            {
                                int oldBlip = GetBlipFromEntity(playerPed);
                                SetBlipRoute(oldBlip, false);
                                RemoveBlip(ref oldBlip);
                                Notify.Custom($"~g~GPS route to ~s~<C>{GetSafePlayerName(currentPlayer.Name)}</C>~g~ is now disabled.");
                            }
                        }
                        PlayersWaypointList.Clear();
                    }

                    if (!selectedPedRouteAlreadyActive)
                    {
                        if (currentPlayer.Handle != Game.Player.Handle)
                        {
                            int ped  = GetPlayerPed(currentPlayer.Handle);
                            int blip = GetBlipFromEntity(ped);
                            if (DoesBlipExist(blip))
                            {
                                SetBlipColour(blip, 58);
                                SetBlipRouteColour(blip, 58);
                                SetBlipRoute(blip, true);
                            }
                            else
                            {
                                blip = AddBlipForEntity(ped);
                                SetBlipColour(blip, 58);
                                SetBlipRouteColour(blip, 58);
                                SetBlipRoute(blip, true);
                            }
                            PlayersWaypointList.Add(currentPlayer.Handle);
                            Notify.Custom($"~g~GPS route to ~s~<C>{GetSafePlayerName(currentPlayer.Name)}</C>~g~ is now active, press the ~s~Toggle GPS Route~g~ button again to disable the route.");
                        }
                        else
                        {
                            Notify.Error("You can not set a waypoint to yourself.");
                        }
                    }
                }
                else if (item == printIdentifiers)
                {
                    Func <string, string> CallbackFunction = (data) =>
                    {
                        Debug.WriteLine(data);
                        string ids = "~s~";
                        foreach (string s in JsonConvert.DeserializeObject <string[]>(data))
                        {
                            ids += "~n~" + s;
                        }
                        Notify.Custom($"~y~<C>{GetSafePlayerName(currentPlayer.Name)}</C>~g~'s Identifiers: {ids}", false);
                        return(data);
                    };
                    BaseScript.TriggerServerEvent("vMenu:GetPlayerIdentifiers", currentPlayer.ServerId, CallbackFunction);
                }
                // kick button
                else if (item == kick)
                {
                    if (currentPlayer.Handle != Game.Player.Handle)
                    {
                        KickPlayer(currentPlayer, true);
                    }
                    else
                    {
                        Notify.Error("You cannot kick yourself!");
                    }
                }
                // temp ban
                else if (item == tempban)
                {
                    BanPlayer(currentPlayer, false);
                }
                // perm ban
                else if (item == ban)
                {
                    if (ban.Label == "Are you sure?")
                    {
                        ban.Label = "";
                        _         = UpdatePlayerlist();
                        playerMenu.GoBack();
                        BanPlayer(currentPlayer, true);
                    }
                    else
                    {
                        ban.Label = "Are you sure?";
                    }
                }
            };

            // handle button presses in the player list.
            menu.OnItemSelect += (sender, item, index) =>
            {
                var baseId = int.Parse(item.Label.Replace(" →→→", "").Replace("Server #", ""));
                var player = MainMenu.PlayersList.FirstOrDefault(p => p.ServerId == baseId);

                if (player != null)
                {
                    currentPlayer             = player;
                    playerMenu.MenuSubtitle   = $"~s~Player: ~y~{GetSafePlayerName(currentPlayer.Name)}";
                    playerMenu.CounterPreText = $"[Server ID: ~y~{currentPlayer.ServerId}~s~] ";
                }
                else
                {
                    playerMenu.GoBack();
                }
            };
        }
Exemplo n.º 40
0
 public void AddToMenuItemRepository(MenuItem menuItem)
 {
     MenuItemSingletonRepository.Instance.AddToRepository(menuItem);
 }
Exemplo n.º 41
0
        public SensorGadget(IComputer computer, PersistentSettings settings,
                            UnitManager unitManager)
        {
            this.unitManager          = unitManager;
            this.settings             = settings;
            computer.HardwareAdded   += new HardwareEventHandler(HardwareAdded);
            computer.HardwareRemoved += new HardwareEventHandler(HardwareRemoved);

            this.darkWhite = new SolidBrush(Color.FromArgb(0xF0, 0xF0, 0xF0));

            this.stringFormat             = new StringFormat();
            this.stringFormat.FormatFlags = StringFormatFlags.NoWrap;

            this.trimStringFormat             = new StringFormat();
            this.trimStringFormat.Trimming    = StringTrimming.EllipsisCharacter;
            this.trimStringFormat.FormatFlags = StringFormatFlags.NoWrap;

            this.alignRightStringFormat             = new StringFormat();
            this.alignRightStringFormat.Alignment   = StringAlignment.Far;
            this.alignRightStringFormat.FormatFlags = StringFormatFlags.NoWrap;

            if (File.Exists("gadget_background.png"))
            {
                try {
                    Image newBack = new Bitmap("gadget_background.png");
                    back.Dispose();
                    back = newBack;
                } catch { }
            }

            if (File.Exists("gadget_image.png"))
            {
                try {
                    image = new Bitmap("gadget_image.png");
                } catch {}
            }

            if (File.Exists("gadget_foreground.png"))
            {
                try {
                    fore = new Bitmap("gadget_foreground.png");
                } catch { }
            }

            if (File.Exists("gadget_bar_background.png"))
            {
                try {
                    Image newBarBack = new Bitmap("gadget_bar_background.png");
                    barBack.Dispose();
                    barBack = newBarBack;
                } catch { }
            }

            if (File.Exists("gadget_bar_foreground.png"))
            {
                try {
                    Image newBarColor = new Bitmap("gadget_bar_foreground.png");
                    barFore.Dispose();
                    barFore = newBarColor;
                } catch { }
            }

            this.Location = new Point(
                settings.GetValue("sensorGadget.Location.X", 100),
                settings.GetValue("sensorGadget.Location.Y", 100));
            LocationChanged += delegate(object sender, EventArgs e) {
                settings.SetValue("sensorGadget.Location.X", Location.X);
                settings.SetValue("sensorGadget.Location.Y", Location.Y);
            };

            // get the custom to default dpi ratio
            using (Bitmap b = new Bitmap(1, 1)) {
                scale = b.HorizontalResolution / 96.0f;
            }

            SetFontSize(settings.GetValue("sensorGadget.FontSize", 7.5f));
            Resize(settings.GetValue("sensorGadget.Width", Size.Width));

            ContextMenu contextMenu       = new ContextMenu();
            MenuItem    hardwareNamesItem = new MenuItem("Hardware Names");

            contextMenu.MenuItems.Add(hardwareNamesItem);
            MenuItem fontSizeMenu = new MenuItem("Font Size");

            for (int i = 0; i < 4; i++)
            {
                float  size;
                string name;
                switch (i)
                {
                case 0: size = 6.5f; name = "Small"; break;

                case 1: size = 7.5f; name = "Medium"; break;

                case 2: size = 9f; name = "Large"; break;

                case 3: size = 11f; name = "Very Large"; break;

                default: throw new NotImplementedException();
                }
                MenuItem item = new MenuItem(name);
                item.Checked = fontSize == size;
                item.Click  += delegate(object sender, EventArgs e) {
                    SetFontSize(size);
                    settings.SetValue("sensorGadget.FontSize", size);
                    foreach (MenuItem mi in fontSizeMenu.MenuItems)
                    {
                        mi.Checked = mi == item;
                    }
                };
                fontSizeMenu.MenuItems.Add(item);
            }
            contextMenu.MenuItems.Add(fontSizeMenu);
            contextMenu.MenuItems.Add(new MenuItem("-"));
            MenuItem lockItem = new MenuItem("Lock Position and Size");

            contextMenu.MenuItems.Add(lockItem);
            contextMenu.MenuItems.Add(new MenuItem("-"));
            MenuItem alwaysOnTopItem = new MenuItem("Always on Top");

            contextMenu.MenuItems.Add(alwaysOnTopItem);
            MenuItem opacityMenu = new MenuItem("Opacity");

            contextMenu.MenuItems.Add(opacityMenu);
            Opacity = (byte)settings.GetValue("sensorGadget.Opacity", 255);
            for (int i = 0; i < 5; i++)
            {
                MenuItem item = new MenuItem((20 * (i + 1)).ToString() + " %");
                byte     o    = (byte)(51 * (i + 1));
                item.Checked = Opacity == o;
                item.Click  += delegate(object sender, EventArgs e) {
                    Opacity = o;
                    settings.SetValue("sensorGadget.Opacity", Opacity);
                    foreach (MenuItem mi in opacityMenu.MenuItems)
                    {
                        mi.Checked = mi == item;
                    }
                };
                opacityMenu.MenuItems.Add(item);
            }
            this.ContextMenu = contextMenu;

            hardwareNames = new UserOption("sensorGadget.Hardwarenames", true,
                                           hardwareNamesItem, settings);
            hardwareNames.Changed += delegate(object sender, EventArgs e) {
                Resize();
            };

            alwaysOnTop = new UserOption("sensorGadget.AlwaysOnTop", false,
                                         alwaysOnTopItem, settings);
            alwaysOnTop.Changed += delegate(object sender, EventArgs e) {
                this.AlwaysOnTop = alwaysOnTop.Value;
            };
            lockPositionAndSize = new UserOption("sensorGadget.LockPositionAndSize",
                                                 false, lockItem, settings);
            lockPositionAndSize.Changed += delegate(object sender, EventArgs e) {
                this.LockPositionAndSize = lockPositionAndSize.Value;
            };

            HitTest += delegate(object sender, HitTestEventArgs e) {
                if (lockPositionAndSize.Value)
                {
                    return;
                }

                if (e.Location.X < leftBorder)
                {
                    e.HitResult = HitResult.Left;
                    return;
                }
                if (e.Location.X > Size.Width - 1 - rightBorder)
                {
                    e.HitResult = HitResult.Right;
                    return;
                }
            };

            SizeChanged += delegate(object sender, EventArgs e) {
                settings.SetValue("sensorGadget.Width", Size.Width);
                Redraw();
            };

            VisibleChanged += delegate(object sender, EventArgs e) {
                Rectangle bounds       = new Rectangle(Location, Size);
                Screen    screen       = Screen.FromRectangle(bounds);
                Rectangle intersection =
                    Rectangle.Intersect(screen.WorkingArea, bounds);
                if (intersection.Width < Math.Min(16, bounds.Width) ||
                    intersection.Height < Math.Min(16, bounds.Height))
                {
                    Location = new Point(
                        screen.WorkingArea.Width / 2 - bounds.Width / 2,
                        screen.WorkingArea.Height / 2 - bounds.Height / 2);
                }
            };

            MouseDoubleClick += delegate(object obj, MouseEventArgs args) {
                SendHideShowCommand();
            };
        }
Exemplo n.º 42
0
 public IEnumerable <MenuItem> GetMenuItems(MenuItem menuItemQuerryObject, string companyID)
 {
     return(MenuItemSingletonRepository.Instance.GetMenuItems(menuItemQuerryObject, companyID));
 }
Exemplo n.º 43
0
        private void p_GenerateMenu(List <MenuItem> parent)
        {
            foreach (var rec in parent)
            {
                var parents = new List <MenuItem>();
                var menu    = p_GetRecursiveMenu().Where(x => x.Parent == rec.kode).ToList();
                menu.ForEach(x =>
                {
                    if (p_IsParent(x.Kode))
                    {
                        var i    = 1;
                        var recs = p_GetRecursiveMenu().Where(x2 => x2.Parent == x.Kode).ToList();
                        recs.ForEach(x2 =>
                        {
                            if (p_IsParent(x2.Kode))
                            {
                                if (i == 1)
                                {
                                    var child = new MenuItem()
                                    {
                                        kode   = x.Kode,
                                        parent = x.Parent,
                                        title  = x.Title,
                                        icon   = x.Icon,
                                        href   = x.Url,
                                        sref   = null,
                                        Index  = x.Index
                                    };

                                    parents.Add(child);
                                }
                            }
                            {
                                if (i == 1)
                                {
                                    if (this.KodeAksesMenus.Contains(x2.Kode))
                                    {
                                        var child = new MenuItem()
                                        {
                                            kode   = x.Kode,
                                            parent = x.Parent,
                                            title  = x.Title,
                                            icon   = x.Icon,
                                            href   = null,
                                            sref   = x.Url,
                                            Index  = x.Index
                                        };

                                        parents.Add(child);
                                    }
                                }
                            }
                            i++;
                        });
                    }
                    else
                    {
                        if (this.KodeAksesMenus.Contains(x.Kode))
                        {
                            var child = new MenuItem()
                            {
                                kode   = x.Kode,
                                parent = x.Parent,
                                title  = x.Title,
                                icon   = x.Icon,
                                href   = null,
                                sref   = x.Url,
                                Index  = x.Index
                            };

                            parents.Add(child);
                        }
                    }
                });

                rec.items = parents;
                if (rec.items.Count() > 0)
                {
                    p_GenerateMenu(rec.items);
                }
            }
        }
 public void HandleSelectLang(MenuItem item)
 {
 }
Exemplo n.º 45
0
 public MenuItemCommand(MenuItem item)
 {
     _menuItem = item;
     _menuItem.PropertyChanged += OnElementPropertyChanged;
 }
Exemplo n.º 46
0
        public List <MenuItem> GetMenuByUser()
        {
            //var user = base.User;
            var menuItem        = new List <MenuItem>();
            var isAdministrator = false;

            using (IAdministrasiUserRepository repoUser = new AdministrasiUserRepository(ctx))
            {
                // repoUser.User = user;
                isAdministrator = repoUser.IsAdministrator;
            }

            if (isAdministrator)
            {
                this.p_GetRecursiveMenu().Where(x => x.Parent == "#").ToList().ForEach(x =>
                {
                    var mnuItem =
                        new MenuItem()
                    {
                        kode   = x.Kode,
                        parent = x.Parent,
                        title  = x.Title,
                        icon   = x.Icon,
                        href   = null,
                        sref   = x.Url,
                        Index  = x.Index
                    };

                    menuItem.Add(mnuItem);
                });


                this.KodeAksesMenus = this.p_GetRecursiveMenu().Select(x => x.Kode).ToList();
                p_GenerateMenu(menuItem);
            }
            else
            {
                var reckRoleUser  = ctx.Set <AdministrasiRoleUser>().Where(x => x.KodeUser == "").Select(x => x.KodeRole).ToList();
                var recAksesRole  = ctx.Set <AdministrasiHakAksesRole>().Where(x => reckRoleUser.Contains(x.KodeRole)).Select(x => x.KodeHakAkses).ToList();
                var recAksesMenu  = ctx.Set <AdministrasiHakAksesMenu>().Where(x => recAksesRole.Contains(x.KodeHakAkses)).Select(x => x.KodeMenu).ToList();
                var recMenu       = p_GetRecursiveMenu().Where(x => recAksesMenu.Contains(x.Kode)).ToList();
                var recParentMenu = recMenu.Select(x => x.Parent).Distinct().ToList();

                this.KodeAksesMenus = recAksesMenu;

                menuItem = p_GetParentMenu(recParentMenu);
                recMenu.Where(x => x.Parent == "#").ToList().ForEach(x =>
                {
                    var itm = new MenuItem()
                    {
                        kode   = x.Kode,
                        parent = x.Parent,
                        title  = x.Title,
                        icon   = x.Icon,
                        href   = null,
                        sref   = x.Url,
                        Index  = x.Index
                    };

                    menuItem.Add(itm);
                });


                p_GenerateMenu(menuItem.Distinct().ToList());
            }

            return(menuItem.OrderBy(x => x.Index).ToList());
        }
Exemplo n.º 47
0
        private void SelectedMenuItem_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {//these properties are not to be persisted we will igore them...
            if (e.PropertyName == "IsSelected" ||
                e.PropertyName == "IsExpanded" ||
                e.PropertyName == "IsValid" ||
                e.PropertyName == "NotValidMessage" ||
                e.PropertyName == "LastModifiedBy" ||
                e.PropertyName == "LastModifiedByDate")
            {
                return;
            }
            //Key ID Logic...
            if (e.PropertyName == "MenuItemID")
            {     //make sure it is has changed...
                if (SelectedMenuItemMirror.MenuItemID != SelectedMenuItem.MenuItemID)
                { //convert to the Entity MenuItem...
                    MenuItem     menuItem    = MenuItemList.FirstOrDefault(q => q.AutoID == SelectedMenuItem.AutoID);
                    EntityStates entityState = GetMenuItemState(menuItem);

                    if (entityState == EntityStates.Unchanged ||
                        entityState == EntityStates.Modified)
                    {//once a key is added it can not be modified...
                        MessageBox.Show("Once A Key Is Added It Can Not Be Modified.");
                        return;
                    }
                }
            }//end KeyID logic...

            object propertyChangedValue = SelectedMenuItem.GetPropertyValue(e.PropertyName);
            object prevPropertyValue    = SelectedMenuItemMirror.GetPropertyValue(e.PropertyName);
            string propertyType         = SelectedMenuItem.GetPropertyType(e.PropertyName);
            //in some instances the value is not really changing but yet it still is tripping property change..
            //This will ensure that the field has physically been modified...
            //As well when we revert back it constitutes a property change but they will be = and it will bypass the logic...
            bool objectsAreEqual;

            if (propertyChangedValue == null)
            {
                if (prevPropertyValue == null)//both values are null
                {
                    objectsAreEqual = true;
                }
                else//only one value is null
                {
                    objectsAreEqual = false;
                }
            }
            else
            {
                if (prevPropertyValue == null)//only one value is null
                {
                    objectsAreEqual = false;
                }
                else //both values are not null use .Equals...
                {
                    objectsAreEqual = propertyChangedValue.Equals(prevPropertyValue);
                }
            }
            if (!objectsAreEqual)
            {
                //Here we do property change validation if false is returned we will reset the value
                //Back to its mirrored value and return out of the property change w/o updating the repository...
                if (MenuItemPropertyChangeIsValid(e.PropertyName, propertyChangedValue, prevPropertyValue, propertyType))
                {//pass in the propertyname and value as we will update the CRUD MenuItem and pass the
                    //change to the repository...
                    Update(SelectedMenuItem, e.PropertyName, propertyChangedValue);
                    //set the mirrored objects field...
                    SelectedMenuItemMirror.SetPropertyValue(e.PropertyName, propertyChangedValue);
                    SelectedMenuItemMirror.IsValid         = SelectedMenuItem.IsValid;
                    SelectedMenuItemMirror.IsExpanded      = SelectedMenuItem.IsExpanded;
                    SelectedMenuItemMirror.NotValidMessage = SelectedMenuItem.NotValidMessage;
                }
                else
                {
                    SelectedMenuItem.SetPropertyValue(e.PropertyName, prevPropertyValue);
                    SelectedMenuItem.IsValid         = SelectedMenuItemMirror.IsValid;
                    SelectedMenuItem.IsExpanded      = SelectedMenuItemMirror.IsExpanded;
                    SelectedMenuItem.NotValidMessage = SelectedMenuItemMirror.NotValidMessage;
                }
            }
        }
Exemplo n.º 48
0
        public static void Load()
        {
            Q = new Spell(SpellSlot.Q, (DeafaltRange + 300));
            W = new Spell(SpellSlot.W);
            E = new Spell(SpellSlot.E, DeafaltRange);

            E.SetTargetted(0.25f, 2400f);

            var drawDamageMenu = new MenuItem("Draw_RDamage", "显示 (W) 伤害", true).SetValue(true);
            var drawFill       = new MenuItem("Draw_Fill", "显示 (W) 补充伤害", true).SetValue(new Circle(true, Color.FromArgb(90, 255, 169, 4)));

            SharpShooter.Menu.SubMenu("Combo").AddItem(new MenuItem("comboUseQ", "使用 Q", true).SetValue(true));
            SharpShooter.Menu.SubMenu("Combo").AddItem(new MenuItem("comboUseE", "使用 E", true).SetValue(true));

            SharpShooter.Menu.SubMenu("Harass").AddItem(new MenuItem("harassUseQ", "使用 Q", true).SetValue(true));
            SharpShooter.Menu.SubMenu("Harass").AddItem(new MenuItem("harassUseE", "使用 E", true).SetValue(true));
            SharpShooter.Menu.SubMenu("Harass").AddItem(new MenuItem("harassMana", "蓝量 % >", true).SetValue(new Slider(50, 0, 100)));

            SharpShooter.Menu.SubMenu("Laneclear").AddItem(new MenuItem("laneclearUseQ", "使用 Q", true).SetValue(true));
            SharpShooter.Menu.SubMenu("Laneclear").AddItem(new MenuItem("laneclearMana", "蓝量 % >", true).SetValue(new Slider(60, 0, 100)));

            SharpShooter.Menu.SubMenu("Jungleclear").AddItem(new MenuItem("jungleclearUseQ", "使用 Q", true).SetValue(true));
            SharpShooter.Menu.SubMenu("Jungleclear").AddItem(new MenuItem("jungleclearUseE", "使用 E", true).SetValue(true));
            SharpShooter.Menu.SubMenu("Jungleclear").AddItem(new MenuItem("jungleclearMana", "蓝量 % >", true).SetValue(new Slider(20, 0, 100)));

            SharpShooter.Menu.SubMenu("Misc").AddItem(new MenuItem("antigapcloser", "使用防突进", true).SetValue(true));
            SharpShooter.Menu.SubMenu("Misc").AddItem(new MenuItem("autointerrupt", "使用打断技能", true).SetValue(true));
            SharpShooter.Menu.SubMenu("Misc").AddItem(new MenuItem("AutoRQ", "当大招时自动Q", true).SetValue(true));
            SharpShooter.Menu.SubMenu("Misc").AddItem(new MenuItem("LogicalQ", "使用逻辑 Q (?)", true).SetValue(true));

            SharpShooter.Menu.SubMenu("Drawings").AddItem(new MenuItem("drawingAA", "真正的 AA 范围", true).SetValue(new Circle(true, Color.FromArgb(183, 0, 0))));
            SharpShooter.Menu.SubMenu("Drawings").AddItem(new MenuItem("drawingP", "被动范围", true).SetValue(new Circle(true, Color.FromArgb(183, 0, 0))));
            SharpShooter.Menu.SubMenu("Drawings").AddItem(new MenuItem("drawingQ", "Q 范围", true).SetValue(new Circle(true, Color.FromArgb(183, 0, 0))));
            SharpShooter.Menu.SubMenu("Drawings").AddItem(new MenuItem("drawingE", "E 范围", true).SetValue(new Circle(false, Color.FromArgb(183, 0, 0))));
            SharpShooter.Menu.SubMenu("Drawings").AddItem(new MenuItem("drawingRtimer", "R 计时器", true).SetValue(true));
            SharpShooter.Menu.SubMenu("Drawings").AddItem(new MenuItem("drawingCond", "E 碰撞预判", true).SetValue(new Circle(true, Color.Red)));

            SharpShooter.Menu.SubMenu("Drawings").AddItem(drawDamageMenu);
            SharpShooter.Menu.SubMenu("Drawings").AddItem(drawFill);

            DamageIndicator.DamageToUnit = GetComboDamage;
            DamageIndicator.Enabled      = drawDamageMenu.GetValue <bool>();
            DamageIndicator.Fill         = drawFill.GetValue <Circle>().Active;
            DamageIndicator.FillColor    = drawFill.GetValue <Circle>().Color;

            drawDamageMenu.ValueChanged +=
                delegate(object sender, OnValueChangeEventArgs eventArgs)
            {
                DamageIndicator.Enabled = eventArgs.GetNewValue <bool>();
            };

            drawFill.ValueChanged +=
                delegate(object sender, OnValueChangeEventArgs eventArgs)
            {
                DamageIndicator.Fill      = eventArgs.GetNewValue <Circle>().Active;
                DamageIndicator.FillColor = eventArgs.GetNewValue <Circle>().Color;
            };

            Game.OnGameUpdate += Game_OnGameUpdate;
            Drawing.OnDraw    += Drawing_OnDraw;
            AntiGapcloser.OnEnemyGapcloser     += AntiGapcloser_OnEnemyGapcloser;
            Interrupter2.OnInterruptableTarget += Interrupter2_OnInterruptableTarget;
            Obj_AI_Hero.OnProcessSpellCast     += Obj_AI_Hero_OnProcessSpellCast;
        }
Exemplo n.º 49
0
 /// <summary>
 /// Add Menu Item (Fluid API Style)
 /// </summary>
 /// <param name="parentMenuItem"></param>
 /// <param name="title"></param>
 /// <param name="itemId"></param>
 /// <param name="position"></param>
 public static MenuItem AddItem(this MenuItem parentMenuItem, string title, string itemId, int position = -1)
 {
     return(parentMenuItem.Add(title, itemId, position, BoMenuType.mt_STRING));
 }
Exemplo n.º 50
0
 private EntityStates GetMenuItemState(MenuItem item)
 {
     return(_serviceAgent.GetMenuItemEntityState(item));
 }
Exemplo n.º 51
0
        public static void Initialize()
        {
            var orbwalkerMenu = new Menu("Orbwalker", "Orbwalker");
            {
                Program.Orbwalker = new Orbwalking.Orbwalker(orbwalkerMenu);
                Config.AddSubMenu(orbwalkerMenu);
            }

            var targetSelectorMenu = new Menu("Target Selector", "Target Selector");
            {
                TargetSelector.AddToMenu(targetSelectorMenu);
                Config.AddSubMenu(targetSelectorMenu);
                Config.AddItem(new MenuItem("force.target", "Force focus selected target").SetValue(true));
                Config.AddItem(new MenuItem("force.target.range", "if within:").SetValue(new Slider(1500, 0, 2500)));
            }

            var comboMenu = new Menu("Combo", "Combo settings");
            {
                comboMenu.AddItem(new MenuItem("combo.q", "Use Q on enemy").SetValue(true));
                comboMenu.AddItem(new MenuItem("combo.q.minrange", "   Minimum range to Q enemy").SetValue(new Slider(450, 0, 650)));
                comboMenu.AddItem(new MenuItem("combo.q.undertower", "   Q enemy under tower only if their health % under").SetValue(new Slider(40)));
                comboMenu.AddItem(new MenuItem("combo.q.lastsecond", "   Use Q to target always before W buff ends (range doesnt matter)").SetValue(true));
                comboMenu.AddItem(new MenuItem("combo.q.gc", "Use Q to gapclose (killable minions)").SetValue(true));
                comboMenu.AddItem(new MenuItem("combo.w", "Use W").SetValue(true));
                comboMenu.AddItem(new MenuItem("combo.e", "Use E").SetValue(true));
                comboMenu.AddItem(new MenuItem("combo.e.logic", "   advanced logic").SetValue(true));
                comboMenu.AddItem(new MenuItem("combo.r", "Use R").SetValue(true));
                comboMenu.AddItem(new MenuItem("combo.r.weave", "   sheen synergy").SetValue(true));
                comboMenu.AddItem(new MenuItem("combo.r.selfactivated", "   only if self activated").SetValue(false));
                comboMenu.AddItem(new MenuItem("combo.items", "Use items").SetValue(true));
                comboMenu.AddItem(new MenuItem("combo.ignite", "Use ignite if combo killable").SetValue(true));
                Config.AddSubMenu(comboMenu);
            }
            var harassMenu = new Menu("Harass", "Harass settings");
            {
                harassMenu.AddItem(new MenuItem("harass.q", "Use Q on enemy").SetValue(true));
                harassMenu.AddItem(new MenuItem("harass.q.minrange", "   Minimum range to Q enemy").SetValue(new Slider(450, 0, 650)));
                harassMenu.AddItem(new MenuItem("harass.q.undertower", "   Q enemy under tower only if their health % under").SetValue(new Slider(40)));
                harassMenu.AddItem(new MenuItem("harass.q.lastsecond", "   Use Q to target always before W buff ends (range doesnt matter)").SetValue(true));
                harassMenu.AddItem(new MenuItem("harass.q.gc", "Use Q to gapclose (killable minions)").SetValue(true));
                harassMenu.AddItem(new MenuItem("harass.w", "Use W").SetValue(true));
                harassMenu.AddItem(new MenuItem("harass.e", "Use E").SetValue(true));
                harassMenu.AddItem(new MenuItem("harass.e.logic", "   advanced logic").SetValue(true));
                harassMenu.AddItem(new MenuItem("harass.r", "Use R").SetValue(true));
                harassMenu.AddItem(new MenuItem("harass.r.weave", "   sheen synergy").SetValue(true));
                harassMenu.AddItem(new MenuItem("harass.mana", "Mana manager (%)").SetValue(new Slider(40, 1)));
                Config.AddSubMenu(harassMenu);
            }
            var laneclearMenu = new Menu("Laneclear", "Laneclear settings");
            {
                laneclearMenu.AddItem(new MenuItem("laneclear.q", "Use Q").SetValue(true));
                laneclearMenu.AddItem(new MenuItem("laneclear.r", "Use R").SetValue(true));
                laneclearMenu.AddItem(new MenuItem("laneclear.r.minimum", "   minimum minions").SetValue(new Slider(2, 1, 6)));
                laneclearMenu.AddItem(new MenuItem("laneclear.mana", "Mana manager (%)").SetValue(new Slider(40, 1)));
                Config.AddSubMenu(laneclearMenu);
            }
            var drawingsMenu = new Menu("Drawings", "Drawings settings");
            {
                drawingsMenu.AddItem(new MenuItem("drawings.q", "Draw Q").SetValue(true));
                drawingsMenu.AddItem(new MenuItem("drawings.e", "Draw E").SetValue(true));
                drawingsMenu.AddItem(new MenuItem("drawings.r", "Draw R").SetValue(true));
                var dmgAfterCombo = new MenuItem("dmgAfterCombo", "Draw combo damage on target").SetValue(true);
                Utility.HpBarDamageIndicator.DamageToUnit = Program.ComboDamage;
                Utility.HpBarDamageIndicator.Enabled      = dmgAfterCombo.GetValue <bool>();
                drawingsMenu.AddItem(dmgAfterCombo);
                Config.AddSubMenu(drawingsMenu);
            }
            var miscMenu = new Menu("Misc", "Misc. settings"); // R to heal
            {
                miscMenu.AddItem(new MenuItem("misc.ks.q", "Killsteal Q").SetValue(true));
                miscMenu.AddItem(new MenuItem("misc.ks.e", "Killsteal E").SetValue(true));
                miscMenu.AddItem(new MenuItem("misc.ks.r", "Killsteal R").SetValue(true));
                miscMenu.AddItem(new MenuItem("misc.age", "Anti-Gapclose E").SetValue(true));
                miscMenu.AddItem(new MenuItem("misc.interrupt", "Stun interruptable spells").SetValue(true));
                miscMenu.AddItem(new MenuItem("misc.stunundertower", "Stun enemy with tower aggro").SetValue(true));
                Config.AddSubMenu(miscMenu);
            }
            var fleeMEnu = new Menu("Flee", "Flee settings");

            {
                fleeMEnu.AddItem(new MenuItem("flee.q", "Use Q").SetValue(true));
                fleeMEnu.AddItem(new MenuItem("flee.e", "Use E").SetValue(true));
                fleeMEnu.AddItem(new MenuItem("flee.r", "Use R").SetValue(true));
                fleeMEnu.AddItem(
                    new MenuItem("flee", "Flee!").SetValue(new KeyBind("Z".ToCharArray()[0], KeyBindType.Press)));
                Config.AddSubMenu(fleeMEnu);
            }

            Config.AddToMainMenu();
        }
Exemplo n.º 52
0
 /// <summary>
 /// Add Separator
 /// </summary>
 /// <param name="parentMenuItem"></param>
 /// <param name="itemId"></param>
 /// <returns></returns>
 public static MenuItem AddSeparator(this MenuItem parentMenuItem, string itemId)
 {
     return(parentMenuItem.Add("", itemId, -1, BoMenuType.mt_SEPERATOR));
 }
Exemplo n.º 53
0
        public static void Load()
        {
            Q = new Spell(SpellSlot.Q, 1300f)
            {
                MinHitChance = HitChance.High
            };
            W = new Spell(SpellSlot.W, 800f);
            E = new Spell(SpellSlot.E, 1000f)
            {
                MinHitChance = HitChance.High
            };
            R = new Spell(SpellSlot.R);

            Q.SetSkillshot(0.625f, 90f, 2200f, false, SkillshotType.SkillshotLine);
            W.SetSkillshot(1.3f, 1f, float.MaxValue, false, SkillshotType.SkillshotCircle);
            E.SetSkillshot(0.125f, 80f, 2000f, true, SkillshotType.SkillshotLine);

            var drawDamageMenu = new MenuItem("Draw_RDamage", "Draw (R) Damage", true).SetValue(true);
            var drawFill       = new MenuItem("Draw_Fill", "Draw (R) Damage Fill", true).SetValue(new Circle(true, Color.FromArgb(90, 255, 169, 4)));

            SharpShooter.Menu.SubMenu("Combo").AddItem(new MenuItem("comboUseQ", "Use Q", true).SetValue(true));
            SharpShooter.Menu.SubMenu("Combo").AddItem(new MenuItem("comboUseW", "Use W", true).SetValue(true));
            SharpShooter.Menu.SubMenu("Combo").AddItem(new MenuItem("comboUseR", "Use R", true).SetValue(true));

            SharpShooter.Menu.SubMenu("Harass").AddItem(new MenuItem("harassUseQ", "Use Q", true).SetValue(true));
            SharpShooter.Menu.SubMenu("Harass").AddItem(new MenuItem("harassMana", "if Mana % >", true).SetValue(new Slider(50, 0, 100)));

            SharpShooter.Menu.SubMenu("Laneclear").AddItem(new MenuItem("laneclearUseQ", "Use Q", true).SetValue(true));
            SharpShooter.Menu.SubMenu("Laneclear").AddItem(new MenuItem("laneclearMana", "if Mana % >", true).SetValue(new Slider(60, 0, 100)));

            SharpShooter.Menu.SubMenu("Jungleclear").AddItem(new MenuItem("jungleclearUseQ", "Use Q", true).SetValue(true));
            SharpShooter.Menu.SubMenu("Jungleclear").AddItem(new MenuItem("jungleclearMana", "if Mana % >", true).SetValue(new Slider(20, 0, 100)));

            SharpShooter.Menu.SubMenu("Misc").AddItem(new MenuItem("antigapcloser", "Use Anti-Gapcloser", true).SetValue(true));
            SharpShooter.Menu.SubMenu("Misc").AddItem(new MenuItem("AutoW", "Autocast W on immobile targets", true).SetValue(true));
            SharpShooter.Menu.SubMenu("Misc").AddItem(new MenuItem("dash", "Dash to Mouse", true).SetValue(new KeyBind('G', KeyBindType.Press)));

            SharpShooter.Menu.SubMenu("Drawings").AddItem(new MenuItem("drawingAA", "Real AA Range", true).SetValue(new Circle(true, Color.FromArgb(255, 94, 0))));
            SharpShooter.Menu.SubMenu("Drawings").AddItem(new MenuItem("drawingQ", "Q Range", true).SetValue(new Circle(true, Color.FromArgb(255, 94, 0))));
            SharpShooter.Menu.SubMenu("Drawings").AddItem(new MenuItem("drawingW", "W Range", true).SetValue(new Circle(false, Color.FromArgb(255, 94, 0))));
            SharpShooter.Menu.SubMenu("Drawings").AddItem(new MenuItem("drawingE", "E Range", true).SetValue(new Circle(false, Color.FromArgb(255, 94, 0))));
            SharpShooter.Menu.SubMenu("Drawings").AddItem(new MenuItem("drawingR", "R Range", true).SetValue(new Circle(true, Color.FromArgb(255, 94, 0))));

            SharpShooter.Menu.SubMenu("Drawings").AddItem(drawDamageMenu);
            SharpShooter.Menu.SubMenu("Drawings").AddItem(drawFill);

            DamageIndicator.DamageToUnit = GetComboDamage;
            DamageIndicator.Enabled      = drawDamageMenu.GetValue <bool>();
            DamageIndicator.Fill         = drawFill.GetValue <Circle>().Active;
            DamageIndicator.FillColor    = drawFill.GetValue <Circle>().Color;

            drawDamageMenu.ValueChanged +=
                delegate(object sender, OnValueChangeEventArgs eventArgs)
            {
                DamageIndicator.Enabled = eventArgs.GetNewValue <bool>();
            };

            drawFill.ValueChanged +=
                delegate(object sender, OnValueChangeEventArgs eventArgs)
            {
                DamageIndicator.Fill      = eventArgs.GetNewValue <Circle>().Active;
                DamageIndicator.FillColor = eventArgs.GetNewValue <Circle>().Color;
            };

            Game.OnUpdate  += Game_OnUpdate;
            Drawing.OnDraw += Drawing_OnDraw;
            AntiGapcloser.OnEnemyGapcloser += AntiGapcloser_OnEnemyGapcloser;
        }
Exemplo n.º 54
0
 /// <summary>
 /// Add Folder (Fluid API Style)
 /// </summary>
 /// <param name="parentMenuItem"></param>
 /// <param name="title"></param>
 /// <param name="itemId"></param>
 /// <param name="position"></param>
 /// <returns></returns>
 public static MenuItem AddFolder(this MenuItem parentMenuItem, string title, string itemId, int position = -1)
 {
     return(parentMenuItem.Add(title, itemId, position, BoMenuType.mt_POPUP));
 }
Exemplo n.º 55
0
        private static void Game_OnGameLoad(EventArgs args)
        {
            Player = ObjectManager.Player;

            if (Player.BaseSkinName != ChampionName)
            {
                return;
            }

            //Create the spells
            Q  = new Spell(SpellSlot.Q, 790);
            W  = new Spell(SpellSlot.W, 925);
            E  = new Spell(SpellSlot.E, 700);
            R  = new Spell(SpellSlot.R, 675);
            EQ = new Spell(SpellSlot.Q, Q.Range + 500);

            IgniteSlot = Player.GetSpellSlot("SummonerDot");

//            DFG = Utility.Map.GetMap().Type == Utility.Map.MapType.TwistedTreeline ? new Items.Item(3188, 750) : new Items.Item(3128, 750);

            Q.SetSkillshot(0.6f, 125f, float.MaxValue, false, SkillshotType.SkillshotCircle);
            W.SetSkillshot(0.25f, 140f, 1600f, false, SkillshotType.SkillshotCircle);
            E.SetSkillshot(0.25f, (float)(45 * 0.5), 2500f, false, SkillshotType.SkillshotCircle);
            EQ.SetSkillshot(float.MaxValue, 55f, 2000f, false, SkillshotType.SkillshotCircle);

            SpellList.Add(Q);
            SpellList.Add(W);
            SpellList.Add(E);
            SpellList.Add(R);

            //Create the menu
            Config = new Menu(ChampionName, ChampionName, true);

            //Orbwalker submenu
            Config.AddSubMenu(new Menu("Orbwalking", "Orbwalking"));

            //Add the target selector to the menu as submenu.
            var targetSelectorMenu = new Menu("Target Selector", "Target Selector");

            TargetSelector.AddToMenu(targetSelectorMenu);
            Config.AddSubMenu(targetSelectorMenu);

            //Load the orbwalker and add it to the menu as submenu.
            Orbwalker = new Orbwalking.Orbwalker(Config.SubMenu("Orbwalking"));

            //Combo menu:
            Config.AddSubMenu(new Menu("Combo", "Combo"));
            Config.SubMenu("Combo").AddItem(new MenuItem("UseQCombo", "Use Q").SetValue(true));
            Config.SubMenu("Combo").AddItem(new MenuItem("UseWCombo", "Use W").SetValue(true));
            Config.SubMenu("Combo").AddItem(new MenuItem("UseECombo", "Use E").SetValue(true));
            Config.SubMenu("Combo").AddItem(new MenuItem("UseQECombo", "Use QE").SetValue(true));
            Config.SubMenu("Combo").AddItem(new MenuItem("UseRCombo", "Use R").SetValue(true));
            Config.SubMenu("Combo").AddItem(new MenuItem("UseIgniteCombo", "Use Ignite").SetValue(true));
            Config.SubMenu("Combo")
            .AddItem(
                new MenuItem("ComboActive", "Combo!").SetValue(
                    new KeyBind(Config.Item("Orbwalk").GetValue <KeyBind>().Key, KeyBindType.Press)));

            //Harass menu:
            Config.AddSubMenu(new Menu("Harass", "Harass"));
            Config.SubMenu("Harass").AddItem(new MenuItem("UseQHarass", "Use Q").SetValue(true));
            Config.SubMenu("Harass").AddItem(new MenuItem("UseWHarass", "Use W").SetValue(false));
            Config.SubMenu("Harass").AddItem(new MenuItem("UseEHarass", "Use E").SetValue(false));
            Config.SubMenu("Harass").AddItem(new MenuItem("UseQEHarass", "Use QE").SetValue(false));
            Config.SubMenu("Harass")
            .AddItem(
                new MenuItem("HarassActive", "Harass!").SetValue(
                    new KeyBind(Config.Item("Farm").GetValue <KeyBind>().Key, KeyBindType.Press)));
            Config.SubMenu("Harass")
            .AddItem(
                new MenuItem("HarassActiveT", "Harass (toggle)!").SetValue(new KeyBind("Y".ToCharArray()[0],
                                                                                       KeyBindType.Toggle)));

            //Farming menu:
            Config.AddSubMenu(new Menu("Farm", "Farm"));
            Config.SubMenu("Farm").AddItem(new MenuItem("EnabledFarm", "Enable! (On/Off: Mouse Scroll)").SetValue(true));
            Config.SubMenu("Farm")
            .AddItem(
                new MenuItem("UseQFarm", "Use Q").SetValue(
                    new StringList(new[] { "Freeze", "LaneClear", "Both", "No" }, 2)));
            Config.SubMenu("Farm")
            .AddItem(
                new MenuItem("UseWFarm", "Use W").SetValue(
                    new StringList(new[] { "Freeze", "LaneClear", "Both", "No" }, 1)));
            Config.SubMenu("Farm")
            .AddItem(
                new MenuItem("UseEFarm", "Use E").SetValue(
                    new StringList(new[] { "Freeze", "LaneClear", "Both", "No" }, 3)));
            Config.SubMenu("Farm")
            .AddItem(
                new MenuItem("FreezeActive", "Freeze!").SetValue(
                    new KeyBind(Config.Item("Farm").GetValue <KeyBind>().Key, KeyBindType.Press)));
            Config.SubMenu("Farm")
            .AddItem(
                new MenuItem("LaneClearActive", "LaneClear!").SetValue(
                    new KeyBind(Config.Item("LaneClear").GetValue <KeyBind>().Key, KeyBindType.Press)));

            //JungleFarm menu:
            Config.AddSubMenu(new Menu("JungleFarm", "JungleFarm"));
            Config.SubMenu("JungleFarm").AddItem(new MenuItem("UseQJFarm", "Use Q").SetValue(true));
            Config.SubMenu("JungleFarm").AddItem(new MenuItem("UseWJFarm", "Use W").SetValue(true));
            Config.SubMenu("JungleFarm").AddItem(new MenuItem("UseEJFarm", "Use E").SetValue(true));
            Config.SubMenu("JungleFarm")
            .AddItem(
                new MenuItem("JungleFarmActive", "JungleFarm!").SetValue(
                    new KeyBind(Config.Item("LaneClear").GetValue <KeyBind>().Key, KeyBindType.Press)));

            //Misc
            Config.AddSubMenu(new Menu("Misc", "Misc"));
            Config.SubMenu("Misc").AddItem(new MenuItem("InterruptSpells", "Interrupt spells").SetValue(true));
            Config.SubMenu("Misc")
            .AddItem(
                new MenuItem("CastQE", "QE closest to cursor").SetValue(new KeyBind("T".ToCharArray()[0],
                                                                                    KeyBindType.Press)));
            Config.SubMenu("Misc").AddSubMenu(new Menu("Dont use R on", "DontUlt"));

            foreach (var enemy in ObjectManager.Get <Obj_AI_Hero>().Where(enemy => enemy.Team != Player.Team))
            {
                Config.SubMenu("Misc")
                .SubMenu("DontUlt")
                .AddItem(new MenuItem("DontUlt" + enemy.BaseSkinName, enemy.BaseSkinName).SetValue(false));
            }

            //Damage after combo:
            var dmgAfterComboItem = new MenuItem("DamageAfterCombo", "Draw damage after combo").SetValue(true);

            Utility.HpBarDamageIndicator.DamageToUnit = GetComboDamage;
            Utility.HpBarDamageIndicator.Enabled      = dmgAfterComboItem.GetValue <bool>();
            dmgAfterComboItem.ValueChanged           += delegate(object sender, OnValueChangeEventArgs eventArgs)
            {
                Utility.HpBarDamageIndicator.Enabled = eventArgs.GetNewValue <bool>();
            };

            //Drawings menu:
            Config.AddSubMenu(new Menu("Drawings", "Drawings"));
            Config.SubMenu("Drawings")
            .AddItem(new MenuItem("QRange", "Q range").SetValue(new Circle(false, Color.FromArgb(100, 255, 0, 255))));
            Config.SubMenu("Drawings")
            .AddItem(new MenuItem("WRange", "W range").SetValue(new Circle(true, Color.FromArgb(100, 255, 0, 255))));
            Config.SubMenu("Drawings")
            .AddItem(new MenuItem("ERange", "E range").SetValue(new Circle(false, Color.FromArgb(100, 255, 0, 255))));
            Config.SubMenu("Drawings")
            .AddItem(new MenuItem("RRange", "R range").SetValue(new Circle(false, Color.FromArgb(100, 255, 0, 255))));
            Config.SubMenu("Drawings")
            .AddItem(new MenuItem("QERange", "QE range").SetValue(new Circle(true, Color.FromArgb(100, 255, 0, 255))));
            Config.SubMenu("Drawings")
            .AddItem(dmgAfterComboItem);
            Config.SubMenu("Drawings")
            .AddItem(
                new MenuItem("HarassActiveTPermashow", "Show harass permashow").SetValue(true)).ValueChanged += (s, ar) =>
            {
                if (ar.GetNewValue <bool>())
                {
                    Config.Item("HarassActiveT").Permashow(true, "HarassActive");
                }
                else
                {
                    Config.Item("HarassActiveT").Permashow(false);
                }
            };

            Config.Item("HarassActiveT").Permashow(Config.Item("HarassActiveTPermashow").GetValue <bool>(), "HarassActive");

            Config.SubMenu("Drawings")
            .AddItem(
                new MenuItem("EnabledFarmPermashow", "Show Farm Permashow").SetValue(true)).ValueChanged +=
                (s, ar) =>
            {
                if (ar.GetNewValue <bool>())
                {
                    Config.Item("EnabledFarm").Permashow(true, "Enabled Farm");
                }
                else
                {
                    Config.Item("EnabledFarm").Permashow(false);
                }
            };
            Config.Item("EnabledFarm").Permashow(Config.Item("EnabledFarmPermashow").GetValue <bool>(), "Enabled Farm");

            Config.AddToMainMenu();

            //Add the events we are going to use:
            Game.OnUpdate  += Game_OnGameUpdate;
            Game.OnWndProc += Game_OnWndProc;
            Obj_AI_Base.OnProcessSpellCast += Obj_AI_Hero_OnProcessSpellCast;
            Drawing.OnDraw += Drawing_OnDraw;
            Interrupter2.OnInterruptableTarget += Interrupter2_OnInterruptableTarget;
            Orbwalking.BeforeAttack            += Orbwalking_BeforeAttack;
            Game.PrintChat(ChampionName + " Loaded!");
        }
Exemplo n.º 56
0
        private void MainMenuItem_SubmenuOpened(object sender, RoutedEventArgs e)
        {
            MainMenuItem.Items.Clear();

            var mi = new MenuItem
            {
                Header           = "_Post to Weblog",
                Command          = WeblogFormCommand,
                CommandParameter = "posttoweblog",
            };

            MainMenuItem.Items.Add(mi);

            mi = new MenuItem
            {
                Header           = "_New Weblog Post",
                Command          = WeblogFormCommand,
                CommandParameter = "newweblogpost"
            };
            MainMenuItem.Items.Add(mi);


            mi = new MenuItem
            {
                Header           = "_Download Weblog Posts",
                Command          = WeblogFormCommand,
                CommandParameter = "downloadweblogpost"
            };
            MainMenuItem.Items.Add(mi);

            mi = new MenuItem
            {
                Header           = "_Open Weblog Posts Folder",
                Command          = WeblogFormCommand,
                CommandParameter = "openweblogfolder"
            };
            MainMenuItem.Items.Add(mi);

            MainMenuItem.Items.Add(new Separator());

            var curText = Model.ActiveDocument?.CurrentText;

            if (!string.IsNullOrEmpty(curText) &&
                curText.Contains("permalink: ", StringComparison.InvariantCultureIgnoreCase))
            {
                MainMenuItem.Items.Add(new Separator());
                mi = new MenuItem
                {
                    Header           = "Open Blog Post in _Browser",
                    Command          = WeblogFormCommand,
                    CommandParameter = "openblogpost"
                };
                MainMenuItem.Items.Add(mi);
                MainMenuItem.Items.Add(new Separator());
            }

            mi = new MenuItem
            {
                Header           = "_Configure Weblogs",
                Command          = WeblogFormCommand,
                CommandParameter = "configureweblog"
            };
            MainMenuItem.Items.Add(mi);

            MainMenuItem.IsSubmenuOpen = true;
        }
Exemplo n.º 57
0
        private static void Game_OnGameLoad(EventArgs args)
        {
            if (ObjectManager.Player.ChampionName != ChampionName)
            {
                return;
            }

            Q = new Spell(SpellSlot.Q, 720);
            Q.SetTargetted(0.5f, 1500f);

            W = new Spell(SpellSlot.W, 670);
            W.SetSkillshot(0.6f, 220f, 1900f, false, SkillshotType.SkillshotCircle);

            E = new Spell(SpellSlot.E, 900);
            E.SetSkillshot(0.3f, 80f, 1650f, true, SkillshotType.SkillshotLine);

            R = new Spell(SpellSlot.R, 720);
            {
                SpellList.Add(Q);
                SpellList.Add(W);
                SpellList.Add(E);
                SpellList.Add(R);
            }

            Config = new Menu("【無爲汉化】xQx-妖姬", ChampionName, true);
            {
                Config.AddSubMenu(new Menu("走砍", "Orbwalking"));
            }

            Orbwalker = new Orbwalking.Orbwalker(Config.SubMenu("Orbwalking"));

            var menuTargetSelector = new Menu("目标选择器", "TargetSelector");

            {
                TargetSelector.AddToMenu(menuTargetSelector);
                Config.AddSubMenu(menuTargetSelector);
            }
            new AssassinManager();

            Config.AddSubMenu(new Menu("连招", "Combo"));
            {
                Config.SubMenu("Combo").AddItem(new MenuItem("ComboSetOption", "连招").SetValue(new StringList(new[] { "自动", "Q-R 连招", "W-R 连招", "E-R 连招", }, 1)));
                Config.SubMenu("Combo").AddItem(new MenuItem("ComboSetEHitCh", "E 命中率").SetValue(new StringList(new[] { "低", "中等", "高", "非常高", "不动的" }, 2)));
                Config.SubMenu("Combo").AddSubMenu(new Menu("不要使用组合", "DontCombo"));
                {
                    foreach (var enemy in ObjectManager.Get <Obj_AI_Hero>().Where(enemy => enemy.Team != ObjectManager.Player.Team))
                    {
                        Config.SubMenu("Combo").SubMenu("DontCombo").AddItem(new MenuItem("DontCombo" + enemy.BaseSkinName, enemy.BaseSkinName).SetValue(false));
                    }
                }
                Config.SubMenu("Combo").AddItem(new MenuItem("ComboDblStun", "双锁链!").SetValue(new KeyBind("T".ToCharArray()[0], KeyBindType.Press)));
                Config.SubMenu("Combo").AddItem(new MenuItem("ComboShowInfo", "显示连招组合状态").SetValue(true));
                Config.SubMenu("Combo").AddItem(new MenuItem("ComboActive", "连招!").SetValue(new KeyBind(Config.Item("Orbwalk").GetValue <KeyBind>().Key, KeyBindType.Press)));
            }

            Config.AddSubMenu(new Menu("骚扰", "Harass"));
            {
                /*
                 * {
                 *  Config.SubMenu("Harass").AddItem(new MenuItem("HarassUseQ", "Q").SetValue(true));
                 *  Config.SubMenu("Harass")
                 *      .AddItem(new MenuItem("HarassManaQ", "Q Min. Mana Percent: ").SetValue(new Slider(50, 100, 0)));
                 *  Config.SubMenu("Harass")
                 *      .AddItem(
                 *          new MenuItem("HarassUseTQ", "Q (toggle)!").SetValue(new KeyBind("J".ToCharArray()[0],
                 *              KeyBindType.Toggle)));
                 * }
                 * Config.SubMenu("Harass").AddItem(new MenuItem("xHx", ""));
                 * {
                 *  Config.SubMenu("Harass").AddItem(new MenuItem("HarassUseW", "W").SetValue(true));
                 *  Config.SubMenu("Harass")
                 *      .AddItem(new MenuItem("HarassManaW", "W Min. Mana Percent: ").SetValue(new Slider(50, 100, 0)));
                 *  Config.SubMenu("Harass")
                 *      .AddItem(
                 *          new MenuItem("HarassUseTW", "W (toggle)!").SetValue(new KeyBind("K".ToCharArray()[0],
                 *              KeyBindType.Toggle)));
                 * }
                 * Config.SubMenu("Harass").AddItem(new MenuItem("xHx", ""));
                 * {
                 *  Config.SubMenu("Harass").AddItem(new MenuItem("HarassUseE", "E").SetValue(true));
                 *  Config.SubMenu("Harass")
                 *      .AddItem(new MenuItem("HarassManaE", "E Min. Mana Percent: ").SetValue(new Slider(50, 100, 0)));
                 *  Config.SubMenu("Harass")
                 *      .AddItem(
                 *          new MenuItem("HarassUseTE", "E (toggle)!").SetValue(
                 *              new KeyBind("L".ToCharArray()[0], KeyBindType.Toggle)));
                 * }
                 * Config.SubMenu("Harass").AddItem(new MenuItem("xHx", ""));
                 */
                Config.SubMenu("Harass").AddSubMenu(new Menu("Q", "HarassQ"));
                Config.SubMenu("Harass").SubMenu("HarassQ").AddItem(new MenuItem("HarassUseQ", "使用 Q").SetValue(true));
                Config.SubMenu("Harass").SubMenu("HarassQ").AddItem(new MenuItem("HarassManaQ", "Q 最小蓝量% ").SetValue(new Slider(50, 100, 0)));
                Config.SubMenu("Harass").SubMenu("HarassQ").AddItem(new MenuItem("HarassUseTQ", "使用 Q (切换)!").SetValue(new KeyBind("J".ToCharArray()[0], KeyBindType.Toggle)));
                Config.SubMenu("Harass").AddSubMenu(new Menu("W", "HarassW"));
                Config.SubMenu("Harass").SubMenu("HarassW").AddItem(new MenuItem("HarassUseW", "使用 W").SetValue(true));
                Config.SubMenu("Harass").SubMenu("HarassW").AddItem(new MenuItem("HarassManaW", "W 最小蓝量% ").SetValue(new Slider(50, 100, 0)));
                Config.SubMenu("Harass").SubMenu("HarassW").AddItem(new MenuItem("HarassUseTW", "使用 W (切换)!").SetValue(new KeyBind("K".ToCharArray()[0], KeyBindType.Toggle)));
                Config.SubMenu("Harass").AddSubMenu(new Menu("E", "HarassE"));
                Config.SubMenu("Harass").SubMenu("HarassE").AddItem(new MenuItem("HarassUseE", "使用 E").SetValue(true));
                Config.SubMenu("Harass").SubMenu("HarassE").AddItem(new MenuItem("HarassManaE", "E 最小蓝量% ").SetValue(new Slider(50, 100, 0)));
                Config.SubMenu("Harass").SubMenu("HarassE").AddItem(new MenuItem("HarassUseTE", "使用 E (切换)!").SetValue(new KeyBind("L".ToCharArray()[0], KeyBindType.Toggle)));

                Config.SubMenu("Harass").AddItem(new MenuItem("HarassShowInfo", "显示骚扰的切换状态").SetValue(true));
                Config.SubMenu("Harass").AddItem(new MenuItem("HarassActive", "骚扰!").SetValue(new KeyBind("C".ToCharArray()[0], KeyBindType.Press)));
            }

            Config.AddSubMenu(new Menu("发育", "LaneClear"));
            {
                Config.SubMenu("LaneClear").AddItem(new MenuItem("LaneClearUseQ", "使用 Q").SetValue(false));
                Config.SubMenu("LaneClear").AddItem(new MenuItem("LaneClearUseW", "使用 W").SetValue(false));
                Config.SubMenu("LaneClear").AddItem(new MenuItem("LaneClearUseE", "使用 E").SetValue(false));
                Config.SubMenu("LaneClear")
                .AddItem(new MenuItem("LaneClearMana", "最小蓝量%").SetValue(new Slider(50, 100, 0)));
                Config.SubMenu("LaneClear")
                .AddItem(
                    new MenuItem("LaneClearActive", "骚扰!").SetValue(
                        new KeyBind("V".ToCharArray()[0], KeyBindType.Press)));
            }

            Config.AddSubMenu(new Menu("清野", "JungleFarm"));
            {
                Config.SubMenu("JungleFarm").AddItem(new MenuItem("JungleFarmUseQ", "使用 Q").SetValue(true));
                Config.SubMenu("JungleFarm").AddItem(new MenuItem("JungleFarmUseW", "使用 W").SetValue(true));
                Config.SubMenu("JungleFarm").AddItem(new MenuItem("JungleFarmUseE", "使用 E").SetValue(true));
                Config.SubMenu("JungleFarm")
                .AddItem(new MenuItem("JungleFarmMana", "最小蓝量%").SetValue(new Slider(50, 100, 0)));
                Config.SubMenu("JungleFarm")
                .AddItem(
                    new MenuItem("JungleFarmActive", "清野!").SetValue(
                        new KeyBind("V".ToCharArray()[0], KeyBindType.Press)));
            }

            var menuRun = new Menu("运行", "Run");

            {
                menuRun.AddItem(new MenuItem("RunUseW", "使用 W").SetValue(true));
                menuRun.AddItem(new MenuItem("RunUseR", "使用 R").SetValue(true));
                menuRun.AddItem(
                    new MenuItem("RunActive", "运行!").SetValue(new KeyBind("A".ToCharArray()[0], KeyBindType.Press)));
                Config.AddSubMenu(menuRun);
            }

            MenuExtras = new Menu("其他", "Extras");
            {
                Config.AddSubMenu(MenuExtras);
                MenuExtras.AddItem(new MenuItem("InterruptSpells", "打断法术").SetValue(true));
                new PotionManager();
            }

            Config.AddSubMenu(new Menu("范围", "Drawings"));
            {
                Config.SubMenu("Drawings")
                .AddItem(new MenuItem("QRange", "Q 范围").SetValue(new Circle(false, Color.Honeydew)));
                Config.SubMenu("Drawings")
                .AddItem(new MenuItem("WRange", "W 范围").SetValue(new Circle(true, Color.Honeydew)));
                Config.SubMenu("Drawings")
                .AddItem(new MenuItem("ERange", "E 范围").SetValue(new Circle(false, Color.Honeydew)));
                Config.SubMenu("Drawings")
                .AddItem(new MenuItem("RRange", "R 范围").SetValue(new Circle(false, Color.Honeydew)));

                Config.SubMenu("Drawings")
                .AddItem(
                    new MenuItem("ActiveERange", "启用 E 范围").SetValue(new Circle(false, Color.GreenYellow)));
                Config.SubMenu("Drawings")
                .AddItem(new MenuItem("WObjPosition", "W Obj. Pos.").SetValue(new Circle(true, Color.GreenYellow)));
                Config.SubMenu("Drawings").AddItem(new MenuItem("WObjTimeTick", "W Obj. Tick").SetValue(true));
                Config.SubMenu("Drawings")
                .AddItem(new MenuItem("WQRange", "W+Q 范围").SetValue(new Circle(false, Color.GreenYellow)));

                var dmgAfterComboItem = new MenuItem("DamageAfterCombo", "连招损伤").SetValue(true);
                Config.SubMenu("Drawings").AddItem(dmgAfterComboItem);

                Utility.HpBarDamageIndicator.DamageToUnit = GetComboDamage;
                Utility.HpBarDamageIndicator.Enabled      = dmgAfterComboItem.GetValue <bool>();
                dmgAfterComboItem.ValueChanged           += delegate(object sender, OnValueChangeEventArgs eventArgs)
                {
                    Utility.HpBarDamageIndicator.Enabled = eventArgs.GetNewValue <bool>();
                };
            }

            Config.AddToMainMenu();

            Game.OnGameUpdate += Game_OnGameUpdate;
            {
                Drawing.OnDraw      += Drawing_OnDraw;
                GameObject.OnCreate += GameObject_OnCreate;
                GameObject.OnDelete += GameObject_OnDelete;
                Interrupter.OnPossibleToInterrupt += Interrupter_OnPosibleToInterrupt;
            }

            Game.PrintChat(
                String.Format(
                    "<font color='#70DBDB'>xQx</font> <font color='#FFFFFF'>{0}</font> <font color='#70DBDB'>Loaded!</font>",
                    ChampionName));
        }
Exemplo n.º 58
0
        /// <summary>
        /// Creates the menu if it doesn't exist yet and sets the event handlers.
        /// </summary>
        public void CreateMenu()
        {
            menu = new Menu(Game.Player.Name, "weapon loadouts management");

            MenuController.AddSubmenu(menu, SavedLoadoutsMenu);
            MenuController.AddSubmenu(SavedLoadoutsMenu, ManageLoadoutMenu);

            MenuItem saveLoadout          = new MenuItem("Save Loadout", "Save your current weapons into a new loadout slot.");
            MenuItem savedLoadoutsMenuBtn = new MenuItem("Manage Loadouts", "Manage saved weapon loadouts.")
            {
                Label = "→→→"
            };
            MenuCheckboxItem enableDefaultLoadouts = new MenuCheckboxItem("Restore Default Loadout On Respawn", "If you've set a loadout as default loadout, then your loadout will be equipped automatically whenever you (re)spawn.", WeaponLoadoutsSetLoadoutOnRespawn);

            menu.AddMenuItem(saveLoadout);
            menu.AddMenuItem(savedLoadoutsMenuBtn);
            MenuController.BindMenuItem(menu, SavedLoadoutsMenu, savedLoadoutsMenuBtn);
            if (IsAllowed(Permission.WLEquipOnRespawn))
            {
                menu.AddMenuItem(enableDefaultLoadouts);

                menu.OnCheckboxChange += (sender, checkbox, index, _checked) =>
                {
                    WeaponLoadoutsSetLoadoutOnRespawn = _checked;
                };
            }


            void RefreshSavedWeaponsMenu()
            {
                int oldCount = SavedLoadoutsMenu.Size;

                SavedLoadoutsMenu.ClearMenuItems(true);

                RefreshSavedWeaponsList();

                foreach (var sw in SavedWeapons)
                {
                    MenuItem btn = new MenuItem(sw.Key.Replace("vmenu_string_saved_weapon_loadout_", ""), "Click to manage this loadout.")
                    {
                        Label = "→→→"
                    };
                    SavedLoadoutsMenu.AddMenuItem(btn);
                    MenuController.BindMenuItem(SavedLoadoutsMenu, ManageLoadoutMenu, btn);
                }

                if (oldCount > SavedWeapons.Count)
                {
                    SavedLoadoutsMenu.RefreshIndex();
                }
            }

            MenuItem spawnLoadout      = new MenuItem("Equip Loadout", "Spawn this saved weapons loadout. This will remove all your current weapons and replace them with this saved slot.");
            MenuItem renameLoadout     = new MenuItem("Rename Loadout", "Rename this saved loadout.");
            MenuItem cloneLoadout      = new MenuItem("Clone Loadout", "Clones this saved loadout to a new slot.");
            MenuItem setDefaultLoadout = new MenuItem("Set As Default Loadout", "Set this loadout to be your default loadout for whenever you (re)spawn. This will override the 'Restore Weapons' option inside the Misc Settings menu. You can toggle this option in the main Weapon Loadouts menu.");
            MenuItem replaceLoadout    = new MenuItem("~r~Replace Loadout", "~r~This replaces this saved slot with the weapons that you currently have in your inventory. This action can not be undone!");
            MenuItem deleteLoadout     = new MenuItem("~r~Delete Loadout", "~r~This will delete this saved loadout. This action can not be undone!");

            if (IsAllowed(Permission.WLEquip))
            {
                ManageLoadoutMenu.AddMenuItem(spawnLoadout);
            }
            ManageLoadoutMenu.AddMenuItem(renameLoadout);
            ManageLoadoutMenu.AddMenuItem(cloneLoadout);
            ManageLoadoutMenu.AddMenuItem(setDefaultLoadout);
            ManageLoadoutMenu.AddMenuItem(replaceLoadout);
            ManageLoadoutMenu.AddMenuItem(deleteLoadout);

            // Save the weapons loadout.
            menu.OnItemSelect += async(sender, item, index) =>
            {
                if (item == saveLoadout)
                {
                    string name = await GetUserInput("Enter a save name", 30);

                    if (string.IsNullOrEmpty(name))
                    {
                        Notify.Error(CommonErrors.InvalidInput);
                    }
                    else
                    {
                        if (SavedWeapons.ContainsKey("vmenu_string_saved_weapon_loadout_" + name))
                        {
                            Notify.Error(CommonErrors.SaveNameAlreadyExists);
                        }
                        else
                        {
                            if (SaveWeaponLoadout("vmenu_string_saved_weapon_loadout_" + name))
                            {
                                Log("saveweapons called from menu select (save loadout button)");
                                Notify.Success($"Your weapons have been saved as ~g~<C>{name}</C>~s~.");
                            }
                            else
                            {
                                Notify.Error(CommonErrors.UnknownError);
                            }
                        }
                    }
                }
            };

            // manage spawning, renaming, deleting etc.
            ManageLoadoutMenu.OnItemSelect += async(sender, item, index) =>
            {
                if (SavedWeapons.ContainsKey(SelectedSavedLoadoutName))
                {
                    List <ValidWeapon> weapons = SavedWeapons[SelectedSavedLoadoutName];

                    if (item == spawnLoadout) // spawn
                    {
                        await SpawnWeaponLoadoutAsync(SelectedSavedLoadoutName, false, true);
                    }
                    else if (item == renameLoadout || item == cloneLoadout) // rename or clone
                    {
                        string newName = await GetUserInput("Enter a save name", SelectedSavedLoadoutName.Replace("vmenu_string_saved_weapon_loadout_", ""), 30);

                        if (string.IsNullOrEmpty(newName))
                        {
                            Notify.Error(CommonErrors.InvalidInput);
                        }
                        else
                        {
                            if (SavedWeapons.ContainsKey("vmenu_string_saved_weapon_loadout_" + newName))
                            {
                                Notify.Error(CommonErrors.SaveNameAlreadyExists);
                            }
                            else
                            {
                                SetResourceKvp("vmenu_string_saved_weapon_loadout_" + newName, JsonConvert.SerializeObject(weapons));
                                Notify.Success($"Your weapons loadout has been {(item == renameLoadout ? "renamed" : "cloned")} to ~g~<C>{newName}</C>~s~.");

                                if (item == renameLoadout)
                                {
                                    DeleteResourceKvp(SelectedSavedLoadoutName);
                                }

                                ManageLoadoutMenu.GoBack();
                            }
                        }
                    }
                    else if (item == setDefaultLoadout) // set as default
                    {
                        SetResourceKvp("vmenu_string_default_loadout", SelectedSavedLoadoutName);
                        Notify.Success("This is now your default loadout.");
                        item.LeftIcon = MenuItem.Icon.TICK;
                    }
                    else if (item == replaceLoadout) // replace
                    {
                        if (replaceLoadout.Label == "Are you sure?")
                        {
                            replaceLoadout.Label = "";
                            SaveWeaponLoadout(SelectedSavedLoadoutName);
                            Log("save weapons called from replace loadout");
                            Notify.Success("Your saved loadout has been replaced with your current weapons.");
                        }
                        else
                        {
                            replaceLoadout.Label = "Are you sure?";
                        }
                    }
                    else if (item == deleteLoadout) // delete
                    {
                        if (deleteLoadout.Label == "Are you sure?")
                        {
                            deleteLoadout.Label = "";
                            DeleteResourceKvp(SelectedSavedLoadoutName);
                            ManageLoadoutMenu.GoBack();
                            Notify.Success("Your saved loadout has been deleted.");
                        }
                        else
                        {
                            deleteLoadout.Label = "Are you sure?";
                        }
                    }
                }
            };

            // Reset the 'are you sure' states.
            ManageLoadoutMenu.OnMenuClose += (sender) =>
            {
                deleteLoadout.Label = "";
                renameLoadout.Label = "";
            };
            // Reset the 'are you sure' states.
            ManageLoadoutMenu.OnIndexChange += (sender, oldItem, newItem, oldIndex, newIndex) =>
            {
                deleteLoadout.Label = "";
                renameLoadout.Label = "";
            };

            // Refresh the spawned weapons menu whenever this menu is opened.
            SavedLoadoutsMenu.OnMenuOpen += (sender) =>
            {
                RefreshSavedWeaponsMenu();
            };

            // Set the current saved loadout whenever a loadout is selected.
            SavedLoadoutsMenu.OnItemSelect += (sender, item, index) =>
            {
                if (SavedWeapons.ContainsKey("vmenu_string_saved_weapon_loadout_" + item.Text))
                {
                    SelectedSavedLoadoutName = "vmenu_string_saved_weapon_loadout_" + item.Text;
                }
                else // shouldn't ever happen, but just in case
                {
                    ManageLoadoutMenu.GoBack();
                }
            };

            // Reset the index whenever the ManageLoadout menu is opened. Just to prevent auto selecting the delete option for example.
            ManageLoadoutMenu.OnMenuOpen += (sender) =>
            {
                ManageLoadoutMenu.RefreshIndex();
                string kvp = GetResourceKvpString("vmenu_string_default_loadout");
                if (string.IsNullOrEmpty(kvp) || kvp != SelectedSavedLoadoutName)
                {
                    setDefaultLoadout.LeftIcon = MenuItem.Icon.NONE;
                }
                else
                {
                    setDefaultLoadout.LeftIcon = MenuItem.Icon.TICK;
                }
            };

            // Refresh the saved weapons menu.
            RefreshSavedWeaponsMenu();
        }
Exemplo n.º 59
0
        private void Game_OnPing(TacticalMapPingEventArgs args)
        {
            try
            {
                GameObject   srcObject = args.Source;
                AIHeroClient src       = srcObject as AIHeroClient;
                if (src == null)
                {
                    return;
                }
                MenuItem blockItem = _menu.Item(src.Name);
                if (blockItem != null && blockItem.GetValue <bool>())
                {
                    args.Process = false;
                    return;
                }
                GameObject target = args.Target;
                if (args.PingType == PingCategory.OnMyWay || !src.IsValid)
                {
                    return;
                }
                Color c = Color.White;
                switch (args.PingType)
                {
                case PingCategory.Fallback:
                case PingCategory.EnemyMissing:
                    c = Color.LightYellow;
                    break;

                case PingCategory.AssistMe:
                    c = Color.LightBlue;
                    break;

                case PingCategory.Danger:
                    c = new Color(255, 204, 203);
                    break;
                }

                int    selectedIndex = _menu.Item("print").GetValue <StringList>().SelectedIndex;
                String name;
                switch (selectedIndex)
                {
                case 0:
                    name = src.ChampionName;
                    break;

                case 1:
                    name = src.Name;
                    break;

                default:
                    name = src.Name + " (" + src.ChampionName + ")";
                    break;
                }
                _pings.Add(new Ping(name, Game.Time + 2f, args.Position.X, args.Position.Y, target, c));
            }

            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 60
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     this.profilingActiveCheckBox = new System.Windows.Forms.CheckBox();
     this.openFileDialog          = new System.Windows.Forms.OpenFileDialog();
     this.groupBox1                  = new System.Windows.Forms.GroupBox();
     this.callsCheckBox              = new System.Windows.Forms.CheckBox();
     this.allocationsCheckBox        = new System.Windows.Forms.CheckBox();
     this.logFileOpenMenuItem        = new System.Windows.Forms.MenuItem();
     this.setCommandLineMenuItem     = new System.Windows.Forms.MenuItem();
     this.profileApplicationMenuItem = new System.Windows.Forms.MenuItem();
     this.profileASP_NETmenuItem     = new System.Windows.Forms.MenuItem();
     this.killApplicationButton      = new System.Windows.Forms.Button();
     this.startApplicationButton     = new System.Windows.Forms.Button();
     this.checkProcessTimer          = new System.Windows.Forms.Timer(this.components);
     this.fontMenuItem               = new System.Windows.Forms.MenuItem();
     this.label1    = new System.Windows.Forms.Label();
     this.mainMenu  = new System.Windows.Forms.MainMenu(this.components);
     this.menuItem1 = new System.Windows.Forms.MenuItem();
     this.menuStartWindowsStoreApp = new System.Windows.Forms.MenuItem();
     this.startURLMenuItem         = new System.Windows.Forms.MenuItem();
     this.attachProcessMenuItem    = new System.Windows.Forms.MenuItem();
     this.detachProcessMenuItem    = new System.Windows.Forms.MenuItem();
     this.profileServiceMenuItem   = new System.Windows.Forms.MenuItem();
     this.saveAsMenuItem           = new System.Windows.Forms.MenuItem();
     this.menuItem3                              = new System.Windows.Forms.MenuItem();
     this.exitMenuItem                           = new System.Windows.Forms.MenuItem();
     this.menuItem5                              = new System.Windows.Forms.MenuItem();
     this.menuItem8                              = new System.Windows.Forms.MenuItem();
     this.viewSummaryMenuItem                    = new System.Windows.Forms.MenuItem();
     this.viewHistogramAllocatedMenuItem         = new System.Windows.Forms.MenuItem();
     this.viewHistogramRelocatedMenuItem         = new System.Windows.Forms.MenuItem();
     this.viewHistogramFinalizerMenuItem         = new System.Windows.Forms.MenuItem();
     this.viewHistogramCriticalFinalizerMenuItem = new System.Windows.Forms.MenuItem();
     this.viewObjectsByAddressMenuItem           = new System.Windows.Forms.MenuItem();
     this.viewHistogramByAgeMenuItem             = new System.Windows.Forms.MenuItem();
     this.viewAllocationGraphMenuItem            = new System.Windows.Forms.MenuItem();
     this.viewAssemblyGraphMenuItem              = new System.Windows.Forms.MenuItem();
     this.viewFunctionGraphMenuItem              = new System.Windows.Forms.MenuItem();
     this.viewModuleGraphMenuItem                = new System.Windows.Forms.MenuItem();
     this.viewClassGraphMenuItem                 = new System.Windows.Forms.MenuItem();
     this.viewHeapGraphMenuItem                  = new System.Windows.Forms.MenuItem();
     this.viewCallGraphMenuItem                  = new System.Windows.Forms.MenuItem();
     this.viewTimeLineMenuItem                   = new System.Windows.Forms.MenuItem();
     this.viewCommentsMenuItem                   = new System.Windows.Forms.MenuItem();
     this.viewCallTreeMenuItem                   = new System.Windows.Forms.MenuItem();
     this.menuItem2                              = new System.Windows.Forms.MenuItem();
     this.viewComparisonMenuItem                 = new System.Windows.Forms.MenuItem();
     this.showHeapButton                         = new System.Windows.Forms.Button();
     this.fontDialog                             = new System.Windows.Forms.FontDialog();
     this.saveFileDialog                         = new System.Windows.Forms.SaveFileDialog();
     this.attachProcessButton                    = new System.Windows.Forms.Button();
     this.groupBox2                              = new System.Windows.Forms.GroupBox();
     this.targetCLRVersioncomboBox               = new System.Windows.Forms.ComboBox();
     this.label2 = new System.Windows.Forms.Label();
     this.detachProcessButton        = new System.Windows.Forms.Button();
     this.startURLButton             = new System.Windows.Forms.Button();
     this.startWindowsStoreAppButton = new System.Windows.Forms.Button();
     this.groupBox1.SuspendLayout();
     this.groupBox2.SuspendLayout();
     this.SuspendLayout();
     //
     // profilingActiveCheckBox
     //
     this.profilingActiveCheckBox.Checked         = true;
     this.profilingActiveCheckBox.CheckState      = System.Windows.Forms.CheckState.Checked;
     this.profilingActiveCheckBox.Location        = new System.Drawing.Point(198, 15);
     this.profilingActiveCheckBox.Name            = "profilingActiveCheckBox";
     this.profilingActiveCheckBox.Size            = new System.Drawing.Size(123, 24);
     this.profilingActiveCheckBox.TabIndex        = 7;
     this.profilingActiveCheckBox.Text            = "Profiling active";
     this.profilingActiveCheckBox.CheckedChanged += new System.EventHandler(this.profilingActiveCheckBox_CheckedChanged);
     //
     // groupBox1
     //
     this.groupBox1.Controls.Add(this.callsCheckBox);
     this.groupBox1.Controls.Add(this.allocationsCheckBox);
     this.groupBox1.Location = new System.Drawing.Point(193, 66);
     this.groupBox1.Name     = "groupBox1";
     this.groupBox1.Size     = new System.Drawing.Size(133, 57);
     this.groupBox1.TabIndex = 7;
     this.groupBox1.TabStop  = false;
     //
     // callsCheckBox
     //
     this.callsCheckBox.Location        = new System.Drawing.Point(16, 32);
     this.callsCheckBox.Name            = "callsCheckBox";
     this.callsCheckBox.Size            = new System.Drawing.Size(94, 18);
     this.callsCheckBox.TabIndex        = 9;
     this.callsCheckBox.Text            = "Calls";
     this.callsCheckBox.CheckedChanged += new System.EventHandler(this.callsCheckBox_CheckedChanged);
     //
     // allocationsCheckBox
     //
     this.allocationsCheckBox.Location        = new System.Drawing.Point(16, 15);
     this.allocationsCheckBox.Name            = "allocationsCheckBox";
     this.allocationsCheckBox.Size            = new System.Drawing.Size(90, 20);
     this.allocationsCheckBox.TabIndex        = 8;
     this.allocationsCheckBox.Text            = "Allocations";
     this.allocationsCheckBox.CheckedChanged += new System.EventHandler(this.allocationsCheckBox_CheckedChanged);
     //
     // logFileOpenMenuItem
     //
     this.logFileOpenMenuItem.Index    = 0;
     this.logFileOpenMenuItem.Shortcut = System.Windows.Forms.Shortcut.CtrlO;
     this.logFileOpenMenuItem.Text     = "Open Log File...";
     this.logFileOpenMenuItem.Click   += new System.EventHandler(this.fileOpenMenuItem_Click);
     //
     // setCommandLineMenuItem
     //
     this.setCommandLineMenuItem.Index  = 9;
     this.setCommandLineMenuItem.Text   = "Set Parameters...";
     this.setCommandLineMenuItem.Click += new System.EventHandler(this.setCommandLineMenuItem_Click);
     //
     // profileApplicationMenuItem
     //
     this.profileApplicationMenuItem.Index  = 1;
     this.profileApplicationMenuItem.Text   = "Profile Application...";
     this.profileApplicationMenuItem.Click += new System.EventHandler(this.profileApplicationMenuItem_Click);
     //
     // profileASP_NETmenuItem
     //
     this.profileASP_NETmenuItem.Index  = 6;
     this.profileASP_NETmenuItem.Text   = "Profile ASP.NET";
     this.profileASP_NETmenuItem.Click += new System.EventHandler(this.profileASP_NETmenuItem_Click);
     //
     // killApplicationButton
     //
     this.killApplicationButton.Location = new System.Drawing.Point(15, 147);
     this.killApplicationButton.Name     = "killApplicationButton";
     this.killApplicationButton.Size     = new System.Drawing.Size(164, 24);
     this.killApplicationButton.TabIndex = 5;
     this.killApplicationButton.Text     = "Kill Application";
     this.killApplicationButton.Click   += new System.EventHandler(this.killApplicationButton_Click);
     //
     // startApplicationButton
     //
     this.startApplicationButton.Location = new System.Drawing.Point(15, 12);
     this.startApplicationButton.Name     = "startApplicationButton";
     this.startApplicationButton.Size     = new System.Drawing.Size(164, 24);
     this.startApplicationButton.TabIndex = 1;
     this.startApplicationButton.Text     = "Start Desktop App...";
     this.startApplicationButton.Click   += new System.EventHandler(this.startApplicationButton_Click);
     //
     // checkProcessTimer
     //
     this.checkProcessTimer.Enabled = true;
     this.checkProcessTimer.Tick   += new System.EventHandler(this.checkProcessTimer_Tick);
     //
     // fontMenuItem
     //
     this.fontMenuItem.Index  = 0;
     this.fontMenuItem.Text   = "Font...";
     this.fontMenuItem.Click += new System.EventHandler(this.fontMenuItem_Click);
     //
     // label1
     //
     this.label1.Location = new System.Drawing.Point(201, 66);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(40, 16);
     this.label1.TabIndex = 6;
     this.label1.Text     = "Profile:";
     //
     // mainMenu
     //
     this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuItem1,
         this.menuItem5,
         this.menuItem8
     });
     //
     // menuItem1
     //
     this.menuItem1.Index = 0;
     this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.logFileOpenMenuItem,
         this.profileApplicationMenuItem,
         this.menuStartWindowsStoreApp,
         this.startURLMenuItem,
         this.attachProcessMenuItem,
         this.detachProcessMenuItem,
         this.profileASP_NETmenuItem,
         this.profileServiceMenuItem,
         this.saveAsMenuItem,
         this.setCommandLineMenuItem,
         this.menuItem3,
         this.exitMenuItem
     });
     this.menuItem1.Text = "File";
     //
     // menuStartWindowsStoreApp
     //
     this.menuStartWindowsStoreApp.Index  = 2;
     this.menuStartWindowsStoreApp.Text   = "Profile Windows Store Application...";
     this.menuStartWindowsStoreApp.Click += new System.EventHandler(this.menuStartWindowsStoreApp_Click);
     //
     // startURLMenuItem
     //
     this.startURLMenuItem.Index  = 3;
     this.startURLMenuItem.Text   = "Start URL...";
     this.startURLMenuItem.Click += new System.EventHandler(this.startURLMenuItem_Click);
     //
     // attachProcessMenuItem
     //
     this.attachProcessMenuItem.Index  = 4;
     this.attachProcessMenuItem.Text   = "Attach Process...";
     this.attachProcessMenuItem.Click += new System.EventHandler(this.attachProcessMenuItem_Click);
     //
     // detachProcessMenuItem
     //
     this.detachProcessMenuItem.Enabled = false;
     this.detachProcessMenuItem.Index   = 5;
     this.detachProcessMenuItem.Text    = "Detach Process";
     this.detachProcessMenuItem.Click  += new System.EventHandler(this.detachProcessMenuItem_Click);
     //
     // profileServiceMenuItem
     //
     this.profileServiceMenuItem.Index  = 7;
     this.profileServiceMenuItem.Text   = "Profile Service...";
     this.profileServiceMenuItem.Click += new System.EventHandler(this.profileServiceMenuItem_Click);
     //
     // saveAsMenuItem
     //
     this.saveAsMenuItem.Enabled  = false;
     this.saveAsMenuItem.Index    = 8;
     this.saveAsMenuItem.Shortcut = System.Windows.Forms.Shortcut.CtrlS;
     this.saveAsMenuItem.Text     = "Save Profile As...";
     this.saveAsMenuItem.Click   += new System.EventHandler(this.saveAsMenuItem_Click);
     //
     // menuItem3
     //
     this.menuItem3.Index = 10;
     this.menuItem3.Text  = "-";
     //
     // exitMenuItem
     //
     this.exitMenuItem.Index  = 11;
     this.exitMenuItem.Text   = "Exit";
     this.exitMenuItem.Click += new System.EventHandler(this.exitMenuItem_Click);
     //
     // menuItem5
     //
     this.menuItem5.Index = 1;
     this.menuItem5.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.fontMenuItem
     });
     this.menuItem5.Text = "Edit";
     //
     // menuItem8
     //
     this.menuItem8.Index = 2;
     this.menuItem8.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.viewSummaryMenuItem,
         this.viewHistogramAllocatedMenuItem,
         this.viewHistogramRelocatedMenuItem,
         this.viewHistogramFinalizerMenuItem,
         this.viewHistogramCriticalFinalizerMenuItem,
         this.viewObjectsByAddressMenuItem,
         this.viewHistogramByAgeMenuItem,
         this.viewAllocationGraphMenuItem,
         this.viewAssemblyGraphMenuItem,
         this.viewFunctionGraphMenuItem,
         this.viewModuleGraphMenuItem,
         this.viewClassGraphMenuItem,
         this.viewHeapGraphMenuItem,
         this.viewCallGraphMenuItem,
         this.viewTimeLineMenuItem,
         this.viewCommentsMenuItem,
         this.viewCallTreeMenuItem,
         this.menuItem2,
         this.viewComparisonMenuItem
     });
     this.menuItem8.Text = "View";
     //
     // viewSummaryMenuItem
     //
     this.viewSummaryMenuItem.Index  = 0;
     this.viewSummaryMenuItem.Text   = "Summary";
     this.viewSummaryMenuItem.Click += new System.EventHandler(this.viewSummaryMenuItem_Click);
     //
     // viewHistogramAllocatedMenuItem
     //
     this.viewHistogramAllocatedMenuItem.Index  = 1;
     this.viewHistogramAllocatedMenuItem.Text   = "Histogram Allocated Types";
     this.viewHistogramAllocatedMenuItem.Click += new System.EventHandler(this.viewHistogram_Click);
     //
     // viewHistogramRelocatedMenuItem
     //
     this.viewHistogramRelocatedMenuItem.Index  = 2;
     this.viewHistogramRelocatedMenuItem.Text   = "Histogram Relocated Types";
     this.viewHistogramRelocatedMenuItem.Click += new System.EventHandler(this.viewHistogramRelocatedMenuItem_Click);
     //
     // viewHistogramFinalizerMenuItem
     //
     this.viewHistogramFinalizerMenuItem.Index  = 3;
     this.viewHistogramFinalizerMenuItem.Text   = "Histogram Finalized Types";
     this.viewHistogramFinalizerMenuItem.Click += new System.EventHandler(this.viewHistogramFinalizerMenuItem_Click);
     //
     // viewHistogramCriticalFinalizerMenuItem
     //
     this.viewHistogramCriticalFinalizerMenuItem.Index  = 4;
     this.viewHistogramCriticalFinalizerMenuItem.Text   = "Histogram Critical Finalized Types";
     this.viewHistogramCriticalFinalizerMenuItem.Click += new System.EventHandler(this.viewHistogramCriticalFinalizerMenuItem_Click);
     //
     // viewObjectsByAddressMenuItem
     //
     this.viewObjectsByAddressMenuItem.Index  = 5;
     this.viewObjectsByAddressMenuItem.Text   = "Objects by Address";
     this.viewObjectsByAddressMenuItem.Click += new System.EventHandler(this.viewByAddressMenuItem_Click);
     //
     // viewHistogramByAgeMenuItem
     //
     this.viewHistogramByAgeMenuItem.Index  = 6;
     this.viewHistogramByAgeMenuItem.Text   = "Histogram by Age";
     this.viewHistogramByAgeMenuItem.Click += new System.EventHandler(this.viewAgeHistogram_Click);
     //
     // viewAllocationGraphMenuItem
     //
     this.viewAllocationGraphMenuItem.Index  = 7;
     this.viewAllocationGraphMenuItem.Text   = "Allocation Graph";
     this.viewAllocationGraphMenuItem.Click += new System.EventHandler(this.viewAllocationGraphmenuItem_Click);
     //
     // viewAssemblyGraphMenuItem
     //
     this.viewAssemblyGraphMenuItem.Index  = 8;
     this.viewAssemblyGraphMenuItem.Text   = "Assembly Graph";
     this.viewAssemblyGraphMenuItem.Click += new System.EventHandler(this.viewAssemblyGraphmenuItem_Click);
     //
     // viewFunctionGraphMenuItem
     //
     this.viewFunctionGraphMenuItem.Index  = 9;
     this.viewFunctionGraphMenuItem.Text   = "Function Graph";
     this.viewFunctionGraphMenuItem.Click += new System.EventHandler(this.viewFunctionGraphMenuItem_Click);
     //
     // viewModuleGraphMenuItem
     //
     this.viewModuleGraphMenuItem.Index  = 10;
     this.viewModuleGraphMenuItem.Text   = "Module Graph";
     this.viewModuleGraphMenuItem.Click += new System.EventHandler(this.viewModuleGraphMenuItem_Click);
     //
     // viewClassGraphMenuItem
     //
     this.viewClassGraphMenuItem.Index  = 11;
     this.viewClassGraphMenuItem.Text   = "Class Graph";
     this.viewClassGraphMenuItem.Click += new System.EventHandler(this.viewClassGraphMenuItem_Click);
     //
     // viewHeapGraphMenuItem
     //
     this.viewHeapGraphMenuItem.Index  = 12;
     this.viewHeapGraphMenuItem.Text   = "Heap Graph";
     this.viewHeapGraphMenuItem.Click += new System.EventHandler(this.viewHeapGraphMenuItem_Click);
     //
     // viewCallGraphMenuItem
     //
     this.viewCallGraphMenuItem.Index  = 13;
     this.viewCallGraphMenuItem.Text   = "Call Graph";
     this.viewCallGraphMenuItem.Click += new System.EventHandler(this.viewCallGraphMenuItem_Click);
     //
     // viewTimeLineMenuItem
     //
     this.viewTimeLineMenuItem.Index  = 14;
     this.viewTimeLineMenuItem.Text   = "Time Line";
     this.viewTimeLineMenuItem.Click += new System.EventHandler(this.viewTimeLineMenuItem_Click);
     //
     // viewCommentsMenuItem
     //
     this.viewCommentsMenuItem.Index  = 15;
     this.viewCommentsMenuItem.Text   = "Comments";
     this.viewCommentsMenuItem.Click += new System.EventHandler(this.viewCommentsMenuItem_Click);
     //
     // viewCallTreeMenuItem
     //
     this.viewCallTreeMenuItem.Index  = 16;
     this.viewCallTreeMenuItem.Text   = "Call Tree";
     this.viewCallTreeMenuItem.Click += new System.EventHandler(this.viewCallTreeMenuItem_Click);
     //
     // menuItem2
     //
     this.menuItem2.Index = 17;
     this.menuItem2.Text  = "-----------------------------";
     //
     // viewComparisonMenuItem
     //
     this.viewComparisonMenuItem.Index  = 18;
     this.viewComparisonMenuItem.Text   = "Comparison with ...";
     this.viewComparisonMenuItem.Click += new System.EventHandler(this.viewComparisonMenuItem_Click);
     //
     // showHeapButton
     //
     this.showHeapButton.Location = new System.Drawing.Point(15, 174);
     this.showHeapButton.Name     = "showHeapButton";
     this.showHeapButton.Size     = new System.Drawing.Size(164, 24);
     this.showHeapButton.TabIndex = 6;
     this.showHeapButton.Text     = "Show Heap now";
     this.showHeapButton.Click   += new System.EventHandler(this.showHeapButton_Click);
     //
     // fontDialog
     //
     this.fontDialog.Color = System.Drawing.SystemColors.ControlText;
     //
     // saveFileDialog
     //
     this.saveFileDialog.FileName = "doc1";
     //
     // attachProcessButton
     //
     this.attachProcessButton.Location = new System.Drawing.Point(15, 93);
     this.attachProcessButton.Name     = "attachProcessButton";
     this.attachProcessButton.Size     = new System.Drawing.Size(164, 24);
     this.attachProcessButton.TabIndex = 3;
     this.attachProcessButton.Text     = "Attach Process...";
     this.attachProcessButton.UseVisualStyleBackColor = true;
     this.attachProcessButton.Click += new System.EventHandler(this.attachProcessButton_Click);
     //
     // groupBox2
     //
     this.groupBox2.Controls.Add(this.targetCLRVersioncomboBox);
     this.groupBox2.Controls.Add(this.label2);
     this.groupBox2.Location = new System.Drawing.Point(194, 144);
     this.groupBox2.Name     = "groupBox2";
     this.groupBox2.Size     = new System.Drawing.Size(132, 54);
     this.groupBox2.TabIndex = 11;
     this.groupBox2.TabStop  = false;
     //
     // targetCLRVersioncomboBox
     //
     this.targetCLRVersioncomboBox.DropDownStyle     = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.targetCLRVersioncomboBox.FormattingEnabled = true;
     this.targetCLRVersioncomboBox.Items.AddRange(new object[] {
         "V4 Desktop CLR",
         "V4 Core CLR",
         "V2 Desktop CLR"
     });
     this.targetCLRVersioncomboBox.Location              = new System.Drawing.Point(7, 22);
     this.targetCLRVersioncomboBox.Name                  = "targetCLRVersioncomboBox";
     this.targetCLRVersioncomboBox.Size                  = new System.Drawing.Size(114, 21);
     this.targetCLRVersioncomboBox.TabIndex              = 10;
     this.targetCLRVersioncomboBox.SelectedIndexChanged += new System.EventHandler(this.targetCLRVersioncomboBox_SelectedIndexChanged);
     //
     // label2
     //
     this.label2.Location = new System.Drawing.Point(6, 0);
     this.label2.Name     = "label2";
     this.label2.Size     = new System.Drawing.Size(120, 19);
     this.label2.TabIndex = 12;
     this.label2.Text     = "Target CLR Version:";
     //
     // detachProcessButton
     //
     this.detachProcessButton.Enabled  = false;
     this.detachProcessButton.Location = new System.Drawing.Point(15, 120);
     this.detachProcessButton.Name     = "detachProcessButton";
     this.detachProcessButton.Size     = new System.Drawing.Size(164, 24);
     this.detachProcessButton.TabIndex = 4;
     this.detachProcessButton.Text     = "Detach Process";
     this.detachProcessButton.UseVisualStyleBackColor = true;
     this.detachProcessButton.Click += new System.EventHandler(this.detachProcessButton_Click);
     //
     // startURLButton
     //
     this.startURLButton.Location = new System.Drawing.Point(15, 66);
     this.startURLButton.Name     = "startURLButton";
     this.startURLButton.Size     = new System.Drawing.Size(164, 24);
     this.startURLButton.TabIndex = 2;
     this.startURLButton.Text     = "Start URL...";
     this.startURLButton.Click   += new System.EventHandler(this.startURLButton_Click);
     //
     // startWindowsStoreAppButton
     //
     this.startWindowsStoreAppButton.Location = new System.Drawing.Point(15, 39);
     this.startWindowsStoreAppButton.Name     = "startWindowsStoreAppButton";
     this.startWindowsStoreAppButton.Size     = new System.Drawing.Size(164, 24);
     this.startWindowsStoreAppButton.TabIndex = 12;
     this.startWindowsStoreAppButton.Text     = "Start Windows Store App...";
     this.startWindowsStoreAppButton.Click   += new System.EventHandler(this.startWindowsStoreAppButton_Click);
     //
     // MainForm
     //
     this.ClientSize = new System.Drawing.Size(341, 208);
     this.Controls.Add(this.startWindowsStoreAppButton);
     this.Controls.Add(this.startURLButton);
     this.Controls.Add(this.detachProcessButton);
     this.Controls.Add(this.groupBox2);
     this.Controls.Add(this.attachProcessButton);
     this.Controls.Add(this.showHeapButton);
     this.Controls.Add(this.profilingActiveCheckBox);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.groupBox1);
     this.Controls.Add(this.killApplicationButton);
     this.Controls.Add(this.startApplicationButton);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
     this.MaximizeBox     = false;
     this.Menu            = this.mainMenu;
     this.Name            = "MainForm";
     this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text            = "CLR Profiler";
     this.Closing        += new System.ComponentModel.CancelEventHandler(this.Form1_Closing);
     this.groupBox1.ResumeLayout(false);
     this.groupBox2.ResumeLayout(false);
     this.ResumeLayout(false);
 }