예제 #1
0
 private void DrawStandingEntry(SpriteBatch spriteBatch, Standing entry, int line, int indent)
 {
     var namePos = TextTopLeft + new Vector2(indent, line * ScoreLineSpacing);
     var scorePos = TextTopLeft + new Vector2(NameWidth, line * ScoreLineSpacing - 3);
     var killsPos = TextTopLeft + new Vector2(NameWidth + ScoreWidth, line * ScoreLineSpacing);
     var deathsPos = TextTopLeft + new Vector2(NameWidth + ScoreWidth + ScoreEntryWidth, line * ScoreLineSpacing);
     var rowAlpha = entry.IsActive ? 1 : 0.5f;
     var isHighlighted = Game.DataEngine.FindSpectator(entry.ID) == _player;
     var rowColor = Color.Multiply(isHighlighted ? Color.White : entry.Color, rowAlpha);
     ModelRenderer.DrawBorderedText(spriteBatch, Content.ConsoleFont, entry.Name, namePos.Round(), rowColor, 0.9f, 1);
     ModelRenderer.DrawBorderedText(spriteBatch, Content.ScoreFont, entry.Score.ToString(), scorePos.Round(), rowColor, 0.9f, 1);
     ModelRenderer.DrawBorderedText(spriteBatch, Content.ConsoleFont, entry.Kills.ToString(), killsPos.Round(), rowColor, 0.9f, 1);
     ModelRenderer.DrawBorderedText(spriteBatch, Content.ConsoleFont, entry.Deaths.ToString(), deathsPos.Round(), rowColor, 0.9f, 1);
 }
 private void DrawStandingsLine(SpriteBatch spriteBatch, ref Vector2 textCenter, Standing standing, int? position, int indent)
 {
     var column1Pos = new Vector2(TextLeftX, textCenter.Y);
     var entrySpec = Game.DataEngine.FindSpectator(standing.ID);
     var useHighlighting = Game.NetworkMode != NetworkMode.Standalone;
     var isHighlighted = entrySpec != null && entrySpec.IsLocal;
     var textColor = useHighlighting && isHighlighted ? Color.White : standing.Color;
     GraphicsEngineImpl.DrawFormattedText(column1Pos, Menu.MenuContent.FontSmallEnWidth,
         string.Format("{0}\t{1}{2}{3}",
             position.HasValue ? position.Value.ToOrdinalString() : "",
             (char)(5 + indent),
             standing.Name,
             GetScoreCells(standing.Score, standing.Kills, standing.Deaths)),
         (textPos, text) => spriteBatch.DrawString(FontSmall, text, textPos, textColor));
     AdvanceLine(ref textCenter, FontSmall);
 }