StyleCop clean D2k Mod DLL
This commit is contained in:
@@ -21,10 +21,10 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
class CaptureNotification : INotifyCapture
|
||||
{
|
||||
CaptureNotificationInfo Info;
|
||||
CaptureNotificationInfo captureInfo;
|
||||
public CaptureNotification(CaptureNotificationInfo info)
|
||||
{
|
||||
Info = info;
|
||||
captureInfo = info;
|
||||
}
|
||||
|
||||
public void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner)
|
||||
@@ -32,8 +32,7 @@ namespace OpenRA.Mods.RA
|
||||
if (captor.World.LocalPlayer != captor.Owner)
|
||||
return;
|
||||
|
||||
Sound.PlayNotification(captor.World.LocalPlayer, "Speech", Info.Notification, newOwner.Country.Race);
|
||||
Sound.PlayNotification(captor.World.LocalPlayer, "Speech", captureInfo.Notification, newOwner.Country.Race);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Network;
|
||||
@@ -21,27 +21,28 @@ namespace OpenRA.Mods.D2k
|
||||
{
|
||||
public class D2kLoadScreen : ILoadScreen
|
||||
{
|
||||
Dictionary<string, string> Info;
|
||||
static string[] Comments = new[] {"Filling Crates...", "Breeding Sandworms..."};
|
||||
public static string[] Comments = new[] { "Filling Crates...", "Breeding Sandworms..." };
|
||||
public Dictionary<string, string> Info;
|
||||
|
||||
Stopwatch lastLoadScreen = new Stopwatch();
|
||||
Rectangle StripeRect;
|
||||
Sprite Stripe, Logo;
|
||||
float2 LogoPos;
|
||||
Rectangle stripeRect;
|
||||
Sprite stripe, Logo;
|
||||
float2 logoPos;
|
||||
|
||||
Renderer r;
|
||||
public void Init(Dictionary<string, string> info)
|
||||
{
|
||||
Info = info;
|
||||
|
||||
// Avoid standard loading mechanisms so we
|
||||
// can display loadscreen as early as possible
|
||||
r = Game.Renderer;
|
||||
if (r == null) return;
|
||||
var s = new Sheet("mods/d2k/uibits/loadscreen.png");
|
||||
Logo = new Sprite(s, new Rectangle(0, 0, 256, 256), TextureChannel.Alpha);
|
||||
Stripe = new Sprite(s, new Rectangle(256,0,256,256), TextureChannel.Alpha);
|
||||
StripeRect = new Rectangle(0, Renderer.Resolution.Height/2 - 128, Renderer.Resolution.Width, 256);
|
||||
LogoPos = new float2(Renderer.Resolution.Width/2 - 128, Renderer.Resolution.Height/2 - 128);
|
||||
stripe = new Sprite(s, new Rectangle(256, 0, 256, 256), TextureChannel.Alpha);
|
||||
stripeRect = new Rectangle(0, Renderer.Resolution.Height / 2 - 128, Renderer.Resolution.Width, 256);
|
||||
logoPos = new float2(Renderer.Resolution.Width / 2 - 128, Renderer.Resolution.Height / 2 - 128);
|
||||
}
|
||||
|
||||
public void Display()
|
||||
@@ -61,8 +62,8 @@ namespace OpenRA.Mods.D2k
|
||||
var textSize = r.Fonts["Bold"].Measure(text);
|
||||
|
||||
r.BeginFrame(float2.Zero, 1f);
|
||||
WidgetUtils.FillRectWithSprite(StripeRect, Stripe);
|
||||
r.RgbaSpriteRenderer.DrawSprite(Logo, LogoPos);
|
||||
WidgetUtils.FillRectWithSprite(stripeRect, stripe);
|
||||
r.RgbaSpriteRenderer.DrawSprite(Logo, logoPos);
|
||||
r.Fonts["Bold"].DrawText(text, new float2(Renderer.Resolution.Width - textSize.X - 20, Renderer.Resolution.Height - textSize.Y - 20), Color.White);
|
||||
r.EndFrame(new NullInputHandler());
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
|
||||
@@ -43,7 +43,6 @@ namespace OpenRA.Mods.D2k.Widgets.Logic
|
||||
Ui.OpenWindow("MODS_PANEL", new WidgetArgs()
|
||||
{
|
||||
{ "onExit", () => { } },
|
||||
// Close this panel
|
||||
{ "onSwitch", Ui.CloseWindow },
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user