Titre de règles en blanc, suppression des espaces au début et à la fin des pseudo et ajout d'un popup quand l'on veut supprimer un pseudo qui n'existe pas
continuous-integration/drone/push Build is passing Details

pull/111/head
Remi NEVEU 11 months ago
parent 7d4343c2ad
commit 7aa5f738c3

@ -59,6 +59,9 @@ namespace Models.Game
/// <param name="profilePicture">The profile picture of the player.</param>
public Player(string pseudo, string profilePicture)
{
//char[] trim = { ' ', '\n', '\t' };
//Pseudo = pseudo.Trim();
//Pseudo = Pseudo.TrimEnd(trim);
Pseudo = pseudo;
ProfilePicture = profilePicture;
CreationDate = DateTime.Now.ToString("dd/MM/yyyy");

@ -25,6 +25,9 @@ public partial class PageProfiles : ContentPage
async void Button_ClickedAdd(System.Object sender, System.EventArgs e)
{
string pseudo = await DisplayPromptAsync("Info", $"Choose a name : ", "Ok");
char[] trim = { ' ', '\n', '\t' };
pseudo = pseudo.TrimEnd(trim);
pseudo = pseudo.TrimStart(trim);
if (pseudo == null) return;
if (ProfileManager.Players.Any(p => p.Pseudo == pseudo))
{
@ -64,7 +67,13 @@ public partial class PageProfiles : ContentPage
Debug.WriteLine("bam, deleted");
OnPropertyChanged(nameof(ProfileManager));
}
else Debug.WriteLine("Player not found");
else
{
await DisplayAlert("Info", "This name do not exist", "Ok");
Debug.WriteLine("Player not found");
return;
}
}

@ -12,7 +12,7 @@
<Image Source="bg_regles.jpg" Grid.RowSpan="3" Aspect="AspectFill"/>
<Label Text="Règles" TextColor="black" HorizontalTextAlignment="Center" FontSize="Header" Margin="30"/>
<Label Text="Règles" TextColor="white" HorizontalTextAlignment="Center" FontSize="Header" Margin="30"/>
<ScrollView Grid.Row="1">
<Grid RowDefinitions="*,*,*,*,*,*,*,*,*">

Loading…
Cancel
Save