mirror of
https://github.com/osukey/osukey.git
synced 2025-05-09 23:57:18 +09:00
Apply changes to UI components overriding functions with changing signatures
This commit is contained in:
parent
c99e152fe4
commit
1fd76ea3fb
@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
|
|||||||
|
|
||||||
public string Text
|
public string Text
|
||||||
{
|
{
|
||||||
get => number.Text;
|
get => number.Text.ToString();
|
||||||
set => number.Text = value;
|
set => number.Text = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
AddAssert("mapped by text not present", () =>
|
AddAssert("mapped by text not present", () =>
|
||||||
this.ChildrenOfType<OsuSpriteText>().All(spriteText => !containsAny(spriteText.Text, "mapped", "by")));
|
this.ChildrenOfType<OsuSpriteText>().All(spriteText => !containsAny(spriteText.Text.ToString(), "mapped", "by")));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showPanel(ScoreInfo score) => Child = new ExpandedPanelMiddleContentContainer(score);
|
private void showPanel(ScoreInfo score) => Child = new ExpandedPanelMiddleContentContainer(score);
|
||||||
|
@ -78,7 +78,7 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
|
|
||||||
clickClearButton();
|
clickClearButton();
|
||||||
|
|
||||||
AddAssert("first binding cleared", () => string.IsNullOrEmpty(multiBindingRow.ChildrenOfType<KeyBindingRow.KeyButton>().First().Text.Text));
|
AddAssert("first binding cleared", () => string.IsNullOrEmpty(multiBindingRow.ChildrenOfType<KeyBindingRow.KeyButton>().First().Text.Text.ToString()));
|
||||||
|
|
||||||
AddStep("click second binding", () =>
|
AddStep("click second binding", () =>
|
||||||
{
|
{
|
||||||
@ -90,7 +90,7 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
|
|
||||||
clickClearButton();
|
clickClearButton();
|
||||||
|
|
||||||
AddAssert("second binding cleared", () => string.IsNullOrEmpty(multiBindingRow.ChildrenOfType<KeyBindingRow.KeyButton>().ElementAt(1).Text.Text));
|
AddAssert("second binding cleared", () => string.IsNullOrEmpty(multiBindingRow.ChildrenOfType<KeyBindingRow.KeyButton>().ElementAt(1).Text.Text.ToString()));
|
||||||
|
|
||||||
void clickClearButton()
|
void clickClearButton()
|
||||||
{
|
{
|
||||||
|
@ -119,7 +119,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
public void TestNullBeatmap()
|
public void TestNullBeatmap()
|
||||||
{
|
{
|
||||||
selectBeatmap(null);
|
selectBeatmap(null);
|
||||||
AddAssert("check empty version", () => string.IsNullOrEmpty(infoWedge.Info.VersionLabel.Text));
|
AddAssert("check empty version", () => string.IsNullOrEmpty(infoWedge.Info.VersionLabel.Text.ToString()));
|
||||||
AddAssert("check default title", () => infoWedge.Info.TitleLabel.Text == Beatmap.Default.BeatmapInfo.Metadata.Title);
|
AddAssert("check default title", () => infoWedge.Info.TitleLabel.Text == Beatmap.Default.BeatmapInfo.Metadata.Title);
|
||||||
AddAssert("check default artist", () => infoWedge.Info.ArtistLabel.Text == Beatmap.Default.BeatmapInfo.Metadata.Artist);
|
AddAssert("check default artist", () => infoWedge.Info.ArtistLabel.Text == Beatmap.Default.BeatmapInfo.Metadata.Artist);
|
||||||
AddAssert("check empty author", () => !infoWedge.Info.MapperContainer.Children.Any());
|
AddAssert("check empty author", () => !infoWedge.Info.MapperContainer.Children.Any());
|
||||||
|
@ -145,7 +145,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
AddStep("click delete option", () =>
|
AddStep("click delete option", () =>
|
||||||
{
|
{
|
||||||
InputManager.MoveMouseTo(contextMenuContainer.ChildrenOfType<DrawableOsuMenuItem>().First(i => i.Item.Text.Value.ToLowerInvariant() == "delete"));
|
InputManager.MoveMouseTo(contextMenuContainer.ChildrenOfType<DrawableOsuMenuItem>().First(i => i.Item.Text.Value.ToString().ToLowerInvariant() == "delete"));
|
||||||
InputManager.Click(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -121,7 +122,7 @@ namespace osu.Game.Collections
|
|||||||
Current.TriggerChange();
|
Current.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string GenerateItemText(CollectionFilterMenuItem item) => item.CollectionName.Value;
|
protected override LocalisableString GenerateItemText(CollectionFilterMenuItem item) => item.CollectionName.Value;
|
||||||
|
|
||||||
protected sealed override DropdownHeader CreateHeader() => CreateCollectionHeader().With(d =>
|
protected sealed override DropdownHeader CreateHeader() => CreateCollectionHeader().With(d =>
|
||||||
{
|
{
|
||||||
@ -139,7 +140,7 @@ namespace osu.Game.Collections
|
|||||||
public readonly Bindable<CollectionFilterMenuItem> SelectedItem = new Bindable<CollectionFilterMenuItem>();
|
public readonly Bindable<CollectionFilterMenuItem> SelectedItem = new Bindable<CollectionFilterMenuItem>();
|
||||||
private readonly Bindable<string> collectionName = new Bindable<string>();
|
private readonly Bindable<string> collectionName = new Bindable<string>();
|
||||||
|
|
||||||
protected override string Label
|
protected override LocalisableString Label
|
||||||
{
|
{
|
||||||
get => base.Label;
|
get => base.Label;
|
||||||
set { } // See updateText().
|
set { } // See updateText().
|
||||||
|
@ -6,6 +6,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Colour;
|
using osu.Framework.Graphics.Colour;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Sprites
|
namespace osu.Game.Graphics.Sprites
|
||||||
@ -14,7 +15,7 @@ namespace osu.Game.Graphics.Sprites
|
|||||||
{
|
{
|
||||||
private readonly OsuSpriteText spriteText, blurredText;
|
private readonly OsuSpriteText spriteText, blurredText;
|
||||||
|
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => spriteText.Text;
|
get => spriteText.Text;
|
||||||
set => blurredText.Text = spriteText.Text = value;
|
set => blurredText.Text = spriteText.Text = value;
|
||||||
|
@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -105,7 +106,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
protected class TextContainer : Container, IHasText
|
protected class TextContainer : Container, IHasText
|
||||||
{
|
{
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => NormalText.Text;
|
get => NormalText.Text;
|
||||||
set
|
set
|
||||||
|
@ -11,6 +11,7 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -21,9 +22,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class OsuButton : Button
|
public class OsuButton : Button
|
||||||
{
|
{
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => SpriteText?.Text;
|
get => SpriteText.Text;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (SpriteText != null)
|
if (SpriteText != null)
|
||||||
|
@ -9,6 +9,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -168,7 +169,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
protected new class Content : FillFlowContainer, IHasText
|
protected new class Content : FillFlowContainer, IHasText
|
||||||
{
|
{
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => Label.Text;
|
get => Label.Text;
|
||||||
set => Label.Text = value;
|
set => Label.Text = value;
|
||||||
@ -215,7 +216,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
protected readonly SpriteText Text;
|
protected readonly SpriteText Text;
|
||||||
|
|
||||||
protected override string Label
|
protected override LocalisableString Label
|
||||||
{
|
{
|
||||||
get => Text.Text;
|
get => Text.Text;
|
||||||
set => Text.Text = value;
|
set => Text.Text = value;
|
||||||
|
@ -11,6 +11,7 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
{
|
{
|
||||||
@ -35,7 +36,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => text.Text;
|
get => text.Text;
|
||||||
set => text.Text = value;
|
set => text.Text = value;
|
||||||
|
@ -11,6 +11,7 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
{
|
{
|
||||||
@ -18,7 +19,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
private const int duration = 200;
|
private const int duration = 200;
|
||||||
|
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => text.Text;
|
get => text.Text;
|
||||||
set => text.Text = value;
|
set => text.Text = value;
|
||||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual IEnumerable<string> FilterTerms => new[] { Text };
|
public virtual IEnumerable<string> FilterTerms => new[] { Text.ToString() };
|
||||||
|
|
||||||
public bool MatchingFilter
|
public bool MatchingFilter
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,6 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Framework.Localisation;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
@ -8,7 +8,6 @@ using osu.Framework.Graphics.Colour;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Localisation;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
@ -8,6 +8,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Cursor;
|
using osu.Framework.Graphics.Cursor;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
@ -96,7 +97,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
|
|
||||||
public string TooltipText { get; }
|
public string TooltipText { get; }
|
||||||
|
|
||||||
public string Value
|
public LocalisableString Value
|
||||||
{
|
{
|
||||||
get => value.Text;
|
get => value.Text;
|
||||||
set => this.value.Text = value;
|
set => this.value.Text = value;
|
||||||
|
@ -9,7 +9,6 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Localisation;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
|
@ -4,12 +4,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osuTK;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Online.Chat;
|
using osu.Game.Online.Chat;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Chat.Selection
|
namespace osu.Game.Overlays.Chat.Selection
|
||||||
{
|
{
|
||||||
@ -29,12 +29,6 @@ namespace osu.Game.Overlays.Chat.Selection
|
|||||||
|
|
||||||
public bool FilteringActive { get; set; }
|
public bool FilteringActive { get; set; }
|
||||||
|
|
||||||
public string Header
|
|
||||||
{
|
|
||||||
get => header.Text;
|
|
||||||
set => header.Text = value.ToUpperInvariant();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<Channel> Channels
|
public IEnumerable<Channel> Channels
|
||||||
{
|
{
|
||||||
set => ChannelFlow.ChildrenEnumerable = value.Select(c => new ChannelListItem(c));
|
set => ChannelFlow.ChildrenEnumerable = value.Select(c => new ChannelListItem(c));
|
||||||
@ -50,6 +44,7 @@ namespace osu.Game.Overlays.Chat.Selection
|
|||||||
header = new OsuSpriteText
|
header = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold),
|
Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold),
|
||||||
|
Text = "All Channels".ToUpperInvariant()
|
||||||
},
|
},
|
||||||
ChannelFlow = new FillFlowContainer<ChannelListItem>
|
ChannelFlow = new FillFlowContainer<ChannelListItem>
|
||||||
{
|
{
|
||||||
|
@ -131,11 +131,7 @@ namespace osu.Game.Overlays.Chat.Selection
|
|||||||
{
|
{
|
||||||
sectionsFlow.ChildrenEnumerable = new[]
|
sectionsFlow.ChildrenEnumerable = new[]
|
||||||
{
|
{
|
||||||
new ChannelSection
|
new ChannelSection { Channels = channels, },
|
||||||
{
|
|
||||||
Header = "All Channels",
|
|
||||||
Channels = channels,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (ChannelSection s in sectionsFlow.Children)
|
foreach (ChannelSection s in sectionsFlow.Children)
|
||||||
|
@ -6,6 +6,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
@ -16,7 +17,7 @@ namespace osu.Game.Overlays.Comments.Buttons
|
|||||||
{
|
{
|
||||||
public abstract class CommentRepliesButton : CompositeDrawable
|
public abstract class CommentRepliesButton : CompositeDrawable
|
||||||
{
|
{
|
||||||
protected string Text
|
protected LocalisableString Text
|
||||||
{
|
{
|
||||||
get => text.Text;
|
get => text.Text;
|
||||||
set => text.Text = value;
|
set => text.Text = value;
|
||||||
|
@ -51,7 +51,7 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
private FillFlowContainer cancelAndClearButtons;
|
private FillFlowContainer cancelAndClearButtons;
|
||||||
private FillFlowContainer<KeyButton> buttons;
|
private FillFlowContainer<KeyButton> buttons;
|
||||||
|
|
||||||
public IEnumerable<string> FilterTerms => bindings.Select(b => b.KeyCombination.ReadableString()).Prepend((string)text.Text);
|
public IEnumerable<string> FilterTerms => bindings.Select(b => b.KeyCombination.ReadableString()).Prepend(text.Text.ToString());
|
||||||
|
|
||||||
public KeyBindingRow(object action, IEnumerable<Framework.Input.Bindings.KeyBinding> bindings)
|
public KeyBindingRow(object action, IEnumerable<Framework.Input.Bindings.KeyBinding> bindings)
|
||||||
{
|
{
|
||||||
|
@ -8,6 +8,7 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -37,7 +38,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
public NotificationSection(string title, string clearButtonText)
|
public NotificationSection(string title, string clearButtonText)
|
||||||
{
|
{
|
||||||
this.clearButtonText = clearButtonText;
|
this.clearButtonText = clearButtonText.ToUpperInvariant();
|
||||||
titleText = title;
|
titleText = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,10 +139,10 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => text.Text;
|
get => text.Text;
|
||||||
set => text.Text = value.ToUpperInvariant();
|
set => text.Text = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Framework.Localisation;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
|
@ -17,6 +17,7 @@ using osu.Game.Overlays.Comments;
|
|||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
@ -30,7 +31,7 @@ namespace osu.Game.Overlays
|
|||||||
set => current.Current = value;
|
set => current.Current = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Title
|
public LocalisableString Title
|
||||||
{
|
{
|
||||||
get => text.Text;
|
get => text.Text;
|
||||||
set => text.Text = value;
|
set => text.Text = value;
|
||||||
|
@ -5,7 +5,6 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Localisation;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
@ -7,7 +7,6 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Localisation;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
|
@ -6,6 +6,7 @@ using osu.Framework.Audio;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Settings.Sections.Audio
|
namespace osu.Game.Overlays.Settings.Sections.Audio
|
||||||
@ -76,7 +77,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
|||||||
|
|
||||||
private class AudioDeviceDropdownControl : DropdownControl
|
private class AudioDeviceDropdownControl : DropdownControl
|
||||||
{
|
{
|
||||||
protected override string GenerateItemText(string item)
|
protected override LocalisableString GenerateItemText(string item)
|
||||||
=> string.IsNullOrEmpty(item) ? "Default" : base.GenerateItemText(item);
|
=> string.IsNullOrEmpty(item) ? "Default" : base.GenerateItemText(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ using osu.Framework.Extensions.IEnumerableExtensions;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -234,7 +235,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
|
|
||||||
private class ResolutionDropdownControl : DropdownControl
|
private class ResolutionDropdownControl : DropdownControl
|
||||||
{
|
{
|
||||||
protected override string GenerateItemText(Size item)
|
protected override LocalisableString GenerateItemText(Size item)
|
||||||
{
|
{
|
||||||
if (item == new Size(9999, 9999))
|
if (item == new Size(9999, 9999))
|
||||||
return "Default";
|
return "Default";
|
||||||
|
@ -178,7 +178,7 @@ namespace osu.Game.Overlays.Settings.Sections
|
|||||||
|
|
||||||
private class SkinDropdownControl : DropdownControl
|
private class SkinDropdownControl : DropdownControl
|
||||||
{
|
{
|
||||||
protected override string GenerateItemText(SkinInfo item) => item.ToString();
|
protected override LocalisableString GenerateItemText(SkinInfo item) => item.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,20 +2,22 @@
|
|||||||
// 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.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Settings
|
namespace osu.Game.Overlays.Settings
|
||||||
{
|
{
|
||||||
public class SettingsCheckbox : SettingsItem<bool>
|
public class SettingsCheckbox : SettingsItem<bool>
|
||||||
{
|
{
|
||||||
private string labelText;
|
private LocalisableString labelText;
|
||||||
|
|
||||||
protected override Drawable CreateControl() => new OsuCheckbox();
|
protected override Drawable CreateControl() => new OsuCheckbox();
|
||||||
|
|
||||||
public override string LabelText
|
public override LocalisableString LabelText
|
||||||
{
|
{
|
||||||
get => labelText;
|
get => labelText;
|
||||||
set => ((OsuCheckbox)Control).LabelText = labelText = value;
|
// checkbox doesn't properly support localisation yet.
|
||||||
|
set => ((OsuCheckbox)Control).LabelText = (labelText = value).ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -39,7 +40,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
|
|
||||||
public string TooltipText { get; set; }
|
public string TooltipText { get; set; }
|
||||||
|
|
||||||
public virtual string LabelText
|
public virtual LocalisableString LabelText
|
||||||
{
|
{
|
||||||
get => labelText?.Text ?? string.Empty;
|
get => labelText?.Text ?? string.Empty;
|
||||||
set
|
set
|
||||||
@ -69,7 +70,7 @@ namespace osu.Game.Overlays.Settings
|
|||||||
set => controlWithCurrent.Current = value;
|
set => controlWithCurrent.Current = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual IEnumerable<string> FilterTerms => Keywords == null ? new[] { LabelText } : new List<string>(Keywords) { LabelText }.ToArray();
|
public virtual IEnumerable<string> FilterTerms => Keywords == null ? new[] { LabelText.ToString() } : new List<string>(Keywords) { LabelText.ToString() }.ToArray();
|
||||||
|
|
||||||
public IEnumerable<string> Keywords { get; set; }
|
public IEnumerable<string> Keywords { get; set; }
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ using osu.Framework.Graphics.Sprites;
|
|||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Backgrounds;
|
using osu.Game.Graphics.Backgrounds;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -43,19 +44,19 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
Texture = textures.Get(texture),
|
Texture = textures.Get(texture),
|
||||||
});
|
});
|
||||||
|
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => DrawableText.Text;
|
get => DrawableText.Text;
|
||||||
set => DrawableText.Text = value;
|
set => DrawableText.Text = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string TooltipMain
|
public LocalisableString TooltipMain
|
||||||
{
|
{
|
||||||
get => tooltip1.Text;
|
get => tooltip1.Text;
|
||||||
set => tooltip1.Text = value;
|
set => tooltip1.Text = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string TooltipSub
|
public LocalisableString TooltipSub
|
||||||
{
|
{
|
||||||
get => tooltip2.Text;
|
get => tooltip2.Text;
|
||||||
set => tooltip2.Text = value;
|
set => tooltip2.Text = value;
|
||||||
|
@ -9,7 +9,6 @@ using osuTK;
|
|||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Framework.Localisation;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Menu
|
namespace osu.Game.Screens.Menu
|
||||||
{
|
{
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Localisation;
|
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
|
@ -10,6 +10,7 @@ using osu.Framework.Extensions.Color4Extensions;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
@ -362,7 +363,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
|||||||
Menu.MaxHeight = 100;
|
Menu.MaxHeight = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string GenerateItemText(TimeSpan item) => item.Humanize();
|
protected override LocalisableString GenerateItemText(TimeSpan item) => item.Humanize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Localisation;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
|
@ -6,7 +6,6 @@ using System.Linq;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Localisation;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
|
@ -6,7 +6,6 @@ using System.Linq;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Localisation;
|
|
||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
|
@ -15,6 +15,7 @@ using System.Collections.Generic;
|
|||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
@ -180,7 +181,7 @@ namespace osu.Game.Screens.Select.Details
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuColour colours { get; set; }
|
private OsuColour colours { get; set; }
|
||||||
|
|
||||||
public string Title
|
public LocalisableString Title
|
||||||
{
|
{
|
||||||
get => name.Text;
|
get => name.Text;
|
||||||
set => name.Text = value;
|
set => name.Text = value;
|
||||||
|
@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
@ -21,9 +22,9 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
protected static readonly Vector2 SHEAR = new Vector2(SHEAR_WIDTH / Footer.HEIGHT, 0);
|
protected static readonly Vector2 SHEAR = new Vector2(SHEAR_WIDTH / Footer.HEIGHT, 0);
|
||||||
|
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => SpriteText?.Text;
|
get => SpriteText.Text;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (SpriteText != null)
|
if (SpriteText != null)
|
||||||
|
@ -8,6 +8,7 @@ using osu.Framework.Graphics.Effects;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -39,13 +40,13 @@ namespace osu.Game.Screens.Select.Options
|
|||||||
set => iconText.Icon = value;
|
set => iconText.Icon = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string FirstLineText
|
public LocalisableString FirstLineText
|
||||||
{
|
{
|
||||||
get => firstLine.Text;
|
get => firstLine.Text;
|
||||||
set => firstLine.Text = value;
|
set => firstLine.Text = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string SecondLineText
|
public LocalisableString SecondLineText
|
||||||
{
|
{
|
||||||
get => secondLine.Text;
|
get => secondLine.Text;
|
||||||
set => secondLine.Text = value;
|
set => secondLine.Text = value;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
|
|
||||||
namespace osu.Game.Skinning
|
namespace osu.Game.Skinning
|
||||||
{
|
{
|
||||||
@ -21,9 +22,9 @@ namespace osu.Game.Skinning
|
|||||||
textDrawable.Text = Text;
|
textDrawable.Text = Text;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string text;
|
private LocalisableString text;
|
||||||
|
|
||||||
public string Text
|
public LocalisableString Text
|
||||||
{
|
{
|
||||||
get => text;
|
get => text;
|
||||||
set
|
set
|
||||||
|
Loading…
x
Reference in New Issue
Block a user