(Feat) Add MainMenu
This commit is contained in:
@@ -20,6 +20,11 @@ void UMainMenuWidget::NativeConstruct()
|
||||
QuitButton->OnClicked.AddDynamic(this, &UMainMenuWidget::HandleQuitClicked);
|
||||
}
|
||||
|
||||
if (SettingsButton)
|
||||
{
|
||||
SettingsButton->OnClicked.AddDynamic(this, &UMainMenuWidget::HandleSettingsClicked);
|
||||
}
|
||||
|
||||
// Les boutons de coop sont visibles mais inertes : ils annoncent la couleur
|
||||
// sans promettre une partie qui echouerait.
|
||||
if (HostButton)
|
||||
@@ -48,3 +53,11 @@ void UMainMenuWidget::HandleQuitClicked()
|
||||
Controller->QuitGame();
|
||||
}
|
||||
}
|
||||
|
||||
void UMainMenuWidget::HandleSettingsClicked()
|
||||
{
|
||||
if (AMainMenuPlayerController* Controller = GetOwningPlayer<AMainMenuPlayerController>())
|
||||
{
|
||||
Controller->OpenSettings();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user