1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 03:02:54 +08:00

Merge pull request #303 from peppy/options-refactor

Global shadows and more sane font size setting.
This commit is contained in:
Dean Herbert 2017-02-03 13:20:51 +09:00 committed by GitHub
commit 3f9b5ee6cb
63 changed files with 495 additions and 386 deletions

View File

@ -14,6 +14,7 @@ using osu.Game.Graphics.UserInterface;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Beatmaps.Drawables namespace osu.Game.Beatmaps.Drawables
{ {
@ -102,7 +103,7 @@ namespace osu.Game.Beatmaps.Drawables
Spacing = new Vector2(4, 0), Spacing = new Vector2(4, 0),
Children = new[] Children = new[]
{ {
new SpriteText new OsuSpriteText
{ {
Font = @"Exo2.0-Medium", Font = @"Exo2.0-Medium",
Text = beatmap.Version, Text = beatmap.Version,
@ -110,7 +111,7 @@ namespace osu.Game.Beatmaps.Drawables
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft Origin = Anchor.BottomLeft
}, },
new SpriteText new OsuSpriteText
{ {
Font = @"Exo2.0-Medium", Font = @"Exo2.0-Medium",
Text = "mapped by", Text = "mapped by",
@ -118,7 +119,7 @@ namespace osu.Game.Beatmaps.Drawables
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft Origin = Anchor.BottomLeft
}, },
new SpriteText new OsuSpriteText
{ {
Font = @"Exo2.0-MediumItalic", Font = @"Exo2.0-MediumItalic",
Text = $"{(beatmap.Metadata ?? beatmap.BeatmapSet.Metadata).Author}", Text = $"{(beatmap.Metadata ?? beatmap.BeatmapSet.Metadata).Author}",

View File

@ -12,6 +12,7 @@ using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
@ -43,14 +44,14 @@ namespace osu.Game.Beatmaps.Drawables
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Children = new[] Children = new[]
{ {
title = new SpriteText title = new OsuSpriteText
{ {
Font = @"Exo2.0-BoldItalic", Font = @"Exo2.0-BoldItalic",
Text = beatmap.BeatmapSetInfo.Metadata.Title, Text = beatmap.BeatmapSetInfo.Metadata.Title,
TextSize = 22, TextSize = 22,
Shadow = true, Shadow = true,
}, },
artist = new SpriteText artist = new OsuSpriteText
{ {
Margin = new MarginPadding { Top = -1 }, Margin = new MarginPadding { Top = -1 },
Font = @"Exo2.0-SemiBoldItalic", Font = @"Exo2.0-SemiBoldItalic",

View File

@ -0,0 +1,18 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics.Sprites;
namespace osu.Game.Graphics.Sprites
{
class OsuSpriteText : SpriteText
{
public const float FONT_SIZE = 16;
public OsuSpriteText()
{
Shadow = true;
TextSize = FONT_SIZE;
}
}
}

View File

@ -4,6 +4,7 @@
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
{ {

View File

@ -5,31 +5,81 @@ using System;
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
{ {
public class OsuButton : Button public class OsuButton : Button
{ {
private Box hover;
public OsuButton() public OsuButton()
{ {
Height = 40; Height = 40;
} }
protected override SpriteText CreateText() => new OsuSpriteText
{
Depth = -1,
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Font = @"Exo2.0-Bold",
};
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
Colour = colours.BlueDark; Colour = colours.BlueDark;
Masking = true;
CornerRadius = 5; Content.Masking = true;
Content.CornerRadius = 5;
Add(new Triangles Add(new Drawable[]
{ {
RelativeSizeAxes = Axes.Both, new Triangles
ColourDark = colours.BlueDarker, {
ColourLight = colours.Blue, RelativeSizeAxes = Axes.Both,
ColourDark = colours.BlueDarker,
ColourLight = colours.Blue,
},
hover = new Box
{
RelativeSizeAxes = Axes.Both,
BlendingMode = BlendingMode.Additive,
Colour = Color4.White.Opacity(0.1f),
Alpha = 0,
},
}); });
} }
protected override bool OnHover(InputState state)
{
hover.FadeIn(200);
return base.OnHover(state);
}
protected override void OnHoverLost(InputState state)
{
hover.FadeOut(200);
base.OnHoverLost(state);
}
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{
Content.ScaleTo(0.9f, 4000, EasingTypes.OutQuint);
return base.OnMouseDown(state, args);
}
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
{
Content.ScaleTo(1, 1000, EasingTypes.OutElastic);
return base.OnMouseUp(state, args);
}
} }
} }

View File

@ -13,14 +13,15 @@ using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.Transformations;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Framework.Input;
using osu.Game.Graphics;
namespace osu.Game.Overlays.Options namespace osu.Game.Graphics.UserInterface
{ {
public class CheckBoxOption : CheckBox public class OsuCheckbox : CheckBox
{ {
private Bindable<bool> bindable; private Bindable<bool> bindable;
@ -70,15 +71,15 @@ namespace osu.Game.Overlays.Options
private AudioSample sampleChecked; private AudioSample sampleChecked;
private AudioSample sampleUnchecked; private AudioSample sampleUnchecked;
public CheckBoxOption() public OsuCheckbox()
{ {
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Children = new Drawable[] Children = new Drawable[]
{ {
labelSpriteText = new SpriteText(), labelSpriteText = new OsuSpriteText(),
light = new Light() light = new Light
{ {
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
@ -145,7 +146,7 @@ namespace osu.Game.Overlays.Options
public Light() public Light()
{ {
Size = new Vector2(40, 12); Size = new Vector2(20, 12);
Masking = true; Masking = true;
@ -187,11 +188,13 @@ namespace osu.Game.Overlays.Options
{ {
if (value) if (value)
{ {
ResizeTo(new Vector2(40, 12), 500, EasingTypes.OutQuint);
FadeColour(glowingColour, 500, EasingTypes.OutQuint); FadeColour(glowingColour, 500, EasingTypes.OutQuint);
FadeGlowTo(1, 500, EasingTypes.OutQuint); FadeGlowTo(1, 500, EasingTypes.OutQuint);
} }
else else
{ {
ResizeTo(new Vector2(20, 12), 500, EasingTypes.OutQuint);
FadeGlowTo(0, 500); FadeGlowTo(0, 500);
FadeColour(idleColour, 500); FadeColour(idleColour, 500);
} }

View File

@ -5,16 +5,22 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
using OpenTK.Graphics; using OpenTK.Graphics;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
{ {
public class OsuTextBox : TextBox public class OsuTextBox : TextBox
{ {
protected override Color4 BackgroundUnfocused => Color4.Black.Opacity(0.5f);
protected override Color4 BackgroundFocused => OsuColour.Gray(0.3f).Opacity(0.8f);
protected override Color4 BackgroundCommit => BorderColour;
public OsuTextBox() public OsuTextBox()
{ {
Height = 40; Height = 40;
TextContainer.Height = 0.6f; TextContainer.Height = OsuSpriteText.FONT_SIZE / Height;
CornerRadius = 5; CornerRadius = 5;
} }

View File

@ -8,6 +8,7 @@ using osu.Framework.Graphics.Transformations;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
{ {
@ -106,7 +107,7 @@ namespace osu.Game.Graphics.UserInterface
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
DisplayedCountSpriteText = new SpriteText(), DisplayedCountSpriteText = new OsuSpriteText(),
}; };
TextSize = 40; TextSize = 40;

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics.Transformations;
using osu.Framework.Input; using osu.Framework.Input;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
{ {
@ -131,7 +132,7 @@ namespace osu.Game.Graphics.UserInterface
}, },
} }
}, },
text = new SpriteText text = new OsuSpriteText
{ {
Origin = Anchor.Centre, Origin = Anchor.Centre,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,

View File

@ -8,6 +8,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.Transformations;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Game.Graphics.Sprites;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
@ -51,7 +52,7 @@ namespace osu.Game.Graphics.UserInterface.Volume
} }
} }
}, },
new SpriteText new OsuSpriteText
{ {
Text = meterName, Text = meterName,
Anchor = Anchor.BottomCentre, Anchor = Anchor.BottomCentre,

View File

@ -7,6 +7,7 @@ using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.Transformations;
using osu.Framework.MathUtils; using osu.Framework.MathUtils;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Modes.UI namespace osu.Game.Modes.UI
{ {
@ -100,11 +101,11 @@ namespace osu.Game.Modes.UI
Children = new Drawable[] Children = new Drawable[]
{ {
DisplayedCountSpriteText = new SpriteText DisplayedCountSpriteText = new OsuSpriteText
{ {
Alpha = 0, Alpha = 0,
}, },
PopOutCount = new SpriteText PopOutCount = new OsuSpriteText
{ {
Alpha = 0, Alpha = 0,
Margin = new MarginPadding(0.05f), Margin = new MarginPadding(0.05f),

View File

@ -8,6 +8,7 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.Sprites;
using OpenTK; using OpenTK;
namespace osu.Game.Online.Chat.Drawables namespace osu.Game.Online.Chat.Drawables
@ -27,7 +28,7 @@ namespace osu.Game.Online.Chat.Drawables
Children = new Drawable[] Children = new Drawable[]
{ {
new SpriteText new OsuSpriteText
{ {
Text = channel.Name, Text = channel.Name,
TextSize = 50, TextSize = 50,

View File

@ -5,6 +5,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.Sprites;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
@ -31,13 +32,13 @@ namespace osu.Game.Online.Chat.Drawables
Size = new Vector2(padding, text_size), Size = new Vector2(padding, text_size),
Children = new Drawable[] Children = new Drawable[]
{ {
new SpriteText new OsuSpriteText
{ {
Text = Message.Timestamp.LocalDateTime.ToLongTimeString(), Text = Message.Timestamp.LocalDateTime.ToLongTimeString(),
TextSize = text_size, TextSize = text_size,
Colour = Color4.Gray Colour = Color4.Gray
}, },
new SpriteText new OsuSpriteText
{ {
Text = Message.User.Name, Text = Message.User.Name,
TextSize = text_size, TextSize = text_size,
@ -53,7 +54,7 @@ namespace osu.Game.Online.Chat.Drawables
Padding = new MarginPadding { Left = padding + 10 }, Padding = new MarginPadding { Left = padding + 10 },
Children = new Drawable[] Children = new Drawable[]
{ {
new SpriteText new OsuSpriteText
{ {
Text = Message.Content, Text = Message.Content,
TextSize = text_size, TextSize = text_size,

View File

@ -14,6 +14,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.Transformations;
using osu.Framework.Threading; using osu.Framework.Threading;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Online.API.Requests; using osu.Game.Online.API.Requests;
using osu.Game.Online.Chat; using osu.Game.Online.Chat;
@ -137,7 +138,7 @@ namespace osu.Game.Overlays
// return; // return;
SpriteText loading; SpriteText loading;
Add(loading = new SpriteText Add(loading = new OsuSpriteText
{ {
Text = @"Loading available channels...", Text = @"Loading available channels...",
Anchor = Anchor.Centre, Anchor = Anchor.Centre,

View File

@ -8,7 +8,7 @@ using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.Transformations;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Overlays.Options.General; using osu.Game.Overlays.Options.Sections.General;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
@ -33,7 +33,7 @@ namespace osu.Game.Overlays
new Box { new Box {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = Color4.Black, Colour = Color4.Black,
Alpha = 0.8f, Alpha = 0.6f,
}, },
new Container new Container
{ {

View File

@ -23,6 +23,7 @@ using osu.Game.Configuration;
using osu.Game.Database; using osu.Game.Database;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Primitives;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays namespace osu.Game.Overlays
{ {
@ -95,7 +96,7 @@ namespace osu.Game.Overlays
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Children = new Drawable[] Children = new Drawable[]
{ {
title = new SpriteText title = new OsuSpriteText
{ {
Origin = Anchor.BottomCentre, Origin = Anchor.BottomCentre,
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
@ -105,7 +106,7 @@ namespace osu.Game.Overlays
Text = @"Nothing to play", Text = @"Nothing to play",
Font = @"Exo2.0-MediumItalic" Font = @"Exo2.0-MediumItalic"
}, },
artist = new SpriteText artist = new OsuSpriteText
{ {
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,

View File

@ -12,16 +12,16 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Options
{ {
public class DropdownOption<T> : FlowContainer public class OptionDropdown<T> : FlowContainer
{ {
private DropDownMenu<T> dropdown; private DropDownMenu<T> dropdown;
private SpriteText text; private SpriteText text;
public string LabelText public string LabelText
{ {
get { return text.Text; } get { return text.Text; }
@ -31,7 +31,7 @@ namespace osu.Game.Overlays.Options
text.Alpha = string.IsNullOrEmpty(value) ? 0 : 1; text.Alpha = string.IsNullOrEmpty(value) ? 0 : 1;
} }
} }
public Bindable<T> Bindable public Bindable<T> Bindable
{ {
get { return bindable; } get { return bindable; }
@ -56,7 +56,7 @@ namespace osu.Game.Overlays.Options
{ {
bindable.Value = dropdown.SelectedValue; bindable.Value = dropdown.SelectedValue;
} }
protected override void Dispose(bool isDisposing) protected override void Dispose(bool isDisposing)
{ {
bindable.ValueChanged -= Bindable_ValueChanged; bindable.ValueChanged -= Bindable_ValueChanged;
@ -64,7 +64,7 @@ namespace osu.Game.Overlays.Options
base.Dispose(isDisposing); base.Dispose(isDisposing);
} }
public DropdownOption() public OptionDropdown()
{ {
if (!typeof(T).IsEnum) if (!typeof(T).IsEnum)
throw new InvalidOperationException("OptionsDropdown only supports enums as the generic type argument"); throw new InvalidOperationException("OptionsDropdown only supports enums as the generic type argument");
@ -73,7 +73,9 @@ namespace osu.Game.Overlays.Options
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Children = new Drawable[] Children = new Drawable[]
{ {
text = new SpriteText { Alpha = 0 }, text = new OsuSpriteText {
Alpha = 0,
},
dropdown = new StyledDropDownMenu<T> dropdown = new StyledDropDownMenu<T>
{ {
Margin = new MarginPadding { Top = 5 }, Margin = new MarginPadding { Top = 5 },
@ -83,7 +85,7 @@ namespace osu.Game.Overlays.Options
}; };
dropdown.ValueChanged += Dropdown_ValueChanged; dropdown.ValueChanged += Dropdown_ValueChanged;
} }
private class StyledDropDownMenu<U> : DropDownMenu<U> private class StyledDropDownMenu<U> : DropDownMenu<U>
{ {
protected override float DropDownListSpacing => 4; protected override float DropDownListSpacing => 4;
@ -92,7 +94,7 @@ namespace osu.Game.Overlays.Options
{ {
return new StyledDropDownComboBox(); return new StyledDropDownComboBox();
} }
protected override IEnumerable<DropDownMenuItem<U>> GetDropDownItems(IEnumerable<U> values) protected override IEnumerable<DropDownMenuItem<U>> GetDropDownItems(IEnumerable<U> values)
{ {
return values.Select(v => return values.Select(v =>
@ -101,7 +103,7 @@ namespace osu.Game.Overlays.Options
return new StyledDropDownMenuItem<U>( return new StyledDropDownMenuItem<U>(
field.GetCustomAttribute<DescriptionAttribute>()?.Description ?? field.Name, v); field.GetCustomAttribute<DescriptionAttribute>()?.Description ?? field.Name, v);
}); });
} }
public StyledDropDownMenu() public StyledDropDownMenu()
@ -143,9 +145,16 @@ namespace osu.Game.Overlays.Options
{ {
Foreground.Padding = new MarginPadding(4); Foreground.Padding = new MarginPadding(4);
AutoSizeAxes = Axes.None;
Height = 40;
Children = new[] Children = new[]
{ {
label = new SpriteText(), label = new OsuSpriteText
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
},
new TextAwesome new TextAwesome
{ {
Icon = FontAwesome.fa_chevron_down, Icon = FontAwesome.fa_chevron_down,
@ -185,11 +194,16 @@ namespace osu.Game.Overlays.Options
{ {
Icon = FontAwesome.fa_chevron_right, Icon = FontAwesome.fa_chevron_right,
Colour = Color4.Black, Colour = Color4.Black,
TextSize = 12,
Margin = new MarginPadding { Right = 3 }, Margin = new MarginPadding { Right = 3 },
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
}, },
new SpriteText { Text = text } new OsuSpriteText {
Text = text,
Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft,
}
} }
} }
}; };

View File

@ -0,0 +1,19 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options
{
class OptionLabel : OsuSpriteText
{
[BackgroundDependencyLoader]
private void load(OsuColour colour)
{
Colour = colour.Gray6;
}
}
}

View File

@ -18,10 +18,11 @@ using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Game.Graphics; using osu.Game.Graphics;
using System.Linq; using System.Linq;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Options
{ {
public class SliderOption<T> : FlowContainer where T : struct public class OptionSlider<T> : FlowContainer where T : struct
{ {
private SliderBar<T> slider; private SliderBar<T> slider;
private SpriteText text; private SpriteText text;
@ -42,14 +43,16 @@ namespace osu.Game.Overlays.Options
set { slider.Bindable = value; } set { slider.Bindable = value; }
} }
public SliderOption() public OptionSlider()
{ {
Direction = FlowDirection.VerticalOnly; Direction = FlowDirection.VerticalOnly;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Children = new Drawable[] Children = new Drawable[]
{ {
text = new SpriteText { Alpha = 0 }, text = new OsuSpriteText {
Alpha = 0,
},
slider = new OsuSliderBar<T> slider = new OsuSliderBar<T>
{ {
Margin = new MarginPadding { Top = 5 }, Margin = new MarginPadding { Top = 5 },
@ -76,7 +79,7 @@ namespace osu.Game.Overlays.Options
public OsuSliderBar() public OsuSliderBar()
{ {
Height = 22; Height = 20;
Padding = new MarginPadding { Left = Height / 2, Right = Height / 2 }; Padding = new MarginPadding { Left = Height / 2, Right = Height / 2 };
Children = new Drawable[] Children = new Drawable[]
{ {

View File

@ -8,7 +8,7 @@ using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Options
{ {
public class TextBoxOption : OsuTextBox public class OptionTextBox : OsuTextBox
{ {
private Bindable<string> bindable; private Bindable<string> bindable;

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Options
{ {
@ -51,7 +52,7 @@ namespace osu.Game.Overlays.Options
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Children = new[] Children = new[]
{ {
headerLabel = new SpriteText headerLabel = new OsuSpriteText
{ {
TextSize = headerSize, TextSize = headerSize,
Text = Header, Text = Header,
@ -60,7 +61,7 @@ namespace osu.Game.Overlays.Options
{ {
Margin = new MarginPadding { Top = headerSize + headerMargin }, Margin = new MarginPadding { Top = headerSize + headerMargin },
Direction = FlowDirection.VerticalOnly, Direction = FlowDirection.VerticalOnly,
Spacing = new Vector2(0, 50), Spacing = new Vector2(0, 30),
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
}, },
@ -72,7 +73,7 @@ namespace osu.Game.Overlays.Options
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
headerLabel.Colour = colours.Pink; headerLabel.Colour = colours.Yellow;
} }
} }
} }

View File

@ -1,14 +1,16 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK; using OpenTK;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Options
{ {
public abstract class OptionsSubsection : Container public abstract class OptionsSubsection : FlowContainer
{ {
private Container<Drawable> content; private Container<Drawable> content;
protected override Container<Drawable> Content => content; protected override Container<Drawable> Content => content;
@ -19,23 +21,21 @@ namespace osu.Game.Overlays.Options
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Direction = FlowDirection.VerticalOnly;
AddInternal(new Drawable[] AddInternal(new Drawable[]
{ {
new OsuSpriteText
{
Text = Header.ToUpper(),
Margin = new MarginPadding { Bottom = 10 },
Font = @"Exo2.0-Black",
},
content = new FlowContainer content = new FlowContainer
{ {
Direction = FlowDirection.VerticalOnly, Direction = FlowDirection.VerticalOnly,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Spacing = new Vector2(0, 5), Spacing = new Vector2(0, 5),
Children = new[]
{
new SpriteText
{
TextSize = 17,
Text = Header.ToUpper(),
Font = @"Exo2.0-Black",
}
}
}, },
}); });
} }

View File

@ -1,9 +1,7 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics.Sprites; namespace osu.Game.Overlays.Options.Sections.Audio
namespace osu.Game.Overlays.Options.Audio
{ {
public class AudioDevicesOptions : OptionsSubsection public class AudioDevicesOptions : OptionsSubsection
{ {
@ -13,7 +11,7 @@ namespace osu.Game.Overlays.Options.Audio
{ {
Children = new[] Children = new[]
{ {
new SpriteText { Text = "Output device: TODO dropdown" } new OptionLabel { Text = "Output device: TODO dropdown" }
}; };
} }
} }

View File

@ -1,16 +1,15 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Game.Configuration;
using osu.Game.Configuration; using osu.Game.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Sections.Audio
namespace osu.Game.Overlays.Options.Audio
{ {
public class OffsetAdjustmentOptions : OptionsSubsection public class OffsetOptions : OptionsSubsection
{ {
protected override string Header => "Offset Adjustment"; protected override string Header => "Offset Adjustment";
@ -19,7 +18,7 @@ namespace osu.Game.Overlays.Options.Audio
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new SliderOption<int> new OptionSlider<int>
{ {
LabelText = "Universal Offset", LabelText = "Universal Offset",
Bindable = (BindableInt)config.GetBindable<int>(OsuConfig.Offset) Bindable = (BindableInt)config.GetBindable<int>(OsuConfig.Offset)

View File

@ -1,15 +1,13 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Audio namespace osu.Game.Overlays.Options.Sections.Audio
{ {
public class VolumeOptions : OptionsSubsection public class VolumeOptions : OptionsSubsection
{ {
@ -20,10 +18,10 @@ namespace osu.Game.Overlays.Options.Audio
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new SliderOption<double> { LabelText = "Master", Bindable = audio.Volume }, new OptionSlider<double> { LabelText = "Master", Bindable = audio.Volume },
new SliderOption<double> { LabelText = "Effect", Bindable = audio.VolumeSample }, new OptionSlider<double> { LabelText = "Effect", Bindable = audio.VolumeSample },
new SliderOption<double> { LabelText = "Music", Bindable = audio.VolumeTrack }, new OptionSlider<double> { LabelText = "Music", Bindable = audio.VolumeTrack },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Ignore beatmap hitsounds", LabelText = "Ignore beatmap hitsounds",
Bindable = config.GetBindable<bool>(OsuConfig.IgnoreBeatmapSamples) Bindable = config.GetBindable<bool>(OsuConfig.IgnoreBeatmapSamples)

View File

@ -1,11 +1,12 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework; using osu.Framework;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Audio;
namespace osu.Game.Overlays.Options.Audio
namespace osu.Game.Overlays.Options.Sections
{ {
public class AudioSection : OptionsSection public class AudioSection : OptionsSection
{ {
@ -18,7 +19,7 @@ namespace osu.Game.Overlays.Options.Audio
{ {
new AudioDevicesOptions { Alpha = RuntimeInfo.IsWindows ? 1 : 0 }, new AudioDevicesOptions { Alpha = RuntimeInfo.IsWindows ? 1 : 0 },
new VolumeOptions(), new VolumeOptions(),
new OffsetAdjustmentOptions(), new OffsetOptions(),
}; };
} }
} }

View File

@ -1,15 +1,14 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using OpenTK;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Options.Sections
{ {
public class EditorSection : OptionsSection public class EditorSection : OptionsSection
{ {
@ -22,32 +21,32 @@ namespace osu.Game.Overlays.Options
content.Spacing = new Vector2(0, 5); content.Spacing = new Vector2(0, 5);
Children = new Drawable[] Children = new Drawable[]
{ {
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Background video", LabelText = "Background video",
Bindable = config.GetBindable<bool>(OsuConfig.VideoEditor) Bindable = config.GetBindable<bool>(OsuConfig.VideoEditor)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Always use default skin", LabelText = "Always use default skin",
Bindable = config.GetBindable<bool>(OsuConfig.EditorDefaultSkin) Bindable = config.GetBindable<bool>(OsuConfig.EditorDefaultSkin)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Snaking sliders", LabelText = "Snaking sliders",
Bindable = config.GetBindable<bool>(OsuConfig.EditorSnakingSliders) Bindable = config.GetBindable<bool>(OsuConfig.EditorSnakingSliders)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Hit animations", LabelText = "Hit animations",
Bindable = config.GetBindable<bool>(OsuConfig.EditorHitAnimations) Bindable = config.GetBindable<bool>(OsuConfig.EditorHitAnimations)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Follow points", LabelText = "Follow points",
Bindable = config.GetBindable<bool>(OsuConfig.EditorFollowPoints) Bindable = config.GetBindable<bool>(OsuConfig.EditorFollowPoints)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Stacking", LabelText = "Stacking",
Bindable = config.GetBindable<bool>(OsuConfig.EditorStacking) Bindable = config.GetBindable<bool>(OsuConfig.EditorStacking)

View File

@ -1,17 +1,15 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework; using osu.Framework.Allocation;
using osu.Framework.Allocation; using osu.Framework.Configuration;
using osu.Framework.Configuration; using osu.Framework.Graphics;
using osu.Framework.Graphics; using osu.Game.Configuration;
using osu.Framework.Graphics.Sprites; using osu.Game.Graphics.UserInterface;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; namespace osu.Game.Overlays.Options.Sections.Gameplay
namespace osu.Game.Overlays.Options.Gameplay
{ {
public class GeneralGameplayOptions : OptionsSubsection public class GeneralOptions : OptionsSubsection
{ {
protected override string Header => "General"; protected override string Header => "General";
@ -20,42 +18,42 @@ namespace osu.Game.Overlays.Options.Gameplay
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new SliderOption<int> new OptionSlider<int>
{ {
LabelText = "Background dim", LabelText = "Background dim",
Bindable = (BindableInt)config.GetBindable<int>(OsuConfig.DimLevel) Bindable = (BindableInt)config.GetBindable<int>(OsuConfig.DimLevel)
}, },
new DropdownOption<ProgressBarType> new OptionDropdown<ProgressBarType>
{ {
LabelText = "Progress display", LabelText = "Progress display",
Bindable = config.GetBindable<ProgressBarType>(OsuConfig.ProgressBarType) Bindable = config.GetBindable<ProgressBarType>(OsuConfig.ProgressBarType)
}, },
new DropdownOption<ScoreMeterType> new OptionDropdown<ScoreMeterType>
{ {
LabelText = "Score meter type", LabelText = "Score meter type",
Bindable = config.GetBindable<ScoreMeterType>(OsuConfig.ScoreMeter) Bindable = config.GetBindable<ScoreMeterType>(OsuConfig.ScoreMeter)
}, },
new SliderOption<double> new OptionSlider<double>
{ {
LabelText = "Score meter size", LabelText = "Score meter size",
Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.ScoreMeterScale) Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.ScoreMeterScale)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Always show key overlay", LabelText = "Always show key overlay",
Bindable = config.GetBindable<bool>(OsuConfig.KeyOverlay) Bindable = config.GetBindable<bool>(OsuConfig.KeyOverlay)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Show approach circle on first \"Hidden\" object", LabelText = "Show approach circle on first \"Hidden\" object",
Bindable = config.GetBindable<bool>(OsuConfig.HiddenShowFirstApproach) Bindable = config.GetBindable<bool>(OsuConfig.HiddenShowFirstApproach)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Scale osu!mania scroll speed with BPM", LabelText = "Scale osu!mania scroll speed with BPM",
Bindable = config.GetBindable<bool>(OsuConfig.ManiaSpeedBPMScale) Bindable = config.GetBindable<bool>(OsuConfig.ManiaSpeedBPMScale)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Remember osu!mania scroll speed per beatmap", LabelText = "Remember osu!mania scroll speed per beatmap",
Bindable = config.GetBindable<bool>(OsuConfig.UsePerBeatmapManiaSpeed) Bindable = config.GetBindable<bool>(OsuConfig.UsePerBeatmapManiaSpeed)

View File

@ -1,17 +1,14 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System; using osu.Framework.Allocation;
using osu.Framework.Allocation; using osu.Framework.Configuration;
using osu.Framework.Configuration; using osu.Framework.Graphics;
using osu.Framework.Graphics; using osu.Game.Configuration;
using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration; namespace osu.Game.Overlays.Options.Sections.Gameplay
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Gameplay
{ {
public class SongSelectGameplayOptions : OptionsSubsection public class SongSelectOptions : OptionsSubsection
{ {
protected override string Header => "Song Select"; protected override string Header => "Song Select";
@ -20,12 +17,12 @@ namespace osu.Game.Overlays.Options.Gameplay
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new SliderOption<double> new OptionSlider<double>
{ {
LabelText = "Display beatmaps from", LabelText = "Display beatmaps from",
Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.DisplayStarsMinimum) Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.DisplayStarsMinimum)
}, },
new SliderOption<double> new OptionSlider<double>
{ {
LabelText = "up to", LabelText = "up to",
Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.DisplayStarsMaximum) Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.DisplayStarsMaximum)

View File

@ -1,10 +1,11 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Gameplay;
namespace osu.Game.Overlays.Options.Gameplay
namespace osu.Game.Overlays.Options.Sections
{ {
public class GameplaySection : OptionsSection public class GameplaySection : OptionsSection
{ {
@ -13,10 +14,10 @@ namespace osu.Game.Overlays.Options.Gameplay
public GameplaySection() public GameplaySection()
{ {
Children = new Drawable[] base.Children = new Drawable[]
{ {
new GeneralGameplayOptions(), new Gameplay.GeneralOptions(),
new SongSelectGameplayOptions(), new SongSelectOptions(),
}; };
} }
} }

View File

@ -1,13 +1,12 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.General namespace osu.Game.Overlays.Options.Sections.General
{ {
public class LanguageOptions : OptionsSubsection public class LanguageOptions : OptionsSubsection
{ {
@ -18,13 +17,13 @@ namespace osu.Game.Overlays.Options.General
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new SpriteText { Text = "TODO: Dropdown" }, new OptionLabel { Text = "TODO: Dropdown" },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Prefer metadata in original language", LabelText = "Prefer metadata in original language",
Bindable = config.GetBindable<bool>(OsuConfig.ShowUnicode) Bindable = config.GetBindable<bool>(OsuConfig.ShowUnicode)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Use alternative font for chat display", LabelText = "Use alternative font for chat display",
Bindable = config.GetBindable<bool>(OsuConfig.AlternativeChatFont) Bindable = config.GetBindable<bool>(OsuConfig.AlternativeChatFont)

View File

@ -1,20 +1,19 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using OpenTK;
using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API; using osu.Game.Online.API;
using osu.Game.Configuration; using OpenTK;
using osu.Framework.Graphics.Primitives;
namespace osu.Game.Overlays.Options.General namespace osu.Game.Overlays.Options.Sections.General
{ {
public class LoginOptions : OptionsSubsection, IOnlineComponent public class LoginOptions : OptionsSubsection, IOnlineComponent
{ {
@ -53,7 +52,7 @@ namespace osu.Game.Overlays.Options.General
case APIState.Failing: case APIState.Failing:
Children = new Drawable[] Children = new Drawable[]
{ {
new SpriteText new OsuSpriteText
{ {
Text = "Connection failing :(", Text = "Connection failing :(",
}, },
@ -62,7 +61,7 @@ namespace osu.Game.Overlays.Options.General
case APIState.Connecting: case APIState.Connecting:
Children = new Drawable[] Children = new Drawable[]
{ {
new SpriteText new OsuSpriteText
{ {
Text = "Connecting...", Text = "Connecting...",
}, },
@ -71,7 +70,7 @@ namespace osu.Game.Overlays.Options.General
case APIState.Online: case APIState.Online:
Children = new Drawable[] Children = new Drawable[]
{ {
new SpriteText new OsuSpriteText
{ {
Text = $"Connected as {api.Username}!", Text = $"Connected as {api.Username}!",
}, },
@ -92,8 +91,8 @@ namespace osu.Game.Overlays.Options.General
private TextBox password; private TextBox password;
private APIAccess api; private APIAccess api;
private CheckBoxOption saveUsername; private OsuCheckbox saveUsername;
private CheckBoxOption savePassword; private OsuCheckbox savePassword;
private void performLogin() private void performLogin()
{ {
@ -111,23 +110,21 @@ namespace osu.Game.Overlays.Options.General
Spacing = new Vector2(0, 5); Spacing = new Vector2(0, 5);
Children = new Drawable[] Children = new Drawable[]
{ {
new SpriteText { Text = "Username" },
username = new OsuTextBox username = new OsuTextBox
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Text = api?.Username ?? string.Empty Text = api?.Username ?? string.Empty
}, },
new SpriteText { Text = "Password" },
password = new OsuPasswordTextBox password = new OsuPasswordTextBox
{ {
RelativeSizeAxes = Axes.X RelativeSizeAxes = Axes.X
}, },
saveUsername = new CheckBoxOption saveUsername = new OsuCheckbox
{ {
LabelText = "Remember username", LabelText = "Remember username",
Bindable = config.GetBindable<bool>(OsuConfig.SaveUsername), Bindable = config.GetBindable<bool>(OsuConfig.SaveUsername),
}, },
savePassword = new CheckBoxOption savePassword = new OsuCheckbox
{ {
LabelText = "Stay logged in", LabelText = "Stay logged in",
Bindable = config.GetBindable<bool>(OsuConfig.SavePassword), Bindable = config.GetBindable<bool>(OsuConfig.SavePassword),

View File

@ -1,15 +1,13 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Platform; using osu.Framework.Platform;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.General namespace osu.Game.Overlays.Options.Sections.General
{ {
public class UpdateOptions : OptionsSubsection public class UpdateOptions : OptionsSubsection
{ {
@ -20,12 +18,12 @@ namespace osu.Game.Overlays.Options.General
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new DropdownOption<ReleaseStream> new OptionDropdown<ReleaseStream>
{ {
LabelText = "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 OptionLabel { Text = "Your osu! is up to date" }, // TODO: map this to reality
new OsuButton new OsuButton
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,

View File

@ -1,10 +1,11 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.General;
namespace osu.Game.Overlays.Options.General
namespace osu.Game.Overlays.Options.Sections
{ {
public class GeneralSection : OptionsSection public class GeneralSection : OptionsSection
{ {

View File

@ -3,10 +3,10 @@
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Graphics namespace osu.Game.Overlays.Options.Sections.Graphics
{ {
public class DetailOptions : OptionsSubsection public class DetailOptions : OptionsSubsection
{ {
@ -17,47 +17,47 @@ namespace osu.Game.Overlays.Options.Graphics
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Snaking in sliders", LabelText = "Snaking in sliders",
Bindable = config.GetBindable<bool>(OsuConfig.SnakingInSliders) Bindable = config.GetBindable<bool>(OsuConfig.SnakingInSliders)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Snaking out sliders", LabelText = "Snaking out sliders",
Bindable = config.GetBindable<bool>(OsuConfig.SnakingOutSliders) Bindable = config.GetBindable<bool>(OsuConfig.SnakingOutSliders)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Background video", LabelText = "Background video",
Bindable = config.GetBindable<bool>(OsuConfig.Video) Bindable = config.GetBindable<bool>(OsuConfig.Video)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Storyboards", LabelText = "Storyboards",
Bindable = config.GetBindable<bool>(OsuConfig.ShowStoryboard) Bindable = config.GetBindable<bool>(OsuConfig.ShowStoryboard)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Combo bursts", LabelText = "Combo bursts",
Bindable = config.GetBindable<bool>(OsuConfig.ComboBurst) Bindable = config.GetBindable<bool>(OsuConfig.ComboBurst)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Hit lighting", LabelText = "Hit lighting",
Bindable = config.GetBindable<bool>(OsuConfig.HitLighting) Bindable = config.GetBindable<bool>(OsuConfig.HitLighting)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Shaders", LabelText = "Shaders",
Bindable = config.GetBindable<bool>(OsuConfig.Bloom) Bindable = config.GetBindable<bool>(OsuConfig.Bloom)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Softening filter", LabelText = "Softening filter",
Bindable = config.GetBindable<bool>(OsuConfig.BloomSoftening) Bindable = config.GetBindable<bool>(OsuConfig.BloomSoftening)
}, },
new DropdownOption<ScreenshotFormat> new OptionDropdown<ScreenshotFormat>
{ {
LabelText = "Screenshot", LabelText = "Screenshot",
Bindable = config.GetBindable<ScreenshotFormat>(OsuConfig.ScreenshotFormat) Bindable = config.GetBindable<ScreenshotFormat>(OsuConfig.ScreenshotFormat)

View File

@ -1,15 +1,12 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Game.Graphics.UserInterface;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Graphics namespace osu.Game.Overlays.Options.Sections.Graphics
{ {
public class LayoutOptions : OptionsSubsection public class LayoutOptions : OptionsSubsection
{ {
@ -20,23 +17,23 @@ namespace osu.Game.Overlays.Options.Graphics
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new SpriteText { Text = "Resolution: TODO dropdown" }, new OptionLabel { Text = "Resolution: TODO dropdown" },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Fullscreen mode", LabelText = "Fullscreen mode",
Bindable = config.GetBindable<bool>(FrameworkConfig.Fullscreen), Bindable = config.GetBindable<bool>(FrameworkConfig.Fullscreen),
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Letterboxing", LabelText = "Letterboxing",
Bindable = config.GetBindable<bool>(FrameworkConfig.Letterboxing), Bindable = config.GetBindable<bool>(FrameworkConfig.Letterboxing),
}, },
new SliderOption<int> new OptionSlider<int>
{ {
LabelText = "Horizontal position", LabelText = "Horizontal position",
Bindable = (BindableInt)config.GetBindable<int>(FrameworkConfig.LetterboxPositionX) Bindable = (BindableInt)config.GetBindable<int>(FrameworkConfig.LetterboxPositionX)
}, },
new SliderOption<int> new OptionSlider<int>
{ {
LabelText = "Vertical position", LabelText = "Vertical position",
Bindable = (BindableInt)config.GetBindable<int>(FrameworkConfig.LetterboxPositionY) Bindable = (BindableInt)config.GetBindable<int>(FrameworkConfig.LetterboxPositionY)

View File

@ -1,12 +1,11 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Graphics namespace osu.Game.Overlays.Options.Sections.Graphics
{ {
public class MainMenuOptions : OptionsSubsection public class MainMenuOptions : OptionsSubsection
{ {
@ -17,27 +16,27 @@ namespace osu.Game.Overlays.Options.Graphics
{ {
Children = new[] Children = new[]
{ {
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Snow", LabelText = "Snow",
Bindable = config.GetBindable<bool>(OsuConfig.MenuSnow) Bindable = config.GetBindable<bool>(OsuConfig.MenuSnow)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Parallax", LabelText = "Parallax",
Bindable = config.GetBindable<bool>(OsuConfig.MenuParallax) Bindable = config.GetBindable<bool>(OsuConfig.MenuParallax)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Menu tips", LabelText = "Menu tips",
Bindable = config.GetBindable<bool>(OsuConfig.ShowMenuTips) Bindable = config.GetBindable<bool>(OsuConfig.ShowMenuTips)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Interface voices", LabelText = "Interface voices",
Bindable = config.GetBindable<bool>(OsuConfig.MenuVoice) Bindable = config.GetBindable<bool>(OsuConfig.MenuVoice)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "osu! music theme", LabelText = "osu! music theme",
Bindable = config.GetBindable<bool>(OsuConfig.MenuMusic) Bindable = config.GetBindable<bool>(OsuConfig.MenuMusic)

View File

@ -1,15 +1,13 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Graphics namespace osu.Game.Overlays.Options.Sections.Graphics
{ {
public class RendererOptions : OptionsSubsection public class RendererOptions : OptionsSubsection
{ {
@ -22,22 +20,22 @@ namespace osu.Game.Overlays.Options.Graphics
Children = new Drawable[] Children = new Drawable[]
{ {
// TODO: this needs to be a custom dropdown at some point // TODO: this needs to be a custom dropdown at some point
new DropdownOption<FrameSync> new OptionDropdown<FrameSync>
{ {
LabelText = "Frame limiter", LabelText = "Frame limiter",
Bindable = config.GetBindable<FrameSync>(FrameworkConfig.FrameSync) Bindable = config.GetBindable<FrameSync>(FrameworkConfig.FrameSync)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Show FPS counter", LabelText = "Show FPS counter",
Bindable = osuConfig.GetBindable<bool>(OsuConfig.FpsCounter), Bindable = osuConfig.GetBindable<bool>(OsuConfig.FpsCounter),
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Reduce dropped frames", LabelText = "Reduce dropped frames",
Bindable = osuConfig.GetBindable<bool>(OsuConfig.ForceFrameFlush), Bindable = osuConfig.GetBindable<bool>(OsuConfig.ForceFrameFlush),
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Detect performance issues", LabelText = "Detect performance issues",
Bindable = osuConfig.GetBindable<bool>(OsuConfig.DetectPerformanceIssues), Bindable = osuConfig.GetBindable<bool>(OsuConfig.DetectPerformanceIssues),

View File

@ -1,12 +1,11 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Graphics namespace osu.Game.Overlays.Options.Sections.Graphics
{ {
public class SongSelectGraphicsOptions : OptionsSubsection public class SongSelectGraphicsOptions : OptionsSubsection
{ {
@ -17,7 +16,7 @@ namespace osu.Game.Overlays.Options.Graphics
{ {
Children = new[] Children = new[]
{ {
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Show thumbnails", LabelText = "Show thumbnails",
Bindable = config.GetBindable<bool>(OsuConfig.SongSelectThumbnails) Bindable = config.GetBindable<bool>(OsuConfig.SongSelectThumbnails)

View File

@ -1,10 +1,11 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Graphics;
namespace osu.Game.Overlays.Options.Graphics
namespace osu.Game.Overlays.Options.Sections
{ {
public class GraphicsSection : OptionsSection public class GraphicsSection : OptionsSection
{ {

View File

@ -1,10 +1,10 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Input namespace osu.Game.Overlays.Options.Sections.Input
{ {
public class KeyboardOptions : OptionsSubsection public class KeyboardOptions : OptionsSubsection
{ {

View File

@ -1,15 +1,13 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Input namespace osu.Game.Overlays.Options.Sections.Input
{ {
public class MouseOptions : OptionsSubsection public class MouseOptions : OptionsSubsection
{ {
@ -20,37 +18,37 @@ namespace osu.Game.Overlays.Options.Input
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new SliderOption<double> new OptionSlider<double>
{ {
LabelText = "Sensitivity", LabelText = "Sensitivity",
Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.MouseSpeed), Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.MouseSpeed),
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Raw input", LabelText = "Raw input",
Bindable = config.GetBindable<bool>(OsuConfig.RawInput) Bindable = config.GetBindable<bool>(OsuConfig.RawInput)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Map absolute raw input to the osu! window", LabelText = "Map absolute raw input to the osu! window",
Bindable = config.GetBindable<bool>(OsuConfig.AbsoluteToOsuWindow) Bindable = config.GetBindable<bool>(OsuConfig.AbsoluteToOsuWindow)
}, },
new DropdownOption<ConfineMouseMode> new OptionDropdown<ConfineMouseMode>
{ {
LabelText = "Confine mouse cursor", LabelText = "Confine mouse cursor",
Bindable = config.GetBindable<ConfineMouseMode>(OsuConfig.ConfineMouse), Bindable = config.GetBindable<ConfineMouseMode>(OsuConfig.ConfineMouse),
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Disable mouse wheel in play mode", LabelText = "Disable mouse wheel in play mode",
Bindable = config.GetBindable<bool>(OsuConfig.MouseDisableWheel) Bindable = config.GetBindable<bool>(OsuConfig.MouseDisableWheel)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Disable mouse buttons in play mode", LabelText = "Disable mouse buttons in play mode",
Bindable = config.GetBindable<bool>(OsuConfig.MouseDisableButtons) Bindable = config.GetBindable<bool>(OsuConfig.MouseDisableButtons)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Cursor ripples", LabelText = "Cursor ripples",
Bindable = config.GetBindable<bool>(OsuConfig.CursorRipple) Bindable = config.GetBindable<bool>(OsuConfig.CursorRipple)

View File

@ -1,13 +1,12 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Input namespace osu.Game.Overlays.Options.Sections.Input
{ {
public class OtherInputOptions : OptionsSubsection public class OtherInputOptions : OptionsSubsection
{ {
@ -18,12 +17,12 @@ namespace osu.Game.Overlays.Options.Input
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "OS TabletPC support", LabelText = "OS TabletPC support",
Bindable = config.GetBindable<bool>(OsuConfig.Tablet) Bindable = config.GetBindable<bool>(OsuConfig.Tablet)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Wiimote/TaTaCon Drum Support", LabelText = "Wiimote/TaTaCon Drum Support",
Bindable = config.GetBindable<bool>(OsuConfig.Wiimote) Bindable = config.GetBindable<bool>(OsuConfig.Wiimote)

View File

@ -1,10 +1,11 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Input;
namespace osu.Game.Overlays.Options.Input
namespace osu.Game.Overlays.Options.Sections
{ {
public class InputSection : OptionsSection public class InputSection : OptionsSection
{ {

View File

@ -1,13 +1,12 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK; using osu.Framework.Graphics;
using osu.Framework.Graphics; using osu.Game.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Game.Graphics.UserInterface;
using osu.Game.Graphics; using OpenTK;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Sections
namespace osu.Game.Overlays.Options
{ {
public class MaintenanceSection : OptionsSection public class MaintenanceSection : OptionsSection
{ {
@ -39,7 +38,7 @@ namespace osu.Game.Overlays.Options
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Text = "Run osu! updater", Text = "Run osu! updater",
}, },
new SpriteText new OptionLabel
{ {
Text = "TODO: osu version here", Text = "TODO: osu version here",
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,

View File

@ -1,53 +1,51 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Online namespace osu.Game.Overlays.Options.Sections.Online
{ {
public class InGameChatOptions : OptionsSubsection public class InGameChatOptions : OptionsSubsection
{ {
private TextBoxOption chatIgnoreList; private OptionTextBox chatIgnoreList;
private TextBoxOption chatHighlightWords; private OptionTextBox chatHighlightWords;
protected override string Header => "In-game Chat"; protected override string Header => "Chat";
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuConfigManager config) private void load(OsuConfigManager config)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Filter offensive words", LabelText = "Filter offensive words",
Bindable = config.GetBindable<bool>(OsuConfig.ChatFilter) Bindable = config.GetBindable<bool>(OsuConfig.ChatFilter)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Filter foreign characters", LabelText = "Filter foreign characters",
Bindable = config.GetBindable<bool>(OsuConfig.ChatRemoveForeign) Bindable = config.GetBindable<bool>(OsuConfig.ChatRemoveForeign)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Log private messages", LabelText = "Log private messages",
Bindable = config.GetBindable<bool>(OsuConfig.LogPrivateMessages) Bindable = config.GetBindable<bool>(OsuConfig.LogPrivateMessages)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Block private messages from non-friends", LabelText = "Block private messages from non-friends",
Bindable = config.GetBindable<bool>(OsuConfig.BlockNonFriendPM) Bindable = config.GetBindable<bool>(OsuConfig.BlockNonFriendPM)
}, },
new SpriteText { Text = "Chat ignore list (space-seperated list)" }, new OptionLabel { Text = "Chat ignore list (space-seperated list)" },
chatIgnoreList = new TextBoxOption { chatIgnoreList = new OptionTextBox {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Bindable = config.GetBindable<string>(OsuConfig.IgnoreList) Bindable = config.GetBindable<string>(OsuConfig.IgnoreList)
}, },
new SpriteText { Text = "Chat highlight words (space-seperated list)" }, new OptionLabel { Text = "Chat highlight words (space-seperated list)" },
chatHighlightWords = new TextBoxOption { chatHighlightWords = new OptionTextBox {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Bindable = config.GetBindable<string>(OsuConfig.HighlightWords) Bindable = config.GetBindable<string>(OsuConfig.HighlightWords)
}, },

View File

@ -1,15 +1,14 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Online namespace osu.Game.Overlays.Options.Sections.Online
{ {
public class OnlineIntegrationOptions : OptionsSubsection public class IntegrationOptions : OptionsSubsection
{ {
protected override string Header => "Integration"; protected override string Header => "Integration";
@ -18,22 +17,22 @@ namespace osu.Game.Overlays.Options.Online
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Integrate with Yahoo! status display", LabelText = "Integrate with Yahoo! status display",
Bindable = config.GetBindable<bool>(OsuConfig.YahooIntegration) Bindable = config.GetBindable<bool>(OsuConfig.YahooIntegration)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Integrate with MSN Live status display", LabelText = "Integrate with MSN Live status display",
Bindable = config.GetBindable<bool>(OsuConfig.MsnIntegration) Bindable = config.GetBindable<bool>(OsuConfig.MsnIntegration)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Automatically start osu!direct downloads", LabelText = "Automatically start osu!direct downloads",
Bindable = config.GetBindable<bool>(OsuConfig.AutomaticDownload) Bindable = config.GetBindable<bool>(OsuConfig.AutomaticDownload)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Prefer no-video downloads", LabelText = "Prefer no-video downloads",
Bindable = config.GetBindable<bool>(OsuConfig.AutomaticDownloadNoVideo) Bindable = config.GetBindable<bool>(OsuConfig.AutomaticDownloadNoVideo)

View File

@ -1,13 +1,12 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Online namespace osu.Game.Overlays.Options.Sections.Online
{ {
public class NotificationsOptions : OptionsSubsection public class NotificationsOptions : OptionsSubsection
{ {
@ -18,32 +17,32 @@ namespace osu.Game.Overlays.Options.Online
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Enable chat ticker", LabelText = "Enable chat ticker",
Bindable = config.GetBindable<bool>(OsuConfig.Ticker) Bindable = config.GetBindable<bool>(OsuConfig.Ticker)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Show a notification popup when someone says your name", LabelText = "Show a notification popup when someone says your name",
Bindable = config.GetBindable<bool>(OsuConfig.ChatHighlightName) Bindable = config.GetBindable<bool>(OsuConfig.ChatHighlightName)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Show chat message notifications", LabelText = "Show chat message notifications",
Bindable = config.GetBindable<bool>(OsuConfig.ChatMessageNotification) Bindable = config.GetBindable<bool>(OsuConfig.ChatMessageNotification)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Play a sound when someone says your name", LabelText = "Play a sound when someone says your name",
Bindable = config.GetBindable<bool>(OsuConfig.ChatAudibleHighlight) Bindable = config.GetBindable<bool>(OsuConfig.ChatAudibleHighlight)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Show notification popups instantly during gameplay", LabelText = "Show notification popups instantly during gameplay",
Bindable = config.GetBindable<bool>(OsuConfig.PopupDuringGameplay) Bindable = config.GetBindable<bool>(OsuConfig.PopupDuringGameplay)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Show notification popups when friends change status", LabelText = "Show notification popups when friends change status",
Bindable = config.GetBindable<bool>(OsuConfig.NotifyFriends) Bindable = config.GetBindable<bool>(OsuConfig.NotifyFriends)

View File

@ -1,13 +1,12 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Online namespace osu.Game.Overlays.Options.Sections.Online
{ {
public class PrivacyOptions : OptionsSubsection public class PrivacyOptions : OptionsSubsection
{ {
@ -18,12 +17,12 @@ namespace osu.Game.Overlays.Options.Online
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Share your city location with others", LabelText = "Share your city location with others",
Bindable = config.GetBindable<bool>(OsuConfig.DisplayCityLocation) Bindable = config.GetBindable<bool>(OsuConfig.DisplayCityLocation)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Allow multiplayer game invites from all users", LabelText = "Allow multiplayer game invites from all users",
Bindable = config.GetBindable<bool>(OsuConfig.AllowPublicInvites) Bindable = config.GetBindable<bool>(OsuConfig.AllowPublicInvites)

View File

@ -1,10 +1,11 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Online;
namespace osu.Game.Overlays.Options.Online
namespace osu.Game.Overlays.Options.Sections
{ {
public class OnlineSection : OptionsSection public class OnlineSection : OptionsSection
{ {
@ -18,7 +19,7 @@ namespace osu.Game.Overlays.Options.Online
new InGameChatOptions(), new InGameChatOptions(),
new PrivacyOptions(), new PrivacyOptions(),
new NotificationsOptions(), new NotificationsOptions(),
new OnlineIntegrationOptions(), new IntegrationOptions(),
}; };
} }
} }

View File

@ -1,18 +1,15 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using OpenTK;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Options.Sections
{ {
public class SkinSection : OptionsSection public class SkinSection : OptionsSection
{ {
@ -25,8 +22,8 @@ namespace osu.Game.Overlays.Options
content.Spacing = new Vector2(0, 5); content.Spacing = new Vector2(0, 5);
Children = new Drawable[] Children = new Drawable[]
{ {
new SpriteText { Text = "TODO: Skin preview textures" }, new OptionLabel { Text = "TODO: Skin preview textures" },
new SpriteText { Text = "Current skin: TODO dropdown" }, new OptionLabel { Text = "Current skin: TODO dropdown" },
new OsuButton new OsuButton
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
@ -42,32 +39,32 @@ namespace osu.Game.Overlays.Options
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Text = "Export as .osk", Text = "Export as .osk",
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Ignore all beatmap skins", LabelText = "Ignore all beatmap skins",
Bindable = config.GetBindable<bool>(OsuConfig.IgnoreBeatmapSkins) Bindable = config.GetBindable<bool>(OsuConfig.IgnoreBeatmapSkins)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Use skin's sound samples", LabelText = "Use skin's sound samples",
Bindable = config.GetBindable<bool>(OsuConfig.SkinSamples) Bindable = config.GetBindable<bool>(OsuConfig.SkinSamples)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Use Taiko skin for Taiko mode", LabelText = "Use Taiko skin for Taiko mode",
Bindable = config.GetBindable<bool>(OsuConfig.UseTaikoSkin) Bindable = config.GetBindable<bool>(OsuConfig.UseTaikoSkin)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Always use skin cursor", LabelText = "Always use skin cursor",
Bindable = config.GetBindable<bool>(OsuConfig.UseSkinCursor) Bindable = config.GetBindable<bool>(OsuConfig.UseSkinCursor)
}, },
new SliderOption<double> new OptionSlider<double>
{ {
LabelText = "Cursor size", LabelText = "Cursor size",
Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.CursorSize) Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.CursorSize)
}, },
new CheckBoxOption new OsuCheckbox
{ {
LabelText = "Automatic cursor size", LabelText = "Automatic cursor size",
Bindable = config.GetBindable<bool>(OsuConfig.AutomaticCursorSizing) Bindable = config.GetBindable<bool>(OsuConfig.AutomaticCursorSizing)

View File

@ -14,13 +14,13 @@ using osu.Game.Graphics;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Options
{ {
public class OptionsSidebar : Container public class Sidebar : Container
{ {
private FlowContainer content; private FlowContainer content;
internal const int default_width = 60, expanded_width = 200; internal const int default_width = 60, expanded_width = 200;
protected override Container<Drawable> Content => content; protected override Container<Drawable> Content => content;
public OptionsSidebar() public Sidebar()
{ {
RelativeSizeAxes = Axes.Y; RelativeSizeAxes = Axes.Y;
InternalChildren = new Drawable[] InternalChildren = new Drawable[]

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Options
{ {
@ -19,6 +20,7 @@ namespace osu.Game.Overlays.Options
private SpriteText headerText; private SpriteText headerText;
private Box backgroundBox; private Box backgroundBox;
private Box selectionIndicator; private Box selectionIndicator;
public Container text;
public Action Action; public Action Action;
private OptionsSection section; private OptionsSection section;
@ -44,15 +46,21 @@ namespace osu.Game.Overlays.Options
{ {
selected = value; selected = value;
if (selected) if (selected)
{
selectionIndicator.FadeIn(50); selectionIndicator.FadeIn(50);
text.FadeColour(Color4.White, 50);
}
else else
{
selectionIndicator.FadeOut(50); selectionIndicator.FadeOut(50);
text.FadeColour(OsuColour.Gray(0.6f), 50);
}
} }
} }
public SidebarButton() public SidebarButton()
{ {
Height = OptionsSidebar.default_width; Height = Sidebar.default_width;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Children = new Drawable[] Children = new Drawable[]
{ {
@ -63,12 +71,18 @@ namespace osu.Game.Overlays.Options
Colour = OsuColour.Gray(60), Colour = OsuColour.Gray(60),
Alpha = 0, Alpha = 0,
}, },
new Container text = new Container
{ {
Width = OptionsSidebar.default_width, Width = Sidebar.default_width,
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
Children = new[] Children = new[]
{ {
headerText = new OsuSpriteText
{
Position = new Vector2(Sidebar.default_width + 10, 0),
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
},
drawableIcon = new TextAwesome drawableIcon = new TextAwesome
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
@ -76,12 +90,6 @@ namespace osu.Game.Overlays.Options
}, },
} }
}, },
headerText = new SpriteText
{
Position = new Vector2(OptionsSidebar.default_width + 10, 0),
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
},
selectionIndicator = new Box selectionIndicator = new Box
{ {
Alpha = 0, Alpha = 0,
@ -96,7 +104,7 @@ namespace osu.Game.Overlays.Options
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
selectionIndicator.Colour = colours.Pink; selectionIndicator.Colour = colours.Yellow;
} }
protected override bool OnClick(InputState state) protected override bool OnClick(InputState state)

View File

@ -16,14 +16,10 @@ using osu.Framework.Graphics.Transformations;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Overlays.Options; using osu.Game.Overlays.Options;
using osu.Game.Overlays.Options.Audio;
using osu.Game.Overlays.Options.Gameplay;
using osu.Game.Overlays.Options.General;
using osu.Game.Overlays.Options.Graphics;
using osu.Game.Overlays.Options.Input;
using osu.Game.Overlays.Options.Online;
using System; using System;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays.Options.Sections;
namespace osu.Game.Overlays namespace osu.Game.Overlays
{ {
@ -33,14 +29,14 @@ namespace osu.Game.Overlays
public const float TRANSITION_LENGTH = 600; public const float TRANSITION_LENGTH = 600;
public const float SIDEBAR_WIDTH = OptionsSidebar.default_width; public const float SIDEBAR_WIDTH = Sidebar.default_width;
private const float width = 400; private const float width = 400;
private const float sidebar_padding = 10; private const float sidebar_padding = 10;
private ScrollContainer scrollContainer; private ScrollContainer scrollContainer;
private OptionsSidebar sidebar; private Sidebar sidebar;
private SidebarButton[] sidebarButtons; private SidebarButton[] sidebarButtons;
private OptionsSection[] sections; private OptionsSection[] sections;
private float lastKnownScroll; private float lastKnownScroll;
@ -90,13 +86,13 @@ namespace osu.Game.Overlays
Children = new Drawable[] Children = new Drawable[]
{ {
new SpriteText new OsuSpriteText
{ {
Text = "settings", Text = "settings",
TextSize = 40, TextSize = 40,
Margin = new MarginPadding { Left = CONTENT_MARGINS, Top = 30 }, Margin = new MarginPadding { Left = CONTENT_MARGINS, Top = 30 },
}, },
new SpriteText new OsuSpriteText
{ {
Colour = colours.Pink, Colour = colours.Pink,
Text = "Change the way osu! behaves", Text = "Change the way osu! behaves",
@ -114,7 +110,7 @@ namespace osu.Game.Overlays
} }
} }
}, },
sidebar = new OptionsSidebar sidebar = new Sidebar
{ {
Width = SIDEBAR_WIDTH, Width = SIDEBAR_WIDTH,
Children = sidebarButtons = sections.Select(section => Children = sidebarButtons = sections.Select(section =>

View File

@ -13,6 +13,7 @@ using osu.Framework.Graphics.Transformations;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Sprites;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
@ -90,7 +91,7 @@ namespace osu.Game.Overlays.Toolbar
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
}, },
DrawableText = new SpriteText DrawableText = new OsuSpriteText
{ {
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
@ -106,13 +107,13 @@ namespace osu.Game.Overlays.Toolbar
Alpha = 0, Alpha = 0,
Children = new[] Children = new[]
{ {
tooltip1 = new SpriteText tooltip1 = new OsuSpriteText
{ {
Shadow = true, Shadow = true,
TextSize = 22, TextSize = 22,
Font = @"Exo2.0-Bold", Font = @"Exo2.0-Bold",
}, },
tooltip2 = new SpriteText tooltip2 = new OsuSpriteText
{ {
Shadow = true, Shadow = true,
TextSize = 16 TextSize = 16

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.Transformations;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.Sprites;
using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Backgrounds;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using OpenTK; using OpenTK;
@ -98,14 +99,14 @@ namespace osu.Game.Screens
Origin = Anchor.Centre, Origin = Anchor.Centre,
Children = new[] Children = new[]
{ {
new SpriteText new OsuSpriteText
{ {
Text = GetType().Name, Text = GetType().Name,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
TextSize = 50, TextSize = 50,
}, },
new SpriteText new OsuSpriteText
{ {
Text = GetType().Namespace, Text = GetType().Namespace,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,

View File

@ -12,6 +12,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.Transformations;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
using OpenTK.Input; using OpenTK.Input;
@ -100,7 +101,7 @@ namespace osu.Game.Screens.Menu
Position = new Vector2(0, 0), Position = new Vector2(0, 0),
Icon = symbol Icon = symbol
}, },
new SpriteText new OsuSpriteText
{ {
Shadow = true, Shadow = true,
Direction = FlowDirection.HorizontalOnly, Direction = FlowDirection.HorizontalOnly,

View File

@ -6,6 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.Transformations;
using osu.Game.Graphics.Sprites;
using osu.Game.Modes; using osu.Game.Modes;
using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Backgrounds;
using OpenTK; using OpenTK;
@ -21,7 +22,7 @@ namespace osu.Game.Screens.Play
public FailDialog() public FailDialog()
{ {
Add(new SpriteText Add(new OsuSpriteText
{ {
Text = "You failed!", Text = "You failed!",
Anchor = Anchor.Centre, Anchor = Anchor.Centre,

View File

@ -6,6 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Textures;
using osu.Game.Graphics.Sprites;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
@ -85,7 +86,7 @@ namespace osu.Game.Screens.Play
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Children = new Drawable[] Children = new Drawable[]
{ {
new SpriteText new OsuSpriteText
{ {
Text = Name, Text = Name,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
@ -94,7 +95,7 @@ namespace osu.Game.Screens.Play
Position = new Vector2(0, -0.25f), Position = new Vector2(0, -0.25f),
Colour = KeyUpTextColor Colour = KeyUpTextColor
}, },
countSpriteText = new SpriteText countSpriteText = new OsuSpriteText
{ {
Text = Count.ToString(@"#,0"), Text = Count.ToString(@"#,0"),
Anchor = Anchor.Centre, Anchor = Anchor.Centre,

View File

@ -6,6 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.Transformations;
using osu.Game.Graphics.Sprites;
using osu.Game.Modes; using osu.Game.Modes;
using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Backgrounds;
using OpenTK; using OpenTK;
@ -71,17 +72,17 @@ namespace osu.Game.Screens.Ranking
Direction = FlowDirection.VerticalOnly, Direction = FlowDirection.VerticalOnly,
Children = new Drawable[] Children = new Drawable[]
{ {
new SpriteText new OsuSpriteText
{ {
TextSize = 40, TextSize = 40,
Text = $@"Accuracy: {s.Accuracy:#0.00%}", Text = $@"Accuracy: {s.Accuracy:#0.00%}",
}, },
new SpriteText new OsuSpriteText
{ {
TextSize = 40, TextSize = 40,
Text = $@"Score: {s.TotalScore}", Text = $@"Score: {s.TotalScore}",
}, },
new SpriteText new OsuSpriteText
{ {
TextSize = 40, TextSize = 40,
Text = $@"MaxCombo: {s.MaxCombo}", Text = $@"MaxCombo: {s.MaxCombo}",

View File

@ -20,6 +20,7 @@ using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.MathUtils; using osu.Framework.MathUtils;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Beatmaps.Timing; using osu.Game.Beatmaps.Timing;
using osu.Game.Graphics.Sprites;
using osu.Game.Modes; using osu.Game.Modes;
namespace osu.Game.Screens.Select namespace osu.Game.Screens.Select
@ -131,14 +132,14 @@ namespace osu.Game.Screens.Select
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Children = new Drawable[] Children = new Drawable[]
{ {
new SpriteText new OsuSpriteText
{ {
Font = @"Exo2.0-MediumItalic", Font = @"Exo2.0-MediumItalic",
Text = beatmapSetInfo.Metadata.Artist + " -- " + beatmapSetInfo.Metadata.Title, Text = beatmapSetInfo.Metadata.Artist + " -- " + beatmapSetInfo.Metadata.Title,
TextSize = 28, TextSize = 28,
Shadow = true, Shadow = true,
}, },
new SpriteText new OsuSpriteText
{ {
Font = @"Exo2.0-MediumItalic", Font = @"Exo2.0-MediumItalic",
Text = beatmapInfo.Version, Text = beatmapInfo.Version,
@ -152,14 +153,14 @@ namespace osu.Game.Screens.Select
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Children = new [] Children = new []
{ {
new SpriteText new OsuSpriteText
{ {
Font = @"Exo2.0-Medium", Font = @"Exo2.0-Medium",
Text = "mapped by ", Text = "mapped by ",
TextSize = 15, TextSize = 15,
Shadow = true, Shadow = true,
}, },
new SpriteText new OsuSpriteText
{ {
Font = @"Exo2.0-Bold", Font = @"Exo2.0-Bold",
Text = beatmapSetInfo.Metadata.Author, Text = beatmapSetInfo.Metadata.Author,
@ -204,7 +205,7 @@ namespace osu.Game.Screens.Select
public InfoLabel(BeatmapStatistic statistic) public InfoLabel(BeatmapStatistic statistic)
{ {
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
Children = new[] Children = new Drawable[]
{ {
new TextAwesome new TextAwesome
{ {
@ -218,7 +219,7 @@ namespace osu.Game.Screens.Select
Colour = new Color4(255, 221, 85, 255), Colour = new Color4(255, 221, 85, 255),
Scale = new Vector2(0.8f) Scale = new Vector2(0.8f)
}, },
new SpriteText new OsuSpriteText
{ {
Margin = new MarginPadding { Left = 13 }, Margin = new MarginPadding { Left = 13 },
Font = @"Exo2.0-Bold", Font = @"Exo2.0-Bold",

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Input; using osu.Framework.Input;
using System; using System;
using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.Transformations;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Screens.Select namespace osu.Game.Screens.Select
{ {
@ -72,7 +73,7 @@ namespace osu.Game.Screens.Select
EdgeSmoothness = new Vector2(2, 0), EdgeSmoothness = new Vector2(2, 0),
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
}, },
spriteText = new SpriteText spriteText = new OsuSpriteText
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,

View File

@ -66,6 +66,7 @@
<Compile Include="Beatmaps\Drawables\BeatmapBackgroundSprite.cs" /> <Compile Include="Beatmaps\Drawables\BeatmapBackgroundSprite.cs" />
<Compile Include="Graphics\Backgrounds\Triangles.cs" /> <Compile Include="Graphics\Backgrounds\Triangles.cs" />
<Compile Include="Graphics\Cursor\CursorTrail.cs" /> <Compile Include="Graphics\Cursor\CursorTrail.cs" />
<Compile Include="Graphics\Sprites\OsuSpriteText.cs" />
<Compile Include="Graphics\UserInterface\BackButton.cs" /> <Compile Include="Graphics\UserInterface\BackButton.cs" />
<Compile Include="Graphics\UserInterface\OsuTextBox.cs" /> <Compile Include="Graphics\UserInterface\OsuTextBox.cs" />
<Compile Include="Graphics\UserInterface\TwoLayerButton.cs" /> <Compile Include="Graphics\UserInterface\TwoLayerButton.cs" />
@ -96,6 +97,7 @@
<Compile Include="Beatmaps\Timing\SampleChange.cs" /> <Compile Include="Beatmaps\Timing\SampleChange.cs" />
<Compile Include="Beatmaps\Timing\TimingChange.cs" /> <Compile Include="Beatmaps\Timing\TimingChange.cs" />
<Compile Include="Configuration\OsuConfigManager.cs" /> <Compile Include="Configuration\OsuConfigManager.cs" />
<Compile Include="Overlays\Options\OptionLabel.cs" />
<Compile Include="Overlays\Toolbar\ToolbarHomeButton.cs" /> <Compile Include="Overlays\Toolbar\ToolbarHomeButton.cs" />
<Compile Include="Overlays\Toolbar\ToolbarMusicButton.cs" /> <Compile Include="Overlays\Toolbar\ToolbarMusicButton.cs" />
<Compile Include="Overlays\Toolbar\ToolbarSettingsButton.cs" /> <Compile Include="Overlays\Toolbar\ToolbarSettingsButton.cs" />
@ -194,45 +196,45 @@
<Compile Include="Database\BeatmapInfo.cs" /> <Compile Include="Database\BeatmapInfo.cs" />
<Compile Include="Database\BaseDifficulty.cs" /> <Compile Include="Database\BaseDifficulty.cs" />
<Compile Include="Graphics\UserInterface\OsuButton.cs" /> <Compile Include="Graphics\UserInterface\OsuButton.cs" />
<Compile Include="Overlays\Options\MaintenanceSection.cs" /> <Compile Include="Overlays\Options\Sections\MaintenanceSection.cs" />
<Compile Include="Overlays\Options\OptionsSection.cs" /> <Compile Include="Overlays\Options\OptionsSection.cs" />
<Compile Include="Overlays\Options\OptionsSubsection.cs" /> <Compile Include="Overlays\Options\OptionsSubsection.cs" />
<Compile Include="Graphics\UserInterface\LoadingAnimation.cs" /> <Compile Include="Graphics\UserInterface\LoadingAnimation.cs" />
<Compile Include="Overlays\Options\OptionsSidebar.cs" /> <Compile Include="Overlays\Options\Sidebar.cs" />
<Compile Include="Overlays\Options\General\GeneralSection.cs" /> <Compile Include="Overlays\Options\Sections\GeneralSection.cs" />
<Compile Include="Overlays\Options\General\LoginOptions.cs" /> <Compile Include="Overlays\Options\Sections\General\LoginOptions.cs" />
<Compile Include="Overlays\Options\General\UpdateOptions.cs" /> <Compile Include="Overlays\Options\Sections\General\UpdateOptions.cs" />
<Compile Include="Overlays\Options\General\LanguageOptions.cs" /> <Compile Include="Overlays\Options\Sections\General\LanguageOptions.cs" />
<Compile Include="Overlays\Options\Graphics\GraphicsSection.cs" /> <Compile Include="Overlays\Options\Sections\GraphicsSection.cs" />
<Compile Include="Overlays\Options\Graphics\RendererOptions.cs" /> <Compile Include="Overlays\Options\Sections\Graphics\RendererOptions.cs" />
<Compile Include="Overlays\Options\Graphics\LayoutOptions.cs" /> <Compile Include="Overlays\Options\Sections\Graphics\LayoutOptions.cs" />
<Compile Include="Overlays\Options\Graphics\DetailOptions.cs" /> <Compile Include="Overlays\Options\Sections\Graphics\DetailOptions.cs" />
<Compile Include="Overlays\Options\Graphics\MainMenuOptions.cs" /> <Compile Include="Overlays\Options\Sections\Graphics\MainMenuOptions.cs" />
<Compile Include="Overlays\Options\Graphics\SongSelectGraphicsOptions.cs" /> <Compile Include="Overlays\Options\Sections\Graphics\SongSelectGraphicsOptions.cs" />
<Compile Include="Overlays\Options\Gameplay\GameplaySection.cs" /> <Compile Include="Overlays\Options\Sections\GameplaySection.cs" />
<Compile Include="Overlays\Options\Gameplay\GeneralGameplayOptions.cs" /> <Compile Include="Overlays\Options\Sections\Gameplay\GeneralOptions.cs" />
<Compile Include="Overlays\Options\Gameplay\SongSelectGameplayOptions.cs" /> <Compile Include="Overlays\Options\Sections\Gameplay\SongSelectOptions.cs" />
<Compile Include="Overlays\Options\Audio\AudioSection.cs" /> <Compile Include="Overlays\Options\Sections\AudioSection.cs" />
<Compile Include="Overlays\Options\Audio\AudioDevicesOptions.cs" /> <Compile Include="Overlays\Options\Sections\Audio\AudioDevicesOptions.cs" />
<Compile Include="Overlays\Options\Audio\VolumeOptions.cs" /> <Compile Include="Overlays\Options\Sections\Audio\VolumeOptions.cs" />
<Compile Include="Overlays\Options\Audio\OffsetAdjustmentOptions.cs" /> <Compile Include="Overlays\Options\Sections\Audio\OffsetOptions.cs" />
<Compile Include="Overlays\Options\Input\InputSection.cs" /> <Compile Include="Overlays\Options\Sections\InputSection.cs" />
<Compile Include="Overlays\Options\Input\MouseOptions.cs" /> <Compile Include="Overlays\Options\Sections\Input\MouseOptions.cs" />
<Compile Include="Overlays\Options\Input\KeyboardOptions.cs" /> <Compile Include="Overlays\Options\Sections\Input\KeyboardOptions.cs" />
<Compile Include="Overlays\Options\Input\OtherInputOptions.cs" /> <Compile Include="Overlays\Options\Sections\Input\OtherInputOptions.cs" />
<Compile Include="Overlays\Options\Online\OnlineSection.cs" /> <Compile Include="Overlays\Options\Sections\OnlineSection.cs" />
<Compile Include="Overlays\Options\Online\OnlineIntegrationOptions.cs" /> <Compile Include="Overlays\Options\Sections\Online\IntegrationOptions.cs" />
<Compile Include="Overlays\Options\Online\InGameChatOptions.cs" /> <Compile Include="Overlays\Options\Sections\Online\InGameChatOptions.cs" />
<Compile Include="Overlays\Options\EditorSection.cs" /> <Compile Include="Overlays\Options\Sections\EditorSection.cs" />
<Compile Include="Overlays\Options\SkinSection.cs" /> <Compile Include="Overlays\Options\Sections\SkinSection.cs" />
<Compile Include="Overlays\Options\Online\PrivacyOptions.cs" /> <Compile Include="Overlays\Options\Sections\Online\PrivacyOptions.cs" />
<Compile Include="Overlays\Options\Online\NotificationsOptions.cs" /> <Compile Include="Overlays\Options\Sections\Online\NotificationsOptions.cs" />
<Compile Include="Overlays\Options\CheckBoxOption.cs" /> <Compile Include="Graphics\UserInterface\OsuCheckbox.cs" />
<Compile Include="Overlays\Options\SidebarButton.cs" /> <Compile Include="Overlays\Options\SidebarButton.cs" />
<Compile Include="Overlays\Options\TextBoxOption.cs" /> <Compile Include="Overlays\Options\OptionTextBox.cs" />
<Compile Include="Overlays\Options\SliderOption.cs" /> <Compile Include="Overlays\Options\OptionSlider.cs" />
<Compile Include="Configuration\ProgressBarType.cs" /> <Compile Include="Configuration\ProgressBarType.cs" />
<Compile Include="Overlays\Options\DropdownOption.cs" /> <Compile Include="Overlays\Options\OptionDropdown.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" />