Guest User

GLQ_GreaterRiftPylonMarkerwFloorsPlugin

a guest
Sep 10th, 2018
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.42 KB | None | 0 0
  1. using System;
  2. using System.Globalization;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using Turbo.Plugins.Default;
  6.  
  7. namespace Turbo.Plugins.glq
  8. {
  9.     //by 我想静静
  10.     public class GLQ_GreaterRiftPylonMarkerPlugin : BasePlugin, IInGameTopPainter
  11.     {
  12.         public IBrush ProgressionLineBrush { get; set; }
  13.         public Dictionary<string, double> ProgressionofShrines { get; set; }
  14.         public IFont GreaterRiftFont { get; set; }
  15.         public bool flag_wn { get; set; }
  16.         public bool flag_dj { get; set; }
  17.         public bool flag_jh { get; set; }
  18.         public bool flag_hd { get; set; }
  19.         public bool flag_js { get; set; }
  20.  
  21.         public GLQ_GreaterRiftPylonMarkerPlugin()
  22.         {
  23.             Enabled = true;
  24.         }
  25.  
  26.         public override void Load(IController hud)
  27.         {
  28.             base.Load(hud);
  29.             GreaterRiftFont = Hud.Render.CreateFont("tahoma", 6, 255, 200, 100, 200, false, false, 160, 0, 0, 0, true);
  30.             ProgressionLineBrush = Hud.Render.CreateBrush(255, 125, 175, 240, 1f);
  31.             ProgressionofShrines = new Dictionary<string, double>();
  32.             flag_wn = false;
  33.             flag_dj = false;
  34.             flag_jh = false;
  35.             flag_hd = false;
  36.             flag_js = false;
  37.         }
  38.  
  39.         public void PaintTopInGame(ClipState clipState)
  40.         {
  41.             if (clipState != ClipState.BeforeClip) return;
  42.             if ((Hud.Game.SpecialArea != SpecialArea.Rift) && (Hud.Game.SpecialArea != SpecialArea.GreaterRift)) return;
  43.  
  44.             if (Hud.Game.SpecialArea == SpecialArea.GreaterRift)
  45.             //if (Hud.Game.SpecialArea == SpecialArea.Rift)
  46.             {
  47.                 var percent = Hud.Game.RiftPercentage;
  48.                 if (percent <= 0)
  49.                 {
  50.                     ProgressionofShrines.Clear();
  51.                     flag_wn = false;
  52.                     flag_dj = false;
  53.                     flag_jh = false;
  54.                     flag_hd = false;
  55.                     flag_js = false;
  56.                     return;
  57.                 }
  58.                 var ui = Hud.Render.GreaterRiftBarUiElement;
  59.                 //var ui = Hud.Render.NephalemRiftBarUiElement;
  60.                 var uiRect = ui.Rectangle;
  61.                 if (ui.Visible)
  62.                 {
  63.                     var shrines = Hud.Game.Shrines;
  64.                     //if (shrines.Count() <= 0) return;
  65.                     foreach (var actor in shrines)
  66.                     {
  67.                         switch (actor.SnoActor.Sno)
  68.                         {
  69.                             case 330695:
  70.                                 if (flag_wn == false) ProgressionofShrines.Add("威能", percent);
  71.                                 flag_wn = true;
  72.                                 break;
  73.                             case 330696:
  74.                             case 398654:
  75.                                 if (flag_dj == false) ProgressionofShrines.Add("电击", percent);
  76.                                 flag_dj = true;
  77.                                 break;
  78.                             case 330697:
  79.                                 if (flag_jh == false) ProgressionofShrines.Add("减耗", percent);
  80.                                 flag_jh = true;
  81.                                 break;
  82.                             case 330698:
  83.                                 if (flag_hd == false) ProgressionofShrines.Add("护盾", percent);
  84.                                 flag_hd = true;
  85.                                 break;
  86.                             case 330699:
  87.                                 if (flag_js == false) ProgressionofShrines.Add("加速", percent);
  88.                                 flag_js = true;
  89.                                 break;
  90.                         }
  91.                     }
  92.                     var x = (float)(uiRect.Left + uiRect.Width / 100.0f * percent);
  93.                     var py = Hud.Window.Size.Height / 30;
  94.                     foreach (var pos in ProgressionofShrines)
  95.                     {
  96.                         var xPos = (float)(uiRect.Left + uiRect.Width / 100.0f * pos.Value);
  97.                         ProgressionLineBrush.DrawLine(xPos, uiRect.Bottom, xPos, uiRect.Bottom + py, 0);
  98.                         var text = pos.Value.ToString("F1") + "%" + "\r\n" + pos.Key;
  99.                         GreaterRiftFont.DrawText(text, xPos, uiRect.Bottom + py, true);
  100.                     }
  101.                 }
  102.             }
  103.         }
  104.     }
  105. }
Add Comment
Please, Sign In to add comment