mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:43:05 +08:00
Move default specification to configuration initial value
This commit is contained in:
parent
37509e04a9
commit
7530fe5adf
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Globalization;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Configuration.Tracking;
|
using osu.Framework.Configuration.Tracking;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
@ -102,7 +103,8 @@ namespace osu.Game.Configuration
|
|||||||
|
|
||||||
SetDefault(OsuSetting.MenuParallax, true);
|
SetDefault(OsuSetting.MenuParallax, true);
|
||||||
|
|
||||||
SetDefault(OsuSetting.Prefer24HourTime, false);
|
// See https://stackoverflow.com/a/63307411 for default sourcing.
|
||||||
|
SetDefault(OsuSetting.Prefer24HourTime, CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern.Contains(@"tt"));
|
||||||
|
|
||||||
// Gameplay
|
// Gameplay
|
||||||
SetDefault(OsuSetting.PositionalHitsounds, true); // replaced by level setting below, can be removed 20220703.
|
SetDefault(OsuSetting.PositionalHitsounds, true); // replaced by level setting below, can be removed 20220703.
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Globalization;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
@ -21,7 +20,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
public class ToolbarClock : OsuClickableContainer
|
public class ToolbarClock : OsuClickableContainer
|
||||||
{
|
{
|
||||||
private Bindable<ToolbarClockDisplayMode> clockDisplayMode;
|
private Bindable<ToolbarClockDisplayMode> clockDisplayMode;
|
||||||
private Bindable<bool> digitalPrefer24Hour;
|
private Bindable<bool> prefer24HourTime;
|
||||||
|
|
||||||
private Box hoverBackground;
|
private Box hoverBackground;
|
||||||
private Box flashBackground;
|
private Box flashBackground;
|
||||||
@ -40,7 +39,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
private void load(OsuConfigManager config)
|
private void load(OsuConfigManager config)
|
||||||
{
|
{
|
||||||
clockDisplayMode = config.GetBindable<ToolbarClockDisplayMode>(OsuSetting.ToolbarClockDisplayMode);
|
clockDisplayMode = config.GetBindable<ToolbarClockDisplayMode>(OsuSetting.ToolbarClockDisplayMode);
|
||||||
digitalPrefer24Hour = config.GetBindable<bool>(OsuSetting.Prefer24HourTime);
|
prefer24HourTime = config.GetBindable<bool>(OsuSetting.Prefer24HourTime);
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
@ -98,8 +97,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
analog.FadeTo(showAnalog ? 1 : 0);
|
analog.FadeTo(showAnalog ? 1 : 0);
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
digitalPrefer24Hour.BindValueChanged(prefer24H =>
|
prefer24HourTime.BindValueChanged(prefer24H => digital.Use24HourDisplay = !prefer24H.NewValue, true);
|
||||||
digital.Use24HourDisplay = !prefer24H.NewValue && CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern.Contains("tt"), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnClick(ClickEvent e)
|
protected override bool OnClick(ClickEvent e)
|
||||||
|
Loading…
Reference in New Issue
Block a user