Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Turbo.Plugins.Default;
- namespace Turbo.Plugins.RNN
- {
- public class DeathInMap : BasePlugin, IInGameTopPainter
- {
- private IFont RedFont { get; set; }
- private IFont GreenFont { get; set; }
- private IFont GrayFont { get; set; }
- private IFont NamesOrangeFont { get; set; }
- private IFont NamesRedFont { get; set; }
- private IFont NamesGreenFont { get; set; }
- private IFont NamesGrayFont { get; set; }
- private IFont NamesYellowFont { get; set; }
- private IFont DefaultFont { get; set; }
- public float XPorc { get; set; }
- public float YPorc { get; set; }
- public bool ShowInTown { get; set; }
- public bool ShowDead { get; set; }
- public bool ShowTown { get; set; }
- public DeathInMap()
- {
- Enabled = true;
- }
- public override void Load(IController hud)
- {
- base.Load(hud);
- XPorc = 0.825f;
- YPorc = 0.047f;
- ShowInTown = true;
- ShowDead = true; // Show name players deads of Color red (in Map) or orange (out Map) .
- ShowTown = true; // Show name players in Town of Color gray (out Map).
- RedFont = Hud.Render.CreateFont("tahoma", 8f, 250, 250, 0, 0, false, false, 128, 0, 0, 0, true) ;
- GreenFont = Hud.Render.CreateFont("tahoma", 8f, 225, 0, 250, 0, false, false, 128, 0, 0, 0, true) ;
- GrayFont = Hud.Render.CreateFont("tahoma", 7f, 225, 180, 180, 180, false, false, 128, 0, 0, 0, true) ;
- DefaultFont = GreenFont;
- NamesOrangeFont = Hud.Render.CreateFont("tahoma", 6f, 225, 250, 150, 50, false, false, 128, 0, 0, 0, true) ;
- NamesRedFont = Hud.Render.CreateFont("tahoma", 6f, 250, 250, 0, 0, false, false, 128, 0, 0, 0, true) ;
- NamesGreenFont = Hud.Render.CreateFont("tahoma", 6f, 225, 0, 250, 0, false, false, 128, 0, 0, 0, true) ;
- NamesGrayFont = Hud.Render.CreateFont("tahoma", 6f, 225, 180, 180, 180, false, false, 128, 0, 0, 0, true) ;
- NamesYellowFont = Hud.Render.CreateFont("tahoma", 6f, 225, 255, 255, 0, false, false, 128, 0, 0, 0, true) ;
- }
- public void PaintTopInGame(ClipState clipState)
- {
- if (Hud.Render.UiHidden) return;
- if (clipState != ClipState.BeforeClip) return;
- if (Hud.Game.IsInGame) {
- if (ShowInTown || !Hud.Game.Me.IsInTown) {
- if ( Hud.Game.NumberOfPlayersInGame > 1 ) {
- bool Alive = true; bool EnMapa = true ; int EnMiMapa = 0 ;
- string JugadorIN = string.Empty, JugadorOUT = string.Empty, JugadorINDead = string.Empty, JugadorOUTDead = string.Empty, JugadorOUTTown = string.Empty;
- foreach (var player in Hud.Game.Players) {
- if (player.IsDead) Alive = false;
- if (player.SnoArea.Sno != Hud.Game.Me.SnoArea.Sno) {
- EnMapa = false;
- if (ShowTown && player.IsInTown) { JugadorOUTTown += " " + player.BattleTagAbovePortrait; }
- else if (ShowDead && player.IsDead) { JugadorOUTDead += " " + player.BattleTagAbovePortrait; }
- else { JugadorOUT += " " + player.BattleTagAbovePortrait; }
- }
- else {
- EnMiMapa++ ;
- if (!player.IsMe)
- {
- if (ShowDead && player.IsDead) { JugadorINDead += " " + player.BattleTagAbovePortrait; }
- else { JugadorIN += " " + player.BattleTagAbovePortrait; }
- }
- }
- }
- var xpos = Hud.Window.Size.Width * XPorc; var ypos = Hud.Window.Size.Height * YPorc;
- DefaultFont = Alive?GreenFont:RedFont ;
- var layout = DefaultFont.GetTextLayout("☠️");
- DefaultFont.DrawText(layout, xpos, ypos );
- xpos += layout.Metrics.Width * 1.15f;
- DefaultFont = EnMapa?GreenFont:RedFont ;
- layout = DefaultFont.GetTextLayout("🏴");
- DefaultFont.DrawText(layout, xpos , ypos );
- xpos += layout.Metrics.Width * 0.85f;
- layout = GrayFont.GetTextLayout(" [" + EnMiMapa + "/" + Hud.Game.NumberOfPlayersInGame + "]");
- GrayFont.DrawText(layout , xpos , ypos + 1 );
- xpos += layout.Metrics.Width;
- if (JugadorIN != string.Empty)
- {
- layout = NamesGreenFont.GetTextLayout(JugadorIN);
- NamesGreenFont.DrawText(layout, xpos, ypos + 1 );
- xpos += layout.Metrics.Width;
- }
- if (JugadorOUTDead != string.Empty)
- {
- layout = NamesOrangeFont.GetTextLayout(JugadorOUTDead);
- NamesOrangeFont.DrawText(layout, xpos, ypos + 1 );
- xpos += layout.Metrics.Width;
- }
- if (JugadorINDead != string.Empty)
- {
- layout = NamesRedFont.GetTextLayout(JugadorINDead);
- NamesRedFont.DrawText(layout, xpos, ypos + 1 );
- xpos += layout.Metrics.Width;
- }
- if (JugadorOUT != string.Empty)
- {
- layout = NamesYellowFont.GetTextLayout(JugadorOUT);
- NamesYellowFont.DrawText(layout, xpos, ypos + 1 );
- xpos += layout.Metrics.Width;
- }
- if (JugadorOUTTown != string.Empty)
- {
- NamesGrayFont.DrawText(NamesGrayFont.GetTextLayout(JugadorOUTTown) , xpos, ypos + 1 );
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment