Skip to content

Commit

Permalink
4.21
Browse files Browse the repository at this point in the history
  • Loading branch information
EverNewJoy committed Nov 9, 2018
1 parent 748b8f0 commit 5c01960
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
10 changes: 6 additions & 4 deletions Source/VictoryBPLibrary/Private/VictoryBPFunctionLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ ULevelStreaming* UVictoryBPFunctionLibrary::VictoryLoadLevelInstance(
FName LevelFName = FName(*FullName);
FString PackageFileName = FullName;
ULevelStreamingKismet* StreamingLevel = NewObject<ULevelStreamingKismet>(World, ULevelStreamingKismet::StaticClass(), NAME_None, RF_Transient, NULL);
ULevelStreamingDynamic* StreamingLevel = NewObject<ULevelStreamingDynamic>(World, ULevelStreamingDynamic::StaticClass(), NAME_None, RF_Transient, NULL);
if(!StreamingLevel)
{
Expand Down Expand Up @@ -3255,6 +3255,7 @@ AActor* UVictoryBPFunctionLibrary::Traces__CharacterMeshTrace___ClosestBone(
TraceEnd,
true,
false,
false,
OutImpactPoint,
OutImpactNormal,
ClosestBoneName,
Expand Down Expand Up @@ -3327,6 +3328,7 @@ AActor* UVictoryBPFunctionLibrary::Traces__CharacterMeshTrace___ClosestSocket(
TraceEnd,
true,
false,
false,
OutImpactPoint,
OutImpactNormal,
BoneName,
Expand Down Expand Up @@ -5098,7 +5100,7 @@ void UVictoryBPFunctionLibrary::SetGenericTeamId(AActor* Target, uint8 NewTeamId
}
}

FLevelStreamInstanceInfo::FLevelStreamInstanceInfo(ULevelStreamingKismet* LevelInstance)
FLevelStreamInstanceInfo::FLevelStreamInstanceInfo(ULevelStreamingDynamic* LevelInstance)
{
PackageName = LevelInstance->GetWorldAssetPackageFName();
PackageNameToLoad = LevelInstance->PackageNameToLoad;
Expand All @@ -5110,7 +5112,7 @@ FLevelStreamInstanceInfo::FLevelStreamInstanceInfo(ULevelStreamingKismet* LevelI
LODIndex = LevelInstance->GetLevelLODIndex();
};

FLevelStreamInstanceInfo UVictoryBPFunctionLibrary::GetLevelInstanceInfo(ULevelStreamingKismet* LevelInstance)
FLevelStreamInstanceInfo UVictoryBPFunctionLibrary::GetLevelInstanceInfo(ULevelStreamingDynamic* LevelInstance)
{
return FLevelStreamInstanceInfo(LevelInstance);
}
Expand Down Expand Up @@ -5149,7 +5151,7 @@ void UVictoryBPFunctionLibrary::AddToStreamingLevels(UObject* WorldContextObject
GEngine->DelayGarbageCollection();

// Setup streaming level object that will load specified map
ULevelStreamingKismet* StreamingLevel = NewObject<ULevelStreamingKismet>(World, ULevelStreamingKismet::StaticClass(), NAME_None, RF_Transient, nullptr);
ULevelStreamingDynamic* StreamingLevel = NewObject<ULevelStreamingDynamic>(World, ULevelStreamingDynamic::StaticClass(), NAME_None, RF_Transient, nullptr);
StreamingLevel->SetWorldAssetByPackageName(PackageName);
StreamingLevel->LevelColor = FColor::MakeRandomColor();
StreamingLevel->SetShouldBeLoaded(LevelInstanceInfo.bShouldBeLoaded);
Expand Down
10 changes: 6 additions & 4 deletions Source/VictoryBPLibrary/Public/VictoryBPFunctionLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include "Developer/TargetPlatform/Public/Interfaces/IAudioFormat.h"
#include "VorbisAudioInfo.h"

#include "Runtime/Engine/Classes/Engine/LevelStreamingDynamic.h"

//Texture2D
//#include "Engine/Texture2D.h"
#include "DDSLoader.h"
Expand Down Expand Up @@ -207,7 +209,7 @@ struct FLevelStreamInstanceInfo

FLevelStreamInstanceInfo() {}

FLevelStreamInstanceInfo(ULevelStreamingKismet* LevelInstance);
FLevelStreamInstanceInfo(ULevelStreamingDynamic* LevelInstance);

FString ToString() const
{
Expand Down Expand Up @@ -1798,7 +1800,7 @@ static void SetBloomIntensity(APostProcessVolume* PostProcessVolume,float Intens
static void SetGenericTeamId(AActor* Target, uint8 NewTeamId);

UFUNCTION(Category = "Victory BP Library|LevelStreaming", BlueprintCallable)
static FLevelStreamInstanceInfo GetLevelInstanceInfo(ULevelStreamingKismet* LevelInstance);
static FLevelStreamInstanceInfo GetLevelInstanceInfo(ULevelStreamingDynamic* LevelInstance);

UFUNCTION(Category = "Victory BP Library|LevelStreaming", BlueprintCallable, Meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"))
static void AddToStreamingLevels(UObject* WorldContextObject, const FLevelStreamInstanceInfo& LevelInstanceInfo);
Expand All @@ -1807,13 +1809,13 @@ static void SetBloomIntensity(APostProcessVolume* PostProcessVolume,float Intens
static void RemoveFromStreamingLevels(UObject* WorldContextObject, const FLevelStreamInstanceInfo& LevelInstanceInfo);

UFUNCTION(Category = "Victory BP Library|LevelStreaming", BlueprintCallable, Meta = (keywords="remove"))
static void HideStreamingLevel(ULevelStreamingKismet* LevelInstance)
static void HideStreamingLevel(ULevelStreamingDynamic* LevelInstance)
{
if(LevelInstance) LevelInstance->SetShouldBeVisible(false);
}

UFUNCTION(Category = "Victory BP Library|LevelStreaming", BlueprintCallable, Meta = (keywords="remove"))
static void UnloadStreamingLevel(ULevelStreamingKismet* LevelInstance)
static void UnloadStreamingLevel(ULevelStreamingDynamic* LevelInstance)
{
if(LevelInstance) LevelInstance->SetShouldBeLoaded(false);
}
Expand Down
2 changes: 2 additions & 0 deletions Source/VictoryBPLibrary/VictoryBPLibrary.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ public class VictoryBPLibrary : ModuleRules
{
public VictoryBPLibrary(ReadOnlyTargetRules Target) : base(Target)
{
PrivatePCHHeaderFile = "Private/VictoryBPLibraryPrivatePCH.h";

//4.15 Include What You Use
bEnforceIWYU = false;

Expand Down

0 comments on commit 5c01960

Please sign in to comment.