From ebce8ab05f55d53d47efc993d6bb48dd0b4315c2 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Thu, 11 Jun 2020 14:01:51 +0200 Subject: [PATCH] refactor: move asm version into Util --- Dalamud/Dalamud.cs | 4 +--- Dalamud/Util.cs | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Dalamud/Dalamud.cs b/Dalamud/Dalamud.cs index 06813c55b..d7e269a8c 100644 --- a/Dalamud/Dalamud.cs +++ b/Dalamud/Dalamud.cs @@ -72,8 +72,6 @@ namespace Dalamud { public bool IsReady { get; private set; } - private readonly string assemblyVersion = Assembly.GetAssembly(typeof(ChatHandlers)).GetName().Version.ToString(); - public Dalamud(DalamudStartInfo info, LoggingLevelSwitch loggingLevelSwitch) { this.StartInfo = info; this.loggingLevelSwitch = loggingLevelSwitch; @@ -283,7 +281,7 @@ namespace Dalamud { var a = Marshal.ReadByte(IntPtr.Zero); } ImGui.Separator(); - ImGui.MenuItem(this.assemblyVersion, false); + ImGui.MenuItem(Util.AssemblyVersion, false); ImGui.MenuItem(this.StartInfo.GameVersion, false); ImGui.EndMenu(); diff --git a/Dalamud/Util.cs b/Dalamud/Util.cs index 36fbd92b6..2c3bb8d7a 100644 --- a/Dalamud/Util.cs +++ b/Dalamud/Util.cs @@ -1,9 +1,8 @@ using System; -using System.Collections.Generic; -using System.Linq; +using System.Reflection; using System.Runtime.InteropServices; using System.Text; -using System.Threading.Tasks; +using Dalamud.Game; using Serilog; namespace Dalamud { @@ -66,5 +65,7 @@ namespace Dalamud { return sb.ToString().TrimEnd(Environment.NewLine.ToCharArray()); } + + public static string AssemblyVersion { get; } = Assembly.GetAssembly(typeof(ChatHandlers)).GetName().Version.ToString(); } }