Compare commits
No commits in common. "38405ca8e2e4e1bde88f220be2c62891cb1b77df" and "15fdc538e5fcdcfc02a38ec953e6f7993a28ae76" have entirely different histories.
38405ca8e2
...
15fdc538e5
BIN
Content/UI/LoadGame/BP_LoadGameUserWidget.uasset (Stored with Git LFS)
BIN
Content/UI/LoadGame/BP_LoadGameUserWidget.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/UI/LoadGame/BP_SaveGameEntryTemplate.uasset (Stored with Git LFS)
BIN
Content/UI/LoadGame/BP_SaveGameEntryTemplate.uasset (Stored with Git LFS)
Binary file not shown.
|
@ -3,11 +3,6 @@
|
||||||
|
|
||||||
#include "../UI/LoadGameUserWidget.h"
|
#include "../UI/LoadGameUserWidget.h"
|
||||||
|
|
||||||
#include "SaveGameEntryUserWidget.h"
|
|
||||||
#include "Blueprint/WidgetTree.h"
|
|
||||||
#include "Kismet/GameplayStatics.h"
|
|
||||||
#include "Nakatomi/NakatomiGameInstance.h"
|
|
||||||
|
|
||||||
void ULoadGameUserWidget::NativeConstruct()
|
void ULoadGameUserWidget::NativeConstruct()
|
||||||
{
|
{
|
||||||
Super::NativeConstruct();
|
Super::NativeConstruct();
|
||||||
|
@ -23,22 +18,6 @@ void ULoadGameUserWidget::NativeConstruct()
|
||||||
CancelButton->OnUnhovered.AddUniqueDynamic(this, &ULoadGameUserWidget::CancelButtonUnhoveredDelegate);
|
CancelButton->OnUnhovered.AddUniqueDynamic(this, &ULoadGameUserWidget::CancelButtonUnhoveredDelegate);
|
||||||
CancelButton->OnUnhovered.AddUniqueDynamic(this, &ULoadGameUserWidget::PlayUnhoveredSound);
|
CancelButton->OnUnhovered.AddUniqueDynamic(this, &ULoadGameUserWidget::PlayUnhoveredSound);
|
||||||
}
|
}
|
||||||
|
|
||||||
UNakatomiGameInstance* gameInstance = Cast<UNakatomiGameInstance>(UGameplayStatics::GetGameInstance(GetWorld()))
|
|
||||||
|
|
||||||
if (gameInstance && IsValid(SaveGameEntryWidgetTemplate))
|
|
||||||
{
|
|
||||||
TArray<FNakatomiSaveFileInfo> SaveFiles = gameInstance->GetAllSaveFilesFromDisk();
|
|
||||||
|
|
||||||
for (FNakatomiSaveFileInfo SaveFile : SaveFiles)
|
|
||||||
{
|
|
||||||
USaveGameEntryUserWidget* SaveGameEntry = WidgetTree->ConstructWidget<USaveGameEntryUserWidget>(
|
|
||||||
SaveGameEntryWidgetTemplate, FName("SaveGameEntry"));
|
|
||||||
|
|
||||||
SaveGameEntry->SetSaveInfo(SaveFile);
|
|
||||||
SavedGamesScrollBox->AddChild(SaveGameEntry);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ULoadGameUserWidget::CancelButtonOnClicked()
|
void ULoadGameUserWidget::CancelButtonOnClicked()
|
||||||
|
|
|
@ -26,9 +26,6 @@ public:
|
||||||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
||||||
UScrollBox* SavedGamesScrollBox;
|
UScrollBox* SavedGamesScrollBox;
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
|
||||||
TSubclassOf<class USaveGameEntryUserWidget> SaveGameEntryWidgetTemplate;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void NativeConstruct() override;
|
virtual void NativeConstruct() override;
|
||||||
|
|
||||||
|
|
|
@ -20,17 +20,12 @@ void USaveGameEntryUserWidget::NativeConstruct()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void USaveGameEntryUserWidget::SetSaveInfo(FNakatomiSaveFileInfo SaveFile)
|
void USaveGameEntryUserWidget::SetSaveInfo()
|
||||||
{
|
{
|
||||||
SaveFileInfo = SaveFile;
|
|
||||||
PlayerNameTextBlock->SetText(FText::FromString(SaveFileInfo.PlayerName));
|
|
||||||
CurrentLevelTextBlock->SetText(FText::FromString(SaveFileInfo.CurrentLevel));
|
|
||||||
DateTimeSavedTextBlock->SetText(FText::FromString(SaveFileInfo.DateTimeSaved));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void USaveGameEntryUserWidget::LoadSaveButtonOnClicked()
|
void USaveGameEntryUserWidget::LoadSaveButtonOnClicked()
|
||||||
{
|
{
|
||||||
// TODO: implement loading of stuff
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void USaveGameEntryUserWidget::LoadSaveButtonHoveredDelegate()
|
void USaveGameEntryUserWidget::LoadSaveButtonHoveredDelegate()
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "NakatomiInteractiveWidget.h"
|
#include "NakatomiInteractiveWidget.h"
|
||||||
#include "Components/Button.h"
|
#include "Components/Button.h"
|
||||||
#include "Nakatomi/NakatomiSaveFileInfo.h"
|
|
||||||
#include "SaveGameEntryUserWidget.generated.h"
|
#include "SaveGameEntryUserWidget.generated.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,14 +29,11 @@ public:
|
||||||
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
|
||||||
UTextBlock* DateTimeSavedTextBlock;
|
UTextBlock* DateTimeSavedTextBlock;
|
||||||
|
|
||||||
private:
|
|
||||||
FNakatomiSaveFileInfo SaveFileInfo;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void NativeConstruct() override;
|
virtual void NativeConstruct() override;
|
||||||
|
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
void SetSaveInfo(FNakatomiSaveFileInfo SaveFile);
|
void SetSaveInfo();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UFUNCTION()
|
UFUNCTION()
|
||||||
|
|
Loading…
Reference in New Issue