fix indents everywhere
This commit is contained in:
@@ -32,14 +32,14 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
widget.GetWidget<LabelWidget>("CONNECTING_DESC").GetText = () =>
|
||||
"Connecting to {0}:{1}...".F(host, port);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ConnectionFailedLogic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public ConnectionFailedLogic(
|
||||
[ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] OrderManager orderManager)
|
||||
[ObjectCreator.Param] OrderManager orderManager)
|
||||
{
|
||||
widget.GetWidget<ButtonWidget>("CONNECTION_BUTTON_CANCEL").OnClick = () => {
|
||||
widget.GetWidget("CONNECTION_BUTTON_CANCEL").Parent.Visible = false;
|
||||
|
||||
@@ -126,8 +126,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
Func<Stance, ScrollItemWidget, ScrollItemWidget> setupItem = (s, template) =>
|
||||
{
|
||||
var item = ScrollItemWidget.Setup(template,
|
||||
() => s == world.LocalPlayer.Stances[ p ],
|
||||
() => SetStance(dropdown, p, s));
|
||||
() => s == world.LocalPlayer.Stances[ p ],
|
||||
() => SetStance(dropdown, p, s));
|
||||
|
||||
item.GetWidget<LabelWidget>("LABEL").GetText = () => s.ToString();
|
||||
return item;
|
||||
|
||||
@@ -22,23 +22,23 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
dc.GetWidget<TextFieldWidget>("SERVER_ADDRESS").Text = Game.Settings.Player.LastServer;
|
||||
|
||||
dc.GetWidget<ButtonWidget>("JOIN_BUTTON").OnClick = () =>
|
||||
{
|
||||
var address = dc.GetWidget<TextFieldWidget>("SERVER_ADDRESS").Text;
|
||||
var addressParts = address.Split(':').ToArray();
|
||||
if (addressParts.Length < 1 || addressParts.Length > 2)
|
||||
return;
|
||||
dc.GetWidget<ButtonWidget>("JOIN_BUTTON").OnClick = () =>
|
||||
{
|
||||
var address = dc.GetWidget<TextFieldWidget>("SERVER_ADDRESS").Text;
|
||||
var addressParts = address.Split(':').ToArray();
|
||||
if (addressParts.Length < 1 || addressParts.Length > 2)
|
||||
return;
|
||||
|
||||
int port;
|
||||
if (addressParts.Length != 2 || !int.TryParse(addressParts[1], out port))
|
||||
port = 1234;
|
||||
int port;
|
||||
if (addressParts.Length != 2 || !int.TryParse(addressParts[1], out port))
|
||||
port = 1234;
|
||||
|
||||
Game.Settings.Player.LastServer = address;
|
||||
Game.Settings.Save();
|
||||
Game.Settings.Player.LastServer = address;
|
||||
Game.Settings.Save();
|
||||
|
||||
Widget.CloseWindow();
|
||||
Game.JoinServer(addressParts[0], port);
|
||||
};
|
||||
Widget.CloseWindow();
|
||||
Game.JoinServer(addressParts[0], port);
|
||||
};
|
||||
|
||||
dc.GetWidget<ButtonWidget>("CANCEL_BUTTON").OnClick = () =>
|
||||
{
|
||||
|
||||
@@ -30,14 +30,14 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
string MapUid;
|
||||
Map Map;
|
||||
|
||||
public static ColorRamp CurrentColorPreview;
|
||||
public static ColorRamp CurrentColorPreview;
|
||||
|
||||
readonly OrderManager orderManager;
|
||||
readonly WorldRenderer worldRenderer;
|
||||
[ObjectCreator.UseCtor]
|
||||
internal LobbyLogic([ObjectCreator.Param( "widget" )] Widget lobby,
|
||||
[ObjectCreator.Param] OrderManager orderManager,
|
||||
[ObjectCreator.Param] WorldRenderer worldRenderer)
|
||||
[ObjectCreator.Param] OrderManager orderManager,
|
||||
[ObjectCreator.Param] WorldRenderer worldRenderer)
|
||||
{
|
||||
this.orderManager = orderManager;
|
||||
this.worldRenderer = worldRenderer;
|
||||
@@ -64,7 +64,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
var map = mapPreview.Map();
|
||||
if (map == null || mi.Button != MouseButton.Left
|
||||
|| orderManager.LocalClient.State == Session.ClientState.Ready)
|
||||
|| orderManager.LocalClient.State == Session.ClientState.Ready)
|
||||
return;
|
||||
|
||||
var p = map.SpawnPoints
|
||||
@@ -208,7 +208,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
void UpdateColorPreview(float hf, float sf, float lf, float r)
|
||||
{
|
||||
CurrentColorPreview = new ColorRamp((byte)(hf * 255), (byte)(sf * 255), (byte)(lf * 255), (byte)(r * 255));
|
||||
CurrentColorPreview = new ColorRamp((byte)(hf * 255), (byte)(sf * 255), (byte)(lf * 255), (byte)(r * 255));
|
||||
}
|
||||
|
||||
void UpdateCurrentMap()
|
||||
|
||||
@@ -29,8 +29,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public RADownloadPackagesLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] Dictionary<string,string> installData,
|
||||
[ObjectCreator.Param] Action continueLoading)
|
||||
[ObjectCreator.Param] Dictionary<string,string> installData,
|
||||
[ObjectCreator.Param] Action continueLoading)
|
||||
{
|
||||
this.installData = installData;
|
||||
this.continueLoading = continueLoading;
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public RAInstallFromCDLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] Action continueLoading)
|
||||
[ObjectCreator.Param] Action continueLoading)
|
||||
{
|
||||
this.continueLoading = continueLoading;
|
||||
panel = widget.GetWidget("INSTALL_FROMCD_PANEL");
|
||||
@@ -102,7 +102,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
return;
|
||||
|
||||
if (!InstallUtils.ExtractFromPackage(source, extractPackage, extractFiles, dest, onProgress, onError))
|
||||
return;
|
||||
return;
|
||||
|
||||
Game.RunAfterTick(() =>
|
||||
{
|
||||
|
||||
@@ -18,12 +18,12 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public RAInstallLogic([ObjectCreator.Param] Widget widget,
|
||||
[ObjectCreator.Param] Dictionary<string,string> installData,
|
||||
[ObjectCreator.Param] Action continueLoading)
|
||||
[ObjectCreator.Param] Dictionary<string,string> installData,
|
||||
[ObjectCreator.Param] Action continueLoading)
|
||||
{
|
||||
var panel = widget.GetWidget("INSTALL_PANEL");
|
||||
var args = new WidgetArgs()
|
||||
{
|
||||
{
|
||||
{ "continueLoading", () => { Widget.CloseWindow(); continueLoading(); } },
|
||||
{ "installData", installData }
|
||||
};
|
||||
|
||||
@@ -85,8 +85,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
void AddReplay(ScrollPanelWidget list, string filename, ScrollItemWidget template)
|
||||
{
|
||||
var item = ScrollItemWidget.Setup(template,
|
||||
() => CurrentReplay == filename,
|
||||
() => CurrentReplay = filename);
|
||||
() => CurrentReplay == filename,
|
||||
() => CurrentReplay = filename);
|
||||
var f = Path.GetFileName(filename);
|
||||
item.GetWidget<LabelWidget>("TITLE").GetText = () => f;
|
||||
list.AddChild(item);
|
||||
|
||||
@@ -88,8 +88,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
{
|
||||
return string.Join("\n", s.UsefulMods
|
||||
.Select(m =>
|
||||
Mod.AllMods.ContainsKey(m.Key) ? string.Format("{0} ({1})", Mod.AllMods[m.Key].Title, m.Value)
|
||||
: string.Format("Unknown Mod: {0}",m.Key)).ToArray());
|
||||
Mod.AllMods.ContainsKey(m.Key) ? string.Format("{0} ({1})", Mod.AllMods[m.Key].Title, m.Value)
|
||||
: string.Format("Unknown Mod: {0}",m.Key)).ToArray());
|
||||
}
|
||||
|
||||
void RefreshServerList(IEnumerable<GameServer> games)
|
||||
@@ -97,8 +97,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
var r = Widget.RootWidget;
|
||||
var bg = r.GetWidget("JOINSERVER_BG");
|
||||
|
||||
if (bg == null) // We got a MasterServer reply AFTER the browser is gone, just return to prevent crash - Gecko
|
||||
return;
|
||||
if (bg == null) // We got a MasterServer reply AFTER the browser is gone, just return to prevent crash - Gecko
|
||||
return;
|
||||
|
||||
var sl = bg.GetWidget<ScrollPanelWidget>("SERVER_LIST");
|
||||
|
||||
@@ -112,9 +112,9 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
return;
|
||||
}
|
||||
|
||||
var gamesWaiting = games.Where(g => g.CanJoin());
|
||||
var gamesWaiting = games.Where(g => g.CanJoin());
|
||||
|
||||
if (gamesWaiting.Count() == 0)
|
||||
if (gamesWaiting.Count() == 0)
|
||||
{
|
||||
r.GetWidget("JOINSERVER_PROGRESS_TITLE").Visible = true;
|
||||
r.GetWidget<LabelWidget>("JOINSERVER_PROGRESS_TITLE").Text = "No games found.";
|
||||
|
||||
@@ -46,15 +46,15 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
else
|
||||
Game.Settings.Player.Name = name.Text;
|
||||
};
|
||||
name.OnEnterKey = () => { name.LoseFocus(); return true; };
|
||||
name.OnEnterKey = () => { name.LoseFocus(); return true; };
|
||||
|
||||
var edgescrollCheckbox = general.GetWidget<CheckboxWidget>("EDGE_SCROLL");
|
||||
edgescrollCheckbox.IsChecked = () => Game.Settings.Game.ViewportEdgeScroll;
|
||||
edgescrollCheckbox.OnClick = () => Game.Settings.Game.ViewportEdgeScroll ^= true;
|
||||
|
||||
var edgeScrollSlider = general.GetWidget<SliderWidget>("EDGE_SCROLL_AMOUNT");
|
||||
var edgeScrollSlider = general.GetWidget<SliderWidget>("EDGE_SCROLL_AMOUNT");
|
||||
edgeScrollSlider.Value = Game.Settings.Game.ViewportEdgeScrollStep;
|
||||
edgeScrollSlider.OnChange += x => Game.Settings.Game.ViewportEdgeScrollStep = x;
|
||||
edgeScrollSlider.OnChange += x => Game.Settings.Game.ViewportEdgeScrollStep = x;
|
||||
|
||||
var inversescroll = general.GetWidget<CheckboxWidget>("INVERSE_SCROLL");
|
||||
inversescroll.IsChecked = () => Game.Settings.Game.MouseScroll == MouseScrollType.Inverted;
|
||||
|
||||
Reference in New Issue
Block a user