mirror of
https://github.com/ppy/osu
synced 2025-03-30 23:26:53 +00:00
commit
fcd7c27bc2
@ -52,7 +52,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.1127.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.1127.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.1126.0" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.1130.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Transitive Dependencies">
|
<ItemGroup Label="Transitive Dependencies">
|
||||||
<!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. -->
|
<!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. -->
|
||||||
|
@ -62,7 +62,6 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
section.Children.Where(f => f.IsPresent)
|
section.Children.Where(f => f.IsPresent)
|
||||||
.OfType<ISettingsItem>()
|
.OfType<ISettingsItem>()
|
||||||
.OfType<IFilterable>()
|
.OfType<IFilterable>()
|
||||||
.Where(f => !(f is IHasFilterableChildren))
|
|
||||||
.All(f => f.FilterTerms.Any(t => t.ToString().Contains("scaling")))
|
.All(f => f.FilterTerms.Any(t => t.ToString().Contains("scaling")))
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -7,8 +7,6 @@ using Newtonsoft.Json;
|
|||||||
|
|
||||||
namespace osu.Game.Online.Rooms
|
namespace osu.Game.Online.Rooms
|
||||||
{
|
{
|
||||||
// TODO: Remove disable below after merging https://github.com/ppy/osu-framework/pull/5548 and applying follow-up changes game-side.
|
|
||||||
// ReSharper disable once PartialTypeWithSinglePart
|
|
||||||
public partial class APICreatedRoom : Room
|
public partial class APICreatedRoom : Room
|
||||||
{
|
{
|
||||||
[JsonProperty("error")]
|
[JsonProperty("error")]
|
||||||
|
@ -16,7 +16,7 @@ using osu.Game.Online.Rooms.RoomStatuses;
|
|||||||
namespace osu.Game.Online.Rooms
|
namespace osu.Game.Online.Rooms
|
||||||
{
|
{
|
||||||
[JsonObject(MemberSerialization.OptIn)]
|
[JsonObject(MemberSerialization.OptIn)]
|
||||||
public partial class Room
|
public partial class Room : IDependencyInjectionCandidate
|
||||||
{
|
{
|
||||||
[Cached]
|
[Cached]
|
||||||
[JsonProperty("id")]
|
[JsonProperty("id")]
|
||||||
|
@ -233,7 +233,7 @@ namespace osu.Game.Overlays.FirstRunSetup
|
|||||||
return parentDependencies.Get(type, info);
|
return parentDependencies.Get(type, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Inject<T>(T instance) where T : class
|
public void Inject<T>(T instance) where T : class, IDependencyInjectionCandidate
|
||||||
{
|
{
|
||||||
parentDependencies.Inject(instance);
|
parentDependencies.Inject(instance);
|
||||||
}
|
}
|
||||||
|
@ -177,13 +177,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
updateScreenModeWarning();
|
updateScreenModeWarning();
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
windowModes.BindCollectionChanged((_, _) =>
|
windowModes.BindCollectionChanged((_, _) => updateDisplaySettingsVisibility());
|
||||||
{
|
|
||||||
if (windowModes.Count > 1)
|
|
||||||
windowModeDropdown.Show();
|
|
||||||
else
|
|
||||||
windowModeDropdown.Hide();
|
|
||||||
}, true);
|
|
||||||
|
|
||||||
currentDisplay.BindValueChanged(display => Schedule(() =>
|
currentDisplay.BindValueChanged(display => Schedule(() =>
|
||||||
{
|
{
|
||||||
@ -219,7 +213,11 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
scalingSettings.ResizeHeightTo(0, transition_duration, Easing.OutQuint);
|
scalingSettings.ResizeHeightTo(0, transition_duration, Easing.OutQuint);
|
||||||
|
|
||||||
scalingSettings.AutoSizeAxes = scalingMode.Value != ScalingMode.Off ? Axes.Y : Axes.None;
|
scalingSettings.AutoSizeAxes = scalingMode.Value != ScalingMode.Off ? Axes.Y : Axes.None;
|
||||||
scalingSettings.ForEach(s => s.TransferValueOnCommit = scalingMode.Value == ScalingMode.Everything);
|
scalingSettings.ForEach(s =>
|
||||||
|
{
|
||||||
|
s.TransferValueOnCommit = scalingMode.Value == ScalingMode.Everything;
|
||||||
|
s.CanBeShown.Value = scalingMode.Value != ScalingMode.Off;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,20 +232,10 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
|
|
||||||
private void updateDisplaySettingsVisibility()
|
private void updateDisplaySettingsVisibility()
|
||||||
{
|
{
|
||||||
if (resolutions.Count > 1 && windowModeDropdown.Current.Value == WindowMode.Fullscreen)
|
windowModeDropdown.CanBeShown.Value = windowModes.Count > 1;
|
||||||
resolutionDropdown.Show();
|
resolutionDropdown.CanBeShown.Value = resolutions.Count > 1 && windowModeDropdown.Current.Value == WindowMode.Fullscreen;
|
||||||
else
|
displayDropdown.CanBeShown.Value = displayDropdown.Items.Count() > 1;
|
||||||
resolutionDropdown.Hide();
|
safeAreaConsiderationsCheckbox.CanBeShown.Value = host.Window?.SafeAreaPadding.Value.Total != Vector2.Zero;
|
||||||
|
|
||||||
if (displayDropdown.Items.Count() > 1)
|
|
||||||
displayDropdown.Show();
|
|
||||||
else
|
|
||||||
displayDropdown.Hide();
|
|
||||||
|
|
||||||
if (host.Window?.SafeAreaPadding.Value.Total != Vector2.Zero)
|
|
||||||
safeAreaConsiderationsCheckbox.Show();
|
|
||||||
else
|
|
||||||
safeAreaConsiderationsCheckbox.Hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateScreenModeWarning()
|
private void updateScreenModeWarning()
|
||||||
|
@ -143,6 +143,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
areaOffset.SetDefault();
|
areaOffset.SetDefault();
|
||||||
areaSize.SetDefault();
|
areaSize.SetDefault();
|
||||||
},
|
},
|
||||||
|
CanBeShown = { BindTarget = enabled }
|
||||||
},
|
},
|
||||||
new SettingsButton
|
new SettingsButton
|
||||||
{
|
{
|
||||||
@ -150,25 +151,29 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
Action = () =>
|
Action = () =>
|
||||||
{
|
{
|
||||||
forceAspectRatio((float)host.Window.ClientSize.Width / host.Window.ClientSize.Height);
|
forceAspectRatio((float)host.Window.ClientSize.Width / host.Window.ClientSize.Height);
|
||||||
}
|
},
|
||||||
|
CanBeShown = { BindTarget = enabled }
|
||||||
},
|
},
|
||||||
new SettingsSlider<float>
|
new SettingsSlider<float>
|
||||||
{
|
{
|
||||||
TransferValueOnCommit = true,
|
TransferValueOnCommit = true,
|
||||||
LabelText = TabletSettingsStrings.XOffset,
|
LabelText = TabletSettingsStrings.XOffset,
|
||||||
Current = offsetX
|
Current = offsetX,
|
||||||
|
CanBeShown = { BindTarget = enabled }
|
||||||
},
|
},
|
||||||
new SettingsSlider<float>
|
new SettingsSlider<float>
|
||||||
{
|
{
|
||||||
TransferValueOnCommit = true,
|
TransferValueOnCommit = true,
|
||||||
LabelText = TabletSettingsStrings.YOffset,
|
LabelText = TabletSettingsStrings.YOffset,
|
||||||
Current = offsetY
|
Current = offsetY,
|
||||||
|
CanBeShown = { BindTarget = enabled }
|
||||||
},
|
},
|
||||||
new SettingsSlider<float>
|
new SettingsSlider<float>
|
||||||
{
|
{
|
||||||
TransferValueOnCommit = true,
|
TransferValueOnCommit = true,
|
||||||
LabelText = TabletSettingsStrings.Rotation,
|
LabelText = TabletSettingsStrings.Rotation,
|
||||||
Current = rotation
|
Current = rotation,
|
||||||
|
CanBeShown = { BindTarget = enabled }
|
||||||
},
|
},
|
||||||
new RotationPresetButtons(tabletHandler)
|
new RotationPresetButtons(tabletHandler)
|
||||||
{
|
{
|
||||||
@ -181,24 +186,28 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
{
|
{
|
||||||
TransferValueOnCommit = true,
|
TransferValueOnCommit = true,
|
||||||
LabelText = TabletSettingsStrings.AspectRatio,
|
LabelText = TabletSettingsStrings.AspectRatio,
|
||||||
Current = aspectRatio
|
Current = aspectRatio,
|
||||||
|
CanBeShown = { BindTarget = enabled }
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = TabletSettingsStrings.LockAspectRatio,
|
LabelText = TabletSettingsStrings.LockAspectRatio,
|
||||||
Current = aspectLock
|
Current = aspectLock,
|
||||||
|
CanBeShown = { BindTarget = enabled }
|
||||||
},
|
},
|
||||||
new SettingsSlider<float>
|
new SettingsSlider<float>
|
||||||
{
|
{
|
||||||
TransferValueOnCommit = true,
|
TransferValueOnCommit = true,
|
||||||
LabelText = CommonStrings.Width,
|
LabelText = CommonStrings.Width,
|
||||||
Current = sizeX
|
Current = sizeX,
|
||||||
|
CanBeShown = { BindTarget = enabled }
|
||||||
},
|
},
|
||||||
new SettingsSlider<float>
|
new SettingsSlider<float>
|
||||||
{
|
{
|
||||||
TransferValueOnCommit = true,
|
TransferValueOnCommit = true,
|
||||||
LabelText = CommonStrings.Height,
|
LabelText = CommonStrings.Height,
|
||||||
Current = sizeY
|
Current = sizeY,
|
||||||
|
CanBeShown = { BindTarget = enabled }
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -3,14 +3,16 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Cursor;
|
using osu.Framework.Graphics.Cursor;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics.UserInterfaceV2;
|
using osu.Game.Graphics.UserInterfaceV2;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Settings
|
namespace osu.Game.Overlays.Settings
|
||||||
{
|
{
|
||||||
public partial class SettingsButton : RoundedButton, IHasTooltip
|
public partial class SettingsButton : RoundedButton, IHasTooltip, IConditionalFilterable
|
||||||
{
|
{
|
||||||
public SettingsButton()
|
public SettingsButton()
|
||||||
{
|
{
|
||||||
@ -20,6 +22,9 @@ namespace osu.Game.Overlays.Settings
|
|||||||
|
|
||||||
public LocalisableString TooltipText { get; set; }
|
public LocalisableString TooltipText { get; set; }
|
||||||
|
|
||||||
|
public BindableBool CanBeShown { get; } = new BindableBool(true);
|
||||||
|
IBindable<bool> IConditionalFilterable.CanBeShown => CanBeShown;
|
||||||
|
|
||||||
public override IEnumerable<LocalisableString> FilterTerms
|
public override IEnumerable<LocalisableString> FilterTerms
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -22,7 +22,7 @@ using osuTK;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays.Settings
|
namespace osu.Game.Overlays.Settings
|
||||||
{
|
{
|
||||||
public abstract partial class SettingsItem<T> : Container, IFilterable, ISettingsItem, IHasCurrentValue<T>, IHasTooltip
|
public abstract partial class SettingsItem<T> : Container, IConditionalFilterable, ISettingsItem, IHasCurrentValue<T>, IHasTooltip
|
||||||
{
|
{
|
||||||
protected abstract Drawable CreateControl();
|
protected abstract Drawable CreateControl();
|
||||||
|
|
||||||
@ -144,6 +144,9 @@ namespace osu.Game.Overlays.Settings
|
|||||||
|
|
||||||
public bool FilteringActive { get; set; }
|
public bool FilteringActive { get; set; }
|
||||||
|
|
||||||
|
public BindableBool CanBeShown { get; } = new BindableBool(true);
|
||||||
|
IBindable<bool> IConditionalFilterable.CanBeShown => CanBeShown;
|
||||||
|
|
||||||
public event Action SettingChanged;
|
public event Action SettingChanged;
|
||||||
|
|
||||||
private T classicDefault;
|
private T classicDefault;
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -19,7 +18,7 @@ using osuTK;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays.Settings
|
namespace osu.Game.Overlays.Settings
|
||||||
{
|
{
|
||||||
public abstract partial class SettingsSection : Container, IHasFilterableChildren
|
public abstract partial class SettingsSection : Container, IFilterable
|
||||||
{
|
{
|
||||||
protected FillFlowContainer FlowContent;
|
protected FillFlowContainer FlowContent;
|
||||||
protected override Container<Drawable> Content => FlowContent;
|
protected override Container<Drawable> Content => FlowContent;
|
||||||
@ -33,7 +32,6 @@ namespace osu.Game.Overlays.Settings
|
|||||||
public abstract Drawable CreateIcon();
|
public abstract Drawable CreateIcon();
|
||||||
public abstract LocalisableString Header { get; }
|
public abstract LocalisableString Header { get; }
|
||||||
|
|
||||||
public IEnumerable<IFilterable> FilterableChildren => Children.OfType<IFilterable>();
|
|
||||||
public virtual IEnumerable<LocalisableString> FilterTerms => new[] { Header };
|
public virtual IEnumerable<LocalisableString> FilterTerms => new[] { Header };
|
||||||
|
|
||||||
public const int ITEM_SPACING = 14;
|
public const int ITEM_SPACING = 14;
|
||||||
|
@ -8,7 +8,6 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
@ -17,7 +16,7 @@ using osu.Game.Graphics;
|
|||||||
namespace osu.Game.Overlays.Settings
|
namespace osu.Game.Overlays.Settings
|
||||||
{
|
{
|
||||||
[ExcludeFromDynamicCompile]
|
[ExcludeFromDynamicCompile]
|
||||||
public abstract partial class SettingsSubsection : FillFlowContainer, IHasFilterableChildren
|
public abstract partial class SettingsSubsection : FillFlowContainer, IFilterable
|
||||||
{
|
{
|
||||||
protected override Container<Drawable> Content => FlowContent;
|
protected override Container<Drawable> Content => FlowContent;
|
||||||
|
|
||||||
@ -25,8 +24,6 @@ namespace osu.Game.Overlays.Settings
|
|||||||
|
|
||||||
protected abstract LocalisableString Header { get; }
|
protected abstract LocalisableString Header { get; }
|
||||||
|
|
||||||
public IEnumerable<IFilterable> FilterableChildren => Children.OfType<IFilterable>();
|
|
||||||
|
|
||||||
public virtual IEnumerable<LocalisableString> FilterTerms => new[] { Header };
|
public virtual IEnumerable<LocalisableString> FilterTerms => new[] { Header };
|
||||||
|
|
||||||
public bool MatchingFilter
|
public bool MatchingFilter
|
||||||
|
@ -164,7 +164,7 @@ namespace osu.Game.Tests.Beatmaps
|
|||||||
return fallback.Get(type, info);
|
return fallback.Get(type, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Inject<T>(T instance) where T : class
|
public void Inject<T>(T instance) where T : class, IDependencyInjectionCandidate
|
||||||
{
|
{
|
||||||
// Never used directly
|
// Never used directly
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ namespace osu.Game.Tests.Visual.OnlinePlay
|
|||||||
=> OnlinePlayDependencies?.Get(type, info) ?? parent.Get(type, info);
|
=> OnlinePlayDependencies?.Get(type, info) ?? parent.Get(type, info);
|
||||||
|
|
||||||
public void Inject<T>(T instance)
|
public void Inject<T>(T instance)
|
||||||
where T : class
|
where T : class, IDependencyInjectionCandidate
|
||||||
=> injectableDependencies.Inject(instance);
|
=> injectableDependencies.Inject(instance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ namespace osu.Game.Tests.Visual.OnlinePlay
|
|||||||
=> dependencies.Get(type, info);
|
=> dependencies.Get(type, info);
|
||||||
|
|
||||||
public void Inject<T>(T instance)
|
public void Inject<T>(T instance)
|
||||||
where T : class
|
where T : class, IDependencyInjectionCandidate
|
||||||
=> dependencies.Inject(instance);
|
=> dependencies.Inject(instance);
|
||||||
|
|
||||||
protected void Cache(object instance)
|
protected void Cache(object instance)
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Realm" Version="10.18.0" />
|
<PackageReference Include="Realm" Version="10.18.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2022.1126.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2022.1130.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.1127.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.1127.0" />
|
||||||
<PackageReference Include="Sentry" Version="3.23.1" />
|
<PackageReference Include="Sentry" Version="3.23.1" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.32.2" />
|
<PackageReference Include="SharpCompress" Version="0.32.2" />
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.1127.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.1127.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.1126.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.1130.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net6.0) -->
|
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net6.0) -->
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
@ -82,7 +82,7 @@
|
|||||||
<PackageReference Include="DiffPlex" Version="1.7.1" />
|
<PackageReference Include="DiffPlex" Version="1.7.1" />
|
||||||
<PackageReference Include="Humanizer" Version="2.14.1" />
|
<PackageReference Include="Humanizer" Version="2.14.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2022.1126.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2022.1130.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.32.2" />
|
<PackageReference Include="SharpCompress" Version="0.32.2" />
|
||||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||||
|
Loading…
Reference in New Issue
Block a user