Compare commits
No commits in common. "7932d9ba342b116d020e725fbbc1bcd0891fbdad" and "df20b42b17f5f058ccc21d9af3f009a3c5ec8eab" have entirely different histories.
7932d9ba34
...
df20b42b17
BIN
Content/Sounds/Coins/coin-collection-2.uasset
(Stored with Git LFS)
BIN
Content/Sounds/Coins/coin-collection-2.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Sounds/Coins/coin-collection-2_Cue.uasset
(Stored with Git LFS)
BIN
Content/Sounds/Coins/coin-collection-2_Cue.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Sounds/Coins/coin-collection.uasset
(Stored with Git LFS)
BIN
Content/Sounds/Coins/coin-collection.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Sounds/Coins/coin-collection_Cue.uasset
(Stored with Git LFS)
BIN
Content/Sounds/Coins/coin-collection_Cue.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Sounds/Enemies/MS_EnemyDamaged.uasset
(Stored with Git LFS)
BIN
Content/Sounds/Enemies/MS_EnemyDamaged.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Sounds/Enemies/MS_EnemyKilled.uasset
(Stored with Git LFS)
BIN
Content/Sounds/Enemies/MS_EnemyKilled.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Sounds/Player/MS_PlayerDamaged.uasset
(Stored with Git LFS)
BIN
Content/Sounds/Player/MS_PlayerDamaged.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Sounds/Player/MS_PlayerKilled.uasset
(Stored with Git LFS)
BIN
Content/Sounds/Player/MS_PlayerKilled.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Sounds/SC_GameMaster.uasset
(Stored with Git LFS)
BIN
Content/Sounds/SC_GameMaster.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Widgets/Options/BP_OptionsMenuWidget.uasset
(Stored with Git LFS)
BIN
Content/Widgets/Options/BP_OptionsMenuWidget.uasset
(Stored with Git LFS)
Binary file not shown.
@ -3,16 +3,12 @@
|
|||||||
|
|
||||||
#include "OptionsMenuWidget.h"
|
#include "OptionsMenuWidget.h"
|
||||||
|
|
||||||
#include "AudioMixerDevice.h"
|
|
||||||
#include "Components/Button.h"
|
#include "Components/Button.h"
|
||||||
#include "Components/ComboBoxString.h"
|
#include "Components/ComboBoxString.h"
|
||||||
#include "GameFramework/GameUserSettings.h"
|
#include "GameFramework/GameUserSettings.h"
|
||||||
#include "Kismet/GameplayStatics.h"
|
#include "Kismet/GameplayStatics.h"
|
||||||
#include "Kismet/KismetSystemLibrary.h"
|
#include "Kismet/KismetSystemLibrary.h"
|
||||||
#include "RHI.h"
|
#include "RHI.h"
|
||||||
#include "Components/Slider.h"
|
|
||||||
#include "Components/TextBlock.h"
|
|
||||||
#include "Sound/SoundClass.h"
|
|
||||||
|
|
||||||
void UOptionsMenuWidget::NativeConstruct()
|
void UOptionsMenuWidget::NativeConstruct()
|
||||||
{
|
{
|
||||||
@ -34,9 +30,6 @@ void UOptionsMenuWidget::NativeConstruct()
|
|||||||
GenerateRefreshRateOptions();
|
GenerateRefreshRateOptions();
|
||||||
RefreshRateComboBox->OnSelectionChanged.AddDynamic(this, &UOptionsMenuWidget::OnRefreshRateSelectionChanged);
|
RefreshRateComboBox->OnSelectionChanged.AddDynamic(this, &UOptionsMenuWidget::OnRefreshRateSelectionChanged);
|
||||||
|
|
||||||
GenerateAudioLevelOptions();
|
|
||||||
MasterAudioSlider->OnValueChanged.AddDynamic(this, &UOptionsMenuWidget::OnAudioLeverValueChanged);
|
|
||||||
|
|
||||||
if (ReturnButton)
|
if (ReturnButton)
|
||||||
{
|
{
|
||||||
ReturnButton->OnClicked.AddUniqueDynamic(this, &UOptionsMenuWidget::ReturnButtonOnClicked);
|
ReturnButton->OnClicked.AddUniqueDynamic(this, &UOptionsMenuWidget::ReturnButtonOnClicked);
|
||||||
@ -145,19 +138,6 @@ void UOptionsMenuWidget::GenerateRefreshRateOptions()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UOptionsMenuWidget::GenerateAudioLevelOptions()
|
|
||||||
{
|
|
||||||
if (MasterSoundClass)
|
|
||||||
{
|
|
||||||
float CurrentVolume = FMath::Clamp(MasterSoundClass->Properties.Volume, 0.0f, 1.0f);
|
|
||||||
|
|
||||||
MasterAudioSlider->SetValue(CurrentVolume);
|
|
||||||
|
|
||||||
int AudioLevel = CurrentVolume * 100.0f;
|
|
||||||
MasterAudioTextBlock->SetText(FText::FromString(FString::FromInt(AudioLevel) + "%"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void UOptionsMenuWidget::OnResolutionSelectionChanged(FString SelectedItem, ESelectInfo::Type SelectionType)
|
void UOptionsMenuWidget::OnResolutionSelectionChanged(FString SelectedItem, ESelectInfo::Type SelectionType)
|
||||||
{
|
{
|
||||||
FString Horizontal;
|
FString Horizontal;
|
||||||
@ -255,18 +235,6 @@ void UOptionsMenuWidget::OnRefreshRateSelectionChanged(FString SelectedItem, ESe
|
|||||||
GEngine->GameUserSettings->ApplySettings(false);
|
GEngine->GameUserSettings->ApplySettings(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UOptionsMenuWidget::OnAudioLeverValueChanged(float Value)
|
|
||||||
{
|
|
||||||
if (MasterSoundClass)
|
|
||||||
{
|
|
||||||
MasterSoundClass->Properties.Volume = FMath::Clamp(Value, 0.0f, 1.0f);
|
|
||||||
|
|
||||||
int AudioLevel = FMath::Clamp(Value, 0.0f, 1.0f) * 100.0f;
|
|
||||||
|
|
||||||
MasterAudioTextBlock->SetText(FText::FromString(FString::FromInt(AudioLevel) + "%"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void UOptionsMenuWidget::ReturnButtonOnClicked()
|
void UOptionsMenuWidget::ReturnButtonOnClicked()
|
||||||
{
|
{
|
||||||
if (MainMenuMenuWidget)
|
if (MainMenuMenuWidget)
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#include "VampireInteractiveWidget.h"
|
#include "VampireInteractiveWidget.h"
|
||||||
#include "OptionsMenuWidget.generated.h"
|
#include "OptionsMenuWidget.generated.h"
|
||||||
|
|
||||||
class USlider;
|
|
||||||
class UComboBoxString;
|
class UComboBoxString;
|
||||||
class UButton;
|
class UButton;
|
||||||
/**
|
/**
|
||||||
@ -34,12 +33,6 @@ class VAMPIRES_API UOptionsMenuWidget : public UVampireInteractiveWidget
|
|||||||
|
|
||||||
UPROPERTY(meta = (BindWidget))
|
UPROPERTY(meta = (BindWidget))
|
||||||
TObjectPtr<UComboBoxString> DynamicResolutionComboBox;
|
TObjectPtr<UComboBoxString> DynamicResolutionComboBox;
|
||||||
|
|
||||||
UPROPERTY(meta = (BindWidget))
|
|
||||||
TObjectPtr<USlider> MasterAudioSlider;
|
|
||||||
|
|
||||||
UPROPERTY(meta = (BindWidget))
|
|
||||||
TObjectPtr<UTextBlock> MasterAudioTextBlock;
|
|
||||||
|
|
||||||
UPROPERTY(meta = (BindWidget))
|
UPROPERTY(meta = (BindWidget))
|
||||||
TObjectPtr<UButton> ReturnButton;
|
TObjectPtr<UButton> ReturnButton;
|
||||||
@ -56,11 +49,7 @@ class VAMPIRES_API UOptionsMenuWidget : public UVampireInteractiveWidget
|
|||||||
UPROPERTY(EditDefaultsOnly, Category = "Widget Settings | New Game")
|
UPROPERTY(EditDefaultsOnly, Category = "Widget Settings | New Game")
|
||||||
TSubclassOf<UUserWidget> MainMenuMenuWidget;
|
TSubclassOf<UUserWidget> MainMenuMenuWidget;
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, Category = "Widget Settings | Sound Settings")
|
|
||||||
TObjectPtr<USoundClass> MasterSoundClass = nullptr;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UFUNCTION()
|
|
||||||
virtual void NativeConstruct() override;
|
virtual void NativeConstruct() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -74,8 +63,6 @@ private:
|
|||||||
|
|
||||||
void GenerateRefreshRateOptions();
|
void GenerateRefreshRateOptions();
|
||||||
|
|
||||||
void GenerateAudioLevelOptions();
|
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void OnResolutionSelectionChanged(FString SelectedItem, ESelectInfo::Type SelectionType);
|
void OnResolutionSelectionChanged(FString SelectedItem, ESelectInfo::Type SelectionType);
|
||||||
|
|
||||||
@ -94,9 +81,6 @@ private:
|
|||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void OnRefreshRateSelectionChanged(FString SelectedItem, ESelectInfo::Type SelectionType);
|
void OnRefreshRateSelectionChanged(FString SelectedItem, ESelectInfo::Type SelectionType);
|
||||||
|
|
||||||
UFUNCTION()
|
|
||||||
void OnAudioLeverValueChanged(float Value);
|
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void ReturnButtonOnClicked();
|
void ReturnButtonOnClicked();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user