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:
@@ -171,25 +171,25 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
|
||||
switch (mi.Event)
|
||||
{
|
||||
case MouseInputEvent.Up:
|
||||
isMoving = false;
|
||||
YieldMouseFocus(mi);
|
||||
break;
|
||||
case MouseInputEvent.Up:
|
||||
isMoving = false;
|
||||
YieldMouseFocus(mi);
|
||||
break;
|
||||
|
||||
case MouseInputEvent.Down:
|
||||
isMoving = true;
|
||||
SetValueFromPx(mi.Location - RenderOrigin);
|
||||
OnChange();
|
||||
break;
|
||||
|
||||
case MouseInputEvent.Move:
|
||||
if (isMoving)
|
||||
{
|
||||
case MouseInputEvent.Down:
|
||||
isMoving = true;
|
||||
SetValueFromPx(mi.Location - RenderOrigin);
|
||||
OnChange();
|
||||
}
|
||||
break;
|
||||
|
||||
break;
|
||||
case MouseInputEvent.Move:
|
||||
if (isMoving)
|
||||
{
|
||||
SetValueFromPx(mi.Location - RenderOrigin);
|
||||
OnChange();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
}
|
||||
|
||||
var playerWidget = panel.GetOrNull<VqaPlayerWidget>("PLAYER");
|
||||
if (playerWidget != null)
|
||||
if (playerWidget != null)
|
||||
playerWidget.IsVisible = () => isVideoLoaded;
|
||||
|
||||
var paletteDropDown = panel.GetOrNull<DropDownButtonWidget>("PALETTE_SELECTOR");
|
||||
@@ -118,22 +118,22 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
frameSlider = panel.Get<SliderWidget>("FRAME_SLIDER");
|
||||
if (frameSlider != null)
|
||||
{
|
||||
frameSlider.OnChange += x =>
|
||||
frameSlider.OnChange += x =>
|
||||
{
|
||||
if (!isVideoLoaded)
|
||||
currentFrame = (int)Math.Round(x);
|
||||
if (!isVideoLoaded)
|
||||
currentFrame = (int)Math.Round(x);
|
||||
};
|
||||
|
||||
frameSlider.GetValue = () => isVideoLoaded ? player.Video.CurrentFrame : currentFrame;
|
||||
frameSlider.IsDisabled = () => isVideoLoaded;
|
||||
frameSlider.IsDisabled = () => isVideoLoaded;
|
||||
}
|
||||
|
||||
var frameText = panel.GetOrNull<LabelWidget>("FRAME_COUNT");
|
||||
if (frameText != null)
|
||||
{
|
||||
frameText.GetText = () =>
|
||||
isVideoLoaded ?
|
||||
"{0} / {1}".F(player.Video.CurrentFrame + 1, player.Video.Frames) :
|
||||
frameText.GetText = () =>
|
||||
isVideoLoaded ?
|
||||
"{0} / {1}".F(player.Video.CurrentFrame + 1, player.Video.Frames) :
|
||||
"{0} / {1}".F(currentFrame + 1, currentSprites.Length);
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
nextButton.OnClick = () =>
|
||||
{
|
||||
if (!isVideoLoaded)
|
||||
if (!isVideoLoaded)
|
||||
nextButton.OnClick = SelectNextFrame;
|
||||
};
|
||||
|
||||
@@ -211,12 +211,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
|
||||
var closeButton = panel.GetOrNull<ButtonWidget>("CLOSE_BUTTON");
|
||||
if (closeButton != null)
|
||||
closeButton.OnClick = () =>
|
||||
closeButton.OnClick = () =>
|
||||
{
|
||||
if (isVideoLoaded)
|
||||
player.Stop();
|
||||
Ui.CloseWindow();
|
||||
onExit();
|
||||
onExit();
|
||||
};
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
player = null;
|
||||
isVideoLoaded = false;
|
||||
}
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(filename))
|
||||
return false;
|
||||
|
||||
@@ -325,8 +325,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
Func<IFolder, ScrollItemWidget, ScrollItemWidget> setupItem = (source, itemTemplate) =>
|
||||
{
|
||||
var item = ScrollItemWidget.Setup(itemTemplate,
|
||||
() => assetSource == source,
|
||||
() => { assetSource = source; PopulateAssetList(); });
|
||||
() => assetSource == source,
|
||||
() => { assetSource = source; PopulateAssetList(); });
|
||||
item.Get<LabelWidget>("LABEL").GetText = () => source != null ? Platform.UnresolvePath(source.Name) : "All Packages";
|
||||
return item;
|
||||
};
|
||||
@@ -359,7 +359,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool ShowPaletteDropdown(DropDownButtonWidget dropdown, World world)
|
||||
{
|
||||
Func<PaletteFromFile, ScrollItemWidget, ScrollItemWidget> setupItem = (palette, itemTemplate) =>
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
public DisconnectWatcherLogic(Widget widget, OrderManager orderManager)
|
||||
{
|
||||
var disconnected = false;
|
||||
widget.Get<LogicTickerWidget>("DISCONNECT_WATCHER").OnTick = () =>
|
||||
widget.Get<LogicTickerWidget>("DISCONNECT_WATCHER").OnTick = () =>
|
||||
{
|
||||
if (disconnected || orderManager.Connection.ConnectionState != ConnectionState.NotConnected)
|
||||
return;
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
|
||||
var textBox = key.Get<HotkeyEntryWidget>("HOTKEY");
|
||||
textBox.Key = (Hotkey)field.GetValue(ks);
|
||||
textBox.OnLoseFocus = () => field.SetValue(ks, textBox.Key);
|
||||
textBox.OnLoseFocus = () => field.SetValue(ks, textBox.Key);
|
||||
parent.AddChild(key);
|
||||
}
|
||||
|
||||
@@ -536,8 +536,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
Func<string, ScrollItemWidget, ScrollItemWidget> setupItem = (o, itemTemplate) =>
|
||||
{
|
||||
var item = ScrollItemWidget.Setup(itemTemplate,
|
||||
() => s.MouseScroll == options[o],
|
||||
() => s.MouseScroll = options[o]);
|
||||
() => s.MouseScroll == options[o],
|
||||
() => s.MouseScroll = options[o]);
|
||||
item.Get<LabelWidget>("LABEL").GetText = () => o;
|
||||
return item;
|
||||
};
|
||||
|
||||
@@ -274,7 +274,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
var stride = radarSheet.Size.Width;
|
||||
var dx = actorSprite.Bounds.Left - world.Map.Bounds.Left;
|
||||
var dy = actorSprite.Bounds.Top - world.Map.Bounds.Top;
|
||||
|
||||
|
||||
Array.Clear(radarData, 4 * (actorSprite.Bounds.Top * stride + actorSprite.Bounds.Left), 4 * actorSprite.Bounds.Height * stride);
|
||||
|
||||
unsafe
|
||||
|
||||
@@ -96,8 +96,9 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
}
|
||||
}
|
||||
else
|
||||
Game.Renderer.LineRenderer.FillRect(new Rectangle(b.X, (int)float2.Lerp(b.Bottom, b.Top, providedFrac),
|
||||
b.Width, (int)(providedFrac * b.Height)), color);
|
||||
Game.Renderer.LineRenderer.FillRect(new Rectangle(
|
||||
b.X, (int)float2.Lerp(b.Bottom, b.Top, providedFrac),
|
||||
b.Width, (int)(providedFrac * b.Height)), color);
|
||||
|
||||
var x = (b.Left + b.Right - indicator.Size.X) / 2;
|
||||
var y = float2.Lerp(b.Bottom, b.Top, usedFrac) - indicator.Size.Y / 2;
|
||||
|
||||
Reference in New Issue
Block a user