mirror of https://github.com/ppy/osu
Add test coverage for localisable setting source
This commit is contained in:
parent
45e9eda9e7
commit
784ce4d23d
|
@ -7,6 +7,7 @@
|
|||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Overlays.Settings;
|
||||
using osuTK;
|
||||
|
@ -39,6 +40,9 @@ private class TestTargetClass
|
|||
[SettingSource("Sample bool", "Clicking this changes a setting")]
|
||||
public BindableBool TickBindable { get; } = new BindableBool();
|
||||
|
||||
[SettingSource(typeof(TestStrings), nameof(TestStrings.LocalisableLabel), nameof(TestStrings.LocalisableDescription))]
|
||||
public BindableBool LocalisableBindable { get; } = new BindableBool(true);
|
||||
|
||||
[SettingSource("Sample float", "Change something for a mod")]
|
||||
public BindableFloat SliderBindable { get; } = new BindableFloat
|
||||
{
|
||||
|
@ -75,5 +79,11 @@ private enum TestEnum
|
|||
Value1,
|
||||
Value2
|
||||
}
|
||||
|
||||
private class TestStrings
|
||||
{
|
||||
public static LocalisableString LocalisableLabel => new LocalisableString("Sample localisable label");
|
||||
public static LocalisableString LocalisableDescription => new LocalisableString("Sample localisable description");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue