Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Turbo.Plugins.Smoochy
- {
- using System;
- using Turbo.Plugins.Default;
- public class EssencePlugin : BasePlugin, IInGameTopPainter
- {
- public TopLabelDecorator EssenceLabelDecorator { get; set; }
- public TopLabelDecorator EssenceDHPriLabelDecorator {get; set; }
- public TopLabelDecorator EssenceDHSecLabelDecorator { get; set; }
- public EssencePlugin()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- EssenceLabelDecorator = new TopLabelDecorator(Hud)
- {
- TextFont = Hud.Render.CreateFont("tahoma", 7, 255, 175, 238, 238, true, false, false), //this configures the size of the numbers ("7") and the color in RGB ("255, 175, 238, 238") for all classes except the DemonHunter
- BackgroundTexture1 = hud.Texture.ButtonTextureBlue,
- BackgroundTexture2 = hud.Texture.BackgroundTextureBlue,
- BackgroundTextureOpacity2 = 0.5f,
- TextFunc = () => (Math.Truncate(Hud.Game.Me.Stats.ResourceCurPri) + "/" + Hud.Game.Me.Stats.ResourceMaxPri),
- };
- EssenceDHPriLabelDecorator = new TopLabelDecorator(Hud)
- {
- TextFont = Hud.Render.CreateFont("tahoma", 7, 255, 175, 238, 238, true, false, false), //this configures the size of the numbers ("7") and the color in RGB ("255, 175, 238, 238") for the primary ressource of the DemonHunter
- BackgroundTexture1 = hud.Texture.ButtonTextureBlue,
- BackgroundTexture2 = hud.Texture.BackgroundTextureBlue,
- BackgroundTextureOpacity2 = 0.5f,
- TextFunc = () => (Math.Truncate(Hud.Game.Me.Stats.ResourceCurPri) + "/" + Hud.Game.Me.Stats.ResourceMaxPri),
- };
- EssenceDHSecLabelDecorator = new TopLabelDecorator(Hud)
- {
- TextFont = Hud.Render.CreateFont("tahoma", 7, 255, 175, 238, 238, true, false, false), //this configures the size of the numbers ("7") and the color in RGB ("255, 175, 238, 238") for the secondary ressource of the DemonHunter
- BackgroundTexture1 = hud.Texture.ButtonTextureBlue,
- BackgroundTexture2 = hud.Texture.BackgroundTextureBlue,
- BackgroundTextureOpacity2 = 0.5f,
- TextFunc = () => (Math.Truncate(Hud.Game.Me.Stats.ResourceCurSec) + "/" + Hud.Game.Me.Stats.ResourceMaxSec),
- };
- }
- public void PaintTopInGame(ClipState clipState)
- {
- var xPos = Hud.Window.Size.Width * 0.5f; //this is the horizontal position
- var yPos = Hud.Window.Size.Height * 0.5f; //this is the vertical position
- var bgWidth = 90; //this is the width of the background texture
- var bgHeight = 30; //this is the heigth of the background texture
- var yPosDH = Hud.Window.Size.Height * 0.5f + bgHeight; //this is the vertical position for the secondary ressource of the Demon Hunter
- if (clipState == ClipState.BeforeClip)
- {
- switch (Hud.Game.Me.HeroClassDefinition.HeroClass)
- {
- case HeroClass.Barbarian:
- EssenceLabelDecorator.Paint(xPos - (bgWidth / 2), yPos, bgWidth, bgHeight, HorizontalAlign.Center);
- break;
- case HeroClass.Crusader:
- EssenceLabelDecorator.Paint(xPos - (bgWidth / 2), yPos, bgWidth, bgHeight, HorizontalAlign.Center);
- break;
- case HeroClass.DemonHunter:
- EssenceDHPriLabelDecorator.Paint(xPos - (bgWidth / 2), yPos, bgWidth, bgHeight, HorizontalAlign.Center);
- EssenceDHSecLabelDecorator.Paint(xPos - (bgWidth / 2), yPosDH, bgWidth, bgHeight, HorizontalAlign.Center);
- break;
- case HeroClass.Monk:
- EssenceLabelDecorator.Paint(xPos - (bgWidth / 2), yPos, bgWidth, bgHeight, HorizontalAlign.Center);
- break;
- case HeroClass.Necromancer:
- EssenceLabelDecorator.Paint(xPos - (bgWidth / 2), yPos, bgWidth, bgHeight, HorizontalAlign.Center);
- break;
- case HeroClass.WitchDoctor:
- EssenceLabelDecorator.Paint(xPos - (bgWidth / 2), yPos, bgWidth, bgHeight, HorizontalAlign.Center);
- break;
- case HeroClass.Wizard:
- EssenceLabelDecorator.Paint(xPos - (bgWidth / 2), yPos, bgWidth, bgHeight, HorizontalAlign.Center);
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement