Add support for multiple logic objects on a widget.
This commit is contained in:
@@ -143,8 +143,8 @@ namespace OpenRA.Widgets
|
|||||||
public string Y = "0";
|
public string Y = "0";
|
||||||
public string Width = "0";
|
public string Width = "0";
|
||||||
public string Height = "0";
|
public string Height = "0";
|
||||||
public string Logic = null;
|
public string[] Logic = { };
|
||||||
public object LogicObject { get; private set; }
|
public object[] LogicObjects { get; private set; }
|
||||||
public bool Visible = true;
|
public bool Visible = true;
|
||||||
public bool IgnoreMouseOver;
|
public bool IgnoreMouseOver;
|
||||||
public bool IgnoreChildMouseOver;
|
public bool IgnoreChildMouseOver;
|
||||||
@@ -232,12 +232,13 @@ namespace OpenRA.Widgets
|
|||||||
|
|
||||||
public void PostInit(WidgetArgs args)
|
public void PostInit(WidgetArgs args)
|
||||||
{
|
{
|
||||||
if (Logic == null)
|
if (!Logic.Any())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
args["widget"] = this;
|
args["widget"] = this;
|
||||||
|
|
||||||
LogicObject = Game.ModData.ObjectCreator.CreateObject<object>(Logic, args);
|
LogicObjects = Logic.Select(l => Game.ModData.ObjectCreator.CreateObject<object>(l, args))
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
args.Remove("widget");
|
args.Remove("widget");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user