コード例 #1
0
ファイル: Cheats.cs プロジェクト: ihatevim/Divine.Plugins
        public void Activate()
        {
            this.menu = this.mainMenu.CheatsMenu;

            this.refresh = this.menu.CreateHoldKey("Refresh", Key.NumPad3);
            this.refresh.ValueChanged += this.RefreshOnPropertyChanged;

            this.wtf = this.menu.CreateHoldKey("Change wtf", Key.Divide);
            this.wtf.ValueChanged += this.WtfOnPropertyChanged;

            this.vision = this.menu.CreateHoldKey("Change vision", Key.Multiply);
            this.vision.ValueChanged += this.VisionOnPropertyChanged;
            this.allVisionEnabled     = ConVarManager.GetInt32("dota_all_vision") == 1;

            this.creeps = this.menu.CreateHoldKey("Change creeps spawn", Key.NumPad0);
            this.creeps.ValueChanged += this.CreepsOnPropertyChanged;

            this.hero25Lvl = this.menu.CreateHoldKey("Hero 25lvl", Key.NumPad1);
            this.hero25Lvl.ValueChanged += this.Hero25LvlOnPropertyChanged;

            this.heroGold = this.menu.CreateHoldKey("Hero gold", Key.NumPad1);
            this.heroGold.ValueChanged += this.HeroGoldOnPropertyChanged;

            this.bot25Lvl = this.menu.CreateHoldKey("Bot 25lvl", Key.NumPad2);
            this.bot25Lvl.ValueChanged += this.Bot25LvlOnPropertyChanged;
        }
コード例 #2
0
        public Minimap(IHudMenu hudMenu)
        {
            var minimapSize = new Vector2(Hud.Info.ScreenSize.X * 0.127f, Hud.Info.ScreenSize.Y * 0.226f);

            if (ConVarManager.GetInt32("dota_hud_extra_large_minimap") == 1)
            {
                minimapSize *= 1.145f;
            }

            var settings = hudMenu.MinimapSettingsMenu;

            this.debug = settings.Add(new MenuSwitcher("Debug", false));
            this.debug.SetTooltip("Use this to adjust minimap position and size");
            this.debug.AddTranslation(Lang.Ru, "Проверка");
            this.debug.AddTooltipTranslation(Lang.Ru, "Использовать для настройки");
            this.debug.AddTranslation(Lang.Cn, "调试");
            this.debug.AddTooltipTranslation(Lang.Cn, "使用它来调整小地图的位置和大小");
            this.debug.DisableSave();

            this.xPosition = settings.Add(new MenuSlider("X coordinate", "x", 0, 0, (int)Hud.Info.ScreenSize.X));
            this.xPosition.AddTranslation(Lang.Ru, "X координата");
            this.xPosition.AddTranslation(Lang.Cn, "X位置");

            this.yPosition = settings.Add(
                new MenuSlider("Y coordinate", "y", (int)(Hud.Info.ScreenSize.Y - minimapSize.Y), 0, (int)Hud.Info.ScreenSize.Y));
            this.yPosition.AddTranslation(Lang.Ru, "Y координата");
            this.yPosition.AddTranslation(Lang.Cn, "Y位置");

            this.xSize = settings.Add(new MenuSlider("X Size", "xSize", (int)minimapSize.X, 0, 600));
            this.xSize.AddTranslation(Lang.Ru, "X размер");
            this.xSize.AddTranslation(Lang.Cn, "X大小");

            this.ySize = settings.Add(new MenuSlider("Y Size", "ySize", (int)minimapSize.Y, 0, 600));
            this.ySize.AddTranslation(Lang.Ru, "Y размер");
            this.ySize.AddTranslation(Lang.Cn, "Y大小");

            if (GameManager.LevelName == "maps/hero_demo_main.vpk")
            {
                this.MapLeft   = -3500;
                this.MapBottom = -3600;
                this.MapRight  = 3000;
                this.MapTop    = 2700;
            }
        }
コード例 #3
0
ファイル: ZoomHack.cs プロジェクト: ihatevim/Divine.Plugins
        private void OnInputManagerMouseWheel(MouseWheelEventArgs e)
        {
            if (ZoomKeyItem)
            {
                var zoomValue = ConVarManager.GetInt32("dota_camera_distance");

                if (e.Up)
                {
                    zoomValue -= 50;
                    zoomValue  = Math.Max(zoomValue, MinZoomValue);
                }
                else
                {
                    zoomValue += 50;
                    zoomValue  = Math.Min(zoomValue, MaxZoomValue);
                }

                ZoomSliderItem.Value = zoomValue;
            }
        }