Compare commits
4 commits
18b79b79fa
...
04243cf088
Author | SHA1 | Date | |
---|---|---|---|
|
04243cf088 | ||
|
36134e1ea5 | ||
|
fd25025889 | ||
|
53bfb770ea |
12 changed files with 243 additions and 8 deletions
|
@ -9,5 +9,8 @@ namespace Sledgemapper.Shared.Entities
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public string Password { get; set; }
|
public string Password { get; set; }
|
||||||
|
|
||||||
|
[Required]
|
||||||
|
public string Email { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -107,7 +107,7 @@
|
||||||
|
|
||||||
#begin handcursorsIndex
|
#begin handcursorsIndex
|
||||||
/importer:XmlImporter
|
/importer:XmlImporter
|
||||||
/processor:
|
/processor:PassThroughProcessor
|
||||||
/build:handcursorsIndex
|
/build:handcursorsIndex
|
||||||
|
|
||||||
#begin icon_delete.png
|
#begin icon_delete.png
|
||||||
|
@ -146,6 +146,18 @@
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
/build:icon_room.png
|
/build:icon_room.png
|
||||||
|
|
||||||
|
#begin listBackground.png
|
||||||
|
/importer:TextureImporter
|
||||||
|
/processor:TextureProcessor
|
||||||
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
/processorParam:ColorKeyEnabled=True
|
||||||
|
/processorParam:GenerateMipmaps=False
|
||||||
|
/processorParam:PremultiplyAlpha=True
|
||||||
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
|
/processorParam:MakeSquare=False
|
||||||
|
/processorParam:TextureFormat=Color
|
||||||
|
/build:listBackground.png
|
||||||
|
|
||||||
#begin location.png
|
#begin location.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
|
|
BIN
Sledgemapper/Content/listBackground.png
Normal file
BIN
Sledgemapper/Content/listBackground.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 697 B |
|
@ -55,7 +55,7 @@ namespace Sledgemapper
|
||||||
Task<AuthResult> Register([Body] RegisterModel registerModel);
|
Task<AuthResult> Register([Body] RegisterModel registerModel);
|
||||||
|
|
||||||
[Headers("Authorization")]
|
[Headers("Authorization")]
|
||||||
[Post("/authmanagement/authenticate")]
|
[Post("/authmanagement/login")]
|
||||||
Task<AuthenticateResponse> Authenticate([Body] AuthenticateModel registerModel);
|
Task<AuthenticateResponse> Authenticate([Body] AuthenticateModel registerModel);
|
||||||
|
|
||||||
[Post("/session/{sessionName}/room")]
|
[Post("/session/{sessionName}/room")]
|
||||||
|
@ -66,5 +66,8 @@ namespace Sledgemapper
|
||||||
|
|
||||||
[Post("/campaign/{campaignName}")]
|
[Post("/campaign/{campaignName}")]
|
||||||
Task NewCampaign(string campaignName);
|
Task NewCampaign(string campaignName);
|
||||||
|
|
||||||
|
[Get("/campaign/")]
|
||||||
|
Task<List<Campaign>> GetCampaigns();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -211,8 +211,9 @@ namespace Sledgemapper
|
||||||
_mainWidget.MenuViewCenterOnSelection.Selected += OnMenuViewCenterOnSelectionSelected;
|
_mainWidget.MenuViewCenterOnSelection.Selected += OnMenuViewCenterOnSelectionSelected;
|
||||||
_mainWidget.MenuViewShowCellNUmbers.Selected += OnMenuViewShowCellNUmbersSelected;
|
_mainWidget.MenuViewShowCellNUmbers.Selected += OnMenuViewShowCellNUmbersSelected;
|
||||||
_mainWidget.MenuViewShowNotes.Selected += OnMenuViewNotesSelected;
|
_mainWidget.MenuViewShowNotes.Selected += OnMenuViewNotesSelected;
|
||||||
_mainWidget.MenuCampaingNew.Selected += OnMenuCampaignNew;
|
|
||||||
|
|
||||||
|
_mainWidget.MenuCampaingNew.Selected += OnMenuCampaignNew;
|
||||||
|
_mainWidget.MenuCampaignOpen.Selected += OnMenuCampaignOpen;
|
||||||
_mainWidget.MenuConnectNew.Enabled = false;
|
_mainWidget.MenuConnectNew.Enabled = false;
|
||||||
_mainWidget.MenuConnectJoin.Enabled = false;
|
_mainWidget.MenuConnectJoin.Enabled = false;
|
||||||
_mainWidget.MenuConnectSync.Enabled = false;
|
_mainWidget.MenuConnectSync.Enabled = false;
|
||||||
|
@ -322,6 +323,41 @@ namespace Sledgemapper
|
||||||
content.TxtCampaign.SetKeyboardFocus();
|
content.TxtCampaign.SetKeyboardFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void OnMenuCampaignOpen(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!((MenuItem)sender).Enabled)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Window window = new()
|
||||||
|
{
|
||||||
|
Title = "Campaigns"
|
||||||
|
};
|
||||||
|
|
||||||
|
var content = new CampaignList();
|
||||||
|
var campaigns = await _communicationManager.Api.GetCampaigns();
|
||||||
|
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, 98),
|
||||||
|
new Myra.Graphics2D.Thickness {Left = 11, Right = 11,
|
||||||
|
Top = 11, Bottom = 11});
|
||||||
|
content.StackNotesList.AddChild(item);
|
||||||
|
}
|
||||||
|
//content.BtnNewCampaign.Text = "N";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// content.BtnNewCampaign.Click += OnButtonNewCampaignClicked;
|
||||||
|
window.Content = content;
|
||||||
|
|
||||||
|
window.ShowModal(_desktop);
|
||||||
|
// content.TxtCampaign.SetKeyboardFocus();
|
||||||
|
}
|
||||||
|
|
||||||
private void OneMenuFileSettingsSelected(object sender, EventArgs e)
|
private void OneMenuFileSettingsSelected(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var propertyGrid = new PropertyGrid
|
var propertyGrid = new PropertyGrid
|
||||||
|
@ -428,7 +464,9 @@ namespace Sledgemapper
|
||||||
_state.SelectClosestSnapPoint(screenPosition);
|
_state.SelectClosestSnapPoint(screenPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!newState.IsKeyDown(Keys.LeftControl) && mouseState.LeftButton == ButtonState.Pressed && mouseState.LeftButton == oldMouseState.LeftButton)
|
if (!newState.IsKeyDown(Keys.LeftControl) && mouseState.LeftButton == ButtonState.Pressed && mouseState.LeftButton == oldMouseState.LeftButton &&
|
||||||
|
!_desktop.IsMouseOverGUI
|
||||||
|
)
|
||||||
{
|
{
|
||||||
_viewportCenter = new Vector3(_viewportCenter.X + mouseState.Position.X - oldMouseState.Position.X, _viewportCenter.Y + mouseState.Position.Y - oldMouseState.Position.Y, 0);
|
_viewportCenter = new Vector3(_viewportCenter.X + mouseState.Position.X - oldMouseState.Position.X, _viewportCenter.Y + mouseState.Position.Y - oldMouseState.Position.Y, 0);
|
||||||
if (mouseState.Position != oldMouseState.Position)
|
if (mouseState.Position != oldMouseState.Position)
|
||||||
|
@ -718,7 +756,7 @@ namespace Sledgemapper
|
||||||
var visibleTilesY = GraphicsDevice.Viewport.Height / _state.TileSize + 1;
|
var visibleTilesY = GraphicsDevice.Viewport.Height / _state.TileSize + 1;
|
||||||
|
|
||||||
DrawMap();
|
DrawMap();
|
||||||
ApplyShaderToMap();
|
//ApplyShaderToMap();
|
||||||
|
|
||||||
_spriteBatch.Begin(
|
_spriteBatch.Begin(
|
||||||
transformMatrix: Matrix.CreateTranslation(_viewportCenter),
|
transformMatrix: Matrix.CreateTranslation(_viewportCenter),
|
||||||
|
@ -726,7 +764,7 @@ namespace Sledgemapper
|
||||||
|
|
||||||
DrawTiles();
|
DrawTiles();
|
||||||
|
|
||||||
DrawWalls();
|
//DrawWalls();
|
||||||
|
|
||||||
DrawOverlays();
|
DrawOverlays();
|
||||||
|
|
||||||
|
@ -2133,6 +2171,7 @@ namespace Sledgemapper
|
||||||
_authResponse = await _communicationManager.Login(new AuthenticateModel
|
_authResponse = await _communicationManager.Login(new AuthenticateModel
|
||||||
{
|
{
|
||||||
Username = localContent.TxtEmail.Text,
|
Username = localContent.TxtEmail.Text,
|
||||||
|
Email = localContent.TxtEmail.Text,
|
||||||
Password = localContent.TxtPassword.Text
|
Password = localContent.TxtPassword.Text
|
||||||
});
|
});
|
||||||
successful = _authResponse != null;
|
successful = _authResponse != null;
|
||||||
|
@ -2335,6 +2374,12 @@ namespace Sledgemapper
|
||||||
};
|
};
|
||||||
|
|
||||||
var content = new LoginRegisterWindow();
|
var content = new LoginRegisterWindow();
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
content.TxtEmail.Text="michele.scandura@outlook.com";
|
||||||
|
content.TxtPassword.Text="slePharland!79";
|
||||||
|
#endif
|
||||||
|
|
||||||
content.RdoLogin.IsPressed = true;
|
content.RdoLogin.IsPressed = true;
|
||||||
content.RdoLogin.Click += (s, e) =>
|
content.RdoLogin.Click += (s, e) =>
|
||||||
{
|
{
|
||||||
|
|
80
Sledgemapper/UI/CampaignList.Generated.cs
Normal file
80
Sledgemapper/UI/CampaignList.Generated.cs
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
/* Generated by MyraPad at 03/06/2021 15:48:34 */
|
||||||
|
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 CampaignList: VerticalStackPanel
|
||||||
|
{
|
||||||
|
private void BuildUI()
|
||||||
|
{
|
||||||
|
var label1 = new Label();
|
||||||
|
label1.Text = "Campaigns";
|
||||||
|
label1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
|
||||||
|
|
||||||
|
StackNotesList = new VerticalStackPanel();
|
||||||
|
StackNotesList.Proportions.Add(new Proportion
|
||||||
|
{
|
||||||
|
Type = Myra.Graphics2D.UI.ProportionType.Fill,
|
||||||
|
});
|
||||||
|
StackNotesList.MinHeight = 350;
|
||||||
|
StackNotesList.Id = "StackNotesList";
|
||||||
|
|
||||||
|
var scrollViewer1 = new ScrollViewer();
|
||||||
|
scrollViewer1.Content = StackNotesList;
|
||||||
|
|
||||||
|
var textButton1 = new TextButton();
|
||||||
|
textButton1.Text = "New";
|
||||||
|
textButton1.Width = 70;
|
||||||
|
textButton1.Height = 20;
|
||||||
|
textButton1.Padding = new Thickness(5);
|
||||||
|
textButton1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
|
||||||
|
|
||||||
|
var textButton2 = new TextButton();
|
||||||
|
textButton2.Text = "Load";
|
||||||
|
textButton2.Width = 70;
|
||||||
|
textButton2.Height = 20;
|
||||||
|
textButton2.Padding = new Thickness(5);
|
||||||
|
textButton2.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
|
||||||
|
|
||||||
|
var textButton3 = new TextButton();
|
||||||
|
textButton3.Text = "Cancel";
|
||||||
|
textButton3.Width = 70;
|
||||||
|
textButton3.Height = 20;
|
||||||
|
textButton3.Padding = new Thickness(5);
|
||||||
|
textButton3.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
|
||||||
|
|
||||||
|
var horizontalStackPanel1 = new HorizontalStackPanel();
|
||||||
|
horizontalStackPanel1.Spacing = 15;
|
||||||
|
horizontalStackPanel1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Right;
|
||||||
|
horizontalStackPanel1.Widgets.Add(textButton1);
|
||||||
|
horizontalStackPanel1.Widgets.Add(textButton2);
|
||||||
|
horizontalStackPanel1.Widgets.Add(textButton3);
|
||||||
|
|
||||||
|
|
||||||
|
Spacing = 13;
|
||||||
|
Width = 400;
|
||||||
|
Padding = new Thickness(10);
|
||||||
|
Widgets.Add(label1);
|
||||||
|
Widgets.Add(scrollViewer1);
|
||||||
|
Widgets.Add(horizontalStackPanel1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public VerticalStackPanel StackNotesList;
|
||||||
|
}
|
||||||
|
}
|
11
Sledgemapper/UI/CampaignList.cs
Normal file
11
Sledgemapper/UI/CampaignList.cs
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
/* Generated by MyraPad at 01/06/2021 12:43:27 */
|
||||||
|
namespace Sledgemapper.UI
|
||||||
|
{
|
||||||
|
public partial class CampaignList
|
||||||
|
{
|
||||||
|
public CampaignList()
|
||||||
|
{
|
||||||
|
BuildUI();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
45
Sledgemapper/UI/CampaignListItem.Generated.cs
Normal file
45
Sledgemapper/UI/CampaignListItem.Generated.cs
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
/* Generated by MyraPad at 03/06/2021 16:16:33 */
|
||||||
|
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 CampaignListItem: HorizontalStackPanel
|
||||||
|
{
|
||||||
|
private void BuildUI()
|
||||||
|
{
|
||||||
|
TxtCampaignName = new Label();
|
||||||
|
TxtCampaignName.Text = "Highfell";
|
||||||
|
TxtCampaignName.TextColor = ColorStorage.CreateColor(102, 102, 102, 255);
|
||||||
|
TxtCampaignName.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center;
|
||||||
|
TxtCampaignName.Background = new SolidBrush("#00000000");
|
||||||
|
TxtCampaignName.Id = "TxtCampaignName";
|
||||||
|
|
||||||
|
|
||||||
|
VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center;
|
||||||
|
Width = 300;
|
||||||
|
Height = 45;
|
||||||
|
BorderThickness = new Thickness(2);
|
||||||
|
Padding = new Thickness(10);
|
||||||
|
Id = "PnlCampaignItem";
|
||||||
|
Widgets.Add(TxtCampaignName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Label TxtCampaignName;
|
||||||
|
}
|
||||||
|
}
|
11
Sledgemapper/UI/CampaignListItem.cs
Normal file
11
Sledgemapper/UI/CampaignListItem.cs
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
/* Generated by MyraPad at 03/06/2021 16:00:11 */
|
||||||
|
namespace Sledgemapper.UI
|
||||||
|
{
|
||||||
|
public partial class CampaignListItem
|
||||||
|
{
|
||||||
|
public CampaignListItem()
|
||||||
|
{
|
||||||
|
BuildUI();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
6
Sledgemapper/UI/campaignListItem.xmmp
Normal file
6
Sledgemapper/UI/campaignListItem.xmmp
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<Project>
|
||||||
|
<Project.ExportOptions Namespace="Sledgemapper.UI" Class="CampaignListItem" OutputPath="C:\src\Map\Sledgemapper\UI" />
|
||||||
|
<HorizontalStackPanel VerticalAlignment="Center" Width="300" Height="45" BorderThickness="2" Padding="10" Id="PnlCampaignItem">
|
||||||
|
<Label Text="Highfell" TextColor="#666666FF" VerticalAlignment="Center" Background="#00000000" Id="TxtCampaignName" />
|
||||||
|
</HorizontalStackPanel>
|
||||||
|
</Project>
|
19
Sledgemapper/UI/campaignsList.xmmp
Normal file
19
Sledgemapper/UI/campaignsList.xmmp
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<Project>
|
||||||
|
<Project.ExportOptions Namespace="Sledgemapper.UI" Class="CampaignList" OutputPath="C:\src\Map\Sledgemapper\UI" />
|
||||||
|
<VerticalStackPanel Width="400" Padding="10" Spacing="13">
|
||||||
|
<Label Text="Campaigns" HorizontalAlignment="Center" />
|
||||||
|
<ScrollViewer >
|
||||||
|
<VerticalStackPanel MinHeight="350" Id="StackNotesList" >
|
||||||
|
<VerticalStackPanel.Proportions>
|
||||||
|
<Proportion Type="Fill" />
|
||||||
|
</VerticalStackPanel.Proportions>
|
||||||
|
</VerticalStackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
<HorizontalStackPanel Spacing="15" HorizontalAlignment="Right" >
|
||||||
|
<TextButton Text="New" ImageHorizontalAlignment="Left" Width="70" Height="20" Padding="5" HorizontalAlignment="Center" />
|
||||||
|
<TextButton Text="Load" Width="70" Height="20" Padding="5" HorizontalAlignment="Center"/>
|
||||||
|
<TextButton Text="Cancel" Width="70" Height="20" Padding="5" HorizontalAlignment="Center"/>
|
||||||
|
</HorizontalStackPanel>
|
||||||
|
</VerticalStackPanel>
|
||||||
|
|
||||||
|
</Project>
|
|
@ -2,6 +2,6 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<add key="BaGet" value="https://baget.michelescandura.com/v3/index.json" />
|
<add key="BaGet" value="https://baget.michelescandura.com/v3/index.json" />
|
||||||
<add key="MonogameDev" value="http://teamcity.monogame.net/guestAuth/app/nuget/feed/_Root/default/v3/index.json" />
|
<add key="MonogameDev" value="http://teamcity.monogame.net/guestAuth/app/nuget/feed/_Root/default/v3/index.json" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
</configuration>
|
</configuration>
|
Loading…
Add table
Add a link
Reference in a new issue