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.
@ -25,14 +25,10 @@ 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();
|
||||||
};
|
};
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#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"
|
||||||
@ -35,6 +36,8 @@ 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);
|
||||||
@ -44,18 +47,31 @@ void UMainMenuWidget::NativeConstruct()
|
|||||||
|
|
||||||
void UMainMenuWidget::NewGameButtonOnClicked()
|
void UMainMenuWidget::NewGameButtonOnClicked()
|
||||||
{
|
{
|
||||||
if (!NewGameLevel.IsNull())
|
if (NewGameMenuWidget)
|
||||||
{
|
{
|
||||||
UGameplayStatics::OpenLevelBySoftObjectPtr(GetWorld(), NewGameLevel);
|
RemoveFromParent();
|
||||||
|
|
||||||
|
UUserWidget* selectWeaponWidget = CreateWidget<UUserWidget, APlayerController*>(
|
||||||
|
UGameplayStatics::GetPlayerController(GetWorld(), 0), NewGameMenuWidget);
|
||||||
|
|
||||||
|
if (selectWeaponWidget)
|
||||||
|
{
|
||||||
|
selectWeaponWidget->AddToViewport();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0))
|
// if (!NewGameLevel.IsNull())
|
||||||
{
|
// {
|
||||||
PlayerController->bShowMouseCursor = false;
|
// UGameplayStatics::OpenLevelBySoftObjectPtr(GetWorld(), NewGameLevel);
|
||||||
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()
|
||||||
|
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