1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 19:42:55 +08:00

Add OSD support

This commit is contained in:
Dean Herbert 2019-01-04 14:18:29 +09:00
parent 3953f829c8
commit 5a807f2143
2 changed files with 27 additions and 5 deletions

View File

@ -1,8 +1,10 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Configuration;
using osu.Framework.Configuration.Tracking;
using osu.Framework.Extensions;
using osu.Framework.Platform;
using osu.Game.Overlays;
using osu.Game.Rulesets.Scoring;
@ -106,14 +108,29 @@ namespace osu.Game.Configuration
Set(OsuSetting.ScalingPositionY, 0.5f, 0f, 1f);
}
public OsuConfigManager(Storage storage) : base(storage)
public OsuConfigManager(Storage storage)
: base(storage)
{
}
public override TrackedSettings CreateTrackedSettings() => new TrackedSettings
public override TrackedSettings CreateTrackedSettings()
{
new TrackedSetting<bool>(OsuSetting.MouseDisableButtons, v => new SettingDescription(!v, "gameplay mouse buttons", v ? "disabled" : "enabled"))
};
Func<SettingDescription> scalingDescription = () =>
{
var scalingMode = Get<ScalingMode>(OsuSetting.Scaling);
return new SettingDescription(scalingMode, "scaling", scalingMode.GetDescription());
};
return new TrackedSettings
{
new TrackedSetting<bool>(OsuSetting.MouseDisableButtons, v => new SettingDescription(!v, "gameplay mouse buttons", v ? "disabled" : "enabled")),
new TrackedSetting<ScalingMode>(OsuSetting.Scaling, _ => scalingDescription()),
new TrackedSetting<float>(OsuSetting.ScalingSizeX, _ => scalingDescription()),
new TrackedSetting<float>(OsuSetting.ScalingSizeY, _ => scalingDescription()),
new TrackedSetting<float>(OsuSetting.ScalingPositionX, _ => scalingDescription()),
new TrackedSetting<float>(OsuSetting.ScalingPositionY, _ => scalingDescription()),
};
}
}
public enum OsuSetting

View File

@ -1,11 +1,16 @@
// Copyright (c) 2007-2019 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.ComponentModel;
namespace osu.Game.Configuration
{
public enum ScalingMode
{
Off,
Everything,
[Description("Excluding overlays")]
ExcludeOverlays,
Gameplay,
}