mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 14:42:54 +08:00
Merge branch 'master' into judgement-cleanup
This commit is contained in:
commit
0f51007867
@ -5,6 +5,7 @@ using System;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Catch.Objects.Drawable;
|
using osu.Game.Rulesets.Catch.Objects.Drawable;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
@ -24,6 +25,8 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
|
|
||||||
protected override bool UserScrollSpeedAdjustment => false;
|
protected override bool UserScrollSpeedAdjustment => false;
|
||||||
|
|
||||||
|
protected override SpeedChangeVisualisationMethod VisualisationMethod => SpeedChangeVisualisationMethod.Constant;
|
||||||
|
|
||||||
public CatchPlayfield(BeatmapDifficulty difficulty, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> getVisualRepresentation)
|
public CatchPlayfield(BeatmapDifficulty difficulty, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> getVisualRepresentation)
|
||||||
: base(BASE_WIDTH)
|
: base(BASE_WIDTH)
|
||||||
{
|
{
|
||||||
@ -55,6 +58,8 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
VisibleTimeRange.Value = BeatmapDifficulty.DifficultyRange(difficulty.ApproachRate, 1800, 1200, 450);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CheckIfWeCanCatch(CatchHitObject obj) => catcherArea.AttemptCatch(obj);
|
public bool CheckIfWeCanCatch(CatchHitObject obj) => catcherArea.AttemptCatch(obj);
|
||||||
|
@ -1,23 +1,24 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Graphics.Shapes;
|
|
||||||
using osu.Game.Rulesets.Taiko.Objects;
|
|
||||||
using OpenTK;
|
|
||||||
using OpenTK.Graphics;
|
|
||||||
using osu.Game.Rulesets.Taiko.Judgements;
|
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Framework.Allocation;
|
||||||
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
|
using osu.Game.Configuration;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osu.Game.Rulesets.UI.Scrolling;
|
using osu.Game.Rulesets.UI.Scrolling;
|
||||||
|
using osu.Game.Rulesets.Taiko.Objects;
|
||||||
|
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
||||||
|
using osu.Game.Rulesets.Taiko.Judgements;
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.UI
|
namespace osu.Game.Rulesets.Taiko.UI
|
||||||
{
|
{
|
||||||
@ -40,6 +41,8 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
|
|
||||||
protected override bool UserScrollSpeedAdjustment => false;
|
protected override bool UserScrollSpeedAdjustment => false;
|
||||||
|
|
||||||
|
protected override SpeedChangeVisualisationMethod VisualisationMethod => SpeedChangeVisualisationMethod.Overlapping;
|
||||||
|
|
||||||
private readonly Container<HitExplosion> hitExplosionContainer;
|
private readonly Container<HitExplosion> hitExplosionContainer;
|
||||||
private readonly Container<KiaiHitExplosion> kiaiExplosionContainer;
|
private readonly Container<KiaiHitExplosion> kiaiExplosionContainer;
|
||||||
private readonly JudgementContainer<DrawableTaikoJudgement> judgementContainer;
|
private readonly JudgementContainer<DrawableTaikoJudgement> judgementContainer;
|
||||||
|
@ -83,8 +83,6 @@ namespace osu.Game.Configuration
|
|||||||
|
|
||||||
Set(OsuSetting.ScoreDisplayMode, ScoringMode.Standardised);
|
Set(OsuSetting.ScoreDisplayMode, ScoringMode.Standardised);
|
||||||
|
|
||||||
Set(OsuSetting.SpeedChangeVisualisation, SpeedChangeVisualisationMethod.Sequential);
|
|
||||||
|
|
||||||
Set(OsuSetting.IncreaseFirstObjectVisibility, true);
|
Set(OsuSetting.IncreaseFirstObjectVisibility, true);
|
||||||
|
|
||||||
// Update
|
// Update
|
||||||
@ -143,7 +141,6 @@ namespace osu.Game.Configuration
|
|||||||
ChatDisplayHeight,
|
ChatDisplayHeight,
|
||||||
Version,
|
Version,
|
||||||
ShowConvertedBeatmaps,
|
ShowConvertedBeatmaps,
|
||||||
SpeedChangeVisualisation,
|
|
||||||
Skin,
|
Skin,
|
||||||
ScreenshotFormat,
|
ScreenshotFormat,
|
||||||
ScreenshotCaptureMenuCursor,
|
ScreenshotCaptureMenuCursor,
|
||||||
|
@ -10,6 +10,8 @@ namespace osu.Game.Configuration
|
|||||||
[Description("Sequential")]
|
[Description("Sequential")]
|
||||||
Sequential,
|
Sequential,
|
||||||
[Description("Overlapping")]
|
[Description("Overlapping")]
|
||||||
Overlapping
|
Overlapping,
|
||||||
|
[Description("Constant")]
|
||||||
|
Constant
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Game.Configuration;
|
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
|
||||||
{
|
|
||||||
public class ScrollingSettings : SettingsSubsection
|
|
||||||
{
|
|
||||||
protected override string Header => "Scrolling";
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuConfigManager config)
|
|
||||||
{
|
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
new SettingsEnumDropdown<SpeedChangeVisualisationMethod>
|
|
||||||
{
|
|
||||||
LabelText = "Visualise speed changes as",
|
|
||||||
Bindable = config.GetBindable<SpeedChangeVisualisationMethod>(OsuSetting.SpeedChangeVisualisation),
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -21,7 +21,6 @@ namespace osu.Game.Overlays.Settings.Sections
|
|||||||
{
|
{
|
||||||
new GeneralSettings(),
|
new GeneralSettings(),
|
||||||
new SongSelectSettings(),
|
new SongSelectSettings(),
|
||||||
new ScrollingSettings(),
|
|
||||||
new ModsSettings(),
|
new ModsSettings(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -29,7 +28,7 @@ namespace osu.Game.Overlays.Settings.Sections
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(RulesetStore rulesets)
|
private void load(RulesetStore rulesets)
|
||||||
{
|
{
|
||||||
foreach(Ruleset ruleset in rulesets.AvailableRulesets.Select(info => info.CreateInstance()))
|
foreach (Ruleset ruleset in rulesets.AvailableRulesets.Select(info => info.CreateInstance()))
|
||||||
{
|
{
|
||||||
SettingsSubsection section = ruleset.CreateSettings();
|
SettingsSubsection section = ruleset.CreateSettings();
|
||||||
if (section != null)
|
if (section != null)
|
||||||
|
@ -102,7 +102,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
resolutionDropdown.Hide();
|
resolutionDropdown.Hide();
|
||||||
});
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
letterboxing.BindValueChanged(isVisible =>
|
letterboxing.BindValueChanged(isVisible =>
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Caching;
|
using osu.Framework.Caching;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -33,20 +32,16 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
|
|
||||||
private Cached initialStateCache = new Cached();
|
private Cached initialStateCache = new Cached();
|
||||||
|
|
||||||
public ScrollingHitObjectContainer()
|
private readonly ISpeedChangeVisualiser speedChangeVisualiser;
|
||||||
|
|
||||||
|
public ScrollingHitObjectContainer(SpeedChangeVisualisationMethod visualisationMethod)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
TimeRange.ValueChanged += _ => initialStateCache.Invalidate();
|
TimeRange.ValueChanged += _ => initialStateCache.Invalidate();
|
||||||
Direction.ValueChanged += _ => initialStateCache.Invalidate();
|
Direction.ValueChanged += _ => initialStateCache.Invalidate();
|
||||||
}
|
|
||||||
|
|
||||||
private ISpeedChangeVisualiser speedChangeVisualiser;
|
switch (visualisationMethod)
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuConfigManager config)
|
|
||||||
{
|
|
||||||
switch (config.Get<SpeedChangeVisualisationMethod>(OsuSetting.SpeedChangeVisualisation))
|
|
||||||
{
|
{
|
||||||
case SpeedChangeVisualisationMethod.Sequential:
|
case SpeedChangeVisualisationMethod.Sequential:
|
||||||
speedChangeVisualiser = new SequentialSpeedChangeVisualiser(ControlPoints);
|
speedChangeVisualiser = new SequentialSpeedChangeVisualiser(ControlPoints);
|
||||||
@ -54,6 +49,9 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
case SpeedChangeVisualisationMethod.Overlapping:
|
case SpeedChangeVisualisationMethod.Overlapping:
|
||||||
speedChangeVisualiser = new OverlappingSpeedChangeVisualiser(ControlPoints);
|
speedChangeVisualiser = new OverlappingSpeedChangeVisualiser(ControlPoints);
|
||||||
break;
|
break;
|
||||||
|
case SpeedChangeVisualisationMethod.Constant:
|
||||||
|
speedChangeVisualiser = new ConstantSpeedChangeVisualiser();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Input.Bindings;
|
using osu.Game.Input.Bindings;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
|
||||||
@ -62,6 +63,8 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected readonly Bindable<ScrollingDirection> Direction = new Bindable<ScrollingDirection>();
|
protected readonly Bindable<ScrollingDirection> Direction = new Bindable<ScrollingDirection>();
|
||||||
|
|
||||||
|
protected virtual SpeedChangeVisualisationMethod VisualisationMethod => SpeedChangeVisualisationMethod.Sequential;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new <see cref="ScrollingPlayfield"/>.
|
/// Creates a new <see cref="ScrollingPlayfield"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -104,7 +107,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
|
|
||||||
protected sealed override HitObjectContainer CreateHitObjectContainer()
|
protected sealed override HitObjectContainer CreateHitObjectContainer()
|
||||||
{
|
{
|
||||||
var container = new ScrollingHitObjectContainer();
|
var container = new ScrollingHitObjectContainer(VisualisationMethod);
|
||||||
container.Direction.BindTo(Direction);
|
container.Direction.BindTo(Direction);
|
||||||
return container;
|
return container;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,67 @@
|
|||||||
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.UI.Scrolling.Visualisers
|
||||||
|
{
|
||||||
|
public class ConstantSpeedChangeVisualiser : ISpeedChangeVisualiser
|
||||||
|
{
|
||||||
|
public void ComputeInitialStates(IEnumerable<DrawableHitObject> hitObjects, ScrollingDirection direction, double timeRange, Vector2 length)
|
||||||
|
{
|
||||||
|
foreach (var obj in hitObjects)
|
||||||
|
{
|
||||||
|
obj.LifetimeStart = obj.HitObject.StartTime - timeRange;
|
||||||
|
|
||||||
|
if (obj.HitObject is IHasEndTime endTime)
|
||||||
|
{
|
||||||
|
var hitObjectLength = (endTime.EndTime - obj.HitObject.StartTime) / timeRange;
|
||||||
|
|
||||||
|
switch (direction)
|
||||||
|
{
|
||||||
|
case ScrollingDirection.Up:
|
||||||
|
case ScrollingDirection.Down:
|
||||||
|
obj.Height = (float)(hitObjectLength * length.Y);
|
||||||
|
break;
|
||||||
|
case ScrollingDirection.Left:
|
||||||
|
case ScrollingDirection.Right:
|
||||||
|
obj.Width = (float)(hitObjectLength * length.X);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ComputeInitialStates(obj.NestedHitObjects, direction, timeRange, length);
|
||||||
|
|
||||||
|
// Nested hitobjects don't need to scroll, but they do need accurate positions
|
||||||
|
UpdatePositions(obj.NestedHitObjects, direction, obj.HitObject.StartTime, timeRange, length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdatePositions(IEnumerable<DrawableHitObject> hitObjects, ScrollingDirection direction, double currentTime, double timeRange, Vector2 length)
|
||||||
|
{
|
||||||
|
foreach (var obj in hitObjects)
|
||||||
|
{
|
||||||
|
var position = (obj.HitObject.StartTime - currentTime) / timeRange;
|
||||||
|
|
||||||
|
switch (direction)
|
||||||
|
{
|
||||||
|
case ScrollingDirection.Up:
|
||||||
|
obj.Y = (float)(position * length.Y);
|
||||||
|
break;
|
||||||
|
case ScrollingDirection.Down:
|
||||||
|
obj.Y = (float)(-position * length.Y);
|
||||||
|
break;
|
||||||
|
case ScrollingDirection.Left:
|
||||||
|
obj.X = (float)(position * length.X);
|
||||||
|
break;
|
||||||
|
case ScrollingDirection.Right:
|
||||||
|
obj.X = (float)(-position * length.X);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user