1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-18 11:53:00 +08:00
osu-lazer/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs

57 lines
2.0 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 13:36:19 +08:00
using System;
2018-06-11 13:36:19 +08:00
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Graphics.UserInterface;
2023-01-16 04:30:11 +08:00
using osu.Game.Localisation;
2018-06-11 13:36:19 +08:00
using osu.Game.Overlays.Settings;
using osu.Game.Rulesets.Mania.Configuration;
using osu.Game.Rulesets.Mania.UI;
namespace osu.Game.Rulesets.Mania
{
2022-11-24 13:32:20 +08:00
public partial class ManiaSettingsSubsection : RulesetSettingsSubsection
2018-06-11 13:36:19 +08:00
{
protected override LocalisableString Header => "osu!mania";
2018-06-11 13:36:19 +08:00
public ManiaSettingsSubsection(ManiaRuleset ruleset)
: base(ruleset)
{
}
[BackgroundDependencyLoader]
2018-07-11 16:25:57 +08:00
private void load()
2018-06-11 13:36:19 +08:00
{
var config = (ManiaRulesetConfigManager)Config;
2018-06-11 13:36:19 +08:00
Children = new Drawable[]
{
new SettingsEnumDropdown<ManiaScrollingDirection>
{
2023-01-16 04:30:11 +08:00
LabelText = RulesetSettingsStrings.ScrollingDirection,
Current = config.GetBindable<ManiaScrollingDirection>(ManiaRulesetSetting.ScrollDirection)
},
new SettingsSlider<double, ManiaScrollSlider>
{
2023-01-16 04:30:11 +08:00
LabelText = RulesetSettingsStrings.ScrollSpeed,
Current = config.GetBindable<double>(ManiaRulesetSetting.ScrollTime),
2020-09-15 14:24:01 +08:00
KeyboardStep = 5
},
new SettingsCheckbox
2021-04-24 16:23:52 +08:00
{
2023-01-16 04:30:11 +08:00
LabelText = RulesetSettingsStrings.TimingBasedColouring,
Current = config.GetBindable<bool>(ManiaRulesetSetting.TimingBasedNoteColouring),
2021-04-24 16:23:52 +08:00
}
2018-06-11 13:36:19 +08:00
};
}
2022-11-24 13:32:20 +08:00
private partial class ManiaScrollSlider : OsuSliderBar<double>
{
2023-01-16 04:30:11 +08:00
public override LocalisableString TooltipText => RulesetSettingsStrings.ScrollSpeedTooltip(Current.Value, (int)Math.Round(DrawableManiaRuleset.MAX_TIME_RANGE / Current.Value));
}
2018-06-11 13:36:19 +08:00
}
}