more campaign stuff
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Michele 2021-08-29 22:51:18 +01:00
parent 96657989c8
commit c46e66595b

View File

@ -214,6 +214,10 @@ namespace Sledgemapper
_mainWidget.MenuCampaingNew.Selected += OnMenuCampaignNew;
_mainWidget.MenuCampaignOpen.Selected += OnMenuCampaignOpen;
_mainWidget.MenuCampaignPlayers.Selected += OnMenuCampaignPlayersSelected;
_mainWidget.MenuMapOpen.Selected += OnMenuMapOpen;
_mainWidget.MenuConnectNew.Enabled = false;
_mainWidget.MenuConnectJoin.Enabled = false;
_mainWidget.MenuConnectSync.Enabled = false;
@ -221,7 +225,6 @@ namespace Sledgemapper
_mainWidget.BtnToolbarLine.Click += OnBtnToolbarLinClicked;
_mainWidget.BtnToolbarRoom.Click += OnBtnToolbarRoomClicked;
_mainWidget.BtnToolbarDelete.Click += OnBtnToolbarDeleteClicked;
_mainWidget.MenuCampaignPlayers.Selected += OnMenuCampaignPlayersSelected;
_wallsContent = Content.LoadContentFolder<Texture2D>("walls");
@ -256,6 +259,52 @@ namespace Sledgemapper
_whiteRectangle.SetData(new[] { Color.White });
}
private async void OnMenuMapOpen(object sender, EventArgs e)
{
if (!((MenuItem)sender).Enabled)
{
return;
}
Window window = new()
{
Title = "Maps"
};
var content = new CampaignList();
//var campaigns = await _communicationManager.Api.GetMaps();
//foreach (var campaign in campaigns)
//{
// var item = new CampaignListItem();
// item.TxtCampaignName.Text = campaign.Name;
// item.Background = new NinePatchRegion(
// Content.Load<Texture2D>("listBackground"), new Rectangle(0, 0, 418, 25),
// new Myra.Graphics2D.Thickness
// {
// Left = 11,
// Right = 11,
// Top = 11,
// Bottom = 11
// });
// item.TouchUp += OnCampaignSelected;
// content.StackCampaignsList.AddChild(item);
//}
//content.BtnNewCampaign.Text = "N";
content.BtnNewCampaign.Click += (s, e) =>
{
window.Close();
OnMenuCampaignNew(s, e);
};
window.Content = content;
window.ShowModal(_desktop);
// content.TxtCampaign.SetKeyboardFocus();
}
private async void OnMenuCampaignPlayersSelected(object sender, EventArgs e)
{
if (!((MenuItem)sender).Enabled)