Beispiel #1
0
 private void Init()
 {
     Render.Rectangle rec = new Render.Rectangle(Drawing.Width / 2 - 200 / 2, (int)(Drawing.Height / 1.5f), 200, 10, SharpDX.Color.Black);
     rec.VisibleCondition = delegate
     {
         return(IsActive() && _recalls.Any(x => x.Recall.Status == Packet.S2C.Teleport.Status.Start && (x.Recall.Start + x.Recall.Duration - Environment.TickCount) > 0));
     };
     rec.Add(0);
 }
Beispiel #2
0
 private void Blink()
 {
     if (!active || Game.ClockTime < time)
     {
         return;
     }
     time = Game.ClockTime + .5f;
     curs.Remove();
     cursorActive = !cursorActive;
     if (cursorActive && active)
     {
         curs.Add();
     }
     else
     {
         curs.Remove();
     }
 }
        /// <summary>
        /// Loads the sprites.
        /// </summary>
        private static void LoadSprites()
        {
            foreach (var player in ObjectManager.Get <Obj_AI_Hero>().Where(h => !h.IsMe))
            {
                try
                {
                    var player_Ex = player;

                    var Summoner1Bitmap =
                        TrackerVariables.summonerSpells[player_Ex.Spellbook.GetSpell(SpellSlot.Summoner1).Name.ToLower()];
                    var Summoner2Bitmap =
                        TrackerVariables.summonerSpells[player_Ex.Spellbook.GetSpell(SpellSlot.Summoner2).Name.ToLower()];

                    Render.Sprite SummonerSpell1 = new Render.Sprite(Resources.empty, new Vector2());
                    Render.Sprite SummonerSpell2 = new Render.Sprite(Resources.empty, new Vector2());
                    var           member         = new TrackerWrapper();
                    var           scale          = 0.94f;
                    var           offset         = 8 * scale;
                    var           offsetX        = 0;

                    var Hudsprite = new Render.Sprite(TrackerVariables.TrackerHud, new Vector2(0, 0))
                    {
                        PositionUpdate   = () => new Vector2(player_Ex.HPBarPosition.X - 14 * scale, player_Ex.HPBarPosition.Y + offset + 6 * scale),
                        VisibleCondition = sender => player_Ex.IsHPBarRendered && (((player_Ex.IsAlly || player_Ex.IsMe) && TrackerVariables.TrackAllies) || (player_Ex.IsEnemy && TrackerVariables.TrackEnemies)),
                        Scale            = new Vector2(1.0f, 1.0f)
                    };

                    try
                    {
                        Hudsprite.Add(0);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e);
                    }


                    #region Summoner Spells
                    if (Summoner1Bitmap != null)
                    {
                        SummonerSpell1 = new Render.Sprite(Summoner1Bitmap, new Vector2(0, 0))
                        {
                            PositionUpdate   = () => new Vector2(player_Ex.HPBarPosition.X - 8 * scale, player_Ex.HPBarPosition.Y + offset + 8 * scale),
                            VisibleCondition = sender => player_Ex.IsHPBarRendered && (((player_Ex.IsAlly || player_Ex.IsMe) && TrackerVariables.TrackAllies) || (player_Ex.IsEnemy && TrackerVariables.TrackEnemies)),
                            Scale            = new Vector2(1.0f, 1.0f)
                        };
                        SummonerSpell1.Add(0);
                        member.Summoner1 = SummonerSpell1;

                        var Summoner1Rectangle = new Render.Rectangle((int)player_Ex.HPBarPosition.X - 7, (int)player_Ex.HPBarPosition.Y + 8, 13, 13, new ColorBGRA(0, 0, 0, 175))
                        {
                            VisibleCondition = sender => player_Ex.IsHPBarRendered && (((player_Ex.IsAlly || player_Ex.IsMe) && TrackerVariables.TrackAllies) || (player_Ex.IsEnemy && TrackerVariables.TrackEnemies)),
                            PositionUpdate   = () => new Vector2((int)player_Ex.HPBarPosition.X - 7 * scale, (int)player_Ex.HPBarPosition.Y + offset + 8 * scale),
                        };
                        Summoner1Rectangle.Add(0);

                        member.SummonerSpell1Rectangle = Summoner1Rectangle;

                        var spellCooldown = player_Ex.Spellbook.GetSpell(SpellSlot.Summoner1).CooldownExpires - Game.Time;

                        var Summoner1Text = new Render.Text((int)player_Ex.HPBarPosition.X - 31, (int)player_Ex.HPBarPosition.Y + 6, ((int)spellCooldown).ToString(), 14, new ColorBGRA(255, 255, 255, 255))
                        {
                            TextUpdate = () => ((int)(player_Ex.Spellbook.GetSpell(SpellSlot.Summoner1).CooldownExpires - Game.Time) > 0 ?
                                                ((int)(player_Ex.Spellbook.GetSpell(SpellSlot.Summoner1).CooldownExpires - Game.Time)).ToString()
                                : string.Empty),
                            PositionUpdate   = () => new Vector2((int)player_Ex.HPBarPosition.X - 31 * scale, (int)player_Ex.HPBarPosition.Y + offset + 6 * scale),
                            VisibleCondition = sender => MenuExtensions.GetItemValue <bool>("dz191.dza.tracker.track.cd") && player_Ex.IsHPBarRendered && (player_Ex.Spellbook.GetSpell(SpellSlot.Summoner1).CooldownExpires - Game.Time) > 0 && (((player_Ex.IsAlly || player_Ex.IsMe) && TrackerVariables.TrackAllies) || (player_Ex.IsEnemy && TrackerVariables.TrackEnemies))
                        };

                        Summoner1Text.Add(0);

                        member.SummonerSpell1Text = Summoner1Text;
                    }

                    if (Summoner2Bitmap != null)
                    {
                        SummonerSpell2 = new Render.Sprite(Summoner2Bitmap, new Vector2(0, 0))
                        {
                            PositionUpdate   = () => new Vector2(player_Ex.HPBarPosition.X - 8 * scale, player_Ex.HPBarPosition.Y + offset + 25 * scale),
                            VisibleCondition = sender => player_Ex.IsHPBarRendered && (((player_Ex.IsAlly || player_Ex.IsMe) && TrackerVariables.TrackAllies) || (player_Ex.IsEnemy && TrackerVariables.TrackEnemies)),
                            Scale            = new Vector2(1.0f, 1.0f)
                        };
                        SummonerSpell2.Add(0);
                        member.Summoner2 = SummonerSpell2;

                        var Summoner2Rectangle = new Render.Rectangle((int)player_Ex.HPBarPosition.X - 7, (int)player_Ex.HPBarPosition.Y + 26, 13, 13, new ColorBGRA(0, 0, 0, 175))
                        {
                            VisibleCondition = sender => player_Ex.IsHPBarRendered && (((player_Ex.IsAlly || player_Ex.IsMe) && TrackerVariables.TrackAllies) || (player_Ex.IsEnemy && TrackerVariables.TrackEnemies)),
                            PositionUpdate   = () => new Vector2((int)player_Ex.HPBarPosition.X - 7 * scale, (int)player_Ex.HPBarPosition.Y + offset + 26 * scale),
                        };
                        Summoner2Rectangle.Add(0);

                        var spellCooldown = player_Ex.Spellbook.GetSpell(SpellSlot.Summoner2).CooldownExpires - Game.Time;

                        var Summoner2Text = new Render.Text((int)player_Ex.HPBarPosition.X - 31, (int)player_Ex.HPBarPosition.Y + 24, ((int)spellCooldown).ToString(), 14, new ColorBGRA(255, 255, 255, 255))
                        {
                            TextUpdate = () => ((int)(player_Ex.Spellbook.GetSpell(SpellSlot.Summoner2).CooldownExpires - Game.Time) > 0 ?
                                                ((int)(player_Ex.Spellbook.GetSpell(SpellSlot.Summoner2).CooldownExpires - Game.Time)).ToString()
                                : string.Empty),
                            PositionUpdate   = () => new Vector2((int)player_Ex.HPBarPosition.X - 31 * scale, (int)player_Ex.HPBarPosition.Y + offset + 24 * scale),
                            VisibleCondition = sender => MenuExtensions.GetItemValue <bool>("dz191.dza.tracker.track.cd") && player_Ex.IsHPBarRendered && (player_Ex.Spellbook.GetSpell(SpellSlot.Summoner2).CooldownExpires - Game.Time) > 0 && (((player_Ex.IsAlly || player_Ex.IsMe) && TrackerVariables.TrackAllies) || (player_Ex.IsEnemy && TrackerVariables.TrackEnemies))
                        };
                        Summoner2Text.Add(0);

                        member.SummonerSpell2Text      = Summoner2Text;
                        member.SummonerSpell2Rectangle = Summoner2Rectangle;
                    }
                    #endregion

                    #region Normal Spells

                    #region Spell1
                    var slot1 = SpellSlot.Q;

                    var Spell1Rectangle = new Render.Sprite(Resources.CooldownSprite, new Vector2((int)player_Ex.HPBarPosition.X + 13, (int)player_Ex.HPBarPosition.Y + 30))
                    {
                        VisibleCondition = sender => player_Ex.IsHPBarRendered && (((player_Ex.IsAlly || player_Ex.IsMe) && TrackerVariables.TrackAllies) || (player_Ex.IsEnemy && TrackerVariables.TrackEnemies)),
                        PositionUpdate   = () => new Vector2(player_Ex.HPBarPosition.X + offsetX + 13.2f * scale, (int)player_Ex.HPBarPosition.Y + offset + 28 * scale),
                    };

                    member.Spell1Rectangle = Spell1Rectangle;
                    Spell1Rectangle.Add(0);

                    var Spell1Text = new Render.Text((int)player_Ex.HPBarPosition.X + 16, (int)player_Ex.HPBarPosition.Y + 33, string.Empty, 14, new ColorBGRA(255, 255, 255, 255))
                    {
                        TextUpdate = () => ((player_Ex.Spellbook.GetSpell(slot1).CooldownExpires - Game.Time) > 0 ?
                                            (Truncate((player_Ex.Spellbook.GetSpell(slot1).CooldownExpires - Game.Time)))
                            : string.Empty),
                        PositionUpdate   = () => new Vector2((int)player_Ex.HPBarPosition.X + offsetX + 16 * scale, (int)player_Ex.HPBarPosition.Y + offset + 33 * scale),
                        VisibleCondition = sender => MenuExtensions.GetItemValue <bool>("dz191.dza.tracker.track.cd") && player_Ex.IsHPBarRendered && (player_Ex.Spellbook.GetSpell(slot1).CooldownExpires - Game.Time) > 0 && (((player_Ex.IsAlly || player_Ex.IsMe) && TrackerVariables.TrackAllies) || (player_Ex.IsEnemy && TrackerVariables.TrackEnemies))
                    };

                    member.Spell1Text = Spell1Text;
                    Spell1Text.Add(0);
                    #endregion

                    #region Spell2
                    var slot2 = SpellSlot.W;

                    var Spell2Rectangle = new Render.Sprite(Resources.CooldownSprite, new Vector2((int)player_Ex.HPBarPosition.X + 41, (int)player_Ex.HPBarPosition.Y + 30))
                    {
                        VisibleCondition = sender => player_Ex.IsHPBarRendered && (((player_Ex.IsAlly || player_Ex.IsMe) && TrackerVariables.TrackAllies) || (player_Ex.IsEnemy && TrackerVariables.TrackEnemies)),
                        PositionUpdate   = () => new Vector2(player_Ex.HPBarPosition.X + offsetX + 41f * scale, (int)player_Ex.HPBarPosition.Y + offset + 28 * scale),
                    };

                    member.Spell2Rectangle = Spell2Rectangle;
                    Spell2Rectangle.Add(0);

                    var Spell2Text = new Render.Text((int)player_Ex.HPBarPosition.X + 44, (int)player_Ex.HPBarPosition.Y + 33, string.Empty, 14, new ColorBGRA(255, 255, 255, 255))
                    {
                        TextUpdate = () => ((player_Ex.Spellbook.GetSpell(slot2).CooldownExpires - Game.Time) > 0 ?
                                            (Truncate((player_Ex.Spellbook.GetSpell(slot2).CooldownExpires - Game.Time)))
                            : string.Empty),
                        PositionUpdate   = () => new Vector2((int)player_Ex.HPBarPosition.X + offsetX + 43.8f * scale, (int)player_Ex.HPBarPosition.Y + offset + 33 * scale),
                        VisibleCondition = sender => MenuExtensions.GetItemValue <bool>("dz191.dza.tracker.track.cd") && player_Ex.IsHPBarRendered && (player_Ex.Spellbook.GetSpell(slot2).CooldownExpires - Game.Time) > 0 && (((player_Ex.IsAlly || player_Ex.IsMe) && TrackerVariables.TrackAllies) || (player_Ex.IsEnemy && TrackerVariables.TrackEnemies))
                    };

                    member.Spell2Text = Spell2Text;
                    Spell2Text.Add(0);
                    #endregion

                    #region Spell3
                    var slot3 = SpellSlot.E;

                    var Spell3Rectangle = new Render.Sprite(Resources.CooldownSprite, new Vector2((int)player_Ex.HPBarPosition.X + 41, (int)player_Ex.HPBarPosition.Y + 30))
                    {
                        VisibleCondition = sender => player_Ex.IsHPBarRendered && (((player_Ex.IsAlly || player_Ex.IsMe) && TrackerVariables.TrackAllies) || (player_Ex.IsEnemy && TrackerVariables.TrackEnemies)),
                        PositionUpdate   = () => new Vector2(player_Ex.HPBarPosition.X + offsetX + 69f * scale, (int)player_Ex.HPBarPosition.Y + offset + 28 * scale),
                    };

                    member.Spell3Rectangle = Spell3Rectangle;
                    Spell3Rectangle.Add(0);

                    var Spell3Text = new Render.Text((int)player_Ex.HPBarPosition.X + 44, (int)player_Ex.HPBarPosition.Y + 33, string.Empty, 14, new ColorBGRA(255, 255, 255, 255))
                    {
                        TextUpdate = () => ((player_Ex.Spellbook.GetSpell(slot3).CooldownExpires - Game.Time) > 0 ?
                                            (Truncate((player_Ex.Spellbook.GetSpell(slot3).CooldownExpires - Game.Time)))
                            : string.Empty),
                        PositionUpdate   = () => new Vector2((int)player_Ex.HPBarPosition.X + offsetX + 73.8f * scale, (int)player_Ex.HPBarPosition.Y + offset + 33 * scale),
                        VisibleCondition = sender => MenuExtensions.GetItemValue <bool>("dz191.dza.tracker.track.cd") && player_Ex.IsHPBarRendered && (player_Ex.Spellbook.GetSpell(slot3).CooldownExpires - Game.Time) > 0 && (((player_Ex.IsAlly || player_Ex.IsMe) && TrackerVariables.TrackAllies) || (player_Ex.IsEnemy && TrackerVariables.TrackEnemies))
                    };

                    member.Spell3Text = Spell3Text;
                    Spell3Text.Add(0);
                    #endregion

                    #region Spell4
                    var slot4 = SpellSlot.R;

                    var Spell4Rectangle = new Render.Sprite(Resources.CooldownSprite, new Vector2((int)player_Ex.HPBarPosition.X + 41, (int)player_Ex.HPBarPosition.Y + 30))
                    {
                        VisibleCondition = sender => player_Ex.IsHPBarRendered && (((player_Ex.IsAlly || player_Ex.IsMe) && TrackerVariables.TrackAllies) || (player_Ex.IsEnemy && TrackerVariables.TrackEnemies)),
                        PositionUpdate   = () => new Vector2(player_Ex.HPBarPosition.X + offsetX + 96f * scale, (int)player_Ex.HPBarPosition.Y + offset + 28 * scale),
                    };

                    member.Spell4Rectangle = Spell4Rectangle;
                    Spell4Rectangle.Add(0);

                    var Spell4Text = new Render.Text((int)player_Ex.HPBarPosition.X + 44, (int)player_Ex.HPBarPosition.Y + 33, string.Empty, 14, new ColorBGRA(255, 255, 255, 255))
                    {
                        TextUpdate = () => ((player_Ex.Spellbook.GetSpell(slot4).CooldownExpires - Game.Time) > 0 ?
                                            (Truncate((player_Ex.Spellbook.GetSpell(slot4).CooldownExpires - Game.Time)))
                            : string.Empty),
                        PositionUpdate   = () => new Vector2((int)player_Ex.HPBarPosition.X + offsetX + 101f * scale, (int)player_Ex.HPBarPosition.Y + offset + 33 * scale),
                        VisibleCondition = sender => MenuExtensions.GetItemValue <bool>("dz191.dza.tracker.track.cd") && player_Ex.IsHPBarRendered && (player_Ex.Spellbook.GetSpell(slot4).CooldownExpires - Game.Time) > 0 && (((player_Ex.IsAlly || player_Ex.IsMe) && TrackerVariables.TrackAllies) || (player_Ex.IsEnemy && TrackerVariables.TrackEnemies))
                    };

                    member.Spell4Text = Spell4Text;
                    Spell4Text.Add(0);
                    #endregion

                    #endregion

                    member.Hero      = player_Ex;
                    member.Hud       = Hudsprite;
                    member.Summoner1 = SummonerSpell1;
                    member.Summoner2 = SummonerSpell2;

                    TrackerWrappers.Add(member);
                }
                catch (Exception e)
                {
                    LogHelper.AddToLog(new LogItem("Tracker_Drawings", e, LogSeverity.Severe));
                }
            }
        }
Beispiel #4
0
            public RecallRender(Packet.S2C.Teleport.Struct recall)
            {
                var recWidth = 200;

                Recall    = recall;
                Rectangle = new Render.Rectangle(Drawing.Width / 2, Drawing.Height / 4, recWidth, 10, SharpDX.Color.Green);
                Rectangle.PositionUpdate += delegate
                {
                    float percent  = RecallStatusPercent();
                    var   newWidth = (int)(recWidth - (recWidth * percent));
                    if (!Rectangle.Width.Equals(newWidth))
                    {
                        Rectangle.Width = newWidth;
                    }
                    SharpDX.Color newCol = Common.PercentColorRedToGreen(percent);
                    if (!Equals(newCol, Rectangle.Color))
                    {
                        Rectangle.Color = newCol;
                    }
                    return(new Vector2(Drawing.Width / 2 - recWidth / 2, Drawing.Height / 1.5f));
                };
                Rectangle.VisibleCondition = delegate
                {
                    return(IsActive() && Recall.Status == Packet.S2C.Teleport.Status.Start && (Recall.Start + Recall.Duration - Environment.TickCount) > 0);
                };
                Rectangle.Add(1);
                Line = new Render.Line(new Vector2(0, 0), new Vector2(0, 0), 1, SharpDX.Color.WhiteSmoke);
                Line.StartPositionUpdate += delegate
                {
                    return(new Vector2(Rectangle.X + Rectangle.Width, Rectangle.Y - 5));
                };
                Line.EndPositionUpdate += delegate
                {
                    return(new Vector2(Rectangle.X + Rectangle.Width, Rectangle.Y));
                };
                Line.VisibleCondition = delegate
                {
                    SharpDX.Color newCol = new SharpDX.Color(255, 255, 255, (int)(255 - (255 * RecallStatusPercent())));
                    if (!Equals(newCol, Line.Color))
                    {
                        Line.Color = newCol;
                    }
                    return(IsActive() && Recall.Status == Packet.S2C.Teleport.Status.Start && (Recall.Start + Recall.Duration - Environment.TickCount) > 0);
                };
                Line.Add(1);
                Text = new Render.Text(ObjectManager.GetUnitByNetworkId <Obj_AI_Hero>(Recall.UnitNetworkId).ChampionName, 0, 0, 18, SharpDX.Color.WhiteSmoke);
                Text.PositionUpdate += delegate
                {
                    return(new Vector2(Line.Start.X, Line.Start.Y - 15));
                };
                Text.TextUpdate = delegate
                {
                    SharpDX.Color newCol = new SharpDX.Color(255, 255, 255, (int)(255 - (150 * RecallStatusPercent())));
                    if (!Equals(newCol, Text.Color))
                    {
                        Text.Color = newCol;
                    }
                    return(ObjectManager.GetUnitByNetworkId <Obj_AI_Hero>(Recall.UnitNetworkId).ChampionName);
                };
                Text.Centered         = true;
                Text.VisibleCondition = delegate
                {
                    return(IsActive() && Recall.Status == Packet.S2C.Teleport.Status.Start && (Recall.Start + Recall.Duration - Environment.TickCount) > 0);
                };
                Text.Add(1);
                Text2 = new Render.Text(ObjectManager.GetUnitByNetworkId <Obj_AI_Hero>(Recall.UnitNetworkId).ChampionName, 0, 0, 18, SharpDX.Color.WhiteSmoke);
                Text2.PositionUpdate += delegate
                {
                    return(new Vector2(Line.Start.X, Line.Start.Y - 5));
                };
                Text2.TextUpdate = delegate
                {
                    SharpDX.Color newCol = new SharpDX.Color(255, 255, 255, (int)(255 - (150 * RecallStatusPercent())));
                    if (!Equals(newCol, Text2.Color))
                    {
                        Text2.Color = newCol;
                    }
                    TimeSpan t = TimeSpan.FromMilliseconds(Recall.Start + Recall.Duration - Environment.TickCount);
                    return(string.Format("{0}.{1}", t.Seconds, t.Milliseconds.ToString("D3").Remove(1, 2)));
                };
                Text2.Centered         = true;
                Text2.VisibleCondition = delegate
                {
                    return(IsActive() && Recall.Status == Packet.S2C.Teleport.Status.Start && (Recall.Start + Recall.Duration - Environment.TickCount) > 0);
                };
                Text2.Add(1);
            }
Beispiel #5
0
        private void Init()
        {
            int posX = LanePowerMisc.GetMenuItem("SAssembliesMiscsLanePowerPositionX").GetValue <Slider>().Value;
            int posY = LanePowerMisc.GetMenuItem("SAssembliesMiscsLanePowerPositionY").GetValue <Slider>().Value;

            for (int i = 1; i <= (int)Lane.Bot; i++)
            {
                List <Render.RenderObject> recs  = new List <Render.RenderObject>();
                Render.Rectangle           bgRec = new Render.Rectangle(posX, posY + (i * 50), 202, 12, Color.Black);
                bgRec.VisibleCondition = delegate
                {
                    return(this.IsActive());
                };
                bgRec.Add(1);

                Render.Rectangle greenRec = new Render.Rectangle(posX + 1, posY + 1 + (i * 50), 100, 10, Color.GreenYellow);
                greenRec.VisibleCondition = delegate
                {
                    return(this.IsActive());
                };
                greenRec.Add(1);

                Render.Rectangle redRec = new Render.Rectangle(posX + 101, posY + 1 + (i * 50), 100, 10, Color.Red);
                redRec.VisibleCondition = delegate
                {
                    return(this.IsActive());
                };
                redRec.Add(1);

                Render.Text nameText = new Render.Text(((Lane)i).ToString(), posX + 100, posY - 10 + (i * 50), 16, Color.Orange);
                nameText.OutLined         = true;
                nameText.Centered         = true;
                nameText.VisibleCondition = delegate
                {
                    return(this.IsActive());
                };
                nameText.Add(1);

                Render.Text directionText = new Render.Text("→", posX + 100, posY + 3 + (i * 50), 20, Color.Peru);
                directionText.OutLined = true;
                directionText.Centered = true;
                directionText.Add(2);

                Render.Text percentText = new Render.Text("Power 50 %", posX + 100, posY + 20 + (i * 50), 16, Color.Orange);
                percentText.OutLined         = true;
                percentText.Centered         = true;
                percentText.VisibleCondition = delegate
                {
                    return(this.IsActive());
                };
                percentText.Add(1);

                recs.Add(bgRec);
                recs.Add(greenRec);
                recs.Add(redRec);
                recs.Add(nameText);
                recs.Add(percentText);
                recs.Add(directionText);

                drawings.Add((Lane)i, new DrawingsClass()
                {
                    Drawings = recs
                });
            }

            this.lowHpHero          = new Render.Text("", new Vector2(posX + 100, posY + 20 + (4 * 50)), 16, Color.Orange);
            this.lowHpHero.OutLined = true;
            this.lowHpHero.Centered = true;
            this.lowHpHero.Add(1);
        }
Beispiel #6
0
 public void Show()
 {
     Game.OnWndProc += Game_OnWndProc;
     Drawing.OnDraw += Drawing_OnDraw;
     rect.Add();
 }