Fix some whitespace formatting issues: stray tabs or spaces.

Wrap some long lines on affected code.
This commit is contained in:
RoosterDragon
2023-03-02 16:41:55 +00:00
committed by Gustas
parent edaf11cb89
commit 52fd564eac
22 changed files with 50 additions and 38 deletions

View File

@@ -67,12 +67,12 @@ namespace OpenRA.Mods.Common.Widgets
{
var c = (int*)cc;
for (var s = 0; s < 256; s++)
for (var h = 0; h < 256; h++)
{
#pragma warning disable IDE0047
(*(c + s * 256 + h)) = Color.FromAhsv(h / 255f, 1 - s / 255f, V).ToArgb();
#pragma warning restore IDE0047
}
for (var h = 0; h < 256; h++)
{
#pragma warning disable IDE0047
(*(c + s * 256 + h)) = Color.FromAhsv(h / 255f, 1 - s / 255f, V).ToArgb();
#pragma warning restore IDE0047
}
}
}

View File

@@ -174,7 +174,9 @@ namespace OpenRA.Mods.Common.Widgets
}
// Draw x axis
axisFont.DrawTextWithShadow(xAxisLabel, new float2(graphOrigin.X, origin.Y) + new float2(width / 2 - xAxisLabelSize.X / 2, -(xAxisLabelSize.Y + Padding)), Color.White, BackgroundColorDark, BackgroundColorLight, 1);
axisFont.DrawTextWithShadow(xAxisLabel,
new float2(graphOrigin.X, origin.Y) + new float2(width / 2 - xAxisLabelSize.X / 2, -(xAxisLabelSize.Y + Padding)),
Color.White, BackgroundColorDark, BackgroundColorLight, 1);
// TODO: make this stuff not draw outside of the RenderBounds
for (int n = pointStart, x = 0; n <= pointEnd; n++, x += xStep)
@@ -186,11 +188,15 @@ namespace OpenRA.Mods.Common.Widgets
var xAxisText = GetXAxisValueFormat().F(n / XAxisTicksPerLabel);
var xAxisTickTextWidth = labelFont.Measure(xAxisText).X;
var xLocation = x - xAxisTickTextWidth / 2;
labelFont.DrawTextWithShadow(xAxisText, graphOrigin + new float2(xLocation, 2), Color.White, BackgroundColorDark, BackgroundColorLight, 1);
labelFont.DrawTextWithShadow(xAxisText,
graphOrigin + new float2(xLocation, 2),
Color.White, BackgroundColorDark, BackgroundColorLight, 1);
}
// Draw y axis
axisFont.DrawTextWithShadow(yAxisLabel, new float2(origin.X, graphOrigin.Y) + new float2(5 - axisFont.TopOffset, -(height / 2 - yAxisLabelSize.X / 2)), Color.White, BackgroundColorDark, BackgroundColorLight, 1, (float)Math.PI / 2);
axisFont.DrawTextWithShadow(yAxisLabel,
new float2(origin.X, graphOrigin.Y) + new float2(5 - axisFont.TopOffset, -(height / 2 - yAxisLabelSize.X / 2)),
Color.White, BackgroundColorDark, BackgroundColorLight, 1, (float)Math.PI / 2);
for (var y = GetDisplayFirstYAxisValue() ? 0 : yStep; y <= height; y += yStep)
{
@@ -202,7 +208,9 @@ namespace OpenRA.Mods.Common.Widgets
var yLocation = y + (textWidth.Y + labelFont.TopOffset) / 2;
labelFont.DrawTextWithShadow(text, graphOrigin + new float2(-(textWidth.X + 3), -yLocation), Color.White, BackgroundColorDark, BackgroundColorLight, 1);
labelFont.DrawTextWithShadow(text,
graphOrigin + new float2(-(textWidth.X + 3), -yLocation),
Color.White, BackgroundColorDark, BackgroundColorLight, 1);
}
// Bottom line

View File

@@ -435,7 +435,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
void CreateResumeButton()
{
var button = AddButton("RESUME", world.IsGameOver ? ReturnToMap : Resume);
var button = AddButton("RESUME", world.IsGameOver ? ReturnToMap : Resume);
button.Key = modData.Hotkeys["escape"];
button.OnClick = CloseMenu;
}

View File

@@ -156,7 +156,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
// Server does not provide the total file length
if (map.DownloadPercentage == 0)
modData.Translation.GetString(Downloading, Translation.Arguments("size", map.DownloadBytes / 1024));
modData.Translation.GetString(Downloading, Translation.Arguments("size", map.DownloadBytes / 1024));
return modData.Translation.GetString(DownloadingPercentage, Translation.Arguments("size", map.DownloadBytes / 1024, "progress", map.DownloadPercentage));
};

View File

@@ -378,7 +378,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
var options = replays.Select(r => r.GameInfo.MapTitle).Distinct(StringComparer.OrdinalIgnoreCase).ToList();
options.Sort(StringComparer.OrdinalIgnoreCase);
options.Insert(0, null); // no filter
options.Insert(0, null); // no filter
var anyText = ddb.GetText();
ddb.GetText = () => string.IsNullOrEmpty(filter.MapName) ? anyText : filter.MapName;
@@ -406,7 +406,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
var options = replays.SelectMany(r => r.GameInfo.Players.Select(p => p.Name)).Distinct(StringComparer.OrdinalIgnoreCase).ToList();
options.Sort(StringComparer.OrdinalIgnoreCase);
options.Insert(0, null); // no filter
options.Insert(0, null); // no filter
var anyText = ddb.GetText();
ddb.GetText = () => string.IsNullOrEmpty(filter.PlayerName) ? anyText : filter.PlayerName;
@@ -438,7 +438,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
.SelectMany(r => r.GameInfo.Players.Select(p => p.FactionName).Where(n => !string.IsNullOrEmpty(n)))
.Distinct(StringComparer.OrdinalIgnoreCase).ToList();
options.Sort(StringComparer.OrdinalIgnoreCase);
options.Insert(0, null); // no filter
options.Insert(0, null); // no filter
var anyText = ddb.GetText();
ddb.GetText = () => string.IsNullOrEmpty(filter.Faction) ? anyText : filter.Faction;