eradicate 'delegate' misuse

This commit is contained in:
Chris Forbes
2011-05-22 21:58:39 +12:00
parent 4b12a19af0
commit ef03d46f13
72 changed files with 234 additions and 269 deletions

View File

@@ -137,7 +137,6 @@ namespace OpenRA.Widgets
} }
int2 lastMouseLocation; int2 lastMouseLocation;
// TODO: ScrollPanelWidget doesn't support delegate methods for mouse input
public override bool HandleMouseInput(MouseInput mi) public override bool HandleMouseInput(MouseInput mi)
{ {
if (mi.Button == MouseButton.WheelDown) if (mi.Button == MouseButton.WheelDown)

View File

@@ -68,7 +68,6 @@ namespace OpenRA.Widgets
Offset = ((newOffset - Little) / Spread).Clamp(0f, 1f); Offset = ((newOffset - Little) / Spread).Clamp(0f, 1f);
} }
// TODO: SliderWidget doesn't support delegate methods for mouse input
public override bool HandleMouseInput(MouseInput mi) public override bool HandleMouseInput(MouseInput mi)
{ {
if (mi.Button != MouseButton.Left) if (mi.Button != MouseButton.Left)

View File

@@ -58,7 +58,6 @@ namespace OpenRA.Widgets
return lose; return lose;
} }
// TODO: TextFieldWidgets don't support delegate methods for mouse input
public override bool HandleMouseInput(MouseInput mi) public override bool HandleMouseInput(MouseInput mi)
{ {
if (IsDisabled()) if (IsDisabled())

View File

@@ -34,7 +34,6 @@ namespace OpenRA.Widgets
protected ViewportScrollControllerWidget(ViewportScrollControllerWidget widget) : base(widget) {} protected ViewportScrollControllerWidget(ViewportScrollControllerWidget widget) : base(widget) {}
public override void DrawInner() {} public override void DrawInner() {}
// TODO: ViewportScrollController doesn't support delegate methods for mouse input
public override bool HandleMouseInput(MouseInput mi) public override bool HandleMouseInput(MouseInput mi)
{ {
var scrolltype = Game.Settings.Game.MouseScroll; var scrolltype = Game.Settings.Game.MouseScroll;

View File

@@ -25,8 +25,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 Delegate = null; public string Logic = null;
public IWidgetDelegate DelegateObject {get; private set;} public object LogicObject { get; private set; }
public bool Visible = true; public bool Visible = true;
public readonly List<Widget> Children = new List<Widget>(); public readonly List<Widget> Children = new List<Widget>();
@@ -61,7 +61,7 @@ namespace OpenRA.Widgets
Y = widget.Y; Y = widget.Y;
Width = widget.Width; Width = widget.Width;
Height = widget.Height; Height = widget.Height;
Delegate = widget.Delegate; Logic = widget.Logic;
Visible = widget.Visible; Visible = widget.Visible;
Bounds = widget.Bounds; Bounds = widget.Bounds;
@@ -126,13 +126,13 @@ namespace OpenRA.Widgets
public void PostInit(WidgetArgs args) public void PostInit(WidgetArgs args)
{ {
if (Delegate == null) if (Logic == null)
return; return;
args["widget"] = this; args["widget"] = this;
DelegateObject = Game.modData.ObjectCreator.CreateObject<IWidgetDelegate>(Delegate, args); LogicObject = Game.modData.ObjectCreator.CreateObject<object>(Logic, args);
var iwd = DelegateObject as IWidgetDelegateEx; var iwd = LogicObject as ILogicWithInit;
if (iwd != null) if (iwd != null)
iwd.Init(); iwd.Init();
@@ -229,7 +229,7 @@ namespace OpenRA.Widgets
// TODO: Solve this properly // TODO: Solve this properly
public virtual bool HandleMouseInput(MouseInput mi) public virtual bool HandleMouseInput(MouseInput mi)
{ {
// Apply any special logic added by delegates; they return true if they caught the input // Apply any special logic added by event handlers; they return true if they caught the input
if (mi.Event == MouseInputEvent.Down && OnMouseDown(mi)) return true; if (mi.Event == MouseInputEvent.Down && OnMouseDown(mi)) return true;
if (mi.Event == MouseInputEvent.Up && OnMouseUp(mi)) return true; if (mi.Event == MouseInputEvent.Up && OnMouseUp(mi)) return true;
if (mi.Event == MouseInputEvent.Move) if (mi.Event == MouseInputEvent.Move)
@@ -252,7 +252,7 @@ namespace OpenRA.Widgets
// Do any widgety behavior (enter text etc) // Do any widgety behavior (enter text etc)
var handled = HandleKeyPressInner(e); var handled = HandleKeyPressInner(e);
// Apply any special logic added by delegates; they return true if they caught the input // Apply any special logic added by event handlers; they return true if they caught the input
if (OnKeyPress(e)) return true; if (OnKeyPress(e)) return true;
return handled; return handled;
@@ -372,10 +372,9 @@ namespace OpenRA.Widgets
public void Add(string key, Action val) { base.Add(key, val); } public void Add(string key, Action val) { base.Add(key, val); }
} }
public interface IWidgetDelegate { } // TODO: you should use this anywhere you want to do
// something in a logic ctor, but retain debuggability.
// TODO: This can die once ra init is sane public interface ILogicWithInit
[Obsolete] public interface IWidgetDelegateEx : IWidgetDelegate
{ {
void Init(); void Init();
} }

View File

@@ -57,7 +57,6 @@ namespace OpenRA.Widgets
int2 dragStart, dragEnd; int2 dragStart, dragEnd;
// TODO: WorldInteractionController doesn't support delegate methods for mouse input
public override bool HandleMouseInput(MouseInput mi) public override bool HandleMouseInput(MouseInput mi)
{ {
var xy = Game.viewport.ViewToWorldPx(mi); var xy = Game.viewport.ViewToWorldPx(mi);

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -70,26 +70,26 @@
<Compile Include="CncWaterPaletteRotation.cs" /> <Compile Include="CncWaterPaletteRotation.cs" />
<Compile Include="AttackPopupTurreted.cs" /> <Compile Include="AttackPopupTurreted.cs" />
<Compile Include="SpawnViceroid.cs" /> <Compile Include="SpawnViceroid.cs" />
<Compile Include="Widgets\CncMenuLogic.cs" /> <Compile Include="Widgets\Logic\CncMenuLogic.cs" />
<Compile Include="Widgets\CncServerBrowserLogic.cs" /> <Compile Include="Widgets\Logic\CncServerBrowserLogic.cs" />
<Compile Include="Widgets\CncLobbyLogic.cs" /> <Compile Include="Widgets\Logic\CncLobbyLogic.cs" />
<Compile Include="Widgets\CncReplayBrowserLogic.cs" /> <Compile Include="Widgets\Logic\CncReplayBrowserLogic.cs" />
<Compile Include="Widgets\CncServerCreationLogic.cs" /> <Compile Include="Widgets\Logic\CncServerCreationLogic.cs" />
<Compile Include="Widgets\CncMapChooserLogic.cs" /> <Compile Include="Widgets\Logic\CncMapChooserLogic.cs" />
<Compile Include="Widgets\CncConnectionLogic.cs" /> <Compile Include="Widgets\Logic\CncConnectionLogic.cs" />
<Compile Include="Widgets\CncIngameChromeLogic.cs" /> <Compile Include="Widgets\Logic\CncIngameChromeLogic.cs" />
<Compile Include="Widgets\CncInstallLogic.cs" /> <Compile Include="Widgets\Logic\CncInstallLogic.cs" />
<Compile Include="Widgets\CncMusicPlayerLogic.cs" /> <Compile Include="Widgets\Logic\CncMusicPlayerLogic.cs" />
<Compile Include="CncColorPickerPaletteModifier.cs" /> <Compile Include="CncColorPickerPaletteModifier.cs" />
<Compile Include="Widgets\CncModBrowserLogic.cs" /> <Compile Include="Widgets\Logic\CncModBrowserLogic.cs" />
<Compile Include="Widgets\CncPerfDebugLogic.cs" /> <Compile Include="Widgets\Logic\CncPerfDebugLogic.cs" />
<Compile Include="Widgets\CncSettingsLogic.cs" /> <Compile Include="Widgets\Logic\CncSettingsLogic.cs" />
<Compile Include="Widgets\CncCheatsLogic.cs" /> <Compile Include="Widgets\Logic\CncCheatsLogic.cs" />
<Compile Include="Widgets\CncInstallFromCDLogic.cs" /> <Compile Include="Widgets\Logic\CncInstallFromCDLogic.cs" />
<Compile Include="Widgets\CncDownloadPackagesLogic.cs" /> <Compile Include="Widgets\Logic\CncDownloadPackagesLogic.cs" />
<Compile Include="CncMenuPaletteEffect.cs" /> <Compile Include="CncMenuPaletteEffect.cs" />
<Compile Include="Widgets\CncIngameMenuLogic.cs" /> <Compile Include="Widgets\Logic\CncIngameMenuLogic.cs" />
<Compile Include="Widgets\CncDiplomacyLogic.cs" /> <Compile Include="Widgets\Logic\CncDiplomacyLogic.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj"> <ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
@@ -121,8 +121,4 @@
copy "$(TargetPath)" "$(SolutionDir)mods/cnc/" copy "$(TargetPath)" "$(SolutionDir)mods/cnc/"
cd "$(SolutionDir)"</PostBuildEvent> cd "$(SolutionDir)"</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Folder Include="Activities\" />
<Folder Include="Widgets\" />
</ItemGroup>
</Project> </Project>

View File

@@ -22,9 +22,9 @@ using System;
using OpenRA.Traits; using OpenRA.Traits;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.Cnc.Widgets namespace OpenRA.Mods.Cnc.Widgets.Logic
{ {
public class CncCheatsLogic : IWidgetDelegate public class CncCheatsLogic
{ {
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public CncCheatsLogic([ObjectCreator.Param] Widget widget, public CncCheatsLogic([ObjectCreator.Param] Widget widget,

View File

@@ -12,9 +12,9 @@ using System;
using OpenRA.Network; using OpenRA.Network;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.Cnc.Widgets namespace OpenRA.Mods.Cnc.Widgets.Logic
{ {
public class CncConnectingLogic : IWidgetDelegate public class CncConnectingLogic
{ {
static bool staticSetup; static bool staticSetup;
Action onConnect, onRetry, onAbort; Action onConnect, onRetry, onAbort;
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Cnc.Widgets
if (panel == null) if (panel == null)
return; return;
var handler = panel.DelegateObject as CncConnectingLogic; var handler = panel.LogicObject as CncConnectingLogic;
if (handler == null) if (handler == null)
return; return;
@@ -95,7 +95,7 @@ namespace OpenRA.Mods.Cnc.Widgets
} }
} }
public class CncConnectionFailedLogic : IWidgetDelegate public class CncConnectionFailedLogic
{ {
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public CncConnectionFailedLogic([ObjectCreator.Param] Widget widget, public CncConnectionFailedLogic([ObjectCreator.Param] Widget widget,

View File

@@ -9,17 +9,13 @@
#endregion #endregion
using System; 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.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; World world;

View File

@@ -17,9 +17,9 @@ using System.Net;
using OpenRA.FileFormats; using OpenRA.FileFormats;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.Cnc.Widgets namespace OpenRA.Mods.Cnc.Widgets.Logic
{ {
public class CncDownloadPackagesLogic : IWidgetDelegate public class CncDownloadPackagesLogic
{ {
Widget panel; Widget panel;
Dictionary<string,string> installData; Dictionary<string,string> installData;

View File

@@ -8,16 +8,13 @@
*/ */
#endregion #endregion
using System;
using System.Drawing; using System.Drawing;
using OpenRA.Mods.RA;
using OpenRA.Widgets;
using OpenRA.Mods.RA.Activities;
using System.Linq; 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 } enum MenuType { None, Diplomacy, Cheats }
MenuType menu = MenuType.None; MenuType menu = MenuType.None;
@@ -31,7 +28,7 @@ namespace OpenRA.Mods.Cnc.Widgets
if (panel == null) if (panel == null)
return; return;
var handler = panel.DelegateObject as CncIngameChromeLogic; var handler = panel.LogicObject as CncIngameChromeLogic;
if (handler == null) if (handler == null)
return; return;

View File

@@ -9,14 +9,12 @@
#endregion #endregion
using System; using System;
using System.Drawing;
using OpenRA.Mods.RA;
using OpenRA.Widgets;
using OpenRA.Mods.RA.Activities; 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; Widget menu;

View File

@@ -16,9 +16,9 @@ using OpenRA.FileFormats;
using OpenRA.FileFormats.Graphics; using OpenRA.FileFormats.Graphics;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.Cnc.Widgets namespace OpenRA.Mods.Cnc.Widgets.Logic
{ {
public class CncInstallFromCDLogic : IWidgetDelegate public class CncInstallFromCDLogic
{ {
Widget panel; Widget panel;
ProgressBarWidget progressBar; ProgressBarWidget progressBar;

View File

@@ -12,9 +12,9 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.Cnc.Widgets namespace OpenRA.Mods.Cnc.Widgets.Logic
{ {
public class CncInstallLogic : IWidgetDelegate public class CncInstallLogic
{ {
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public CncInstallLogic([ObjectCreator.Param] Widget widget, public CncInstallLogic([ObjectCreator.Param] Widget widget,

View File

@@ -18,9 +18,9 @@ using OpenRA.Network;
using OpenRA.Traits; using OpenRA.Traits;
using OpenRA.Widgets; 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; Widget LocalPlayerTemplate, RemotePlayerTemplate, EmptySlotTemplate, EmptySlotTemplateHost;
ScrollPanelWidget chatPanel; ScrollPanelWidget chatPanel;
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Cnc.Widgets
if (panel == null) if (panel == null)
return null; return null;
return panel.DelegateObject as CncLobbyLogic; return panel.LogicObject as CncLobbyLogic;
} }
static void LobbyInfoChangedStub() static void LobbyInfoChangedStub()
@@ -588,7 +588,7 @@ namespace OpenRA.Mods.Cnc.Widgets
} }
} }
public class CncColorPickerLogic : IWidgetDelegate public class CncColorPickerLogic
{ {
ColorRamp ramp; ColorRamp ramp;
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]

View File

@@ -11,12 +11,11 @@
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using OpenRA.Graphics;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.Cnc.Widgets namespace OpenRA.Mods.Cnc.Widgets.Logic
{ {
public class CncMapChooserLogic : IWidgetDelegate public class CncMapChooserLogic
{ {
Map map; Map map;
Widget scrollpanel; Widget scrollpanel;

View File

@@ -10,12 +10,11 @@
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using OpenRA.Mods.RA;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.Cnc.Widgets namespace OpenRA.Mods.Cnc.Widgets.Logic
{ {
public class CncMenuLogic : IWidgetDelegate public class CncMenuLogic
{ {
enum MenuType enum MenuType
{ {

View File

@@ -12,12 +12,11 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using OpenRA.FileFormats; using OpenRA.FileFormats;
using OpenRA.Graphics;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.Cnc.Widgets namespace OpenRA.Mods.Cnc.Widgets.Logic
{ {
public class CncModBrowserLogic : IWidgetDelegate public class CncModBrowserLogic
{ {
Mod currentMod; Mod currentMod;

View File

@@ -15,13 +15,12 @@ using System.Threading;
using OpenRA.FileFormats; using OpenRA.FileFormats;
using OpenRA.FileFormats.Graphics; using OpenRA.FileFormats.Graphics;
using OpenRA.GameRules; using OpenRA.GameRules;
using OpenRA.Graphics;
using OpenRA.Traits; using OpenRA.Traits;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.Cnc.Widgets namespace OpenRA.Mods.Cnc.Widgets.Logic
{ {
public class CncMusicPlayerLogic : IWidgetDelegate public class CncMusicPlayerLogic
{ {
bool installed; bool installed;
MusicInfo currentSong = null; MusicInfo currentSong = null;
@@ -185,7 +184,7 @@ namespace OpenRA.Mods.Cnc.Widgets
} }
public class CncInstallMusicLogic : IWidgetDelegate public class CncInstallMusicLogic
{ {
Widget panel; Widget panel;
ProgressBarWidget progressBar; ProgressBarWidget progressBar;

View File

@@ -8,13 +8,12 @@
*/ */
#endregion #endregion
using System;
using OpenRA.Support; using OpenRA.Support;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.Cnc.Widgets namespace OpenRA.Mods.Cnc.Widgets.Logic
{ {
public class CncPerfDebugLogic : IWidgetDelegate public class CncPerfDebugLogic
{ {
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public CncPerfDebugLogic([ObjectCreator.Param] Widget widget) public CncPerfDebugLogic([ObjectCreator.Param] Widget widget)

View File

@@ -11,13 +11,12 @@
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using OpenRA.Graphics; using OpenRA.Mods.RA.Widgets.Logic;
using OpenRA.Mods.RA.Widgets.Delegates;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.Cnc.Widgets namespace OpenRA.Mods.Cnc.Widgets.Logic
{ {
public class CncReplayBrowserLogic : IWidgetDelegate public class CncReplayBrowserLogic
{ {
Widget panel; Widget panel;

View File

@@ -11,13 +11,13 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using OpenRA.Mods.RA.Widgets.Delegates; using OpenRA.Mods.RA.Widgets.Logic;
using OpenRA.Network; using OpenRA.Network;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.Cnc.Widgets namespace OpenRA.Mods.Cnc.Widgets.Logic
{ {
public class CncServerBrowserLogic : IWidgetDelegate public class CncServerBrowserLogic
{ {
GameServer currentServer; GameServer currentServer;
ScrollItemWidget serverTemplate; ScrollItemWidget serverTemplate;
@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Cnc.Widgets
}; };
var join = panel.GetWidget<ButtonWidget>("JOIN_BUTTON"); var join = panel.GetWidget<ButtonWidget>("JOIN_BUTTON");
join.IsDisabled = () => currentServer == null || !ServerBrowserDelegate.CanJoin(currentServer); join.IsDisabled = () => currentServer == null || !ServerBrowserLogic.CanJoin(currentServer);
join.OnClick = () => join.OnClick = () =>
{ {
if (currentServer == null) if (currentServer == null)
@@ -100,7 +100,7 @@ namespace OpenRA.Mods.Cnc.Widgets
var infoPanel = panel.GetWidget("SERVER_INFO"); var infoPanel = panel.GetWidget("SERVER_INFO");
infoPanel.IsVisible = () => currentServer != null; infoPanel.IsVisible = () => currentServer != null;
infoPanel.GetWidget<LabelWidget>("SERVER_IP").GetText = () => currentServer.Address; 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_TITLE").GetText = () => (CurrentMap() != null) ? CurrentMap().Title : "Unknown";
infoPanel.GetWidget<LabelWidget>("MAP_PLAYERS").GetText = () => GetPlayersLabel(currentServer); infoPanel.GetWidget<LabelWidget>("MAP_PLAYERS").GetText = () => GetPlayersLabel(currentServer);
@@ -142,7 +142,7 @@ namespace OpenRA.Mods.Cnc.Widgets
return; return;
} }
var gamesWaiting = games.Where(g => ServerBrowserDelegate.CanJoin(g)); var gamesWaiting = games.Where(g => ServerBrowserLogic.CanJoin(g));
if (gamesWaiting.Count() == 0) if (gamesWaiting.Count() == 0)
{ {
@@ -172,7 +172,7 @@ namespace OpenRA.Mods.Cnc.Widgets
} }
} }
public class CncDirectConnectLogic : IWidgetDelegate public class CncDirectConnectLogic
{ {
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public CncDirectConnectLogic([ObjectCreator.Param] Widget widget, public CncDirectConnectLogic([ObjectCreator.Param] Widget widget,

View File

@@ -14,9 +14,9 @@ using System.Net;
using OpenRA.GameRules; using OpenRA.GameRules;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.Cnc.Widgets namespace OpenRA.Mods.Cnc.Widgets.Logic
{ {
public class CncServerCreationLogic : IWidgetDelegate public class CncServerCreationLogic
{ {
Widget panel; Widget panel;
Action onCreate; Action onCreate;

View File

@@ -10,22 +10,22 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing;
using System.Linq; using System.Linq;
using OpenRA.FileFormats; using OpenRA.FileFormats;
using OpenRA.FileFormats.Graphics; using OpenRA.FileFormats.Graphics;
using OpenRA.GameRules; using OpenRA.GameRules;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.Cnc.Widgets namespace OpenRA.Mods.Cnc.Widgets.Logic
{ {
public class CncSettingsLogic : IWidgetDelegate public class CncSettingsLogic
{ {
enum PanelType enum PanelType
{ {
General, General,
Input Input
} }
PanelType Settings = PanelType.General; PanelType Settings = PanelType.General;
ColorRamp playerColor; ColorRamp playerColor;
Modifiers groupAddModifier; Modifiers groupAddModifier;

View File

@@ -12,7 +12,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using OpenRA.FileFormats; using OpenRA.FileFormats;
using OpenRA.Graphics; using OpenRA.Graphics;
using OpenRA.Mods.RA.Widgets.Delegates; using OpenRA.Mods.RA.Widgets.Logic;
using OpenRA.Traits; using OpenRA.Traits;
namespace OpenRA.Mods.RA namespace OpenRA.Mods.RA
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.RA
public void AdjustPalette(Dictionary<string, Palette> palettes) public void AdjustPalette(Dictionary<string, Palette> palettes)
{ {
palettes["colorpicker"] = new Palette(palettes["colorpicker"], palettes["colorpicker"] = new Palette(palettes["colorpicker"],
new PlayerColorRemap(LobbyDelegate.CurrentColorPreview, format)); new PlayerColorRemap(LobbyLogic.CurrentColorPreview, format));
} }
} }
} }

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -260,9 +260,9 @@
<Compile Include="WaterPaletteRotation.cs" /> <Compile Include="WaterPaletteRotation.cs" />
<Compile Include="Weapon.cs" /> <Compile Include="Weapon.cs" />
<Compile Include="Widgets\BuildPaletteWidget.cs" /> <Compile Include="Widgets\BuildPaletteWidget.cs" />
<Compile Include="Widgets\Delegates\IngameObserverChromeDelegate.cs" /> <Compile Include="Widgets\Logic\IngameObserverChromeLogic.cs" />
<Compile Include="Widgets\Delegates\IngameChromeDelegate.cs" /> <Compile Include="Widgets\Logic\IngameChromeLogic.cs" />
<Compile Include="Widgets\Delegates\ReplayBrowserDelegate.cs" /> <Compile Include="Widgets\Logic\ReplayBrowserLogic.cs" />
<Compile Include="Widgets\MoneyBinWidget.cs" /> <Compile Include="Widgets\MoneyBinWidget.cs" />
<Compile Include="Widgets\OrderButtonWidget.cs" /> <Compile Include="Widgets\OrderButtonWidget.cs" />
<Compile Include="Widgets\PowerBinWidget.cs" /> <Compile Include="Widgets\PowerBinWidget.cs" />
@@ -277,7 +277,7 @@
<Compile Include="Invulnerable.cs" /> <Compile Include="Invulnerable.cs" />
<Compile Include="ReplaceWithActor.cs" /> <Compile Include="ReplaceWithActor.cs" />
<Compile Include="StoresOre.cs" /> <Compile Include="StoresOre.cs" />
<Compile Include="Widgets\Delegates\OrderButtonsChromeDelegate.cs" /> <Compile Include="Widgets\Logic\OrderButtonsChromeLogic.cs" />
<Compile Include="RadarColorFromTerrain.cs" /> <Compile Include="RadarColorFromTerrain.cs" />
<Compile Include="EngineerRepair.cs" /> <Compile Include="EngineerRepair.cs" />
<Compile Include="Activities\RepairBuilding.cs" /> <Compile Include="Activities\RepairBuilding.cs" />
@@ -308,17 +308,17 @@
<Compile Include="ServerTraits\LobbyCommands.cs" /> <Compile Include="ServerTraits\LobbyCommands.cs" />
<Compile Include="Scripting\RASpecialPowers.cs" /> <Compile Include="Scripting\RASpecialPowers.cs" />
<Compile Include="PaletteFromCurrentTileset.cs" /> <Compile Include="PaletteFromCurrentTileset.cs" />
<Compile Include="Widgets\Delegates\ConnectionDialogsDelegate.cs" /> <Compile Include="Widgets\Logic\ConnectionDialogsLogic.cs" />
<Compile Include="Widgets\Delegates\CreateServerMenuDelegate.cs" /> <Compile Include="Widgets\Logic\CreateServerMenuLogic.cs" />
<Compile Include="Widgets\Delegates\DeveloperModeDelegate.cs" /> <Compile Include="Widgets\Logic\DeveloperModeLogic.cs" />
<Compile Include="Widgets\Delegates\DiplomacyDelegate.cs" /> <Compile Include="Widgets\Logic\DiplomacyLogic.cs" />
<Compile Include="Widgets\Delegates\LobbyDelegate.cs" /> <Compile Include="Widgets\Logic\LobbyLogic.cs" />
<Compile Include="Widgets\Delegates\MainMenuButtonsDelegate.cs" /> <Compile Include="Widgets\Logic\MainMenuButtonsLogic.cs" />
<Compile Include="Widgets\Delegates\MapChooserDelegate.cs" /> <Compile Include="Widgets\Logic\MapChooserLogic.cs" />
<Compile Include="Widgets\Delegates\MusicPlayerDelegate.cs" /> <Compile Include="Widgets\Logic\MusicPlayerLogic.cs" />
<Compile Include="Widgets\Delegates\PerfDebugDelegate.cs" /> <Compile Include="Widgets\Logic\PerfDebugLogic.cs" />
<Compile Include="Widgets\Delegates\ServerBrowserDelegate.cs" /> <Compile Include="Widgets\Logic\ServerBrowserLogic.cs" />
<Compile Include="Widgets\Delegates\SettingsMenuDelegate.cs" /> <Compile Include="Widgets\Logic\SettingsMenuLogic.cs" />
<Compile Include="TargetableSubmarine.cs" /> <Compile Include="TargetableSubmarine.cs" />
<Compile Include="Effects\RallyPoint.cs" /> <Compile Include="Effects\RallyPoint.cs" />
<Compile Include="AttackMedic.cs" /> <Compile Include="AttackMedic.cs" />
@@ -328,7 +328,7 @@
<Compile Include="Buildings\SoundOnDamageTransition.cs" /> <Compile Include="Buildings\SoundOnDamageTransition.cs" />
<Compile Include="Activities\RAHarvesterDockSequence.cs" /> <Compile Include="Activities\RAHarvesterDockSequence.cs" />
<Compile Include="Widgets\GameInitInfoWidget.cs" /> <Compile Include="Widgets\GameInitInfoWidget.cs" />
<Compile Include="Widgets\Delegates\GameInitDelegate.cs" /> <Compile Include="Widgets\Logic\GameInitLogic.cs" />
<Compile Include="AttackWander.cs" /> <Compile Include="AttackWander.cs" />
<Compile Include="ScaredyCat.cs" /> <Compile Include="ScaredyCat.cs" />
<Compile Include="Widgets\SidebarButtonWidget.cs" /> <Compile Include="Widgets\SidebarButtonWidget.cs" />

View File

@@ -157,7 +157,6 @@ namespace OpenRA.Mods.RA.Widgets
return DoBuildingHotkey(e.KeyName, world); return DoBuildingHotkey(e.KeyName, world);
} }
// TODO: BuildPaletteWidget doesn't support delegate methods for mouse input
public override bool HandleMouseInput(MouseInput mi) public override bool HandleMouseInput(MouseInput mi)
{ {
if (mi.Event != MouseInputEvent.Down) if (mi.Event != MouseInputEvent.Down)

View File

@@ -9,9 +9,6 @@
#endregion #endregion
using OpenRA.Widgets; using OpenRA.Widgets;
using System;
using OpenRA.Mods.RA.Widgets.Delegates;
using System.IO;
namespace OpenRA.Mods.RA.Widgets namespace OpenRA.Mods.RA.Widgets
{ {

View File

@@ -11,12 +11,12 @@
using OpenRA.Network; using OpenRA.Network;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.RA.Widgets.Delegates namespace OpenRA.Mods.RA.Widgets.Logic
{ {
public class ConnectionDialogsDelegate : IWidgetDelegate public class ConnectionDialogsLogic
{ {
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public ConnectionDialogsDelegate( public ConnectionDialogsLogic(
[ObjectCreator.Param] Widget widget, [ObjectCreator.Param] Widget widget,
[ObjectCreator.Param] string host, [ObjectCreator.Param] string host,
[ObjectCreator.Param] int port ) [ObjectCreator.Param] int port )
@@ -35,10 +35,10 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
} }
} }
public class ConnectionFailedDelegate : IWidgetDelegate public class ConnectionFailedLogic
{ {
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public ConnectionFailedDelegate( public ConnectionFailedLogic(
[ObjectCreator.Param] Widget widget, [ObjectCreator.Param] Widget widget,
[ObjectCreator.Param] OrderManager orderManager) [ObjectCreator.Param] OrderManager orderManager)
{ {

View File

@@ -13,12 +13,12 @@ using System.Net;
using OpenRA.Widgets; using OpenRA.Widgets;
using OpenRA.GameRules; using OpenRA.GameRules;
namespace OpenRA.Mods.RA.Widgets.Delegates namespace OpenRA.Mods.RA.Widgets.Logic
{ {
public class CreateServerMenuDelegate : IWidgetDelegate public class CreateServerMenuLogic
{ {
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public CreateServerMenuDelegate( [ObjectCreator.Param( "widget" )] Widget cs ) public CreateServerMenuLogic( [ObjectCreator.Param( "widget" )] Widget cs )
{ {
var settings = Game.Settings; var settings = Game.Settings;

View File

@@ -23,12 +23,12 @@ using OpenRA;
using OpenRA.Traits; using OpenRA.Traits;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.RA.Widgets.Delegates namespace OpenRA.Mods.RA.Widgets.Logic
{ {
public class DeveloperModeDelegate : IWidgetDelegate public class DeveloperModeLogic
{ {
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public DeveloperModeDelegate( [ObjectCreator.Param] World world ) public DeveloperModeLogic( [ObjectCreator.Param] World world )
{ {
var devmodeBG = Widget.RootWidget.GetWidget("INGAME_ROOT").GetWidget("DEVELOPERMODE_BG"); var devmodeBG = Widget.RootWidget.GetWidget("INGAME_ROOT").GetWidget("DEVELOPERMODE_BG");
var devModeButton = Widget.RootWidget.GetWidget<ButtonWidget>("INGAME_DEVELOPERMODE_BUTTON"); var devModeButton = Widget.RootWidget.GetWidget<ButtonWidget>("INGAME_DEVELOPERMODE_BUTTON");

View File

@@ -15,9 +15,9 @@ using System.Linq;
using OpenRA.Traits; using OpenRA.Traits;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.RA.Widgets.Delegates namespace OpenRA.Mods.RA.Widgets.Logic
{ {
public class DiplomacyDelegate : IWidgetDelegate public class DiplomacyLogic
{ {
static List<Widget> controls = new List<Widget>(); static List<Widget> controls = new List<Widget>();
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
readonly World world; readonly World world;
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public DiplomacyDelegate( [ObjectCreator.Param] World world ) public DiplomacyLogic( [ObjectCreator.Param] World world )
{ {
this.world = world; this.world = world;
var root = Widget.RootWidget.GetWidget("INGAME_ROOT"); var root = Widget.RootWidget.GetWidget("INGAME_ROOT");

View File

@@ -17,51 +17,49 @@ using OpenRA.FileFormats;
using OpenRA.Network; using OpenRA.Network;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.RA.Widgets.Delegates namespace OpenRA.Mods.RA.Widgets.Logic
{ {
public class GameInitDelegate : IWidgetDelegateEx public class GameInitLogic : ILogicWithInit
{ {
GameInitInfoWidget Info; GameInitInfoWidget Info;
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public GameInitDelegate([ObjectCreator.Param] Widget widget) public GameInitLogic([ObjectCreator.Param] Widget widget)
{ {
Info = (widget as GameInitInfoWidget); Info = (widget as GameInitInfoWidget);
} }
public void Init() void ILogicWithInit.Init()
{ {
if (Info.InstallMode != "cnc") Game.ConnectionStateChanged += orderManager =>
{ {
Game.ConnectionStateChanged += orderManager => Widget.CloseWindow();
{ switch (orderManager.Connection.ConnectionState)
Widget.CloseWindow(); {
switch (orderManager.Connection.ConnectionState) case ConnectionState.PreConnecting:
{ Widget.LoadWidget("MAINMENU_BG", Widget.RootWidget, new WidgetArgs());
case ConnectionState.PreConnecting: break;
Widget.LoadWidget("MAINMENU_BG", Widget.RootWidget, new WidgetArgs()); case ConnectionState.Connecting:
break; Widget.OpenWindow("CONNECTING_BG",
case ConnectionState.Connecting: new WidgetArgs() { { "host", orderManager.Host }, { "port", orderManager.Port } });
Widget.OpenWindow("CONNECTING_BG", break;
new WidgetArgs() { { "host", orderManager.Host }, { "port", orderManager.Port } }); case ConnectionState.NotConnected:
break; Widget.OpenWindow("CONNECTION_FAILED_BG",
case ConnectionState.NotConnected: new WidgetArgs() { { "orderManager", orderManager } });
Widget.OpenWindow("CONNECTION_FAILED_BG", break;
new WidgetArgs() { { "orderManager", orderManager } }); case ConnectionState.Connected:
break; var lobby = Game.OpenWindow(orderManager.world, "SERVER_LOBBY");
case ConnectionState.Connected: lobby.GetWidget<ChatDisplayWidget>("CHAT_DISPLAY").ClearChat();
var lobby = Game.OpenWindow(orderManager.world, "SERVER_LOBBY"); lobby.GetWidget("CHANGEMAP_BUTTON").Visible = true;
lobby.GetWidget<ChatDisplayWidget>("CHAT_DISPLAY").ClearChat(); lobby.GetWidget("LOCKTEAMS_CHECKBOX").Visible = true;
lobby.GetWidget("CHANGEMAP_BUTTON").Visible = true; lobby.GetWidget("ALLOWCHEATS_CHECKBOX").Visible = true;
lobby.GetWidget("LOCKTEAMS_CHECKBOX").Visible = true; lobby.GetWidget("DISCONNECT_BUTTON").Visible = true;
lobby.GetWidget("ALLOWCHEATS_CHECKBOX").Visible = true; break;
lobby.GetWidget("DISCONNECT_BUTTON").Visible = true; }
break; };
}
};
}
TestAndContinue(); TestAndContinue();
} }
void TestAndContinue() void TestAndContinue()
{ {
@@ -76,7 +74,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
} }
else else
{ {
MainMenuButtonsDelegate.DisplayModSelector(); MainMenuButtonsLogic.DisplayModSelector();
ShowInstallMethodDialog(); ShowInstallMethodDialog();
} }
} }

View File

@@ -11,12 +11,12 @@
using OpenRA.Traits; using OpenRA.Traits;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.RA.Widgets.Delegates namespace OpenRA.Mods.RA.Widgets.Logic
{ {
public class IngameChromeDelegate : IWidgetDelegate public class IngameChromeLogic
{ {
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public IngameChromeDelegate( [ObjectCreator.Param] World world ) public IngameChromeLogic( [ObjectCreator.Param] World world )
{ {
var r = Widget.RootWidget; var r = Widget.RootWidget;
var gameRoot = r.GetWidget("INGAME_ROOT"); var gameRoot = r.GetWidget("INGAME_ROOT");

View File

@@ -11,12 +11,12 @@
using OpenRA.Traits; using OpenRA.Traits;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.RA.Widgets.Delegates namespace OpenRA.Mods.RA.Widgets.Logic
{ {
public class IngameObserverChromeDelegate : IWidgetDelegate public class IngameObserverChromeLogic
{ {
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public IngameObserverChromeDelegate([ObjectCreator.Param] World world) public IngameObserverChromeLogic([ObjectCreator.Param] World world)
{ {
var r = Widget.RootWidget; var r = Widget.RootWidget;
var gameRoot = r.GetWidget("OBSERVER_ROOT"); var gameRoot = r.GetWidget("OBSERVER_ROOT");

View File

@@ -13,14 +13,14 @@ using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using OpenRA.FileFormats; using OpenRA.FileFormats;
using OpenRA.Graphics;
using OpenRA.Network; using OpenRA.Network;
using OpenRA.Traits; using OpenRA.Traits;
using OpenRA.Widgets; using OpenRA.Widgets;
using OpenRA.Graphics;
namespace OpenRA.Mods.RA.Widgets.Delegates namespace OpenRA.Mods.RA.Widgets.Logic
{ {
public class LobbyDelegate : IWidgetDelegate public class LobbyLogic
{ {
Widget LocalPlayerTemplate, RemotePlayerTemplate, EmptySlotTemplate, EmptySlotTemplateHost; Widget LocalPlayerTemplate, RemotePlayerTemplate, EmptySlotTemplate, EmptySlotTemplateHost;
ScrollPanelWidget Players; ScrollPanelWidget Players;
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
readonly OrderManager orderManager; readonly OrderManager orderManager;
readonly WorldRenderer worldRenderer; readonly WorldRenderer worldRenderer;
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
internal LobbyDelegate( [ObjectCreator.Param( "widget" )] Widget lobby, [ObjectCreator.Param] OrderManager orderManager, [ObjectCreator.Param] WorldRenderer worldRenderer) internal LobbyLogic( [ObjectCreator.Param( "widget" )] Widget lobby, [ObjectCreator.Param] OrderManager orderManager, [ObjectCreator.Param] WorldRenderer worldRenderer)
{ {
this.orderManager = orderManager; this.orderManager = orderManager;
this.worldRenderer = worldRenderer; this.worldRenderer = worldRenderer;

View File

@@ -17,12 +17,12 @@ using System;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
namespace OpenRA.Mods.RA.Widgets.Delegates namespace OpenRA.Mods.RA.Widgets.Logic
{ {
public class MainMenuButtonsDelegate : IWidgetDelegate public class MainMenuButtonsLogic
{ {
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public MainMenuButtonsDelegate([ObjectCreator.Param] Widget widget) public MainMenuButtonsLogic([ObjectCreator.Param] Widget widget)
{ {
Game.modData.WidgetLoader.LoadWidget( new WidgetArgs(), Widget.RootWidget, "PERF_BG" ); Game.modData.WidgetLoader.LoadWidget( new WidgetArgs(), Widget.RootWidget, "PERF_BG" );
widget.GetWidget("MAINMENU_BUTTON_JOIN").OnMouseUp = mi => { Widget.OpenWindow("JOINSERVER_BG"); return true; }; widget.GetWidget("MAINMENU_BUTTON_JOIN").OnMouseUp = mi => { Widget.OpenWindow("JOINSERVER_BG"); return true; };

View File

@@ -15,16 +15,16 @@ using OpenRA.Network;
using OpenRA.Widgets; using OpenRA.Widgets;
using System.IO; using System.IO;
namespace OpenRA.Mods.RA.Widgets.Delegates namespace OpenRA.Mods.RA.Widgets.Logic
{ {
public class MapChooserDelegate : IWidgetDelegate public class MapChooserLogic
{ {
Map Map = null; Map Map = null;
Widget scrollpanel; Widget scrollpanel;
ScrollItemWidget itemTemplate; ScrollItemWidget itemTemplate;
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
internal MapChooserDelegate( internal MapChooserLogic(
[ObjectCreator.Param( "widget" )] Widget bg, [ObjectCreator.Param( "widget" )] Widget bg,
[ObjectCreator.Param] OrderManager orderManager, [ObjectCreator.Param] OrderManager orderManager,
[ObjectCreator.Param] string mapName ) [ObjectCreator.Param] string mapName )

View File

@@ -14,12 +14,12 @@ using OpenRA.FileFormats;
using OpenRA.Support; using OpenRA.Support;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.RA.Widgets.Delegates namespace OpenRA.Mods.RA.Widgets.Logic
{ {
public class MusicPlayerDelegate : IWidgetDelegate public class MusicPlayerLogic
{ {
string CurrentSong = null; string CurrentSong = null;
public MusicPlayerDelegate() public MusicPlayerLogic()
{ {
var bg = Widget.RootWidget.GetWidget("MUSIC_MENU"); var bg = Widget.RootWidget.GetWidget("MUSIC_MENU");
CurrentSong = GetNextSong(); CurrentSong = GetNextSong();

View File

@@ -12,12 +12,12 @@ using OpenRA;
using OpenRA.Mods.RA.Orders; using OpenRA.Mods.RA.Orders;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.RA.Widgets.Delegates namespace OpenRA.Mods.RA.Widgets.Logic
{ {
public class OrderButtonsChromeDelegate : IWidgetDelegate public class OrderButtonsChromeLogic
{ {
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public OrderButtonsChromeDelegate( [ObjectCreator.Param] World world ) public OrderButtonsChromeLogic( [ObjectCreator.Param] World world )
{ {
var r = Widget.RootWidget; var r = Widget.RootWidget;
var gameRoot = r.GetWidget("INGAME_ROOT"); var gameRoot = r.GetWidget("INGAME_ROOT");

View File

@@ -11,11 +11,11 @@
using OpenRA.Support; using OpenRA.Support;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.RA.Widgets.Delegates namespace OpenRA.Mods.RA.Widgets.Logic
{ {
public class PerfDebugDelegate : IWidgetDelegate public class PerfDebugLogic
{ {
public PerfDebugDelegate() public PerfDebugLogic()
{ {
var r = Widget.RootWidget; var r = Widget.RootWidget;
var perfRoot = r.GetWidget("PERF_BG"); var perfRoot = r.GetWidget("PERF_BG");

View File

@@ -16,14 +16,14 @@ using OpenRA.FileFormats;
using OpenRA.Network; using OpenRA.Network;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.RA.Widgets.Delegates namespace OpenRA.Mods.RA.Widgets.Logic
{ {
public class ReplayBrowserDelegate : IWidgetDelegate public class ReplayBrowserLogic
{ {
Widget widget; Widget widget;
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public ReplayBrowserDelegate( [ObjectCreator.Param] Widget widget ) public ReplayBrowserLogic( [ObjectCreator.Param] Widget widget )
{ {
this.widget = widget; this.widget = widget;

View File

@@ -12,12 +12,11 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using OpenRA.FileFormats; using OpenRA.FileFormats;
using OpenRA.Network; using OpenRA.Network;
using OpenRA.Server;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.RA.Widgets.Delegates namespace OpenRA.Mods.RA.Widgets.Logic
{ {
public class ServerBrowserDelegate : IWidgetDelegate public class ServerBrowserLogic
{ {
static List<Widget> GameButtons = new List<Widget>(); static List<Widget> GameButtons = new List<Widget>();
@@ -25,7 +24,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
ScrollItemWidget ServerTemplate; ScrollItemWidget ServerTemplate;
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public ServerBrowserDelegate( [ObjectCreator.Param] Widget widget ) public ServerBrowserLogic( [ObjectCreator.Param] Widget widget )
{ {
var bg = widget.GetWidget("JOINSERVER_BG"); var bg = widget.GetWidget("JOINSERVER_BG");
@@ -170,10 +169,10 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
} }
public class DirectConnectDelegate : IWidgetDelegate public class DirectConnectLogic
{ {
[ObjectCreator.UseCtor] [ObjectCreator.UseCtor]
public DirectConnectDelegate( [ObjectCreator.Param] Widget widget ) public DirectConnectLogic( [ObjectCreator.Param] Widget widget )
{ {
var dc = widget.GetWidget("DIRECTCONNECT_BG"); var dc = widget.GetWidget("DIRECTCONNECT_BG");

View File

@@ -13,12 +13,12 @@ using OpenRA.FileFormats.Graphics;
using OpenRA.GameRules; using OpenRA.GameRules;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.RA.Widgets.Delegates namespace OpenRA.Mods.RA.Widgets.Logic
{ {
public class SettingsMenuDelegate : IWidgetDelegate public class SettingsMenuLogic
{ {
Widget bg; Widget bg;
public SettingsMenuDelegate() public SettingsMenuLogic()
{ {
bg = Widget.RootWidget.GetWidget<BackgroundWidget>("SETTINGS_MENU"); bg = Widget.RootWidget.GetWidget<BackgroundWidget>("SETTINGS_MENU");
var tabs = bg.GetWidget<ContainerWidget>("TAB_CONTAINER"); var tabs = bg.GetWidget<ContainerWidget>("TAB_CONTAINER");

View File

@@ -7,6 +7,7 @@
* see COPYING. * see COPYING.
*/ */
#endregion #endregion
using System; using System;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
@@ -84,7 +85,6 @@ namespace OpenRA.Mods.RA.Widgets
return CursorProvider.HasCursorSequence(cursor+"-minimap") ? cursor+"-minimap" : cursor; return CursorProvider.HasCursorSequence(cursor+"-minimap") ? cursor+"-minimap" : cursor;
} }
// TODO: RadarBinWidget doesn't support delegate methods for mouse input
public override bool HandleMouseInput(MouseInput mi) public override bool HandleMouseInput(MouseInput mi)
{ {
if (!hasRadar || radarAnimating) return false; // we're not set up for this. if (!hasRadar || radarAnimating) return false; // we're not set up for this.

View File

@@ -11,7 +11,6 @@ using System;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using OpenRA.Graphics; using OpenRA.Graphics;
using OpenRA.Traits;
using OpenRA.Widgets; using OpenRA.Widgets;
namespace OpenRA.Mods.RA.Widgets namespace OpenRA.Mods.RA.Widgets
@@ -85,7 +84,6 @@ namespace OpenRA.Mods.RA.Widgets
return CursorProvider.HasCursorSequence(cursor+"-minimap") ? cursor+"-minimap" : cursor; return CursorProvider.HasCursorSequence(cursor+"-minimap") ? cursor+"-minimap" : cursor;
} }
// TODO: RadarWidget doesn't support delegate methods for mouse input
public override bool HandleMouseInput(MouseInput mi) public override bool HandleMouseInput(MouseInput mi)
{ {
if (!hasRadar || Animating) return false; if (!hasRadar || Animating) return false;

View File

@@ -54,7 +54,6 @@ namespace OpenRA.Mods.RA.Widgets
get { return buttons.Any() ? buttons.Select(b => b.First).Aggregate(Rectangle.Union) : Bounds; } get { return buttons.Any() ? buttons.Select(b => b.First).Aggregate(Rectangle.Union) : Bounds; }
} }
// TODO: SpecialPowerBin doesn't support delegate methods for mouse input
public override bool HandleMouseInput(MouseInput mi) public override bool HandleMouseInput(MouseInput mi)
{ {
if (mi.Event == MouseInputEvent.Down) if (mi.Event == MouseInputEvent.Down)

View File

@@ -1,6 +1,6 @@
Container@CHEATS_PANEL: Container@CHEATS_PANEL:
Id:CHEATS_PANEL Id:CHEATS_PANEL
Delegate:CncCheatsLogic Logic:CncCheatsLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 110)/2 Y:(WINDOW_BOTTOM - 110)/2
Width:590 Width:590

View File

@@ -1,6 +1,6 @@
Container@CONNECTING_PANEL: Container@CONNECTING_PANEL:
Id:CONNECTING_PANEL Id:CONNECTING_PANEL
Delegate:CncConnectingLogic Logic:CncConnectingLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 90)/2 Y:(WINDOW_BOTTOM - 90)/2
Width:370 Width:370
@@ -36,7 +36,7 @@ Container@CONNECTING_PANEL:
Container@CONNECTIONFAILED_PANEL: Container@CONNECTIONFAILED_PANEL:
Id:CONNECTIONFAILED_PANEL Id:CONNECTIONFAILED_PANEL
Delegate:CncConnectionFailedLogic Logic:CncConnectionFailedLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 90)/2 Y:(WINDOW_BOTTOM - 90)/2
Width:370 Width:370

View File

@@ -3,7 +3,7 @@
# TODO: Have the advertise checkbox en/disable the external port textfield # TODO: Have the advertise checkbox en/disable the external port textfield
Container@CREATESERVER_PANEL: Container@CREATESERVER_PANEL:
Id:CREATESERVER_PANEL Id:CREATESERVER_PANEL
Delegate:CncServerCreationLogic Logic:CncServerCreationLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 260)/2 Y:(WINDOW_BOTTOM - 260)/2
Width:604 Width:604

View File

@@ -1,6 +1,6 @@
Container@DIPLOMACY_PANEL: Container@DIPLOMACY_PANEL:
Id:DIPLOMACY_PANEL Id:DIPLOMACY_PANEL
Delegate:CncDiplomacyLogic Logic:CncDiplomacyLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 400)/2 Y:(WINDOW_BOTTOM - 400)/2
Width:450 Width:450

View File

@@ -1,6 +1,6 @@
Container@DIRECTCONNECT_PANEL: Container@DIRECTCONNECT_PANEL:
Id:DIRECTCONNECT_PANEL Id:DIRECTCONNECT_PANEL
Delegate:CncDirectConnectLogic Logic:CncDirectConnectLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 90)/2 Y:(WINDOW_BOTTOM - 90)/2
Width:370 Width:370

View File

@@ -1,6 +1,6 @@
Background@COLOR_CHOOSER: Background@COLOR_CHOOSER:
Id:COLOR_CHOOSER Id:COLOR_CHOOSER
Delegate:CncColorPickerLogic Logic:CncColorPickerLogic
Background:panel-black Background:panel-black
Width:315 Width:315
Height:130 Height:130

View File

@@ -1,6 +1,6 @@
Container@INGAME_ROOT: Container@INGAME_ROOT:
Id:INGAME_ROOT Id:INGAME_ROOT
Delegate:CncIngameChromeLogic Logic:CncIngameChromeLogic
Children: Children:
WorldInteractionController: WorldInteractionController:
Id:INTERACTION_CONTROLLER Id:INTERACTION_CONTROLLER
@@ -57,7 +57,7 @@ Container@INGAME_ROOT:
UseContrast: yes UseContrast: yes
Container@PERFORMANCE_INFO: Container@PERFORMANCE_INFO:
Id:PERFORMANCE_INFO Id:PERFORMANCE_INFO
Delegate:CncPerfDebugLogic Logic:CncPerfDebugLogic
Children: Children:
Label@PERF_TEXT: Label@PERF_TEXT:
Id:PERF_TEXT Id:PERF_TEXT
@@ -123,7 +123,7 @@ Container@INGAME_ROOT:
Children: Children:
OrderButton@SELL: OrderButton@SELL:
Id:SELL Id:SELL
Delegate:OrderButtonsChromeDelegate Logic:OrderButtonsChromeLogic
X:39 X:39
Y:0 Y:0
Width:30 Width:30
@@ -133,7 +133,7 @@ Container@INGAME_ROOT:
LongDesc:Sell buildings, reclaiming a \nproportion of their build cost LongDesc:Sell buildings, reclaiming a \nproportion of their build cost
OrderButton@REPAIR: OrderButton@REPAIR:
Id:REPAIR Id:REPAIR
Delegate:OrderButtonsChromeDelegate Logic:OrderButtonsChromeLogic
X:75 X:75
Y:0 Y:0
Width:30 Width:30

View File

@@ -2,7 +2,7 @@ Container@INGAME_MENU:
Id:INGAME_MENU Id:INGAME_MENU
Width:WINDOW_RIGHT Width:WINDOW_RIGHT
Height:WINDOW_BOTTOM Height:WINDOW_BOTTOM
Delegate:CncIngameMenuLogic Logic:CncIngameMenuLogic
Children: Children:
Image@RETICLE: Image@RETICLE:
X:(WINDOW_RIGHT-WIDTH)/2 X:(WINDOW_RIGHT-WIDTH)/2

View File

@@ -27,7 +27,7 @@ Container@INSTALL_BACKGROUND:
Container@INSTALL_PANEL: Container@INSTALL_PANEL:
Id:INSTALL_PANEL Id:INSTALL_PANEL
Delegate:CncInstallLogic Logic:CncInstallLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 150)/2 Y:(WINDOW_BOTTOM - 150)/2
Width:640 Width:640
@@ -95,7 +95,7 @@ Container@INSTALL_PANEL:
Container@INSTALL_FROMCD_PANEL: Container@INSTALL_FROMCD_PANEL:
Id:INSTALL_FROMCD_PANEL Id:INSTALL_FROMCD_PANEL
Delegate:CncInstallFromCDLogic Logic:CncInstallFromCDLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 150)/2 Y:(WINDOW_BOTTOM - 150)/2
Width:640 Width:640
@@ -148,7 +148,7 @@ Container@INSTALL_FROMCD_PANEL:
Container@INSTALL_DOWNLOAD_PANEL: Container@INSTALL_DOWNLOAD_PANEL:
Id:INSTALL_DOWNLOAD_PANEL Id:INSTALL_DOWNLOAD_PANEL
Delegate:CncDownloadPackagesLogic Logic:CncDownloadPackagesLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 150)/2 Y:(WINDOW_BOTTOM - 150)/2
Width:640 Width:640

View File

@@ -1,6 +1,6 @@
Container@SERVER_LOBBY: Container@SERVER_LOBBY:
Id:SERVER_LOBBY Id:SERVER_LOBBY
Delegate:CncLobbyLogic Logic:CncLobbyLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 500)/2 Y:(WINDOW_BOTTOM - 500)/2
Width:740 Width:740

View File

@@ -2,7 +2,7 @@ Container@MENU_BACKGROUND:
Id:MENU_BACKGROUND Id:MENU_BACKGROUND
Width:WINDOW_RIGHT Width:WINDOW_RIGHT
Height:WINDOW_BOTTOM Height:WINDOW_BOTTOM
Delegate:CncMenuLogic Logic:CncMenuLogic
Children: Children:
Image@RETICLE: Image@RETICLE:
X:(WINDOW_RIGHT-WIDTH)/2 X:(WINDOW_RIGHT-WIDTH)/2
@@ -176,7 +176,7 @@ Container@MENU_BACKGROUND:
Text:Back Text:Back
Container@PERFORMANCE_INFO: Container@PERFORMANCE_INFO:
Id:PERFORMANCE_INFO Id:PERFORMANCE_INFO
Delegate:CncPerfDebugLogic Logic:CncPerfDebugLogic
Children: Children:
Label@PERF_TEXT: Label@PERF_TEXT:
Id:PERF_TEXT Id:PERF_TEXT

View File

@@ -1,6 +1,6 @@
Container@MAPCHOOSER_PANEL: Container@MAPCHOOSER_PANEL:
Id:MAPCHOOSER_PANEL Id:MAPCHOOSER_PANEL
Delegate:CncMapChooserLogic Logic:CncMapChooserLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 500)/2 Y:(WINDOW_BOTTOM - 500)/2
Width:740 Width:740

View File

@@ -1,6 +1,6 @@
Container@MODS_PANEL: Container@MODS_PANEL:
Id:MODS_PANEL Id:MODS_PANEL
Delegate:CncModBrowserLogic Logic:CncModBrowserLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 500)/2 Y:(WINDOW_BOTTOM - 500)/2
Width:740 Width:740

View File

@@ -1,6 +1,6 @@
Container@MUSIC_PANEL: Container@MUSIC_PANEL:
Id:MUSIC_PANEL Id:MUSIC_PANEL
Delegate:CncMusicPlayerLogic Logic:CncMusicPlayerLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 400)/2 Y:(WINDOW_BOTTOM - 400)/2
Width:360 Width:360
@@ -201,7 +201,7 @@ Container@MUSIC_PANEL:
Container@INSTALL_MUSIC_PANEL: Container@INSTALL_MUSIC_PANEL:
Id:INSTALL_MUSIC_PANEL Id:INSTALL_MUSIC_PANEL
Delegate:CncInstallMusicLogic Logic:CncInstallMusicLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 150)/2 Y:(WINDOW_BOTTOM - 150)/2
Width:640 Width:640

View File

@@ -1,6 +1,6 @@
Container@SETTINGS_PANEL: Container@SETTINGS_PANEL:
Id:SETTINGS_PANEL Id:SETTINGS_PANEL
Delegate:CncSettingsLogic Logic:CncSettingsLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 250)/2 Y:(WINDOW_BOTTOM - 250)/2
Width:740 Width:740

View File

@@ -1,6 +1,6 @@
Container@REPLAYBROWSER_PANEL: Container@REPLAYBROWSER_PANEL:
Id:REPLAYBROWSER_PANEL Id:REPLAYBROWSER_PANEL
Delegate:CncReplayBrowserLogic Logic:CncReplayBrowserLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 300)/2 Y:(WINDOW_BOTTOM - 300)/2
Width:520 Width:520

View File

@@ -1,6 +1,6 @@
Container@SERVERBROWSER_PANEL: Container@SERVERBROWSER_PANEL:
Id:SERVERBROWSER_PANEL Id:SERVERBROWSER_PANEL
Delegate:CncServerBrowserLogic Logic:CncServerBrowserLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - 500)/2 Y:(WINDOW_BOTTOM - 500)/2
Width:740 Width:740

View File

@@ -5,7 +5,7 @@ GameInitInfo@INIT_SETUP:
PackageURL:http://open-ra.org/get-dependency.php?file=ra-packages PackageURL:http://open-ra.org/get-dependency.php?file=ra-packages
PackagePath:^/Content/ra PackagePath:^/Content/ra
InstallMode:ra InstallMode:ra
Delegate:GameInitDelegate Logic:GameInitLogic
Background@INIT_CHOOSEINSTALL: Background@INIT_CHOOSEINSTALL:
Id:INIT_CHOOSEINSTALL Id:INIT_CHOOSEINSTALL

View File

@@ -1,6 +1,6 @@
Background@SERVER_LOBBY: Background@SERVER_LOBBY:
Id:SERVER_LOBBY Id:SERVER_LOBBY
Delegate:LobbyDelegate Logic:LobbyLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - HEIGHT)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:800 Width:800
@@ -431,7 +431,7 @@ Background@MAP_CHOOSER:
Id:MAP_CHOOSER Id:MAP_CHOOSER
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - HEIGHT)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2
Delegate:MapChooserDelegate Logic:MapChooserLogic
Width:800 Width:800
Height:600 Height:600
Children: Children:

View File

@@ -1,6 +1,6 @@
Container@INGAME_ROOT: Container@INGAME_ROOT:
Id:INGAME_ROOT Id:INGAME_ROOT
Delegate:IngameChromeDelegate Logic:IngameChromeLogic
Children: Children:
WorldInteractionController: WorldInteractionController:
Id:INTERACTION_CONTROLLER Id:INTERACTION_CONTROLLER
@@ -93,7 +93,7 @@ Container@INGAME_ROOT:
Children: Children:
OrderButton@SELL: OrderButton@SELL:
Id:SELL Id:SELL
Delegate:OrderButtonsChromeDelegate Logic:OrderButtonsChromeLogic
X:3 X:3
Y:0 Y:0
Width:30 Width:30
@@ -103,7 +103,7 @@ Container@INGAME_ROOT:
LongDesc:Sell buildings, reclaiming a \nproportion of their build cost LongDesc:Sell buildings, reclaiming a \nproportion of their build cost
OrderButton@POWER_DOWN: OrderButton@POWER_DOWN:
Id:POWER_DOWN Id:POWER_DOWN
Delegate:OrderButtonsChromeDelegate Logic:OrderButtonsChromeLogic
X:39 X:39
Y:0 Y:0
Width:30 Width:30
@@ -113,7 +113,7 @@ Container@INGAME_ROOT:
LongDesc:Disable unneeded structures so their \npower can be used elsewhere LongDesc:Disable unneeded structures so their \npower can be used elsewhere
OrderButton@REPAIR: OrderButton@REPAIR:
Id:REPAIR Id:REPAIR
Delegate:OrderButtonsChromeDelegate Logic:OrderButtonsChromeLogic
X:75 X:75
Y:0 Y:0
Width:30 Width:30
@@ -189,7 +189,7 @@ Container@INGAME_ROOT:
Font:Bold Font:Bold
Background@DIPLOMACY_BG: Background@DIPLOMACY_BG:
Id:DIPLOMACY_BG Id:DIPLOMACY_BG
Delegate:DiplomacyDelegate Logic:DiplomacyLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - HEIGHT)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:450 Width:450
@@ -223,7 +223,7 @@ Container@INGAME_ROOT:
UseContrast: yes UseContrast: yes
Background@DEVELOPERMODE_BG: Background@DEVELOPERMODE_BG:
Id:DEVELOPERMODE_BG Id:DEVELOPERMODE_BG
Delegate:DeveloperModeDelegate Logic:DeveloperModeLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - HEIGHT)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:350 Width:350
@@ -305,7 +305,7 @@ Container@INGAME_ROOT:
ClickThrough:true ClickThrough:true
Id:PERF_BG Id:PERF_BG
Background:dialog4 Background:dialog4
Delegate:PerfDebugDelegate Logic:PerfDebugLogic
X:10 X:10
Y:WINDOW_BOTTOM - 250 Y:WINDOW_BOTTOM - 250
Width: 210 Width: 210
@@ -326,7 +326,7 @@ Container@INGAME_ROOT:
Container@OBSERVER_ROOT: Container@OBSERVER_ROOT:
Id:OBSERVER_ROOT Id:OBSERVER_ROOT
Visible:true Visible:true
Delegate:IngameObserverChromeDelegate Logic:IngameObserverChromeLogic
Children: Children:
WorldInteractionController: WorldInteractionController:
X:0 X:0
@@ -455,7 +455,7 @@ Container@OBSERVER_ROOT:
ClickThrough:true ClickThrough:true
Id:PERF_BG Id:PERF_BG
Background:dialog4 Background:dialog4
Delegate:PerfDebugDelegate Logic:PerfDebugLogic
X:10 X:10
Y:WINDOW_BOTTOM - 250 Y:WINDOW_BOTTOM - 250
Width: 210 Width: 210

View File

@@ -5,7 +5,7 @@ Background@MAINMENU_BG:
Width:250 Width:250
Height:330 Height:330
Visible:true Visible:true
Delegate:MainMenuButtonsDelegate Logic:MainMenuButtonsLogic
Children: Children:
Label@MAINMENU_LABEL_TITLE: Label@MAINMENU_LABEL_TITLE:
Id:MAINMENU_LABEL_TITLE Id:MAINMENU_LABEL_TITLE
@@ -99,7 +99,7 @@ Background@PERF_BG:
ClickThrough:true ClickThrough:true
Id:PERF_BG Id:PERF_BG
Background:dialog4 Background:dialog4
Delegate:PerfDebugDelegate Logic:PerfDebugLogic
X:10 X:10
Y:WINDOW_BOTTOM - 250 Y:WINDOW_BOTTOM - 250
Width: 210 Width: 210
@@ -119,7 +119,7 @@ Background@PERF_BG:
Height:40 Height:40
Background@MUSIC_MENU: Background@MUSIC_MENU:
Id:MUSIC_MENU Id:MUSIC_MENU
Delegate:MusicPlayerDelegate Logic:MusicPlayerLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - HEIGHT)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2
Width: 450 Width: 450

View File

@@ -1,6 +1,6 @@
Background@REPLAYBROWSER_BG: Background@REPLAYBROWSER_BG:
Id:REPLAYBROWSER_BG Id:REPLAYBROWSER_BG
Delegate:ReplayBrowserDelegate Logic:ReplayBrowserLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - HEIGHT)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:700 Width:700

View File

@@ -1,6 +1,6 @@
Background@CREATESERVER_BG: Background@CREATESERVER_BG:
Id:CREATESERVER_BG Id:CREATESERVER_BG
Delegate:CreateServerMenuDelegate Logic:CreateServerMenuLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - HEIGHT)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:400 Width:400
@@ -87,7 +87,7 @@ Background@CREATESERVER_BG:
Font:Bold Font:Bold
Background@JOINSERVER_BG: Background@JOINSERVER_BG:
Id:JOINSERVER_BG Id:JOINSERVER_BG
Delegate:ServerBrowserDelegate Logic:ServerBrowserLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - HEIGHT)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:700 Width:700
@@ -242,7 +242,7 @@ Background@JOINSERVER_BG:
Font:Bold Font:Bold
Background@DIRECTCONNECT_BG: Background@DIRECTCONNECT_BG:
Id:DIRECTCONNECT_BG Id:DIRECTCONNECT_BG
Delegate:DirectConnectDelegate Logic:DirectConnectLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - HEIGHT)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:400 Width:400
@@ -290,7 +290,7 @@ Background@DIRECTCONNECT_BG:
Font:Bold Font:Bold
Background@CONNECTION_FAILED_BG: Background@CONNECTION_FAILED_BG:
Id:CONNECTION_FAILED_BG Id:CONNECTION_FAILED_BG
Delegate:ConnectionFailedDelegate Logic:ConnectionFailedLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - HEIGHT)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:450 Width:450
@@ -331,7 +331,7 @@ Background@CONNECTION_FAILED_BG:
Font:Bold Font:Bold
Background@CONNECTING_BG: Background@CONNECTING_BG:
Id:CONNECTING_BG Id:CONNECTING_BG
Delegate:ConnectionDialogsDelegate Logic:ConnectionDialogsLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM - HEIGHT)/2 Y:(WINDOW_BOTTOM - HEIGHT)/2
Width:450 Width:450

View File

@@ -1,6 +1,6 @@
Background@SETTINGS_MENU: Background@SETTINGS_MENU:
Id:SETTINGS_MENU Id:SETTINGS_MENU
Delegate:SettingsMenuDelegate Logic:SettingsMenuLogic
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2
Y:(WINDOW_BOTTOM- HEIGHT)/2 Y:(WINDOW_BOTTOM- HEIGHT)/2
Width: 450 Width: 450