Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CpkTools/CpkTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

<ItemGroup>
<PackageReference Include="CommunityToolkit.HighPerformance" Version="8.4.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="10.0.1" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions CpkTools/Model/Cpk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ public sealed class Cpk {
private Memory<byte> _tocPacket;
private Memory<byte> _itocPacket;
private Memory<byte> _etocPacket;
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
private Memory<byte> _gtocPacket;
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
private ulong _tocOffset = ulong.MaxValue;
private ulong _etocOffset = ulong.MaxValue;
private ulong _itocOffset = ulong.MaxValue;
Expand Down
1 change: 0 additions & 1 deletion ParLibrary/ParLibrary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Text.Encoding.CodePages" Version="10.0.1" />
<PackageReference Include="Yarhl" Version="4.0.0" />
</ItemGroup>

Expand Down
92 changes: 92 additions & 0 deletions ShinRyuModManager-CE/GameModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -401,4 +401,96 @@ public static void DoUBIKProcedure(MLO mlo) {

par.Dispose();
}

public static void DoYK3HActProcedure(MLO mlo, string codename) {
var hactDir = new DirectoryInfo(GamePath.DataPath).EnumerateDirectories().FirstOrDefault(x => x.Name.StartsWith("hact_"))?.FullName;

if (string.IsNullOrEmpty(hactDir))
return;

var haveTalk = mlo.Files.Any(x => x.Name.Contains("/hact_"));

if (!haveTalk)
return;

var rootHActDir = Path.Combine(GamePath.ParlessDir, "hact_" + codename);

Directory.CreateDirectory(rootHActDir);

// This is really bad but it will have to do:
// Get the smallest hact in the hact dir
// Use that as a dummy file.
// Our created pars inf load the game for some reason.
var smallestHAct = new DirectoryInfo(hactDir)
.EnumerateFiles("*.par", SearchOption.TopDirectoryOnly)
.OrderBy(f => f.Length)
.First();

foreach (var mod in mlo.Mods) {
var modPath = GamePath.GetModDirectory(mod);
var hActDirPath = Directory.EnumerateDirectories(modPath).FirstOrDefault(x => x.Contains("hact_"));

if (string.IsNullOrEmpty(hActDirPath))
continue;

var hActDir = new DirectoryInfo(hActDirPath);

foreach (var dir in hActDir.EnumerateDirectories()) {
var dummyParDir = new DirectoryInfo(rootHActDir);

if (!dummyParDir.Exists)
dummyParDir.Create();

var dummyParPath = new FileInfo(Path.Combine(dummyParDir.FullName, dir.Name + ".par"));
File.Copy(smallestHAct.FullName, dummyParPath.FullName, true);
}
}
}

public static void DoTalkProcedureYK3(MLO mlo, string codename) {
var hactDir = new DirectoryInfo(GamePath.DataPath).GetDirectories().FirstOrDefault(x => x.Name.StartsWith("hact_"))?.FullName;

if (string.IsNullOrEmpty(hactDir))
return;

var haveTalk = mlo.Files.Any(x => x.Name.Contains("/talk_"));

if (!haveTalk)
return;

var rootTalkDir = Path.Combine(GamePath.ParlessDir, "talk_" + codename);

if (!Directory.Exists(rootTalkDir))
Directory.CreateDirectory(rootTalkDir);

//This is really bad but it will have to do:
//Get the smallest hact in the hact dir
//Use that as a dummy file.
//Our created pars inf load the game for some reason.
var smallestHAct = new DirectoryInfo(hactDir)
.GetFiles("*.par", SearchOption.TopDirectoryOnly)
.OrderBy(f => f.Length)
.First();

foreach (var mod in mlo.Mods) {
var modPath = GamePath.GetModDirectory(mod);
var talkDirs = Directory.EnumerateDirectories(modPath).Where(x => x.Contains("talk_"));

foreach (var modTalkDir in talkDirs) {
var talksDirs = new DirectoryInfo(modTalkDir).EnumerateDirectories();

foreach (var talkCategory in talksDirs) {
foreach (var talkDir in talkCategory.EnumerateDirectories()) {
var dummyParDir = new DirectoryInfo(Path.Combine(rootTalkDir, talkCategory.Name));

if (!dummyParDir.Exists)
dummyParDir.Create();

var dummyParPath = new FileInfo(Path.Combine(dummyParDir.FullName, talkDir.Name + ".par"));
File.Copy(smallestHAct.FullName, dummyParPath.FullName, true);
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion ShinRyuModManager-CE/ModLoadOrder/Mods/Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public void AddFiles(string path, string check) {
}
}

if (GamePath.CurrentGame >= Game.Yakuza6) {
if (GamePath.CurrentGame >= Game.Yakuza6 && GamePath.CurrentGame != Game.YakuzaKiwami3) {
//Dragon Engine talks use pars directly for these
if (path.Contains("talk_")) {
if (char.IsDigit(basename[0]) || check == "cmn") {
Expand Down
3 changes: 2 additions & 1 deletion ShinRyuModManager-CE/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ internal static async Task RunGeneration(List<ModInfo> mods) {
break;

case Game.YakuzaKiwami3:
GameModel.DoDEHActProcedure(result, "bis");
GameModel.DoYK3HActProcedure(result, "bis");
GameModel.DoTalkProcedureYK3(result, "bis");
break;
}

Expand Down
2 changes: 1 addition & 1 deletion ShinRyuModManager-CE/ShinRyuModManager-CE.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>

<!-- Versioning -->
<AssemblyVersion>1.4.1</AssemblyVersion>
<AssemblyVersion>1.4.2</AssemblyVersion>
<VersionPrefix>$(AssemblyVersion)</VersionPrefix>
<AssemblyTitle>ShinRyuModManager-CE</AssemblyTitle>
<Company>SRMM Studio</Company>
Expand Down
7 changes: 6 additions & 1 deletion ShinRyuModManager-CE/UserInterface/Assets/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
> ### **%{color:gold} Version 1.4.1 %** ###
> ### **%{color:gold} Version 1.4.2 %** ###
* Implemented **experimental** Talk and HAct repack methods from SRMM 4.7.6

---

> ### **%{color:orange} Version 1.4.1 %** ###
* Yakuza Kiwami 3 Support
* Fixed PYIH gmt hash lookup
* Fixed bug when removing an installed mod
Expand Down
2 changes: 1 addition & 1 deletion Utils/GamePath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static GamePath() {
ParlessDir = Path.Combine(ModsPath, "Parless");
ExternalModsPath = Path.Combine(ModsPath, Constants.EXTERNAL_MODS);
LibrariesPath = Path.Combine(FullGamePath, LIBRARIES);
LocalLibrariesPath = Path.Combine(GamePath.LibrariesPath, Constants.LIBRARIES_INFO_REPO_FILE_PATH);
LocalLibrariesPath = Path.Combine(LibrariesPath, Constants.LIBRARIES_INFO_REPO_FILE_PATH);

// Try to get game
foreach (var file in Directory.GetFiles(FullGamePath, "*.exe")) {
Expand Down