Skip to content

Commit

Permalink
Merge pull request ppy#22385 from peppy/touchscreen-settings-keyword
Browse files Browse the repository at this point in the history
Fix touch input handler settings not matching search for "touchscreen"
  • Loading branch information
bdach authored Jan 24, 2023
2 parents 054938b + fc55827 commit edb9c76
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
4 changes: 2 additions & 2 deletions osu.Game/OsuGameBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,8 @@ public virtual SettingsSubsection CreateSettingsSubsectionFor(InputHandler handl
case JoystickHandler jh:
return new JoystickSettings(jh);

case TouchHandler:
return new InputSection.HandlerSection(handler);
case TouchHandler th:
return new TouchSettings(th);
}
}

Expand Down
40 changes: 40 additions & 0 deletions osu.Game/Overlays/Settings/Sections/Input/TouchSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// 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 System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Input.Handlers.Touch;
using osu.Framework.Localisation;
using osu.Game.Localisation;

namespace osu.Game.Overlays.Settings.Sections.Input
{
public partial class TouchSettings : SettingsSubsection
{
private readonly TouchHandler handler;

public TouchSettings(TouchHandler handler)
{
this.handler = handler;
}

[BackgroundDependencyLoader]
private void load()
{
Children = new Drawable[]
{
new SettingsCheckbox
{
LabelText = CommonStrings.Enabled,
Current = handler.Enabled
},
};
}

public override IEnumerable<LocalisableString> FilterTerms => base.FilterTerms.Concat(new LocalisableString[] { @"touchscreen" });

protected override LocalisableString Header => handler.Description;
}
}

0 comments on commit edb9c76

Please sign in to comment.