diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 8a018f17d9..e604e91471 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -986,6 +986,31 @@ namespace osu.Game return false; } + public override bool OnPressed(KeyBindingPressEvent e) + { + switch (e.Action) + { + case PlatformAction.ZoomIn: + adjustUIScaling(1); + return true; + + case PlatformAction.ZoomOut: + adjustUIScaling(-1); + return true; + + case PlatformAction.ZoomDefault: + LocalConfig.GetBindable(OsuSetting.UIScale).SetDefault(); + return true; + } + + void adjustUIScaling(int amount) + { + LocalConfig.SetValue(OsuSetting.UIScale, LocalConfig.Get(OsuSetting.UIScale) + (0.05f * amount)); + } + + return base.OnPressed(e); + } + #region Inactive audio dimming private readonly BindableDouble inactiveVolumeFade = new BindableDouble();