-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
leg work already done, saving for template
- Loading branch information
Showing
96 changed files
with
9,789 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"version": "1.0", | ||
"components": [ | ||
"Microsoft.Net.Component.4.6.2.TargetingPack", | ||
"Microsoft.VisualStudio.Component.VC.14.36.17.6.x86.x64", | ||
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64", | ||
"Microsoft.VisualStudio.Component.Windows10SDK.22000", | ||
"Microsoft.VisualStudio.Workload.CoreEditor", | ||
"Microsoft.VisualStudio.Workload.ManagedDesktop", | ||
"Microsoft.VisualStudio.Workload.NativeDesktop", | ||
"Microsoft.VisualStudio.Workload.NativeGame" | ||
] | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
|
||
|
||
[/Script/EngineSettings.GameMapsSettings] | ||
EditorStartupMap=/Game/Level/Menu.Menu | ||
LocalMapOptions= | ||
TransitionMap=None | ||
bUseSplitscreen=True | ||
TwoPlayerSplitscreenLayout=Horizontal | ||
ThreePlayerSplitscreenLayout=FavorTop | ||
FourPlayerSplitscreenLayout=Grid | ||
bOffsetPlayerGamepadIds=False | ||
GameInstanceClass=/Script/UE5EnhancedInputEx.MyGameInstance | ||
GameDefaultMap=/Game/Level/Menu.Menu | ||
ServerDefaultMap=/Engine/Maps/Entry.Entry | ||
GlobalDefaultGameMode=/Game/Setup/BP_MyGameMode.BP_MyGameMode_C | ||
GlobalDefaultServerGameMode=None | ||
|
||
[/Script/WindowsTargetPlatform.WindowsTargetSettings] | ||
DefaultGraphicsRHI=DefaultGraphicsRHI_DX12 | ||
-D3D12TargetedShaderFormats=PCD3D_SM5 | ||
+D3D12TargetedShaderFormats=PCD3D_SM6 | ||
-D3D11TargetedShaderFormats=PCD3D_SM5 | ||
+D3D11TargetedShaderFormats=PCD3D_SM5 | ||
Compiler=Default | ||
AudioSampleRate=48000 | ||
AudioCallbackBufferFrameSize=1024 | ||
AudioNumBuffersToEnqueue=1 | ||
AudioMaxChannels=0 | ||
AudioNumSourceWorkers=4 | ||
SpatializationPlugin= | ||
SourceDataOverridePlugin= | ||
ReverbPlugin= | ||
OcclusionPlugin= | ||
CompressionOverrides=(bOverrideCompressionTimes=False,DurationThreshold=5.000000,MaxNumRandomBranches=0,SoundCueQualityIndex=0) | ||
CacheSizeKB=65536 | ||
MaxChunkSizeOverrideKB=0 | ||
bResampleForDevice=False | ||
MaxSampleRate=48000.000000 | ||
HighSampleRate=32000.000000 | ||
MedSampleRate=24000.000000 | ||
LowSampleRate=12000.000000 | ||
MinSampleRate=8000.000000 | ||
CompressionQualityModifier=1.000000 | ||
AutoStreamingThreshold=0.000000 | ||
SoundCueCookQualityIndex=-1 | ||
|
||
[/Script/HardwareTargeting.HardwareTargetingSettings] | ||
TargetedHardwareClass=Desktop | ||
AppliedTargetedHardwareClass=Desktop | ||
DefaultGraphicsPerformance=Maximum | ||
AppliedDefaultGraphicsPerformance=Maximum | ||
|
||
[/Script/Engine.RendererSettings] | ||
r.GenerateMeshDistanceFields=True | ||
r.DynamicGlobalIlluminationMethod=1 | ||
r.ReflectionMethod=1 | ||
r.Shadow.Virtual.Enable=1 | ||
r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True | ||
r.DefaultFeature.LocalExposure.HighlightContrastScale=0.8 | ||
r.DefaultFeature.LocalExposure.ShadowContrastScale=0.8 | ||
|
||
[/Script/WorldPartitionEditor.WorldPartitionEditorSettings] | ||
CommandletClass=Class'/Script/UnrealEd.WorldPartitionConvertCommandlet' | ||
|
||
[/Script/Engine.UserInterfaceSettings] | ||
bAuthorizeAutomaticWidgetVariableCreation=False | ||
FontDPIPreset=Standard | ||
FontDPI=72 | ||
|
||
[/Script/Engine.Engine] | ||
+ActiveGameNameRedirects=(OldGameName="TP_Blank",NewGameName="/Script/UE5EnhancedInputEx") | ||
+ActiveGameNameRedirects=(OldGameName="/Script/TP_Blank",NewGameName="/Script/UE5EnhancedInputEx") | ||
GameViewportClientClassName=/Script/CommonUI.CommonGameViewportClient | ||
LocalPlayerClassName=/Script/UE5EnhancedInputEx.MyCommonLocalPlayer | ||
|
||
[/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings] | ||
bEnablePlugin=True | ||
bAllowNetworkConnection=True | ||
SecurityToken=067749DE40DF19A8814C02943498EB56 | ||
bIncludeInShipping=False | ||
bAllowExternalStartInShipping=False | ||
bCompileAFSProject=False | ||
bUseCompression=False | ||
bLogFiles=False | ||
bReportStats=False | ||
ConnectionType=USBOnly | ||
bUseManualIPAddress=False | ||
ManualIPAddress= | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[/Script/EngineSettings.GeneralProjectSettings] | ||
ProjectID=1858BE544E5FB61D2BB31AADA294221A | ||
|
||
[/Script/CommonGame.GameUIManagerSubsystem] | ||
DefaultUIPolicyClass=/Game/UI/BP_MyUIPolicy.BP_MyUIPolicy_C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[/Script/GameplayTags.GameplayTagsSettings] | ||
ImportTagsFromConfig=True | ||
WarnOnInvalidTags=True | ||
ClearInvalidTags=False | ||
AllowEditorTagUnloading=True | ||
AllowGameTagUnloading=False | ||
FastReplication=False | ||
InvalidTagCharacters="\"\'," | ||
NumBitsForContainerSize=6 | ||
NetIndexFirstBitSegment=16 | ||
+GameplayTagList=(Tag="UI.Layer.Game",DevComment="") | ||
+GameplayTagList=(Tag="UI.Layer.GameMenu",DevComment="") | ||
+GameplayTagList=(Tag="UI.Layer.Menu",DevComment="") | ||
+GameplayTagList=(Tag="UI.MainMenu.Landing",DevComment="") | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
[/Script/Engine.InputSettings] | ||
-AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) | ||
-AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) | ||
-AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) | ||
-AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) | ||
-AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) | ||
-AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) | ||
-AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) | ||
+AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MouseWheelAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Gamepad_LeftTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Gamepad_RightTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Gamepad_Special_Left_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Gamepad_Special_Left_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Vive_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Vive_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Vive_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Vive_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Vive_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="Vive_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MixedReality_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MixedReality_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) | ||
bAltEnterTogglesFullscreen=True | ||
bF11TogglesFullscreen=True | ||
bUseMouseForTouch=False | ||
bEnableMouseSmoothing=True | ||
bEnableFOVScaling=True | ||
bCaptureMouseOnLaunch=True | ||
bEnableLegacyInputScales=True | ||
bEnableMotionControls=True | ||
bFilterInputByPlatformUser=False | ||
bShouldFlushPressedKeysOnViewportFocusLost=True | ||
bAlwaysShowTouchInterface=False | ||
bShowConsoleOnFourFingerTap=True | ||
bEnableGestureRecognizer=False | ||
bUseAutocorrect=False | ||
DefaultViewportMouseCaptureMode=CapturePermanently_IncludingInitialMouseDown | ||
DefaultViewportMouseLockMode=LockOnCapture | ||
FOVScale=0.011110 | ||
DoubleClickTime=0.200000 | ||
DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput | ||
DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent | ||
DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks | ||
-ConsoleKeys=Tilde | ||
+ConsoleKeys=Tilde | ||
+ConsoleKeys=Caret | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"FileVersion": 3, | ||
"Version": 1, | ||
"VersionName": "1.0", | ||
"FriendlyName": "CommonGame", | ||
"Description": "Generic gameplay classes that use the other Common plugins.", | ||
"Category": "Gameplay", | ||
"CreatedBy": "Epic Games, Inc.", | ||
"CreatedByURL": "https://www.epicgames.com", | ||
"DocsURL": "", | ||
"MarketplaceURL": "", | ||
"SupportURL": "", | ||
"CanContainContent": false, | ||
"IsBetaVersion": false, | ||
"Installed": false, | ||
|
||
"Modules": [ | ||
{ | ||
"Name": "CommonGame", | ||
"Type": "Runtime", | ||
"LoadingPhase": "Default" | ||
} | ||
], | ||
"Plugins": [ | ||
{ | ||
"Name": "CommonUI", | ||
"Enabled": true | ||
}, | ||
{ | ||
"Name": "CommonUser", | ||
"Enabled": true | ||
}, | ||
{ | ||
"Name": "ModularGameplayActors", | ||
"Enabled": true | ||
}, | ||
{ | ||
"Name": "OnlineFramework", | ||
"Enabled": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright Epic Games, Inc. All Rights Reserved. | ||
|
||
using UnrealBuildTool; | ||
|
||
public class CommonGame : ModuleRules | ||
{ | ||
public CommonGame(ReadOnlyTargetRules Target) : base(Target) | ||
{ | ||
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; | ||
|
||
PublicDependencyModuleNames.AddRange( | ||
new string[] | ||
{ | ||
"Core", | ||
"CoreUObject", | ||
"InputCore", | ||
"Engine", | ||
"Slate", | ||
"SlateCore", | ||
"UMG", | ||
"CommonInput", | ||
"CommonUI", | ||
"CommonUser", | ||
"GameplayTags", | ||
"ModularGameplayActors", | ||
} | ||
); | ||
|
||
|
||
PrivateDependencyModuleNames.AddRange( | ||
new string[] | ||
{ | ||
} | ||
); | ||
|
||
|
||
DynamicallyLoadedModuleNames.AddRange( | ||
new string[] | ||
{ | ||
} | ||
); | ||
} | ||
} |
97 changes: 97 additions & 0 deletions
97
Plugins/CommonGame/Source/Private/Actions/AsyncAction_CreateWidgetAsync.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// Copyright Epic Games, Inc. All Rights Reserved. | ||
|
||
#include "Actions/AsyncAction_CreateWidgetAsync.h" | ||
|
||
#include "Blueprint/UserWidget.h" | ||
#include "Blueprint/WidgetBlueprintLibrary.h" | ||
#include "CommonUIExtensions.h" | ||
#include "Engine/AssetManager.h" | ||
#include "Engine/Engine.h" | ||
#include "Engine/GameInstance.h" | ||
#include "Engine/StreamableManager.h" | ||
#include "UObject/Stack.h" | ||
|
||
#include UE_INLINE_GENERATED_CPP_BY_NAME(AsyncAction_CreateWidgetAsync) | ||
|
||
class UUserWidget; | ||
|
||
static const FName InputFilterReason_Template = FName(TEXT("CreatingWidgetAsync")); | ||
|
||
UAsyncAction_CreateWidgetAsync::UAsyncAction_CreateWidgetAsync(const FObjectInitializer& ObjectInitializer) | ||
: Super(ObjectInitializer) | ||
, bSuspendInputUntilComplete(true) | ||
{ | ||
} | ||
|
||
UAsyncAction_CreateWidgetAsync* UAsyncAction_CreateWidgetAsync::CreateWidgetAsync(UObject* InWorldContextObject, TSoftClassPtr<UUserWidget> InUserWidgetSoftClass, APlayerController* InOwningPlayer, bool bSuspendInputUntilComplete) | ||
{ | ||
if (InUserWidgetSoftClass.IsNull()) | ||
{ | ||
FFrame::KismetExecutionMessage(TEXT("CreateWidgetAsync was passed a null UserWidgetSoftClass"), ELogVerbosity::Error); | ||
return nullptr; | ||
} | ||
|
||
UWorld* World = GEngine->GetWorldFromContextObject(InWorldContextObject, EGetWorldErrorMode::LogAndReturnNull); | ||
|
||
UAsyncAction_CreateWidgetAsync* Action = NewObject<UAsyncAction_CreateWidgetAsync>(); | ||
Action->UserWidgetSoftClass = InUserWidgetSoftClass; | ||
Action->OwningPlayer = InOwningPlayer; | ||
Action->World = World; | ||
Action->GameInstance = World->GetGameInstance(); | ||
Action->bSuspendInputUntilComplete = bSuspendInputUntilComplete; | ||
Action->RegisterWithGameInstance(World); | ||
|
||
return Action; | ||
} | ||
|
||
void UAsyncAction_CreateWidgetAsync::Activate() | ||
{ | ||
SuspendInputToken = bSuspendInputUntilComplete ? UCommonUIExtensions::SuspendInputForPlayer(OwningPlayer.Get(), InputFilterReason_Template) : NAME_None; | ||
|
||
TWeakObjectPtr<UAsyncAction_CreateWidgetAsync> LocalWeakThis(this); | ||
StreamingHandle = UAssetManager::Get().GetStreamableManager().RequestAsyncLoad( | ||
UserWidgetSoftClass.ToSoftObjectPath(), | ||
FStreamableDelegate::CreateUObject(this, &ThisClass::OnWidgetLoaded), | ||
FStreamableManager::AsyncLoadHighPriority | ||
); | ||
|
||
// Setup a cancel delegate so that we can resume input if this handler is canceled. | ||
StreamingHandle->BindCancelDelegate(FStreamableDelegate::CreateWeakLambda(this, | ||
[this]() | ||
{ | ||
UCommonUIExtensions::ResumeInputForPlayer(OwningPlayer.Get(), SuspendInputToken); | ||
}) | ||
); | ||
} | ||
|
||
void UAsyncAction_CreateWidgetAsync::Cancel() | ||
{ | ||
Super::Cancel(); | ||
|
||
if (StreamingHandle.IsValid()) | ||
{ | ||
StreamingHandle->CancelHandle(); | ||
StreamingHandle.Reset(); | ||
} | ||
} | ||
|
||
void UAsyncAction_CreateWidgetAsync::OnWidgetLoaded() | ||
{ | ||
if (bSuspendInputUntilComplete) | ||
{ | ||
UCommonUIExtensions::ResumeInputForPlayer(OwningPlayer.Get(), SuspendInputToken); | ||
} | ||
|
||
// If the load as successful, create it, otherwise don't complete this. | ||
TSubclassOf<UUserWidget> UserWidgetClass = UserWidgetSoftClass.Get(); | ||
if (UserWidgetClass) | ||
{ | ||
UUserWidget* UserWidget = UWidgetBlueprintLibrary::Create(World.Get(), UserWidgetClass, OwningPlayer.Get()); | ||
OnComplete.Broadcast(UserWidget); | ||
} | ||
|
||
StreamingHandle.Reset(); | ||
|
||
SetReadyToDestroy(); | ||
} | ||
|
Oops, something went wrong.