StyleCop clean D2k Mod DLL
This commit is contained in:
@@ -22,13 +22,13 @@ namespace OpenRA.Mods.D2k.Widgets.Logic
|
||||
public class D2kDownloadPackagesLogic
|
||||
{
|
||||
Widget panel;
|
||||
Dictionary<string,string> installData;
|
||||
Dictionary<string, string> installData;
|
||||
ProgressBarWidget progressBar;
|
||||
LabelWidget statusLabel;
|
||||
Action afterInstall;
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public D2kDownloadPackagesLogic(Widget widget, Dictionary<string,string> installData, Action afterInstall)
|
||||
public D2kDownloadPackagesLogic(Widget widget, Dictionary<string, string> installData, Action afterInstall)
|
||||
{
|
||||
this.installData = installData;
|
||||
this.afterInstall = afterInstall;
|
||||
@@ -71,7 +71,7 @@ namespace OpenRA.Mods.D2k.Widgets.Logic
|
||||
{
|
||||
Game.RunAfterTick(() =>
|
||||
{
|
||||
statusLabel.GetText = () => "Error: "+s;
|
||||
statusLabel.GetText = () => "Error: " + s;
|
||||
retryButton.IsVisible = () => true;
|
||||
});
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,8 +14,8 @@ using System.Linq;
|
||||
using System.Threading;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.FileFormats.Graphics;
|
||||
using OpenRA.Widgets;
|
||||
using OpenRA.Utility;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.D2k.Widgets.Logic
|
||||
{
|
||||
@@ -51,8 +51,8 @@ namespace OpenRA.Mods.D2k.Widgets.Logic
|
||||
public static bool IsValidDisk(string diskRoot)
|
||||
{
|
||||
var files = new string[][] {
|
||||
new [] { diskRoot, "music", "ambush.aud" },
|
||||
new [] { diskRoot, "setup", "setup.z" },
|
||||
new[] { diskRoot, "music", "ambush.aud" },
|
||||
new[] { diskRoot, "setup", "setup.z" },
|
||||
};
|
||||
|
||||
return files.All(f => File.Exists(f.Aggregate(Path.Combine)));
|
||||
@@ -79,8 +79,8 @@ namespace OpenRA.Mods.D2k.Widgets.Logic
|
||||
installingContainer.IsVisible = () => true;
|
||||
|
||||
var destMusic = new string[] { Platform.SupportDir, "Content", "d2k", "Music" }.Aggregate(Path.Combine);
|
||||
var destData = new [] { Platform.SupportDir, "Content", "d2k" }.Aggregate(Path.Combine);
|
||||
var destSound = new [] { destData, "GAMESFX" }.Aggregate(Path.Combine);
|
||||
var destData = new[] { Platform.SupportDir, "Content", "d2k" }.Aggregate(Path.Combine);
|
||||
var destSound = new[] { destData, "GAMESFX" }.Aggregate(Path.Combine);
|
||||
var copyFiles = new string[] { "music/ambush.aud", "music/arakatak.aud", "music/atregain.aud", "music/entordos.aud", "music/fightpwr.aud", "music/fremen.aud", "music/hark_bat.aud", "music/landsand.aud", "music/options.aud", "music/plotting.aud", "music/risehark.aud", "music/robotix.aud", "music/score.aud", "music/soldappr.aud", "music/spicesct.aud", "music/undercon.aud", "music/waitgame.aud" };
|
||||
|
||||
var extractPackage = "setup/setup.z";
|
||||
@@ -123,7 +123,7 @@ namespace OpenRA.Mods.D2k.Widgets.Logic
|
||||
|
||||
var onProgress = (Action<string>)(s => Game.RunAfterTick(() =>
|
||||
{
|
||||
progressBar.Percentage = installCounter*100/installTotal;
|
||||
progressBar.Percentage = installCounter * 100 / installTotal;
|
||||
installCounter++;
|
||||
|
||||
statusLabel.GetText = () => s;
|
||||
@@ -131,12 +131,12 @@ namespace OpenRA.Mods.D2k.Widgets.Logic
|
||||
|
||||
var onError = (Action<string>)(s => Game.RunAfterTick(() =>
|
||||
{
|
||||
statusLabel.GetText = () => "Error: "+s;
|
||||
statusLabel.GetText = () => "Error: " + s;
|
||||
backButton.IsDisabled = () => false;
|
||||
retryButton.IsDisabled = () => false;
|
||||
}));
|
||||
|
||||
var t = new Thread( _ =>
|
||||
var t = new Thread(_ =>
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace OpenRA.Mods.D2k.Widgets.Logic
|
||||
public class D2kInstallLogic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public D2kInstallLogic(Widget widget, Dictionary<string,string> installData, Action continueLoading)
|
||||
public D2kInstallLogic(Widget widget, Dictionary<string, string> installData, Action continueLoading)
|
||||
{
|
||||
var panel = widget.Get("INSTALL_PANEL");
|
||||
var args = new WidgetArgs()
|
||||
@@ -41,9 +41,8 @@ namespace OpenRA.Mods.D2k.Widgets.Logic
|
||||
panel.Get<ButtonWidget>("MODS_BUTTON").OnClick = () =>
|
||||
{
|
||||
Ui.OpenWindow("MODS_PANEL", new WidgetArgs()
|
||||
{
|
||||
{ "onExit", () => {} },
|
||||
// Close this panel
|
||||
{
|
||||
{ "onExit", () => { } },
|
||||
{ "onSwitch", Ui.CloseWindow },
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user