remove ObjectCreator.Param and all associated nonsense

This commit is contained in:
Chris Forbes
2011-10-21 18:16:07 +13:00
parent 4c8e048c2c
commit 6010034b4a
69 changed files with 120 additions and 213 deletions

View File

@@ -16,10 +16,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
public class ConnectionDialogsLogic
{
[ObjectCreator.UseCtor]
public ConnectionDialogsLogic(
[ObjectCreator.Param] Widget widget,
[ObjectCreator.Param] string host,
[ObjectCreator.Param] int port )
public ConnectionDialogsLogic(Widget widget, string host, int port)
{
widget.GetWidget<ButtonWidget>("CONNECTION_BUTTON_ABORT").OnClick = () => {
widget.GetWidget("CONNECTION_BUTTON_ABORT").Parent.Visible = false;
@@ -37,9 +34,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
public class ConnectionFailedLogic
{
[ObjectCreator.UseCtor]
public ConnectionFailedLogic(
[ObjectCreator.Param] Widget widget,
[ObjectCreator.Param] OrderManager orderManager)
public ConnectionFailedLogic(Widget widget, OrderManager orderManager)
{
widget.GetWidget<ButtonWidget>("CONNECTION_BUTTON_CANCEL").OnClick = () => {
widget.GetWidget("CONNECTION_BUTTON_CANCEL").Parent.Visible = false;

View File

@@ -18,9 +18,10 @@ namespace OpenRA.Mods.RA.Widgets.Logic
public class CreateServerMenuLogic
{
[ObjectCreator.UseCtor]
public CreateServerMenuLogic( [ObjectCreator.Param( "widget" )] Widget cs )
public CreateServerMenuLogic(Widget widget)
{
var settings = Game.Settings;
var cs = widget;
cs.GetWidget<ButtonWidget>("BUTTON_CANCEL").OnClick = () => Widget.CloseWindow();
cs.GetWidget<ButtonWidget>("BUTTON_START").OnClick = () =>

View File

@@ -28,7 +28,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
public class DeveloperModeLogic
{
[ObjectCreator.UseCtor]
public DeveloperModeLogic( [ObjectCreator.Param] World world )
public DeveloperModeLogic(World world)
{
var devmodeBG = Widget.RootWidget.GetWidget("INGAME_ROOT").GetWidget("DEVELOPERMODE_BG");
var devModeButton = Widget.RootWidget.GetWidget<ButtonWidget>("INGAME_DEVELOPERMODE_BUTTON");

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
readonly World world;
[ObjectCreator.UseCtor]
public DiplomacyLogic( [ObjectCreator.Param] World world )
public DiplomacyLogic(World world)
{
this.world = world;
var root = Widget.RootWidget.GetWidget("INGAME_ROOT");

View File

@@ -16,7 +16,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
public class DirectConnectLogic
{
[ObjectCreator.UseCtor]
public DirectConnectLogic( [ObjectCreator.Param] Widget widget )
public DirectConnectLogic(Widget widget)
{
var dc = widget.GetWidget("DIRECTCONNECT_BG");

View File

@@ -26,11 +26,9 @@ namespace OpenRA.Mods.RA.Widgets.Logic
ProgressBarWidget progressBar;
LabelWidget statusLabel;
Action afterInstall;
[ObjectCreator.UseCtor]
public DownloadPackagesLogic([ObjectCreator.Param] Widget widget,
[ObjectCreator.Param] Dictionary<string,string> installData,
[ObjectCreator.Param] Action afterInstall)
public DownloadPackagesLogic(Widget widget, Dictionary<string,string> installData, Action afterInstall)
{
this.installData = installData;
this.afterInstall = afterInstall;

View File

@@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
Widget gameRoot;
[ObjectCreator.UseCtor]
public IngameChromeLogic( [ObjectCreator.Param] World world )
public IngameChromeLogic(World world)
{
Game.AddChatLine += AddChatLine;
Game.BeforeGameStart += UnregisterEvents;

View File

@@ -20,7 +20,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
// WTF duplication
[ObjectCreator.UseCtor]
public IngameObserverChromeLogic([ObjectCreator.Param] World world)
public IngameObserverChromeLogic(World world)
{
Game.AddChatLine += AddChatLine;
Game.BeforeGameStart += UnregisterEvents;

View File

@@ -36,14 +36,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic
readonly WorldRenderer worldRenderer;
[ObjectCreator.UseCtor]
internal LobbyLogic([ObjectCreator.Param( "widget" )] Widget lobby,
[ObjectCreator.Param] World world, // Shellmap world
[ObjectCreator.Param] OrderManager orderManager,
[ObjectCreator.Param] WorldRenderer worldRenderer)
internal LobbyLogic(Widget widget, World world, OrderManager orderManager, WorldRenderer worldRenderer)
{
this.orderManager = orderManager;
this.worldRenderer = worldRenderer;
this.lobby = lobby;
this.lobby = widget;
Game.BeforeGameStart += CloseWindow;
Game.LobbyInfoChanged += UpdateCurrentMap;
Game.LobbyInfoChanged += UpdatePlayerList;

View File

@@ -18,7 +18,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
public class MainMenuButtonsLogic
{
[ObjectCreator.UseCtor]
public MainMenuButtonsLogic([ObjectCreator.Param] Widget widget)
public MainMenuButtonsLogic(Widget widget)
{
Game.modData.WidgetLoader.LoadWidget( new WidgetArgs(), Widget.RootWidget, "PERF_BG" );
widget.GetWidget<ButtonWidget>("MAINMENU_BUTTON_JOIN").OnClick = () => Widget.OpenWindow("JOINSERVER_BG");

View File

@@ -21,12 +21,9 @@ namespace OpenRA.Mods.RA.Widgets.Logic
ScrollPanelWidget scrollpanel;
ScrollItemWidget itemTemplate;
string gameMode;
[ObjectCreator.UseCtor]
internal MapChooserLogic([ObjectCreator.Param] Widget widget,
[ObjectCreator.Param] string initialMap,
[ObjectCreator.Param] Action onExit,
[ObjectCreator.Param] Action<Map> onSelect)
internal MapChooserLogic(Widget widget, string initialMap, Action onExit, Action<Map> onSelect)
{
map = Game.modData.AvailableMaps[WidgetUtils.ChooseInitialMap(initialMap)];

View File

@@ -17,7 +17,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
public class OrderButtonsChromeLogic
{
[ObjectCreator.UseCtor]
public OrderButtonsChromeLogic( [ObjectCreator.Param] World world )
public OrderButtonsChromeLogic(World world)
{
var r = Widget.RootWidget;
var gameRoot = r.GetWidget("INGAME_ROOT");

View File

@@ -28,8 +28,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
Widget installingContainer, insertDiskContainer;
[ObjectCreator.UseCtor]
public RAInstallFromCDLogic([ObjectCreator.Param] Widget widget,
[ObjectCreator.Param] Action continueLoading)
public RAInstallFromCDLogic(Widget widget, Action continueLoading)
{
this.continueLoading = continueLoading;
panel = widget.GetWidget("INSTALL_FROMCD_PANEL");

View File

@@ -17,9 +17,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
public class RAInstallLogic
{
[ObjectCreator.UseCtor]
public RAInstallLogic([ObjectCreator.Param] Widget widget,
[ObjectCreator.Param] Dictionary<string,string> installData,
[ObjectCreator.Param] Action continueLoading)
public RAInstallLogic(Widget widget, Dictionary<string,string> installData, Action continueLoading)
{
var panel = widget.GetWidget("INSTALL_PANEL");
var args = new WidgetArgs()

View File

@@ -1,4 +1,4 @@
#region Copyright & License Information
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
Widget widget;
[ObjectCreator.UseCtor]
public ReplayBrowserLogic( [ObjectCreator.Param] Widget widget )
public ReplayBrowserLogic(Widget widget)
{
this.widget = widget;

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
ScrollItemWidget ServerTemplate;
[ObjectCreator.UseCtor]
public ServerBrowserLogic( [ObjectCreator.Param] Widget widget )
public ServerBrowserLogic(Widget widget)
{
var bg = widget.GetWidget("JOINSERVER_BG");

View File

@@ -20,6 +20,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
public class SettingsMenuLogic
{
Widget bg;
public SettingsMenuLogic()
{
bg = Widget.RootWidget.GetWidget<BackgroundWidget>("SETTINGS_MENU");