Now the TilesInfo.txt file is searched only in the destination map folder

This commit is contained in:
bernatx 2023-03-07 08:47:48 +01:00 committed by bernat
parent 777b174a08
commit 34469375c7
2 changed files with 10 additions and 5 deletions

View File

@ -2,6 +2,7 @@
* Fixed bug causing the TM's unstuck logic to incorrectly remove the vehicles in some situations. * Fixed bug causing the TM's unstuck logic to incorrectly remove the vehicles in some situations.
* Fixed the extra data in Directx textures, so we need to copy row by row on Windows to remove extra bytes on images * Fixed the extra data in Directx textures, so we need to copy row by row on Windows to remove extra bytes on images
* Fixed the import script, where could use any other TilesInfo.txt if the destination folder has many
* Restored gamma value to 2.2 instead of 2.4 * Restored gamma value to 2.2 instead of 2.4
* Added API function to avoid replaying the spectator * Added API function to avoid replaying the spectator
* `Client.set_replayer_ignore_spectator(bool)` * `Client.set_replayer_ignore_spectator(bool)`

View File

@ -143,7 +143,7 @@ void ULoadAssetMaterialsCommandlet::ApplyRoadPainterMaterials(const FString &Loa
// Acquire the TilesInfo.txt file for storing the tile data (offset and size) // Acquire the TilesInfo.txt file for storing the tile data (offset and size)
TArray<FString> FileList; TArray<FString> FileList;
IFileManager::Get().FindFilesRecursive(FileList, *(FPaths::ProjectContentDir() + "/" + PackageName), *(FString("TilesInfo.txt")), true, false, false); IFileManager::Get().FindFilesRecursive(FileList, *(FPaths::ProjectContentDir() + "/" + PackageName + "/Maps/" + MapName), *(FString("TilesInfo.txt")), true, false, false);
FString TxtFile; FString TxtFile;
if (FFileHelper::LoadFileToString(TxtFile, *FileList[0]) == true) { if (FFileHelper::LoadFileToString(TxtFile, *FileList[0]) == true) {
@ -198,8 +198,11 @@ void ULoadAssetMaterialsCommandlet::ApplyRoadPainterMaterials(const FString &Loa
float MaxYSizeCm = MaxYSize * 100.0f; float MaxYSizeCm = MaxYSize * 100.0f;
float TileSizeCm = TileData.Size * 100.0f; float TileSizeCm = TileData.Size * 100.0f;
float TileWorldLocationX = TileData.FirstTileCenterX * 100.0f; float FirstTileWorldLocationX = TileData.FirstTileCenterX * 100.0f;
float TileWorldLocationY = TileData.FirstTileCenterY * 100.0f; float FirstTileWorldLocationY = TileData.FirstTileCenterY * 100.0f;
float CenterOfTileX = FirstTileWorldLocationX + (XIndex * TileSizeCm);
float CenterOfTileY = FirstTileWorldLocationY - (YIndex * TileSizeCm);
for (int32 i = 0; i < DecalsProperties.DecalMaterials.Num(); ++i) { for (int32 i = 0; i < DecalsProperties.DecalMaterials.Num(); ++i) {
@ -224,8 +227,9 @@ void ULoadAssetMaterialsCommandlet::ApplyRoadPainterMaterials(const FString &Loa
// Transform the location from world coords to tile coordinates. // Transform the location from world coords to tile coordinates.
// The location we get is the location of the XODR waypoint, which is in WORLD coordinates // The location we get is the location of the XODR waypoint, which is in WORLD coordinates
// The Y coordinates are reversed! -Y = Y and Y = -Y // The Y coordinates are reversed! -Y = Y and Y = -Y
FinalLocation.X -= TileWorldLocationX + (XIndex * TileSizeCm);
FinalLocation.Y -= TileWorldLocationY - (YIndex * TileSizeCm); FinalLocation.X -= CenterOfTileX;
FinalLocation.Y -= CenterOfTileY;
FActorSpawnParameters SpawnParams; FActorSpawnParameters SpawnParams;
SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;