Split some useful bits from CncIngameMenuLogic into CncWidgetUtils for use elsewhere

This commit is contained in:
Paul Chote
2011-07-26 21:59:16 +12:00
parent 648979c8ae
commit 304601b5ca
7 changed files with 94 additions and 80 deletions

View File

@@ -35,7 +35,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
.Fade(CncMenuPaletteEffect.EffectType.Desaturated);
rootMenu = widget.GetWidget("MENU_BACKGROUND");
rootMenu.GetWidget<LabelWidget>("VERSION_LABEL").GetText = ActiveModVersion;
rootMenu.GetWidget<LabelWidget>("VERSION_LABEL").GetText = CncWidgetUtils.ActiveModVersion;
// Menu buttons
var mainMenu = widget.GetWidget("MAIN_MENU");
@@ -128,13 +128,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
rootMenu.GetWidget<ImageWidget>("RECBLOCK").IsVisible = () => world.FrameNumber / 25 % 2 == 0;
}
static string ActiveModVersion()
{
var mod = Game.modData.Manifest.Mods[0];
return Mod.AllMods[mod].Version;
}
void RemoveShellmapUI()
{
rootMenu.Parent.RemoveChild(rootMenu);