Skip to content

Commit 6094fe0

Browse files
committed
[Addition] Installed mods and their versions are displayed in main menu now
1 parent 862a30e commit 6094fe0

File tree

5 files changed

+11
-2
lines changed

5 files changed

+11
-2
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# RL2.ModLoader Changelog
22

3+
# v1.0.4
4+
### Additions:
5+
- All installed mods and their versions are displayed below the RL2.ModLoader version number
6+
37
# v1.0.3
48
### Changes:
59
- All RL2.ModLoader detours now have their own IDs

RL2.ModLoader/BuiltinEndpoints.cs

100755100644
File mode changed.

RL2.ModLoader/ConsoleHook.cs

100755100644
File mode changed.

RL2.ModLoader/ModLoader.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public partial class ModLoader
1616
/// <summary>
1717
/// <see href="SemVersion"/> object representing the modloaders version
1818
/// </summary>
19-
public static readonly SemVersion ModLoaderVersion = new SemVersion(1, 0, 3);
19+
public static readonly SemVersion ModLoaderVersion = new SemVersion(1, 0, 4);
2020

2121
/// <summary>
2222
/// Path to directory containing all mods

RL2.ModLoader/ModLoaderDetours.cs

100755100644
+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using MonoMod.RuntimeDetour;
22
using System;
3+
using System.Collections.Generic;
34
using System.Reflection;
45

56
namespace RL2.ModLoader;
@@ -9,7 +10,11 @@ public partial class ModLoader
910
public static Hook VersionDisplay = new Hook(
1011
typeof(System_EV).GetMethod("GetVersionString", BindingFlags.Public | BindingFlags.Static),
1112
(Func<string> orig) => {
12-
return orig() + "\nRL2.ModLoader v." + ModLoaderVersion.ToString();
13+
List<string> loaded = [];
14+
foreach (KeyValuePair<string, SemVersion> entry in LoadedModNamesToVersions) {
15+
loaded.Add($"{entry.Key} v{entry.Value}");
16+
}
17+
return orig() + "\nRL2.ModLoader v." + ModLoaderVersion.ToString() + "\n" + string.Join("\n", loaded);
1318
},
1419
new HookConfig() {
1520
ID = "RL2.ModLoader::VersionDisplay"

0 commit comments

Comments
 (0)