Remove modRules widget logic argument.
This commit is contained in:
@@ -46,9 +46,6 @@ namespace OpenRA
|
|||||||
|
|
||||||
public Widget LoadWidget(WidgetArgs args, Widget parent, MiniYamlNode node)
|
public Widget LoadWidget(WidgetArgs args, Widget parent, MiniYamlNode node)
|
||||||
{
|
{
|
||||||
if (!args.ContainsKey("modRules"))
|
|
||||||
args = new WidgetArgs(args) { { "modRules", modData.DefaultRules } };
|
|
||||||
|
|
||||||
if (!args.ContainsKey("modData"))
|
if (!args.ContainsKey("modData"))
|
||||||
args = new WidgetArgs(args) { { "modData", modData } };
|
args = new WidgetArgs(args) { { "modData", modData } };
|
||||||
|
|
||||||
|
|||||||
@@ -60,9 +60,9 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
protected readonly Ruleset ModRules;
|
protected readonly Ruleset ModRules;
|
||||||
|
|
||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public ButtonWidget(Ruleset modRules)
|
public ButtonWidget(ModData modData)
|
||||||
{
|
{
|
||||||
ModRules = modRules;
|
ModRules = modData.DefaultRules;
|
||||||
|
|
||||||
GetText = () => Text;
|
GetText = () => Text;
|
||||||
GetColor = () => TextColor;
|
GetColor = () => TextColor;
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
public bool HasPressedState = ChromeMetrics.Get<bool>("CheckboxPressedState");
|
public bool HasPressedState = ChromeMetrics.Get<bool>("CheckboxPressedState");
|
||||||
|
|
||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public CheckboxWidget(Ruleset modRules)
|
public CheckboxWidget(ModData modData)
|
||||||
: base(modRules)
|
: base(modData)
|
||||||
{
|
{
|
||||||
GetCheckType = () => CheckType;
|
GetCheckType = () => CheckType;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
public string PanelRoot;
|
public string PanelRoot;
|
||||||
|
|
||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public DropDownButtonWidget(Ruleset modRules)
|
public DropDownButtonWidget(ModData modData)
|
||||||
: base(modRules) { }
|
: base(modData) { }
|
||||||
|
|
||||||
protected DropDownButtonWidget(DropDownButtonWidget widget)
|
protected DropDownButtonWidget(DropDownButtonWidget widget)
|
||||||
: base(widget)
|
: base(widget)
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
bool teamChat;
|
bool teamChat;
|
||||||
|
|
||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public IngameChatLogic(Widget widget, OrderManager orderManager, World world, Ruleset modRules)
|
public IngameChatLogic(Widget widget, OrderManager orderManager, World world, ModData modData)
|
||||||
{
|
{
|
||||||
this.orderManager = orderManager;
|
this.orderManager = orderManager;
|
||||||
this.modRules = modRules;
|
this.modRules = modData.DefaultRules;
|
||||||
|
|
||||||
chatTraits = world.WorldActor.TraitsImplementing<INotifyChat>().ToArray();
|
chatTraits = world.WorldActor.TraitsImplementing<INotifyChat>().ToArray();
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
internal LobbyLogic(Widget widget, ModData modData, WorldRenderer worldRenderer, OrderManager orderManager,
|
internal LobbyLogic(Widget widget, ModData modData, WorldRenderer worldRenderer, OrderManager orderManager,
|
||||||
Action onExit, Action onStart, bool skirmishMode, Ruleset modRules)
|
Action onExit, Action onStart, bool skirmishMode)
|
||||||
{
|
{
|
||||||
MapPreview = MapCache.UnknownMap;
|
MapPreview = MapCache.UnknownMap;
|
||||||
lobby = widget;
|
lobby = widget;
|
||||||
@@ -121,7 +121,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
this.onStart = onStart;
|
this.onStart = onStart;
|
||||||
this.onExit = onExit;
|
this.onExit = onExit;
|
||||||
this.skirmishMode = skirmishMode;
|
this.skirmishMode = skirmishMode;
|
||||||
this.modRules = modRules;
|
|
||||||
|
// TODO: This needs to be reworked to support per-map tech levels, bots, etc.
|
||||||
|
this.modRules = modData.DefaultRules;
|
||||||
shellmapWorld = worldRenderer.World;
|
shellmapWorld = worldRenderer.World;
|
||||||
|
|
||||||
orderManager.AddChatLine += AddChatLine;
|
orderManager.AddChatLine += AddChatLine;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
MusicInfo currentSong = null;
|
MusicInfo currentSong = null;
|
||||||
|
|
||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public MusicPlayerLogic(Widget widget, ModData modData, Ruleset modRules, World world, Action onExit)
|
public MusicPlayerLogic(Widget widget, ModData modData, World world, Action onExit)
|
||||||
{
|
{
|
||||||
var panel = widget;
|
var panel = widget;
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
Game.RunAfterTick(() => Game.InitializeMod("modchooser", new Arguments(args)));
|
Game.RunAfterTick(() => Game.InitializeMod("modchooser", new Arguments(args)));
|
||||||
|
|
||||||
var installData = modData.Manifest.Get<ContentInstaller>();
|
var installData = modData.Manifest.Get<ContentInstaller>();
|
||||||
installButton.IsVisible = () => modRules.InstalledMusic.ToArray().Length <= installData.ShippedSoundtracks;
|
installButton.IsVisible = () => modData.DefaultRules.InstalledMusic.ToArray().Length <= installData.ShippedSoundtracks;
|
||||||
}
|
}
|
||||||
|
|
||||||
var songWatcher = widget.GetOrNull<LogicTickerWidget>("SONG_WATCHER");
|
var songWatcher = widget.GetOrNull<LogicTickerWidget>("SONG_WATCHER");
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
public readonly bool HideIngameUI = true;
|
public readonly bool HideIngameUI = true;
|
||||||
|
|
||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public MenuButtonWidget(Ruleset modRules)
|
public MenuButtonWidget(ModData modData)
|
||||||
: base(modRules) { }
|
: base(modData) { }
|
||||||
|
|
||||||
protected MenuButtonWidget(MenuButtonWidget other)
|
protected MenuButtonWidget(MenuButtonWidget other)
|
||||||
: base(other)
|
: base(other)
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
public readonly string HotkeyName;
|
public readonly string HotkeyName;
|
||||||
|
|
||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public ProductionTypeButtonWidget(Ruleset modRules)
|
public ProductionTypeButtonWidget(ModData modData)
|
||||||
: base(modRules) { }
|
: base(modData) { }
|
||||||
|
|
||||||
protected ProductionTypeButtonWidget(ProductionTypeButtonWidget other)
|
protected ProductionTypeButtonWidget(ProductionTypeButtonWidget other)
|
||||||
: base(other)
|
: base(other)
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
public string BaseName = "scrollitem";
|
public string BaseName = "scrollitem";
|
||||||
|
|
||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public ScrollItemWidget(Ruleset modRules)
|
public ScrollItemWidget(ModData modData)
|
||||||
: base(modRules)
|
: base(modData)
|
||||||
{
|
{
|
||||||
IsVisible = () => false;
|
IsVisible = () => false;
|
||||||
VisualHeight = 0;
|
VisualHeight = 0;
|
||||||
|
|||||||
@@ -86,9 +86,9 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
}
|
}
|
||||||
|
|
||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public ScrollPanelWidget(Ruleset modRules)
|
public ScrollPanelWidget(ModData modData)
|
||||||
{
|
{
|
||||||
this.modRules = modRules;
|
this.modRules = modData.DefaultRules;
|
||||||
|
|
||||||
Layout = new ListLayout(this);
|
Layout = new ListLayout(this);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user