mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 07:22:54 +08:00
Switch to System.ComponentModel.Description
This commit is contained in:
parent
5456e0102c
commit
cf60c52f00
@ -1,15 +0,0 @@
|
||||
using System;
|
||||
namespace osu.Game.Configuration
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
|
||||
public class DisplayNameAttribute : Attribute
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public DisplayNameAttribute(string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +0,0 @@
|
||||
using System;
|
||||
namespace osu.Game.Configuration
|
||||
{
|
||||
public class HiddenAttribute
|
||||
{
|
||||
public HiddenAttribute()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace osu.Game.Configuration
|
||||
{
|
||||
@ -6,9 +7,9 @@ namespace osu.Game.Configuration
|
||||
{
|
||||
Off,
|
||||
Pie,
|
||||
[DisplayName("Top Right")]
|
||||
[Description("Top Right")]
|
||||
TopRight,
|
||||
[DisplayName("Bottom Right")]
|
||||
[Description("Bottom Right")]
|
||||
BottomRight,
|
||||
Bottom
|
||||
}
|
||||
|
@ -1,12 +1,14 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace osu.Game.Configuration
|
||||
{
|
||||
public enum RankingType
|
||||
{
|
||||
Local,
|
||||
[DisplayName("Global")]
|
||||
[Description("Global")]
|
||||
Top,
|
||||
[DisplayName("Selected Mods")]
|
||||
[Description("Selected Mods")]
|
||||
SelectedMod,
|
||||
Friends,
|
||||
Country
|
||||
|
@ -1,12 +1,14 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace osu.Game.Configuration
|
||||
{
|
||||
public enum ScreenshotFormat
|
||||
{
|
||||
Bmp = 0, // TODO: Figure out the best way to hide this from the dropdown
|
||||
[DisplayName("JPG (web-friendly)")]
|
||||
[Description("JPG (web-friendly)")]
|
||||
Jpg = 1,
|
||||
[DisplayName("PNG (lossless)")]
|
||||
[Description("PNG (lossless)")]
|
||||
Png = 2
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using OpenTK.Graphics;
|
||||
@ -56,7 +57,7 @@ namespace osu.Game.Overlays.Options
|
||||
AutoSizeAxes = Axes.Y;
|
||||
var items = typeof(T).GetFields().Where(f => !f.IsSpecialName).Zip(
|
||||
(T[])Enum.GetValues(typeof(T)), (a, b) => new Tuple<string, T>(
|
||||
a.GetCustomAttribute<DisplayNameAttribute>()?.Name ?? a.Name, b));
|
||||
a.GetCustomAttribute<DescriptionAttribute>()?.Description ?? a.Name, b));
|
||||
Children = new Drawable[]
|
||||
{
|
||||
text = new SpriteText { Alpha = 0 },
|
||||
|
@ -22,7 +22,7 @@ namespace osu.Game.Overlays.Options.General
|
||||
{
|
||||
new DropdownOption<ReleaseStream>
|
||||
{
|
||||
Label = "Release stream",
|
||||
LabelText = "Release stream",
|
||||
Bindable = config.GetBindable<ReleaseStream>(OsuConfig.ReleaseStream),
|
||||
},
|
||||
new SpriteText { Text = "Your osu! is up to date" }, // TODO: map this to reality
|
||||
|
@ -225,7 +225,6 @@
|
||||
<Compile Include="Overlays\Options\SliderOption.cs" />
|
||||
<Compile Include="Configuration\ProgressBarType.cs" />
|
||||
<Compile Include="Overlays\Options\DropdownOption.cs" />
|
||||
<Compile Include="Configuration\DisplayNameAttribute.cs" />
|
||||
<Compile Include="Configuration\RankingType.cs" />
|
||||
<Compile Include="Configuration\ScoreMeterType.cs" />
|
||||
<Compile Include="Configuration\ReleaseStream.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user