WorldToMinimap() публичный статический Метод

public static WorldToMinimap ( System.Vector3 pos ) : System.Vector2
pos System.Vector3
Результат System.Vector2
Пример #1
0
        public TeleportCatcher()
        {
            _effectList     = new List <TeleportEffect>();
            Drawing.OnDraw += args =>
            {
                var safeList = new List <TeleportEffect>();
                foreach (var particleEffect in _effectList)
                {
                    var effect = particleEffect.GetEffect;
                    if (effect != null && effect.IsValid && !effect.IsDestroyed)
                    {
                        var position = particleEffect.GetPosition;
                        safeList.Add(particleEffect);
                        var pos    = DrawOnMiniMap ? Helper.WorldToMinimap(position) : new Vector2();
                        var player =
                            ObjectManager.GetPlayerByID(
                                (uint)ColorList.FindIndex(x => x == particleEffect.GetColor));
                        if (player == null || !player.IsValid)
                        {
                            continue;
                        }

                        var hero = player.Hero;
                        if (!pos.IsZero)
                        {
                            var size = new Vector2(MiniMapSize);

                            /*Drawing.DrawRect(pos - size, size,
                             *  new Color(particleEffect.GetColor.X, particleEffect.GetColor.Y,
                             *      particleEffect.GetColor.Z));*/

                            //Printer.Print($"Player: {player.Name} | Hero: {hero.GetRealName()}");
                            if (MinimapType)
                            {
                                Drawing.DrawRect(pos - size / 2, size, Helper.GetHeroTextureMinimap(hero.StoredName()));
                            }
                            else
                            {
                                Drawing.DrawRect(pos - size / 2, size, (Color)particleEffect.GetColor);
                                Drawing.DrawRect(pos - size / 2, size, Color.Black, true);
                            }
                        }
                        pos = DrawOnMap?Drawing.WorldToScreen(position):new Vector2();
                        if (!pos.IsZero)
                        {
                            var size = new Vector2(MapSize);

                            /*Drawing.DrawRect(pos - size, size,
                             *  new Color(particleEffect.GetColor.X, particleEffect.GetColor.Y,
                             *      particleEffect.GetColor.Z));*/

                            //Printer.Print($"Player: {player.Name} | Hero: {hero.GetRealName()}");
                            Drawing.DrawRect(pos - size / 2, size, Helper.GetHeroTextureMinimap(hero.StoredName()));
                            //Drawing.DrawRect(pos - size, size, Color.Black,true);
                        }
                    }
                }
                _effectList = safeList;
            };
        }
Пример #2
0
 private static void DrawLastPosition()
 {
     //var particleAttachment = ParticleAttachment.OverheadFollow;
     // new ParticleEffect(@"", target, ParticleAttachment.OverheadFollow);
     foreach (var hero in Members.EnemyHeroes.Where(x => x.IsAlive && !x.IsVisible))
     {
         if (Members.Menu.Item("lastPosition.Enable.Minimap").GetValue <bool>())
         {
             var size = new Vector2(Members.Menu.Item("lastPosition.Minimap.X").GetValue <Slider>().Value,
                                    Members.Menu.Item("lastPosition.Minimap.X").GetValue <Slider>().Value);
             if (Members.Menu.Item("lastPosition.Enable.Prediction").GetValue <bool>())
             {
                 if (Members.PredictionTimes.ContainsKey(hero.StoredName()))
                 {
                     Drawing.DrawRect(Helper.WorldToMinimap(Prediction.InFront(hero,
                                                                               hero.MovementSpeed * (Game.GameTime - Members.PredictionTimes[hero.StoredName()]))) +
                                      new Vector2(-size.X / 2, -size.Y / 2), size,
                                      Helper.GetHeroTextureMinimap(hero.StoredName()));
                 }
             }
             else
             {
                 Drawing.DrawRect(Helper.WorldToMinimap(hero.Position) + new Vector2(-size.X / 2, -size.Y / 2), size,
                                  Helper.GetHeroTextureMinimap(hero.StoredName()));
             }
         }
         if (Members.Menu.Item("lastPosition.Enable.Map").GetValue <bool>())
         {
             Vector2 newPos;
             if (Drawing.WorldToScreen(hero.Position, out newPos))
             {
                 var size = new Vector2(Members.Menu.Item("lastPosition.Map.X").GetValue <Slider>().Value,
                                        Members.Menu.Item("lastPosition.Map.X").GetValue <Slider>().Value);
                 if (Members.Menu.Item("lastPosition.Enable.Prediction").GetValue <bool>())
                 {
                     if (Members.PredictionTimes.ContainsKey(hero.StoredName()))
                     {
                         Drawing.DrawRect(
                             Drawing.WorldToScreen(Prediction.InFront(hero,
                                                                      hero.MovementSpeed * (Game.GameTime - Members.PredictionTimes[hero.StoredName()]))) +
                             new Vector2(-size.X / 2, (float)(-size.Y * 2.5)),
                             size,
                             Textures.GetHeroTexture(hero.StoredName()));
                     }
                 }
                 else
                 {
                     Drawing.DrawRect(newPos + new Vector2(-size.X / 2, -size.Y * 2), size,
                                      Textures.GetHeroTexture(hero.StoredName()));
                 }
             }
         }
     }
 }
Пример #3
0
 private static void Drawing_OnDraw(EventArgs args)
 {
     if (Game.IsKeyDown(9))
     {
         Points.Clear();
     }
     foreach (var p in Points)
     {
         var pos = Helper.WorldToMinimap(p);
         Drawing.DrawCircle(pos, 2, 50, Color.White);
         pos = Drawing.WorldToScreen(p);
         Drawing.DrawCircle(pos, 10, 50, Color.White);
     }
 }
Пример #4
0
 public static void Draw(EventArgs args)
 {
     if (!Checker.IsActive())
     {
         return;
     }
     if (!Members.Menu.Item("runevision.DrawOnMinimap.Enable").GetValue <bool>())
     {
         return;
     }
     foreach (var rune in InSystem.Where(rune => rune != null && rune.IsValid && rune.RuneType != RuneType.Bounty))
     {
         var v     = rune;
         var size3 = new Vector2(10, 25) + new Vector2(13, -6);
         var w2M   = Helper.WorldToMinimap(v.NetworkPosition);
         var name  = RuneTypes[v.RuneType];
         Drawing.DrawRect(w2M - new Vector2(size3.X / 2, size3.Y / 2), size3,
                          Drawing.GetTexture(name));
     }
 }
Пример #5
0
 private static void DrawLastPosition()
 {
     foreach (var hero in Members.EnemyHeroes.Where(x => x.IsAlive && !x.IsVisible))
     {
         if (Members.Menu.Item("lastPosition.Enable.Minimap").GetValue <bool>())
         {
             var size = new Vector2(Members.Menu.Item("lastPosition.Minimap.X").GetValue <Slider>().Value,
                                    Members.Menu.Item("lastPosition.Minimap.X").GetValue <Slider>().Value);
             Drawing.DrawRect(Helper.WorldToMinimap(hero.Position), size,
                              Textures.GetHeroTexture(hero.StoredName()));
         }
         if (Members.Menu.Item("lastPosition.Enable.Map").GetValue <bool>())
         {
             Vector2 newPos;
             if (Drawing.WorldToScreen(hero.Position, out newPos))
             {
                 var size = new Vector2(Members.Menu.Item("lastPosition.Map.X").GetValue <Slider>().Value,
                                        Members.Menu.Item("lastPosition.Map.X").GetValue <Slider>().Value);
                 Drawing.DrawRect(Drawing.WorldToScreen(hero.Position), size,
                                  Textures.GetHeroTexture(hero.StoredName()));
             }
         }
     }
 }
Пример #6
0
 public static void Draw(EventArgs args)
 {
     if (!Checker.IsActive())
     {
         return;
     }
     if (!Members.Menu.Item("showmemore.Enable").GetValue <bool>())
     {
         return;
     }
     if (AAunit != null && AAunit.IsValid)
     {
         var aapos = Drawing.WorldToScreen(AAunit.Position);
         if (aapos.X > 0 && aapos.Y > 0)
         {
             Drawing.DrawLine(Drawing.WorldToScreen(Members.MyHero.Position), aapos, Color.AliceBlue);
             const string name = "materials/ensage_ui/spellicons/ancient_apparition_ice_blast.vmat";
             Drawing.DrawRect(aapos, new Vector2(50, 50), Drawing.GetTexture(name));
         }
     }
     if (Members.BaraIsHere)
     {
         foreach (var v in Manager.HeroManager.GetAllyViableHeroes())
         {
             var mod = v.HasModifier("modifier_spirit_breaker_charge_of_darkness_vision");
             if (mod)
             {
                 if (Equals(Members.MyHero, v))
                 {
                     Drawing.DrawRect(new Vector2(0, 0), new Vector2(Drawing.Width, Drawing.Height),
                                      new Color(Members.Menu.Item("charge" + ".Red").GetValue <Slider>().Value,
                                                Members.Menu.Item("charge" + ".Green").GetValue <Slider>().Value,
                                                Members.Menu.Item("charge" + ".Blue").GetValue <Slider>().Value,
                                                Members.Menu.Item("charge" + ".Alpha").GetValue <Slider>().Value));
                 }
                 if (!InSys.Contains(v))
                 {
                     Helper.GenerateSideMessage(v.Name.Replace("npc_dota_hero_", ""),
                                                "spirit_breaker_charge_of_darkness");
                     InSys.Add(v);
                 }
             }
             else
             {
                 if (InSys.Contains(v))
                 {
                     InSys.Remove(v);
                 }
             }
         }
     }
     if (Members.PAisHere != null)
     {
         var mod = Members.PAisHere.HasModifier("modifier_phantom_assassin_blur_active");
         if (mod && Members.PAisHere.StoredName() == "npc_dota_hero_phantom_assassin")
         {
             var size3 = new Vector2(10, 20) + new Vector2(13, -6);
             var w2M   = Helper.WorldToMinimap(Members.PAisHere.NetworkPosition);
             var name  = "materials/ensage_ui/miniheroes/" +
                         Members.PAisHere.StoredName().Replace("npc_dota_hero_", "") + ".vmat";
             Drawing.DrawRect(w2M - new Vector2(size3.X / 2, size3.Y / 2), size3,
                              Drawing.GetTexture(name));
         }
     }
 }
Пример #7
0
        public static void Draw(EventArgs args)
        {
            if (!Checker.IsActive())
            {
                return;
            }
            if (!Members.Menu.Item("showmemore.Enable").GetValue <bool>())
            {
                return;
            }
            if (Members.Menu.Item("apparition.Enable").GetValue <bool>() && AAunit != null && AAunit.IsValid)
            {
                try
                {
                    var aapos = Drawing.WorldToScreen(AAunit.Position);
                    if (!aapos.IsZero)
                    {
                        var myHeroPos = Drawing.WorldToScreen(Members.MyHero.Position);
                        if (!myHeroPos.IsZero)
                        {
                            Drawing.DrawLine(Drawing.WorldToScreen(Members.MyHero.Position), aapos, Color.AliceBlue);
                            const string name = "materials/ensage_ui/spellicons/ancient_apparition_ice_blast.vmat";
                            Drawing.DrawRect(aapos, new Vector2(50, 50), Drawing.GetTexture(name));
                        }
                    }
                }
                catch (Exception)
                {
                    Printer.Print("[Draw]: Apparation");
                }
            }
            if (Members.Menu.Item("tinker.Enable").GetValue <bool>())
            {
                try
                {
                    if (Members.Tinker != null && Members.Tinker.IsValid)
                    {
                        var baseList =
                            Manager.BaseManager.GetBaseList()
                            .Where(x => x.IsAlive && x.HasModifier("modifier_tinker_march_thinker"));
                        foreach (var unit in baseList)
                        {
                            var realPos = unit.Position;
                            var pos     = Drawing.WorldToScreen(realPos);
                            var texture = Textures.GetSpellTexture("tinker_march_of_the_machines");
                            if (pos.X > 0 && pos.Y > 0)
                            {
                                Drawing.DrawRect(pos, new Vector2(50, 50), texture);
                            }
                            var pos2 = Helper.WorldToMinimap(realPos);
                            Drawing.DrawRect(pos2 - new Vector2(10, 10), new Vector2(10, 10), texture);
                        }
                    }
                }
                catch (Exception)
                {
                    Printer.Print("[Draw]: Tinker");
                }
            }
            if (Members.Menu.Item("tech.Enable").GetValue <bool>())
            {
                try
                {
                    if (Members.Techies != null && Members.Techies.IsValid)
                    {
                        var baseList =
                            ObjectManager.GetEntities <Unit>()
                            .Where(x => x.IsAlive && x.ClassID == ClassID.CDOTA_NPC_TechiesMines && x.Team != Members.MyHero.Team && !Bombs.Contains(x));
                        foreach (var unit in baseList)
                        {
                            Bombs.Add(unit);
                        }
                        foreach (var bomb in Bombs)
                        {
                            if (!bomb.IsValid)
                            {
                                continue;
                            }
                            if (bomb.IsVisible)
                            {
                                continue;
                            }
                            var realPos = bomb.Position;
                            var pos     = Drawing.WorldToScreen(realPos);
                            var texture = bomb.Spellbook.Spell1 != null
                                ? Textures.GetTexture("materials/ensage_ui/other/npc_dota_techies_remote_mine.vmat")
                                : Textures.GetTexture("materials/ensage_ui/other/npc_dota_techies_land_mine.vmat");

                            if (pos.X > 0 && pos.Y > 0)
                            {
                                Drawing.DrawRect(pos, new Vector2(50, 50), texture);
                            }
                            var pos2 = Helper.WorldToMinimap(realPos);
                            Drawing.DrawRect(pos2 - new Vector2(15, 15), new Vector2(15, 15), texture);
                        }
                    }
                }
                catch (Exception)
                {
                    Printer.Print("[Draw]: Techies");
                }
            }
            if (Members.Menu.Item("scan.Enable").GetValue <bool>())
            {
                if (Members.ScanEnemy != null && Members.ScanEnemy.IsValid)
                {
                    try
                    {
                        var position = Members.ScanEnemy.Position;
                        var w2S      = Drawing.WorldToScreen(position);
                        if (!w2S.IsZero)
                        {
                            Drawing.DrawText(
                                "Scan Ability " +
                                Members.ScanEnemy.FindModifier("modifier_radar_thinker").RemainingTime.ToString("F1"),
                                w2S,
                                new Vector2(15, 15),
                                Color.White,
                                FontFlags.AntiAlias | FontFlags.StrikeOut);
                        }
                    }
                    catch (Exception)
                    {
                        Printer.Print("[Draw]: scan");
                    }
                }
            }
            if (Members.Menu.Item("charge.Enable").GetValue <bool>() && Members.BaraIsHere)
            {
                try
                {
                    foreach (var v in Manager.HeroManager.GetAllyViableHeroes())
                    {
                        var mod = v.HasModifier("modifier_spirit_breaker_charge_of_darkness_vision");
                        if (mod)
                        {
                            if (Equals(Members.MyHero, v))
                            {
                                Drawing.DrawRect(new Vector2(0, 0), new Vector2(Drawing.Width, Drawing.Height),
                                                 new Color(Members.Menu.Item("charge" + ".Red").GetValue <Slider>().Value,
                                                           Members.Menu.Item("charge" + ".Green").GetValue <Slider>().Value,
                                                           Members.Menu.Item("charge" + ".Blue").GetValue <Slider>().Value,
                                                           Members.Menu.Item("charge" + ".Alpha").GetValue <Slider>().Value));
                            }
                            if (!InSys.Contains(v))
                            {
                                Helper.GenerateSideMessage(v.Name.Replace("npc_dota_hero_", ""),
                                                           "spirit_breaker_charge_of_darkness");
                                InSys.Add(v);
                            }
                            else
                            {
                                var pos = HUDInfo.GetHPbarPosition(v);
                                if (!pos.IsZero)
                                {
                                    Drawing.DrawRect(pos - new Vector2(50, 0), new Vector2(30, 30),
                                                     Textures.GetSpellTexture("spirit_breaker_charge_of_darkness"));
                                    Drawing.DrawRect(pos - new Vector2(50, 0), new Vector2(30, 30),
                                                     Color.Red, true);
                                }
                            }
                        }
                        else
                        {
                            if (InSys.Contains(v))
                            {
                                InSys.Remove(v);
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    Printer.Print("[Draw]: charge " + e.Message);
                }
            }
            if (Members.Menu.Item("lifestealer.Enable").GetValue <bool>() && Members.LifeStealer != null && Members.LifeStealer.IsValid && !Members.LifeStealer.IsVisible)
            {
                try
                {
                    const string modname = "modifier_life_stealer_infest_effect";
                    foreach (var t in Manager.HeroManager.GetEnemyViableHeroes().Where(x => x.HasModifier(modname)))
                    {
                        var size3  = new Vector2(10, 20) + new Vector2(13, -6);
                        var w2SPos = HUDInfo.GetHPbarPosition(t);
                        if (w2SPos.IsZero)
                        {
                            continue;
                        }
                        var name = "materials/ensage_ui/miniheroes/" +
                                   Members.LifeStealer.StoredName().Replace("npc_dota_hero_", "") + ".vmat";
                        Drawing.DrawRect(w2SPos - new Vector2(size3.X / 2, size3.Y / 2), size3,
                                         Drawing.GetTexture(name));
                    }
                    if (Members.Menu.Item("lifestealer.creeps.Enable").GetValue <bool>())
                    {
                        foreach (var t in Creeps.All.Where(x => x != null && x.IsAlive && x.HasModifier(modname)))
                        {
                            var size3  = new Vector2(10, 20) + new Vector2(13, -6);
                            var w2SPos = HUDInfo.GetHPbarPosition(t);
                            if (w2SPos.IsZero)
                            {
                                continue;
                            }
                            var name = "materials/ensage_ui/miniheroes/" +
                                       Members.LifeStealer.StoredName().Replace("npc_dota_hero_", "") + ".vmat";
                            Drawing.DrawRect(w2SPos - new Vector2(size3.X / 2, size3.Y / 2), size3,
                                             Drawing.GetTexture(name));
                        }
                    }
                }
                catch (Exception)
                {
                    Printer.Print("[Draw]: lifestealer");
                }
            }
            if (Members.Menu.Item("blur.Enable").GetValue <bool>() && Members.PAisHere != null && Members.PAisHere.IsValid)
            {
                try
                {
                    var mod = Members.PAisHere.HasModifier("modifier_phantom_assassin_blur_active");
                    if (mod && Members.PAisHere.StoredName() == "npc_dota_hero_phantom_assassin")
                    {
                        var size3 = new Vector2(10, 20) + new Vector2(13, -6);
                        var w2M   = Helper.WorldToMinimap(Members.PAisHere.NetworkPosition);
                        var name  = "materials/ensage_ui/miniheroes/" +
                                    Members.PAisHere.StoredName().Replace("npc_dota_hero_", "") + ".vmat";
                        Drawing.DrawRect(w2M - new Vector2(size3.X / 2, size3.Y / 2), size3,
                                         Drawing.GetTexture(name));
                    }
                }
                catch (Exception)
                {
                    Printer.Print("[Draw]: phantom assasin");
                }
            }
        }