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
66 changes: 63 additions & 3 deletions ShinRyuModManager-CE/GameModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
}
}

public static void DoY0DCLegacyModelSupport(MLO mlo) {
public static void DoY0DCLegacyModelUpgrade(MLO mlo) {
var parlessDir = new DirectoryInfo(GamePath.ParlessDir);

parlessDir.Create();
Expand All @@ -110,12 +110,72 @@
continue;

var legacyCharaDir = Path.Combine(modDir, "chara", "w64");

if (!Directory.Exists(legacyCharaDir))
continue;

var newCharaDir = Path.Combine(parlessDir.FullName, "chara", "ngen");

for (var i = 0; i < mlo.Files.Count; i++) {
var file = mlo.Files[i];

if (file.Name.Contains("chara/w64"))
file = file with {
Name = file.Name.Replace("chara/w64", "chara/ngen")
};

mlo.Files[i] = file;
}

if (!Directory.Exists(legacyCharaDir))
Directory.Move(legacyCharaDir, newCharaDir);
}
}

public static void DoYK2RemasterLegacyDBUpgrade(MLO mlo) {

Check failure on line 134 in ShinRyuModManager-CE/GameModel.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this method to reduce its Cognitive Complexity from 23 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=TheTrueColonel_ShinRyuModManager-CE&issues=AZsQFtwX0CJpDpy9cZHB&open=AZsQFtwX0CJpDpy9cZHB&pullRequest=23
var parlessDir = new DirectoryInfo(GamePath.ParlessDir);

parlessDir.Create();

foreach (var modName in mlo.Mods) {
var modDir = Path.Combine(GamePath.ModsPath, modName);

if (!Directory.Exists(modDir))
continue;

var legacyDBDir = Path.Combine(modDir, "db");
var newDBDir = Path.Combine(modDir, "db.lexus2");

var legacyPUIDDir = Path.Combine(modDir, "puid");
var newPUIDDir = Path.Combine(modDir, "puid.lexus2");

var haveOldDb = Directory.Exists(legacyDBDir);
var haveOldPuid = Directory.Exists(legacyPUIDDir);

if (haveOldDb || haveOldPuid) {
for (var i = 0; i < mlo.Files.Count; i++) {
var file = mlo.Files[i];

if (haveOldDb && file.Name.Contains("/db") && !file.Name.Contains("/db.lexus2")) {
file = file with {
Name = file.Name.Replace("/db", "/db.lexus2")
};
}

if (haveOldPuid && file.Name.Contains("/puid") && !file.Name.Contains("/puid.lexus2")) {
file = file with {
Name = file.Name.Replace("/puid", "/puid.lexus2")
};
}

mlo.Files[i] = file;
}
}

if (haveOldDb)
Directory.Move(legacyDBDir, newDBDir);

Utils.CopyDirectory(legacyCharaDir, newCharaDir);
if (haveOldPuid)
Directory.Move(legacyPUIDDir, newPUIDDir);
}
}

Expand Down
4 changes: 2 additions & 2 deletions ShinRyuModManager-CE/ModLoadOrder/Mods/Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void AddFiles(string path, string check) {

switch (basename) {
case "bgm":
if (GamePath.CurrentGame <= Game.YakuzaKiwami) {
if (GamePath.CurrentGame <= Game.YakuzaKiwami_R) {
cpkDataPath = GamePath.RemoveModPath(path);
RepackCpKs.Add(cpkDataPath);
}
Expand All @@ -134,7 +134,7 @@ public void AddFiles(string path, string check) {

case "se":
case "speech":
if (GamePath.CurrentGame is Game.Yakuza5 or <= Game.YakuzaKiwami) {
if (GamePath.CurrentGame is Game.Yakuza5 or <= Game.YakuzaKiwami_R) {
// Removed adding ".cpk" to se folder. Seemed incorrect
cpkDataPath = GamePath.RemoveModPath(path);
RepackCpKs.Add(cpkDataPath);
Expand Down
14 changes: 10 additions & 4 deletions ShinRyuModManager-CE/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,20 +328,26 @@ internal static async Task RunGeneration(List<string> mods) {
GameModel.DoY5HActProcedure(result);
break;

case Game.Yakuza0_DC:
case Game.Yakuza0:
case Game.YakuzaKiwami:
GameModel.DoOEHActProcedure(result);
GameModel.DoY0DCLegacyModelSupport(result);
break;

case Game.Yakuza0:
case Game.YakuzaKiwami:
case Game.Yakuza0_DC:
case Game.YakuzaKiwami_R:
GameModel.DoOEHActProcedure(result);
GameModel.DoY0DCLegacyModelUpgrade(result);
break;

case Game.YakuzaKiwami2:
GameModel.DoDEHActProcedure(result, "lexus2");
break;

case Game.YakuzaKiwami2_R:
GameModel.DoDEHActProcedure(result, "lexus2");
GameModel.DoYK2RemasterLegacyDBUpgrade(result);
break;

case Game.Judgment:
GameModel.DoDEHActProcedure(result, "judge");
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.3.2</AssemblyVersion>
<AssemblyVersion>1.3.3</AssemblyVersion>
<VersionPrefix>$(AssemblyVersion)</VersionPrefix>
<AssemblyTitle>ShinRyuModManager-CE</AssemblyTitle>
<Company>SRMM Studio</Company>
Expand Down
3 changes: 3 additions & 0 deletions ShinRyuModManager-CE/UserInterface/Assets/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
> ### **%{color:orange} Version 1.3.3 %** ###
* Implemented changes from SRMM 4.6.9

> ### **%{color:orange} Version 1.3.2 %** ###
* Implemented changes from SRMM 4.6.8

Expand Down
2 changes: 2 additions & 0 deletions Utils/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ public enum Game {
Yakuza0,
Yakuza0_DC,
YakuzaKiwami,
YakuzaKiwami_R,

// Dragon Engine
Yakuza6,
YakuzaKiwami2,
YakuzaKiwami2_R,
YakuzaLikeADragon,
Judgment,
LostJudgment,
Expand Down
4 changes: 4 additions & 0 deletions Utils/GamePath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ public static string GetGameFriendlyName(Game g) {
Game.Yakuza0 => "Yakuza 0",
Game.Yakuza0_DC => "Yakuza 0: Director's Cut",
Game.YakuzaKiwami => "Yakuza Kiwami",
Game.YakuzaKiwami_R => "Yakuza Kiwami Remastered",
Game.YakuzaKiwami2 => "Yakuza Kiwami 2",
Game.YakuzaKiwami2_R => "Yakuza Kiwami 2 Remastered",
Game.Yakuza3 => "Yakuza 3 Remastered",
Game.Yakuza4 => "Yakuza 4 Remastered",
Game.Yakuza5 => "Yakuza 5 Remastered",
Expand All @@ -233,7 +235,9 @@ public static string GetGameFriendlyName(Game g) {
Game.Yakuza0 => 638970,
Game.Yakuza0_DC => 2988580,
Game.YakuzaKiwami => 834530,
Game.YakuzaKiwami_R => 3717330,
Game.YakuzaKiwami2 => 927380,
Game.YakuzaKiwami2_R => 3717340,
Game.Yakuza3 => 1088710,
Game.Yakuza4 => 1105500,
Game.Yakuza5 => 1105510,
Expand Down
Loading