Formatted all files.
Automatically formatted all files via VS. This generally corrects indentation, removes trailing whitespace and corrects misplaced tabs or spaces. Manually tweaked a few files where required.
This commit is contained in:
@@ -93,7 +93,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
abortButton.OnClick = () => { Ui.CloseWindow(); onAbort(); };
|
||||
|
||||
retryButton.Visible = onRetry != null;
|
||||
retryButton.OnClick = () =>
|
||||
retryButton.OnClick = () =>
|
||||
{
|
||||
var password = passwordField != null && passwordField.IsVisible() ? passwordField.Text : orderManager.Password;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
public class CreditsLogic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public CreditsLogic(Widget widget, Action onExit)
|
||||
public CreditsLogic(Widget widget, Action onExit)
|
||||
{
|
||||
var panel = widget.Get("CREDITS_PANEL");
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
dataReceived = i.BytesReceived / (float)(1L << (mag * 10));
|
||||
dataSuffix = SizeSuffixes[mag];
|
||||
}
|
||||
|
||||
|
||||
progressBar.Indeterminate = false;
|
||||
progressBar.Percentage = i.ProgressPercentage;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
if (timer != null)
|
||||
{
|
||||
timer.GetText = () =>
|
||||
timer.GetText = () =>
|
||||
{
|
||||
if (status == null && shouldShowStatus())
|
||||
return statusText();
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
ConfirmationDialogs.PromptConfirmAction("Abort Mission", "Leave this game and return to the menu?", onQuit, showMenu);
|
||||
};
|
||||
|
||||
Action onSurrender = () =>
|
||||
Action onSurrender = () =>
|
||||
{
|
||||
world.IssueOrder(new Order("Surrender", world.LocalPlayer.PlayerActor, false));
|
||||
closeMenu();
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
var mapButton = lobby.GetOrNull<ButtonWidget>("CHANGEMAP_BUTTON");
|
||||
if (mapButton != null)
|
||||
{
|
||||
mapButton.IsDisabled = configurationDisabled;
|
||||
mapButton.IsDisabled = configurationDisabled;
|
||||
mapButton.OnClick = () =>
|
||||
{
|
||||
var onSelect = new Action<string>(uid =>
|
||||
@@ -322,7 +322,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
allowCheats.IsChecked = () => orderManager.LobbyInfo.GlobalSettings.AllowCheats;
|
||||
allowCheats.IsDisabled = () => Map.Status != MapStatus.Available || Map.Map.Options.Cheats.HasValue || configurationDisabled();
|
||||
allowCheats.OnClick = () => orderManager.IssueOrder(Order.Command(
|
||||
allowCheats.OnClick = () => orderManager.IssueOrder(Order.Command(
|
||||
"allowcheats {0}".F(!orderManager.LobbyInfo.GlobalSettings.AllowCheats)));
|
||||
}
|
||||
|
||||
@@ -629,7 +629,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
if (Map.Status == MapStatus.Available)
|
||||
{
|
||||
// Maps need to be validated and pre-loaded before they can be accessed
|
||||
new Thread(_ =>
|
||||
new Thread(_ =>
|
||||
{
|
||||
var map = Map;
|
||||
map.CacheRules();
|
||||
@@ -820,7 +820,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
public Action OnClick;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class LobbyCountry
|
||||
{
|
||||
public string Name;
|
||||
|
||||
@@ -107,20 +107,20 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
var statusSearching = progress.GetOrNull("MAP_STATUS_SEARCHING");
|
||||
if (statusSearching != null)
|
||||
statusSearching.IsVisible = () => lobby.Map.Status == MapStatus.Searching;
|
||||
statusSearching.IsVisible = () => lobby.Map.Status == MapStatus.Searching;
|
||||
|
||||
var statusUnavailable = progress.GetOrNull("MAP_STATUS_UNAVAILABLE");
|
||||
if (statusUnavailable != null)
|
||||
statusUnavailable.IsVisible = () => lobby.Map.Status == MapStatus.Unavailable;
|
||||
statusUnavailable.IsVisible = () => lobby.Map.Status == MapStatus.Unavailable;
|
||||
|
||||
var statusError = progress.GetOrNull("MAP_STATUS_ERROR");
|
||||
if (statusError != null)
|
||||
statusError.IsVisible = () => lobby.Map.Status == MapStatus.DownloadError;
|
||||
statusError.IsVisible = () => lobby.Map.Status == MapStatus.DownloadError;
|
||||
|
||||
var statusDownloading = progress.GetOrNull<LabelWidget>("MAP_STATUS_DOWNLOADING");
|
||||
if (statusDownloading != null)
|
||||
{
|
||||
statusDownloading.IsVisible = () => lobby.Map.Status == MapStatus.Downloading;
|
||||
statusDownloading.IsVisible = () => lobby.Map.Status == MapStatus.Downloading;
|
||||
statusDownloading.GetText = () =>
|
||||
{
|
||||
if (lobby.Map.DownloadBytes == 0)
|
||||
|
||||
@@ -345,7 +345,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
checkBox.IsVisible = () => orderManager.LocalClient.IsAdmin && !skirmishMode;
|
||||
checkBox.IsDisabled = () => false;
|
||||
|
||||
Action okPressed = () =>
|
||||
Action okPressed = () =>
|
||||
{
|
||||
orderManager.IssueOrder(Order.Command("allow_spectators {0}".F(!orderManager.LobbyInfo.GlobalSettings.AllowSpectators)));
|
||||
orderManager.IssueOrders(
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
mapfilterInput.TakeKeyboardFocus();
|
||||
mapfilterInput.OnEscKey = () =>
|
||||
{
|
||||
{
|
||||
if (mapfilterInput.Text.Length == 0)
|
||||
canceling();
|
||||
else
|
||||
@@ -87,7 +87,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
EnumerateMaps(onSelect, filter);
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
};
|
||||
mapfilterInput.OnEnterKey = () => { approving(); return true; };
|
||||
mapfilterInput.OnTextEdited = () =>
|
||||
|
||||
@@ -217,14 +217,14 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
if (title != null)
|
||||
{
|
||||
title.GetText = () => game.Name;
|
||||
title.GetColor = () => !compatible ? Color.DarkGray : !canJoin ? Color.LightGray : title.TextColor;
|
||||
title.GetColor = () => !compatible ? Color.DarkGray : !canJoin ? Color.LightGray : title.TextColor;
|
||||
}
|
||||
|
||||
var maptitle = item.GetOrNull<LabelWidget>("MAP");
|
||||
if (title != null)
|
||||
{
|
||||
maptitle.GetText = () => map.Title;
|
||||
maptitle.GetColor = () => !compatible ? Color.DarkGray : !canJoin ? Color.LightGray : maptitle.TextColor;
|
||||
maptitle.GetColor = () => !compatible ? Color.DarkGray : !canJoin ? Color.LightGray : maptitle.TextColor;
|
||||
}
|
||||
|
||||
var players = item.GetOrNull<LabelWidget>("PLAYERS");
|
||||
@@ -232,7 +232,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
players.GetText = () => "{0} / {1}".F(game.Players, game.MaxPlayers)
|
||||
+ (game.Spectators > 0 ? " ({0} Spectator{1})".F(game.Spectators, game.Spectators > 1 ? "s" : "") : "");
|
||||
players.GetColor = () => !compatible ? Color.DarkGray : !canJoin ? Color.LightGray : players.TextColor;
|
||||
players.GetColor = () => !compatible ? Color.DarkGray : !canJoin ? Color.LightGray : players.TextColor;
|
||||
}
|
||||
|
||||
var state = item.GetOrNull<LabelWidget>("STATE");
|
||||
@@ -254,7 +254,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
var cachedServerLocation = LobbyUtils.LookupCountry(game.Address.Split(':')[0]);
|
||||
location.GetText = () => cachedServerLocation;
|
||||
location.GetColor = () => !compatible ? Color.DarkGray : !canJoin ? Color.LightGray : location.TextColor;
|
||||
location.GetColor = () => !compatible ? Color.DarkGray : !canJoin ? Color.LightGray : location.TextColor;
|
||||
}
|
||||
|
||||
rows.Add(item);
|
||||
|
||||
@@ -51,24 +51,24 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
labelText = "Unexplored Terrain";
|
||||
break;
|
||||
case WorldTooltipType.Actor:
|
||||
{
|
||||
o = viewport.ActorTooltip.Owner;
|
||||
showOwner = !o.NonCombatant && viewport.ActorTooltip.TooltipInfo.IsOwnerRowVisible;
|
||||
{
|
||||
o = viewport.ActorTooltip.Owner;
|
||||
showOwner = !o.NonCombatant && viewport.ActorTooltip.TooltipInfo.IsOwnerRowVisible;
|
||||
|
||||
var stance = o == null || world.RenderPlayer == null ? Stance.None : o.Stances[world.RenderPlayer];
|
||||
labelText = viewport.ActorTooltip.TooltipInfo.TooltipForPlayerStance(stance);
|
||||
break;
|
||||
}
|
||||
var stance = o == null || world.RenderPlayer == null ? Stance.None : o.Stances[world.RenderPlayer];
|
||||
labelText = viewport.ActorTooltip.TooltipInfo.TooltipForPlayerStance(stance);
|
||||
break;
|
||||
}
|
||||
|
||||
case WorldTooltipType.FrozenActor:
|
||||
{
|
||||
o = viewport.FrozenActorTooltip.TooltipOwner;
|
||||
showOwner = !o.NonCombatant && viewport.FrozenActorTooltip.TooltipInfo.IsOwnerRowVisible;
|
||||
{
|
||||
o = viewport.FrozenActorTooltip.TooltipOwner;
|
||||
showOwner = !o.NonCombatant && viewport.FrozenActorTooltip.TooltipInfo.IsOwnerRowVisible;
|
||||
|
||||
var stance = o == null || world.RenderPlayer == null ? Stance.None : o.Stances[world.RenderPlayer];
|
||||
labelText = viewport.FrozenActorTooltip.TooltipInfo.TooltipForPlayerStance(stance);
|
||||
break;
|
||||
}
|
||||
var stance = o == null || world.RenderPlayer == null ? Stance.None : o.Stances[world.RenderPlayer];
|
||||
labelText = viewport.FrozenActorTooltip.TooltipInfo.TooltipForPlayerStance(stance);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var textWidth = font.Measure(labelText).X;
|
||||
|
||||
Reference in New Issue
Block a user