Skip to content
This repository has been archived by the owner on Jun 11, 2023. It is now read-only.

Commit

Permalink
当BeatmapPiece在不可用的情况下被点击时摇晃内容; 优化Mvis屏幕光标隐藏条件
Browse files Browse the repository at this point in the history
  • Loading branch information
MATRIX-feather committed Feb 9, 2021
1 parent 42edae9 commit 82e9656
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
6 changes: 4 additions & 2 deletions osu.Game/Screens/Mvis/Collections/Interface/BeatmapPiece.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class BeatmapPiece : CompositeDrawable
private Box hover;
private FillFlowContainer maskFillFlow;
private Box bgBox;
private Container content;
private ShakeContainer content;

public BeatmapPiece(WorkingBeatmap b)
{
Expand All @@ -51,7 +51,7 @@ public BeatmapPiece(WorkingBeatmap b)
[BackgroundDependencyLoader]
private void load()
{
InternalChild = content = new Container
InternalChild = content = new ShakeContainer
{
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Expand Down Expand Up @@ -242,6 +242,8 @@ protected override bool OnClick(ClickEvent e)
b.Value = Beatmap;
controller.Play();
}
else
content.Shake();

return base.OnClick(e);
}
Expand Down
20 changes: 10 additions & 10 deletions osu.Game/Screens/Mvis/MvisScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ namespace osu.Game.Screens.Mvis
public class MvisScreen : ScreenWithBeatmapBackground, IKeyBindingHandler<GlobalAction>
{
public override bool HideOverlaysOnEnter => true;
private bool allowCursor;
public override bool AllowBackButton => false;
public override bool CursorVisible => allowCursor;

public override bool CursorVisible => !overlaysHidden || sidebar.State.Value == Visibility.Visible; //隐藏界面或侧边栏可见,显示光标

public override bool AllowRateAdjustments => true;

private bool canReallyHide =>
Expand Down Expand Up @@ -121,7 +122,12 @@ protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnl
#region overlay

private LoadingSpinner loadingSpinner;
private Sidebar sidebar;

private readonly Sidebar sidebar = new Sidebar
{
Name = "Sidebar Container",
Padding = new MarginPadding { Right = HORIZONTAL_OVERFLOW_PADDING }
};

#endregion

Expand Down Expand Up @@ -269,11 +275,7 @@ private void load(MConfigManager config, IdleTracker idleTracker)
Origin = Anchor.BottomCentre,
Margin = new MarginPadding(115)
},
sidebar = new Sidebar
{
Name = "Sidebar Container",
Padding = new MarginPadding { Right = HORIZONTAL_OVERFLOW_PADDING }
},
sidebar,
skinnableBbBackground = new FullScreenSkinnableComponent("MBottomBar-background",
confineMode: ConfineMode.ScaleToFill,
masking: true,
Expand Down Expand Up @@ -830,7 +832,6 @@ private void hideOverlays(bool force)
progressBar.MoveToY(5, duration, Easing.OutQuint);
bottomBar.FadeOut(duration, Easing.OutQuint);

allowCursor = false;
overlaysHidden = true;
updateIdleVisuals();
}
Expand All @@ -852,7 +853,6 @@ private void showOverlays(bool force)
progressBar.MoveToY(0, duration, Easing.OutQuint);
bottomBar.FadeIn(duration, Easing.OutQuint);

allowCursor = true;
overlaysHidden = false;

applyBackgroundBrightness();
Expand Down

0 comments on commit 82e9656

Please sign in to comment.