Skip to content

Commit

Permalink
Fixed formatted filename
Browse files Browse the repository at this point in the history
  • Loading branch information
Emik03 committed Apr 5, 2021
1 parent f921db8 commit 193b63f
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions lib/src/PathManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ public static string GetModInfoPath(string bundleFileName)

var methodInfo = typeof(ModManager).GetMethod("GetModInfoFromPath", Helper.Flags);

return SetCache(current, ((ModInfo)methodInfo.Invoke(ModManager.Instance, new object[] { GetPath(bundleFileName), ModInfo.ModSourceEnum.Local })).FilePath ??
((ModInfo)methodInfo.Invoke(ModManager.Instance, new object[] { GetPath(bundleFileName), ModInfo.ModSourceEnum.SteamWorkshop })).FilePath ??
((ModInfo)methodInfo.Invoke(ModManager.Instance, new object[] { GetPath(bundleFileName), ModInfo.ModSourceEnum.Invalid })).FilePath ??
string path = GetPath(FileFormat.Form(bundleFileName, FileExtensionWindows));

return SetCache(current, ((ModInfo)methodInfo.Invoke(ModManager.Instance, new object[] { path, ModInfo.ModSourceEnum.Local })).FilePath ??
((ModInfo)methodInfo.Invoke(ModManager.Instance, new object[] { path, ModInfo.ModSourceEnum.SteamWorkshop })).FilePath ??
((ModInfo)methodInfo.Invoke(ModManager.Instance, new object[] { path, ModInfo.ModSourceEnum.Invalid })).FilePath ??
throw new FileNotFoundException(bundleFileName));
}

Expand All @@ -87,9 +89,11 @@ public static string GetModInfoVersion(string bundleFileName)

var methodInfo = typeof(ModManager).GetMethod("GetModInfoFromPath", Helper.Flags);

return SetCache(current, ((ModInfo)methodInfo.Invoke(ModManager.Instance, new object[] { GetPath(bundleFileName), ModInfo.ModSourceEnum.Local })).Version ??
((ModInfo)methodInfo.Invoke(ModManager.Instance, new object[] { GetPath(bundleFileName), ModInfo.ModSourceEnum.SteamWorkshop })).Version ??
((ModInfo)methodInfo.Invoke(ModManager.Instance, new object[] { GetPath(bundleFileName), ModInfo.ModSourceEnum.Invalid })).Version ??
string path = GetPath(FileFormat.Form(bundleFileName, FileExtensionWindows));

return SetCache(current, ((ModInfo)methodInfo.Invoke(ModManager.Instance, new object[] { path, ModInfo.ModSourceEnum.Local })).Version ??
((ModInfo)methodInfo.Invoke(ModManager.Instance, new object[] { path, ModInfo.ModSourceEnum.SteamWorkshop })).Version ??
((ModInfo)methodInfo.Invoke(ModManager.Instance, new object[] { path, ModInfo.ModSourceEnum.Invalid })).Version ??
throw new FileNotFoundException(bundleFileName));
}

Expand Down Expand Up @@ -137,7 +141,7 @@ public static void LoadLibrary(string bundleFileName, string libraryFileName)

string path = GetPath(FileFormat.Form(bundleFileName, FileExtensionWindows));

Debug.Log($"[Keep Coding So Nobody Explodes] The path to load {libraryFileName} as called from {bundleFileName} is: {path}.");
Log($"The path to load {libraryFileName} as called from {bundleFileName} is: {path}.");

CopyLibrary(libraryFileName, path);
}
Expand Down Expand Up @@ -190,5 +194,7 @@ private static string GetDisabledPath(string fileName)

return null;
}

private static void Log(string message) => Debug.Log($"[Keep Coding So Nobody Explodes] {message}");
}
}

0 comments on commit 193b63f

Please sign in to comment.