Some more naming and format corrections
This commit is contained in:
parent
a4d1ea431e
commit
ad6bf7369c
|
@ -24,20 +24,6 @@ FString UMapGeneratorWidget::GenerateMapFiles(const FMapGeneratorMetaInfo& MetaI
|
||||||
// 1. Creating Levels
|
// 1. Creating Levels
|
||||||
CreateMainLargeMap(MetaInfo);
|
CreateMainLargeMap(MetaInfo);
|
||||||
CreateTilesMaps(MetaInfo);
|
CreateTilesMaps(MetaInfo);
|
||||||
// bool bLoaded = LoadWorld(WorldAssetData);
|
|
||||||
// GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Yellow,
|
|
||||||
// bLoaded ? "Loaded CORRECT" : "NOT loaded");
|
|
||||||
|
|
||||||
// 2. Applying heightmap
|
|
||||||
// UWorld* World = CastChecked<UWorld>(WorldAssetData.GetAsset());
|
|
||||||
// ALandscape* landscape =
|
|
||||||
// (ALandscape*) UGameplayStatics::GetActorOfClass(World, ALandscape::StaticClass());
|
|
||||||
// GEngine->AddOnScreenDebugMessage(
|
|
||||||
// -1, 15.0f, FColor::Green, landscape!=nullptr ? "L TRUE" : "L FALSE");
|
|
||||||
// AssignLandscapeHeightMap(landscape);
|
|
||||||
|
|
||||||
// 3. Saving World
|
|
||||||
// bool bSaved = SaveWorld(WorldAssetData, MetaInfo.DestinationPath, MetaInfo.MapName);
|
|
||||||
|
|
||||||
return ErrorMsg;
|
return ErrorMsg;
|
||||||
}
|
}
|
||||||
|
@ -78,8 +64,7 @@ bool UMapGeneratorWidget::LoadWorld(FAssetData& WorldAssetData, const FString& B
|
||||||
bool UMapGeneratorWidget::SaveWorld(
|
bool UMapGeneratorWidget::SaveWorld(
|
||||||
FAssetData& WorldToBeSaved,
|
FAssetData& WorldToBeSaved,
|
||||||
const FString& DestinationPath,
|
const FString& DestinationPath,
|
||||||
const FString& WorldName
|
const FString& WorldName)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
UWorld* World;
|
UWorld* World;
|
||||||
UObjectRedirector *BaseMapRedirector =
|
UObjectRedirector *BaseMapRedirector =
|
||||||
|
@ -108,8 +93,8 @@ bool UMapGeneratorWidget::SaveWorld(
|
||||||
// Saving Package
|
// Saving Package
|
||||||
const FString PackageFileName = FPackageName::LongPackageNameToFilename(
|
const FString PackageFileName = FPackageName::LongPackageNameToFilename(
|
||||||
PackagePath,
|
PackagePath,
|
||||||
FPackageName::GetMapPackageExtension()
|
FPackageName::GetMapPackageExtension());
|
||||||
);
|
|
||||||
if(FPaths::FileExists(*PackageFileName))
|
if(FPaths::FileExists(*PackageFileName))
|
||||||
{
|
{
|
||||||
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, "Package already Exists");
|
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, "Package already Exists");
|
||||||
|
@ -117,8 +102,7 @@ bool UMapGeneratorWidget::SaveWorld(
|
||||||
}
|
}
|
||||||
return UPackage::SavePackage(
|
return UPackage::SavePackage(
|
||||||
Package, World, EObjectFlags::RF_Public | EObjectFlags::RF_Standalone,
|
Package, World, EObjectFlags::RF_Public | EObjectFlags::RF_Standalone,
|
||||||
*PackageFileName, GError, nullptr, true, true, SAVE_NoError
|
*PackageFileName, GError, nullptr, true, true, SAVE_NoError);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UMapGeneratorWidget::CreateMainLargeMap(const FMapGeneratorMetaInfo& MetaInfo)
|
bool UMapGeneratorWidget::CreateMainLargeMap(const FMapGeneratorMetaInfo& MetaInfo)
|
||||||
|
@ -155,8 +139,7 @@ bool UMapGeneratorWidget::CreateTilesMaps(const FMapGeneratorMetaInfo& MetaInfo)
|
||||||
|
|
||||||
bool UMapGeneratorWidget::ApplyHeightMapToLandscape(
|
bool UMapGeneratorWidget::ApplyHeightMapToLandscape(
|
||||||
FAssetData& WorldAssetData,
|
FAssetData& WorldAssetData,
|
||||||
FMapGeneratorTileMetaInfo TileMetaInfo
|
FMapGeneratorTileMetaInfo TileMetaInfo)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
UWorld* World;
|
UWorld* World;
|
||||||
UObjectRedirector* BaseMapRedirector =
|
UObjectRedirector* BaseMapRedirector =
|
||||||
|
@ -171,8 +154,7 @@ bool UMapGeneratorWidget::ApplyHeightMapToLandscape(
|
||||||
}
|
}
|
||||||
ALandscape* landscape = (ALandscape*) UGameplayStatics::GetActorOfClass(
|
ALandscape* landscape = (ALandscape*) UGameplayStatics::GetActorOfClass(
|
||||||
World,
|
World,
|
||||||
ALandscape::StaticClass()
|
ALandscape::StaticClass());
|
||||||
);
|
|
||||||
AssignLandscapeHeightMap(landscape, TileMetaInfo);
|
AssignLandscapeHeightMap(landscape, TileMetaInfo);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,8 +184,7 @@ FString UProceduralWaterManager::LakeGeneration(const FProceduralRiversMetaInfo
|
||||||
FVector Location(
|
FVector Location(
|
||||||
MetaInfo.CustomScaleFactor*CenterX,
|
MetaInfo.CustomScaleFactor*CenterX,
|
||||||
MetaInfo.CustomScaleFactor*CenterY,
|
MetaInfo.CustomScaleFactor*CenterY,
|
||||||
CenterZ
|
CenterZ);
|
||||||
);
|
|
||||||
|
|
||||||
Location += MetaInfo.CustomLocationOffset;
|
Location += MetaInfo.CustomLocationOffset;
|
||||||
|
|
||||||
|
@ -194,8 +193,7 @@ FString UProceduralWaterManager::LakeGeneration(const FProceduralRiversMetaInfo
|
||||||
FVector Scale(
|
FVector Scale(
|
||||||
MetaInfo.CustomRiverWidth * SizeX,
|
MetaInfo.CustomRiverWidth * SizeX,
|
||||||
MetaInfo.CustomRiverWidth * SizeY,
|
MetaInfo.CustomRiverWidth * SizeY,
|
||||||
1.0f
|
1.0f);
|
||||||
);
|
|
||||||
|
|
||||||
LakeActor->SetActorScale3D(Scale);
|
LakeActor->SetActorScale3D(Scale);
|
||||||
LakeActor->SetActorLocationAndRotation(
|
LakeActor->SetActorLocationAndRotation(
|
||||||
|
@ -203,8 +201,7 @@ FString UProceduralWaterManager::LakeGeneration(const FProceduralRiversMetaInfo
|
||||||
Rotation,
|
Rotation,
|
||||||
false,
|
false,
|
||||||
0,
|
0,
|
||||||
ETeleportType::None
|
ETeleportType::None);
|
||||||
);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,8 +226,7 @@ AActor* UProceduralWaterManager::SpawnRiverBlueprintActor()
|
||||||
RiverBlueprintClass,
|
RiverBlueprintClass,
|
||||||
Location,
|
Location,
|
||||||
Rotation,
|
Rotation,
|
||||||
SpawnInfo
|
SpawnInfo);
|
||||||
);
|
|
||||||
|
|
||||||
return RiverActor;
|
return RiverActor;
|
||||||
}
|
}
|
||||||
|
@ -247,8 +243,7 @@ AActor* UProceduralWaterManager::SpawnLakeBlueprintActor()
|
||||||
LakeBlueprintClass,
|
LakeBlueprintClass,
|
||||||
Location,
|
Location,
|
||||||
Rotation,
|
Rotation,
|
||||||
SpawnInfo
|
SpawnInfo);
|
||||||
);
|
|
||||||
|
|
||||||
return LakeActor;
|
return LakeActor;
|
||||||
}
|
}
|
||||||
|
@ -269,8 +264,7 @@ float UProceduralWaterManager::GetLandscapeSurfaceHeight(float x, float y, bool
|
||||||
RayStartingPoint,
|
RayStartingPoint,
|
||||||
RayEndPoint,
|
RayEndPoint,
|
||||||
FCollisionObjectQueryParams(ECollisionChannel::ECC_WorldStatic),
|
FCollisionObjectQueryParams(ECollisionChannel::ECC_WorldStatic),
|
||||||
FCollisionQueryParams()
|
FCollisionQueryParams());
|
||||||
);
|
|
||||||
|
|
||||||
// Draw debug line.
|
// Draw debug line.
|
||||||
if (bDrawDebugLines)
|
if (bDrawDebugLines)
|
||||||
|
@ -288,8 +282,7 @@ float UProceduralWaterManager::GetLandscapeSurfaceHeight(float x, float y, bool
|
||||||
true,
|
true,
|
||||||
5.f,
|
5.f,
|
||||||
0.f,
|
0.f,
|
||||||
10.f
|
10.f);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return Z Location.
|
// Return Z Location.
|
||||||
|
|
Loading…
Reference in New Issue