mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 14:25:05 +08:00
Rename LoadingAnimation to LoadingSpinner
This commit is contained in:
parent
623b78d675
commit
92f6f0207c
@ -35,7 +35,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
AddStep("set status to online", () => ((DummyAPIAccess)API).State = APIState.Online);
|
AddStep("set status to online", () => ((DummyAPIAccess)API).State = APIState.Online);
|
||||||
|
|
||||||
AddUntilStep("children are visible", () => onlineView.ViewTarget.IsPresent);
|
AddUntilStep("children are visible", () => onlineView.ViewTarget.IsPresent);
|
||||||
AddUntilStep("loading animation is not visible", () => !onlineView.LoadingAnimation.IsPresent);
|
AddUntilStep("loading animation is not visible", () => !onlineView.LoadingSpinner.IsPresent);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -44,7 +44,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
AddStep("set status to offline", () => ((DummyAPIAccess)API).State = APIState.Offline);
|
AddStep("set status to offline", () => ((DummyAPIAccess)API).State = APIState.Offline);
|
||||||
|
|
||||||
AddUntilStep("children are not visible", () => !onlineView.ViewTarget.IsPresent);
|
AddUntilStep("children are not visible", () => !onlineView.ViewTarget.IsPresent);
|
||||||
AddUntilStep("loading animation is not visible", () => !onlineView.LoadingAnimation.IsPresent);
|
AddUntilStep("loading animation is not visible", () => !onlineView.LoadingSpinner.IsPresent);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -53,7 +53,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
AddStep("set status to connecting", () => ((DummyAPIAccess)API).State = APIState.Connecting);
|
AddStep("set status to connecting", () => ((DummyAPIAccess)API).State = APIState.Connecting);
|
||||||
|
|
||||||
AddUntilStep("children are not visible", () => !onlineView.ViewTarget.IsPresent);
|
AddUntilStep("children are not visible", () => !onlineView.ViewTarget.IsPresent);
|
||||||
AddUntilStep("loading animation is visible", () => onlineView.LoadingAnimation.IsPresent);
|
AddUntilStep("loading animation is visible", () => onlineView.LoadingSpinner.IsPresent);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -62,12 +62,12 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
AddStep("set status to failing", () => ((DummyAPIAccess)API).State = APIState.Failing);
|
AddStep("set status to failing", () => ((DummyAPIAccess)API).State = APIState.Failing);
|
||||||
|
|
||||||
AddUntilStep("children are not visible", () => !onlineView.ViewTarget.IsPresent);
|
AddUntilStep("children are not visible", () => !onlineView.ViewTarget.IsPresent);
|
||||||
AddUntilStep("loading animation is visible", () => onlineView.LoadingAnimation.IsPresent);
|
AddUntilStep("loading animation is visible", () => onlineView.LoadingSpinner.IsPresent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestOnlineViewContainer : OnlineViewContainer
|
private class TestOnlineViewContainer : OnlineViewContainer
|
||||||
{
|
{
|
||||||
public new LoadingAnimation LoadingAnimation => base.LoadingAnimation;
|
public new LoadingSpinner LoadingSpinner => base.LoadingSpinner;
|
||||||
|
|
||||||
public CompositeDrawable ViewTarget => base.Content;
|
public CompositeDrawable ViewTarget => base.Content;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
public TestSceneLoadingAnimation()
|
public TestSceneLoadingAnimation()
|
||||||
: base(2, 2)
|
: base(2, 2)
|
||||||
{
|
{
|
||||||
LoadingAnimation loading;
|
LoadingSpinner loading;
|
||||||
|
|
||||||
Cell(0).AddRange(new Drawable[]
|
Cell(0).AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
@ -22,7 +22,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
RelativeSizeAxes = Axes.Both
|
RelativeSizeAxes = Axes.Both
|
||||||
},
|
},
|
||||||
loading = new LoadingAnimation()
|
loading = new LoadingSpinner()
|
||||||
});
|
});
|
||||||
|
|
||||||
loading.Show();
|
loading.Show();
|
||||||
@ -34,7 +34,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
Colour = Color4.White,
|
Colour = Color4.White,
|
||||||
RelativeSizeAxes = Axes.Both
|
RelativeSizeAxes = Axes.Both
|
||||||
},
|
},
|
||||||
loading = new LoadingAnimation()
|
loading = new LoadingSpinner()
|
||||||
});
|
});
|
||||||
|
|
||||||
loading.Show();
|
loading.Show();
|
||||||
@ -46,14 +46,14 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
Colour = Color4.Gray,
|
Colour = Color4.Gray,
|
||||||
RelativeSizeAxes = Axes.Both
|
RelativeSizeAxes = Axes.Both
|
||||||
},
|
},
|
||||||
loading = new LoadingAnimation()
|
loading = new LoadingSpinner()
|
||||||
});
|
});
|
||||||
|
|
||||||
loading.Show();
|
loading.Show();
|
||||||
|
|
||||||
Cell(3).AddRange(new Drawable[]
|
Cell(3).AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
loading = new LoadingAnimation()
|
loading = new LoadingSpinner()
|
||||||
});
|
});
|
||||||
|
|
||||||
Scheduler.AddDelayed(() => loading.ToggleVisibility(), 200, true);
|
Scheduler.AddDelayed(() => loading.ToggleVisibility(), 200, true);
|
||||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
private Drawable dimContent;
|
private Drawable dimContent;
|
||||||
private LoadingLayer overlay;
|
private LoadingLayer overlay;
|
||||||
|
|
||||||
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(LoadingAnimation) };
|
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(LoadingSpinner) };
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp() => Schedule(() =>
|
public void SetUp() => Schedule(() =>
|
||||||
|
@ -40,14 +40,14 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
set => loading.Size = value;
|
set => loading.Size = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly LoadingAnimation loading;
|
private readonly LoadingSpinner loading;
|
||||||
|
|
||||||
protected LoadingButton()
|
protected LoadingButton()
|
||||||
{
|
{
|
||||||
AddRange(new[]
|
AddRange(new[]
|
||||||
{
|
{
|
||||||
CreateContent(),
|
CreateContent(),
|
||||||
loading = new LoadingAnimation
|
loading = new LoadingSpinner
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
@ -15,7 +15,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
/// Also optionally dims target elements.
|
/// Also optionally dims target elements.
|
||||||
/// Useful for disabling all elements in a form and showing we are waiting on a response, for instance.
|
/// Useful for disabling all elements in a form and showing we are waiting on a response, for instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class LoadingLayer : LoadingAnimation
|
public class LoadingLayer : LoadingSpinner
|
||||||
{
|
{
|
||||||
private readonly Drawable dimTarget;
|
private readonly Drawable dimTarget;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A loading spinner.
|
/// A loading spinner.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class LoadingAnimation : VisibilityContainer
|
public class LoadingSpinner : VisibilityContainer
|
||||||
{
|
{
|
||||||
private readonly SpriteIcon spinner;
|
private readonly SpriteIcon spinner;
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
/// Constuct a new loading spinner.
|
/// Constuct a new loading spinner.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="withBox"></param>
|
/// <param name="withBox"></param>
|
||||||
public LoadingAnimation(bool withBox = false)
|
public LoadingSpinner(bool withBox = false)
|
||||||
{
|
{
|
||||||
Size = new Vector2(60);
|
Size = new Vector2(60);
|
||||||
|
|
@ -30,7 +30,7 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
|
|
||||||
private FillFlowContainer<LeaderboardScore> scrollFlow;
|
private FillFlowContainer<LeaderboardScore> scrollFlow;
|
||||||
|
|
||||||
private readonly LoadingAnimation loading;
|
private readonly LoadingSpinner loading;
|
||||||
|
|
||||||
private ScheduledDelegate showScoresDelegate;
|
private ScheduledDelegate showScoresDelegate;
|
||||||
private CancellationTokenSource showScoresCancellationSource;
|
private CancellationTokenSource showScoresCancellationSource;
|
||||||
@ -202,7 +202,7 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
loading = new LoadingAnimation(),
|
loading = new LoadingSpinner(),
|
||||||
placeholderContainer = new Container
|
placeholderContainer = new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both
|
RelativeSizeAxes = Axes.Both
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Online
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class OnlineViewContainer : Container, IOnlineComponent
|
public abstract class OnlineViewContainer : Container, IOnlineComponent
|
||||||
{
|
{
|
||||||
protected LoadingAnimation LoadingAnimation { get; private set; }
|
protected LoadingSpinner LoadingSpinner { get; private set; }
|
||||||
|
|
||||||
protected override Container<Drawable> Content { get; } = new Container { RelativeSizeAxes = Axes.Both };
|
protected override Container<Drawable> Content { get; } = new Container { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ namespace osu.Game.Online
|
|||||||
{
|
{
|
||||||
Content,
|
Content,
|
||||||
placeholder = new LoginPlaceholder(placeholderMessage),
|
placeholder = new LoginPlaceholder(placeholderMessage),
|
||||||
LoadingAnimation = new LoadingAnimation
|
LoadingSpinner = new LoadingSpinner
|
||||||
{
|
{
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
}
|
}
|
||||||
@ -63,19 +63,19 @@ namespace osu.Game.Online
|
|||||||
PopContentOut(Content);
|
PopContentOut(Content);
|
||||||
placeholder.ScaleTo(0.8f).Then().ScaleTo(1, 3 * transform_duration, Easing.OutQuint);
|
placeholder.ScaleTo(0.8f).Then().ScaleTo(1, 3 * transform_duration, Easing.OutQuint);
|
||||||
placeholder.FadeInFromZero(2 * transform_duration, Easing.OutQuint);
|
placeholder.FadeInFromZero(2 * transform_duration, Easing.OutQuint);
|
||||||
LoadingAnimation.Hide();
|
LoadingSpinner.Hide();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case APIState.Online:
|
case APIState.Online:
|
||||||
PopContentIn(Content);
|
PopContentIn(Content);
|
||||||
placeholder.FadeOut(transform_duration / 2, Easing.OutQuint);
|
placeholder.FadeOut(transform_duration / 2, Easing.OutQuint);
|
||||||
LoadingAnimation.Hide();
|
LoadingSpinner.Hide();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case APIState.Failing:
|
case APIState.Failing:
|
||||||
case APIState.Connecting:
|
case APIState.Connecting:
|
||||||
PopContentOut(Content);
|
PopContentOut(Content);
|
||||||
LoadingAnimation.Show();
|
LoadingSpinner.Show();
|
||||||
placeholder.FadeOut(transform_duration / 2, Easing.OutQuint);
|
placeholder.FadeOut(transform_duration / 2, Easing.OutQuint);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -45,7 +45,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
|
|
||||||
private readonly FavouriteButton favouriteButton;
|
private readonly FavouriteButton favouriteButton;
|
||||||
private readonly FillFlowContainer fadeContent;
|
private readonly FillFlowContainer fadeContent;
|
||||||
private readonly LoadingAnimation loading;
|
private readonly LoadingSpinner loading;
|
||||||
private readonly BeatmapSetHeader beatmapSetHeader;
|
private readonly BeatmapSetHeader beatmapSetHeader;
|
||||||
|
|
||||||
[Cached(typeof(IBindable<RulesetInfo>))]
|
[Cached(typeof(IBindable<RulesetInfo>))]
|
||||||
@ -179,7 +179,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loading = new LoadingAnimation
|
loading = new LoadingSpinner
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
@ -37,7 +37,7 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private readonly List<DrawableChannel> loadedChannels = new List<DrawableChannel>();
|
private readonly List<DrawableChannel> loadedChannels = new List<DrawableChannel>();
|
||||||
|
|
||||||
private LoadingAnimation loading;
|
private LoadingSpinner loading;
|
||||||
|
|
||||||
private FocusedTextBox textbox;
|
private FocusedTextBox textbox;
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ namespace osu.Game.Overlays
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loading = new LoadingAnimation(),
|
loading = new LoadingSpinner(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tabsArea = new TabsArea
|
tabsArea = new TabsArea
|
||||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
|
|
||||||
private Color4 hoverColour;
|
private Color4 hoverColour;
|
||||||
private readonly SpriteIcon icon;
|
private readonly SpriteIcon icon;
|
||||||
private readonly LoadingAnimation loadingAnimation;
|
private readonly LoadingSpinner loadingSpinner;
|
||||||
|
|
||||||
private const float transition_duration = 500;
|
private const float transition_duration = 500;
|
||||||
|
|
||||||
@ -53,12 +53,12 @@ namespace osu.Game.Overlays.Direct
|
|||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
icon.FadeTo(0.5f, transition_duration, Easing.OutQuint);
|
icon.FadeTo(0.5f, transition_duration, Easing.OutQuint);
|
||||||
loadingAnimation.Show();
|
loadingSpinner.Show();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
icon.FadeTo(1, transition_duration, Easing.OutQuint);
|
icon.FadeTo(1, transition_duration, Easing.OutQuint);
|
||||||
loadingAnimation.Hide();
|
loadingSpinner.Hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Icon = FontAwesome.Solid.Play,
|
Icon = FontAwesome.Solid.Play,
|
||||||
},
|
},
|
||||||
loadingAnimation = new LoadingAnimation
|
loadingSpinner = new LoadingSpinner
|
||||||
{
|
{
|
||||||
Size = new Vector2(15),
|
Size = new Vector2(15),
|
||||||
},
|
},
|
||||||
|
@ -95,7 +95,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new LoadingAnimation
|
new LoadingSpinner
|
||||||
{
|
{
|
||||||
State = { Value = Visibility.Visible },
|
State = { Value = Visibility.Visible },
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
public class SocialOverlay : SearchableListOverlay<SocialTab, SocialSortCriteria, SortDirection>
|
public class SocialOverlay : SearchableListOverlay<SocialTab, SocialSortCriteria, SortDirection>
|
||||||
{
|
{
|
||||||
private readonly LoadingAnimation loading;
|
private readonly LoadingSpinner loading;
|
||||||
private FillFlowContainer<SocialPanel> panels;
|
private FillFlowContainer<SocialPanel> panels;
|
||||||
|
|
||||||
protected override Color4 BackgroundColour => OsuColour.FromHex(@"60284b");
|
protected override Color4 BackgroundColour => OsuColour.FromHex(@"60284b");
|
||||||
@ -54,7 +54,7 @@ namespace osu.Game.Overlays
|
|||||||
public SocialOverlay()
|
public SocialOverlay()
|
||||||
: base(OverlayColourScheme.Pink)
|
: base(OverlayColourScheme.Pink)
|
||||||
{
|
{
|
||||||
Add(loading = new LoadingAnimation());
|
Add(loading = new LoadingSpinner());
|
||||||
|
|
||||||
Filter.Search.Current.ValueChanged += text =>
|
Filter.Search.Current.ValueChanged += text =>
|
||||||
{
|
{
|
||||||
|
@ -53,7 +53,7 @@ namespace osu.Game.Screens.Play
|
|||||||
private readonly WorkingBeatmap beatmap;
|
private readonly WorkingBeatmap beatmap;
|
||||||
private readonly Bindable<IReadOnlyList<Mod>> mods;
|
private readonly Bindable<IReadOnlyList<Mod>> mods;
|
||||||
private readonly Drawable facade;
|
private readonly Drawable facade;
|
||||||
private LoadingAnimation loading;
|
private LoadingSpinner loading;
|
||||||
private Sprite backgroundSprite;
|
private Sprite backgroundSprite;
|
||||||
|
|
||||||
public IBindable<IReadOnlyList<Mod>> Mods => mods;
|
public IBindable<IReadOnlyList<Mod>> Mods => mods;
|
||||||
@ -138,7 +138,7 @@ namespace osu.Game.Screens.Play
|
|||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
},
|
},
|
||||||
loading = new LoadingAnimation { Scale = new Vector2(1.3f) }
|
loading = new LoadingSpinner { Scale = new Vector2(1.3f) }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
|
Loading…
Reference in New Issue
Block a user