Add new map editor UI.

This commit is contained in:
Paul Chote
2015-04-06 14:57:13 +01:00
parent d211fe9fe1
commit 469f47aeea
28 changed files with 2142 additions and 11 deletions

View File

@@ -23,6 +23,9 @@ namespace OpenRA.Mods.Common.Traits
[Desc("The widget tree to open when a regular map is loaded (i.e. the ingame UI).")]
public readonly string IngameRoot = "INGAME_ROOT";
[Desc("The widget tree to open when the map editor is loaded.")]
public readonly string EditorRoot = "EDITOR_ROOT";
[Desc("Remove any existing UI when a map is loaded.")]
public readonly bool ClearRoot = true;
@@ -44,7 +47,9 @@ namespace OpenRA.Mods.Common.Traits
if (info.ClearRoot)
Ui.ResetAll();
var widget = world.Type == WorldType.Shellmap ? info.ShellmapRoot : info.IngameRoot;
var widget = world.Type == WorldType.Shellmap ? info.ShellmapRoot :
world.Type == WorldType.Editor ? info.EditorRoot : info.IngameRoot;
Game.LoadWidget(world, widget, Ui.Root, new WidgetArgs());
}
}