Merge pull request #10542 from RoosterDragon/simplify

General Cleanup
This commit is contained in:
abcdefg30
2016-01-18 11:37:30 +01:00
304 changed files with 218 additions and 639 deletions

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
public ColorPickerLogic(Widget widget, World world, HSLColor initialColor, Action<HSLColor> onChange, WorldRenderer worldRenderer)
{
string actorType;
if (!ChromeMetrics.TryGet<string>("ColorPickerActorType", out actorType))
if (!ChromeMetrics.TryGet("ColorPickerActorType", out actorType))
actorType = "mcv";
var preview = widget.GetOrNull<ActorPreviewWidget>("PREVIEW");

View File

@@ -9,14 +9,9 @@
#endregion
using System;
using System.Drawing;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.Graphics;
using OpenRA.Mods.Common;
using OpenRA.Mods.Common.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Mods.Common.Widgets;
using OpenRA.Primitives;
using OpenRA.Traits;
using OpenRA.Widgets;
@@ -38,7 +33,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
[ObjectCreator.UseCtor]
public ActorSelectorLogic(Widget widget, World world, WorldRenderer worldRenderer)
{
this.mapRules = world.Map.Rules;
mapRules = world.Map.Rules;
this.world = world;
this.worldRenderer = worldRenderer;
@@ -126,7 +121,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
// Scale templates to fit within the panel
var scale = 1f;
if (scale * preview.IdealPreviewSize.X > itemTemplate.Bounds.Width)
scale = (float)(itemTemplate.Bounds.Width - panel.ItemSpacing) / (float)preview.IdealPreviewSize.X;
scale = (itemTemplate.Bounds.Width - panel.ItemSpacing) / (float)preview.IdealPreviewSize.X;
preview.GetScale = () => scale;
preview.Bounds.Width = (int)(scale * preview.IdealPreviewSize.X);

View File

@@ -8,9 +8,7 @@
*/
#endregion
using System;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.Graphics;
using OpenRA.Traits;
using OpenRA.Widgets;
@@ -32,7 +30,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
this.modRules = modRules;
this.worldRenderer = worldRenderer;
this.world = worldRenderer.World;
world = worldRenderer.World;
editor = widget.Parent.Get<EditorViewportControllerWidget>("MAP_EDITOR");

View File

@@ -9,10 +9,6 @@
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.GameRules;
using OpenRA.Graphics;
using OpenRA.Widgets;

View File

@@ -9,14 +9,7 @@
#endregion
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using OpenRA;
using OpenRA.FileFormats;
using OpenRA.Mods.Common.Widgets;
using OpenRA.Traits;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets.Logic

View File

@@ -12,7 +12,6 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using OpenRA.Mods.Common.Traits;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets.Logic

View File

@@ -10,7 +10,6 @@
using System;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.Graphics;
using OpenRA.Widgets;

View File

@@ -8,12 +8,7 @@
*/
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Threading;
using OpenRA.Chat;
using OpenRA.Widgets;

View File

@@ -11,7 +11,6 @@
using System;
using System.Linq;
using OpenRA.Mods.Common.Traits;
using OpenRA.Mods.Common.Widgets;
using OpenRA.Network;
using OpenRA.Widgets;

View File

@@ -9,7 +9,6 @@
#endregion
using OpenRA.Graphics;
using OpenRA.Mods.Common.Widgets;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets.Logic

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System;
using System.Linq;
using OpenRA.Mods.Common.Scripting;
using OpenRA.Traits;

View File

@@ -12,7 +12,6 @@ using System;
using System.Drawing;
using System.Linq;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets.Logic

View File

@@ -10,7 +10,6 @@
using System.Drawing;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Network;
using OpenRA.Primitives;
@@ -63,7 +62,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
nameLabel.GetText = () =>
{
var suffix = pp.WinState == WinState.Undefined ? "" : " (" + pp.WinState + ")";
if (client != null && client.State == Network.Session.ClientState.Disconnected)
if (client != null && client.State == Session.ClientState.Disconnected)
suffix = " (Gone)";
var sl = suffixLength.Update(suffix);

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Mods.Common.Commands;

View File

@@ -10,9 +10,7 @@
using System;
using System.Linq;
using OpenRA.Mods.Common.Orders;
using OpenRA.Mods.Common.Traits;
using OpenRA.Mods.Common.Widgets;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets.Logic

View File

@@ -8,11 +8,7 @@
*/
#endregion
using System;
using System.Linq;
using OpenRA.Mods.Common.Orders;
using OpenRA.Mods.Common.Traits;
using OpenRA.Mods.Common.Widgets;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets.Logic

View File

@@ -9,7 +9,6 @@
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using OpenRA.Traits;
using OpenRA.Widgets;

View File

@@ -9,7 +9,6 @@
#endregion
using System;
using System.Net;
using OpenRA.Graphics;
using OpenRA.Network;
using OpenRA.Widgets;

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System;
using OpenRA.Network;
using OpenRA.Widgets;

View File

@@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
return item;
};
dropdown.ShowDropDown<SlotDropDownOption>("LABEL_DROPDOWN_TEMPLATE", 167, options, setupItem);
dropdown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 167, options, setupItem);
}
public static void ShowTeamDropDown(DropDownButtonWidget dropdown, Session.Client client,
@@ -490,7 +490,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
playerName.GetText = () =>
{
var suffix = player.WinState == WinState.Undefined ? "" : " (" + player.WinState + ")";
if (client != null && client.State == Network.Session.ClientState.Disconnected)
if (client != null && client.State == Session.ClientState.Disconnected)
suffix = " (Gone)";
var sl = suffixLength.Update(suffix);

View File

@@ -244,7 +244,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
void LoadMapIntoEditor(Map map)
{
ConnectionLogic.Connect(System.Net.IPAddress.Loopback.ToString(),
ConnectionLogic.Connect(IPAddress.Loopback.ToString(),
Game.CreateLocalServer(map.Uid),
"",
() => { Game.LoadEditor(map.Uid); },

View File

@@ -12,10 +12,8 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading;
using OpenRA.Graphics;
using OpenRA.Network;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets.Logic

View File

@@ -16,7 +16,6 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using OpenRA.FileFormats;
using OpenRA.Mods.Common.Widgets;
using OpenRA.Primitives;
using OpenRA.Widgets;