osu/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs

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

56 lines
1.9 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-06-11 05:36:19 +00:00
using System;
2018-06-11 05:36:19 +00:00
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Graphics.UserInterface;
2018-06-11 05:36:19 +00:00
using osu.Game.Overlays.Settings;
using osu.Game.Rulesets.Mania.Configuration;
using osu.Game.Rulesets.Mania.UI;
namespace osu.Game.Rulesets.Mania
{
public partial class ManiaSettingsSubsection : RulesetSettingsSubsection
{
protected override LocalisableString Header => "osu!mania";
2018-06-11 05:36:19 +00:00
public ManiaSettingsSubsection(ManiaRuleset ruleset)
: base(ruleset)
{
}
[BackgroundDependencyLoader]
2018-07-11 08:25:57 +00:00
private void load()
2018-06-11 05:36:19 +00:00
{
var config = (ManiaRulesetConfigManager)Config;
2018-06-11 05:36:19 +00:00
Children = new Drawable[]
{
new SettingsEnumDropdown<ManiaScrollingDirection>
{
LabelText = "Scrolling direction",
Current = config.GetBindable<ManiaScrollingDirection>(ManiaRulesetSetting.ScrollDirection)
},
new SettingsSlider<double, ManiaScrollSlider>
{
LabelText = "Scroll speed",
Current = config.GetBindable<double>(ManiaRulesetSetting.ScrollTime),
2020-09-15 06:24:01 +00:00
KeyboardStep = 5
},
new SettingsCheckbox
2021-04-24 08:23:52 +00:00
{
LabelText = "Timing-based note colouring",
Current = config.GetBindable<bool>(ManiaRulesetSetting.TimingBasedNoteColouring),
2021-04-24 08:23:52 +00:00
}
2018-06-11 05:36:19 +00:00
};
}
private partial class ManiaScrollSlider : OsuSliderBar<double>
{
2022-09-08 11:12:54 +00:00
public override LocalisableString TooltipText => $"{Current.Value}ms (speed {(int)Math.Round(DrawableManiaRuleset.MAX_TIME_RANGE / Current.Value)})";
}
2018-06-11 05:36:19 +00:00
}
}