(Feat) Add Main Menu + Music Manger

This commit is contained in:
2026-07-29 20:18:51 +02:00
parent 956f48816b
commit 9b5ad7c8a4
55 changed files with 3727 additions and 125 deletions
@@ -0,0 +1,62 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "SettingKeyRowWidget.h"
#include "Components/Button.h"
#include "Components/TextBlock.h"
#define LOCTEXT_NAMESPACE "Reglages"
void USettingKeyRowWidget::NativeOnInitialized()
{
Super::NativeOnInitialized();
// Comme USettingRowWidget : l'onglet appelle Setup depuis SON NativeConstruct,
// et rien ne garantit l'ordre entre le construct du parent et celui de ses
// enfants. Initialize, lui, tourne une fois a la creation de l'arbre.
if (KeyButton)
{
KeyButton->OnClicked.AddDynamic(this, &USettingKeyRowWidget::HandleKeyButtonClicked);
}
}
void USettingKeyRowWidget::Setup(FName InMappingName, const FText& Label, const FKey& Key)
{
MappingName = InMappingName;
if (LabelText)
{
LabelText->SetText(Label);
}
SetKey(Key);
}
void USettingKeyRowWidget::SetKey(const FKey& Key)
{
if (!KeyText)
{
return;
}
// Une touche invalide n'est pas une erreur : c'est l'etat normal d'une action
// dont on vient de voler la touche. Le rouge est le signal qu'il reste
// quelque chose a reparer avant de quitter l'ecran.
const bool bBound = Key.IsValid();
KeyText->SetText(bBound
? Key.GetDisplayName()
: LOCTEXT("ToucheNonAssignee", "Non assignée"));
KeyText->SetColorAndOpacity(FSlateColor(bBound ? BoundColor : UnboundColor));
}
void USettingKeyRowWidget::HandleKeyButtonClicked()
{
// On ne fait rien de plus que transmettre : la ligne ignore ce qu'est un
// profil de touches, et c'est tres bien ainsi.
OnRebindRequested.Broadcast(MappingName);
}
#undef LOCTEXT_NAMESPACE