RNNCode

DeathInMap

Apr 7th, 2025
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.00 KB | None | 0 0
  1. using Turbo.Plugins.Default;
  2.  
  3. namespace Turbo.Plugins.RNN
  4. {
  5.     public class DeathInMap : BasePlugin, IInGameTopPainter
  6.     {
  7.         private IFont RedFont { get; set; }
  8.         private IFont GreenFont { get; set; }
  9.         private IFont GrayFont { get; set; }
  10.         private IFont NamesOrangeFont { get; set; }
  11.         private IFont NamesRedFont { get; set; }
  12.         private IFont NamesGreenFont { get; set; }
  13.         private IFont NamesGrayFont { get; set; }
  14.         private IFont NamesYellowFont { get; set; }
  15.  
  16.  
  17.         private IFont DefaultFont { get; set; }
  18.         public float XPorc { get; set; }
  19.         public float YPorc { get; set; }
  20.         public bool ShowInTown { get; set; }
  21.         public bool ShowDead { get; set; }
  22.         public bool ShowTown { get; set; }
  23.  
  24.         public DeathInMap()
  25.         {
  26.             Enabled = true;
  27.         }
  28.         public override void Load(IController hud)
  29.         {
  30.             base.Load(hud);
  31.             XPorc = 0.825f;
  32.             YPorc = 0.047f;
  33.             ShowInTown = true;
  34.             ShowDead = true; // Show name players deads of Color red (in Map) or orange (out Map) .
  35.             ShowTown = true; // Show name players in Town of Color gray (out Map).
  36.  
  37.             RedFont = Hud.Render.CreateFont("tahoma", 8f, 250, 250, 0, 0, false, false, 128, 0, 0, 0, true) ;
  38.             GreenFont = Hud.Render.CreateFont("tahoma", 8f, 225, 0, 250, 0, false, false, 128, 0, 0, 0, true) ;
  39.             GrayFont = Hud.Render.CreateFont("tahoma", 7f, 225, 180, 180, 180, false, false, 128, 0, 0, 0, true) ;
  40.             DefaultFont = GreenFont;
  41.             NamesOrangeFont = Hud.Render.CreateFont("tahoma", 6f, 225, 250, 150, 50, false, false, 128, 0, 0, 0, true) ;
  42.             NamesRedFont = Hud.Render.CreateFont("tahoma", 6f, 250, 250, 0, 0, false, false, 128, 0, 0, 0, true) ;
  43.             NamesGreenFont = Hud.Render.CreateFont("tahoma", 6f, 225, 0, 250, 0, false, false, 128, 0, 0, 0, true) ;
  44.             NamesGrayFont = Hud.Render.CreateFont("tahoma", 6f, 225, 180, 180, 180, false, false, 128, 0, 0, 0, true) ;
  45.             NamesYellowFont = Hud.Render.CreateFont("tahoma", 6f, 225, 255, 255, 0, false, false, 128, 0, 0, 0, true) ;
  46.         }
  47.  
  48.         public void PaintTopInGame(ClipState clipState)
  49.         {
  50.             if (Hud.Render.UiHidden) return;
  51.             if (clipState != ClipState.BeforeClip) return;
  52.             if (Hud.Game.IsInGame) {
  53.                 if (ShowInTown || !Hud.Game.Me.IsInTown) {
  54.                     if ( Hud.Game.NumberOfPlayersInGame > 1 )  {
  55.                         bool Alive = true; bool EnMapa = true ; int EnMiMapa = 0 ;
  56.                         string JugadorIN = string.Empty, JugadorOUT = string.Empty, JugadorINDead = string.Empty, JugadorOUTDead = string.Empty, JugadorOUTTown = string.Empty;
  57.                         foreach (var player in Hud.Game.Players) {
  58.                             if (player.IsDead) Alive = false;
  59.                             if (player.SnoArea.Sno != Hud.Game.Me.SnoArea.Sno) {
  60.                                 EnMapa = false;
  61.                                 if (ShowTown && player.IsInTown) { JugadorOUTTown += " " + player.BattleTagAbovePortrait; }
  62.                                 else if (ShowDead && player.IsDead) { JugadorOUTDead += " " + player.BattleTagAbovePortrait; }
  63.                                 else { JugadorOUT += " " + player.BattleTagAbovePortrait; }
  64.                             }
  65.                             else {
  66.                                 EnMiMapa++ ;
  67.                                 if (!player.IsMe)
  68.                                 {
  69.                                     if (ShowDead && player.IsDead) { JugadorINDead += " " + player.BattleTagAbovePortrait; }
  70.                                     else { JugadorIN += " " + player.BattleTagAbovePortrait; }
  71.  
  72.                                 }
  73.                             }
  74.                         }
  75.                         var xpos = Hud.Window.Size.Width * XPorc;  var ypos = Hud.Window.Size.Height * YPorc;
  76.  
  77.                         DefaultFont = Alive?GreenFont:RedFont ;
  78.                         var layout = DefaultFont.GetTextLayout("☠️");
  79.                         DefaultFont.DrawText(layout, xpos, ypos );
  80.                         xpos += layout.Metrics.Width * 1.15f;
  81.  
  82.                         DefaultFont = EnMapa?GreenFont:RedFont ;
  83.                         layout = DefaultFont.GetTextLayout("🏴");
  84.                         DefaultFont.DrawText(layout, xpos , ypos );
  85.                         xpos += layout.Metrics.Width * 0.85f;
  86.  
  87.                         layout =  GrayFont.GetTextLayout(" [" + EnMiMapa + "/" + Hud.Game.NumberOfPlayersInGame + "]");
  88.                         GrayFont.DrawText(layout , xpos , ypos + 1 );
  89.                         xpos += layout.Metrics.Width;
  90.  
  91.                         if (JugadorIN != string.Empty)
  92.                         {
  93.                             layout = NamesGreenFont.GetTextLayout(JugadorIN);
  94.                             NamesGreenFont.DrawText(layout, xpos, ypos + 1 );
  95.                             xpos +=  layout.Metrics.Width;
  96.                         }
  97.                         if (JugadorOUTDead != string.Empty)
  98.                         {
  99.                             layout = NamesOrangeFont.GetTextLayout(JugadorOUTDead);
  100.                             NamesOrangeFont.DrawText(layout, xpos, ypos + 1 );
  101.                             xpos +=  layout.Metrics.Width;
  102.                         }
  103.                         if (JugadorINDead != string.Empty)
  104.                         {
  105.                             layout = NamesRedFont.GetTextLayout(JugadorINDead);
  106.                             NamesRedFont.DrawText(layout, xpos, ypos + 1 );
  107.                             xpos +=  layout.Metrics.Width;
  108.                         }
  109.                         if (JugadorOUT != string.Empty)
  110.                         {
  111.                             layout = NamesYellowFont.GetTextLayout(JugadorOUT);
  112.                             NamesYellowFont.DrawText(layout, xpos, ypos + 1 );
  113.                             xpos +=  layout.Metrics.Width;
  114.                         }
  115.                         if (JugadorOUTTown != string.Empty)
  116.                         {
  117.                             NamesGrayFont.DrawText(NamesGrayFont.GetTextLayout(JugadorOUTTown) , xpos, ypos + 1 );
  118.                         }
  119.                     }
  120.                 }
  121.             }
  122.         }
  123.     }
  124. }
Advertisement
Add Comment
Please, Sign In to add comment