small fixes
This commit is contained in:
parent
32bc8274a2
commit
2a796509c8
7 changed files with 60 additions and 36 deletions
|
@ -659,34 +659,46 @@ namespace Sledgemapper
|
|||
|
||||
private void DrawPlayers()
|
||||
{
|
||||
foreach (var player in _sessionData.Players.Copy())
|
||||
try
|
||||
{
|
||||
|
||||
var color = player.Color.ToColor();
|
||||
_spriteBatch.DrawRectangle(new Rectangle(player.Position.X * _state.TileSize - 4, player.Position.Y * _state.TileSize - 4, _state.TileSize + 7, _state.TileSize + 7), color, 2);
|
||||
|
||||
var ffont = _fonts.FirstOrDefault(m => int.Parse(m.Key.Replace("font", "")) > _state.TileSize).Value ?? _fonts.Last().Value;
|
||||
|
||||
var fscale = _state.TileSize / ((float)ffont.LineSpacing * 2);
|
||||
_spriteBatch.DrawString(ffont,
|
||||
player.Initials,
|
||||
new Vector2(player.Position.X * _state.TileSize + 2, player.Position.Y * _state.TileSize + _state.TileSize - 2 - ffont.LineSpacing * fscale),
|
||||
color,
|
||||
0,
|
||||
Vector2.Zero,
|
||||
fscale,
|
||||
SpriteEffects.None,
|
||||
0);
|
||||
}
|
||||
|
||||
|
||||
foreach (var player in _sessionData.Players.Copy())
|
||||
{
|
||||
var isOffscreen = IsOffscreen(player.Position);
|
||||
if (isOffscreen)
|
||||
foreach (var player in _sessionData.Players.Copy())
|
||||
{
|
||||
DrawPlayerPointer(player);
|
||||
|
||||
var color = player.Color.ToColor();
|
||||
_spriteBatch.DrawRectangle(new Rectangle(player.Position.X * _state.TileSize - 4, player.Position.Y * _state.TileSize - 4, _state.TileSize + 7, _state.TileSize + 7), color, 2);
|
||||
|
||||
foreach (var font in _fonts.Keys)
|
||||
{
|
||||
System.Console.WriteLine(font);
|
||||
}
|
||||
|
||||
var ffont = _fonts.FirstOrDefault(m => int.Parse(m.Key.Replace("font", "")) > _state.TileSize).Value ?? _fonts.Last().Value;
|
||||
|
||||
var fscale = _state.TileSize / ((float)ffont.LineSpacing * 2);
|
||||
_spriteBatch.DrawString(ffont,
|
||||
player.Initials,
|
||||
new Vector2(player.Position.X * _state.TileSize + 2, player.Position.Y * _state.TileSize + _state.TileSize - 2 - ffont.LineSpacing * fscale),
|
||||
color,
|
||||
0,
|
||||
Vector2.Zero,
|
||||
fscale,
|
||||
SpriteEffects.None,
|
||||
0);
|
||||
}
|
||||
|
||||
|
||||
foreach (var player in _sessionData.Players.Copy())
|
||||
{
|
||||
var isOffscreen = IsOffscreen(player.Position);
|
||||
if (isOffscreen)
|
||||
{
|
||||
DrawPlayerPointer(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Console.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue