Compare commits

...

4 Commits

Author SHA1 Message Date
8f7428d27e Merge pull request 'campaign' (#5) from campaign into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #5
2021-09-25 08:15:30 +00:00
633c97e0da small fixes
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2021-09-24 21:53:00 +01:00
Michele Scandura
fe886315a1 Merge branch 'campaign' of https://git.michelescandura.com/michele/sledgemapper into campaign
All checks were successful
continuous-integration/drone/push Build is passing
2021-09-24 16:54:51 +01:00
Michele Scandura
9cd001919a fixing keyboard input 2021-09-24 16:54:44 +01:00
3 changed files with 17 additions and 5 deletions

View File

@ -28,11 +28,13 @@ namespace Sledgemapper.Api.Handlers
{ {
var user = await _dbcontext.Users.FindAsync(command.UserId); var user = await _dbcontext.Users.FindAsync(command.UserId);
_dbcontext.Attach(user); _dbcontext.Attach(user);
var campaigns = _dbcontext.Campaigns.Include(c => c.InvitedUsers).Include(c => c.Maps).Include(c => c.Owner).Where(campaign => campaign.OwnerId == command.UserId || campaign.InvitedUsers.Contains(user)); var campaigns = await _dbcontext.Campaigns
.Include(c => c.InvitedUsers)
.Include(c => c.Owner)
.Where(campaign => campaign.OwnerId == command.UserId || campaign.InvitedUsers.Contains(user)).ToListAsync();
return campaigns. return campaigns.Select(c => new Campaign { Id = c.CampaignId, Name = c.CampaignName }).ToList();
Select(c => new Campaign { Id = c.CampaignId, Name = c.CampaignName, Maps = c.Maps.Select(m => new Map { SessionName = m.SessionName }).ToList() })
.ToList();
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -137,7 +137,16 @@ namespace Sledgemapper
_outlineShader = Content.Load<Effect>("shaders/OutlineShader"); _outlineShader = Content.Load<Effect>("shaders/OutlineShader");
MyraEnvironment.Game = this; MyraEnvironment.Game = this;
ResetRenderTarget(); ResetRenderTarget();
// Inform Myra that external text input is available
// So it stops translating Keys to chars
_desktop.HasExternalTextInput = true;
// Provide that text input
Window.TextInput += (s, a) =>
{
_desktop.OnChar(a.Character);
};
_mainWidget = new MainWidget(_communicationManager, _messenger, Window); _mainWidget = new MainWidget(_communicationManager, _messenger, Window);
_communicationManager.CheckLogin(); _communicationManager.CheckLogin();

View File

@ -114,7 +114,6 @@ namespace Sledgemapper.UI
private void OnBtnToolbarDeleteClicked(object sender, EventArgs e) private void OnBtnToolbarDeleteClicked(object sender, EventArgs e)
{ {
Messenger.Publish(new ErrorMessage(this, "test"));
State.Instance.InsertMode = InsertMode.NewDelete; State.Instance.InsertMode = InsertMode.NewDelete;
ClearSelection(); ClearSelection();
@ -231,6 +230,8 @@ namespace Sledgemapper.UI
MenuCampaingNew.Enabled = true; MenuCampaingNew.Enabled = true;
MenuMapNew.Enabled = false; MenuMapNew.Enabled = false;
MenuMapOpen.Enabled = false; MenuMapOpen.Enabled = false;
MenuConnectSync.Enabled = false;
MenuConnectUpload.Enabled = false;
MenuCampaignPlayers.Enabled = false; MenuCampaignPlayers.Enabled = false;
lblCampaign.Text = "n/a"; lblCampaign.Text = "n/a";
lblMap.Text = "n/a"; lblMap.Text = "n/a";