Browse Source

Fix auto-patching and game detection

I also realized that this auto-patching isn't gonna work well, so I should probably resort to file swapping or something
tags/v1.5.0
NorbiPeti 3 years ago
parent
commit
a7d26ebdb8
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      GCMM/MainUtils.cs

+ 3
- 4
GCMM/MainUtils.cs View File

@@ -40,8 +40,7 @@ namespace GCMM
if (line.StartsWith("133062..GAME_PATH=") && line.Contains('/'))
{
gamePathSet = true;
return
$"{line.Substring(0, Math.Max(line.LastIndexOf("TBMM", StringComparison.Ordinal), line.Length))}{(enable ? "TBMM/" : "")}";
return $"{line.Replace("/TBMM/", "/")}{(enable ? "TBMM/" : "")}";
}

return line;
@@ -50,7 +49,7 @@ namespace GCMM
}

return gamePathSet;
}
} //TODO: Setting the game path might not be a good idea because of updates...

public void EnableDisableAutoPatchingWithDialog(bool enable)
{
@@ -73,7 +72,7 @@ namespace GCMM
if (!File.Exists(launcherConfig)) return null;
string path = File.ReadLines(launcherConfig)
.FirstOrDefault(line => line.StartsWith("133062..GAME_PATH="))
?.Substring("133062..GAME_PATH=".Length);
?.Substring("133062..GAME_PATH=".Length).Replace("/TBMM/", "/") + "StandaloneWindows64";
if (path != null && GetExe(path) != null) return path;
return null;
}


Loading…
Cancel
Save