Skip to content

Commit

Permalink
Automatically set the extension version number in oxide from the asse…
Browse files Browse the repository at this point in the history
…mbly version.
  • Loading branch information
dassjosh committed Aug 23, 2024
1 parent 90781dc commit 1d15e5e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Rust.UIFramework/Extension/Oxide/UiFrameworkExtension.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#if OXIDE
using System.Reflection;
using Oxide.Core;
using Oxide.Core.Extensions;

Expand All @@ -9,8 +10,12 @@ public class UiFrameworkExtension : Extension
{
public override string Name => "UiFramework";
public override string Author => "MJSU";
public override VersionNumber Version => new(1, 4, 5);

public UiFrameworkExtension(ExtensionManager manager) : base(manager) { }
public override VersionNumber Version { get; }

public UiFrameworkExtension(ExtensionManager manager) : base(manager)
{
AssemblyName assembly = Assembly.GetExecutingAssembly().GetName();
Version = new VersionNumber(assembly.Version.Major, assembly.Version.Minor, assembly.Version.Build);
}
}
#endif

0 comments on commit 1d15e5e

Please sign in to comment.