1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

Add ability to change ui scaling via keyboard

This commit is contained in:
Joehu 2021-10-10 12:19:56 -07:00
parent b8fe744d2b
commit ce864011f2

View File

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