Skip to content

Commit

Permalink
Amend the mod version displaying
Browse files Browse the repository at this point in the history
  • Loading branch information
KSP-TaxiService committed Feb 23, 2020
1 parent 806152b commit d0bb32d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CommNetConstellation/UI/AbstractDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ private PopupDialog spawnDialog()
footer = new DialogGUIBase[]
{
new DialogGUIFlexibleSpace(),
new DialogGUILabel(string.Format("v{0}.{1}", CNCSettings.Instance.MajorVersion, CNCSettings.Instance.MinorVersion), false, false)
new DialogGUILabel(GameUtils.Version, false, false)
};
dialogComponentList.Add(new DialogGUIHorizontalLayout(footer));
}
Expand All @@ -228,7 +228,7 @@ private PopupDialog spawnDialog()
new DialogGUIFlexibleSpace(),
new DialogGUIButton(dismissButtonText, dismiss),
new DialogGUIFlexibleSpace(),
new DialogGUILabel(string.Format("v{0}.{1}", CNCSettings.Instance.MajorVersion, CNCSettings.Instance.MinorVersion), false, false)
new DialogGUILabel(GameUtils.Version, false, false)
};
dialogComponentList.Add(new DialogGUIHorizontalLayout(footer));
}
Expand Down
14 changes: 14 additions & 0 deletions src/CommNetConstellation/UI/GameUtils.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;

namespace CommNetConstellation.UI
{
Expand Down Expand Up @@ -135,5 +137,17 @@ public static double NonLinqMax(List<double> list)
}
return max;
}

/// <summary>
/// Returns the current AssemplyFileVersion from AssemblyInfos.cs
/// </summary>
public static string Version
{
get
{
Assembly executableAssembly = Assembly.GetExecutingAssembly();
return "v" + FileVersionInfo.GetVersionInfo(executableAssembly.Location).ProductVersion;
}
}
}
}

0 comments on commit d0bb32d

Please sign in to comment.