C++ Implementation GameInstance save, also some cleanup of unsued C++ classes
This literally took me days, as it turn out that the timing offset between C++ and BP Init of GameIstance caused it to not be added as a GlobalObject to SPUD correctly.
This commit is contained in:
parent
ff4cff2b5d
commit
362b5ff23f
18 changed files with 72 additions and 112 deletions
BIN
VIRTUOS_ExpansionPluginTests/Content/Maps/Map_Gameworld.umap
(Stored with Git LFS)
BIN
VIRTUOS_ExpansionPluginTests/Content/Maps/Map_Gameworld.umap
(Stored with Git LFS)
Binary file not shown.
BIN
VIRTUOS_ExpansionPluginTests/Content/UI/Inventory/BP_VRInventory.uasset
(Stored with Git LFS)
BIN
VIRTUOS_ExpansionPluginTests/Content/UI/Inventory/BP_VRInventory.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
VIRTUOS_ExpansionPluginTests/Content/UI/Inventory/InventoryStruct.uasset
(Stored with Git LFS)
BIN
VIRTUOS_ExpansionPluginTests/Content/UI/Inventory/InventoryStruct.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
VIRTUOS_ExpansionPluginTests/Content/UI/Inventory/WB_InventoryWidget.uasset
(Stored with Git LFS)
BIN
VIRTUOS_ExpansionPluginTests/Content/UI/Inventory/WB_InventoryWidget.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
VIRTUOS_ExpansionPluginTests/Content/VRE/Core/VRGameInstance.uasset
(Stored with Git LFS)
BIN
VIRTUOS_ExpansionPluginTests/Content/VRE/Core/VRGameInstance.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
VIRTUOS_ExpansionPluginTests/Content/VRE/Grippables/Weapons/Guns/GunBase.uasset
(Stored with Git LFS)
BIN
VIRTUOS_ExpansionPluginTests/Content/VRE/Grippables/Weapons/Guns/GunBase.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
VIRTUOS_ExpansionPluginTests/Content/World/Interactibles/Electrical/Recorder/BP_Cassette.uasset
(Stored with Git LFS)
BIN
VIRTUOS_ExpansionPluginTests/Content/World/Interactibles/Electrical/Recorder/BP_Cassette.uasset
(Stored with Git LFS)
Binary file not shown.
|
|
@ -30,7 +30,7 @@ namespace UnrealBuildTool.Rules
|
||||||
"Engine",
|
"Engine",
|
||||||
"Core",
|
"Core",
|
||||||
"CoreUObject",
|
"CoreUObject",
|
||||||
"VRExpansionPlugin",
|
"VRExpansionPlugin"
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ public class VRExpansionPlugin : ModuleRules
|
||||||
"AnimGraphRuntime",
|
"AnimGraphRuntime",
|
||||||
"XRBase",
|
"XRBase",
|
||||||
"GameplayTags",
|
"GameplayTags",
|
||||||
"Mover"
|
"Mover",
|
||||||
});
|
});
|
||||||
|
|
||||||
//if(Target.bUseChaos)
|
//if(Target.bUseChaos)
|
||||||
|
|
@ -92,7 +92,7 @@ public class VRExpansionPlugin : ModuleRules
|
||||||
"ApplicationCore",
|
"ApplicationCore",
|
||||||
"RenderCore",
|
"RenderCore",
|
||||||
// "ShaderCore",
|
// "ShaderCore",
|
||||||
"NetworkReplayStreaming"
|
"NetworkReplayStreaming",
|
||||||
//"Renderer",
|
//"Renderer",
|
||||||
// "UtilityShaders"
|
// "UtilityShaders"
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -15,22 +15,22 @@
|
||||||
"IsBetaVersion": false,
|
"IsBetaVersion": false,
|
||||||
"Installed": true,
|
"Installed": true,
|
||||||
"SupportedTargetPlatforms": [
|
"SupportedTargetPlatforms": [
|
||||||
"Win64",
|
"Win64",
|
||||||
"Linux",
|
"Linux",
|
||||||
"Android",
|
"Android",
|
||||||
"Mac",
|
"Mac",
|
||||||
"IOS"
|
"IOS"
|
||||||
],
|
],
|
||||||
"Modules": [
|
"Modules": [
|
||||||
{
|
{
|
||||||
"Name": "VRExpansionPlugin",
|
"Name": "VRExpansionPlugin",
|
||||||
"Type": "RunTime",
|
"Type": "RunTime",
|
||||||
"LoadingPhase": "Default"
|
"LoadingPhase": "Default"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "VRExpansionEditor",
|
"Name": "VRExpansionEditor",
|
||||||
"Type": "UnCookedOnly",
|
"Type": "UnCookedOnly",
|
||||||
"LoadingPhase": "PostEngineInit"
|
"LoadingPhase": "PostEngineInit"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Plugins": [
|
"Plugins": [
|
||||||
|
|
@ -45,6 +45,10 @@
|
||||||
{
|
{
|
||||||
"Name": "Mover",
|
"Name": "Mover",
|
||||||
"Enabled": true
|
"Enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "SPUD",
|
||||||
|
"Enabled": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
#include "CodeOnlyFunctionLibrary.h"
|
|
||||||
#include "GameFramework/Actor.h"
|
|
||||||
#include "Engine/Level.h"
|
|
||||||
|
|
||||||
FString UCodeOnlyFunctionLibrary::RenameActorUnique(AActor* ActorToRename, const FString& DesiredName, AActor* ReferenceActorForLevel)
|
|
||||||
{
|
|
||||||
if (!ActorToRename || !ReferenceActorForLevel)
|
|
||||||
{
|
|
||||||
return FString();
|
|
||||||
}
|
|
||||||
|
|
||||||
FString NewName = DesiredName;
|
|
||||||
|
|
||||||
while (!ActorToRename->Rename(*NewName, ReferenceActorForLevel->GetLevel(), REN_Test))
|
|
||||||
{
|
|
||||||
UE_LOG(LogTemp, Warning, TEXT("Rename conflict on drop: %s"), *NewName);
|
|
||||||
NewName.AppendChar('x');
|
|
||||||
}
|
|
||||||
|
|
||||||
ActorToRename->Rename(*NewName, ReferenceActorForLevel->GetLevel());
|
|
||||||
|
|
||||||
return NewName;
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
#include "CustomAdvancedFriendsGI.h"
|
||||||
|
#include "Engine/World.h"
|
||||||
|
#include "Engine/Engine.h"
|
||||||
|
#include "SpudSubsystem.h"
|
||||||
|
|
||||||
|
void UCustomAdvancedFriendsGI::Init()
|
||||||
|
{
|
||||||
|
Super::Init();
|
||||||
|
|
||||||
|
if (GEngine)
|
||||||
|
{
|
||||||
|
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green,
|
||||||
|
TEXT("CustomAdvancedFriendsGI::Init() called"));
|
||||||
|
}
|
||||||
|
|
||||||
|
GetSpudSubsystem(GetWorld())->AddPersistentGlobalObjectWithName(this, TEXT("ExampleGameInstance"));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
|
||||||
|
|
||||||
|
|
||||||
#include "WidgetHelper.h"
|
|
||||||
|
|
||||||
WidgetHelper::WidgetHelper()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
WidgetHelper::~WidgetHelper()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
|
||||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
|
||||||
#include "CodeOnlyFunctionLibrary.generated.h"
|
|
||||||
|
|
||||||
UCLASS()
|
|
||||||
class NO_API UCodeOnlyFunctionLibrary : public UBlueprintFunctionLibrary
|
|
||||||
{
|
|
||||||
GENERATED_BODY()
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Utilities|Actor")
|
|
||||||
static FString RenameActorUnique(AActor* ActorToRename, const FString& DesiredName, AActor* ReferenceActorForLevel);
|
|
||||||
};
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
#include "AdvancedFriendsGameInstance.h"
|
||||||
|
#include "CustomAdvancedFriendsGI.generated.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom GameInstance that registers itself with SPUD for persistence.
|
||||||
|
*/
|
||||||
|
UCLASS()
|
||||||
|
class VREXPPLUGINEXAMPLE_API UCustomAdvancedFriendsGI : public UAdvancedFriendsGameInstance
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void Init() override;
|
||||||
|
};
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
// Fill out your copyright notice in the Description page of Project Settings.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class VREXPPLUGINEXAMPLE_API WidgetHelper
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
WidgetHelper();
|
|
||||||
~WidgetHelper();
|
|
||||||
};
|
|
||||||
|
|
@ -10,7 +10,7 @@ public class VRExpPluginExample : ModuleRules
|
||||||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||||
// PrivatePCHHeaderFile = "Private/WindowsMixedRealityPrecompiled.h";
|
// PrivatePCHHeaderFile = "Private/WindowsMixedRealityPrecompiled.h";
|
||||||
|
|
||||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "AdvancedSessions", "VRExpansionPlugin" });
|
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "AdvancedSessions", "VRExpansionPlugin", "SPUD" });
|
||||||
|
|
||||||
PrivateDependencyModuleNames.AddRange(new string[] { });
|
PrivateDependencyModuleNames.AddRange(new string[] { });
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,20 +9,15 @@
|
||||||
"Type": "Runtime",
|
"Type": "Runtime",
|
||||||
"LoadingPhase": "Default",
|
"LoadingPhase": "Default",
|
||||||
"AdditionalDependencies": [
|
"AdditionalDependencies": [
|
||||||
"Engine"
|
"Engine",
|
||||||
|
"AdvancedSessions"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Plugins": [
|
"Plugins": [
|
||||||
{
|
{
|
||||||
"Name": "OpenXR",
|
"Name": "OpenXR",
|
||||||
"Enabled": true,
|
"Enabled": true
|
||||||
"SupportedTargetPlatforms": [
|
|
||||||
"Win64",
|
|
||||||
"Linux",
|
|
||||||
"LinuxArm64",
|
|
||||||
"Android"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "VRExpansionPlugin",
|
"Name": "VRExpansionPlugin",
|
||||||
|
|
@ -61,13 +56,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "OpenXRHandTracking",
|
"Name": "OpenXRHandTracking",
|
||||||
"Enabled": true,
|
"Enabled": true
|
||||||
"SupportedTargetPlatforms": [
|
|
||||||
"Win64",
|
|
||||||
"Linux",
|
|
||||||
"LinuxArm64",
|
|
||||||
"Android"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "UdpMessaging",
|
"Name": "UdpMessaging",
|
||||||
|
|
@ -112,10 +101,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "TextureGraph",
|
"Name": "TextureGraph",
|
||||||
"Enabled": true,
|
"Enabled": true
|
||||||
"SupportedTargetPlatforms": [
|
|
||||||
"Win64"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "Harmonix",
|
"Name": "Harmonix",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue