diff --git a/Content/Audio/Music/Level2/Minigames/SW_Minigame_RythmClick.uasset b/Content/Audio/Music/Level2/Minigames/SW_Minigame_RythmClick.uasset new file mode 100644 index 0000000..91bd2fd --- /dev/null +++ b/Content/Audio/Music/Level2/Minigames/SW_Minigame_RythmClick.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:137cd84114e2f87760b93055722cfe7235935c4a1612acd7ad52b7f819d47161 +size 7428527 diff --git a/Content/Blueprints/Characters/BP_Player.uasset b/Content/Blueprints/Characters/BP_Player.uasset index c279c57..44b3efc 100644 Binary files a/Content/Blueprints/Characters/BP_Player.uasset and b/Content/Blueprints/Characters/BP_Player.uasset differ diff --git a/Content/Levels/Level_2/Blueprints/Minigames/RythmClick/UI/Textures/T_Minigame_RuthmClick_Button.uasset b/Content/Levels/Level_2/Blueprints/Minigames/RythmClick/UI/Textures/T_Minigame_RuthmClick_Button.uasset new file mode 100644 index 0000000..08548b6 Binary files /dev/null and b/Content/Levels/Level_2/Blueprints/Minigames/RythmClick/UI/Textures/T_Minigame_RuthmClick_Button.uasset differ diff --git a/Content/Levels/Level_2/Blueprints/Minigames/RythmClick/UI/Textures/T_Minigame_RuthmClick_ButtonBorder.uasset b/Content/Levels/Level_2/Blueprints/Minigames/RythmClick/UI/Textures/T_Minigame_RuthmClick_ButtonBorder.uasset new file mode 100644 index 0000000..287bdfb Binary files /dev/null and b/Content/Levels/Level_2/Blueprints/Minigames/RythmClick/UI/Textures/T_Minigame_RuthmClick_ButtonBorder.uasset differ diff --git a/Content/Levels/Level_2/Blueprints/Minigames/RythmClick/UI/UIC_Minigame_RythmClick_Button.uasset b/Content/Levels/Level_2/Blueprints/Minigames/RythmClick/UI/UIC_Minigame_RythmClick_Button.uasset new file mode 100644 index 0000000..4336e32 Binary files /dev/null and b/Content/Levels/Level_2/Blueprints/Minigames/RythmClick/UI/UIC_Minigame_RythmClick_Button.uasset differ diff --git a/Content/Levels/Level_2/Blueprints/Minigames/RythmClick/UI/UI_Minigame_RythmClick_Canvas.uasset b/Content/Levels/Level_2/Blueprints/Minigames/RythmClick/UI/UI_Minigame_RythmClick_Canvas.uasset new file mode 100644 index 0000000..5e121e6 Binary files /dev/null and b/Content/Levels/Level_2/Blueprints/Minigames/RythmClick/UI/UI_Minigame_RythmClick_Canvas.uasset differ diff --git a/Content/Levels/Test/Actors/Minigame/BP_Test_Fishing.uasset b/Content/Levels/Test/Actors/Minigame/BP_Test_Fishing.uasset new file mode 100644 index 0000000..b30a2f6 Binary files /dev/null and b/Content/Levels/Test/Actors/Minigame/BP_Test_Fishing.uasset differ diff --git a/Content/Levels/Test/Actors/Minigame/BP_Test_Rythm.uasset b/Content/Levels/Test/Actors/Minigame/BP_Test_Rythm.uasset new file mode 100644 index 0000000..50efde6 Binary files /dev/null and b/Content/Levels/Test/Actors/Minigame/BP_Test_Rythm.uasset differ diff --git a/Content/Levels/Test/Actors/RuntimeLoadTest/BP_Test_RuntimeLoad.uasset b/Content/Levels/Test/Actors/RuntimeLoadTest/BP_Test_RuntimeLoad.uasset index 22bbe71..40e68d7 100644 Binary files a/Content/Levels/Test/Actors/RuntimeLoadTest/BP_Test_RuntimeLoad.uasset and b/Content/Levels/Test/Actors/RuntimeLoadTest/BP_Test_RuntimeLoad.uasset differ diff --git a/Content/Levels/Test/L_Test.umap b/Content/Levels/Test/L_Test.umap index 19be340..c1291f9 100644 Binary files a/Content/Levels/Test/L_Test.umap and b/Content/Levels/Test/L_Test.umap differ diff --git a/Content/Misc/ImportTest/BP_ImportTest_Barrel.uasset b/Content/Misc/ImportTest/BP_ImportTest_Barrel.uasset deleted file mode 100644 index 57aa3d8..0000000 Binary files a/Content/Misc/ImportTest/BP_ImportTest_Barrel.uasset and /dev/null differ diff --git a/Content/Misc/ImportTest/M_ImportTest_BarelWood.uasset b/Content/Misc/ImportTest/M_ImportTest_BarelWood.uasset index 22bda87..3393317 100644 Binary files a/Content/Misc/ImportTest/M_ImportTest_BarelWood.uasset and b/Content/Misc/ImportTest/M_ImportTest_BarelWood.uasset differ diff --git a/Content/UI/BP_MainWidgetManager.uasset b/Content/UI/BP_MainWidgetManager.uasset index a0fcdf3..f592027 100644 Binary files a/Content/UI/BP_MainWidgetManager.uasset and b/Content/UI/BP_MainWidgetManager.uasset differ diff --git a/Source/Lost_Edge/Private/ContentLoader.cpp b/Source/Lost_Edge/Private/ContentLoader.cpp index c281b88..67f72f3 100644 --- a/Source/Lost_Edge/Private/ContentLoader.cpp +++ b/Source/Lost_Edge/Private/ContentLoader.cpp @@ -28,7 +28,7 @@ UClass* UContentLoader::MountAndRegisterPak(FString pakFilePath) TArray content; FString mountPoint = GetPakMountContentPath(pakFilePath, content); - //RegisterMountPoint("/Game/", mountPoint); + RegisterMountPoint(mountPath, mountPoint); GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, FString::Printf(TEXT("ContentLoader: Pak '%s' contains %d items"), *FPaths::GetCleanFilename(pakFilePath), content.Num())); UE_LOG(LogTemp, Log, TEXT("ContentLoader: Pak '%s' contains %d items"), *FPaths::GetCleanFilename(pakFilePath), content.Num()); @@ -48,10 +48,13 @@ UClass* UContentLoader::MountAndRegisterPak(FString pakFilePath) void UContentLoader::BeginDestroy() { - while(mountedFiles.Num() > 0) - UnmountPak(*mountedFiles.begin()); + if(mountedFiles.Num() > 0) + { + while(mountedFiles.Num() > 0) + UnmountPak(*mountedFiles.begin()); - FPlatformFileManager::Get().RemovePlatformFile(GetPakPlatformFile()); + FPlatformFileManager::Get().RemovePlatformFile(GetPakPlatformFile()); + } UObject::BeginDestroy(); } @@ -202,10 +205,10 @@ FString UContentLoader::GetPakMountContentPath(const FString& pakFilePath, TArra UClass* UContentLoader::LoadPakObjClassReference(const FString& pakContentPath) { - FString assetName = FString::Printf(TEXT("/Game/%s.%s_C"), *FPaths::GetBaseFilename(pakContentPath, false), *FPaths::GetBaseFilename(pakContentPath, true)); + FString assetName = FString::Printf(TEXT("%s/%s.%s_C"), mountPath, *FPaths::GetBaseFilename(pakContentPath, false), *FPaths::GetBaseFilename(pakContentPath, true)); GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, FString::Printf(TEXT("ContentLoader: Loading '%s' class"), *assetName)); UE_LOG(LogTemp, Log, TEXT("ContentLoader: Loading '%s' class"), *assetName); - return StaticLoadClass(UObject::StaticClass(), nullptr, *assetName); + return nullptr;//StaticLoadClass(UObject::StaticClass(), nullptr, *assetName); } \ No newline at end of file diff --git a/Source/Lost_Edge/Private/CustomGameInstanceBase.cpp b/Source/Lost_Edge/Private/CustomGameInstanceBase.cpp index 4162ab1..a042ab6 100644 --- a/Source/Lost_Edge/Private/CustomGameInstanceBase.cpp +++ b/Source/Lost_Edge/Private/CustomGameInstanceBase.cpp @@ -50,6 +50,14 @@ UCustomGameInstanceBase* UCustomGameInstanceBase::GetGameInstance() return instance; } +UContentLoader* UCustomGameInstanceBase::GetContentLoader() +{ + if(auto GI = GetGameInstance()) + return GI->contentLoader; + + return nullptr; +} + void UCustomGameInstanceBase::ApplyMouseSettings() { if(auto gameSettings = UCustomGameUserSettings::GetCustomGameUserSettings()) diff --git a/Source/Lost_Edge/Private/CustomGameInstanceBase.h b/Source/Lost_Edge/Private/CustomGameInstanceBase.h index 4d9e762..f0a4b6d 100644 --- a/Source/Lost_Edge/Private/CustomGameInstanceBase.h +++ b/Source/Lost_Edge/Private/CustomGameInstanceBase.h @@ -19,6 +19,9 @@ public: UFUNCTION(BlueprintPure) static UCustomGameInstanceBase* GetGameInstance(); + UFUNCTION(BlueprintPure) + static class UContentLoader* GetContentLoader(); + UFUNCTION(BlueprintCallable, Category = Settings) void ApplyMouseSettings(); diff --git a/Source/Lost_Edge/Private/Widgets/AdvanceButton.cpp b/Source/Lost_Edge/Private/Widgets/AdvanceButton.cpp new file mode 100644 index 0000000..564c4d0 --- /dev/null +++ b/Source/Lost_Edge/Private/Widgets/AdvanceButton.cpp @@ -0,0 +1,64 @@ +// Oleg Petruny proprietary. + + +#include "AdvanceButton.h" + +#include "Components/ButtonSlot.h" + +//FReply SAdvanceButton::OnMouseMove(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) +//{ +// if(!hitboxTexture) +// return SButton::OnMouseMove(MyGeometry, MouseEvent); +// +// FVector2D locPos = MyGeometry.AbsoluteToLocal(MouseEvent.GetScreenSpacePosition()); +// locPos /= MyGeometry.GetLocalSize(); +// int width = hitboxTexture->GetPlatformData()->SizeX; +// locPos.X *= width; +// locPos.Y *= hitboxTexture->GetPlatformData()->SizeY; +// long pixelIndex = (locPos.Y * width) + locPos.X; +// +// FColor* imageData = static_cast((hitboxTexture->GetPlatformData()->Mips[0]).BulkData.Lock(LOCK_READ_ONLY)); +// bool hovered = imageData && imageData[pixelIndex].A <= hitboxTextureAlphaThreshold; +// hitboxTexture->GetPlatformData()->Mips[0].BulkData.Unlock(); +// +// if(hovered != bIsHovered) +// { +// bIsHovered = hovered; +// if(bIsHovered) +// SButton::OnMouseEnter(MyGeometry, MouseEvent); +// else +// SButton::OnMouseLeave(MouseEvent); +// } +// +// return SButton::OnMouseMove(MyGeometry, MouseEvent); +//} +// +//void UAdvanceButton::SynchronizeProperties() +//{ +// Super::SynchronizeProperties(); +// (static_cast(MyButton.Get()))->hitboxTexture = hitboxTexture; +// (static_cast(MyButton.Get()))->hitboxTextureAlphaThreshold = hitboxTextureAlphaThreshold; +//} +// +//TSharedRef UAdvanceButton::RebuildWidget() +//{ +// TSharedPtr advanceButton = SNew(SAdvanceButton) +// .OnClicked(BIND_UOBJECT_DELEGATE(FOnClicked, SlateHandleClicked)) +// .OnPressed(BIND_UOBJECT_DELEGATE(FSimpleDelegate, SlateHandlePressed)) +// .OnReleased(BIND_UOBJECT_DELEGATE(FSimpleDelegate, SlateHandleReleased)) +// .OnHovered_UObject(this, &ThisClass::SlateHandleHovered) +// .OnUnhovered_UObject(this, &ThisClass::SlateHandleUnhovered) +// .ButtonStyle(&WidgetStyle) +// .ClickMethod(ClickMethod) +// .TouchMethod(TouchMethod) +// .IsFocusable(IsFocusable); +// +// advanceButton->hitboxTexture = hitboxTexture; +// advanceButton->hitboxTextureAlphaThreshold = hitboxTextureAlphaThreshold; +// MyButton = advanceButton; +// +// if(GetChildrenCount() > 0) +// Cast(GetContentSlot())->BuildSlot(MyButton.ToSharedRef()); +// +// return MyButton.ToSharedRef(); +//} \ No newline at end of file diff --git a/Source/Lost_Edge/Private/Widgets/AdvanceButton.h b/Source/Lost_Edge/Private/Widgets/AdvanceButton.h new file mode 100644 index 0000000..d2d8a5b --- /dev/null +++ b/Source/Lost_Edge/Private/Widgets/AdvanceButton.h @@ -0,0 +1,51 @@ +// Oleg Petruny proprietary. + +#pragma once + +#include "Components/Button.h" + +#include "AdvanceButton.generated.h" + +class SAdvanceButton : public SButton +{ +public: + //virtual FReply OnMouseButtonDown(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override + //{ + // if(!bIsHovered) return FReply::Unhandled(); + // return SButton::OnMouseButtonDown(MyGeometry, MouseEvent); + //} + //virtual FReply OnMouseButtonDoubleClick(const FGeometry& InMyGeometry, const FPointerEvent& InMouseEvent) override + //{ + // if(!bIsHovered) return FReply::Unhandled(); + // return SButton::OnMouseButtonDoubleClick(InMyGeometry, InMouseEvent); + //} + //virtual FReply OnMouseMove(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override; + //virtual void OnMouseEnter(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override + //{ + // if(hitboxTexture) return; + // return SButton::OnMouseEnter(MyGeometry, MouseEvent); + //} + //virtual TSharedPtr GetToolTip() override + //{ + // return (bIsHovered ? SWidget::GetToolTip() : nullptr); + //} + // + //UTexture2D* hitboxTexture = nullptr; + //uint8 hitboxTextureAlphaThreshold = 0; +}; + +UCLASS() +class UAdvanceButton : public UButton +{ + GENERATED_BODY() + // + //public: + // virtual void SynchronizeProperties() override; + // virtual TSharedRef RebuildWidget() override; + // + // UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "AdvanceButton") + // UTexture2D* hitboxTexture = nullptr; + // + // UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "AdvanceButton", meta = (ClampMin = "0.0", ClampMax = "255.0", UIMin = "0.0", UIMax = "255.0")) + // int hitboxTextureAlphaThreshold = 0; +}; diff --git a/Source/Lost_Edge/Private/Widgets/InteractableHintWidgetManager.cpp b/Source/Lost_Edge/Private/Widgets/InteractableHintWidgetManager.cpp index 7c31b18..9f4520d 100644 --- a/Source/Lost_Edge/Private/Widgets/InteractableHintWidgetManager.cpp +++ b/Source/Lost_Edge/Private/Widgets/InteractableHintWidgetManager.cpp @@ -17,7 +17,7 @@ void UInteractableHintWidgetManager::Append(const UInteractableModificator* modi { FScopeLock Lock(&hintsLock); - if(!modificator) + if(!IsValid(modificator)) { hints->SetVisibility(ESlateVisibility::Visible); return; @@ -57,7 +57,7 @@ void UInteractableHintWidgetManager::Remove(const UInteractableModificator* modi { FScopeLock Lock(&hintsLock); - if(!modificator) + if(!IsValid(modificator)) { hints->SetVisibility(ESlateVisibility::Hidden); return;