exit button bb
continuous-integration/drone/push Build is failing Details

old_branch_before_remy
Jérémy Mouyon 11 months ago
parent 0878871c5d
commit 3678fc96f9

@ -41,15 +41,15 @@ public partial class Gameboard : ContentPage
}
private void Game_EndOfGameNotified(object? sender, EndOfGameNotifiedEventArgs e)
private async void Game_EndOfGameNotified(object? sender, EndOfGameNotifiedEventArgs e)
{
PopUpEnd();
Navigation.PushAsync(new MainPage());
await PopUpEnd();
await Navigation.PushAsync(new MainPage());
}
private async void PopUpEnd()
private Task PopUpEnd()
{
await this.ShowPopupAsync(new PopUpEndGame());
return this.ShowPopupAsync(new PopUpEndGame());
}
private void OnDragStarting(object sender, DragStartingEventArgs e)
@ -186,13 +186,13 @@ public partial class Gameboard : ContentPage
if (game.CellsUsed.Count == 0 && !game.PlayerSwapping)
{
AnswerSwap();
_ = AnswerSwap();
}
game.PlaceTileNotified -= Game_PlaceTileNotified;
}
private async void AnswerSwap()
private async Task AnswerSwap()
{
bool answer = await DisplayAlert("Swap System", "Etes vous sur de vouloir swap vos tuiles ? Attention, si vous swapez vous ne pouvez pu jouer", "Yes", "No");
@ -215,4 +215,18 @@ public partial class Gameboard : ContentPage
tilesSwap.Add(tiledrag!);
}
}
}
private async void OnButtonExitClicked(object sender, EventArgs e)
{
bool answer = await DisplayAlert("System information", "Are you sure you want to quit? You can resume your game at any time from the home screen.", "Yes", "No");
if (answer)
{
await Navigation.PushAsync(new MainPage());
}
}
}

@ -61,6 +61,14 @@
ToolTipProperties.Text="Click to check your settings -_-"
Style="{StaticResource GameButton}"/>
<Button
HorizontalOptions="End"
Grid.Row="0" Grid.Column="1"
Text="Exit" WidthRequest="200"
Clicked="OnButtonExitClicked"
ToolTipProperties.Text="Click here to exit ;)"
Style="{StaticResource GameButton}"/>
<CollectionView Grid.Row="0" Grid.Column="1" ItemsSource="{Binding PlayerList[0].Tiles}"
HorizontalOptions="Center"
VerticalOptions="Center" >

Loading…
Cancel
Save