display note on grid
This commit is contained in:
parent
ec98d53f48
commit
af7d9ee6cb
2 changed files with 43 additions and 0 deletions
|
@ -208,7 +208,17 @@ namespace Sledgemapper
|
|||
{
|
||||
Title = "Note"
|
||||
};
|
||||
noteWindow.BtnOk.Click += (s, e) =>
|
||||
{
|
||||
var note = new Note
|
||||
{
|
||||
X = _state.SelectedTile.X,
|
||||
Y = _state.SelectedTile.Y,
|
||||
Text = noteWindow.NoteText.Text
|
||||
};
|
||||
_sessionData.Notes.TryAdd(note.ToString(), note);
|
||||
|
||||
};
|
||||
// var content = new LoginRegisterWindow();
|
||||
// content.RdoLogin.IsPressed = true;
|
||||
// content.RdoLogin.Click += (s, e) =>
|
||||
|
@ -386,6 +396,8 @@ namespace Sledgemapper
|
|||
|
||||
DrawWalls();
|
||||
DrawOverlays();
|
||||
DrawNotes();
|
||||
|
||||
|
||||
if (string.IsNullOrWhiteSpace(_sessionData.SessionName))
|
||||
{
|
||||
|
@ -548,6 +560,35 @@ namespace Sledgemapper
|
|||
}
|
||||
}
|
||||
|
||||
private void DrawNotes()
|
||||
{
|
||||
foreach (var note in _sessionData.Notes.Values)
|
||||
{
|
||||
var ffont = _fonts.FirstOrDefault(m => int.Parse(m.Key.Replace("font", "")) > _state.TileSize / 8).Value ?? _fonts.Last().Value;
|
||||
var fscale = 1f;
|
||||
|
||||
|
||||
var screenPosition = new Point(note.X * _state.TileSize - (int)_viewportCenter.X, note.Y * _state.TileSize - (int)_viewportCenter.Y);
|
||||
|
||||
var x = screenPosition.X / _state.TileSize;
|
||||
var y = screenPosition.Y / _state.TileSize;
|
||||
|
||||
_spriteBatch.DrawString(ffont,
|
||||
"N",
|
||||
new Vector2(
|
||||
x * _state.TileSize + _state.TileSize - _state.TileSize/3,
|
||||
y * _state.TileSize + 2
|
||||
),
|
||||
Color.Black,
|
||||
0,
|
||||
Vector2.Zero,
|
||||
fscale,
|
||||
SpriteEffects.None,
|
||||
0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawOverlays()
|
||||
{
|
||||
foreach (var tile in _sessionData.Overlays.Values)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue