Fix newlines in C# files.
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|||||||
@@ -77,9 +77,9 @@ namespace OpenRA.Graphics
|
|||||||
for (; secondarySheetIndex < ns; secondarySheetIndex++)
|
for (; secondarySheetIndex < ns; secondarySheetIndex++)
|
||||||
if (sheets[secondarySheetIndex] == secondarySheet)
|
if (sheets[secondarySheetIndex] == secondarySheet)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure that we have enough free samplers to map both if needed, otherwise flush
|
// Make sure that we have enough free samplers to map both if needed, otherwise flush
|
||||||
var needSamplers = (sheetIndex == ns ? 1 : 0) + (secondarySheetIndex == ns ? 1 : 0);
|
var needSamplers = (sheetIndex == ns ? 1 : 0) + (secondarySheetIndex == ns ? 1 : 0);
|
||||||
if (ns + needSamplers >= sheets.Length)
|
if (ns + needSamplers >= sheets.Length)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ namespace OpenRA.Graphics
|
|||||||
sl = ss.SecondaryLeft;
|
sl = ss.SecondaryLeft;
|
||||||
st = ss.SecondaryTop;
|
st = ss.SecondaryTop;
|
||||||
sr = ss.SecondaryRight;
|
sr = ss.SecondaryRight;
|
||||||
sb = ss.SecondaryBottom;
|
sb = ss.SecondaryBottom;
|
||||||
|
|
||||||
attribC |= ((byte)ss.SecondaryChannel) << 4 | 0x08;
|
attribC |= ((byte)ss.SecondaryChannel) << 4 | 0x08;
|
||||||
attribC |= samplers.Y << 9;
|
attribC |= samplers.Y << 9;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -174,26 +174,26 @@ namespace OpenRA.Network
|
|||||||
if (string.IsNullOrEmpty(ModTitle))
|
if (string.IsNullOrEmpty(ModTitle))
|
||||||
{
|
{
|
||||||
Manifest mod;
|
Manifest mod;
|
||||||
|
|
||||||
if (external != null && external.Version == Version)
|
if (external != null && external.Version == Version)
|
||||||
{
|
{
|
||||||
// Use external mod registration to populate the section header
|
// Use external mod registration to populate the section header
|
||||||
ModTitle = external.Title;
|
ModTitle = external.Title;
|
||||||
}
|
}
|
||||||
else if (Game.Mods.TryGetValue(Mod, out mod))
|
else if (Game.Mods.TryGetValue(Mod, out mod))
|
||||||
{
|
{
|
||||||
// Use internal mod data to populate the section header, but
|
// Use internal mod data to populate the section header, but
|
||||||
// on-connect switching must use the external mod plumbing.
|
// on-connect switching must use the external mod plumbing.
|
||||||
ModTitle = mod.Metadata.Title;
|
ModTitle = mod.Metadata.Title;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Some platforms (e.g. macOS) package each mod separately, so the Mods check above won't work.
|
// Some platforms (e.g. macOS) package each mod separately, so the Mods check above won't work.
|
||||||
// Guess based on the most recent ExternalMod instead.
|
// Guess based on the most recent ExternalMod instead.
|
||||||
var guessMod = Game.ExternalMods.Values
|
var guessMod = Game.ExternalMods.Values
|
||||||
.OrderByDescending(m => m.Version)
|
.OrderByDescending(m => m.Version)
|
||||||
.FirstOrDefault(m => m.Id == Mod);
|
.FirstOrDefault(m => m.Id == Mod);
|
||||||
|
|
||||||
if (guessMod != null)
|
if (guessMod != null)
|
||||||
ModTitle = "{0}".F(guessMod.Title);
|
ModTitle = "{0}".F(guessMod.Title);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace OpenRA.Server
|
|||||||
byte b;
|
byte b;
|
||||||
switch (b = r.ReadByte())
|
switch (b = r.ReadByte())
|
||||||
{
|
{
|
||||||
case 0xbf:
|
case 0xbf:
|
||||||
// Silently ignore disconnect notifications
|
// Silently ignore disconnect notifications
|
||||||
return null;
|
return null;
|
||||||
case 0xff:
|
case 0xff:
|
||||||
|
|||||||
@@ -420,9 +420,9 @@ namespace OpenRA
|
|||||||
ret += n++ * Sync.Hash(sync);
|
ret += n++ * Sync.Hash(sync);
|
||||||
|
|
||||||
// Hash the shared random number generator.
|
// Hash the shared random number generator.
|
||||||
ret += SharedRandom.Last;
|
ret += SharedRandom.Last;
|
||||||
|
|
||||||
// Hash player RenderPlayer status
|
// Hash player RenderPlayer status
|
||||||
foreach (var p in Players)
|
foreach (var p in Players)
|
||||||
if (p.UnlockedRenderPlayer)
|
if (p.UnlockedRenderPlayer)
|
||||||
ret += Sync.HashPlayer(p);
|
ret += Sync.HashPlayer(p);
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnFirstRun(Actor self)
|
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).
|
// 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)
|
foreach (var pool in ammoPools)
|
||||||
pool.RemainingTicks = pool.Info.ReloadDelay;
|
pool.RemainingTicks = pool.Info.ReloadDelay;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,24 +109,24 @@ namespace OpenRA.Mods.Common.SpriteLoaders
|
|||||||
}
|
}
|
||||||
|
|
||||||
var trimmedWidth = right - left + 1;
|
var trimmedWidth = right - left + 1;
|
||||||
var trimmedHeight = bottom - top + 1;
|
var trimmedHeight = bottom - top + 1;
|
||||||
|
|
||||||
// Pad the dimensions to an even number to avoid issues with half-integer offsets
|
// Pad the dimensions to an even number to avoid issues with half-integer offsets
|
||||||
var widthFudge = trimmedWidth % 2;
|
var widthFudge = trimmedWidth % 2;
|
||||||
var heightFudge = trimmedHeight % 2;
|
var heightFudge = trimmedHeight % 2;
|
||||||
var destWidth = trimmedWidth + widthFudge;
|
var destWidth = trimmedWidth + widthFudge;
|
||||||
var destHeight = trimmedHeight + heightFudge;
|
var destHeight = trimmedHeight + heightFudge;
|
||||||
|
|
||||||
if (trimmedWidth == origSize.Width && trimmedHeight == origSize.Height)
|
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;
|
Size = header.Size;
|
||||||
FrameSize = header.FrameSize;
|
FrameSize = header.FrameSize;
|
||||||
Offset = header.Offset;
|
Offset = header.Offset;
|
||||||
Data = header.Data;
|
Data = header.Data;
|
||||||
}
|
}
|
||||||
else if (trimmedWidth > 0 && trimmedHeight > 0)
|
else if (trimmedWidth > 0 && trimmedHeight > 0)
|
||||||
{
|
{
|
||||||
// Trim frame
|
// Trim frame
|
||||||
Data = new byte[destWidth * destHeight];
|
Data = new byte[destWidth * destHeight];
|
||||||
for (var y = 0; y < trimmedHeight; y++)
|
for (var y = 0; y < trimmedHeight; y++)
|
||||||
@@ -139,8 +139,8 @@ namespace OpenRA.Mods.Common.SpriteLoaders
|
|||||||
top + bottom + heightFudge - origSize.Height + 1);
|
top + bottom + heightFudge - origSize.Height + 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Empty frame
|
// Empty frame
|
||||||
Data = new byte[0];
|
Data = new byte[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
amount = resources.ChangeCash(amount);
|
amount = resources.ChangeCash(amount);
|
||||||
|
|
||||||
if (info.ShowTicks && amount != 0)
|
if (info.ShowTicks && amount != 0)
|
||||||
AddCashTick(self, amount);
|
AddCashTick(self, amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#region Copyright & License Information
|
#region Copyright & License Information
|
||||||
/*
|
/*
|
||||||
* Copyright 2007-2018 The OpenRA Developers (see AUTHORS)
|
* Copyright 2007-2018 The OpenRA Developers (see AUTHORS)
|
||||||
* This file is part of OpenRA, which is free software. It is made
|
* 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 resources = newOwner.PlayerActor.Trait<PlayerResources>();
|
||||||
|
|
||||||
var amount = resources.ChangeCash(info.Amount);
|
var amount = resources.ChangeCash(info.Amount);
|
||||||
|
|
||||||
if (!info.ShowTicks && amount != 0)
|
if (!info.ShowTicks && amount != 0)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -88,16 +88,16 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
public int ChangeCash(int amount)
|
public int ChangeCash(int amount)
|
||||||
{
|
{
|
||||||
if (amount >= 0)
|
if (amount >= 0)
|
||||||
GiveCash(amount);
|
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);
|
amount = Math.Max(-(Cash + Resources), amount);
|
||||||
|
|
||||||
TakeCash(-amount);
|
TakeCash(-amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
return amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -200,10 +200,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
color.AttachPanel(colorChooser, onExit);
|
color.AttachPanel(colorChooser, onExit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Tick()
|
public override void Tick()
|
||||||
{
|
{
|
||||||
if (paletteTabHighlighted > 0)
|
if (paletteTabHighlighted > 0)
|
||||||
paletteTabHighlighted--;
|
paletteTabHighlighted--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenRA.Widgets;
|
using OpenRA.Widgets;
|
||||||
|
|
||||||
namespace OpenRA.Mods.Common.Widgets.Logic
|
namespace OpenRA.Mods.Common.Widgets.Logic
|
||||||
@@ -59,9 +59,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var modCredits = modData.Manifest.Get<ModCredits>();
|
var modCredits = modData.Manifest.Get<ModCredits>();
|
||||||
modLines = ParseLines(modCredits.ModCreditsFile);
|
modLines = ParseLines(modCredits.ModCreditsFile);
|
||||||
modTab.GetText = () => modCredits.ModTabTitle;
|
modTab.GetText = () => modCredits.ModTabTitle;
|
||||||
|
|
||||||
// Make space to show the tabs
|
// Make space to show the tabs
|
||||||
tabContainer.IsVisible = () => true;
|
tabContainer.IsVisible = () => true;
|
||||||
scrollPanel.Bounds.Y += tabContainer.Bounds.Height;
|
scrollPanel.Bounds.Y += tabContainer.Bounds.Height;
|
||||||
scrollPanel.Bounds.Height -= tabContainer.Bounds.Height;
|
scrollPanel.Bounds.Height -= tabContainer.Bounds.Height;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using OpenRA.Support;
|
using OpenRA.Support;
|
||||||
using OpenRA.Widgets;
|
using OpenRA.Widgets;
|
||||||
|
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!flashed && !o.SuppressVisualFeedback)
|
if (!flashed && !o.SuppressVisualFeedback)
|
||||||
{
|
{
|
||||||
var visualTarget = o.VisualFeedbackTarget.Type != TargetType.Invalid ? o.VisualFeedbackTarget : o.Target;
|
var visualTarget = o.VisualFeedbackTarget.Type != TargetType.Invalid ? o.VisualFeedbackTarget : o.Target;
|
||||||
if (visualTarget.Type == TargetType.Actor)
|
if (visualTarget.Type == TargetType.Actor)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user