mirror of
https://github.com/ppy/osu.git
synced 2025-03-14 05:47:20 +08:00
Add ability to change ui scaling via keyboard
This commit is contained in:
parent
b8fe744d2b
commit
ce864011f2
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user