diff --git a/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs new file mode 100644 index 0000000000..8299cdf548 --- /dev/null +++ b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs @@ -0,0 +1,37 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Graphics.UserInterface +{ + public class OsuPasswordTextBox : OsuTextBox + { + protected override Drawable GetDrawableCharacter(char c) => + new Container + { + Size = new Vector2(CalculatedTextSize / 2, CalculatedTextSize), + Children = new[] + { + new CircularContainer + { + Anchor = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Size = new Vector2(0.8f), + Children = new[] + { + new Box + { + Colour = Color4.White, + RelativeSizeAxes = Axes.Both, + } + }, + } + } + }; + } +} \ No newline at end of file diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs index 0590c0e79b..cb78656bea 100644 --- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs @@ -8,7 +8,6 @@ using osu.Framework.Input; using osu.Game.Graphics.Sprites; using osu.Game.Overlays; using OpenTK.Graphics; -using osu.Framework.Graphics.Sprites; namespace osu.Game.Graphics.UserInterface { @@ -47,13 +46,6 @@ namespace osu.Game.Graphics.UserInterface base.OnFocusLost(state); } - protected override SpriteText GetDrawableCharacter(char c) => new OsuSpriteText { Text = c.ToString() }; - } - - public class OsuPasswordTextBox : OsuTextBox - { - protected virtual char MaskCharacter => '*'; - - protected override Drawable AddCharacterToFlow(char c) => base.AddCharacterToFlow(MaskCharacter); + protected override Drawable GetDrawableCharacter(char c) => new OsuSpriteText { Text = c.ToString(), TextSize = CalculatedTextSize }; } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 5f7c171cfe..1b1c851128 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -69,6 +69,7 @@ +