campaign #5
@ -28,11 +28,13 @@ namespace Sledgemapper.Api.Handlers
|
||||
{
|
||||
var user = await _dbcontext.Users.FindAsync(command.UserId);
|
||||
_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.
|
||||
Select(c => new Campaign { Id = c.CampaignId, Name = c.CampaignName, Maps = c.Maps.Select(m => new Map { SessionName = m.SessionName }).ToList() })
|
||||
.ToList();
|
||||
return campaigns.Select(c => new Campaign { Id = c.CampaignId, Name = c.CampaignName }).ToList();
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -137,7 +137,16 @@ namespace Sledgemapper
|
||||
_outlineShader = Content.Load<Effect>("shaders/OutlineShader");
|
||||
MyraEnvironment.Game = this;
|
||||
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);
|
||||
_communicationManager.CheckLogin();
|
||||
|
@ -114,7 +114,6 @@ namespace Sledgemapper.UI
|
||||
|
||||
private void OnBtnToolbarDeleteClicked(object sender, EventArgs e)
|
||||
{
|
||||
Messenger.Publish(new ErrorMessage(this, "test"));
|
||||
State.Instance.InsertMode = InsertMode.NewDelete;
|
||||
|
||||
ClearSelection();
|
||||
@ -231,6 +230,8 @@ namespace Sledgemapper.UI
|
||||
MenuCampaingNew.Enabled = true;
|
||||
MenuMapNew.Enabled = false;
|
||||
MenuMapOpen.Enabled = false;
|
||||
MenuConnectSync.Enabled = false;
|
||||
MenuConnectUpload.Enabled = false;
|
||||
MenuCampaignPlayers.Enabled = false;
|
||||
lblCampaign.Text = "n/a";
|
||||
lblMap.Text = "n/a";
|
||||
|
Loading…
Reference in New Issue
Block a user