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