mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 14:42:56 +08:00
Merge pull request #14268 from frenzibyte/open-tablet-driver-faq
Notify users to read OpenTabletDriver's FAQ when tablet not detected
This commit is contained in:
commit
6dfab4d431
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -9,9 +10,11 @@ using osu.Framework.Input.Handlers.Tablet;
|
|||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osu.Game.Localisation;
|
using osu.Game.Localisation;
|
||||||
|
using osu.Game.Online.Chat;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Settings.Sections.Input
|
namespace osu.Game.Overlays.Settings.Sections.Input
|
||||||
{
|
{
|
||||||
@ -52,7 +55,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
|
|
||||||
private FillFlowContainer mainSettings;
|
private FillFlowContainer mainSettings;
|
||||||
|
|
||||||
private OsuSpriteText noTabletMessage;
|
private FillFlowContainer noTabletMessage;
|
||||||
|
|
||||||
protected override LocalisableString Header => TabletSettingsStrings.Tablet;
|
protected override LocalisableString Header => TabletSettingsStrings.Tablet;
|
||||||
|
|
||||||
@ -62,7 +65,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
@ -73,12 +76,39 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Current = tabletHandler.Enabled
|
Current = tabletHandler.Enabled
|
||||||
},
|
},
|
||||||
noTabletMessage = new OsuSpriteText
|
noTabletMessage = new FillFlowContainer
|
||||||
{
|
{
|
||||||
Text = TabletSettingsStrings.NoTabletDetected,
|
RelativeSizeAxes = Axes.X,
|
||||||
Anchor = Anchor.TopCentre,
|
AutoSizeAxes = Axes.Y,
|
||||||
Origin = Anchor.TopCentre,
|
Direction = FillDirection.Vertical,
|
||||||
Padding = new MarginPadding { Horizontal = SettingsPanel.CONTENT_MARGINS }
|
Padding = new MarginPadding { Horizontal = SettingsPanel.CONTENT_MARGINS },
|
||||||
|
Spacing = new Vector2(5f),
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Text = TabletSettingsStrings.NoTabletDetected,
|
||||||
|
},
|
||||||
|
new SettingsNoticeText(colours)
|
||||||
|
{
|
||||||
|
TextAnchor = Anchor.TopCentre,
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
}.With(t =>
|
||||||
|
{
|
||||||
|
if (RuntimeInfo.OS == RuntimeInfo.Platform.Windows || RuntimeInfo.OS == RuntimeInfo.Platform.Linux)
|
||||||
|
{
|
||||||
|
t.NewLine();
|
||||||
|
t.AddText("If your tablet is not detected, please read ");
|
||||||
|
t.AddLink("this FAQ", LinkAction.External, RuntimeInfo.OS == RuntimeInfo.Platform.Windows
|
||||||
|
? @"https://github.com/OpenTabletDriver/OpenTabletDriver/wiki/Windows-FAQ"
|
||||||
|
: @"https://github.com/OpenTabletDriver/OpenTabletDriver/wiki/Linux-FAQ");
|
||||||
|
t.AddText(" for troubleshooting steps.");
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mainSettings = new FillFlowContainer
|
mainSettings = new FillFlowContainer
|
||||||
{
|
{
|
||||||
|
@ -73,13 +73,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// construct lazily for cases where the label is not needed (may be provided by the Control).
|
// construct lazily for cases where the label is not needed (may be provided by the Control).
|
||||||
FlowContent.Add(warningText = new OsuTextFlowContainer
|
FlowContent.Add(warningText = new SettingsNoticeText(colours) { Margin = new MarginPadding { Bottom = 5 } });
|
||||||
{
|
|
||||||
Colour = colours.Yellow,
|
|
||||||
Margin = new MarginPadding { Bottom = 5 },
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
warningText.Alpha = hasValue ? 0 : 1;
|
warningText.Alpha = hasValue ? 0 : 1;
|
||||||
|
19
osu.Game/Overlays/Settings/SettingsNoticeText.cs
Normal file
19
osu.Game/Overlays/Settings/SettingsNoticeText.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays.Settings
|
||||||
|
{
|
||||||
|
public class SettingsNoticeText : LinkFlowContainer
|
||||||
|
{
|
||||||
|
public SettingsNoticeText(OsuColour colours)
|
||||||
|
: base(s => s.Colour = colours.Yellow)
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
AutoSizeAxes = Axes.Y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user