diff --git a/Reactor/Patches/ReactorVersionShower.cs b/Reactor/Patches/ReactorVersionShower.cs
index 6ed8f2a..16c47df 100644
--- a/Reactor/Patches/ReactorVersionShower.cs
+++ b/Reactor/Patches/ReactorVersionShower.cs
@@ -89,19 +89,14 @@ internal static void Initialize()
}));
}
- private static string ToStringWithoutBuild(Version version)
- {
- return $"{version.Major}.{version.Minor}.{version.Patch}{(version.PreRelease == null ? string.Empty : $"-{version.PreRelease}")}";
- }
-
///
/// Updates with reactor version and fires .
///
public static void UpdateText()
{
if (Text == null) return;
- Text.text = "Reactor " + ReactorPlugin.Version;
- Text.text += "\nBepInEx " + ToStringWithoutBuild(Paths.BepInExVersion);
+ Text.text = "Reactor " + Version.Parse(ReactorPlugin.Version).WithoutBuild();
+ Text.text += "\nBepInEx " + Paths.BepInExVersion.WithoutBuild();
Text.text += "\nMods: " + IL2CPPChainloader.Instance.Plugins.Count;
TextUpdated?.Invoke(Text);
}
diff --git a/Reactor/Utilities/Extensions/VersionExtensions.cs b/Reactor/Utilities/Extensions/VersionExtensions.cs
new file mode 100644
index 0000000..947dd80
--- /dev/null
+++ b/Reactor/Utilities/Extensions/VersionExtensions.cs
@@ -0,0 +1,19 @@
+using SemanticVersioning;
+
+namespace Reactor.Utilities.Extensions;
+
+///
+/// Provides extension methods for .
+///
+public static class VersionExtensions
+{
+ ///
+ /// Gets the provided without the build string (everything after the + symbol like the commit hash is stripped).
+ ///
+ /// The .
+ /// The without build.
+ public static Version WithoutBuild(this Version version)
+ {
+ return new Version(version.Major, version.Minor, version.Patch, version.PreRelease);
+ }
+}
diff --git a/Reactor/Utilities/ReactorPingTracker.cs b/Reactor/Utilities/ReactorPingTracker.cs
index beb8325..0c6d29d 100644
--- a/Reactor/Utilities/ReactorPingTracker.cs
+++ b/Reactor/Utilities/ReactorPingTracker.cs
@@ -82,7 +82,7 @@ public static void Register(Func? shouldShow) where T : BasePlugin
var metadata = pluginInfo.Metadata;
- Register(metadata.Name, metadata.Version.ToString(), metadata.Version.IsPreRelease, shouldShow);
+ Register(metadata.Name, metadata.Version.WithoutBuild().Clean(), metadata.Version.IsPreRelease, shouldShow);
}
internal static string? GetText()