1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 06:47:24 +08:00

Expose more pieces of TabletSettings

This commit is contained in:
Dean Herbert 2021-09-04 15:35:46 +09:00
parent cdd0262ca1
commit 16beb2c90c
2 changed files with 8 additions and 4 deletions

View File

@ -17,6 +17,8 @@ namespace osu.Game.Overlays.Settings.Sections.Input
{
public class TabletAreaSelection : CompositeDrawable
{
public bool IsWithinBounds { get; private set; }
private readonly ITabletHandler handler;
private Container tabletContainer;
@ -171,10 +173,10 @@ namespace osu.Game.Overlays.Settings.Sections.Input
var usableSsdq = usableAreaContainer.ScreenSpaceDrawQuad;
bool isWithinBounds = tabletContainer.ScreenSpaceDrawQuad.Contains(usableSsdq.TopLeft + new Vector2(1)) &&
tabletContainer.ScreenSpaceDrawQuad.Contains(usableSsdq.BottomRight - new Vector2(1));
IsWithinBounds = tabletContainer.ScreenSpaceDrawQuad.Contains(usableSsdq.TopLeft + new Vector2(1)) &&
tabletContainer.ScreenSpaceDrawQuad.Contains(usableSsdq.BottomRight - new Vector2(1));
usableFill.FadeColour(isWithinBounds ? colour.Blue : colour.RedLight, 100);
usableFill.FadeColour(IsWithinBounds ? colour.Blue : colour.RedLight, 100);
}
protected override void Update()

View File

@ -20,6 +20,8 @@ namespace osu.Game.Overlays.Settings.Sections.Input
{
public class TabletSettings : SettingsSubsection
{
public TabletAreaSelection AreaSelection { get; private set; }
private readonly ITabletHandler tabletHandler;
private readonly Bindable<bool> enabled = new BindableBool(true);
@ -121,7 +123,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
new TabletAreaSelection(tabletHandler)
AreaSelection = new TabletAreaSelection(tabletHandler)
{
RelativeSizeAxes = Axes.X,
Height = 300,