Esempio n. 1
0
        private static void Game_OnFireEvent(FireEventEventArgs args)
        {
            if (inGame || args.GameEvent.Name != "hero_picker_shown")
            {
                return;
            }

            if (selectedLane != 0)
            {
                var team = ObjectManager.LocalPlayer.Team == Team.Radiant ? 0 : LaneList.Length - 1;
                var xy   = CoordinateMultiplayers[selectedLane - 1 + team];

                SetCursorPos((int)(HUDInfo.ScreenSizeX() * xy[0]), (int)(HUDInfo.ScreenSizeY() * xy[1]));
                mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);

                var sayTextIndex = Menu.Item(LaneList[selectedLane] + "Text").GetValue <StringList>().SelectedIndex;

                if (sayTextIndex != 0)
                {
                    Game.ExecuteCommand("say_team " + SayText[selectedLane - 1][sayTextIndex]);
                }
            }

            if (currentPair.Value != "None" && locked)
            {
                Game.ExecuteCommand("dota_select_hero " + currentPair.Value);
            }

            inGame = true;
        }
Esempio n. 2
0
        public void Activate()
        {
            var menu = this.mainMenu.OverlaySettingsMenu;

            this.itemsToSave = menu.Item("Items to save", new Slider(100, 5, 500));
            this.linesToShow = menu.Item("Lines to show", new Slider(30, 10, 50));
            this.linesToShow.PropertyChanged += this.LinesToShowOnPropertyChanged;
            this.textSize = menu.Item("Text size", new Slider(20, 10, 30));
            this.textSize.PropertyChanged += this.TextSizeOnPropertyChanged;
            this.screenSizeX = HUDInfo.ScreenSizeX();
            this.positionX   = menu.Item("Position x", new Slider((int)(this.screenSizeX * 0.75), 0, (int)this.screenSizeX));
            this.positionY   = menu.Item("Position y", new Slider(100, 0, (int)HUDInfo.ScreenSizeY()));
            this.positionY.PropertyChanged += this.PositionYOnPropertyChanged;

            this.overlayButton = new ToggleButton(
                "Hide",
                "Show",
                new Vector2(this.screenSizeX - 100, this.positionY - 50),
                new Vector2(100, 30));
            this.pauseButton = new ToggleButton(
                "Pause",
                "Continue",
                new Vector2(this.screenSizeX - 200, this.positionY - 50),
                new Vector2(100, 30));
            this.clearButton   = new Button("Clear", new Vector2(this.screenSizeX - 300, this.positionY - 50), new Vector2(100, 30));
            this.jumpTopButton = new Button("^", new Vector2(this.screenSizeX - 400, this.positionY - 50), new Vector2(100, 30));

            this.TextSizeOnPropertyChanged(null, null);

            Drawing.OnDraw += this.DrawingOnDraw;
            Game.OnWndProc += this.GameOnWndProc;
        }
Esempio n. 3
0
        private static void Drawing_OnDraw(EventArgs args)
        {
            //Color
            if (Menu.Item("Forced").GetValue <KeyBind>().Active)
            {
                Drawing.DrawText("ANTIREUSE DELIVER", new Vector2((int)HUDInfo.ScreenSizeX() / 2 - 110, 130),
                                 new Vector2(26, 26), Color.Red, FontFlags.AntiAlias | FontFlags.DropShadow | FontFlags.Outline);
            }
            if (Menu.Item("Abuse").GetValue <KeyBind>().Active)
            {
                Drawing.DrawText("BOTTLE ABUSE", new Vector2((int)HUDInfo.ScreenSizeX() / 2 - 85, 100),
                                 new Vector2(26, 26), Color.GreenYellow,
                                 FontFlags.AntiAlias | FontFlags.DropShadow | FontFlags.Outline);
            }
            if (Menu.Item("Lock").GetValue <KeyBind>().Active)
            {
                Drawing.DrawText("LOCK AT BASE", new Vector2((int)HUDInfo.ScreenSizeX() / 2 - 80, 70),
                                 new Vector2(26, 26), Color.Blue, FontFlags.AntiAlias | FontFlags.DropShadow | FontFlags.Outline);
            }
            if (Menu.Item("Secret Shop").GetValue <KeyBind>().Active)
            {
                Drawing.DrawText("SECRET SHOP", new Vector2((int)HUDInfo.ScreenSizeX() / 2 - 75, 40),
                                 new Vector2(26, 26), Color.DarkCyan,
                                 FontFlags.AntiAlias | FontFlags.DropShadow | FontFlags.Outline);
            }

            /*
             *
             *          var me = ObjectManager.LocalHero;
             *          var couriers = ObjectManager.GetEntities<Courier>().Where(x => x.IsAlive && x.Team == me.Team);
             *
             *
             *          if (Game.IsKeyDown(Menu.Item("Selection").GetValue<KeyBind>().Key) && !Game.IsChatOpen)
             *                  {
             *                  if (owned == false)
             *                          owned = true;
             *                  else owned = false;
             *                  }
             *
             *          //foreach (var courier in couriers)
             *          //var courier = ClosestToMyHero();
             *          //var courier = ClosestToMouse();
             *          if (Menu.Item("Abuse").GetValue<KeyBind>().Active)
             *          {
             *                          var courier1 =  HavingBottle();
             *                          {
             *
             *
             *                                  Vector2 screenPos;
             *                                  var pos = courier1.Position + new Vector3(0, 0, courier1.HealthBarOffset);
             *                                  Drawing.WorldToScreen(pos, out screenPos);
             *                                  var textPos = screenPos + new Vector2(-35, 52);
             *
             *                                  Drawing.DrawText("Bottle!", textPos, new Vector2(21, 22), Color.Cyan, FontFlags.AntiAlias | FontFlags.DropShadow);
             *
             *                          }
             *          }
             */
        }
Esempio n. 4
0
        /// <summary>
        ///     The execute.
        /// </summary>
        /// <param name="hero">
        ///     The hero.
        /// </param>
        /// <returns>
        ///     The <see cref="bool" />.
        /// </returns>
        public bool Execute(Hero hero)
        {
            if ((Variables.Instance.Techies.EnabledHeroes.ContainsKey(hero.ClassID) &&
                 !Variables.Instance.Techies.EnabledHeroes[hero.ClassID]) || hero.IsInvul() || hero.IsMagicImmune() ||
                hero.HasModifiers(
                    new[]
            {
                "modifier_juggernaut_blade_fury",
                "modifier_ember_spirit_sleight_of_fist_caster_invulnerability"
            },
                    false) || !hero.CanDie())
            {
                return(false);
            }

            if (!Utils.SleepCheck(hero.ClassID + "Techies.AutoDetonate"))
            {
                return(false);
            }

            var tempDamage = hero.GetStackDamage();

            if (!(tempDamage.Item1 >= hero.Health))
            {
                return(false);
            }

            if (tempDamage.Item3 != null && tempDamage.Item3.AutoDetonate)
            {
                Detonate(tempDamage.Item2);
                Utils.Sleep(500, hero.ClassID + "Techies.AutoDetonate");
                return(true);
            }

            if (tempDamage.Item3 == null || tempDamage.Item3.AutoDetonate ||
                !Variables.Menu.DrawingsMenu.Item("Techies.ShowNotification").GetValue <bool>())
            {
                return(false);
            }

            if (!Utils.SleepCheck("Techies.Notification." + hero.StoredName()))
            {
                return(false);
            }

            Utils.Sleep(15000, "Techies.Notification." + hero.StoredName());
            if (this.notification == null)
            {
                this.notification = new Notification(
                    5000,
                    new Vector2(HUDInfo.ScreenSizeX(), (float)(HUDInfo.ScreenSizeY() / 2.3)),
                    new Vector2(HUDInfo.ScreenSizeX() / 8, HUDInfo.ScreenSizeX() / 30));
            }

            this.notification.RemoteMines = tempDamage.Item2;
            this.notification.PopUp(hero);
            return(false);
        }
        static Vector2 HeroPositionOnScreen(Hero x)
        {
            float   scaleX = HUDInfo.ScreenSizeX();
            float   scaleY = HUDInfo.ScreenSizeY();
            Vector2 PicPosition;

            Drawing.WorldToScreen(x.Position, out PicPosition);
            PicPosition = new Vector2((float)(PicPosition.X + (scaleX * -0.035)), (float)((PicPosition.Y) + (scaleY * -0.10)));
            return(PicPosition);
        }
Esempio n. 6
0
        /// <summary>
        ///     The on load.
        /// </summary>
        public void OnLoad()
        {
            this.LocalTeam = new AbilityTeam(GlobalVariables.Team);
            var enemyTeam = new AbilityTeam(GlobalVariables.EnemyTeam)
            {
                OtherTeams = new List <IAbilityTeam> {
                    this.LocalTeam
                }
            };

            this.LocalTeam.OtherTeams.Add(enemyTeam);
            this.Teams = new List <IAbilityTeam> {
                this.LocalTeam, enemyTeam
            };

            // foreach (var unit in ObjectManager.GetEntities<Unit>())
            // {
            // if (!(unit is Hero) || unit.Team == GlobalVariables.EnemyTeam && !(unit is Hero)
            // || unit.ClassId == ClassId.CDOTA_BaseNPC_Creep_Lane
            // || unit.ClassId == ClassId.CDOTA_BaseNPC_Creep_Siege || unit.IsIllusion)
            // {
            // continue;
            // }

            // this.AddUnit(unit);
            // }

            // var delay = Game.GameTime < 0 ? 3000 : 500;
            // DelayAction.Add(
            // delay,
            // () =>
            // {

            // });
            foreach (var hero in Heroes.All)
            {
                this.AddUnit(hero);
            }

            var size = new Vector2((float)(HUDInfo.ScreenSizeX() / 2.3), HUDInfo.ScreenSizeY() / 2);

            this.ui =
                new AbilityManagerUserInterface(
                    new Vector2(HUDInfo.ScreenSizeX() - size.X - 10, (float)(HUDInfo.ScreenSizeY() / 2 - size.Y / 1.5)),
                    size,
                    this);

            this.TeamAdd.Next(this.LocalTeam);
            this.TeamAdd.Next(enemyTeam);
            ObjectManager.OnAddEntity    += this.OnAddEntity;
            ObjectManager.OnRemoveEntity += this.OnRemoveEntity;

            // Game.OnUpdate += this.Game_OnUpdate;
            // Drawing.OnDraw += this.Drawing_OnDraw;
        }
Esempio n. 7
0
        private static void Drawing_OnEndScene(EventArgs args)
        {
            if (inGame || SelectedLane == 0 || Drawing.Direct3DDevice9 == null)
            {
                return;
            }

            textFont.DrawText(null,
                              LaneList[SelectedLane],
                              (int)(HUDInfo.ScreenSizeX() * 0.01),
                              (int)(HUDInfo.ScreenSizeY() * 0.06),
                              Color.Yellow);
        }
        /// <summary>Initializes a new instance of the <see cref="UnitIconDrawerMenu" /> class.</summary>
        internal UnitIconDrawerMenu()
        {
            this.Menu = new Menu("IconDrawer", Constants.AssemblyName + "UnitIconDrawer");
            var reso = "(" + HUDInfo.ScreenSizeX() + "x" + HUDInfo.ScreenSizeY() + ")";

            this.sizeMenuItem =
                this.Menu.AddItem(
                    new MenuItem(
                        this.Menu.Name + nameof(this.sizeMenuItem) + HUDInfo.ScreenSizeY() + HUDInfo.ScreenSizeX(),
                        "Minimap icon size " + reso).SetValue(
                        new Slider((int)(HUDInfo.GetHpBarSizeY() * 1.5), (int)(HUDInfo.GetHpBarSizeY() * 1.5), 64))
                    .SetTooltip("Set minimap icon size for resolution " + reso));
        }
 /// <summary>
 ///     Initializes a new instance of the <see cref="ChargeOfDarkness" /> class.
 /// </summary>
 /// <param name="ability">
 ///     The ability.
 /// </param>
 public ChargeOfDarkness(Ability ability)
 {
     this.ability      = ability;
     this.speed        = ability.GetProjectileSpeed();
     this.sleeper      = new Sleeper();
     this.lastLevel    = ability.Level;
     this.abilityIcon  = Drawing.GetTexture("materials/ensage_ui/spellicons/spirit_breaker_charge_of_darkness");
     this.iconSize     = new Vector2(HUDInfo.GetHpBarSizeY() * 2);
     this.CastPoint    = this.ability.FindCastPoint();
     this.notification = new Notification(
         5000,
         new Vector2(HUDInfo.ScreenSizeX(), (float)(HUDInfo.ScreenSizeY() / 2.3)),
         new Vector2(HUDInfo.ScreenSizeX() / 11, HUDInfo.ScreenSizeX() / 30));
 }
Esempio n. 10
0
        public StatusDrawer()
        {
            textSize  = new Vector2(21);
            textColor = Color.Orange;

            var x = HUDInfo.ScreenSizeX();
            var evaderTextSize     = Drawing.MeasureText(EvaderText, Font, textSize, FontFlags.None);
            var pathfinderTextSize = Drawing.MeasureText(PathfinderText, Font, textSize, FontFlags.None);

            evaderTextPosition     = new Vector2(x - evaderTextSize.X - 10, evaderTextSize.Y + 25);
            pathfinderTextPosition = new Vector2(
                x - pathfinderTextSize.X - 10,
                pathfinderTextSize.Y + evaderTextPosition.Y);
        }
Esempio n. 11
0
        private static void SetScreenVariables()
        {
            mScreenSize = new Vector2(HUDInfo.ScreenSizeX(), HUDInfo.ScreenSizeY());

            mMenuPosition = mScreenSize.X;
            mButtonHeight = mScreenSize.Y / 30;

            // Open - Close Menu Button
            mMenuButtonSize = new Vector2(mScreenSize.X / 60, mScreenSize.Y / 12);
            mMenuButtonPos  = new Vector2(mScreenSize.X - mMenuButtonSize.X, (float)((mScreenSize.Y - (mScreenSize.Y / 5.5)) / 2 - (mMenuButtonSize.Y / 2)));

            // Menu Background
            mMenuSize           = new Vector2(mScreenSize.X / 12, (float)(mScreenSize.Y / 1.56));
            mMenuPos            = new Vector2(mScreenSize.X - mMenuSize.X, (float)((mScreenSize.Y - (mScreenSize.Y / 5.5)) / 2 - (mMenuSize.Y / 2)));
            mScreenVariablesSet = true;
        }
Esempio n. 12
0
        static void Information(EventArgs args)
        {
            if (!Game.IsInGame || Game.IsWatchingGame)
            {
                return;
            }
            me = ObjectMgr.LocalHero;
            if (me == null)
            {
                return;
            }

            if (Menu.Item("ToggleKey").GetValue <KeyBind>().Active == true)
            {
                Drawing.DrawText("SNATCHING!", new Vector2(HUDInfo.ScreenSizeX() / 2 + 2, HUDInfo.ScreenSizeY() / 2 + 235 + 2), new Vector2(30, 200), Color.Black, FontFlags.AntiAlias);
                Drawing.DrawText("SNATCHING!", new Vector2(HUDInfo.ScreenSizeX() / 2, HUDInfo.ScreenSizeY() / 2 + 235), new Vector2(30, 200), Color.Cyan, FontFlags.AntiAlias);
            }
        }
Esempio n. 13
0
        private static void Drawing_OnEndScene(EventArgs args)
        {
            if (Drawing.Direct3DDevice9 == null)
            {
                return;
            }

            textFont.DrawText(
                null,
                "Lane: " + LaneList[selectedLane],
                (int)(HUDInfo.ScreenSizeX() * 0.01),
                (int)(HUDInfo.ScreenSizeY() * 0.06),
                Color.Yellow);

            var heroText = currentPair.Key;

            if (heroText.Contains(","))
            {
                heroText = currentPair.Key.Substring(0, currentPair.Key.IndexOf(",", StringComparison.Ordinal));
            }

            if (locked)
            {
                heroText += " (locked)";
            }

            textFont.DrawText(
                null,
                "Hero: " + heroText,
                (int)(HUDInfo.ScreenSizeX() * 0.01),
                (int)(HUDInfo.ScreenSizeY() * 0.09),
                Color.Yellow);

            if (displayTempName && tempName.Any())
            {
                textFont.DrawText(
                    null,
                    tempName,
                    (int)(HUDInfo.ScreenSizeX() * 0.01),
                    (int)(HUDInfo.ScreenSizeY() * 0.12),
                    Color.Orange);
            }
        }
Esempio n. 14
0
 private static void Drawing_OnDraw(EventArgs args)
 {
     //Color
     if (Menu.Item("Forced").GetValue <KeyBind>().Active)
     {
         Drawing.DrawText("ANTIREUSE DELIVER", new Vector2((int)HUDInfo.ScreenSizeX() / 2 - 110, 130),
                          new Vector2(26, 26), Color.Red, FontFlags.AntiAlias | FontFlags.DropShadow | FontFlags.Outline);
     }
     if (Menu.Item("Lock").GetValue <KeyBind>().Active)
     {
         Drawing.DrawText("LOCK AT BASE", new Vector2((int)HUDInfo.ScreenSizeX() / 2 - 80, 70),
                          new Vector2(26, 26), Color.Blue, FontFlags.AntiAlias | FontFlags.DropShadow | FontFlags.Outline);
     }
     if (Menu.Item("Secret Shop").GetValue <KeyBind>().Active)
     {
         Drawing.DrawText("SECRET SHOP", new Vector2((int)HUDInfo.ScreenSizeX() / 2 - 75, 40),
                          new Vector2(26, 26), Color.DarkCyan,
                          FontFlags.AntiAlias | FontFlags.DropShadow | FontFlags.Outline);
     }
 }
Esempio n. 15
0
        public StatusDrawer()
        {
            textSize  = new Vector2(21);
            textColor = Color.Orange;

            var x = HUDInfo.ScreenSizeX();
            var evaderTextSize      = Drawing.MeasureText(EvaderText, Font, textSize, FontFlags.None);
            var pathfinderTextSize  = Drawing.MeasureText(PathfinderText, Font, textSize, FontFlags.None);
            var bkbTextSize         = Drawing.MeasureText(BkbText, Font, textSize, FontFlags.None);
            var movementBlockedText = Drawing.MeasureText(MovementBlockedText, Font, textSize, FontFlags.None);

            evaderTextPosition = new Vector2(x - evaderTextSize.X - 10, evaderTextSize.Y + 25);

            pathfinderTextPosition = new Vector2(
                x - pathfinderTextSize.X - 10,
                pathfinderTextSize.Y + evaderTextPosition.Y);

            bkbTextPosition = new Vector2(x - bkbTextSize.X - 10, bkbTextSize.Y + pathfinderTextPosition.Y);

            movementBlockedPosition = new Vector2(
                x - movementBlockedText.X - 10,
                movementBlockedText.Y + bkbTextPosition.Y);
        }
Esempio n. 16
0
        private static void Pick()
        {
            if (selectedLane != 0)
            {
                var teamAdjustment = ObjectManager.LocalPlayer.Team == Team.Radiant ? 0 : LaneList.Length - 1;
                var xMult          = CoordinateMultiplayers[selectedLane - 1 + teamAdjustment, ratioAdjustment, 0];
                var yMult          = CoordinateMultiplayers[selectedLane - 1 + teamAdjustment, ratioAdjustment, 1];

                SetCursorPos((int)(HUDInfo.ScreenSizeX() * xMult), (int)(HUDInfo.ScreenSizeY() * yMult));
                mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);

                var sayTextIndex = Menu.Item(LaneList[selectedLane] + "Text").GetValue <StringList>().SelectedIndex;

                if (sayTextIndex != 0)
                {
                    Game.ExecuteCommand("say_team " + SayText[selectedLane - 1][sayTextIndex]);
                }
            }

            if (currentPair.Value != "None" && locked)
            {
                Game.ExecuteCommand("dota_select_hero " + currentPair.Value);
            }
        }
Esempio n. 17
0
        private static void DragButton(Vector2 loc, float w, float h)
        {
            var isIn = Utils.IsUnderRectangle(Game.MouseScreenPosition, loc.X, loc.Y, w, h);

            if (leftMouseIsHold && Utils.SleepCheck("HoldButtonCd") && isIn && !hold)
            {
                hold = true;
                diff = Game.MouseScreenPosition - startloc;
                Utils.Sleep(250, "HoldButtonCd");
            }
            else if (!leftMouseIsHold)
            {
                hold = false;
            }
            if (hold)
            {
                startloc = Game.MouseScreenPosition - diff;
                Menu.Item("xposition").SetValue(new Slider((int)startloc.X, 1, (int)HUDInfo.ScreenSizeX()));
                Menu.Item("yposition").SetValue(new Slider((int)startloc.Y, 1, (int)HUDInfo.ScreenSizeY()));
            }
            Drawing.DrawRect(loc, new Vector2(w, h), new Color(0, 0, 0, 150));
            Drawing.DrawText("          Emoticons", loc + new Vector2(103, 2), Color.Blue,
                             FontFlags.AntiAlias | FontFlags.DropShadow);
        }
Esempio n. 18
0
        /// <summary>
        ///     The on load.
        /// </summary>
        public void OnLoad()
        {
            this.LocalTeam = new AbilityTeam(GlobalVariables.Team);
            var enemyTeam = new AbilityTeam(GlobalVariables.EnemyTeam)
            {
                OtherTeams = new List <IAbilityTeam> {
                    this.LocalTeam
                }
            };

            this.LocalTeam.OtherTeams.Add(enemyTeam);
            this.Teams = new List <IAbilityTeam> {
                this.LocalTeam, enemyTeam
            };

            // foreach (var unit in ObjectManager.GetEntities<Unit>())
            // {
            // if (!(unit is Hero) || unit.Team == GlobalVariables.EnemyTeam && !(unit is Hero)
            // || unit.ClassId == ClassID.CDOTA_BaseNPC_Creep_Lane
            // || unit.ClassId == ClassID.CDOTA_BaseNPC_Creep_Siege || unit.IsIllusion)
            // {
            // continue;
            // }

            // this.AddUnit(unit);
            // }

            // var delay = Game.GameTime < 0 ? 3000 : 500;
            // DelayAction.Add(
            // delay,
            // () =>
            // {

            // });
            var heroes =
                ObjectManager.GetEntities <Player>()
                .Where(x => x.Hero != null && x.Hero.IsValid)
                .Select(x => x.Hero)
                .ToList();

            foreach (var hero in
                     ObjectManager.GetEntities <Hero>()
                     .Where(hero => !hero.IsIllusion && heroes.All(x => x.Handle != hero.Handle)))
            {
                heroes.Add(hero);
            }

            foreach (var hero in heroes)
            {
                this.AddUnit(hero);
            }

            foreach (var keyValuePair in this.Units)
            {
                foreach (var sourceUnitModifier in keyValuePair.Value.SourceUnit.Modifiers)
                {
                    keyValuePair.Value.Modifiers.AddModifier(sourceUnitModifier);
                }
            }

            // foreach (var hero in heroes)
            // {
            // foreach (var heroModifier in hero.Modifiers)
            // {
            // this.Unit_OnModifierAdded(hero, new ModifierChangedEventArgs(heroModifier));
            // }
            // }
            foreach (var entity in ObjectManager.GetEntities <Unit>())
            {
                if (entity.IsValid && !(entity is Hero) && !(entity is Courier) && entity.Team == this.LocalTeam.Name &&
                    entity.IsControllable)
                {
                    // if (entity.Name == "npc_dota_lone_druid_bear1")
                    // {
                    // Console.WriteLine(entity.GetType());
                    // }
                    // Console.WriteLine(entity.Name);
                    this.AddUnit(entity);
                }
            }

            var size = new Vector2((float)(HUDInfo.ScreenSizeX() / 2.3), HUDInfo.ScreenSizeY() / 2);

            this.ui =
                new AbilityManagerUserInterface(
                    new Vector2(HUDInfo.ScreenSizeX() - size.X - 10, (float)(HUDInfo.ScreenSizeY() / 2 - size.Y / 1.5)),
                    size,
                    this);
            this.TeamAdd.Next(this.LocalTeam);
            this.TeamAdd.Next(enemyTeam);
            ObjectManager.OnAddEntity    += this.OnAddEntity;
            ObjectManager.OnRemoveEntity += this.OnRemoveEntity;

            Unit.OnModifierAdded   += this.Unit_OnModifierAdded;
            Unit.OnModifierRemoved += this.Unit_OnModifierRemoved;

            // Game.OnUpdate += this.Game_OnUpdate;
            // Drawing.OnDraw += this.Drawing_OnDraw;
        }
Esempio n. 19
0
 static void markedfordeath(EventArgs args)
 {
     if (!Game.IsInGame || Game.IsWatchingGame)
     {
         return;
     }
     me = ObjectMgr.LocalHero;
     if (me == null)
     {
         return;
     }
     if (me.ClassID != ClassID.CDOTA_Unit_Hero_Legion_Commander)
     {
         return;
     }
     target = me.ClosestToMouseTarget(50000);
     if (target != null)
     {
         Vector2 target_health_bar = HeroPositionOnScreen(target);
         Drawing.DrawText("Marked for Death", target_health_bar, new Vector2(15, 200), me.Distance2D(target) < 1200 ? Color.Red : Color.Azure, FontFlags.AntiAlias | FontFlags.Additive | FontFlags.DropShadow);
     }
     if (!Utils.SleepCheck("BKBTOGGLE"))
     {
         Drawing.DrawText(Menu.Item("Duel Items3").GetValue <AbilityToggler>().IsEnabled("item_black_king_bar") == true ? "ON" : "OFF", new Vector2(HUDInfo.ScreenSizeX() / 2, HUDInfo.ScreenSizeY() / 2), new Vector2(30, 200), Menu.Item("Duel Items3").GetValue <AbilityToggler>().IsEnabled("item_black_king_bar") == true ? Color.LimeGreen : Color.Red, FontFlags.AntiAlias | FontFlags.Additive | FontFlags.DropShadow);
     }
 }
Esempio n. 20
0
        public SnatcherMenu(Menu mainMenu)
        {
            var menu = new Menu("Snatcher", "snatcher");

            var notificationMenu = new Menu("Notification", "snatcherNotification");

            var notificationEnabled = new MenuItem("snatcherNotificationEnabled", "Enabled").SetValue(false);

            notificationEnabled.SetTooltip("Show notification when snatched is enabled");
            notificationMenu.AddItem(notificationEnabled);
            notificationEnabled.ValueChanged += (sender, args) =>
            {
                IsNotificationEnabled = args.GetNewValue <bool>();
                OnNotificationEnabledChange?.Invoke(null, new BoolEventArgs(IsNotificationEnabled));
            };
            IsNotificationEnabled = notificationEnabled.IsActive();

            var notificationHoldKey =
                new MenuItem("snatcherNotificationHoldKey", "Enabled for hold key").SetValue(false);

            notificationMenu.AddItem(notificationHoldKey);
            notificationHoldKey.ValueChanged += (sender, args) => { NotificationHold = args.GetNewValue <bool>(); };
            NotificationHold = notificationHoldKey.IsActive();

            var notificationToggleKey =
                new MenuItem("snatcherNotificationToggleKey", "Enabled for toggle key").SetValue(true);

            notificationMenu.AddItem(notificationToggleKey);
            notificationToggleKey.ValueChanged += (sender, args) => { NotificationToggle = args.GetNewValue <bool>(); };
            NotificationToggle = notificationToggleKey.IsActive();

            var notificationSize = new MenuItem("snatcherNotificationSize", "Size").SetValue(new Slider(22, 15, 30));

            notificationMenu.AddItem(notificationSize);
            notificationSize.ValueChanged += (sender, args) => { NotificationSize = args.GetNewValue <Slider>().Value; };
            NotificationSize = notificationSize.GetValue <Slider>().Value;

            var notificationX =
                new MenuItem("snatcherNotificationX", "Coordinates X").SetValue(
                    new Slider(15, 0, (int)HUDInfo.ScreenSizeX()));

            notificationMenu.AddItem(notificationX);
            notificationX.ValueChanged += (sender, args) => { NotificationX = args.GetNewValue <Slider>().Value; };
            NotificationX = notificationX.GetValue <Slider>().Value;

            var notificationY =
                new MenuItem("snatcherNotificationY", "Coordinates Y").SetValue(
                    new Slider(50, 0, (int)HUDInfo.ScreenSizeY()));

            notificationMenu.AddItem(notificationY);
            notificationY.ValueChanged += (sender, args) => { NotificationY = args.GetNewValue <Slider>().Value; };
            NotificationY = notificationY.GetValue <Slider>().Value;

            var enabled = new MenuItem("snatcherEnabled", "Enabled").SetValue(true);

            menu.AddItem(enabled);
            enabled.ValueChanged += (sender, args) =>
            {
                IsEnabled = args.GetNewValue <bool>();
                OnEnabledChange?.Invoke(null, new BoolEventArgs(IsEnabled));
            };
            IsEnabled = enabled.IsActive();

            var holdKey = new MenuItem("holdSnatchKey", "Hold key").SetValue(new KeyBind('O', KeyBindType.Press));

            menu.AddItem(holdKey);
            holdKey.ValueChanged += (sender, args) => HoldKey = args.GetNewValue <KeyBind>().Active;
            HoldKey = holdKey.IsActive();

            var holdItems = new MenuItem("enabledStealHold", "Hold steal:").SetValue(
                new AbilityToggler(items.ToDictionary(x => x.Key, x => true)));

            menu.AddItem(holdItems);
            holdItems.ValueChanged += (sender, args) =>
            {
                SetEnabledItems(args.GetNewValue <AbilityToggler>().Dictionary, EnabledHoldItems);
            };

            var toggleKey = new MenuItem("pressSnatchKey", "Toggle key").SetValue(new KeyBind('P', KeyBindType.Toggle));

            menu.AddItem(toggleKey);
            toggleKey.ValueChanged += (sender, args) => ToggleKey = args.GetNewValue <KeyBind>().Active;
            ToggleKey = toggleKey.IsActive();

            var toggleItems =
                new MenuItem("enabledStealToggle", "Toggle steal:").SetValue(
                    new AbilityToggler(items.ToDictionary(x => x.Key, x => true)));

            menu.AddItem(toggleItems);
            toggleItems.ValueChanged += (sender, args) => SetEnabledItems(
                args.GetNewValue <AbilityToggler>().Dictionary,
                EnabledToggleItems);

            var otherUnits = new MenuItem("snatcherOtherUnits", "Use other units").SetValue(false)
                             .SetTooltip("Like Spirit Bear, Meepo clones");

            menu.AddItem(otherUnits);
            otherUnits.ValueChanged += (sender, args) =>
            {
                UseOtherUnits = args.GetNewValue <bool>();
                OnUseOtherUnitsChange?.Invoke(null, new BoolEventArgs(UseOtherUnits));
            };
            UseOtherUnits = otherUnits.IsActive();

            var itemMoveCostThreshold =
                new MenuItem("snatcherMoveItemCost", "Move item cost threshold").SetValue(new Slider(1000, 0, 5000));

            itemMoveCostThreshold.SetTooltip(
                "It will move item from inventory (when full) to backpack which costs less gold to pick up aegis/rapier/gem (disabled: 0)");
            menu.AddItem(itemMoveCostThreshold);
            itemMoveCostThreshold.ValueChanged         +=
                (sender, args) => ItemMoveCostThreshold = args.GetNewValue <Slider>().Value;
            ItemMoveCostThreshold = itemMoveCostThreshold.GetValue <Slider>().Value;

            var updateRate = new MenuItem("snatcherUpdateRate", "Update rate").SetValue(new Slider(1, 1, 500));

            updateRate.SetTooltip("Lower value => faster reaction, but requires more resources");
            menu.AddItem(updateRate);
            updateRate.ValueChanged += (sender, args) =>
            {
                UpdateRate = args.GetNewValue <Slider>().Value;
                OnUpdateRateChange?.Invoke(null, new IntEventArgs(UpdateRate));
            };
            UpdateRate = updateRate.GetValue <Slider>().Value;

            var debug = new MenuItem("snatcherDebug", "Debug info").SetValue(false);

            menu.AddItem(debug);
            debug.ValueChanged += (sender, args) => OnDebug?.Invoke(null, EventArgs.Empty);

            SetEnabledItems(holdItems.GetValue <AbilityToggler>().Dictionary, EnabledHoldItems);
            SetEnabledItems(toggleItems.GetValue <AbilityToggler>().Dictionary, EnabledToggleItems);

            menu.AddSubMenu(notificationMenu);
            mainMenu.AddSubMenu(menu);
        }
Esempio n. 21
0
        public static void Drawing_OnDraw(EventArgs args)
        {
            if (!Game.IsInGame || AbilityMain.Me == null || !AbilityMain.Me.IsValid || EnemyHeroes.Heroes == null)
            {
                return;
            }
            var enumerable = EnemyHeroes.UsableHeroes;

            if (!enumerable.Any())
            {
                return;
            }
            foreach (var hero in enumerable)
            {
                float dmg;
                if (!Dictionaries.InDamageDictionary.TryGetValue(hero.Handle, out dmg))
                {
                    dmg = 0;
                }
                float outdmg;
                if (!Dictionaries.OutDamageDictionary.TryGetValue(hero.Handle, out outdmg))
                {
                    outdmg = 0;
                }
                var     hp      = Math.Max(hero.Health - dmg, 0);
                var     lhp     = Math.Max(hp - outdmg, 0);
                var     hpperc  = hp / hero.MaximumHealth;
                var     dmgperc = Math.Min(dmg, hero.Health) / hero.MaximumHealth;
                Vector2 hbarpos;
                HpBar.HpBarPositionDictionary.TryGetValue(NameManager.Name(hero), out hbarpos);
                if (hbarpos.X + 20 > HUDInfo.ScreenSizeX() || hbarpos.X - 20 < 0 ||
                    hbarpos.Y + 100 > HUDInfo.ScreenSizeY() || hbarpos.Y - 30 < 0)
                {
                    continue;
                }
                var hpvarx   = HpBar.SizeX;
                var hpbary   = HpBar.SizeY;
                var position = hbarpos + new Vector2(hpvarx * hpperc, (float)(hpbary * 0.4));
                if (MainMenu.DamageIndicatorMenu.Item("abilityDamageIndicatorDrawDamage").GetValue <bool>())
                {
                    if (dmg > 0)
                    {
                        Drawing.DrawRect(
                            position,
                            new Vector2(hpvarx * dmgperc, (float)(hpbary / 1.6)),
                            (lhp > 0) ? new Color(225, 200, 150, 95) : new Color(70, 225, 70, 105));
                        Drawing.DrawRect(
                            position,
                            new Vector2(hpvarx * dmgperc, (float)(hpbary / 1.6)),
                            Color.Black,
                            true);
                    }
                    if (outdmg > 0)
                    {
                        var outdmgperc = Math.Min(outdmg, hp) / hero.MaximumHealth;
                        var pos        = position + new Vector2(-hpvarx * outdmgperc, 0);
                        Drawing.DrawRect(
                            pos,
                            new Vector2(hpvarx * outdmgperc, (float)(hpbary / 1.6)),
                            (lhp > 0) ? new Color(100, 0, 0, 200) : new Color(0, 120, 0, 200));
                        Drawing.DrawRect(
                            pos,
                            new Vector2(hpvarx * outdmgperc, (float)(hpbary / 1.6)),
                            Color.Black,
                            true);
                    }
                }
                if (MainMenu.DamageIndicatorMenu.Item("abilityDamageIndicatorDrawHits").GetValue <bool>())
                {
                    double hits;
                    if (!Dictionaries.HitsDictionary.TryGetValue(hero.Handle.ToString(), out hits))
                    {
                        continue;
                    }
                    var textt          = hits.ToString(CultureInfo.InvariantCulture) + ((hits > 1) ? " hits" : " hit");
                    var hpbarpositionX = HUDInfo.GetHPbarPosition(hero).X;
                    var s   = ((hits > 0) ? textt : "KILL");
                    var h   = "(" + Math.Floor(hero.Health - dmg - outdmg) + ")";
                    var isi =
                        MainMenu.DamageIndicatorMenu.Item("abilityDamageIndicatorTextSize").GetValue <Slider>().Value;
                    var textSize = Drawing.MeasureText(
                        s,
                        "Arial",
                        new Vector2(hpbary + 4 + isi, 1),
                        FontFlags.AntiAlias);
                    var textPos =
                        new Vector2(
                            (int)
                            (hpbarpositionX + 4
                             + (HpBar.SizeX * ((float)hero.Health * 1000 / hero.MaximumHealth)) / 1000),
                            (int)(HUDInfo.GetHPbarPosition(hero).Y - 2));
                    Drawing.DrawText(
                        s,
                        textPos,
                        new Vector2(hpbary + 4 + isi, 1),
                        (hits > 0) ? Color.White : new Color(100, 225, 110),
                        FontFlags.AntiAlias);
                    Drawing.DrawText(
                        h,
                        textPos + new Vector2(textSize.X + 2, 1),
                        new Vector2(hpbary + 2 + isi, 1),
                        (hits > 0) ? Color.LightGoldenrodYellow : Color.YellowGreen,
                        FontFlags.AntiAlias);
                }
            }
        }
        /// <summary>The update.</summary>
        public void Check()
        {
            if (this.CheckMinimap())
            {
                return;
            }

            float difference;
            float ydifference;

            if (this.Position.X < 0)
            {
                difference = -this.Position.X;

                // Console.WriteLine("1 " + Game.RawGameTime);
                this.IsOffScreen = true;

                if ((ydifference = this.Position.Y + this.Size.Y - HUDInfo.ScreenSizeY()) >= 0)
                {
                    if (!this.CalculateEdgePosition)
                    {
                        this.IsVisible = this.Position.X > -this.Size.X && ydifference < this.Size.Y;
                        return;
                    }

                    this.EdgePosition = new Vector2(0, HUDInfo.ScreenSizeY() - this.Size.Y);

                    // var x = Math.Min(this.Position.X + ydifference, HUDInfo.ScreenSizeX() - this.Size.X);
                    // var y = Math.Max(this.Position.Y - difference, 0);
                    // this.EdgePosition = new Vector2(Math.Max(0, x), Math.Min(y, HUDInfo.ScreenSizeY() - this.Size.Y));
                }
                else
                {
                    if (!this.CalculateEdgePosition)
                    {
                        this.IsVisible = this.Position.X > -this.Size.X && this.Position.Y > -this.Size.Y;
                        return;
                    }

                    this.EdgePosition = this.Position.Y < 0 ? Vector2.Zero : new Vector2(0, this.Position.Y);

                    // var x = Math.Min(this.Position.X + ydifference, HUDInfo.ScreenSizeX() - this.Size.X);
                    // var y = Math.Min(this.Position.Y + difference, HUDInfo.ScreenSizeY() - this.Size.Y);
                    // this.EdgePosition = new Vector2(Math.Max(0, x), Math.Max(y, 0));
                }

                // this.DistanceFromScreenEdge = this.Position.Distance(this.EdgePosition);
            }
            else if (this.Position.Y < 0)
            {
                ydifference = -this.Position.Y;

                // Console.WriteLine("2 " + Game.RawGameTime);
                this.IsOffScreen = true;

                if ((difference = this.Position.X + this.Size.X - HUDInfo.ScreenSizeX()) >= 0)
                {
                    if (!this.CalculateEdgePosition)
                    {
                        this.IsVisible = difference <this.Size.X && this.Position.Y> -this.Size.Y;
                        return;
                    }

                    this.EdgePosition = new Vector2(HUDInfo.ScreenSizeX() - this.Size.X, 0);

                    // var x = Math.Max(this.Position.X - ydifference, 0);
                    // var y = Math.Min(this.Position.Y + difference, HUDInfo.ScreenSizeY() - this.Size.Y);
                    // this.EdgePosition = new Vector2(Math.Min(HUDInfo.ScreenSizeX() - this.Size.X, x), Math.Max(y, 0));
                }
                else
                {
                    if (!this.CalculateEdgePosition)
                    {
                        this.IsVisible = this.Position.X > -this.Size.X && this.Position.Y > -this.Size.Y;
                        return;
                    }

                    this.EdgePosition = this.Position.X < 0 ? Vector2.Zero : new Vector2(this.Position.X, 0);

                    // var x = Math.Min(this.Position.X + ydifference, HUDInfo.ScreenSizeX() - this.Size.X);
                    // var y = Math.Min(this.Position.Y + difference, HUDInfo.ScreenSizeY() - this.Size.Y);
                    // this.EdgePosition = new Vector2(Math.Max(0, x), Math.Max(y, 0));
                }

                // this.DistanceFromScreenEdge = this.Position.Distance(this.EdgePosition);
            }
            else if ((difference = this.Position.X + this.Size.X - HUDInfo.ScreenSizeX()) >= 0)
            {
                // Console.WriteLine("3 " + Game.RawGameTime);
                this.IsOffScreen = true;

                if ((ydifference = this.Position.Y + this.Size.Y - HUDInfo.ScreenSizeY()) >= 0)
                {
                    if (!this.CalculateEdgePosition)
                    {
                        this.IsVisible = difference < this.Size.X && ydifference < this.Size.Y;
                        return;
                    }

                    this.EdgePosition = new Vector2(
                        HUDInfo.ScreenSizeX() - this.Size.X,
                        HUDInfo.ScreenSizeY() - this.Size.Y);

                    // var x = Math.Max(this.Position.X - ydifference, 0);
                    // var y = Math.Max(this.Position.Y - difference, 0);
                    // this.EdgePosition = new Vector2(
                    // Math.Min(HUDInfo.ScreenSizeX() - this.Size.X, x),
                    // Math.Min(y, HUDInfo.ScreenSizeY() - this.Size.Y));
                }
                else
                {
                    if (!this.CalculateEdgePosition)
                    {
                        this.IsVisible = difference < this.Size.X;
                        return;
                    }

                    this.EdgePosition = new Vector2(HUDInfo.ScreenSizeX() - this.Size.X, this.Position.Y);

                    // var x = Math.Max(this.Position.X - ydifference, 0);
                    // var y = Math.Min(this.Position.Y + difference, HUDInfo.ScreenSizeY() - this.Size.Y);
                    // this.EdgePosition = new Vector2(Math.Min(HUDInfo.ScreenSizeX() - this.Size.X, x), Math.Max(y, 0));
                }

                // this.DistanceFromScreenEdge =
                // new Vector2(this.Position.X + this.Size.X, this.Position.Y).Distance(this.EdgePosition);
            }
            else if ((ydifference = this.Position.Y + this.Size.Y - HUDInfo.ScreenSizeY()) >= 0)
            {
                // Console.WriteLine("4 " + Game.RawGameTime);
                this.IsOffScreen = true;

                if ((difference = this.Position.X + this.Size.X - HUDInfo.ScreenSizeX()) >= 0)
                {
                    if (!this.CalculateEdgePosition)
                    {
                        this.IsVisible = difference < this.Size.X && ydifference < this.Size.Y;
                        return;
                    }

                    this.EdgePosition = new Vector2(
                        HUDInfo.ScreenSizeX() - this.Size.X,
                        HUDInfo.ScreenSizeY() - this.Size.Y);

                    // var x = Math.Max(this.Position.X - ydifference, 0);
                    // var y = Math.Max(this.Position.Y - difference, 0);
                    // this.EdgePosition = new Vector2(
                    // Math.Min(HUDInfo.ScreenSizeX() - this.Size.X, x),
                    // Math.Min(y, HUDInfo.ScreenSizeY() - this.Size.Y));
                }
                else
                {
                    if (!this.CalculateEdgePosition)
                    {
                        this.IsVisible = ydifference < this.Size.Y;
                        return;
                    }

                    // var x = Math.Min(this.Position.X + ydifference, HUDInfo.ScreenSizeX() - this.Size.X);
                    // var y = Math.Max(this.Position.Y - difference, 0);
                    // this.EdgePosition = new Vector2(Math.Max(0, x), Math.Min(y, HUDInfo.ScreenSizeY() - this.Size.Y));
                    this.EdgePosition = new Vector2(this.Position.X, HUDInfo.ScreenSizeY() - this.Size.Y);
                }

                // this.DistanceFromScreenEdge =
                // new Vector2(this.Position.X + this.Size.X, this.Position.Y).Distance(this.EdgePosition);
            }
            else
            {
                this.IsOffScreen = false;
            }
        }
Esempio n. 23
0
        public void OnDraw()
        {
            if (!menuManager.IsOpen || !menuManager.ShowAutoBuild)
            {
                return;
            }

            var build           = abilityBuilder.GetBestBuild().ToList();
            var uniqueAbilities = build.GroupBy(x => x)
                                  .Select(x => x.First())
                                  .OrderBy(x => x.AbilitySlot)
                                  .Select(x => x.StoredName())
                                  .ToList();

            var ratio  = HUDInfo.RatioPercentage();
            var xStart = HUDInfo.ScreenSizeX() * 0.35f;
            var yStart = HUDInfo.ScreenSizeY() * 0.55f;

            var text = "Auto build preview (Win rate: " + abilityBuilder.BestBuildWinRate + ")";

            Drawing.DrawRect(
                new Vector2(xStart - 2, yStart - (35 * ratio)),
                new Vector2(Drawing.MeasureText(text, "Arial", new Vector2(35 * ratio), FontFlags.None).X + 2, 35 * ratio),
                new Color(75, 75, 75, 175),
                false);
            Drawing.DrawRect(
                new Vector2(xStart - 2, yStart),
                new Vector2(((build.Count + 1) * 48 * ratio) + 2, uniqueAbilities.Count * 40 * ratio),
                new Color(75, 75, 75, 175),
                false);
            Drawing.DrawText(
                text,
                "Arial",
                new Vector2(xStart, yStart - (35 * ratio)),
                new Vector2(35 * ratio),
                Color.Orange,
                FontFlags.None);

            var positions = new Dictionary <string, float>();

            for (var i = 0; i < uniqueAbilities.Count; i++)
            {
                var texture = uniqueAbilities[i].Contains("special_")
                                  ? Drawing.GetTexture("materials/ensage_ui/other/chat_wheel/arrow_1")
                                  : Drawing.GetTexture("materials/ensage_ui/spellicons/" + uniqueAbilities[i]);

                Drawing.DrawRect(new Vector2(xStart, yStart + (i * 40 * ratio)), new Vector2(45 * ratio, 40 * ratio), texture);
                positions.Add(uniqueAbilities[i], yStart + (i * 40 * ratio));
                Drawing.DrawRect(
                    new Vector2(xStart - 2, (yStart - 2) + (i * 40 * ratio)),
                    new Vector2((build.Count + 1) * 48 * ratio, 2),
                    Color.Silver);
            }

            Drawing.DrawRect(
                new Vector2(xStart - 2, (yStart - 2) + (uniqueAbilities.Count * 40 * ratio)),
                new Vector2((build.Count + 1) * 48 * ratio, 2),
                Color.Silver);

            for (var i = 0; i < build.Count; i++)
            {
                var number = i + 1;

                if (number >= 10)
                {
                    //skip level 10 (talent)
                    number++;
                }
                if (number >= 15)
                {
                    //skip level 15 (talent)
                    number++;
                }
                if (number >= 17)
                {
                    //skip level 17 (empty)
                    number++;
                }

                var size = Drawing.MeasureText(number.ToString(), "Arial", new Vector2(35 * ratio), FontFlags.None);
                Drawing.DrawText(
                    number.ToString(),
                    "Arial",
                    new Vector2(xStart + (45 * ratio) + (i * 48 * ratio) + (((48 * ratio) - size.X) / 2), positions[build[i].StoredName()]),
                    new Vector2(35 * ratio),
                    Color.White,
                    FontFlags.None);
                Drawing.DrawRect(
                    new Vector2((xStart - 2) + (i * 48 * ratio), yStart - 2),
                    new Vector2(2, uniqueAbilities.Count * 40 * ratio),
                    Color.Silver);
            }

            Drawing.DrawRect(
                new Vector2((xStart - 2) + (build.Count * 48 * ratio), yStart - 2),
                new Vector2(2, uniqueAbilities.Count * 40 * ratio),
                Color.Silver);
            Drawing.DrawRect(
                new Vector2((xStart - 2) + ((build.Count + 1) * 48 * ratio), yStart - 2),
                new Vector2(2, (uniqueAbilities.Count * 40 * ratio) + 2),
                Color.Silver);
        }
Esempio n. 24
0
        /// <summary>
        ///     The draw.
        /// </summary>
        public void Draw()
        {
            if (!this.Visible || this.Hero == null || !this.Hero.IsValid)
            {
                return;
            }

            var hover = Utils.IsUnderRectangle(
                Game.MouseScreenPosition,
                this.Position.X,
                this.Position.Y,
                this.Size.X,
                this.Size.Y);

            if (!hover && this.DisplayTime > this.Duration && !this.Hide)
            {
                this.transition.Start(this.Position, this.positionOff);
                this.Hide     = true;
                this.IsHidden = false;
            }

            if (this.Hide && !this.IsHidden)
            {
                if (hover)
                {
                    this.Hide = false;
                    this.transition.Start(this.Position, this.positionOn);
                }
                else
                {
                    if (this.Position.X > HUDInfo.ScreenSizeX())
                    {
                        this.IsHidden = true;
                    }
                    else
                    {
                        this.Position = this.transition.GetPosition();
                    }
                }
            }

            if (!this.Hide && (this.IsHidden || hover))
            {
                if (this.Position.X < HUDInfo.ScreenSizeX() - this.Size.X)
                {
                    this.IsHidden = false;
                }
                else
                {
                    this.Position = this.transition.GetPosition();
                }
            }

            Drawing.DrawRect(this.Position, this.Size, new Color(0, 0, 0, 150));
            Drawing.DrawRect(this.Position, this.Size, Color.Black, true);
            this.heroIconPosition = this.Position
                                    + new Vector2(
                this.HeroIconSize.X / 10,
                (this.Size.Y / 2) - (((this.HeroIconSize.Y / 4) + this.HeroIconSize.Y) / 2));
            Drawing.DrawRect(
                this.heroIconPosition,
                this.HeroIconSize,
                Textures.GetTexture(
                    "materials/ensage_ui/heroes_horizontal/" + this.Hero.StoredName().Substring("npc_dota_hero_".Length)));
            Drawing.DrawRect(this.heroIconPosition, this.HeroIconSize, Color.Black, true);
            var perc = (float)this.Hero.Health / this.Hero.MaximumHealth;

            Drawing.DrawRect(
                this.heroIconPosition + new Vector2(0, this.HeroIconSize.Y),
                new Vector2(this.HeroIconSize.X, this.HeroIconSize.Y / 4),
                Color.Black);
            Drawing.DrawRect(
                this.heroIconPosition + new Vector2(0, this.HeroIconSize.Y),
                new Vector2(this.HeroIconSize.X * perc, this.HeroIconSize.Y / 4),
                Color.Red);
            Drawing.DrawRect(
                this.heroIconPosition + new Vector2(0, this.HeroIconSize.Y),
                new Vector2(this.HeroIconSize.X, this.HeroIconSize.Y / 4),
                Color.Black,
                true);

            this.healthText.Text     = this.Hero.Health + "/" + this.Hero.MaximumHealth;
            this.healthText.Position = this.heroIconPosition
                                       + new Vector2(
                (this.HeroIconSize.X / 2) - (this.healthText.Size.X / 2),
                this.HeroIconSize.Y + (this.HeroIconSize.Y / 8)
                - (this.healthText.Size.Y / 2));
            this.healthText.Draw();

            hover = Utils.IsUnderRectangle(
                Game.MouseScreenPosition,
                this.heroIconPosition.X,
                this.heroIconPosition.Y,
                this.HeroIconSize.X,
                this.HeroIconSize.Y / 2);
            var a = hover ? 255 : 165;

            this.chargeText.Color    = new Color(a, a, a, a);
            this.chargeText.Position = this.heroIconPosition
                                       + new Vector2((this.HeroIconSize.X / 2) - (this.chargeText.Size.X / 2), 1);

            Drawing.DrawRect(
                this.heroIconPosition,
                new Vector2(this.HeroIconSize.X, this.HeroIconSize.Y / 2),
                new Color(45, 45, 45, hover ? 210 : 80));

            this.chargeText.Draw();
            hover = Utils.IsUnderRectangle(
                Game.MouseScreenPosition,
                this.heroIconPosition.X,
                this.heroIconPosition.Y + (this.HeroIconSize.Y / 2),
                this.HeroIconSize.X,
                this.HeroIconSize.Y / 2);
            a = hover ? 255 : 190;
            this.moveCameraText.Color    = new Color(a, a, a, a);
            this.moveCameraText.Position = this.heroIconPosition
                                           + new Vector2(
                (this.HeroIconSize.X / 2) - (this.moveCameraText.Size.X / 2),
                (this.HeroIconSize.Y / 2)
                + ((this.HeroIconSize.Y / 4) - (this.moveCameraText.Size.Y / 2)));
            Drawing.DrawRect(
                this.heroIconPosition + new Vector2(0, this.HeroIconSize.Y / 2),
                new Vector2(this.HeroIconSize.X, this.HeroIconSize.Y / 2),
                new Color(45, 45, 45, hover ? 210 : 80));

            this.moveCameraText.Draw();

            this.keyText.Text = "Press '"
                                + Utils.KeyToText(
                Variables.Menu.DetonationMenu.Item("Techies.MoveCameraAndDetonate")
                .GetValue <KeyBind>()
                .Key) + "' to detonate";
            this.keyText.Position = this.heroIconPosition
                                    + new Vector2(
                this.HeroIconSize.X + 1,
                (this.HeroIconSize.Y / 2) - (this.keyText.Size.Y / 3));
            this.keyText.Draw();
        }
Esempio n. 25
0
        private static void Main()
        {
            RecoveryMenu.AddItem(new MenuItem("hotkey", "Change hotkey").SetValue(new KeyBind('T', KeyBindType.Press)));

            var forcePick = new Menu("Force item picking", "forcePick");

            forcePick.AddItem(new MenuItem("forcePickMoved", "When hero moved").SetValue(true));
            forcePick.AddItem(new MenuItem("forcePickEnemyNearDistance", "When enemy in range").SetValue(new Slider(500, 0,
                                                                                                                    700)).SetTooltip("If enemy is closer then pick items"));

            RecoveryMenu.AddSubMenu(forcePick);

            PTMenu.AddItem(new MenuItem("enabledPT", "Enabled").SetValue(true));
            PTMenu.AddItem(new MenuItem("enabledPTAbilities", "Enabled for").SetValue(new AbilityToggler(AbilitiesPT)))
            .DontSave();
            PTMenu.AddItem(new MenuItem("switchPTonMove", "Switch when moving").SetValue(
                               new StringList(new[] { "Don't switch", "Main attribute", "Strength", "Intelligence", "Agility" })))
            .SetTooltip("Switch PT to selected attribute when moving");
            PTMenu.AddItem(new MenuItem("switchPTonAttack", "Swtich when attacking").SetValue(
                               new StringList(new[] { "Don't switch", "Main attribute", "Strength", "Intelligence", "Agility" })))
            .SetTooltip("Switch PT to selected attribute when attacking");
            PTMenu.AddItem(new MenuItem("switchPTHeal", "Swtich when healing").SetValue(true))
            .SetTooltip("Bottle, flask, clarity and other hero spells");
            PTMenu.AddItem(new MenuItem("manaPTThreshold", "Mana cost threshold").SetValue(new Slider(15, 0, 50))
                           .SetTooltip("Don't switch PT if spell/item costs less mana"));
            PTMenu.AddItem(new MenuItem("switchbackPTdelay", "Switch back delay").SetValue(new Slider(500, 100, 1000))
                           .SetTooltip("Make delay bigger if you have issues with PT when casting more than 1 spell in a row"));
            PTMenu.AddItem(new MenuItem("autoPTdisable", "Auto disable PT switcher").SetValue(new Slider(0, 0, 60))
                           .SetTooltip("Auto disable PT switching after X min (always enabled: 0)"));

            SoulRingMenu.AddItem(new MenuItem("enabledSR", "Enabled").SetValue(true));
            SoulRingMenu.AddItem(
                new MenuItem("enabledSRAbilities", "Enabled for").SetValue(new AbilityToggler(AbilitiesSR)))
            .DontSave();
            SoulRingMenu.AddItem(new MenuItem("soulringHPThreshold", "HP threshold").SetValue(new Slider(30))
                                 .SetTooltip("Don't use soul ring if HP % less than X"));

            ManaCheckMenu.AddItem(new MenuItem("enabledMC", "Enabled").SetValue(false));
            ManaCheckMenu.AddItem(
                new MenuItem("enabledMCAbilities", "Enabled for").SetValue(new AbilityToggler(AbilitiesMC)))
            .DontSave();
            ManaCheckMenu.AddItem(new MenuItem("mcManaInfo", "Show mana info").SetValue(true)
                                  .SetTooltip("Will show how much mana left/needed after/before casting combo"));
            ManaCheckMenu.AddItem(new MenuItem("mcPTcalculations", "Include PT switcher calculations").SetValue(true)
                                  .SetTooltip("Will include in calculations mana gained from PT switching"));
            ManaCheckMenu.AddItem(new MenuItem("mcSize", "Size").SetValue(new Slider(8, 1, 10)))
            .SetTooltip("Reload assembly to apply new size");
            ManaCheckMenu.AddItem(
                new MenuItem("mcX", "Position X").SetValue(new Slider(0, 0, (int)HUDInfo.ScreenSizeX())));
            ManaCheckMenu.AddItem(
                new MenuItem("mcY", "Position Y").SetValue(new Slider(0, 0, (int)HUDInfo.ScreenSizeY())));

            Menu.AddSubMenu(PTMenu);
            Menu.AddSubMenu(RecoveryMenu);
            Menu.AddSubMenu(SoulRingMenu);
            Menu.AddSubMenu(ManaCheckMenu);

            Menu.AddItem(new MenuItem("checkPTdelay", "PT check delay").SetValue(new Slider(250, 200, 500))
                         .SetTooltip("Make delay bigger if PT constantly switching when using bottle for example"));

            Menu.AddToMainMenu();

            manaCheckText = new Font(
                Drawing.Direct3DDevice9,
                new FontDescription {
                FaceName        = "Tahoma",
                Height          = 13 * (ManaCheckMenu.Item("mcSize").GetValue <Slider>().Value / 2),
                OutputPrecision = FontPrecision.Raster,
                Quality         = FontQuality.ClearTypeNatural,
                CharacterSet    = FontCharacterSet.Hangul,
                MipLevels       = 3,
                PitchAndFamily  = FontPitchAndFamily.Modern,
                Weight          = FontWeight.Heavy,
                Width           = 5 * (ManaCheckMenu.Item("mcSize").GetValue <Slider>().Value / 2)
            });

            Game.OnUpdate  += Game_OnUpdate;
            Game.OnWndProc += Game_OnWndProc;

            Player.OnExecuteOrder += Player_OnExecuteAction;

            Drawing.OnPreReset  += Drawing_OnPreReset;
            Drawing.OnPostReset += Drawing_OnPostReset;
            Drawing.OnEndScene  += Drawing_OnEndScene;
        }
Esempio n. 26
0
        static void Main(string[] args)
        {
            Menu Position = new Menu("Position", "position");

            Position.AddItem(new MenuItem("xposition", "X Position").SetValue(new Slider(450, 1, (int)HUDInfo.ScreenSizeX())));
            Position.AddItem(new MenuItem("yposition", "Y Position").SetValue(new Slider(110, 1, (int)HUDInfo.ScreenSizeY())));
            Menu.AddSubMenu(Position);
            Menu.AddToMainMenu();

            Game.OnWndProc += Game_OnWndProc;
            Drawing.OnDraw += Drawing_OnDraw;
        }
        private bool CheckMinimap()
        {
            if (HUDInfo.MinimapIsOnRight)
            {
                var minimapPos = new Vector2(
                    HUDInfo.ScreenSizeX() - HUDInfo.Minimap.Position.X - HUDInfo.Minimap.Size.X,
                    HUDInfo.ScreenSizeY() - HUDInfo.Minimap.Position.Y - HUDInfo.Minimap.Size.Y);

                var difference = this.Position.X + this.Size.X - minimapPos.X;
                if (difference >= 0)
                {
                    var ydifference = this.Position.Y + this.Size.Y - minimapPos.Y;
                    if (ydifference >= 0)
                    {
                        // Console.WriteLine("1 " + ydifference + " " + difference);
                        this.IsOffScreen = true;
                        if (!this.CalculateEdgePosition)
                        {
                            this.IsVisible = (difference > this.Size.X && ydifference < this.Size.Y ||
                                              difference < this.Size.X &&
                                              (ydifference <this.Size.Y || ydifference> this.Size.Y)) &&
                                             this.Position.X < HUDInfo.ScreenSizeX() &&
                                             this.Position.Y < HUDInfo.ScreenSizeY();
                            return(true);
                        }

                        var y = Math.Max(this.Position.Y - difference, minimapPos.Y - this.Size.Y);
                        var x = Math.Max(this.Position.X - ydifference, minimapPos.X - this.Size.X);
                        this.EdgePosition = new Vector2(
                            Math.Min(x, HUDInfo.ScreenSizeX() - this.Size.X),
                            Math.Min(y, HUDInfo.ScreenSizeY() - this.Size.Y));

                        // this.DistanceFromScreenEdge = this.Position.Distance(this.EdgePosition);
                        return(true);
                    }

                    return(false);
                }
            }
            else
            {
                var minimapPos = new Vector2(
                    HUDInfo.Minimap.Position.X + HUDInfo.Minimap.Size.X,
                    HUDInfo.ScreenSizeY() - HUDInfo.Minimap.Position.Y - HUDInfo.Minimap.Size.Y);
                var difference = minimapPos.X - this.Position.X;
                if (difference >= 0)
                {
                    var ydifference = this.Position.Y + this.Size.Y - minimapPos.Y;
                    if (ydifference >= 0)
                    {
                        // Console.WriteLine("1 " + ydifference + " " + difference);
                        this.IsOffScreen = true;
                        if (!this.CalculateEdgePosition)
                        {
                            this.IsVisible = (difference > this.Size.X && ydifference < this.Size.Y ||
                                              difference < this.Size.X &&
                                              (ydifference <this.Size.Y || ydifference> this.Size.Y)) &&
                                             this.Position.X + this.Size.X > 0 &&
                                             this.Position.Y < HUDInfo.ScreenSizeY();
                            return(true);
                        }

                        var y = Math.Max(this.Position.Y - difference, minimapPos.Y - this.Size.Y);
                        var x = Math.Min(this.Position.X + ydifference, minimapPos.X);
                        this.EdgePosition = new Vector2(
                            Math.Max(x, 0),
                            Math.Min(y, HUDInfo.ScreenSizeY() - this.Size.Y));

                        // this.DistanceFromScreenEdge = this.Position.Distance(this.EdgePosition);
                        return(true);
                    }

                    return(false);
                }
            }

            // return false;
            return(false);
        }
        public static void Drawing_OnDraw(EventArgs args)
        {
            if (!Game.IsInGame || AbilityMain.Me == null || !AbilityMain.Me.IsValid || EnemyHeroes.Heroes == null)
            {
                return;
            }

            if (Utils.SleepCheck("AbilityOverlay.Update"))
            {
                boxSizeX         = HpBar.SizeX / 6 + MainMenu.AbilityOverlayMenu.Item("sizeSliderSpell").GetValue <Slider>().Value;
                boxSizeY         = boxSizeX + 1;
                boxExtraPosX     = MainMenu.AbilityOverlayMenu.Item("ExtraPosSliderSpellX").GetValue <Slider>().Value *(float)0.5;
                boxExtraPosY     = MainMenu.AbilityOverlayMenu.Item("ExtraPosSliderSpellY").GetValue <Slider>().Value *(float)0.5;
                itemBoxSizeX     = HpBar.SizeX / 6 + MainMenu.AbilityOverlayMenu.Item("sizeSliderItem").GetValue <Slider>().Value;
                itemBoxSizeY     = (float)(itemBoxSizeX / 1.24);
                itemboxExtraPosX = MainMenu.AbilityOverlayMenu.Item("ExtraPosSliderItemX").GetValue <Slider>().Value *(float)0.5;
                itemboxExtraPosY = MainMenu.AbilityOverlayMenu.Item("ExtraPosSliderItemY").GetValue <Slider>().Value *(float)0.5;
                Utils.Sleep(100, "AbilityOverlay.Update");
            }

            var size = new Vector2(HpBar.SizeX, (float)(HpBar.SizeY / 2.8));
            var spellOverlayEnabledEnemy = MainMenu.AbilityOverlayMenu.Item("enableSpellOverlayEnemy").GetValue <bool>();
            var enableManaBar            = MainMenu.ManaBarMenu.Item("enableManaBar").GetValue <bool>();

            try
            {
                foreach (var hero in EnemyHeroes.UsableHeroes)
                {
                    var heroName = NameManager.Name(hero);
                    var mana     = hero.Mana;
                    var maxMana  = hero.MaximumMana;
                    var hpbarpos = HpBar.HpBarPositionDictionary[heroName];
                    if (hpbarpos.X + 20 > HUDInfo.ScreenSizeX() || hpbarpos.X - 20 < 0 ||
                        hpbarpos.Y + 100 > HUDInfo.ScreenSizeY() || hpbarpos.Y - 30 < 0)
                    {
                        continue;
                    }
                    if (enableManaBar)
                    {
                        var start    = hpbarpos + new Vector2(0, HpBar.SizeY + 1);
                        var manaperc = mana / maxMana;
                        Drawing.DrawRect(start, size + new Vector2(1, 1), new Color(0, 0, 50, 150));
                        Drawing.DrawRect(start, new Vector2(size.X * manaperc, size.Y), new Color(70, 120, 220));
                        Drawing.DrawRect(start + new Vector2(-1, -1), size + new Vector2(3, 3), Color.Black, true);
                    }
                    if (EnemyHeroes.AbilityDictionary.ContainsKey(heroName) && spellOverlayEnabledEnemy)
                    {
                        var abilities =
                            EnemyHeroes.AbilityDictionary[heroName].Where(
                                x => (int)x.AbilitySlot >= 0 && (int)x.AbilitySlot <= 5)
                            .OrderBy(x => (int)x.AbilitySlot);
                        var defaultPos = hpbarpos
                                         + new Vector2(
                            HpBar.SizeX / 2
                            - Math.Max((abilities.Count() / 2) * boxSizeX, HpBar.SizeX / 2),
                            HpBar.SizeY + size.Y + 3);
                        var position = defaultPos + new Vector2(boxExtraPosX, boxExtraPosY);
                        foreach (var ability in abilities)
                        {
                            DrawAbilityOverlay(ability, position, heroName, mana);
                            position += new Vector2(boxSizeX, 0);
                        }
                    }

                    if (MainMenu.AbilityOverlayMenu.Item("enableItemOverlayEnemy").GetValue <bool>())
                    {
                        if (!EnemyHeroes.ItemDictionary.ContainsKey(heroName))
                        {
                            continue;
                        }
                        var items   = EnemyHeroes.ItemDictionary[heroName].Where(ability => ability.IsValid).ToList();
                        var itemPos = hpbarpos
                                      - new Vector2(
                            -HpBar.SizeX / 2
                            + Math.Max((items.Count / 2) * itemBoxSizeX, HpBar.SizeX / 2),
                            itemBoxSizeY);
                        var ItemPosExtra = itemPos + new Vector2(itemboxExtraPosX, itemboxExtraPosY);
                        foreach (var ability in items)
                        {
                            DrawItemOverlay(ability, ItemPosExtra, mana);
                            ItemPosExtra += new Vector2(itemBoxSizeX, 0);
                        }
                    }
                }
            }
            catch (EntityNotFoundException e)
            {
                EnemyHeroes.UpdateHeroes();
                Console.WriteLine(e.ToString());
            }

            var spellOverlayEnabledAlly = MainMenu.AbilityOverlayMenu.Item("enableSpellOverlayAlly").GetValue <bool>();

            try
            {
                foreach (var hero in AllyHeroes.UsableHeroes)
                {
                    var heroName = NameManager.Name(hero);
                    var mana     = hero.Mana;
                    var hpbarpos = HpBar.HpBarPositionDictionary[heroName];
                    if (hpbarpos.X + 20 > HUDInfo.ScreenSizeX() || hpbarpos.X - 20 < 0 ||
                        hpbarpos.Y + 100 > HUDInfo.ScreenSizeY() || hpbarpos.Y - 30 < 0)
                    {
                        continue;
                    }

                    if (spellOverlayEnabledAlly && AllyHeroes.AbilityDictionary.ContainsKey(heroName))
                    {
                        var abilities =
                            AllyHeroes.AbilityDictionary[heroName].Where(
                                x => (int)x.AbilitySlot >= 0 && (int)x.AbilitySlot <= 5)
                            .OrderBy(x => (int)x.AbilitySlot);
                        var defaultPos = hpbarpos
                                         + new Vector2(
                            HpBar.SizeX / 2
                            - Math.Max((abilities.Count() / 2) * boxSizeX, HpBar.SizeX / 2),
                            HpBar.SizeY + size.Y + 3);
                        if (hero.Equals(AbilityMain.Me))
                        {
                            defaultPos += new Vector2(-3, 3);
                        }

                        var position = defaultPos + new Vector2(boxExtraPosX, boxExtraPosY);
                        foreach (var ability in abilities)
                        {
                            DrawAbilityOverlay(ability, position, heroName, mana);
                            position += new Vector2(boxSizeX, 0);
                        }
                    }

                    if (MainMenu.AbilityOverlayMenu.Item("enableItemOverlayAlly").GetValue <bool>())
                    {
                        if (!AllyHeroes.ItemDictionary.ContainsKey(heroName))
                        {
                            continue;
                        }

                        var items   = AllyHeroes.ItemDictionary[heroName].Where(ability => ability.IsValid).ToList();
                        var itemPos = hpbarpos
                                      - new Vector2(
                            -HpBar.SizeX / 2
                            + Math.Max((items.Count / 2) * itemBoxSizeX, HpBar.SizeX / 2),
                            itemBoxSizeY);
                        var ItemPosExtra = itemPos + new Vector2(itemboxExtraPosX, itemboxExtraPosY);
                        if (hero.Equals(AbilityMain.Me))
                        {
                            ItemPosExtra += new Vector2(-3, 1);
                        }

                        foreach (var ability in items)
                        {
                            DrawItemOverlay(ability, ItemPosExtra, mana);
                            ItemPosExtra += new Vector2(itemBoxSizeX, 0);
                        }
                    }
                }
            }
            catch (EntityNotFoundException e)
            {
                AllyHeroes.UpdateHeroes();
                Console.WriteLine(e.ToString());
            }
        }
Esempio n. 29
0
        public static void Drawing_OnDraw(EventArgs args)
        {
            if (!Game.IsInGame || !allies.Any() || !enemies.Any() || !IncomingDamages.Any() || AbilityMain.Me == null ||
                !AbilityMain.Me.IsValid || !MainMenu.GankDamageMenu.Item("enableGankDamage").GetValue <bool>())
            {
                return;
            }

            if (MainMenu.GankDamageMenu.Item("enableGankDamageAllies").GetValue <bool>())
            {
                foreach (var ally in allies.Where(x => x != null && IncomingDamages.ContainsKey(NameManager.Name(x))))
                {
                    var     health    = ally.Health;
                    var     maxHealth = ally.MaximumHealth;
                    var     allyName  = NameManager.Name(ally);
                    var     hpleft    = Math.Max(health - IncomingDamages[allyName], 0);
                    var     hpperc    = hpleft / maxHealth;
                    var     dmgperc   = Math.Min(IncomingDamages[allyName], health) / maxHealth;
                    Vector2 hbarpos;
                    HpBar.HpBarPositionDictionary.TryGetValue(allyName, out hbarpos);
                    if (hbarpos.X + 20 > HUDInfo.ScreenSizeX() || hbarpos.X - 20 < 0 ||
                        hbarpos.Y + 100 > HUDInfo.ScreenSizeY() || hbarpos.Y - 30 < 0)
                    {
                        continue;
                    }

                    var hpvarx   = HpBar.SizeX;
                    var hpbary   = HpBar.SizeY;
                    var position = hbarpos + new Vector2(hpvarx * hpperc, 0);
                    Drawing.DrawRect(
                        position,
                        new Vector2(hpvarx * dmgperc, (float)(hpbary * 0.4)),
                        (hpleft > 0) ? new Color(190, 150, 130, 100) : new Color(225, 70, 70, 200));
                    Drawing.DrawRect(position, new Vector2(hpvarx * dmgperc, (float)(hpbary * 0.4)), Color.Black, true);
                }
            }

            if (!MainMenu.GankDamageMenu.Item("enableGankDamageEnemies").GetValue <bool>())
            {
                return;
            }

            foreach (var enemy in enemies.Where(x => x != null && IncomingDamages.ContainsKey(NameManager.Name(x))))
            {
                var     health    = enemy.Health;
                var     maxHealth = enemy.MaximumHealth;
                var     enemyName = NameManager.Name(enemy);
                var     hpleft    = Math.Max(health - IncomingDamages[enemyName], 0);
                var     hpperc    = hpleft / maxHealth;
                var     dmgperc   = Math.Min(IncomingDamages[enemyName], health) / maxHealth;
                Vector2 hbarpos;
                HpBar.HpBarPositionDictionary.TryGetValue(enemyName, out hbarpos);
                if (hbarpos.X + 20 > HUDInfo.ScreenSizeX() || hbarpos.X - 20 < 0 ||
                    hbarpos.Y + 100 > HUDInfo.ScreenSizeY() || hbarpos.Y - 30 < 0)
                {
                    continue;
                }

                var hpvarx   = HpBar.SizeX;
                var hpbary   = HpBar.SizeY;
                var position = hbarpos + new Vector2(hpvarx * hpperc, 0);
                Drawing.DrawRect(
                    position,
                    new Vector2(hpvarx * dmgperc, (float)(hpbary * 0.4)),
                    (hpleft > 0) ? new Color(150, 225, 150, 80) : new Color(70, 225, 150, 225));
                Drawing.DrawRect(position, new Vector2(hpvarx * dmgperc, (float)(hpbary * 0.4)), Color.Black, true);
            }
        }
Esempio n. 30
0
        private static void Main()
        {
            Menu.AddItem(new MenuItem("key", "Enabled").SetValue(new KeyBind('P', KeyBindType.Toggle, true)));
            Menu.AddItem(new MenuItem("panicMode", "Panic mode").SetValue(new KeyBind('O', KeyBindType.Toggle))
                         .SetTooltip("Blink abilities will be used when enemy is close"));
            Menu.AddItem(new MenuItem("panicDistance", "Panic mode enemy distance").SetValue(new Slider(900, 200, 2000)))
            .SetTooltip("Will blink away when enemy is in this range");
            Menu.AddItem(new MenuItem("blink", "Use blink").SetValue(true)
                         .SetTooltip("Suports Blink Dagger and most of blink type abilities"));
            Menu.AddItem(new MenuItem("forceBlink", "Force blink dagger").SetValue(true)
                         .SetTooltip(
                             "Blink Dagger will be used on your hero position if it's not enough time to blink in fountain direction"));
            Menu.AddItem(new MenuItem("blinkSilenced", "Use blink when silenced").SetValue(true)
                         .SetTooltip("\"Use blink\" must be enabled"));
            Menu.AddItem(new MenuItem("center", "Center camera on blink").SetValue(true));
            Menu.AddItem(new MenuItem("disable", "Disable enemy if can't dodge").SetValue(false)
                         .SetTooltip("Use hex, stun, silence when you don't have eul, dagger, dark pact etc. to dodge stun"));
            Menu.AddItem(new MenuItem("diffusal", "Use diffusal blade when silenced").SetValue(false));
            Menu.AddItem(new MenuItem("delay", "Delay between abilities").SetValue(new Slider(600, 200, 1000)))
            .SetTooltip("Time in ms between counter abilities usage");
            Menu.AddItem(new MenuItem("castpointAdjustment", "Manual cast point adjustment").SetValue(new Slider(800, 500, 1000)))
            .SetTooltip("Change this if your spells are casted too early/late");
            Menu.AddItem(new MenuItem("size", "Text Size").SetValue(new Slider(6, 1, 10)))
            .SetTooltip("Reload assembly to apply new size");
            Menu.AddItem(new MenuItem("x", "Text position X").SetValue(new Slider(0, 0, (int)HUDInfo.ScreenSizeX())));
            Menu.AddItem(new MenuItem("y", "Text position Y").SetValue(new Slider(0, 0, (int)HUDInfo.ScreenSizeY())));
            Menu.AddToMainMenu();

            text = new Font(
                Drawing.Direct3DDevice9,
                new FontDescription {
                FaceName        = "Tahoma",
                Height          = 13 * (Menu.Item("size").GetValue <Slider>().Value / 2),
                OutputPrecision = FontPrecision.Raster,
                Quality         = FontQuality.ClearTypeNatural,
                CharacterSet    = FontCharacterSet.Hangul,
                MipLevels       = 3,
                PitchAndFamily  = FontPitchAndFamily.Modern,
                Weight          = FontWeight.Heavy,
                Width           = 5 * (Menu.Item("size").GetValue <Slider>().Value / 2)
            });

            Game.OnUpdate += Game_OnUpdate;

            Drawing.OnPreReset  += Drawing_OnPreReset;
            Drawing.OnPostReset += Drawing_OnPostReset;
            Drawing.OnEndScene  += Drawing_OnEndScene;
        }