eradicate 'delegate' misuse
This commit is contained in:
@@ -22,9 +22,9 @@ using System;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncCheatsLogic : IWidgetDelegate
|
||||
public class CncCheatsLogic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncCheatsLogic([ObjectCreator.Param] Widget widget,
|
||||
@@ -12,9 +12,9 @@ using System;
|
||||
using OpenRA.Network;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncConnectingLogic : IWidgetDelegate
|
||||
public class CncConnectingLogic
|
||||
{
|
||||
static bool staticSetup;
|
||||
Action onConnect, onRetry, onAbort;
|
||||
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
if (panel == null)
|
||||
return;
|
||||
|
||||
var handler = panel.DelegateObject as CncConnectingLogic;
|
||||
var handler = panel.LogicObject as CncConnectingLogic;
|
||||
if (handler == null)
|
||||
return;
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
}
|
||||
}
|
||||
|
||||
public class CncConnectionFailedLogic : IWidgetDelegate
|
||||
public class CncConnectionFailedLogic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncConnectionFailedLogic([ObjectCreator.Param] Widget widget,
|
||||
12
OpenRA.Mods.Cnc/Widgets/CncDiplomacyLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncDiplomacyLogic.cs
Executable file → Normal file
12
OpenRA.Mods.Cnc/Widgets/CncDiplomacyLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncDiplomacyLogic.cs
Executable file → Normal file
@@ -9,17 +9,13 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using OpenRA.Mods.RA;
|
||||
using OpenRA.Widgets;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Traits;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncDiplomacyLogic : IWidgetDelegate
|
||||
public class CncDiplomacyLogic
|
||||
{
|
||||
World world;
|
||||
|
||||
4
OpenRA.Mods.Cnc/Widgets/CncDownloadPackagesLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncDownloadPackagesLogic.cs
Executable file → Normal file
4
OpenRA.Mods.Cnc/Widgets/CncDownloadPackagesLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncDownloadPackagesLogic.cs
Executable file → Normal file
@@ -17,9 +17,9 @@ using System.Net;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncDownloadPackagesLogic : IWidgetDelegate
|
||||
public class CncDownloadPackagesLogic
|
||||
{
|
||||
Widget panel;
|
||||
Dictionary<string,string> installData;
|
||||
11
OpenRA.Mods.Cnc/Widgets/CncIngameChromeLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs
Executable file → Normal file
11
OpenRA.Mods.Cnc/Widgets/CncIngameChromeLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs
Executable file → Normal file
@@ -8,16 +8,13 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using OpenRA.Mods.RA;
|
||||
using OpenRA.Widgets;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using System.Linq;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncIngameChromeLogic : IWidgetDelegate
|
||||
public class CncIngameChromeLogic
|
||||
{
|
||||
enum MenuType { None, Diplomacy, Cheats }
|
||||
MenuType menu = MenuType.None;
|
||||
@@ -31,7 +28,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
if (panel == null)
|
||||
return;
|
||||
|
||||
var handler = panel.DelegateObject as CncIngameChromeLogic;
|
||||
var handler = panel.LogicObject as CncIngameChromeLogic;
|
||||
if (handler == null)
|
||||
return;
|
||||
|
||||
8
OpenRA.Mods.Cnc/Widgets/CncIngameMenuLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncIngameMenuLogic.cs
Executable file → Normal file
8
OpenRA.Mods.Cnc/Widgets/CncIngameMenuLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncIngameMenuLogic.cs
Executable file → Normal file
@@ -9,14 +9,12 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using OpenRA.Mods.RA;
|
||||
using OpenRA.Widgets;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncIngameMenuLogic : IWidgetDelegate
|
||||
public class CncIngameMenuLogic
|
||||
{
|
||||
Widget menu;
|
||||
|
||||
4
OpenRA.Mods.Cnc/Widgets/CncInstallFromCDLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncInstallFromCDLogic.cs
Executable file → Normal file
4
OpenRA.Mods.Cnc/Widgets/CncInstallFromCDLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncInstallFromCDLogic.cs
Executable file → Normal file
@@ -16,9 +16,9 @@ using OpenRA.FileFormats;
|
||||
using OpenRA.FileFormats.Graphics;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncInstallFromCDLogic : IWidgetDelegate
|
||||
public class CncInstallFromCDLogic
|
||||
{
|
||||
Widget panel;
|
||||
ProgressBarWidget progressBar;
|
||||
4
OpenRA.Mods.Cnc/Widgets/CncInstallLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncInstallLogic.cs
Executable file → Normal file
4
OpenRA.Mods.Cnc/Widgets/CncInstallLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncInstallLogic.cs
Executable file → Normal file
@@ -12,9 +12,9 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncInstallLogic : IWidgetDelegate
|
||||
public class CncInstallLogic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncInstallLogic([ObjectCreator.Param] Widget widget,
|
||||
8
OpenRA.Mods.Cnc/Widgets/CncLobbyLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncLobbyLogic.cs
Executable file → Normal file
8
OpenRA.Mods.Cnc/Widgets/CncLobbyLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncLobbyLogic.cs
Executable file → Normal file
@@ -18,9 +18,9 @@ using OpenRA.Network;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncLobbyLogic : IWidgetDelegate
|
||||
public class CncLobbyLogic
|
||||
{
|
||||
Widget LocalPlayerTemplate, RemotePlayerTemplate, EmptySlotTemplate, EmptySlotTemplateHost;
|
||||
ScrollPanelWidget chatPanel;
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
if (panel == null)
|
||||
return null;
|
||||
|
||||
return panel.DelegateObject as CncLobbyLogic;
|
||||
return panel.LogicObject as CncLobbyLogic;
|
||||
}
|
||||
|
||||
static void LobbyInfoChangedStub()
|
||||
@@ -588,7 +588,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
}
|
||||
}
|
||||
|
||||
public class CncColorPickerLogic : IWidgetDelegate
|
||||
public class CncColorPickerLogic
|
||||
{
|
||||
ColorRamp ramp;
|
||||
[ObjectCreator.UseCtor]
|
||||
@@ -11,12 +11,11 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncMapChooserLogic : IWidgetDelegate
|
||||
public class CncMapChooserLogic
|
||||
{
|
||||
Map map;
|
||||
Widget scrollpanel;
|
||||
5
OpenRA.Mods.Cnc/Widgets/CncMenuLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncMenuLogic.cs
Executable file → Normal file
5
OpenRA.Mods.Cnc/Widgets/CncMenuLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncMenuLogic.cs
Executable file → Normal file
@@ -10,12 +10,11 @@
|
||||
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using OpenRA.Mods.RA;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncMenuLogic : IWidgetDelegate
|
||||
public class CncMenuLogic
|
||||
{
|
||||
enum MenuType
|
||||
{
|
||||
@@ -12,12 +12,11 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncModBrowserLogic : IWidgetDelegate
|
||||
public class CncModBrowserLogic
|
||||
{
|
||||
Mod currentMod;
|
||||
|
||||
@@ -15,13 +15,12 @@ using System.Threading;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.FileFormats.Graphics;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncMusicPlayerLogic : IWidgetDelegate
|
||||
public class CncMusicPlayerLogic
|
||||
{
|
||||
bool installed;
|
||||
MusicInfo currentSong = null;
|
||||
@@ -185,7 +184,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
}
|
||||
|
||||
|
||||
public class CncInstallMusicLogic : IWidgetDelegate
|
||||
public class CncInstallMusicLogic
|
||||
{
|
||||
Widget panel;
|
||||
ProgressBarWidget progressBar;
|
||||
@@ -8,13 +8,12 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using OpenRA.Support;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncPerfDebugLogic : IWidgetDelegate
|
||||
public class CncPerfDebugLogic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncPerfDebugLogic([ObjectCreator.Param] Widget widget)
|
||||
@@ -11,13 +11,12 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Widgets.Delegates;
|
||||
using OpenRA.Mods.RA.Widgets.Logic;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncReplayBrowserLogic : IWidgetDelegate
|
||||
public class CncReplayBrowserLogic
|
||||
{
|
||||
Widget panel;
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.RA.Widgets.Delegates;
|
||||
using OpenRA.Mods.RA.Widgets.Logic;
|
||||
using OpenRA.Network;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncServerBrowserLogic : IWidgetDelegate
|
||||
public class CncServerBrowserLogic
|
||||
{
|
||||
GameServer currentServer;
|
||||
ScrollItemWidget serverTemplate;
|
||||
@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
};
|
||||
|
||||
var join = panel.GetWidget<ButtonWidget>("JOIN_BUTTON");
|
||||
join.IsDisabled = () => currentServer == null || !ServerBrowserDelegate.CanJoin(currentServer);
|
||||
join.IsDisabled = () => currentServer == null || !ServerBrowserLogic.CanJoin(currentServer);
|
||||
join.OnClick = () =>
|
||||
{
|
||||
if (currentServer == null)
|
||||
@@ -100,7 +100,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
var infoPanel = panel.GetWidget("SERVER_INFO");
|
||||
infoPanel.IsVisible = () => currentServer != null;
|
||||
infoPanel.GetWidget<LabelWidget>("SERVER_IP").GetText = () => currentServer.Address;
|
||||
infoPanel.GetWidget<LabelWidget>("SERVER_MODS").GetText = () => ServerBrowserDelegate.GenerateModsLabel(currentServer);
|
||||
infoPanel.GetWidget<LabelWidget>("SERVER_MODS").GetText = () => ServerBrowserLogic.GenerateModsLabel(currentServer);
|
||||
infoPanel.GetWidget<LabelWidget>("MAP_TITLE").GetText = () => (CurrentMap() != null) ? CurrentMap().Title : "Unknown";
|
||||
infoPanel.GetWidget<LabelWidget>("MAP_PLAYERS").GetText = () => GetPlayersLabel(currentServer);
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
return;
|
||||
}
|
||||
|
||||
var gamesWaiting = games.Where(g => ServerBrowserDelegate.CanJoin(g));
|
||||
var gamesWaiting = games.Where(g => ServerBrowserLogic.CanJoin(g));
|
||||
|
||||
if (gamesWaiting.Count() == 0)
|
||||
{
|
||||
@@ -172,7 +172,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
}
|
||||
}
|
||||
|
||||
public class CncDirectConnectLogic : IWidgetDelegate
|
||||
public class CncDirectConnectLogic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public CncDirectConnectLogic([ObjectCreator.Param] Widget widget,
|
||||
@@ -14,9 +14,9 @@ using System.Net;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncServerCreationLogic : IWidgetDelegate
|
||||
public class CncServerCreationLogic
|
||||
{
|
||||
Widget panel;
|
||||
Action onCreate;
|
||||
6
OpenRA.Mods.Cnc/Widgets/CncSettingsLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncSettingsLogic.cs
Executable file → Normal file
6
OpenRA.Mods.Cnc/Widgets/CncSettingsLogic.cs → OpenRA.Mods.Cnc/Widgets/Logic/CncSettingsLogic.cs
Executable file → Normal file
@@ -10,22 +10,22 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.FileFormats.Graphics;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
{
|
||||
public class CncSettingsLogic : IWidgetDelegate
|
||||
public class CncSettingsLogic
|
||||
{
|
||||
enum PanelType
|
||||
{
|
||||
General,
|
||||
Input
|
||||
}
|
||||
|
||||
PanelType Settings = PanelType.General;
|
||||
ColorRamp playerColor;
|
||||
Modifiers groupAddModifier;
|
||||
Reference in New Issue
Block a user