small changes
This commit is contained in:
parent
49bde02544
commit
0b7b3116b4
4 changed files with 26 additions and 7 deletions
|
@ -153,6 +153,11 @@ namespace Sledgemapper
|
|||
_state.SelectOverlay(screenPosition);
|
||||
}
|
||||
|
||||
if (newState.IsKeyDown(Keys.LeftControl) && newState.IsKeyDown(Keys.C))
|
||||
{
|
||||
CenterOnSelectedTile();
|
||||
}
|
||||
|
||||
if (mouseState.LeftButton == ButtonState.Pressed && mouseState.LeftButton != oldMouseState.LeftButton)
|
||||
{
|
||||
_state._selectedTile.X = _state._hoveredTile.X;
|
||||
|
@ -187,6 +192,8 @@ namespace Sledgemapper
|
|||
if (!newState.IsKeyDown(Keys.LeftControl) && mouseState.LeftButton == ButtonState.Pressed && mouseState.LeftButton == oldMouseState.LeftButton)
|
||||
{
|
||||
_viewportCenter = new Vector3(_viewportCenter.X + mouseState.Position.X - oldMouseState.Position.X, _viewportCenter.Y + mouseState.Position.Y - oldMouseState.Position.Y, 0);
|
||||
|
||||
Console.WriteLine($"{_state._selectedTile.X}:{_state._selectedTile.Y} / {_viewportCenter.X}:{_viewportCenter.Y}");
|
||||
}
|
||||
|
||||
if (newState.IsKeyDown(Keys.LeftControl) && mouseState.ScrollWheelValue != oldMouseState.ScrollWheelValue)
|
||||
|
@ -254,6 +261,12 @@ namespace Sledgemapper
|
|||
base.Update(gameTime);
|
||||
}
|
||||
|
||||
private void CenterOnSelectedTile()
|
||||
{
|
||||
_viewportCenter.X=_state._selectedTile.X*_state._tileSize;
|
||||
_viewportCenter.Y=_state._selectedTile.Y*_state._tileSize;
|
||||
}
|
||||
|
||||
protected override void Draw(GameTime gameTime)
|
||||
{
|
||||
if (_spriteBatch is null)
|
||||
|
@ -676,7 +689,7 @@ namespace Sledgemapper
|
|||
LastName = localContent.TxtLastname.Text,
|
||||
Initials = localContent.TxtInitials.Text
|
||||
});
|
||||
if (result)
|
||||
if (result.IsSuccessStatusCode)
|
||||
{
|
||||
_authResponse = await _communicationManager.Login(new AuthenticateModel
|
||||
{
|
||||
|
@ -685,6 +698,11 @@ namespace Sledgemapper
|
|||
});
|
||||
successful = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
localContent.LblLoginError.Text = result.ReasonPhrase;
|
||||
localContent.LblLoginError.Visible = true;
|
||||
}
|
||||
}
|
||||
catch (Refit.ApiException refitException)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue