cleanup, refactoring, usual stuff
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
b671c661a7
commit
f15f1c8857
26 changed files with 183 additions and 209 deletions
44
Sledgemapper/UI/PlayerWindow.Custom.cs
Normal file
44
Sledgemapper/UI/PlayerWindow.Custom.cs
Normal file
|
@ -0,0 +1,44 @@
|
|||
/* Generated by MyraPad at 28/08/2021 22:04:11 */
|
||||
using Myra.Graphics2D.UI;
|
||||
using Sentry;
|
||||
using System;
|
||||
|
||||
namespace Sledgemapper.UI
|
||||
{
|
||||
public partial class PlayerWindow
|
||||
{
|
||||
protected readonly Window Window;
|
||||
protected readonly CommunicationManager CommunicationManager;
|
||||
|
||||
public PlayerWindow(CommunicationManager communicationManager, Window window)
|
||||
{
|
||||
Window = window;
|
||||
CommunicationManager = communicationManager;
|
||||
|
||||
BuildUI();
|
||||
BtnNewCampaign.Click += OnButtonInvitePlayerClicked;
|
||||
}
|
||||
|
||||
private async void OnButtonInvitePlayerClicked(object sender, EventArgs e)
|
||||
{
|
||||
var localContent = ((TextButton)sender).GetParentContentInWindow<PlayerWindow>();// localWindow.Content as PlayerWindow;
|
||||
var isValid = localContent.Content.TxtCampaign.ValidateTextbox();
|
||||
if (!isValid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var successful = false;
|
||||
try
|
||||
{
|
||||
await CommunicationManager.Api.InvitePlayer(State.Instance.CampaignName, localContent.Content.TxtCampaign.Text);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SentrySdk.CaptureException(ex);
|
||||
}
|
||||
localContent.Window.Close();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue