Skip to content
This repository was archived by the owner on Jun 10, 2022. It is now read-only.

Commit de70501

Browse files
authored
Merge pull request #37 from TGEnigma/main
Add P5S PC linkdata filelist
2 parents 94b1cde + 42d0dc7 commit de70501

3 files changed

Lines changed: 900 additions & 2 deletions

File tree

Cethleann/Cethleann.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
</ItemGroup>
2929

3030
<ItemGroup>
31+
<None Update="filelist-P5SPC-link.csv">
32+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
33+
</None>
3134
<None Update="TXTH\.ktgcadpcm.txth">
3235
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
3336
</None>

Cethleann/ManagedFS/Flayn.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ public string GetFilename(int index, string? ext = "bin", DataType dataType = Da
190190
id = GameId switch
191191
{
192192
"ThreeHouses" => $"{(i == 0 ? string.Empty : "DLC_")}{localId}",
193+
"P5SPC" => $"{localId}",
193194
_ => $"{linkname}_{localId}"
194195
};
195196
prefix = GameId switch
@@ -200,8 +201,19 @@ public string GetFilename(int index, string? ext = "bin", DataType dataType = Da
200201
break;
201202
}
202203

203-
if (!FileList.TryGetValue(id, out var path)) path = ext == "bin" || ext == "bin.gz" ? $"misc/unknown/{generatedPrefix}{localId}.{ext}" : $"misc/formats/{ext.ToUpper().Replace('.', '_')}/{generatedPrefix}{localId}.{ext}";
204-
else path = Path.Combine(Path.GetDirectoryName(path) ?? string.Empty, Path.GetFileNameWithoutExtension(path) + $".{ext}");
204+
if (!FileList.TryGetValue(id, out var path))
205+
{
206+
path = ext == "bin" || ext == "bin.gz" ? $"misc/unknown/{generatedPrefix}{localId}.{ext}" : $"misc/formats/{ext.ToUpper().Replace('.', '_')}/{generatedPrefix}{localId}.{ext}";
207+
}
208+
else
209+
{
210+
ext = GameId switch
211+
{
212+
"P5SPC" => Path.GetExtension(path) ?? ext,
213+
_ => $".{ext}"
214+
};
215+
path = Path.Combine(Path.GetDirectoryName(path) ?? string.Empty, Path.GetFileNameWithoutExtension(path) + $"{ext}");
216+
}
205217
if (ext.EndsWith(".gz") && !path.EndsWith(".gz")) path += ".gz";
206218
return $@"{prefix}\{path}";
207219
}

0 commit comments

Comments
 (0)