mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Merge branch 'master' into localisation-proof-of-concept
This commit is contained in:
@ -141,7 +141,14 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
|
||||
scalingSettings.ForEach(s => bindPreviewEvent(s.Current));
|
||||
|
||||
windowModeDropdown.Current.ValueChanged += _ => updateResolutionDropdown();
|
||||
windowModeDropdown.Current.BindValueChanged(mode =>
|
||||
{
|
||||
updateResolutionDropdown();
|
||||
|
||||
const string not_fullscreen_note = "Running without fullscreen mode will increase your input latency!";
|
||||
|
||||
windowModeDropdown.WarningText = mode.NewValue != WindowMode.Fullscreen ? not_fullscreen_note : string.Empty;
|
||||
}, true);
|
||||
|
||||
windowModes.BindCollectionChanged((sender, args) =>
|
||||
{
|
||||
|
@ -13,6 +13,8 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
{
|
||||
protected override string Header => "Renderer";
|
||||
|
||||
private SettingsEnumDropdown<FrameSync> frameLimiterDropdown;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(FrameworkConfigManager config, OsuConfigManager osuConfig)
|
||||
{
|
||||
@ -20,7 +22,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
Children = new Drawable[]
|
||||
{
|
||||
// TODO: this needs to be a custom dropdown at some point
|
||||
new SettingsEnumDropdown<FrameSync>
|
||||
frameLimiterDropdown = new SettingsEnumDropdown<FrameSync>
|
||||
{
|
||||
LabelText = "Frame limiter",
|
||||
Current = config.GetBindable<FrameSync>(FrameworkSetting.FrameSync)
|
||||
@ -37,5 +39,17 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
frameLimiterDropdown.Current.BindValueChanged(limit =>
|
||||
{
|
||||
const string unlimited_frames_note = "Using unlimited frame limiter can lead to stutters, bad performance and overheating. It will not improve perceived latency. \"2x refresh rate\" is recommended.";
|
||||
|
||||
frameLimiterDropdown.WarningText = limit.NewValue == FrameSync.Unlimited ? unlimited_frames_note : string.Empty;
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -129,9 +129,10 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
||||
rotation.BindTo(handler.Rotation);
|
||||
rotation.BindValueChanged(val =>
|
||||
{
|
||||
tabletContainer.RotateTo(-val.NewValue, 800, Easing.OutQuint);
|
||||
usableAreaContainer.RotateTo(val.NewValue, 100, Easing.OutQuint)
|
||||
.OnComplete(_ => checkBounds()); // required as we are using SSDQ.
|
||||
});
|
||||
}, true);
|
||||
|
||||
tablet.BindTo(handler.Tablet);
|
||||
tablet.BindValueChanged(_ => Scheduler.AddOnce(updateTabletDetails));
|
||||
@ -183,8 +184,10 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
||||
if (!(tablet.Value?.Size is Vector2 size))
|
||||
return;
|
||||
|
||||
float fitX = size.X / (DrawWidth - Padding.Left - Padding.Right);
|
||||
float fitY = size.Y / DrawHeight;
|
||||
float maxDimension = size.LengthFast;
|
||||
|
||||
float fitX = maxDimension / (DrawWidth - Padding.Left - Padding.Right);
|
||||
float fitY = maxDimension / DrawHeight;
|
||||
|
||||
float adjust = MathF.Max(fitX, fitY);
|
||||
|
||||
|
@ -2,8 +2,11 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Overlays.Settings.Sections.UserInterface
|
||||
{
|
||||
@ -11,9 +14,15 @@ namespace osu.Game.Overlays.Settings.Sections.UserInterface
|
||||
{
|
||||
protected override string Header => "Main Menu";
|
||||
|
||||
private IBindable<User> user;
|
||||
|
||||
private SettingsEnumDropdown<BackgroundSource> backgroundSourceDropdown;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config)
|
||||
private void load(OsuConfigManager config, IAPIProvider api)
|
||||
{
|
||||
user = api.LocalUser.GetBoundCopy();
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new SettingsCheckbox
|
||||
@ -31,7 +40,7 @@ namespace osu.Game.Overlays.Settings.Sections.UserInterface
|
||||
LabelText = "Intro sequence",
|
||||
Current = config.GetBindable<IntroSequence>(OsuSetting.IntroSequence),
|
||||
},
|
||||
new SettingsEnumDropdown<BackgroundSource>
|
||||
backgroundSourceDropdown = new SettingsEnumDropdown<BackgroundSource>
|
||||
{
|
||||
LabelText = "Background source",
|
||||
Current = config.GetBindable<BackgroundSource>(OsuSetting.MenuBackgroundSource),
|
||||
@ -43,5 +52,17 @@ namespace osu.Game.Overlays.Settings.Sections.UserInterface
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
user.BindValueChanged(u =>
|
||||
{
|
||||
const string not_supporter_note = "Changes to this setting will only apply with an active osu!supporter tag.";
|
||||
|
||||
backgroundSourceDropdown.WarningText = u.NewValue?.IsSupporter != true ? not_supporter_note : string.Empty;
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user