(Feat) Add MainMenu
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "SettingsTabWidget.h"
|
||||
#include "SettingsGameplayWidget.generated.h"
|
||||
|
||||
class USettingRowWidget;
|
||||
class USurvivalUserSettings;
|
||||
|
||||
/**
|
||||
* L'onglet "Jeu & Controles".
|
||||
*
|
||||
* Il ne stocke rien : chaque ligne ecrit directement dans USurvivalUserSettings,
|
||||
* qui diffuse au pawn dans la foulee. C'est ce qui rend l'effet immediat sans
|
||||
* bouton "Appliquer".
|
||||
*
|
||||
* Classe Abstract : on cree un WBP_SettingsGameplay qui en herite, avec un
|
||||
* WBP_SettingRow par ligne, nomme exactement comme le BindWidget correspondant.
|
||||
*/
|
||||
UCLASS(Abstract)
|
||||
class SURVIVAL_PROJET_API USettingsGameplayWidget : public USettingsTabWidget
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
virtual void NativeConstruct() override;
|
||||
|
||||
virtual void RefreshFromSettings() override;
|
||||
virtual void ResetToDefaults() override;
|
||||
|
||||
protected:
|
||||
UPROPERTY(meta = (BindWidget))
|
||||
TObjectPtr<USettingRowWidget> SensitivityRow;
|
||||
|
||||
UPROPERTY(meta = (BindWidget))
|
||||
TObjectPtr<USettingRowWidget> SeparateVerticalRow;
|
||||
|
||||
/** Masquee tant que la sensibilite verticale n'est pas separee. */
|
||||
UPROPERTY(meta = (BindWidget))
|
||||
TObjectPtr<USettingRowWidget> SensitivityVerticalRow;
|
||||
|
||||
UPROPERTY(meta = (BindWidget))
|
||||
TObjectPtr<USettingRowWidget> InvertLookRow;
|
||||
|
||||
UPROPERTY(meta = (BindWidget))
|
||||
TObjectPtr<USettingRowWidget> FieldOfViewRow;
|
||||
|
||||
UPROPERTY(meta = (BindWidget))
|
||||
TObjectPtr<USettingRowWidget> CameraShakeRow;
|
||||
|
||||
UPROPERTY(meta = (BindWidget))
|
||||
TObjectPtr<USettingRowWidget> SprintModeRow;
|
||||
|
||||
UPROPERTY(meta = (BindWidget))
|
||||
TObjectPtr<USettingRowWidget> CrouchModeRow;
|
||||
|
||||
private:
|
||||
UFUNCTION()
|
||||
void HandleSensitivityChanged(int32 NewIndex);
|
||||
|
||||
UFUNCTION()
|
||||
void HandleSeparateVerticalChanged(int32 NewIndex);
|
||||
|
||||
UFUNCTION()
|
||||
void HandleSensitivityVerticalChanged(int32 NewIndex);
|
||||
|
||||
UFUNCTION()
|
||||
void HandleInvertLookChanged(int32 NewIndex);
|
||||
|
||||
UFUNCTION()
|
||||
void HandleFieldOfViewChanged(int32 NewIndex);
|
||||
|
||||
UFUNCTION()
|
||||
void HandleCameraShakeChanged(int32 NewIndex);
|
||||
|
||||
UFUNCTION()
|
||||
void HandleSprintModeChanged(int32 NewIndex);
|
||||
|
||||
UFUNCTION()
|
||||
void HandleCrouchModeChanged(int32 NewIndex);
|
||||
|
||||
/** Ecrit puis diffuse. Tous les handlers finissent ici. */
|
||||
void PushToPawn(USurvivalUserSettings* Settings);
|
||||
|
||||
/** Affiche ou masque la ligne de sensibilite verticale. */
|
||||
void UpdateVerticalRowVisibility(bool bSeparate);
|
||||
};
|
||||
Reference in New Issue
Block a user