mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 05:32:54 +08:00
Merge branch 'master' into sprite-icon-compatibility
This commit is contained in:
commit
176b4ecc38
@ -6,6 +6,7 @@ using System.Linq;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osuTK.Graphics;
|
||||
@ -14,7 +15,7 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
{
|
||||
public class SliderBall : CircularContainer, ISliderProgress
|
||||
public class SliderBall : CircularContainer, ISliderProgress, IRequireHighFrequencyMousePosition
|
||||
{
|
||||
private const float width = 128;
|
||||
|
||||
@ -107,18 +108,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
|
||||
private Vector2? lastScreenSpaceMousePosition;
|
||||
|
||||
protected override bool OnMouseDown(MouseDownEvent e)
|
||||
{
|
||||
lastScreenSpaceMousePosition = e.ScreenSpaceMousePosition;
|
||||
return base.OnMouseDown(e);
|
||||
}
|
||||
|
||||
protected override bool OnMouseUp(MouseUpEvent e)
|
||||
{
|
||||
lastScreenSpaceMousePosition = e.ScreenSpaceMousePosition;
|
||||
return base.OnMouseUp(e);
|
||||
}
|
||||
|
||||
protected override bool OnMouseMove(MouseMoveEvent e)
|
||||
{
|
||||
lastScreenSpaceMousePosition = e.ScreenSpaceMousePosition;
|
||||
|
@ -92,7 +92,7 @@ namespace osu.Game.Tests.Visual.Background
|
||||
public void PlayerLoaderSettingsHoverTest()
|
||||
{
|
||||
setupUserSettings();
|
||||
AddStep("Start player loader", () => songSelect.Push(playerLoader = new TestPlayerLoader(player = new TestPlayer())));
|
||||
AddStep("Start player loader", () => songSelect.Push(playerLoader = new TestPlayerLoader(player = new TestPlayer { BlockLoad = true })));
|
||||
AddUntilStep("Wait for Player Loader to load", () => playerLoader?.IsLoaded ?? false);
|
||||
AddAssert("Background retained from song select", () => songSelect.IsBackgroundCurrent());
|
||||
AddStep("Trigger background preview", () =>
|
||||
@ -255,14 +255,7 @@ namespace osu.Game.Tests.Visual.Background
|
||||
{
|
||||
setupUserSettings();
|
||||
|
||||
AddStep("Start player loader", () =>
|
||||
{
|
||||
songSelect.Push(playerLoader = new TestPlayerLoader(player = new TestPlayer
|
||||
{
|
||||
AllowPause = allowPause,
|
||||
Ready = true,
|
||||
}));
|
||||
});
|
||||
AddStep("Start player loader", () => songSelect.Push(playerLoader = new TestPlayerLoader(player = new TestPlayer { AllowPause = allowPause, })));
|
||||
AddUntilStep("Wait for Player Loader to load", () => playerLoader.IsLoaded);
|
||||
AddStep("Move mouse to center of screen", () => InputManager.MoveMouseTo(playerLoader.ScreenPos));
|
||||
AddUntilStep("Wait for player to load", () => player.IsLoaded);
|
||||
@ -351,7 +344,7 @@ namespace osu.Game.Tests.Visual.Background
|
||||
public UserDimContainer CurrentStoryboardContainer => StoryboardContainer;
|
||||
|
||||
// Whether or not the player should be allowed to load.
|
||||
public bool Ready;
|
||||
public bool BlockLoad;
|
||||
|
||||
public Bindable<bool> StoryboardEnabled;
|
||||
public readonly Bindable<bool> ReplacesBackground = new Bindable<bool>();
|
||||
@ -362,10 +355,11 @@ namespace osu.Game.Tests.Visual.Background
|
||||
public bool IsStoryboardInvisible() => ((TestUserDimContainer)CurrentStoryboardContainer).CurrentAlpha <= 1;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config)
|
||||
private void load(OsuConfigManager config, CancellationToken token)
|
||||
{
|
||||
while (!Ready)
|
||||
while (BlockLoad && !token.IsCancellationRequested)
|
||||
Thread.Sleep(1);
|
||||
|
||||
StoryboardEnabled = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
||||
ReplacesBackground.BindTo(Background.StoryboardReplacesBackground);
|
||||
DrawableRuleset.IsPaused.BindTo(IsPaused);
|
||||
|
@ -391,11 +391,9 @@ namespace osu.Game
|
||||
logoContainer = new Container { RelativeSizeAxes = Axes.Both },
|
||||
}
|
||||
},
|
||||
overlayContent = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
floatingOverlayContent = new Container { RelativeSizeAxes = Axes.Both, Depth = float.MinValue },
|
||||
overlayContent = new Container { RelativeSizeAxes = Axes.Both },
|
||||
floatingOverlayContent = new Container { RelativeSizeAxes = Axes.Both },
|
||||
topMostOverlayContent = new Container { RelativeSizeAxes = Axes.Both },
|
||||
idleTracker = new GameIdleTracker(6000)
|
||||
});
|
||||
|
||||
@ -415,13 +413,12 @@ namespace osu.Game
|
||||
|
||||
loadComponentSingleFile(Toolbar = new Toolbar
|
||||
{
|
||||
Depth = -5,
|
||||
OnHome = delegate
|
||||
{
|
||||
CloseAllOverlays(false);
|
||||
menuScreen?.MakeCurrent();
|
||||
},
|
||||
}, floatingOverlayContent.Add);
|
||||
}, topMostOverlayContent.Add);
|
||||
|
||||
loadComponentSingleFile(volume = new VolumeOverlay(), floatingOverlayContent.Add);
|
||||
loadComponentSingleFile(onscreenDisplay = new OnScreenDisplay(), Add);
|
||||
@ -429,47 +426,32 @@ namespace osu.Game
|
||||
loadComponentSingleFile(screenshotManager, Add);
|
||||
|
||||
//overlay elements
|
||||
loadComponentSingleFile(direct = new DirectOverlay { Depth = -1 }, overlayContent.Add);
|
||||
loadComponentSingleFile(social = new SocialOverlay { Depth = -1 }, overlayContent.Add);
|
||||
loadComponentSingleFile(direct = new DirectOverlay(), overlayContent.Add);
|
||||
loadComponentSingleFile(social = new SocialOverlay(), overlayContent.Add);
|
||||
loadComponentSingleFile(channelManager = new ChannelManager(), AddInternal);
|
||||
loadComponentSingleFile(chatOverlay = new ChatOverlay { Depth = -1 }, overlayContent.Add);
|
||||
loadComponentSingleFile(settings = new MainSettings
|
||||
loadComponentSingleFile(chatOverlay = new ChatOverlay(), overlayContent.Add);
|
||||
loadComponentSingleFile(settings = new MainSettings { GetToolbarHeight = () => ToolbarOffset }, floatingOverlayContent.Add);
|
||||
loadComponentSingleFile(userProfile = new UserProfileOverlay(), overlayContent.Add);
|
||||
loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay(), overlayContent.Add);
|
||||
loadComponentSingleFile(notifications = new NotificationOverlay
|
||||
{
|
||||
GetToolbarHeight = () => ToolbarOffset,
|
||||
Depth = -1
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
}, floatingOverlayContent.Add);
|
||||
loadComponentSingleFile(userProfile = new UserProfileOverlay { Depth = -2 }, overlayContent.Add);
|
||||
loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay { Depth = -3 }, overlayContent.Add);
|
||||
|
||||
loadComponentSingleFile(musicController = new MusicController
|
||||
{
|
||||
Depth = -5,
|
||||
Position = new Vector2(0, Toolbar.HEIGHT),
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
}, floatingOverlayContent.Add);
|
||||
|
||||
loadComponentSingleFile(notifications = new NotificationOverlay
|
||||
{
|
||||
GetToolbarHeight = () => ToolbarOffset,
|
||||
Depth = -4,
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
}, floatingOverlayContent.Add);
|
||||
loadComponentSingleFile(accountCreation = new AccountCreationOverlay(), topMostOverlayContent.Add);
|
||||
|
||||
loadComponentSingleFile(accountCreation = new AccountCreationOverlay
|
||||
{
|
||||
Depth = -6,
|
||||
}, floatingOverlayContent.Add);
|
||||
loadComponentSingleFile(dialogOverlay = new DialogOverlay(), topMostOverlayContent.Add);
|
||||
|
||||
loadComponentSingleFile(dialogOverlay = new DialogOverlay
|
||||
{
|
||||
Depth = -7,
|
||||
}, floatingOverlayContent.Add);
|
||||
|
||||
loadComponentSingleFile(externalLinkOpener = new ExternalLinkOpener
|
||||
{
|
||||
Depth = -8,
|
||||
}, floatingOverlayContent.Add);
|
||||
loadComponentSingleFile(externalLinkOpener = new ExternalLinkOpener(), topMostOverlayContent.Add);
|
||||
|
||||
dependencies.CacheAs(idleTracker);
|
||||
dependencies.Cache(settings);
|
||||
@ -715,6 +697,8 @@ namespace osu.Game
|
||||
|
||||
private Container floatingOverlayContent;
|
||||
|
||||
private Container topMostOverlayContent;
|
||||
|
||||
private FrameworkConfigManager frameworkConfig;
|
||||
private ScalingContainer screenContainer;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user