Compare commits

..

No commits in common. "4ff8d8eca31d10487842cedcdb2bc8a3b9aea476" and "6475e1e18320b5641af043555deba353b1d75972" have entirely different histories.

8 changed files with 19 additions and 105 deletions

BIN
Content/Player/BP_PlayerCharacter.uasset (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -25,10 +25,14 @@ public:
UPROPERTY(BlueprintReadWrite, meta=(BindWidget)) UPROPERTY(BlueprintReadWrite, meta=(BindWidget))
UListView* UpgradesListView; UListView* UpgradesListView;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray<TSubclassOf<UUpgradeButtonDataObject>> UpgradeItems;
virtual void NativeConstruct() override; virtual void NativeConstruct() override;
private: private:
UFUNCTION() UFUNCTION()
void ResumeButtonClicked(); void ResumeButtonClicked();
}; };

View File

@ -3,7 +3,6 @@
#include "MainMenuWidget.h" #include "MainMenuWidget.h"
#include "SelectWeaponWidget.h"
#include "Blueprint/WidgetBlueprintLibrary.h" #include "Blueprint/WidgetBlueprintLibrary.h"
#include "Components/Button.h" #include "Components/Button.h"
#include "Kismet/GameplayStatics.h" #include "Kismet/GameplayStatics.h"
@ -36,8 +35,6 @@ void UMainMenuWidget::NativeConstruct()
QuitButton->OnUnhovered.AddUniqueDynamic(this, &UMainMenuWidget::PlayUnhoveredSound); QuitButton->OnUnhovered.AddUniqueDynamic(this, &UMainMenuWidget::PlayUnhoveredSound);
} }
QuitButton->SetIsEnabled(false);
if (APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0)) if (APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0))
{ {
UWidgetBlueprintLibrary::SetInputMode_UIOnlyEx(PlayerController, this, EMouseLockMode::LockAlways); UWidgetBlueprintLibrary::SetInputMode_UIOnlyEx(PlayerController, this, EMouseLockMode::LockAlways);
@ -47,31 +44,18 @@ void UMainMenuWidget::NativeConstruct()
void UMainMenuWidget::NewGameButtonOnClicked() void UMainMenuWidget::NewGameButtonOnClicked()
{ {
if (NewGameMenuWidget) if (!NewGameLevel.IsNull())
{ {
RemoveFromParent(); UGameplayStatics::OpenLevelBySoftObjectPtr(GetWorld(), NewGameLevel);
UUserWidget* selectWeaponWidget = CreateWidget<UUserWidget, APlayerController*>(
UGameplayStatics::GetPlayerController(GetWorld(), 0), NewGameMenuWidget);
if (selectWeaponWidget)
{
selectWeaponWidget->AddToViewport();
}
} }
// if (!NewGameLevel.IsNull()) if (APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0))
// { {
// UGameplayStatics::OpenLevelBySoftObjectPtr(GetWorld(), NewGameLevel); PlayerController->bShowMouseCursor = false;
// } UWidgetBlueprintLibrary::SetInputMode_GameOnly(PlayerController);
// }
// if (APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0))
// { SetIsFocusable(false);
// PlayerController->bShowMouseCursor = false;
// UWidgetBlueprintLibrary::SetInputMode_GameOnly(PlayerController);
// }
//
// SetIsFocusable(false);
} }
void UMainMenuWidget::QuitButtonOnClicked() void UMainMenuWidget::QuitButtonOnClicked()

View File

@ -1,34 +0,0 @@
// Louis Hobbs | 2024-2025
#include "SelectWeaponWidget.h"
#include "MainMenuWidget.h"
#include "Components/Button.h"
#include "Kismet/GameplayStatics.h"
void USelectWeaponWidget::NativeConstruct()
{
Super::NativeConstruct();
if (BackButton)
{
BackButton->OnClicked.AddUniqueDynamic(this, &USelectWeaponWidget::BackButtonClicked);
}
}
void USelectWeaponWidget::BackButtonClicked()
{
if (PreviousWidget)
{
RemoveFromParent();
UUserWidget* selectWeaponWidget = CreateWidget<UUserWidget, APlayerController*>(
UGameplayStatics::GetPlayerController(GetWorld(), 0), PreviousWidget);
if (selectWeaponWidget)
{
selectWeaponWidget->AddToViewport();
}
}
}

View File

@ -1,37 +0,0 @@
// Louis Hobbs | 2024-2025
#pragma once
#include "CoreMinimal.h"
#include "VampireInteractiveWidget.h"
#include "SelectWeaponWidget.generated.h"
class UListView;
class UButton;
/**
*
*/
UCLASS()
class VAMPIRES_API USelectWeaponWidget : public UVampireInteractiveWidget
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadWrite, meta=(BindWidget))
UButton* BackButton;
UPROPERTY(BlueprintReadWrite, meta=(BindWidget))
UListView* UpgradesListView;
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
TSubclassOf<class UUserWidget> PreviousWidget;
virtual void NativeConstruct() override;
private:
UFUNCTION()
void BackButtonClicked();
};