Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Turbo.Plugins.Default;
- using System.Collections.Generic;
- using System.Linq;
- using System;
- using System.Globalization;
- namespace Turbo.Plugins.Resu
- {
- public class ParagonPercentagePlugin : BasePlugin, IInGameTopPainter
- {
- public TopLabelDecorator ParagonPercentageDecorator { get; set; }
- public ParagonPercentagePlugin()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- ParagonPercentageDecorator = new TopLabelDecorator(Hud)
- {
- BackgroundTexture1 = Hud.Texture.Button2TextureBrown,
- BackgroundTextureOpacity1 = 1.0f,
- TextFont = Hud.Render.CreateFont("Segoe UI Light", 7, 250, 87, 137, 255, false, false, true),
- TextFunc = () => Hud.Game.Me.CurrentLevelParagonFloat.ToString("F3").Substring(Hud.Game.Me.CurrentLevelParagonFloat.ToString("F3").Length-3).Insert(2, ".")+"%",
- HintFunc = () => "Paragon percentage",
- };
- }
- public void PaintTopInGame(ClipState clipState)
- {
- if (Hud.Render.UiHidden) return;
- if (clipState != ClipState.BeforeClip) return;
- var uiRect = Hud.Render.GetUiElement("*portrait-bottom").Rectangle;
- if (Hud.Game.NumberOfPlayersInGame == 1)
- {
- ParagonPercentageDecorator.Paint(uiRect.Left + uiRect.Width * 0.14f, uiRect.Top + uiRect.Height * 0.905f, uiRect.Width * 0.72f, uiRect.Height * 0.1f, HorizontalAlign.Center);
- };
- if (Hud.Game.NumberOfPlayersInGame == 2)
- {
- ParagonPercentageDecorator.Paint(uiRect.Left + uiRect.Width * 0.14f, uiRect.Top + uiRect.Height * -0.145f, uiRect.Width * 0.72f, uiRect.Height * 0.1f, HorizontalAlign.Center);
- };
- if (Hud.Game.NumberOfPlayersInGame == 3)
- {
- ParagonPercentageDecorator.Paint(uiRect.Left + uiRect.Width * 0.14f, uiRect.Top + uiRect.Height * -1.190f, uiRect.Width * 0.72f, uiRect.Height * 0.1f, HorizontalAlign.Center);
- };
- if (Hud.Game.NumberOfPlayersInGame == 4)
- {
- ParagonPercentageDecorator.Paint(uiRect.Left + uiRect.Width * 0.14f, uiRect.Top + uiRect.Height * -2.24f, uiRect.Width * 0.72f, uiRect.Height * 0.1f, HorizontalAlign.Center);
- };
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement