mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 01:17:35 +09:00
Change display to always show progress bar, only hiding seeking handle instead
This commit is contained in:
parent
da65fff48e
commit
997b49f6dc
@ -6,6 +6,9 @@ using System.Collections.Generic;
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Testing;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
using osu.Framework.Timing;
|
using osu.Framework.Timing;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
@ -131,7 +131,6 @@ namespace osu.Game.Screens.Play
|
|||||||
BindDrawableRuleset(drawableRuleset);
|
BindDrawableRuleset(drawableRuleset);
|
||||||
|
|
||||||
Progress.Objects = drawableRuleset.Objects;
|
Progress.Objects = drawableRuleset.Objects;
|
||||||
Progress.AllowSeeking = drawableRuleset.HasReplayLoaded.Value;
|
|
||||||
Progress.RequestSeek = time => RequestSeek(time);
|
Progress.RequestSeek = time => RequestSeek(time);
|
||||||
Progress.ReferenceClock = drawableRuleset.FrameStableClock;
|
Progress.ReferenceClock = drawableRuleset.FrameStableClock;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,6 @@ namespace osu.Game.Screens.Play
|
|||||||
public override bool HandlePositionalInput => AllowSeeking.Value;
|
public override bool HandlePositionalInput => AllowSeeking.Value;
|
||||||
|
|
||||||
private double firstHitTime => objects.First().StartTime;
|
private double firstHitTime => objects.First().StartTime;
|
||||||
private double lastHitTime => ((objects.Last() as IHasEndTime)?.EndTime ?? objects.Last().StartTime) + 1;
|
|
||||||
|
|
||||||
private IEnumerable<HitObject> objects;
|
private IEnumerable<HitObject> objects;
|
||||||
|
|
||||||
@ -92,7 +91,6 @@ namespace osu.Game.Screens.Play
|
|||||||
},
|
},
|
||||||
bar = new SongProgressBar(bottom_bar_height, graph_height, handle_size)
|
bar = new SongProgressBar(bottom_bar_height, graph_height, handle_size)
|
||||||
{
|
{
|
||||||
Alpha = 0,
|
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
OnSeek = time => RequestSeek?.Invoke(time),
|
OnSeek = time => RequestSeek?.Invoke(time),
|
||||||
@ -105,6 +103,9 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
|
if (clock != null)
|
||||||
|
gameplayClock = clock;
|
||||||
|
|
||||||
config.BindWith(OsuSetting.ShowProgressGraph, ShowGraph);
|
config.BindWith(OsuSetting.ShowProgressGraph, ShowGraph);
|
||||||
|
|
||||||
graph.FillColour = bar.FillColour = colours.BlueLighter;
|
graph.FillColour = bar.FillColour = colours.BlueLighter;
|
||||||
@ -151,8 +152,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private void updateBarVisibility()
|
private void updateBarVisibility()
|
||||||
{
|
{
|
||||||
bar.FadeTo(AllowSeeking.Value ? 1 : 0, transition_duration, Easing.In);
|
bar.ShowHandle = AllowSeeking.Value;
|
||||||
this.MoveTo(new Vector2(0, AllowSeeking.Value ? 0 : bottom_bar_height), transition_duration, Easing.In);
|
|
||||||
|
|
||||||
updateInfoMargin();
|
updateInfoMargin();
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,22 @@ namespace osu.Game.Screens.Play
|
|||||||
private readonly Container handleBase;
|
private readonly Container handleBase;
|
||||||
private readonly Container handleContainer;
|
private readonly Container handleContainer;
|
||||||
|
|
||||||
|
private bool showHandle;
|
||||||
|
|
||||||
|
public bool ShowHandle
|
||||||
|
{
|
||||||
|
get => showHandle;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == showHandle)
|
||||||
|
return;
|
||||||
|
|
||||||
|
showHandle = value;
|
||||||
|
|
||||||
|
handleBase.FadeTo(showHandle ? 1 : 0, 200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Color4 FillColour
|
public Color4 FillColour
|
||||||
{
|
{
|
||||||
set => fill.Colour = value;
|
set => fill.Colour = value;
|
||||||
@ -75,6 +91,7 @@ namespace osu.Game.Screens.Play
|
|||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Width = 2,
|
Width = 2,
|
||||||
|
Alpha = 0,
|
||||||
Colour = Color4.White,
|
Colour = Color4.White,
|
||||||
Position = new Vector2(2, 0),
|
Position = new Vector2(2, 0),
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
@ -128,7 +145,11 @@ namespace osu.Game.Screens.Play
|
|||||||
protected override void OnUserChange(double value)
|
protected override void OnUserChange(double value)
|
||||||
{
|
{
|
||||||
scheduledSeek?.Cancel();
|
scheduledSeek?.Cancel();
|
||||||
scheduledSeek = Schedule(() => OnSeek?.Invoke(value));
|
scheduledSeek = Schedule(() =>
|
||||||
|
{
|
||||||
|
if (showHandle)
|
||||||
|
OnSeek?.Invoke(value);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user