mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 20:12:57 +08:00
Move labelled dropdown from tournament to main game
This commit is contained in:
parent
ba57493732
commit
acf38c723a
@ -1,14 +1,12 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics.UserInterface;
|
|
||||||
using osu.Game.Graphics.UserInterfaceV2;
|
using osu.Game.Graphics.UserInterfaceV2;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
@ -131,25 +129,5 @@ namespace osu.Game.Tournament.Screens.Setup
|
|||||||
|
|
||||||
resolution.Value = $"{ScreenSpaceDrawQuad.Width:N0}x{ScreenSpaceDrawQuad.Height:N0}";
|
resolution.Value = $"{ScreenSpaceDrawQuad.Width:N0}x{ScreenSpaceDrawQuad.Height:N0}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public class LabelledDropdown<T> : LabelledComponent<OsuDropdown<T>, T>
|
|
||||||
{
|
|
||||||
public LabelledDropdown()
|
|
||||||
: base(true)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<T> Items
|
|
||||||
{
|
|
||||||
get => Component.Items;
|
|
||||||
set => Component.Items = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override OsuDropdown<T> CreateComponent() => new OsuDropdown<T>
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
Width = 0.5f,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
31
osu.Game/Graphics/UserInterfaceV2/LabelledDropdown.cs
Normal file
31
osu.Game/Graphics/UserInterfaceV2/LabelledDropdown.cs
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// 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 osu.Framework.Graphics;
|
||||||
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
|
||||||
|
namespace osu.Game.Graphics.UserInterfaceV2
|
||||||
|
{
|
||||||
|
public class LabelledDropdown<TItem> : LabelledComponent<OsuDropdown<TItem>, TItem>
|
||||||
|
{
|
||||||
|
public LabelledDropdown()
|
||||||
|
: base(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<TItem> Items
|
||||||
|
{
|
||||||
|
get => Component.Items;
|
||||||
|
set => Component.Items = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected sealed override OsuDropdown<TItem> CreateComponent() => CreateDropdown().With(d =>
|
||||||
|
{
|
||||||
|
d.RelativeSizeAxes = Axes.X;
|
||||||
|
d.Width = 0.5f;
|
||||||
|
});
|
||||||
|
|
||||||
|
protected virtual OsuDropdown<TItem> CreateDropdown() => new OsuDropdown<TItem>();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user