diff --git a/osu.Android.props b/osu.Android.props
index c57fc342ba..46fd5424df 100644
--- a/osu.Android.props
+++ b/osu.Android.props
@@ -62,6 +62,6 @@
-
+
diff --git a/osu.Game.Tests/Skins/TestSceneSkinConfigurationLookup.cs b/osu.Game.Tests/Skins/TestSceneSkinConfigurationLookup.cs
index bbcc4140a9..578030748b 100644
--- a/osu.Game.Tests/Skins/TestSceneSkinConfigurationLookup.cs
+++ b/osu.Game.Tests/Skins/TestSceneSkinConfigurationLookup.cs
@@ -9,6 +9,7 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Textures;
+using osu.Framework.Testing;
using osu.Game.Audio;
using osu.Game.Skinning;
using osu.Game.Tests.Visual;
@@ -17,6 +18,7 @@ using osuTK.Graphics;
namespace osu.Game.Tests.Skins
{
[TestFixture]
+ [HeadlessTest]
public class TestSceneSkinConfigurationLookup : OsuTestScene
{
private LegacySkin source1;
diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneLabelledComponent.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneLabelledComponent.cs
index 73e0191adb..700adad9cb 100644
--- a/osu.Game.Tests/Visual/UserInterface/TestSceneLabelledComponent.cs
+++ b/osu.Game.Tests/Visual/UserInterface/TestSceneLabelledComponent.cs
@@ -6,7 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Sprites;
-using osu.Game.Screens.Edit.Setup.Components.LabelledComponents;
+using osu.Game.Graphics.UserInterfaceV2;
using osuTK.Graphics;
namespace osu.Game.Tests.Visual.UserInterface
@@ -25,7 +25,7 @@ namespace osu.Game.Tests.Visual.UserInterface
{
AddStep("create component", () =>
{
- LabelledComponent component;
+ LabelledComponent component;
Child = new Container
{
@@ -33,7 +33,7 @@ namespace osu.Game.Tests.Visual.UserInterface
Origin = Anchor.Centre,
Width = 500,
AutoSizeAxes = Axes.Y,
- Child = component = padded ? (LabelledComponent)new PaddedLabelledComponent() : new NonPaddedLabelledComponent(),
+ Child = component = padded ? (LabelledComponent)new PaddedLabelledComponent() : new NonPaddedLabelledComponent(),
};
component.Label = "a sample component";
@@ -41,7 +41,7 @@ namespace osu.Game.Tests.Visual.UserInterface
});
}
- private class PaddedLabelledComponent : LabelledComponent
+ private class PaddedLabelledComponent : LabelledComponent
{
public PaddedLabelledComponent()
: base(true)
@@ -57,7 +57,7 @@ namespace osu.Game.Tests.Visual.UserInterface
};
}
- private class NonPaddedLabelledComponent : LabelledComponent
+ private class NonPaddedLabelledComponent : LabelledComponent
{
public NonPaddedLabelledComponent()
: base(false)
diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneLabelledTextBox.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneLabelledTextBox.cs
index 395905a30d..53a2bfabbc 100644
--- a/osu.Game.Tests/Visual/UserInterface/TestSceneLabelledTextBox.cs
+++ b/osu.Game.Tests/Visual/UserInterface/TestSceneLabelledTextBox.cs
@@ -7,7 +7,8 @@ using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
-using osu.Game.Screens.Edit.Setup.Components.LabelledComponents;
+using osu.Game.Graphics.UserInterface;
+using osu.Game.Graphics.UserInterfaceV2;
namespace osu.Game.Tests.Visual.UserInterface
{
@@ -19,6 +20,36 @@ namespace osu.Game.Tests.Visual.UserInterface
typeof(LabelledTextBox),
};
+ [TestCase(false)]
+ [TestCase(true)]
+ public void TestTextBox(bool hasDescription) => createTextBox(hasDescription);
+
+ private void createTextBox(bool hasDescription = false)
+ {
+ AddStep("create component", () =>
+ {
+ LabelledComponent component;
+
+ Child = new Container
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ Width = 500,
+ AutoSizeAxes = Axes.Y,
+ Child = component = new LabelledTextBox
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ Label = "Testing text",
+ PlaceholderText = "This is definitely working as intended",
+ }
+ };
+
+ component.Label = "a sample component";
+ component.Description = hasDescription ? "this text describes the component" : string.Empty;
+ });
+ }
+
[BackgroundDependencyLoader]
private void load()
{
@@ -32,7 +63,7 @@ namespace osu.Game.Tests.Visual.UserInterface
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
- LabelText = "Testing text",
+ Label = "Testing text",
PlaceholderText = "This is definitely working as intended",
}
};
diff --git a/osu.Game.Tournament.Tests/Screens/TestSceneSetupScreen.cs b/osu.Game.Tournament.Tests/Screens/TestSceneSetupScreen.cs
new file mode 100644
index 0000000000..650b4c5412
--- /dev/null
+++ b/osu.Game.Tournament.Tests/Screens/TestSceneSetupScreen.cs
@@ -0,0 +1,17 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using osu.Framework.Allocation;
+using osu.Game.Tournament.Screens;
+
+namespace osu.Game.Tournament.Tests.Screens
+{
+ public class TestSceneSetupScreen : TournamentTestScene
+ {
+ [BackgroundDependencyLoader]
+ private void load()
+ {
+ Add(new SetupScreen());
+ }
+ }
+}
diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs
index 4fd858bd12..e05d96e098 100644
--- a/osu.Game.Tournament/IPC/FileBasedIPC.cs
+++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs
@@ -9,6 +9,7 @@ using osu.Framework.Allocation;
using osu.Framework.Logging;
using osu.Framework.Platform;
using osu.Framework.Platform.Windows;
+using osu.Framework.Threading;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Legacy;
using osu.Game.Online.API;
@@ -26,103 +27,120 @@ namespace osu.Game.Tournament.IPC
[Resolved]
protected RulesetStore Rulesets { get; private set; }
+ [Resolved]
+ private GameHost host { get; set; }
+
+ [Resolved]
+ private LadderInfo ladder { get; set; }
+
private int lastBeatmapId;
+ private ScheduledDelegate scheduled;
+
+ public Storage Storage { get; private set; }
[BackgroundDependencyLoader]
- private void load(LadderInfo ladder, GameHost host)
+ private void load()
{
- StableStorage stable;
+ LocateStableStorage();
+ }
+
+ public Storage LocateStableStorage()
+ {
+ scheduled?.Cancel();
+
+ Storage = null;
try
{
- stable = new StableStorage(host as DesktopGameHost);
+ Storage = new StableStorage(host as DesktopGameHost);
+
+ const string file_ipc_filename = "ipc.txt";
+ const string file_ipc_state_filename = "ipc-state.txt";
+ const string file_ipc_scores_filename = "ipc-scores.txt";
+ const string file_ipc_channel_filename = "ipc-channel.txt";
+
+ if (Storage.Exists(file_ipc_filename))
+ scheduled = Scheduler.AddDelayed(delegate
+ {
+ try
+ {
+ using (var stream = Storage.GetStream(file_ipc_filename))
+ using (var sr = new StreamReader(stream))
+ {
+ var beatmapId = int.Parse(sr.ReadLine());
+ var mods = int.Parse(sr.ReadLine());
+
+ if (lastBeatmapId != beatmapId)
+ {
+ lastBeatmapId = beatmapId;
+
+ var existing = ladder.CurrentMatch.Value?.Round.Value?.Beatmaps.FirstOrDefault(b => b.ID == beatmapId && b.BeatmapInfo != null);
+
+ if (existing != null)
+ Beatmap.Value = existing.BeatmapInfo;
+ else
+ {
+ var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId });
+ req.Success += b => Beatmap.Value = b.ToBeatmap(Rulesets);
+ API.Queue(req);
+ }
+ }
+
+ Mods.Value = (LegacyMods)mods;
+ }
+ }
+ catch
+ {
+ // file might be in use.
+ }
+
+ try
+ {
+ using (var stream = Storage.GetStream(file_ipc_channel_filename))
+ using (var sr = new StreamReader(stream))
+ {
+ ChatChannel.Value = sr.ReadLine();
+ }
+ }
+ catch (Exception)
+ {
+ // file might be in use.
+ }
+
+ try
+ {
+ using (var stream = Storage.GetStream(file_ipc_state_filename))
+ using (var sr = new StreamReader(stream))
+ {
+ State.Value = (TourneyState)Enum.Parse(typeof(TourneyState), sr.ReadLine());
+ }
+ }
+ catch (Exception)
+ {
+ // file might be in use.
+ }
+
+ try
+ {
+ using (var stream = Storage.GetStream(file_ipc_scores_filename))
+ using (var sr = new StreamReader(stream))
+ {
+ Score1.Value = int.Parse(sr.ReadLine());
+ Score2.Value = int.Parse(sr.ReadLine());
+ }
+ }
+ catch (Exception)
+ {
+ // file might be in use.
+ }
+ }, 250, true);
}
catch (Exception e)
{
Logger.Error(e, "Stable installation could not be found; disabling file based IPC");
- return;
}
- const string file_ipc_filename = "ipc.txt";
- const string file_ipc_state_filename = "ipc-state.txt";
- const string file_ipc_scores_filename = "ipc-scores.txt";
- const string file_ipc_channel_filename = "ipc-channel.txt";
-
- if (stable.Exists(file_ipc_filename))
- Scheduler.AddDelayed(delegate
- {
- try
- {
- using (var stream = stable.GetStream(file_ipc_filename))
- using (var sr = new StreamReader(stream))
- {
- var beatmapId = int.Parse(sr.ReadLine());
- var mods = int.Parse(sr.ReadLine());
-
- if (lastBeatmapId != beatmapId)
- {
- lastBeatmapId = beatmapId;
-
- var existing = ladder.CurrentMatch.Value?.Round.Value?.Beatmaps.FirstOrDefault(b => b.ID == beatmapId && b.BeatmapInfo != null);
-
- if (existing != null)
- Beatmap.Value = existing.BeatmapInfo;
- else
- {
- var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId });
- req.Success += b => Beatmap.Value = b.ToBeatmap(Rulesets);
- API.Queue(req);
- }
- }
-
- Mods.Value = (LegacyMods)mods;
- }
- }
- catch
- {
- // file might be in use.
- }
-
- try
- {
- using (var stream = stable.GetStream(file_ipc_channel_filename))
- using (var sr = new StreamReader(stream))
- {
- ChatChannel.Value = sr.ReadLine();
- }
- }
- catch (Exception)
- {
- // file might be in use.
- }
-
- try
- {
- using (var stream = stable.GetStream(file_ipc_state_filename))
- using (var sr = new StreamReader(stream))
- {
- State.Value = (TourneyState)Enum.Parse(typeof(TourneyState), sr.ReadLine());
- }
- }
- catch (Exception)
- {
- // file might be in use.
- }
-
- try
- {
- using (var stream = stable.GetStream(file_ipc_scores_filename))
- using (var sr = new StreamReader(stream))
- {
- Score1.Value = int.Parse(sr.ReadLine());
- Score2.Value = int.Parse(sr.ReadLine());
- }
- }
- catch (Exception)
- {
- // file might be in use.
- }
- }, 250, true);
+ return Storage;
}
///
diff --git a/osu.Game.Tournament/Screens/SetupScreen.cs b/osu.Game.Tournament/Screens/SetupScreen.cs
new file mode 100644
index 0000000000..091a837745
--- /dev/null
+++ b/osu.Game.Tournament/Screens/SetupScreen.cs
@@ -0,0 +1,142 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using System;
+using osu.Framework.Allocation;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
+using osu.Game.Graphics.Sprites;
+using osu.Game.Graphics.UserInterface;
+using osu.Game.Graphics.UserInterfaceV2;
+using osu.Game.Online.API;
+using osu.Game.Overlays;
+using osu.Game.Tournament.IPC;
+using osuTK;
+using osuTK.Graphics;
+
+namespace osu.Game.Tournament.Screens
+{
+ public class SetupScreen : TournamentScreen, IProvideVideo
+ {
+ private FillFlowContainer fillFlow;
+
+ private LoginOverlay loginOverlay;
+
+ [Resolved]
+ private MatchIPCInfo ipc { get; set; }
+
+ [Resolved]
+ private IAPIProvider api { get; set; }
+
+ [BackgroundDependencyLoader]
+ private void load()
+ {
+ InternalChild = fillFlow = new FillFlowContainer
+ {
+ RelativeSizeAxes = Axes.X,
+ AutoSizeAxes = Axes.Y,
+ Direction = FillDirection.Vertical,
+ Padding = new MarginPadding(10),
+ Spacing = new Vector2(10),
+ };
+
+ api.LocalUser.BindValueChanged(_ => Schedule(reload));
+ reload();
+ }
+
+ private void reload()
+ {
+ var fileBasedIpc = ipc as FileBasedIPC;
+
+ fillFlow.Children = new Drawable[]
+ {
+ new ActionableInfo
+ {
+ Label = "Current IPC source",
+ ButtonText = "Refresh",
+ Action = () =>
+ {
+ fileBasedIpc?.LocateStableStorage();
+ reload();
+ },
+ Value = fileBasedIpc?.Storage?.GetFullPath(string.Empty) ?? "Not found",
+ Failing = fileBasedIpc?.Storage == null,
+ Description = "The osu!stable installation which is currently being used as a data source. If a source is not found, make sure you have created an empty ipc.txt in your stable cutting-edge installation, and that it is registered as the default osu! install."
+ },
+ new ActionableInfo
+ {
+ Label = "Current User",
+ ButtonText = "Change Login",
+ Action = () =>
+ {
+ api.Logout();
+
+ if (loginOverlay == null)
+ {
+ AddInternal(loginOverlay = new LoginOverlay
+ {
+ Anchor = Anchor.TopRight,
+ Origin = Anchor.TopRight,
+ });
+ }
+
+ loginOverlay.State.Value = Visibility.Visible;
+ },
+ Value = api?.LocalUser.Value.Username,
+ Failing = api?.IsLoggedIn != true,
+ Description = "In order to access the API and display metadata, a login is required."
+ }
+ };
+ }
+
+ private class ActionableInfo : LabelledComponent
+ {
+ private OsuButton button;
+
+ public ActionableInfo()
+ : base(true)
+ {
+ }
+
+ public string ButtonText
+ {
+ set => button.Text = value;
+ }
+
+ public string Value
+ {
+ set => valueText.Text = value;
+ }
+
+ public bool Failing
+ {
+ set => valueText.Colour = value ? Color4.Red : Color4.White;
+ }
+
+ public Action Action;
+
+ private OsuSpriteText valueText;
+
+ protected override Drawable CreateComponent() => new Container
+ {
+ AutoSizeAxes = Axes.Y,
+ RelativeSizeAxes = Axes.X,
+ Children = new Drawable[]
+ {
+ valueText = new OsuSpriteText
+ {
+ Anchor = Anchor.CentreLeft,
+ Origin = Anchor.CentreLeft,
+ },
+ button = new TriangleButton
+ {
+ Anchor = Anchor.CentreRight,
+ Origin = Anchor.CentreRight,
+ Size = new Vector2(100, 30),
+ Action = () => Action?.Invoke()
+ },
+ }
+ };
+ }
+ }
+}
diff --git a/osu.Game.Tournament/TournamentSceneManager.cs b/osu.Game.Tournament/TournamentSceneManager.cs
index 4c255be463..02ee1c8603 100644
--- a/osu.Game.Tournament/TournamentSceneManager.cs
+++ b/osu.Game.Tournament/TournamentSceneManager.cs
@@ -69,6 +69,7 @@ namespace osu.Game.Tournament
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
+ new SetupScreen(),
new ScheduleScreen(),
new LadderScreen(),
new LadderEditorScreen(),
@@ -106,6 +107,8 @@ namespace osu.Game.Tournament
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
+ new OsuButton { RelativeSizeAxes = Axes.X, Text = "Setup", Action = () => SetScreen(typeof(SetupScreen)) },
+ new Container { RelativeSizeAxes = Axes.X, Height = 50 },
new OsuButton { RelativeSizeAxes = Axes.X, Text = "Team Editor", Action = () => SetScreen(typeof(TeamEditorScreen)) },
new OsuButton { RelativeSizeAxes = Axes.X, Text = "Rounds Editor", Action = () => SetScreen(typeof(RoundEditorScreen)) },
new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket Editor", Action = () => SetScreen(typeof(LadderEditorScreen)) },
@@ -127,7 +130,7 @@ namespace osu.Game.Tournament
},
};
- SetScreen(typeof(ScheduleScreen));
+ SetScreen(typeof(SetupScreen));
}
public void SetScreen(Type screenType)
diff --git a/osu.Game/Screens/Edit/Setup/Components/LabelledComponents/LabelledComponent.cs b/osu.Game/Graphics/UserInterfaceV2/LabelledComponent.cs
similarity index 93%
rename from osu.Game/Screens/Edit/Setup/Components/LabelledComponents/LabelledComponent.cs
rename to osu.Game/Graphics/UserInterfaceV2/LabelledComponent.cs
index 19e9c329d6..2e659825b7 100644
--- a/osu.Game/Screens/Edit/Setup/Components/LabelledComponents/LabelledComponent.cs
+++ b/osu.Game/Graphics/UserInterfaceV2/LabelledComponent.cs
@@ -5,13 +5,13 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
-using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osuTK;
-namespace osu.Game.Screens.Edit.Setup.Components.LabelledComponents
+namespace osu.Game.Graphics.UserInterfaceV2
{
- public abstract class LabelledComponent : CompositeDrawable
+ public abstract class LabelledComponent : CompositeDrawable
+ where T : Drawable
{
protected const float CONTENT_PADDING_VERTICAL = 10;
protected const float CONTENT_PADDING_HORIZONTAL = 15;
@@ -20,15 +20,15 @@ namespace osu.Game.Screens.Edit.Setup.Components.LabelledComponents
///
/// The component that is being displayed.
///
- protected readonly Drawable Component;
+ protected readonly T Component;
private readonly OsuTextFlowContainer labelText;
private readonly OsuTextFlowContainer descriptionText;
///
- /// Creates a new .
+ /// Creates a new .
///
- /// Whether the component should be padded or should be expanded to the bounds of this .
+ /// Whether the component should be padded or should be expanded to the bounds of this .
protected LabelledComponent(bool padded)
{
RelativeSizeAxes = Axes.X;
@@ -127,6 +127,6 @@ namespace osu.Game.Screens.Edit.Setup.Components.LabelledComponents
/// Creates the component that should be displayed.
///
/// The component.
- protected abstract Drawable CreateComponent();
+ protected abstract T CreateComponent();
}
}
diff --git a/osu.Game/Graphics/UserInterfaceV2/LabelledTextBox.cs b/osu.Game/Graphics/UserInterfaceV2/LabelledTextBox.cs
new file mode 100644
index 0000000000..50d2a14482
--- /dev/null
+++ b/osu.Game/Graphics/UserInterfaceV2/LabelledTextBox.cs
@@ -0,0 +1,49 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using osu.Framework.Allocation;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.UserInterface;
+using osu.Game.Graphics.UserInterface;
+
+namespace osu.Game.Graphics.UserInterfaceV2
+{
+ public class LabelledTextBox : LabelledComponent
+ {
+ public event TextBox.OnCommitHandler OnCommit;
+
+ public LabelledTextBox()
+ : base(false)
+ {
+ }
+
+ public bool ReadOnly
+ {
+ set => Component.ReadOnly = value;
+ }
+
+ public string PlaceholderText
+ {
+ set => Component.PlaceholderText = value;
+ }
+
+ public string Text
+ {
+ set => Component.Text = value;
+ }
+
+ [BackgroundDependencyLoader]
+ private void load(OsuColour colours)
+ {
+ Component.BorderColour = colours.Blue;
+ }
+
+ protected override OsuTextBox CreateComponent() => new OsuTextBox
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.X,
+ CornerRadius = CORNER_RADIUS,
+ }.With(t => t.OnCommit += (sender, newText) => OnCommit?.Invoke(sender, newText));
+ }
+}
diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs
index 66fec1ecf9..b02b1a5489 100644
--- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs
+++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs
@@ -67,7 +67,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
api?.Register(this);
}
- public void APIStateChanged(IAPIProvider api, APIState state)
+ public void APIStateChanged(IAPIProvider api, APIState state) => Schedule(() =>
{
form = null;
@@ -184,7 +184,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
}
if (form != null) GetContainingInputManager()?.ChangeFocus(form);
- }
+ });
public override bool AcceptsFocus => true;
diff --git a/osu.Game/Screens/Edit/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Setup/Components/LabelledComponents/LabelledTextBox.cs
deleted file mode 100644
index 1c53fc7088..0000000000
--- a/osu.Game/Screens/Edit/Setup/Components/LabelledComponents/LabelledTextBox.cs
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
-// See the LICENCE file in the repository root for full licence text.
-
-using osu.Framework.Allocation;
-using osu.Framework.Graphics;
-using osu.Framework.Graphics.Containers;
-using osu.Framework.Graphics.Shapes;
-using osu.Framework.Graphics.UserInterface;
-using osu.Game.Graphics;
-using osu.Game.Graphics.Sprites;
-using osu.Game.Graphics.UserInterface;
-using osuTK.Graphics;
-
-namespace osu.Game.Screens.Edit.Setup.Components.LabelledComponents
-{
- public class LabelledTextBox : CompositeDrawable
- {
- private const float label_container_width = 150;
- private const float corner_radius = 15;
- private const float default_height = 40;
- private const float default_label_left_padding = 15;
- private const float default_label_top_padding = 12;
- private const float default_label_text_size = 16;
-
- public event TextBox.OnCommitHandler OnCommit;
-
- public bool ReadOnly
- {
- get => textBox.ReadOnly;
- set => textBox.ReadOnly = value;
- }
-
- public string LabelText
- {
- get => label.Text;
- set => label.Text = value;
- }
-
- public float LabelTextSize
- {
- get => label.Font.Size;
- set => label.Font = label.Font.With(size: value);
- }
-
- public string PlaceholderText
- {
- get => textBox.PlaceholderText;
- set => textBox.PlaceholderText = value;
- }
-
- public string Text
- {
- get => textBox.Text;
- set => textBox.Text = value;
- }
-
- public Color4 LabelTextColour
- {
- get => label.Colour;
- set => label.Colour = value;
- }
-
- private readonly OsuTextBox textBox;
- private readonly OsuSpriteText label;
-
- public LabelledTextBox()
- {
- RelativeSizeAxes = Axes.X;
- Height = default_height;
- CornerRadius = corner_radius;
- Masking = true;
-
- InternalChild = new Container
- {
- RelativeSizeAxes = Axes.Both,
- CornerRadius = corner_radius,
- Masking = true,
- Children = new Drawable[]
- {
- new Box
- {
- RelativeSizeAxes = Axes.Both,
- Colour = OsuColour.FromHex("1c2125"),
- },
- new GridContainer
- {
- RelativeSizeAxes = Axes.X,
- Height = default_height,
- Content = new[]
- {
- new Drawable[]
- {
- label = new OsuSpriteText
- {
- Anchor = Anchor.TopLeft,
- Origin = Anchor.TopLeft,
- Padding = new MarginPadding { Left = default_label_left_padding, Top = default_label_top_padding },
- Colour = Color4.White,
- Font = OsuFont.GetFont(size: default_label_text_size, weight: FontWeight.Bold),
- },
- textBox = new OsuTextBox
- {
- Anchor = Anchor.TopLeft,
- Origin = Anchor.TopLeft,
- RelativeSizeAxes = Axes.Both,
- Height = 1,
- CornerRadius = corner_radius,
- },
- },
- },
- ColumnDimensions = new[]
- {
- new Dimension(GridSizeMode.Absolute, label_container_width),
- new Dimension()
- }
- }
- }
- };
-
- textBox.OnCommit += OnCommit;
- }
-
- [BackgroundDependencyLoader]
- private void load(OsuColour colours)
- {
- textBox.BorderColour = colours.Blue;
- }
- }
-}
diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj
index a699217503..83632f3d41 100644
--- a/osu.Game/osu.Game.csproj
+++ b/osu.Game/osu.Game.csproj
@@ -26,7 +26,7 @@
-
+
diff --git a/osu.iOS.props b/osu.iOS.props
index 7803ea1e49..30f1da362d 100644
--- a/osu.iOS.props
+++ b/osu.iOS.props
@@ -118,8 +118,8 @@
-
-
+
+