Compare commits
3 Commits
6475e1e183
...
4ff8d8eca3
Author | SHA1 | Date | |
---|---|---|---|
4ff8d8eca3 | |||
e29e4e5b32 | |||
7d8c59d3fe |
BIN
Content/Player/BP_PlayerCharacter.uasset
(Stored with Git LFS)
BIN
Content/Player/BP_PlayerCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Weapons/MagicWand/BP_MagicWandProjectile.uasset
(Stored with Git LFS)
BIN
Content/Weapons/MagicWand/BP_MagicWandProjectile.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Widgets/MainMenu/BP_MainMenuWidget.uasset
(Stored with Git LFS)
BIN
Content/Widgets/MainMenu/BP_MainMenuWidget.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Widgets/MainMenu/BP_SelectWeaponWidget.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Widgets/MainMenu/BP_SelectWeaponWidget.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -24,14 +24,10 @@ public:
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, meta=(BindWidget))
|
||||
UListView* UpgradesListView;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
TArray<TSubclassOf<UUpgradeButtonDataObject>> UpgradeItems;
|
||||
|
||||
virtual void NativeConstruct() override;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
UFUNCTION()
|
||||
void ResumeButtonClicked();
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include "MainMenuWidget.h"
|
||||
|
||||
#include "SelectWeaponWidget.h"
|
||||
#include "Blueprint/WidgetBlueprintLibrary.h"
|
||||
#include "Components/Button.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
@ -35,6 +36,8 @@ void UMainMenuWidget::NativeConstruct()
|
||||
QuitButton->OnUnhovered.AddUniqueDynamic(this, &UMainMenuWidget::PlayUnhoveredSound);
|
||||
}
|
||||
|
||||
QuitButton->SetIsEnabled(false);
|
||||
|
||||
if (APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0))
|
||||
{
|
||||
UWidgetBlueprintLibrary::SetInputMode_UIOnlyEx(PlayerController, this, EMouseLockMode::LockAlways);
|
||||
@ -44,18 +47,31 @@ void UMainMenuWidget::NativeConstruct()
|
||||
|
||||
void UMainMenuWidget::NewGameButtonOnClicked()
|
||||
{
|
||||
if (!NewGameLevel.IsNull())
|
||||
if (NewGameMenuWidget)
|
||||
{
|
||||
UGameplayStatics::OpenLevelBySoftObjectPtr(GetWorld(), NewGameLevel);
|
||||
}
|
||||
RemoveFromParent();
|
||||
|
||||
if (APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0))
|
||||
{
|
||||
PlayerController->bShowMouseCursor = false;
|
||||
UWidgetBlueprintLibrary::SetInputMode_GameOnly(PlayerController);
|
||||
}
|
||||
UUserWidget* selectWeaponWidget = CreateWidget<UUserWidget, APlayerController*>(
|
||||
UGameplayStatics::GetPlayerController(GetWorld(), 0), NewGameMenuWidget);
|
||||
|
||||
SetIsFocusable(false);
|
||||
if (selectWeaponWidget)
|
||||
{
|
||||
selectWeaponWidget->AddToViewport();
|
||||
}
|
||||
}
|
||||
|
||||
// if (!NewGameLevel.IsNull())
|
||||
// {
|
||||
// UGameplayStatics::OpenLevelBySoftObjectPtr(GetWorld(), NewGameLevel);
|
||||
// }
|
||||
//
|
||||
// if (APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0))
|
||||
// {
|
||||
// PlayerController->bShowMouseCursor = false;
|
||||
// UWidgetBlueprintLibrary::SetInputMode_GameOnly(PlayerController);
|
||||
// }
|
||||
//
|
||||
// SetIsFocusable(false);
|
||||
}
|
||||
|
||||
void UMainMenuWidget::QuitButtonOnClicked()
|
||||
|
34
Source/vampires/Widgets/SelectWeaponWidget.cpp
Normal file
34
Source/vampires/Widgets/SelectWeaponWidget.cpp
Normal file
@ -0,0 +1,34 @@
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
}
|
37
Source/vampires/Widgets/SelectWeaponWidget.h
Normal file
37
Source/vampires/Widgets/SelectWeaponWidget.h
Normal file
@ -0,0 +1,37 @@
|
||||
// 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();
|
||||
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user