diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameMenuLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameMenuLogic.cs index 9c38508442..bbc7160dd5 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameMenuLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameMenuLogic.cs @@ -9,10 +9,11 @@ #endregion using System; -using OpenRA.Mods.RA.Activities; -using OpenRA.Widgets; -using OpenRA.Traits; using System.Linq; +using OpenRA.FileFormats; +using OpenRA.Traits; +using OpenRA.Widgets; +using OpenRA.Mods.RA.Activities; namespace OpenRA.Mods.Cnc.Widgets.Logic { @@ -30,6 +31,8 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic var mpe = world.WorldActor.Trait(); mpe.Fade(CncMenuPaletteEffect.EffectType.Desaturated); + menu.GetWidget("VERSION_LABEL").GetText = ActiveModVersion; + bool hideButtons = false; menu.GetWidget("MENU_BUTTONS").IsVisible = () => !hideButtons; @@ -92,7 +95,13 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic if (iop != null && iop.ObjectivesPanel != null) Game.OpenWindow(world, iop.ObjectivesPanel); } - + + static string ActiveModVersion() + { + var mod = Game.modData.Manifest.Mods[0]; + return Mod.AllMods[mod].Version; + } + public void PromptConfirmAction(string title, string text, Action onConfirm, Action onCancel) { var prompt = Widget.OpenWindow("CONFIRM_PROMPT"); diff --git a/mods/cnc/chrome/ingamemenu.yaml b/mods/cnc/chrome/ingamemenu.yaml index 4775705f7f..32bc57e440 100644 --- a/mods/cnc/chrome/ingamemenu.yaml +++ b/mods/cnc/chrome/ingamemenu.yaml @@ -11,6 +11,13 @@ Container@INGAME_MENU: Height:64 ImageCollection:logos ImageName:eva + Label@VERSION_LABEL: + Id:VERSION_LABEL + X:WINDOW_RIGHT-128-43 + Y:115 + Width:128 + Align:Center + Contrast:true Background@BORDER: Width:WINDOW_RIGHT Height:WINDOW_BOTTOM