Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Turbo.Plugins.Default;
- using System.Linq;
- using System.Collections.Generic;
- namespace Turbo.Plugins.User
- {
- public class MonkS27WaveOfLightSancPlugin : BasePlugin, IInGameWorldPainter, IInGameTopPainter
- {
- public WorldDecoratorCollection WaveOfLightDecorator;
- public bool WaveOfLightEnabled;
- public string WaveOfLightLabel;
- private int WaveOfLightCount { get; set; } = 0;
- public HashSet<ActorSnoEnum> WaveOfLightActorSNOs = new HashSet<ActorSnoEnum>
- {
- ActorSnoEnum._p74_monk_bell_waveoflight_runeb //487679
- };
- public IFont TextFontCount { get; set; }
- public MonkS27WaveOfLightSancPlugin()
- {
- Enabled = true;
- WaveOfLightEnabled = true;
- WaveOfLightLabel = "";
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- WaveOfLightDecorator = new WorldDecoratorCollection(new GroundCircleDecorator(Hud) {
- Brush = Hud.Render.CreateBrush(0, 0, 0, 0, 0),
- Radius = 0f });
- TextFontCount = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 0, true, false, 255, 0, 0, 0, true);
- }
- public void PaintWorld(WorldLayer layer)
- {
- if (Hud.Game.Me.HeroClassDefinition.HeroClass != HeroClass.Monk) return;
- if (WaveOfLightEnabled && Hud.Game.Me.Powers.UsedMonkPowers.WaveOfLight != null)
- {
- var WaveOfLightActors = Hud.Game.Actors.Where(EachActor => WaveOfLightActorSNOs.Contains(EachActor.SnoActor.Sno));
- WaveOfLightCount = WaveOfLightActors.Count();
- foreach (var EachActor in WaveOfLightActors)
- {
- var text = string.IsNullOrWhiteSpace(WaveOfLightLabel) ? EachActor.SnoActor.NameLocalized : WaveOfLightLabel;
- WaveOfLightDecorator.Paint(layer, EachActor, EachActor.FloorCoordinate, text);
- }
- }
- else
- {
- WaveOfLightCount = 0;
- }
- }
- public void PaintTopInGame(ClipState clipState)
- {
- if (Hud.Game.Me.HeroClassDefinition.HeroClass != HeroClass.Monk) return;
- if (clipState != ClipState.BeforeClip) return;
- if (WaveOfLightEnabled && WaveOfLightCount != 0 && Hud.Game.Me.Powers.UsedMonkPowers.WaveOfLight != null)
- {
- var rect = Hud.Render.GetPlayerSkillUiElement(Hud.Game.Me.Powers.UsedMonkPowers.WaveOfLight.Key).Rectangle;
- var textLayout = TextFontCount.GetTextLayout(WaveOfLightCount.ToString()) ;
- TextFontCount.DrawText(textLayout, rect.X + (rect.Width - textLayout.Metrics.Width) * 0.85f, rect.Y + (rect.Height - textLayout.Metrics.Height) * 0.05f);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement