diff --git a/src/BAUPlugin.cs b/src/BAUPlugin.cs index 88b05a4..1c31fba 100644 --- a/src/BAUPlugin.cs +++ b/src/BAUPlugin.cs @@ -42,7 +42,7 @@ internal class BAUPlugin : BasePlugin text = $"v{BetterAmongUsVersion}{newLineText}Beta {ModInfo.BetaNum}"; break; case ReleaseTypes.Dev: - text = $"v{BetterAmongUsVersion}{newLineText}Dev {ModInfo.ReleaseDate}"; + text = $"v{BetterAmongUsVersion}{newLineText}Dev {ModInfo.CommitHash}-{ModInfo.BuildDate}"; break; default: break; @@ -106,7 +106,7 @@ internal class BAUPlugin : BasePlugin Logger_.Log("Better Among Us successfully loaded!"); string SupportedVersions = string.Join(" ", SupportedAmongUsVersions); - Logger_.Log($"BetterAmongUs {BetterAmongUsVersion}-{ModInfo.ReleaseDate} - [{AppVersion} --> {SupportedVersions}] {Utils.GetPlatformName(PlatformData.Platform)}"); + Logger_.Log($"BetterAmongUs {BetterAmongUsVersion}-{ModInfo.BuildDate} - [{AppVersion} --> {SupportedVersions}] {Utils.GetPlatformName(PlatformData.Platform)}"); } catch (Exception ex) { diff --git a/src/BetterAmongUs.csproj b/src/BetterAmongUs.csproj index 634c239..23c863e 100644 --- a/src/BetterAmongUs.csproj +++ b/src/BetterAmongUs.csproj @@ -7,10 +7,27 @@ preview - + + unknown + $([System.DateTime]::UtcNow.ToString(MM.dd.yyyy)) true false + + + + + + <_Parameter1>CommitHash + <_Parameter2>$(CommitHash) + + + <_Parameter1>BuildDate + <_Parameter2>$(BuildDate) + + + + build\mod_folder_path $([System.IO.File]::ReadAllText('$(ModPathFile)').Trim()) $(GamePath) @@ -28,6 +45,7 @@ + @@ -37,8 +55,8 @@ + - \ No newline at end of file diff --git a/src/ModInfo.cs b/src/ModInfo.cs index 042ddb6..025e937 100644 --- a/src/ModInfo.cs +++ b/src/ModInfo.cs @@ -1,4 +1,6 @@ -namespace BetterAmongUs; +using System.Reflection; + +namespace BetterAmongUs; internal static class ModInfo { @@ -9,7 +11,17 @@ internal static class ModInfo internal const string PluginName = "BetterAmongUs"; internal const string PluginGuid = "com.d1gq.betteramongus"; internal const string PluginVersion = "1.3.1"; - internal const string ReleaseDate = "01.09.2026"; // mm/dd/yyyy internal const string Github = "https://github.com/D1GQ/BetterAmongUs-Public"; internal const string Discord = "https://discord.gg/vjYrXpzNAn"; + public static string CommitHash => GetAssemblyMetadata("CommitHash"); + public static string BuildDate => GetAssemblyMetadata("BuildDate"); + + private static string GetAssemblyMetadata(string key) + { + var attribute = Assembly.GetExecutingAssembly() + .GetCustomAttributes() + .FirstOrDefault(a => a.Key == key); + + return attribute?.Value ?? "unknown"; + } } \ No newline at end of file