mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 23:12:56 +08:00
Merge branch 'master' into patch-2
This commit is contained in:
commit
d86b1c724a
@ -105,6 +105,8 @@ namespace osu.Game.Configuration
|
|||||||
|
|
||||||
Set(OsuSetting.ScalingPositionX, 0.5f, 0f, 1f);
|
Set(OsuSetting.ScalingPositionX, 0.5f, 0f, 1f);
|
||||||
Set(OsuSetting.ScalingPositionY, 0.5f, 0f, 1f);
|
Set(OsuSetting.ScalingPositionY, 0.5f, 0f, 1f);
|
||||||
|
|
||||||
|
Set(OsuSetting.UIScale, 1f, 0.8f, 1.6f, 0.01f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OsuConfigManager(Storage storage)
|
public OsuConfigManager(Storage storage)
|
||||||
@ -167,6 +169,7 @@ namespace osu.Game.Configuration
|
|||||||
ScalingPositionX,
|
ScalingPositionX,
|
||||||
ScalingPositionY,
|
ScalingPositionY,
|
||||||
ScalingSizeX,
|
ScalingSizeX,
|
||||||
ScalingSizeY
|
ScalingSizeY,
|
||||||
|
UIScale
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,10 +46,37 @@ namespace osu.Game.Graphics.Containers
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
RelativePositionAxes = Axes.Both,
|
RelativePositionAxes = Axes.Both,
|
||||||
CornerRadius = 10,
|
CornerRadius = 10,
|
||||||
Child = content = new DrawSizePreservingFillContainer()
|
Child = content = new ScalingDrawSizePreservingFillContainer(targetMode != ScalingMode.Gameplay)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class ScalingDrawSizePreservingFillContainer : DrawSizePreservingFillContainer
|
||||||
|
{
|
||||||
|
private readonly bool applyUIScale;
|
||||||
|
private Bindable<float> uiScale;
|
||||||
|
|
||||||
|
public ScalingDrawSizePreservingFillContainer(bool applyUIScale)
|
||||||
|
{
|
||||||
|
this.applyUIScale = applyUIScale;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuConfigManager osuConfig)
|
||||||
|
{
|
||||||
|
if (applyUIScale)
|
||||||
|
{
|
||||||
|
uiScale = osuConfig.GetBindable<float>(OsuSetting.UIScale);
|
||||||
|
uiScale.BindValueChanged(scaleChanged, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void scaleChanged(float value)
|
||||||
|
{
|
||||||
|
this.ScaleTo(new Vector2(value), 500, Easing.Out);
|
||||||
|
this.ResizeTo(new Vector2(1 / value), 500, Easing.Out);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuConfigManager config)
|
private void load(OsuConfigManager config)
|
||||||
{
|
{
|
||||||
|
@ -101,6 +101,9 @@ namespace osu.Game.Online.API
|
|||||||
//todo: replace this with a ping request.
|
//todo: replace this with a ping request.
|
||||||
log.Add(@"In a failing state, waiting a bit before we try again...");
|
log.Add(@"In a failing state, waiting a bit before we try again...");
|
||||||
Thread.Sleep(5000);
|
Thread.Sleep(5000);
|
||||||
|
|
||||||
|
if (!IsLoggedIn) goto case APIState.Connecting;
|
||||||
|
|
||||||
if (queue.Count == 0)
|
if (queue.Count == 0)
|
||||||
{
|
{
|
||||||
log.Add(@"Queueing a ping request");
|
log.Add(@"Queueing a ping request");
|
||||||
|
@ -359,7 +359,10 @@ namespace osu.Game
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
},
|
},
|
||||||
mainContent = new DrawSizePreservingFillContainer(),
|
mainContent = new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
},
|
||||||
overlayContent = new Container { RelativeSizeAxes = Axes.Both, Depth = float.MinValue },
|
overlayContent = new Container { RelativeSizeAxes = Axes.Both, Depth = float.MinValue },
|
||||||
idleTracker = new IdleTracker(6000)
|
idleTracker = new IdleTracker(6000)
|
||||||
});
|
});
|
||||||
|
@ -63,9 +63,16 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y
|
AutoSizeAxes = Axes.Y
|
||||||
},
|
},
|
||||||
|
new SettingsSlider<float, UIScaleSlider>
|
||||||
|
{
|
||||||
|
LabelText = "UI Scaling",
|
||||||
|
TransferValueOnCommit = true,
|
||||||
|
Bindable = osuConfig.GetBindable<float>(OsuSetting.UIScale),
|
||||||
|
KeyboardStep = 0.01f
|
||||||
|
},
|
||||||
new SettingsEnumDropdown<ScalingMode>
|
new SettingsEnumDropdown<ScalingMode>
|
||||||
{
|
{
|
||||||
LabelText = "Scaling",
|
LabelText = "Screen Scaling",
|
||||||
Bindable = osuConfig.GetBindable<ScalingMode>(OsuSetting.Scaling),
|
Bindable = osuConfig.GetBindable<ScalingMode>(OsuSetting.Scaling),
|
||||||
},
|
},
|
||||||
scalingSettings = new FillFlowContainer<SettingsSlider<float>>
|
scalingSettings = new FillFlowContainer<SettingsSlider<float>>
|
||||||
@ -202,6 +209,11 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class UIScaleSlider : OsuSliderBar<float>
|
||||||
|
{
|
||||||
|
public override string TooltipText => base.TooltipText + "x";
|
||||||
|
}
|
||||||
|
|
||||||
private class ResolutionSettingsDropdown : SettingsDropdown<Size>
|
private class ResolutionSettingsDropdown : SettingsDropdown<Size>
|
||||||
{
|
{
|
||||||
protected override OsuDropdown<Size> CreateDropdown() => new ResolutionDropdownControl { Items = Items };
|
protected override OsuDropdown<Size> CreateDropdown() => new ResolutionDropdownControl { Items = Items };
|
||||||
|
Loading…
Reference in New Issue
Block a user