Skip to content

Commit 6fb110d

Browse files
committed
Version update,
dropped support for *.dll patches, only *.ipatch extension is supported Improved detection of local mods directory on MacOS
1 parent c2c853e commit 6fb110d

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

PatchLoader/PatchScanner.cs

+11-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public List<KeyValuePair<string, IPatch>> Scan(string path) {
2424
string[] directories = Directory.GetDirectories(path, "*");
2525
for (var i = 0; i < directories.Length; i++) {
2626
if (!Path.GetFileName(directories[i]).StartsWith("_")) {
27-
assemblies.AddRange(Directory.GetFiles(directories[i], "*.dll", SearchOption.AllDirectories));
27+
assemblies.AddRange(GetFiles(directories[i], "*.ipatch", SearchOption.AllDirectories));
2828
} else {
2929
_logger.Info($"Ignored Inactive mod path {directories[i]}");
3030
}
@@ -101,5 +101,15 @@ private bool ImplementsIPatch(string file) {
101101

102102
return hit;
103103
}
104+
105+
public static string[] GetFiles(string path, string searchPattern, SearchOption searchOption)
106+
{
107+
string[] searchPatterns = searchPattern.Split('|');
108+
List<string> files = new List<string>();
109+
foreach (string sp in searchPatterns)
110+
files.AddRange(Directory.GetFiles(path, sp, searchOption));
111+
files.Sort();
112+
return files.ToArray();
113+
}
104114
}
105115
}

PatchLoader/Paths.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static Paths Create() {
4545

4646
var appDataModsPath = "";
4747
if (isMac) {
48-
appDataModsPath = PathExtensions.Combine(new DirectoryInfo(workingPath).Parent.Parent.FullName, "Addons", "Mods");
48+
appDataModsPath = PathExtensions.Combine(new DirectoryInfo(workingPath).Parent.Parent.Parent.Parent.Parent.Parent.FullName, "Colossal Order", "Cities_Skylines", "Addons", "Mods");
4949
} else {
5050
appDataModsPath = PathExtensions.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Colossal Order", "Cities_Skylines", "Addons", "Mods");
5151
}

PatchLoader/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("1.0.0.0")]
35-
[assembly: AssemblyFileVersion("1.0.0.0")]
34+
[assembly: AssemblyVersion("2.0.0.0")]
35+
[assembly: AssemblyFileVersion("2.0.0.0")]

0 commit comments

Comments
 (0)