mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 18:32:56 +08:00
Add scrolling algorithm to global settings
This commit is contained in:
parent
4ab3b0d76b
commit
c4d1922c8b
@ -71,6 +71,8 @@ namespace osu.Game.Configuration
|
|||||||
|
|
||||||
Set(OsuSetting.FloatingComments, false);
|
Set(OsuSetting.FloatingComments, false);
|
||||||
|
|
||||||
|
Set(OsuSetting.ScrollingAlgorithm, ScrollingAlgorithmType.Global);
|
||||||
|
|
||||||
// Update
|
// Update
|
||||||
Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer);
|
Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer);
|
||||||
|
|
||||||
@ -114,6 +116,7 @@ namespace osu.Game.Configuration
|
|||||||
ShowFpsDisplay,
|
ShowFpsDisplay,
|
||||||
ChatDisplayHeight,
|
ChatDisplayHeight,
|
||||||
Version,
|
Version,
|
||||||
ShowConvertedBeatmaps
|
ShowConvertedBeatmaps,
|
||||||
|
ScrollingAlgorithm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
15
osu.Game/Configuration/ScrollingAlgorithmType.cs
Normal file
15
osu.Game/Configuration/ScrollingAlgorithmType.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
|
||||||
|
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
|
namespace osu.Game.Configuration
|
||||||
|
{
|
||||||
|
public enum ScrollingAlgorithmType
|
||||||
|
{
|
||||||
|
[Description("Global")]
|
||||||
|
Global,
|
||||||
|
[Description("Local")]
|
||||||
|
Local
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/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<ScrollingAlgorithmType>
|
||||||
|
{
|
||||||
|
LabelText = "Scrolling algorithm",
|
||||||
|
Bindable = config.GetBindable<ScrollingAlgorithmType>(OsuSetting.ScrollingAlgorithm),
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -21,6 +21,7 @@ namespace osu.Game.Overlays.Settings.Sections
|
|||||||
{
|
{
|
||||||
new GeneralSettings(),
|
new GeneralSettings(),
|
||||||
new SongSelectSettings(),
|
new SongSelectSettings(),
|
||||||
|
new ScrollingSettings()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,4 +36,4 @@ namespace osu.Game.Overlays.Settings.Sections
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The HitObjects contained in this Playfield.
|
/// The HitObjects contained in this Playfield.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly HitObjectContainer HitObjects;
|
public HitObjectContainer HitObjects { get; private set; }
|
||||||
|
|
||||||
public Container<Drawable> ScaledContent;
|
public Container<Drawable> ScaledContent;
|
||||||
|
|
||||||
@ -49,14 +49,14 @@ namespace osu.Game.Rulesets.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
HitObjects = CreateHitObjectContainer();
|
|
||||||
HitObjects.RelativeSizeAxes = Axes.Both;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
|
HitObjects = CreateHitObjectContainer();
|
||||||
|
HitObjects.RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
Add(HitObjects);
|
Add(HitObjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.UI.Scrolling.Algorithms
|
|||||||
var controlPoint = controlPointAt(obj.HitObject.StartTime);
|
var controlPoint = controlPointAt(obj.HitObject.StartTime);
|
||||||
|
|
||||||
obj.LifetimeStart = obj.HitObject.StartTime - timeRange / controlPoint.Multiplier;
|
obj.LifetimeStart = obj.HitObject.StartTime - timeRange / controlPoint.Multiplier;
|
||||||
obj.LifetimeEnd = ((obj as IHasEndTime)?.EndTime ?? obj.HitObject.StartTime) + timeRange / controlPoint.Multiplier;
|
obj.LifetimeEnd = ((obj.HitObject as IHasEndTime)?.EndTime ?? obj.HitObject.StartTime) + timeRange / controlPoint.Multiplier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
|
|
||||||
|
|
||||||
using osu.Game.Rulesets.UI.Scrolling.Algorithms;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.UI.Scrolling
|
|
||||||
{
|
|
||||||
public class GlobalScrollingHitObjectContainer : ScrollingHitObjectContainer
|
|
||||||
{
|
|
||||||
public GlobalScrollingHitObjectContainer(ScrollingDirection direction)
|
|
||||||
: base(direction)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override IScrollingAlgorithm CreateScrollingAlgorithm() => new GlobalScrollingAlgorithm(ControlPoints);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
|
|
||||||
|
|
||||||
using osu.Game.Rulesets.UI.Scrolling.Algorithms;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.UI.Scrolling
|
|
||||||
{
|
|
||||||
public class LocalScrollingHitObjectContainer : ScrollingHitObjectContainer
|
|
||||||
{
|
|
||||||
public LocalScrollingHitObjectContainer(ScrollingDirection direction)
|
|
||||||
: base(direction)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override IScrollingAlgorithm CreateScrollingAlgorithm() => new LocalScrollingAlgorithm(ControlPoints);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +1,19 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 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;
|
||||||
using osu.Framework.Lists;
|
using osu.Framework.Lists;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Timing;
|
using osu.Game.Rulesets.Timing;
|
||||||
using osu.Game.Rulesets.UI.Scrolling.Algorithms;
|
using osu.Game.Rulesets.UI.Scrolling.Algorithms;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.UI.Scrolling
|
namespace osu.Game.Rulesets.UI.Scrolling
|
||||||
{
|
{
|
||||||
public abstract class ScrollingHitObjectContainer : HitObjectContainer
|
public class ScrollingHitObjectContainer : HitObjectContainer
|
||||||
{
|
{
|
||||||
public readonly BindableDouble TimeRange = new BindableDouble
|
public readonly BindableDouble TimeRange = new BindableDouble
|
||||||
{
|
{
|
||||||
@ -25,7 +27,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
|
|
||||||
private Cached initialStateCache = new Cached();
|
private Cached initialStateCache = new Cached();
|
||||||
|
|
||||||
protected ScrollingHitObjectContainer(ScrollingDirection direction)
|
public ScrollingHitObjectContainer(ScrollingDirection direction)
|
||||||
{
|
{
|
||||||
this.direction = direction;
|
this.direction = direction;
|
||||||
|
|
||||||
@ -35,11 +37,19 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
}
|
}
|
||||||
|
|
||||||
private IScrollingAlgorithm scrollingAlgorithm;
|
private IScrollingAlgorithm scrollingAlgorithm;
|
||||||
protected override void LoadComplete()
|
|
||||||
{
|
|
||||||
base.LoadComplete();
|
|
||||||
|
|
||||||
scrollingAlgorithm = CreateScrollingAlgorithm();
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuConfigManager config)
|
||||||
|
{
|
||||||
|
switch (config.Get<ScrollingAlgorithmType>(OsuSetting.ScrollingAlgorithm))
|
||||||
|
{
|
||||||
|
case ScrollingAlgorithmType.Global:
|
||||||
|
scrollingAlgorithm = new GlobalScrollingAlgorithm(ControlPoints);
|
||||||
|
break;
|
||||||
|
case ScrollingAlgorithmType.Local:
|
||||||
|
scrollingAlgorithm = new LocalScrollingAlgorithm(ControlPoints);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Add(DrawableHitObject hitObject)
|
public override void Add(DrawableHitObject hitObject)
|
||||||
@ -99,10 +109,5 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
|
|
||||||
scrollingAlgorithm.ComputePositions(AliveObjects, direction, Time.Current, TimeRange, DrawSize);
|
scrollingAlgorithm.ComputePositions(AliveObjects, direction, Time.Current, TimeRange, DrawSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates the algorithm that will process the positions of the <see cref="DrawableHitObject"/>s.
|
|
||||||
/// </summary>
|
|
||||||
protected abstract IScrollingAlgorithm CreateScrollingAlgorithm();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// 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 System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Transforms;
|
using osu.Framework.Graphics.Transforms;
|
||||||
@ -62,6 +63,11 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
: base(customWidth)
|
: base(customWidth)
|
||||||
{
|
{
|
||||||
this.direction = direction;
|
this.direction = direction;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
HitObjects.TimeRange.BindTo(VisibleTimeRange);
|
HitObjects.TimeRange.BindTo(VisibleTimeRange);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,13 +113,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
this.TransformTo(this.PopulateTransform(new TransformVisibleTimeRange(), newTimeRange, duration, easing));
|
this.TransformTo(this.PopulateTransform(new TransformVisibleTimeRange(), newTimeRange, duration, easing));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected sealed override HitObjectContainer CreateHitObjectContainer() => CreateScrollingHitObjectContainer();
|
protected sealed override HitObjectContainer CreateHitObjectContainer() => new ScrollingHitObjectContainer(direction);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates the <see cref="ScrollingHitObjectContainer"/> that will handle the scrolling of the <see cref="DrawableHitObject"/>s.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected virtual ScrollingHitObjectContainer CreateScrollingHitObjectContainer() => new GlobalScrollingHitObjectContainer(direction);
|
|
||||||
|
|
||||||
private class TransformVisibleTimeRange : Transform<double, ScrollingPlayfield>
|
private class TransformVisibleTimeRange : Transform<double, ScrollingPlayfield>
|
||||||
{
|
{
|
||||||
|
@ -265,6 +265,7 @@
|
|||||||
<Compile Include="Beatmaps\Formats\JsonBeatmapDecoder.cs" />
|
<Compile Include="Beatmaps\Formats\JsonBeatmapDecoder.cs" />
|
||||||
<Compile Include="Beatmaps\Formats\LegacyDecoder.cs" />
|
<Compile Include="Beatmaps\Formats\LegacyDecoder.cs" />
|
||||||
<Compile Include="Beatmaps\Formats\LegacyStoryboardDecoder.cs" />
|
<Compile Include="Beatmaps\Formats\LegacyStoryboardDecoder.cs" />
|
||||||
|
<Compile Include="Configuration\ScrollingAlgorithmType.cs" />
|
||||||
<Compile Include="Database\DatabaseContextFactory.cs" />
|
<Compile Include="Database\DatabaseContextFactory.cs" />
|
||||||
<Compile Include="Database\IHasPrimaryKey.cs" />
|
<Compile Include="Database\IHasPrimaryKey.cs" />
|
||||||
<Compile Include="Graphics\Textures\LargeTextureStore.cs" />
|
<Compile Include="Graphics\Textures\LargeTextureStore.cs" />
|
||||||
@ -310,6 +311,7 @@
|
|||||||
<Compile Include="Overlays\Profile\Sections\Ranks\PaginatedScoreContainer.cs" />
|
<Compile Include="Overlays\Profile\Sections\Ranks\PaginatedScoreContainer.cs" />
|
||||||
<Compile Include="Overlays\Profile\Sections\Ranks\DrawableTotalScore.cs" />
|
<Compile Include="Overlays\Profile\Sections\Ranks\DrawableTotalScore.cs" />
|
||||||
<Compile Include="Overlays\Profile\Sections\Ranks\ScoreModsContainer.cs" />
|
<Compile Include="Overlays\Profile\Sections\Ranks\ScoreModsContainer.cs" />
|
||||||
|
<Compile Include="Overlays\Settings\Sections\Gameplay\ScrollingSettings.cs" />
|
||||||
<Compile Include="Overlays\Settings\Sections\Maintenance\DeleteAllBeatmapsDialog.cs" />
|
<Compile Include="Overlays\Settings\Sections\Maintenance\DeleteAllBeatmapsDialog.cs" />
|
||||||
<Compile Include="Rulesets\Mods\IApplicableFailOverride.cs" />
|
<Compile Include="Rulesets\Mods\IApplicableFailOverride.cs" />
|
||||||
<Compile Include="Rulesets\Mods\IApplicableMod.cs" />
|
<Compile Include="Rulesets\Mods\IApplicableMod.cs" />
|
||||||
@ -319,8 +321,6 @@
|
|||||||
<Compile Include="Rulesets\UI\Scrolling\Algorithms\GlobalScrollingAlgorithm.cs" />
|
<Compile Include="Rulesets\UI\Scrolling\Algorithms\GlobalScrollingAlgorithm.cs" />
|
||||||
<Compile Include="Rulesets\UI\Scrolling\Algorithms\IScrollingAlgorithm.cs" />
|
<Compile Include="Rulesets\UI\Scrolling\Algorithms\IScrollingAlgorithm.cs" />
|
||||||
<Compile Include="Rulesets\UI\Scrolling\Algorithms\LocalScrollingAlgorithm.cs" />
|
<Compile Include="Rulesets\UI\Scrolling\Algorithms\LocalScrollingAlgorithm.cs" />
|
||||||
<Compile Include="Rulesets\UI\Scrolling\GlobalScrollingHitObjectContainer.cs" />
|
|
||||||
<Compile Include="Rulesets\UI\Scrolling\LocalScrollingHitObjectContainer.cs" />
|
|
||||||
<Compile Include="Rulesets\UI\Scrolling\ScrollingDirection.cs" />
|
<Compile Include="Rulesets\UI\Scrolling\ScrollingDirection.cs" />
|
||||||
<Compile Include="Rulesets\UI\Scrolling\ScrollingHitObjectContainer.cs" />
|
<Compile Include="Rulesets\UI\Scrolling\ScrollingHitObjectContainer.cs" />
|
||||||
<Compile Include="Rulesets\UI\Scrolling\ScrollingPlayfield.cs" />
|
<Compile Include="Rulesets\UI\Scrolling\ScrollingPlayfield.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user