Fix newlines in C# files.

This commit is contained in:
Paul Chote
2018-07-01 00:48:03 +01:00
committed by reaperrr
parent 6b6167d37c
commit 8c0f4fde81
15 changed files with 51 additions and 51 deletions

View File

@@ -27,10 +27,10 @@ namespace OpenRA.Mods.Common.Activities
}
protected override void OnFirstRun(Actor self)
{
// Reset the ReloadDelay to avoid any issues with early cancellation
{
// Reset the ReloadDelay to avoid any issues with early cancellation
// from previous reload attempts (explicit order, host building died, etc).
// HACK: this really shouldn't be managed from here
// HACK: this really shouldn't be managed from here
foreach (var pool in ammoPools)
pool.RemainingTicks = pool.Info.ReloadDelay;
}

View File

@@ -109,24 +109,24 @@ namespace OpenRA.Mods.Common.SpriteLoaders
}
var trimmedWidth = right - left + 1;
var trimmedHeight = bottom - top + 1;
// Pad the dimensions to an even number to avoid issues with half-integer offsets
var trimmedHeight = bottom - top + 1;
// Pad the dimensions to an even number to avoid issues with half-integer offsets
var widthFudge = trimmedWidth % 2;
var heightFudge = trimmedHeight % 2;
var destWidth = trimmedWidth + widthFudge;
var destHeight = trimmedHeight + heightFudge;
var destHeight = trimmedHeight + heightFudge;
if (trimmedWidth == origSize.Width && trimmedHeight == origSize.Height)
{
// Nothing to trim, so copy old data directly
{
// Nothing to trim, so copy old data directly
Size = header.Size;
FrameSize = header.FrameSize;
Offset = header.Offset;
Data = header.Data;
}
else if (trimmedWidth > 0 && trimmedHeight > 0)
{
{
// Trim frame
Data = new byte[destWidth * destHeight];
for (var y = 0; y < trimmedHeight; y++)
@@ -139,8 +139,8 @@ namespace OpenRA.Mods.Common.SpriteLoaders
top + bottom + heightFudge - origSize.Height + 1);
}
else
{
// Empty frame
{
// Empty frame
Data = new byte[0];
}
}

View File

@@ -86,7 +86,7 @@ namespace OpenRA.Mods.Common.Traits
{
amount = resources.ChangeCash(amount);
if (info.ShowTicks && amount != 0)
if (info.ShowTicks && amount != 0)
AddCashTick(self, amount);
}
}

View File

@@ -1,4 +1,4 @@
#region Copyright & License Information
#region Copyright & License Information
/*
* Copyright 2007-2018 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Traits
var resources = newOwner.PlayerActor.Trait<PlayerResources>();
var amount = resources.ChangeCash(info.Amount);
var amount = resources.ChangeCash(info.Amount);
if (!info.ShowTicks && amount != 0)
return;

View File

@@ -88,16 +88,16 @@ namespace OpenRA.Mods.Common.Traits
public int ChangeCash(int amount)
{
if (amount >= 0)
if (amount >= 0)
GiveCash(amount);
else
else
{
// Don't put the player into negative funds
// Don't put the player into negative funds
amount = Math.Max(-(Cash + Resources), amount);
TakeCash(-amount);
}
TakeCash(-amount);
}
return amount;
}

View File

@@ -200,10 +200,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
color.AttachPanel(colorChooser, onExit);
}
public override void Tick()
{
public override void Tick()
{
if (paletteTabHighlighted > 0)
paletteTabHighlighted--;
paletteTabHighlighted--;
}
}
}

View File

@@ -12,7 +12,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets.Logic
@@ -59,9 +59,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
var modCredits = modData.Manifest.Get<ModCredits>();
modLines = ParseLines(modCredits.ModCreditsFile);
modTab.GetText = () => modCredits.ModTabTitle;
// Make space to show the tabs
modTab.GetText = () => modCredits.ModTabTitle;
// Make space to show the tabs
tabContainer.IsVisible = () => true;
scrollPanel.Bounds.Y += tabContainer.Bounds.Height;
scrollPanel.Bounds.Height -= tabContainer.Bounds.Height;

View File

@@ -9,7 +9,7 @@
*/
#endregion
using System.Diagnostics;
using System.Diagnostics;
using OpenRA.Support;
using OpenRA.Widgets;

View File

@@ -200,7 +200,7 @@ namespace OpenRA.Mods.Common.Widgets
continue;
if (!flashed && !o.SuppressVisualFeedback)
{
{
var visualTarget = o.VisualFeedbackTarget.Type != TargetType.Invalid ? o.VisualFeedbackTarget : o.Target;
if (visualTarget.Type == TargetType.Actor)
{