Beispiel #1
0
        private void DrawSingleRecallBar(float X, float Y, Recall recall)
        {
            int opacity = (int)((recallTrackerMenu["opacity"].Cast <Slider>().CurrentValue / 100f) * 255);

            DrawingHelper.DrawRectangle(X, Y, recallbarWidth, recallbarHeight, Color.FromArgb(opacity, Color.Black));
            DrawingHelper.DrawRectangle(X + 1, Y + 1, recallbarWidth - 2, recallbarHeight - 2, Color.FromArgb(opacity, Color.Black));
            DrawingHelper.DrawRectangle(X + 2, Y + 2, recallbarWidth - 4, recallbarHeight - 4, Color.FromArgb(opacity, Color.Gray));

            if (!recall.IsAborted)
            {
                DrawingHelper.DrawFilledRectangle(X + 2, Y + 2, (recallbarWidth - 4) * recall.Percent(), recallbarHeight - 4, Color.FromArgb(opacity, DrawingHelper.Interpolate(Color.Red, Color.LawnGreen, recall.Percent())));
            }
            else
            {
                DrawingHelper.DrawFilledRectangle(X + 2, Y + 2, (recallbarWidth - 4) * recall.Percent(), recallbarHeight - 4, Color.FromArgb(opacity, Color.SlateGray));
            }

            Text.TextValue = recall.Name;
            Text.Position  = new Vector2(X + recallbarWidth + 3, Y);
            Text.Draw();

            Text.Position  = new Vector2(X + recallbarWidth + 6 + Text.Bounding.Width, Y);
            Text.TextValue = "(" + Math.Round(recall.HealthPercent) + "%)";
            Text.Color     = DrawingHelper.Interpolate(Color.Red, Color.LawnGreen, recall.HealthPercent / 100f);
            Text.Draw();

            Text.Color = Color.AntiqueWhite;
        }
Beispiel #2
0
        private void Teleport_OnTeleport(Obj_AI_Base sender, Teleport.TeleportEventArgs args)
        {
            if (sender.Type != GameObjectType.AIHeroClient || args.Type != TeleportType.Recall)
            {
                return;
            }

            AIHeroClient player = sender as AIHeroClient;

            if (player == null || player.IsMe || player.IsAlly)
            {
                return;
            }

            switch (args.Status)
            {
            case TeleportStatus.Start:
                Recall startedRecall = Recalls.FirstOrDefault(x => x.Name == player.ChampionName);

                if (startedRecall != null)
                {
                    Recalls.Remove(startedRecall);
                }

                Recalls.Add(new Recall(player.ChampionName, player.HealthPercent, Game.Time + (args.Duration / 1000f), args.Duration / 1000f));
                break;

            case TeleportStatus.Abort:
                Recall abortedRecall = Recalls.FirstOrDefault(x => x.Name == player.ChampionName);

                if (abortedRecall != null)
                {
                    abortedRecall.Abort();
                    Core.DelayAction(() => Recalls.Remove(abortedRecall), 2000);
                }
                break;

            case TeleportStatus.Finish:
                //BUG: Procs when recall aborts with less than 0.3 second left.
                Recall finishedRecall = Recalls.FirstOrDefault(x => x.Name == player.ChampionName);

                if (finishedRecall != null)
                {
                    Recalls.Remove(finishedRecall);
                }
                break;
            }
        }
        private void DrawSingleRecallBar(float X, float Y, Recall recall)
        {
            int opacity = (int)((recallTrackerMenu["opacity"].Cast<Slider>().CurrentValue/100f)*255);

            DrawingHelper.DrawRectangle(X, Y, recallbarWidth, recallbarHeight, Color.FromArgb(opacity, Color.Black));
            DrawingHelper.DrawRectangle(X + 1, Y + 1, recallbarWidth - 2, recallbarHeight - 2, Color.FromArgb(opacity, Color.Black));
            DrawingHelper.DrawRectangle(X + 2, Y + 2, recallbarWidth - 4, recallbarHeight - 4, Color.FromArgb(opacity, Color.Gray));

            if (!recall.IsAborted)
                DrawingHelper.DrawFilledRectangle(X + 2, Y + 2, (recallbarWidth - 4) * recall.Percent(), recallbarHeight - 4, Color.FromArgb(opacity, DrawingHelper.Interpolate(Color.Red, Color.LawnGreen, recall.Percent())));
            else
                DrawingHelper.DrawFilledRectangle(X + 2, Y + 2, (recallbarWidth - 4)*recall.Percent(), recallbarHeight - 4, Color.FromArgb(opacity, Color.SlateGray));

            Text.TextValue = recall.Name;
            Text.Position = new Vector2(X + recallbarWidth + 3, Y);
            Text.Draw();

            Text.Position = new Vector2(X + recallbarWidth + 6 + Text.Bounding.Width, Y);
            Text.TextValue = "(" + Math.Round(recall.HealthPercent) + "%)";
            Text.Color = DrawingHelper.Interpolate(Color.Red, Color.LawnGreen, recall.HealthPercent / 100f);
            Text.Draw();

            Text.Color = Color.AntiqueWhite;
        }