1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-21 20:02:54 +08:00
osu-lazer/osu.Game.Rulesets.Mania/Configuration/ManiaRulesetConfigManager.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.6 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2018-04-13 17:19:50 +08:00
2022-06-17 15:37:17 +08:00
#nullable disable
using System;
2018-01-18 16:00:41 +08:00
using osu.Framework.Configuration.Tracking;
using osu.Game.Configuration;
2018-01-17 19:10:35 +08:00
using osu.Game.Rulesets.Configuration;
2018-06-11 13:36:19 +08:00
using osu.Game.Rulesets.Mania.UI;
2018-04-13 17:19:50 +08:00
2018-01-17 19:10:35 +08:00
namespace osu.Game.Rulesets.Mania.Configuration
{
public class ManiaRulesetConfigManager : RulesetConfigManager<ManiaRulesetSetting>
2018-01-17 19:10:35 +08:00
{
public ManiaRulesetConfigManager(SettingsStore settings, RulesetInfo ruleset, int? variant = null)
: base(settings, ruleset, variant)
2018-01-17 19:10:35 +08:00
{
}
2018-04-13 17:19:50 +08:00
protected override void InitialiseDefaults()
{
base.InitialiseDefaults();
2018-04-13 17:19:50 +08:00
SetDefault(ManiaRulesetSetting.ScrollTime, 1500.0, DrawableManiaRuleset.MIN_TIME_RANGE, DrawableManiaRuleset.MAX_TIME_RANGE, 5);
SetDefault(ManiaRulesetSetting.ScrollDirection, ManiaScrollingDirection.Down);
SetDefault(ManiaRulesetSetting.TimingBasedNoteColouring, false);
}
2018-04-13 17:19:50 +08:00
2018-01-18 16:00:41 +08:00
public override TrackedSettings CreateTrackedSettings() => new TrackedSettings
{
2020-04-03 17:38:04 +08:00
new TrackedSetting<double>(ManiaRulesetSetting.ScrollTime,
2021-10-19 16:22:50 +08:00
scrollTime => new SettingDescription(
rawValue: scrollTime,
name: "Scroll Speed",
2021-10-19 16:22:50 +08:00
value: $"{(int)Math.Round(DrawableManiaRuleset.MAX_TIME_RANGE / scrollTime)} ({scrollTime}ms)"
)
)
2018-01-18 16:00:41 +08:00
};
2018-01-17 19:10:35 +08:00
}
2018-04-13 17:19:50 +08:00
public enum ManiaRulesetSetting
2018-01-17 19:10:35 +08:00
{
2018-06-11 13:36:19 +08:00
ScrollTime,
2021-04-24 16:23:52 +08:00
ScrollDirection,
TimingBasedNoteColouring
2018-01-17 19:10:35 +08:00
}
}