small campaign progress
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
9f9be13215
commit
96657989c8
18 changed files with 439 additions and 89 deletions
|
@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||||
using Sledgemapper.Api.Commands;
|
using Sledgemapper.Api.Commands;
|
||||||
using Sledgemapper.Api.Notifications;
|
using Sledgemapper.Api.Notifications;
|
||||||
using Sledgemapper.Shared.Entities;
|
using Sledgemapper.Shared.Entities;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
@ -28,6 +29,14 @@ namespace Sledgemapper.Api.Controllers
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//[HttpPost]
|
||||||
|
//[Route("{campaignName}")]
|
||||||
|
//public async Task<Guid> Get(string campaignName)
|
||||||
|
//{
|
||||||
|
// var result = await _mediator.Send(new GetCampaignCommand(campaignName, UserId.ToString()));
|
||||||
|
// return result;
|
||||||
|
//}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<List<Campaign>> Get()
|
public async Task<List<Campaign>> Get()
|
||||||
{
|
{
|
||||||
|
@ -50,5 +59,7 @@ namespace Sledgemapper.Api.Controllers
|
||||||
var result = await _mediator.Send(new GetCampaignPlayersCommand(campaignName, UserId.ToString()));
|
var result = await _mediator.Send(new GetCampaignPlayersCommand(campaignName, UserId.ToString()));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -69,5 +69,11 @@ namespace Sledgemapper
|
||||||
|
|
||||||
[Get("/campaign/")]
|
[Get("/campaign/")]
|
||||||
Task<List<Campaign>> GetCampaigns();
|
Task<List<Campaign>> GetCampaigns();
|
||||||
|
|
||||||
|
[Get("/campaign/{campaignName}/players")]
|
||||||
|
Task<List<Player>> GetPlayers(string campaignName);
|
||||||
|
|
||||||
|
[Post("/campaign/{campaignName}/players/{email}")]
|
||||||
|
Task InvitePlayer(string campaignName, string email);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -221,6 +221,7 @@ namespace Sledgemapper
|
||||||
_mainWidget.BtnToolbarLine.Click += OnBtnToolbarLinClicked;
|
_mainWidget.BtnToolbarLine.Click += OnBtnToolbarLinClicked;
|
||||||
_mainWidget.BtnToolbarRoom.Click += OnBtnToolbarRoomClicked;
|
_mainWidget.BtnToolbarRoom.Click += OnBtnToolbarRoomClicked;
|
||||||
_mainWidget.BtnToolbarDelete.Click += OnBtnToolbarDeleteClicked;
|
_mainWidget.BtnToolbarDelete.Click += OnBtnToolbarDeleteClicked;
|
||||||
|
_mainWidget.MenuCampaignPlayers.Selected += OnMenuCampaignPlayersSelected;
|
||||||
|
|
||||||
|
|
||||||
_wallsContent = Content.LoadContentFolder<Texture2D>("walls");
|
_wallsContent = Content.LoadContentFolder<Texture2D>("walls");
|
||||||
|
@ -255,6 +256,68 @@ namespace Sledgemapper
|
||||||
_whiteRectangle.SetData(new[] { Color.White });
|
_whiteRectangle.SetData(new[] { Color.White });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void OnMenuCampaignPlayersSelected(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!((MenuItem)sender).Enabled)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Window window = new()
|
||||||
|
{
|
||||||
|
Title = "Players"
|
||||||
|
};
|
||||||
|
|
||||||
|
var content = new PlayerList();
|
||||||
|
var players = await _communicationManager.Api.GetPlayers(_state.CampaignName);
|
||||||
|
foreach (var player in players)
|
||||||
|
{
|
||||||
|
var item = new PlayerListItem();
|
||||||
|
item.TxtPlayerName.Text = player.UserName;
|
||||||
|
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
|
||||||
|
});
|
||||||
|
|
||||||
|
content.StackCampaignsList.AddChild(item);
|
||||||
|
}
|
||||||
|
//content.BtnNewCampaign.Text = "N";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
content.BtnInvitePlayer.Click += (s, e) =>
|
||||||
|
{
|
||||||
|
window.Close();
|
||||||
|
ShowAddPLayerWindow();
|
||||||
|
};
|
||||||
|
|
||||||
|
window.Content = content;
|
||||||
|
|
||||||
|
window.ShowModal(_desktop);
|
||||||
|
// content.TxtCampaign.SetKeyboardFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowAddPLayerWindow()
|
||||||
|
{
|
||||||
|
Window window = new()
|
||||||
|
{
|
||||||
|
Title = "Invite player"
|
||||||
|
};
|
||||||
|
|
||||||
|
var content = new PlayerWindow();
|
||||||
|
//content.BtnNewCampaign.Text = "N";
|
||||||
|
content.BtnNewCampaign.Click += OnButtonInvitePlayerClicked;
|
||||||
|
window.Content = content;
|
||||||
|
|
||||||
|
window.ShowModal(_desktop);
|
||||||
|
content.TxtCampaign.SetKeyboardFocus();
|
||||||
|
}
|
||||||
|
|
||||||
private void OnTxtOverlaySearchChange(object sender, ValueChangedEventArgs<string> e)
|
private void OnTxtOverlaySearchChange(object sender, ValueChangedEventArgs<string> e)
|
||||||
{
|
{
|
||||||
AddItemToToolGrid(_mainWidget.GridOverlays, OnOverlayButtonClicked, _spriteSheet, e.NewValue);
|
AddItemToToolGrid(_mainWidget.GridOverlays, OnOverlayButtonClicked, _spriteSheet, e.NewValue);
|
||||||
|
@ -304,7 +367,7 @@ namespace Sledgemapper
|
||||||
|
|
||||||
private void OnMenuCampaignNew(object sender, EventArgs e)
|
private void OnMenuCampaignNew(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (!((MenuItem)sender).Enabled)
|
if (sender is MenuItem && !((MenuItem)sender).Enabled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -316,7 +379,7 @@ namespace Sledgemapper
|
||||||
|
|
||||||
var content = new CampaignWindow();
|
var content = new CampaignWindow();
|
||||||
//content.BtnNewCampaign.Text = "N";
|
//content.BtnNewCampaign.Text = "N";
|
||||||
content.BtnNewCampaign.Click += OnButtonNewCampaignClicked;
|
content.BtnNewCampaign.Click += OnButtonInvitePlayerClicked;
|
||||||
window.Content = content;
|
window.Content = content;
|
||||||
|
|
||||||
window.ShowModal(_desktop);
|
window.ShowModal(_desktop);
|
||||||
|
@ -342,22 +405,39 @@ namespace Sledgemapper
|
||||||
var item = new CampaignListItem();
|
var item = new CampaignListItem();
|
||||||
item.TxtCampaignName.Text = campaign.Name;
|
item.TxtCampaignName.Text = campaign.Name;
|
||||||
item.Background = new NinePatchRegion(
|
item.Background = new NinePatchRegion(
|
||||||
Content.Load<Texture2D>("listBackground"), new Rectangle(0, 0, 418, 98),
|
Content.Load<Texture2D>("listBackground"), new Rectangle(0, 0, 418, 25),
|
||||||
new Myra.Graphics2D.Thickness {Left = 11, Right = 11,
|
new Myra.Graphics2D.Thickness
|
||||||
Top = 11, Bottom = 11});
|
{
|
||||||
content.StackNotesList.AddChild(item);
|
Left = 11,
|
||||||
|
Right = 11,
|
||||||
|
Top = 11,
|
||||||
|
Bottom = 11
|
||||||
|
});
|
||||||
|
item.TouchUp += OnCampaignSelected;
|
||||||
|
content.StackCampaignsList.AddChild(item);
|
||||||
}
|
}
|
||||||
//content.BtnNewCampaign.Text = "N";
|
//content.BtnNewCampaign.Text = "N";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// content.BtnNewCampaign.Click += OnButtonNewCampaignClicked;
|
content.BtnNewCampaign.Click += (s, e) =>
|
||||||
|
{
|
||||||
|
window.Close();
|
||||||
|
OnMenuCampaignNew(s, e);
|
||||||
|
};
|
||||||
|
|
||||||
window.Content = content;
|
window.Content = content;
|
||||||
|
|
||||||
window.ShowModal(_desktop);
|
window.ShowModal(_desktop);
|
||||||
// content.TxtCampaign.SetKeyboardFocus();
|
// content.TxtCampaign.SetKeyboardFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnCampaignSelected(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var item = sender as CampaignListItem;
|
||||||
|
_state.CampaignName = item.TxtCampaignName.Text;
|
||||||
|
}
|
||||||
|
|
||||||
private void OneMenuFileSettingsSelected(object sender, EventArgs e)
|
private void OneMenuFileSettingsSelected(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var propertyGrid = new PropertyGrid
|
var propertyGrid = new PropertyGrid
|
||||||
|
@ -1962,7 +2042,7 @@ item.Background= new NinePatchRegion(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void OnButtonNewCampaignClicked(object sender, EventArgs e)
|
private async void OnButtonInvitePlayerClicked(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Container container = ((TextButton)sender).Parent;
|
Container container = ((TextButton)sender).Parent;
|
||||||
while (!(container is Window))
|
while (!(container is Window))
|
||||||
|
@ -1970,24 +2050,24 @@ item.Background= new NinePatchRegion(
|
||||||
container = container.Parent;
|
container = container.Parent;
|
||||||
}
|
}
|
||||||
var localWindow = (Window)container;
|
var localWindow = (Window)container;
|
||||||
var localContent = localWindow.Content as CampaignWindow;
|
var localContent = localWindow.Content as PlayerWindow;
|
||||||
var isValid = ValidateTextbox(localContent.TxtCampaign);
|
var isValid = ValidateTextbox(localContent.TxtCampaign);
|
||||||
if (!isValid)
|
if (!isValid)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_communicationManager.Connection.State != HubConnectionState.Connected)
|
//if (_communicationManager.Connection.State != HubConnectionState.Connected)
|
||||||
{
|
//{
|
||||||
_mainWidget.lblConnectionStatus.Text = "Connecting";
|
// _mainWidget.lblConnectionStatus.Text = "Connecting";
|
||||||
await _communicationManager.Connection.StartAsync();
|
// await _communicationManager.Connection.StartAsync();
|
||||||
UpdateConnectionState(_communicationManager.Connection);
|
// UpdateConnectionState(_communicationManager.Connection);
|
||||||
}
|
//}
|
||||||
|
|
||||||
var successful = false;
|
var successful = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _communicationManager.Api.NewCampaign(localContent.TxtCampaign.Text);
|
await _communicationManager.Api.InvitePlayer(_state.CampaignName, localContent.TxtCampaign.Text);
|
||||||
|
|
||||||
//if (result)
|
//if (result)
|
||||||
//{
|
//{
|
||||||
|
@ -2007,17 +2087,20 @@ item.Background= new NinePatchRegion(
|
||||||
ExceptionlessClient.Default.SubmitException(ex);
|
ExceptionlessClient.Default.SubmitException(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (successful)
|
//if (successful)
|
||||||
{
|
//{
|
||||||
//_sessionData.SessionName = localContent.TxtSession.Text;
|
// //_sessionData.SessionName = localContent.TxtSession.Text;
|
||||||
//_communicationManager.SessionData.Map = _sessionData.Map;
|
// //_communicationManager.SessionData.Map = _sessionData.Map;
|
||||||
//_communicationManager.SessionData.Overlays = _sessionData.Overlays;
|
// //_communicationManager.SessionData.Overlays = _sessionData.Overlays;
|
||||||
//_communicationManager.SessionData.Walls = _sessionData.Walls;
|
// //_communicationManager.SessionData.Walls = _sessionData.Walls;
|
||||||
//_mainWidget.lblSessionName.Text = _sessionData.SessionName;
|
// //_mainWidget.lblSessionName.Text = _sessionData.SessionName;
|
||||||
//_mainWidget.MenuConnectSync.Enabled = true;
|
// //_mainWidget.MenuConnectSync.Enabled = true;
|
||||||
//_mainWidget.MenuConnectUpload.Enabled = true;
|
// //_mainWidget.MenuConnectUpload.Enabled = true;
|
||||||
|
// localWindow.Close();
|
||||||
|
//}
|
||||||
|
|
||||||
localWindow.Close();
|
localWindow.Close();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void OnButtonNewSessionClicked(object sender, EventArgs e)
|
private async void OnButtonNewSessionClicked(object sender, EventArgs e)
|
||||||
|
|
|
@ -21,6 +21,7 @@ namespace Sledgemapper
|
||||||
public float LineWidth { get; internal set; }
|
public float LineWidth { get; internal set; }
|
||||||
|
|
||||||
public InsertMode InsertMode;
|
public InsertMode InsertMode;
|
||||||
|
public string CampaignName { get; set; }
|
||||||
|
|
||||||
public State()
|
public State()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Generated by MyraPad at 03/06/2021 15:48:34 */
|
/* Generated by MyraPad at 28/08/2021 16:25:44 */
|
||||||
using Myra;
|
using Myra;
|
||||||
using Myra.Graphics2D;
|
using Myra.Graphics2D;
|
||||||
using Myra.Graphics2D.TextureAtlases;
|
using Myra.Graphics2D.TextureAtlases;
|
||||||
|
@ -26,44 +26,44 @@ namespace Sledgemapper.UI
|
||||||
label1.Text = "Campaigns";
|
label1.Text = "Campaigns";
|
||||||
label1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
|
label1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
|
||||||
|
|
||||||
StackNotesList = new VerticalStackPanel();
|
StackCampaignsList = new VerticalStackPanel();
|
||||||
StackNotesList.Proportions.Add(new Proportion
|
StackCampaignsList.MinHeight = 350;
|
||||||
{
|
StackCampaignsList.MaxHeight = 350;
|
||||||
Type = Myra.Graphics2D.UI.ProportionType.Fill,
|
StackCampaignsList.Id = "StackCampaignsList";
|
||||||
});
|
|
||||||
StackNotesList.MinHeight = 350;
|
|
||||||
StackNotesList.Id = "StackNotesList";
|
|
||||||
|
|
||||||
var scrollViewer1 = new ScrollViewer();
|
var scrollViewer1 = new ScrollViewer();
|
||||||
scrollViewer1.Content = StackNotesList;
|
scrollViewer1.Content = StackCampaignsList;
|
||||||
|
|
||||||
var textButton1 = new TextButton();
|
BtnNewCampaign = new TextButton();
|
||||||
textButton1.Text = "New";
|
BtnNewCampaign.Text = "New";
|
||||||
textButton1.Width = 70;
|
BtnNewCampaign.Width = 70;
|
||||||
textButton1.Height = 20;
|
BtnNewCampaign.Height = 20;
|
||||||
textButton1.Padding = new Thickness(5);
|
BtnNewCampaign.Padding = new Thickness(5);
|
||||||
textButton1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
|
BtnNewCampaign.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
|
||||||
|
BtnNewCampaign.Id = "BtnNewCampaign";
|
||||||
|
|
||||||
var textButton2 = new TextButton();
|
BtnLoadCampaign = new TextButton();
|
||||||
textButton2.Text = "Load";
|
BtnLoadCampaign.Text = "Load";
|
||||||
textButton2.Width = 70;
|
BtnLoadCampaign.Width = 70;
|
||||||
textButton2.Height = 20;
|
BtnLoadCampaign.Height = 20;
|
||||||
textButton2.Padding = new Thickness(5);
|
BtnLoadCampaign.Padding = new Thickness(5);
|
||||||
textButton2.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
|
BtnLoadCampaign.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
|
||||||
|
BtnLoadCampaign.Id = "BtnLoadCampaign";
|
||||||
|
|
||||||
var textButton3 = new TextButton();
|
BtnCancelCampaign = new TextButton();
|
||||||
textButton3.Text = "Cancel";
|
BtnCancelCampaign.Text = "Cancel";
|
||||||
textButton3.Width = 70;
|
BtnCancelCampaign.Width = 70;
|
||||||
textButton3.Height = 20;
|
BtnCancelCampaign.Height = 20;
|
||||||
textButton3.Padding = new Thickness(5);
|
BtnCancelCampaign.Padding = new Thickness(5);
|
||||||
textButton3.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
|
BtnCancelCampaign.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
|
||||||
|
BtnCancelCampaign.Id = "BtnCancelCampaign";
|
||||||
|
|
||||||
var horizontalStackPanel1 = new HorizontalStackPanel();
|
var horizontalStackPanel1 = new HorizontalStackPanel();
|
||||||
horizontalStackPanel1.Spacing = 15;
|
horizontalStackPanel1.Spacing = 15;
|
||||||
horizontalStackPanel1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Right;
|
horizontalStackPanel1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Right;
|
||||||
horizontalStackPanel1.Widgets.Add(textButton1);
|
horizontalStackPanel1.Widgets.Add(BtnNewCampaign);
|
||||||
horizontalStackPanel1.Widgets.Add(textButton2);
|
horizontalStackPanel1.Widgets.Add(BtnLoadCampaign);
|
||||||
horizontalStackPanel1.Widgets.Add(textButton3);
|
horizontalStackPanel1.Widgets.Add(BtnCancelCampaign);
|
||||||
|
|
||||||
|
|
||||||
Spacing = 13;
|
Spacing = 13;
|
||||||
|
@ -75,6 +75,9 @@ namespace Sledgemapper.UI
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public VerticalStackPanel StackNotesList;
|
public VerticalStackPanel StackCampaignsList;
|
||||||
|
public TextButton BtnNewCampaign;
|
||||||
|
public TextButton BtnLoadCampaign;
|
||||||
|
public TextButton BtnCancelCampaign;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Generated by MyraPad at 03/06/2021 16:16:33 */
|
/* Generated by MyraPad at 28/08/2021 19:31:16 */
|
||||||
using Myra;
|
using Myra;
|
||||||
using Myra.Graphics2D;
|
using Myra.Graphics2D;
|
||||||
using Myra.Graphics2D.TextureAtlases;
|
using Myra.Graphics2D.TextureAtlases;
|
||||||
|
@ -32,7 +32,7 @@ namespace Sledgemapper.UI
|
||||||
|
|
||||||
VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center;
|
VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center;
|
||||||
Width = 300;
|
Width = 300;
|
||||||
Height = 45;
|
Height = 30;
|
||||||
BorderThickness = new Thickness(2);
|
BorderThickness = new Thickness(2);
|
||||||
Padding = new Thickness(10);
|
Padding = new Thickness(10);
|
||||||
Id = "PnlCampaignItem";
|
Id = "PnlCampaignItem";
|
||||||
|
|
73
Sledgemapper/UI/PlayerList.Generated.cs
Normal file
73
Sledgemapper/UI/PlayerList.Generated.cs
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
/* Generated by MyraPad at 28/08/2021 19:49:08 */
|
||||||
|
using Myra;
|
||||||
|
using Myra.Graphics2D;
|
||||||
|
using Myra.Graphics2D.TextureAtlases;
|
||||||
|
using Myra.Graphics2D.UI;
|
||||||
|
using Myra.Graphics2D.Brushes;
|
||||||
|
using Myra.Graphics2D.UI.Properties;
|
||||||
|
|
||||||
|
#if MONOGAME || FNA
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
#elif STRIDE
|
||||||
|
using Stride.Core.Mathematics;
|
||||||
|
#else
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Numerics;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace Sledgemapper.UI
|
||||||
|
{
|
||||||
|
partial class PlayerList: VerticalStackPanel
|
||||||
|
{
|
||||||
|
private void BuildUI()
|
||||||
|
{
|
||||||
|
var label1 = new Label();
|
||||||
|
label1.Text = "Campaigns";
|
||||||
|
label1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
|
||||||
|
|
||||||
|
StackCampaignsList = new VerticalStackPanel();
|
||||||
|
StackCampaignsList.MinHeight = 350;
|
||||||
|
StackCampaignsList.MaxHeight = 350;
|
||||||
|
StackCampaignsList.Id = "StackCampaignsList";
|
||||||
|
|
||||||
|
var scrollViewer1 = new ScrollViewer();
|
||||||
|
scrollViewer1.Content = StackCampaignsList;
|
||||||
|
|
||||||
|
BtnInvitePlayer = new TextButton();
|
||||||
|
BtnInvitePlayer.Text = "Invite";
|
||||||
|
BtnInvitePlayer.Width = 70;
|
||||||
|
BtnInvitePlayer.Height = 20;
|
||||||
|
BtnInvitePlayer.Padding = new Thickness(5);
|
||||||
|
BtnInvitePlayer.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
|
||||||
|
BtnInvitePlayer.Id = "BtnInvitePlayer";
|
||||||
|
|
||||||
|
BtnCancelCampaign = new TextButton();
|
||||||
|
BtnCancelCampaign.Text = "Cancel";
|
||||||
|
BtnCancelCampaign.Width = 70;
|
||||||
|
BtnCancelCampaign.Height = 20;
|
||||||
|
BtnCancelCampaign.Padding = new Thickness(5);
|
||||||
|
BtnCancelCampaign.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
|
||||||
|
BtnCancelCampaign.Id = "BtnCancelCampaign";
|
||||||
|
|
||||||
|
var horizontalStackPanel1 = new HorizontalStackPanel();
|
||||||
|
horizontalStackPanel1.Spacing = 15;
|
||||||
|
horizontalStackPanel1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Right;
|
||||||
|
horizontalStackPanel1.Widgets.Add(BtnInvitePlayer);
|
||||||
|
horizontalStackPanel1.Widgets.Add(BtnCancelCampaign);
|
||||||
|
|
||||||
|
|
||||||
|
Spacing = 13;
|
||||||
|
Width = 400;
|
||||||
|
Padding = new Thickness(10);
|
||||||
|
Widgets.Add(label1);
|
||||||
|
Widgets.Add(scrollViewer1);
|
||||||
|
Widgets.Add(horizontalStackPanel1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public VerticalStackPanel StackCampaignsList;
|
||||||
|
public TextButton BtnInvitePlayer;
|
||||||
|
public TextButton BtnCancelCampaign;
|
||||||
|
}
|
||||||
|
}
|
11
Sledgemapper/UI/PlayerList.cs
Normal file
11
Sledgemapper/UI/PlayerList.cs
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
/* Generated by MyraPad at 28/08/2021 19:49:08 */
|
||||||
|
namespace Sledgemapper.UI
|
||||||
|
{
|
||||||
|
public partial class PlayerList
|
||||||
|
{
|
||||||
|
public PlayerList()
|
||||||
|
{
|
||||||
|
BuildUI();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
45
Sledgemapper/UI/PlayerListItem.Generated.cs
Normal file
45
Sledgemapper/UI/PlayerListItem.Generated.cs
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
/* Generated by MyraPad at 28/08/2021 19:49:48 */
|
||||||
|
using Myra;
|
||||||
|
using Myra.Graphics2D;
|
||||||
|
using Myra.Graphics2D.TextureAtlases;
|
||||||
|
using Myra.Graphics2D.UI;
|
||||||
|
using Myra.Graphics2D.Brushes;
|
||||||
|
using Myra.Graphics2D.UI.Properties;
|
||||||
|
|
||||||
|
#if MONOGAME || FNA
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
#elif STRIDE
|
||||||
|
using Stride.Core.Mathematics;
|
||||||
|
#else
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Numerics;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace Sledgemapper.UI
|
||||||
|
{
|
||||||
|
partial class PlayerListItem: HorizontalStackPanel
|
||||||
|
{
|
||||||
|
private void BuildUI()
|
||||||
|
{
|
||||||
|
TxtPlayerName = new Label();
|
||||||
|
TxtPlayerName.Text = "Highfell";
|
||||||
|
TxtPlayerName.TextColor = ColorStorage.CreateColor(102, 102, 102, 255);
|
||||||
|
TxtPlayerName.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center;
|
||||||
|
TxtPlayerName.Background = new SolidBrush("#00000000");
|
||||||
|
TxtPlayerName.Id = "TxtPlayerName";
|
||||||
|
|
||||||
|
|
||||||
|
VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center;
|
||||||
|
Width = 300;
|
||||||
|
Height = 30;
|
||||||
|
BorderThickness = new Thickness(2);
|
||||||
|
Padding = new Thickness(10);
|
||||||
|
Id = "PnlPlayerItem";
|
||||||
|
Widgets.Add(TxtPlayerName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Label TxtPlayerName;
|
||||||
|
}
|
||||||
|
}
|
11
Sledgemapper/UI/PlayerListItem.cs
Normal file
11
Sledgemapper/UI/PlayerListItem.cs
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
/* Generated by MyraPad at 28/08/2021 19:49:48 */
|
||||||
|
namespace Sledgemapper.UI
|
||||||
|
{
|
||||||
|
public partial class PlayerListItem
|
||||||
|
{
|
||||||
|
public PlayerListItem()
|
||||||
|
{
|
||||||
|
BuildUI();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
67
Sledgemapper/UI/PlayerWindow.Generated.cs
Normal file
67
Sledgemapper/UI/PlayerWindow.Generated.cs
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
/* Generated by MyraPad at 28/08/2021 22:04:37 */
|
||||||
|
using Myra;
|
||||||
|
using Myra.Graphics2D;
|
||||||
|
using Myra.Graphics2D.TextureAtlases;
|
||||||
|
using Myra.Graphics2D.UI;
|
||||||
|
using Myra.Graphics2D.Brushes;
|
||||||
|
using Myra.Graphics2D.UI.Properties;
|
||||||
|
|
||||||
|
#if MONOGAME || FNA
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
#elif STRIDE
|
||||||
|
using Stride.Core.Mathematics;
|
||||||
|
#else
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Numerics;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace Sledgemapper.UI
|
||||||
|
{
|
||||||
|
partial class PlayerWindow: VerticalStackPanel
|
||||||
|
{
|
||||||
|
private void BuildUI()
|
||||||
|
{
|
||||||
|
var label1 = new Label();
|
||||||
|
label1.Text = "Email";
|
||||||
|
|
||||||
|
TxtCampaign = new TextBox();
|
||||||
|
TxtCampaign.GridColumn = 1;
|
||||||
|
TxtCampaign.Id = "TxtCampaign";
|
||||||
|
|
||||||
|
var grid1 = new Grid();
|
||||||
|
grid1.ColumnSpacing = 25;
|
||||||
|
grid1.RowSpacing = 10;
|
||||||
|
grid1.ColumnsProportions.Add(new Proportion
|
||||||
|
{
|
||||||
|
Type = Myra.Graphics2D.UI.ProportionType.Pixels,
|
||||||
|
Value = 60,
|
||||||
|
});
|
||||||
|
grid1.ColumnsProportions.Add(new Proportion
|
||||||
|
{
|
||||||
|
Type = Myra.Graphics2D.UI.ProportionType.Fill,
|
||||||
|
});
|
||||||
|
grid1.Widgets.Add(label1);
|
||||||
|
grid1.Widgets.Add(TxtCampaign);
|
||||||
|
|
||||||
|
BtnNewCampaign = new TextButton();
|
||||||
|
BtnNewCampaign.Text = "New";
|
||||||
|
BtnNewCampaign.Padding = new Thickness(10, 5);
|
||||||
|
BtnNewCampaign.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
|
||||||
|
BtnNewCampaign.Id = "BtnNewCampaign";
|
||||||
|
|
||||||
|
|
||||||
|
Spacing = 16;
|
||||||
|
HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
|
||||||
|
VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center;
|
||||||
|
Width = 300;
|
||||||
|
Padding = new Thickness(10);
|
||||||
|
Widgets.Add(grid1);
|
||||||
|
Widgets.Add(BtnNewCampaign);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public TextBox TxtCampaign;
|
||||||
|
public TextButton BtnNewCampaign;
|
||||||
|
}
|
||||||
|
}
|
11
Sledgemapper/UI/PlayerWindow.cs
Normal file
11
Sledgemapper/UI/PlayerWindow.cs
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
/* Generated by MyraPad at 28/08/2021 22:04:11 */
|
||||||
|
namespace Sledgemapper.UI
|
||||||
|
{
|
||||||
|
public partial class PlayerWindow
|
||||||
|
{
|
||||||
|
public PlayerWindow()
|
||||||
|
{
|
||||||
|
BuildUI();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
<Project>
|
<Project>
|
||||||
<Project.ExportOptions Namespace="Sledgemapper.UI" Class="CampaignListItem" OutputPath="C:\src\Map\Sledgemapper\UI" />
|
<Project.ExportOptions Namespace="Sledgemapper.UI" Class="CampaignListItem" OutputPath="C:\dev\Map\Sledgemapper\UI" />
|
||||||
<HorizontalStackPanel VerticalAlignment="Center" Width="300" Height="45" BorderThickness="2" Padding="10" Id="PnlCampaignItem">
|
<HorizontalStackPanel VerticalAlignment="Center" Width="300" Height="30" BorderThickness="2" Padding="10" Id="PnlCampaignItem">
|
||||||
<Label Text="Highfell" TextColor="#666666FF" VerticalAlignment="Center" Background="#00000000" Id="TxtCampaignName" />
|
<Label Text="Highfell" TextColor="#666666FF" VerticalAlignment="Center" Background="#00000000" Id="TxtCampaignName" />
|
||||||
</HorizontalStackPanel>
|
</HorizontalStackPanel>
|
||||||
</Project>
|
</Project>
|
|
@ -1,19 +1,14 @@
|
||||||
<Project>
|
<Project>
|
||||||
<Project.ExportOptions Namespace="Sledgemapper.UI" Class="CampaignList" OutputPath="C:\src\Map\Sledgemapper\UI" />
|
<Project.ExportOptions Namespace="Sledgemapper.UI" Class="CampaignList" OutputPath="C:\dev\Map\Sledgemapper\UI" />
|
||||||
<VerticalStackPanel Width="400" Padding="10" Spacing="13">
|
<VerticalStackPanel Spacing="13" Width="400" Padding="10">
|
||||||
<Label Text="Campaigns" HorizontalAlignment="Center" />
|
<Label Text="Campaigns" HorizontalAlignment="Center" />
|
||||||
<ScrollViewer>
|
<ScrollViewer>
|
||||||
<VerticalStackPanel MinHeight="350" Id="StackNotesList" >
|
<VerticalStackPanel MinHeight="350" MaxHeight="350" Id="StackCampaignsList" />
|
||||||
<VerticalStackPanel.Proportions>
|
|
||||||
<Proportion Type="Fill" />
|
|
||||||
</VerticalStackPanel.Proportions>
|
|
||||||
</VerticalStackPanel>
|
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
<HorizontalStackPanel Spacing="15" HorizontalAlignment="Right">
|
<HorizontalStackPanel Spacing="15" HorizontalAlignment="Right">
|
||||||
<TextButton Text="New" ImageHorizontalAlignment="Left" Width="70" Height="20" Padding="5" HorizontalAlignment="Center" />
|
<TextButton Text="New" Width="70" Height="20" Padding="5" HorizontalAlignment="Center" Id="BtnNewCampaign" />
|
||||||
<TextButton Text="Load" Width="70" Height="20" Padding="5" HorizontalAlignment="Center"/>
|
<TextButton Text="Load" Width="70" Height="20" Padding="5" HorizontalAlignment="Center" Id="BtnLoadCampaign" />
|
||||||
<TextButton Text="Cancel" Width="70" Height="20" Padding="5" HorizontalAlignment="Center"/>
|
<TextButton Text="Cancel" Width="70" Height="20" Padding="5" HorizontalAlignment="Center" Id="BtnCancelCampaign" />
|
||||||
</HorizontalStackPanel>
|
</HorizontalStackPanel>
|
||||||
</VerticalStackPanel>
|
</VerticalStackPanel>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
14
Sledgemapper/UI/newPlayerWindow.xmmp
Normal file
14
Sledgemapper/UI/newPlayerWindow.xmmp
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<Project>
|
||||||
|
<Project.ExportOptions Namespace="Sledgemapper.UI" Class="PlayerWindow" OutputPath="C:\dev\Map\Sledgemapper\UI" />
|
||||||
|
<VerticalStackPanel Spacing="16" HorizontalAlignment="Center" VerticalAlignment="Center" Width="300" Padding="10">
|
||||||
|
<Grid ColumnSpacing="25" RowSpacing="10">
|
||||||
|
<Grid.ColumnsProportions>
|
||||||
|
<Proportion Type="Pixels" Value="60" />
|
||||||
|
<Proportion Type="Fill" />
|
||||||
|
</Grid.ColumnsProportions>
|
||||||
|
<Label Text="Email" />
|
||||||
|
<TextBox GridColumn="1" Id="TxtCampaign" />
|
||||||
|
</Grid>
|
||||||
|
<TextButton Text="New" Padding="10, 5" HorizontalAlignment="Center" Id="BtnNewCampaign" />
|
||||||
|
</VerticalStackPanel>
|
||||||
|
</Project>
|
6
Sledgemapper/UI/playerListItem.xmmp
Normal file
6
Sledgemapper/UI/playerListItem.xmmp
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<Project>
|
||||||
|
<Project.ExportOptions Namespace="Sledgemapper.UI" Class="PlayerListItem" OutputPath="C:\dev\Map\Sledgemapper\UI" />
|
||||||
|
<HorizontalStackPanel VerticalAlignment="Center" Width="300" Height="30" BorderThickness="2" Padding="10" Id="PnlPlayerItem">
|
||||||
|
<Label Text="Highfell" TextColor="#666666FF" VerticalAlignment="Center" Background="#00000000" Id="TxtPlayerName" />
|
||||||
|
</HorizontalStackPanel>
|
||||||
|
</Project>
|
13
Sledgemapper/UI/playersList.xmmp
Normal file
13
Sledgemapper/UI/playersList.xmmp
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<Project>
|
||||||
|
<Project.ExportOptions Namespace="Sledgemapper.UI" Class="PlayerList" OutputPath="C:\dev\Map\Sledgemapper\UI" />
|
||||||
|
<VerticalStackPanel Spacing="13" Width="400" Padding="10">
|
||||||
|
<Label Text="Campaigns" HorizontalAlignment="Center" />
|
||||||
|
<ScrollViewer>
|
||||||
|
<VerticalStackPanel MinHeight="350" MaxHeight="350" Id="StackCampaignsList" />
|
||||||
|
</ScrollViewer>
|
||||||
|
<HorizontalStackPanel Spacing="15" HorizontalAlignment="Right">
|
||||||
|
<TextButton Text="Invite" Width="70" Height="20" Padding="5" HorizontalAlignment="Center" Id="BtnInvitePlayer" />
|
||||||
|
<TextButton Text="Cancel" Width="70" Height="20" Padding="5" HorizontalAlignment="Center" Id="BtnCancelCampaign" />
|
||||||
|
</HorizontalStackPanel>
|
||||||
|
</VerticalStackPanel>
|
||||||
|
</Project>
|
Loading…
Add table
Add a link
Reference in a new issue