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

Merge remote-tracking branch 'origin/master' into mania-timing-sections

This commit is contained in:
smoogipooo 2017-05-16 18:35:32 +09:00
commit 6231a19b8c
132 changed files with 1210 additions and 530 deletions

@ -1 +1 @@
Subproject commit 682f078b2efc82fa19342f499f14c4a8458843d5 Subproject commit 3111d1aa4f0d3aa1c0df03f8003b6c5c726b10d2

@ -1 +1 @@
Subproject commit b90c4ed490f76f2995662b3a8af3a32b8756a012 Subproject commit ffccbeb98dc9e8f0965520270b5885e63f244c83

View File

@ -2,7 +2,6 @@
// 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.Framework.Graphics.Primitives;
using osu.Framework.Testing; using osu.Framework.Testing;
using osu.Game.Database; using osu.Game.Database;
using osu.Game.Screens.Select; using osu.Game.Screens.Select;

View File

@ -3,7 +3,6 @@
using OpenTK; using OpenTK;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.MathUtils; using osu.Framework.MathUtils;
using osu.Framework.Testing; using osu.Framework.Testing;

View File

@ -6,18 +6,18 @@ using osu.Game.Overlays;
namespace osu.Desktop.VisualTests.Tests namespace osu.Desktop.VisualTests.Tests
{ {
internal class TestCaseOptions : TestCase internal class TestCaseSettings : TestCase
{ {
public override string Description => @"Tests the options overlay"; public override string Description => @"Tests the settings overlay";
private OptionsOverlay options; private SettingsOverlay settings;
public override void Reset() public override void Reset()
{ {
base.Reset(); base.Reset();
Children = new[] { options = new OptionsOverlay() }; Children = new[] { settings = new SettingsOverlay() };
options.ToggleVisibility(); settings.ToggleVisibility();
} }
} }
} }

View File

@ -18,10 +18,14 @@ namespace osu.Desktop.VisualTests.Tests
private SongProgress progress; private SongProgress progress;
private SongProgressGraph graph; private SongProgressGraph graph;
private StopwatchClock clock;
public override void Reset() public override void Reset()
{ {
base.Reset(); base.Reset();
clock = new StopwatchClock(true);
Add(progress = new SongProgress Add(progress = new SongProgress
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
@ -55,6 +59,9 @@ namespace osu.Desktop.VisualTests.Tests
progress.Objects = objects; progress.Objects = objects;
graph.Objects = objects; graph.Objects = objects;
progress.AudioClock = clock;
progress.OnSeek = pos => clock.Seek(pos);
} }
} }
} }

View File

@ -1,8 +1,8 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 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 OpenTK; using OpenTK;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Testing; using osu.Framework.Testing;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;

View File

@ -211,7 +211,7 @@
<Compile Include="Tests\TestCaseTwoLayerButton.cs" /> <Compile Include="Tests\TestCaseTwoLayerButton.cs" />
<Compile Include="VisualTestGame.cs" /> <Compile Include="VisualTestGame.cs" />
<Compile Include="Platform\TestStorage.cs" /> <Compile Include="Platform\TestStorage.cs" />
<Compile Include="Tests\TestCaseOptions.cs" /> <Compile Include="Tests\TestCaseSettings.cs" />
<Compile Include="Tests\TestCaseSongProgress.cs" /> <Compile Include="Tests\TestCaseSongProgress.cs" />
<Compile Include="Tests\TestCaseMods.cs" /> <Compile Include="Tests\TestCaseMods.cs" />
<Compile Include="Tests\TestCaseDialogOverlay.cs" /> <Compile Include="Tests\TestCaseDialogOverlay.cs" />

View File

@ -10,7 +10,6 @@ using OpenTK.Graphics;
using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Mania.Judgements;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using System; using System;
using osu.Framework.Graphics.Primitives;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using OpenTK.Input; using OpenTK.Input;

View File

@ -92,7 +92,7 @@ namespace osu.Game.Rulesets.Osu.Mods
public class OsuModAutoplay : ModAutoplay<OsuHitObject> public class OsuModAutoplay : ModAutoplay<OsuHitObject>
{ {
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray(); public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot), typeof(OsuModSpunOut) }).ToArray();
protected override Score CreateReplayScore(Beatmap<OsuHitObject> beatmap) => new Score protected override Score CreateReplayScore(Beatmap<OsuHitObject> beatmap) => new Score
{ {

View File

@ -108,11 +108,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
private Vector2 scaleToCircle => circle.Scale * circle.DrawWidth / DrawWidth * 0.95f; private Vector2 scaleToCircle => circle.Scale * circle.DrawWidth / DrawWidth * 0.95f;
private const float spins_per_minute_needed = 100 + 5 * 15; //TODO: read per-map OD and place it on the 5 public float Progress => MathHelper.Clamp(disc.RotationAbsolute / 360 / spinner.SpinsRequired, 0, 1);
private float rotationsNeeded => (float)(spins_per_minute_needed * (spinner.EndTime - spinner.StartTime) / 60000f);
public float Progress => MathHelper.Clamp(disc.RotationAbsolute / 360 / rotationsNeeded, 0, 1);
protected override void UpdatePreemptState() protected override void UpdatePreemptState()
{ {

View File

@ -97,8 +97,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuConfigManager config) private void load(OsuConfigManager config)
{ {
snakingIn = config.GetBindable<bool>(OsuConfig.SnakingInSliders); snakingIn = config.GetBindable<bool>(OsuSetting.SnakingInSliders);
snakingOut = config.GetBindable<bool>(OsuConfig.SnakingOutSliders); snakingOut = config.GetBindable<bool>(OsuSetting.SnakingOutSliders);
reloadTexture(); reloadTexture();
} }

View File

@ -2,6 +2,8 @@
// 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.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Objects.Types;
using osu.Game.Beatmaps.Timing;
using osu.Game.Database;
namespace osu.Game.Rulesets.Osu.Objects namespace osu.Game.Rulesets.Osu.Objects
{ {
@ -10,6 +12,18 @@ namespace osu.Game.Rulesets.Osu.Objects
public double EndTime { get; set; } public double EndTime { get; set; }
public double Duration => EndTime - StartTime; public double Duration => EndTime - StartTime;
/// <summary>
/// Number of spins required to finish the spinner without miss.
/// </summary>
public int SpinsRequired { get; protected set; } = 1;
public override bool NewCombo => true; public override bool NewCombo => true;
public override void ApplyDefaults(TimingInfo timing, BeatmapDifficulty difficulty)
{
base.ApplyDefaults(timing, difficulty);
SpinsRequired = (int)(Duration / 1000 * BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 3, 5, 7.5));
}
} }
} }

View File

@ -2,7 +2,7 @@
// 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 System;
using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
{ {

View File

@ -13,7 +13,6 @@ using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics.Primitives;
using System.Linq; using System.Linq;
using osu.Game.Rulesets.Taiko.Objects.Drawables; using osu.Game.Rulesets.Taiko.Objects.Drawables;
using System; using System;

View File

@ -5,7 +5,6 @@ using System;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Colour;
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.Game.Database; using osu.Game.Database;
using osu.Game.Graphics; using osu.Game.Graphics;

View File

@ -9,7 +9,6 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Colour;
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.Localisation; using osu.Framework.Localisation;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;

View File

@ -3,73 +3,75 @@
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Platform; using osu.Framework.Platform;
using osu.Game.Overlays;
using osu.Game.Screens.Select; using osu.Game.Screens.Select;
namespace osu.Game.Configuration namespace osu.Game.Configuration
{ {
public class OsuConfigManager : ConfigManager<OsuConfig> public class OsuConfigManager : ConfigManager<OsuSetting>
{ {
protected override void InitialiseDefaults() protected override void InitialiseDefaults()
{ {
// UI/selection defaults // UI/selection defaults
Set(OsuConfig.Ruleset, 0, 0, int.MaxValue); Set(OsuSetting.Ruleset, 0, 0, int.MaxValue);
Set(OsuConfig.BeatmapDetailTab, BeatmapDetailTab.Details); Set(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Details);
Set(OsuConfig.DisplayStarsMinimum, 0.0, 0, 10); Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10);
Set(OsuConfig.DisplayStarsMaximum, 10.0, 0, 10); Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10);
Set(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1);
// Online settings // Online settings
Set(OsuConfig.Username, string.Empty); Set(OsuSetting.Username, string.Empty);
Set(OsuConfig.Token, string.Empty); Set(OsuSetting.Token, string.Empty);
Set(OsuConfig.SavePassword, false).ValueChanged += val => Set(OsuSetting.SavePassword, false).ValueChanged += val =>
{ {
if (val) Set(OsuConfig.SaveUsername, true); if (val) Set(OsuSetting.SaveUsername, true);
}; };
Set(OsuConfig.SaveUsername, true).ValueChanged += val => Set(OsuSetting.SaveUsername, true).ValueChanged += val =>
{ {
if (!val) Set(OsuConfig.SavePassword, false); if (!val) Set(OsuSetting.SavePassword, false);
}; };
// Audio // Audio
Set(OsuConfig.AudioDevice, string.Empty); Set(OsuSetting.MenuVoice, true);
Set(OsuSetting.MenuMusic, true);
Set(OsuConfig.MenuVoice, true); Set(OsuSetting.AudioOffset, 0, -500.0, 500.0);
Set(OsuConfig.MenuMusic, true);
Set(OsuConfig.AudioOffset, 0, -500.0, 500.0);
// Input // Input
Set(OsuConfig.MenuCursorSize, 1.0, 0.5f, 2); Set(OsuSetting.MenuCursorSize, 1.0, 0.5f, 2);
Set(OsuConfig.GameplayCursorSize, 1.0, 0.5f, 2); Set(OsuSetting.GameplayCursorSize, 1.0, 0.5f, 2);
Set(OsuSetting.AutoCursorSize, false);
Set(OsuConfig.MouseDisableButtons, false); Set(OsuSetting.MouseDisableButtons, false);
Set(OsuConfig.MouseDisableWheel, false); Set(OsuSetting.MouseDisableWheel, false);
// Graphics // Graphics
Set(OsuConfig.ShowFpsDisplay, false); Set(OsuSetting.ShowFpsDisplay, false);
Set(OsuConfig.MenuParallax, true); Set(OsuSetting.MenuParallax, true);
Set(OsuConfig.SnakingInSliders, true); Set(OsuSetting.SnakingInSliders, true);
Set(OsuConfig.SnakingOutSliders, true); Set(OsuSetting.SnakingOutSliders, true);
// Gameplay // Gameplay
Set(OsuConfig.DimLevel, 0.3, 0, 1); Set(OsuSetting.DimLevel, 0.3, 0, 1);
Set(OsuConfig.ShowInterface, true); Set(OsuSetting.ShowInterface, true);
Set(OsuConfig.KeyOverlay, false); Set(OsuSetting.KeyOverlay, false);
// Update // Update
Set(OsuConfig.ReleaseStream, ReleaseStream.Lazer); Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer);
} }
public OsuConfigManager(Storage storage) : base(storage) public OsuConfigManager(Storage storage) : base(storage)
@ -77,12 +79,13 @@ namespace osu.Game.Configuration
} }
} }
public enum OsuConfig public enum OsuSetting
{ {
Ruleset, Ruleset,
Token, Token,
MenuCursorSize, MenuCursorSize,
GameplayCursorSize, GameplayCursorSize,
AutoCursorSize,
DimLevel, DimLevel,
KeyOverlay, KeyOverlay,
ShowInterface, ShowInterface,
@ -94,7 +97,6 @@ namespace osu.Game.Configuration
MenuParallax, MenuParallax,
BeatmapDetailTab, BeatmapDetailTab,
Username, Username,
AudioDevice,
ReleaseStream, ReleaseStream,
SavePassword, SavePassword,
SaveUsername, SaveUsername,
@ -102,6 +104,7 @@ namespace osu.Game.Configuration
DisplayStarsMaximum, DisplayStarsMaximum,
SnakingInSliders, SnakingInSliders,
SnakingOutSliders, SnakingOutSliders,
ShowFpsDisplay ShowFpsDisplay,
ChatDisplayHeight
} }
} }

View File

@ -267,7 +267,7 @@ namespace osu.Game.Database
public WorkingBeatmap GetWorkingBeatmap(BeatmapInfo beatmapInfo, WorkingBeatmap previous = null, bool withStoryboard = false) public WorkingBeatmap GetWorkingBeatmap(BeatmapInfo beatmapInfo, WorkingBeatmap previous = null, bool withStoryboard = false)
{ {
if (beatmapInfo.BeatmapSet == null) if (beatmapInfo.BeatmapSet == null || beatmapInfo.Ruleset == null)
beatmapInfo = GetChildren(beatmapInfo, true); beatmapInfo = GetChildren(beatmapInfo, true);
if (beatmapInfo.BeatmapSet == null) if (beatmapInfo.BeatmapSet == null)

View File

@ -7,12 +7,17 @@ namespace osu.Game.Database
{ {
public class BeatmapDifficulty public class BeatmapDifficulty
{ {
/// <summary>
/// The default value used for all difficulty settings except <see cref="SliderMultiplier"/> and <see cref="SliderTickRate"/>.
/// </summary>
public const float DEFAULT_DIFFICULTY = 5;
[PrimaryKey, AutoIncrement] [PrimaryKey, AutoIncrement]
public int ID { get; set; } public int ID { get; set; }
public float DrainRate { get; set; } = 5; public float DrainRate { get; set; } = DEFAULT_DIFFICULTY;
public float CircleSize { get; set; } = 5; public float CircleSize { get; set; } = DEFAULT_DIFFICULTY;
public float OverallDifficulty { get; set; } = 5; public float OverallDifficulty { get; set; } = DEFAULT_DIFFICULTY;
public float ApproachRate { get; set; } = 5; public float ApproachRate { get; set; } = DEFAULT_DIFFICULTY;
public float SliderMultiplier { get; set; } = 1; public float SliderMultiplier { get; set; } = 1;
public float SliderTickRate { get; set; } = 1; public float SliderTickRate { get; set; } = 1;

View File

@ -39,7 +39,7 @@ namespace osu.Game.Graphics.Containers
private void load(UserInputManager input, OsuConfigManager config) private void load(UserInputManager input, OsuConfigManager config)
{ {
this.input = input; this.input = input;
parallaxEnabled = config.GetBindable<bool>(OsuConfig.MenuParallax); parallaxEnabled = config.GetBindable<bool>(OsuSetting.MenuParallax);
parallaxEnabled.ValueChanged += delegate parallaxEnabled.ValueChanged += delegate
{ {
if (!parallaxEnabled) if (!parallaxEnabled)

View File

@ -11,7 +11,9 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Game.Beatmaps;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Database;
namespace osu.Game.Graphics.Cursor namespace osu.Game.Graphics.Cursor
{ {
@ -41,7 +43,10 @@ namespace osu.Game.Graphics.Cursor
public class OsuCursor : Container public class OsuCursor : Container
{ {
private Container cursorContainer; private Container cursorContainer;
private Bindable<double> cursorScale; private Bindable<double> cursorScale;
private Bindable<bool> autoCursorScale;
private Bindable<WorkingBeatmap> beatmap;
public OsuCursor() public OsuCursor()
{ {
@ -50,7 +55,7 @@ namespace osu.Game.Graphics.Cursor
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuConfigManager config) private void load(OsuConfigManager config, OsuGameBase game)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
@ -114,9 +119,29 @@ namespace osu.Game.Graphics.Cursor
}, },
}; };
cursorScale = config.GetBindable<double>(OsuConfig.GameplayCursorSize); beatmap = game.Beatmap.GetBoundCopy();
cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)cursorScale); beatmap.ValueChanged += v => calculateScale();
cursorScale.TriggerChange();
cursorScale = config.GetBindable<double>(OsuSetting.GameplayCursorSize);
cursorScale.ValueChanged += v => calculateScale();
autoCursorScale = config.GetBindable<bool>(OsuSetting.AutoCursorSize);
autoCursorScale.ValueChanged += v => calculateScale();
calculateScale();
}
private void calculateScale()
{
float scale = (float)cursorScale.Value;
if (autoCursorScale && beatmap.Value != null)
{
// if we have a beatmap available, let's get its circle size to figure out an automatic cursor scale modifier.
scale *= (float)(1 - 0.7 * (1 + beatmap.Value.BeatmapInfo.Difficulty.CircleSize - BeatmapDifficulty.DEFAULT_DIFFICULTY) / BeatmapDifficulty.DEFAULT_DIFFICULTY);
}
cursorContainer.Scale = new Vector2(scale);
} }
} }
} }

View File

@ -128,7 +128,7 @@ namespace osu.Game.Graphics.Cursor
} }
}; };
cursorScale = config.GetBindable<double>(OsuConfig.MenuCursorSize); cursorScale = config.GetBindable<double>(OsuSetting.MenuCursorSize);
cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale); cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale);
cursorScale.TriggerChange(); cursorScale.TriggerChange();
} }

View File

@ -8,7 +8,6 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Framework.Threading; using osu.Framework.Threading;

View File

@ -85,5 +85,7 @@ namespace osu.Game.Graphics
public readonly Color4 Red = FromHex(@"ed1121"); public readonly Color4 Red = FromHex(@"ed1121");
public readonly Color4 RedDark = FromHex(@"ba0011"); public readonly Color4 RedDark = FromHex(@"ba0011");
public readonly Color4 RedDarker = FromHex(@"870000"); public readonly Color4 RedDarker = FromHex(@"870000");
public readonly Color4 ChatBlue = FromHex(@"17292e");
} }
} }

View File

@ -6,7 +6,6 @@ using osu.Framework.Audio;
using osu.Framework.Audio.Sample; using osu.Framework.Audio.Sample;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
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.Framework.Input; using osu.Framework.Input;

View File

@ -7,7 +7,6 @@ using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
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.Graphics.Sprites; using osu.Game.Graphics.Sprites;

View File

@ -5,7 +5,6 @@ using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface

View File

@ -9,7 +9,6 @@ using osu.Framework.Allocation;
using osu.Framework.Extensions; using osu.Framework.Extensions;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
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.Framework.Input; using osu.Framework.Input;
@ -25,13 +24,13 @@ namespace osu.Game.Graphics.UserInterface
protected override bool InternalContains(Vector2 screenSpacePos) => base.InternalContains(screenSpacePos) || Dropdown.Contains(screenSpacePos); protected override bool InternalContains(Vector2 screenSpacePos) => base.InternalContains(screenSpacePos) || Dropdown.Contains(screenSpacePos);
private bool isEnumType => typeof(T).IsEnum;
public OsuTabControl() public OsuTabControl()
{ {
TabContainer.Spacing = new Vector2(10f, 0f); TabContainer.Spacing = new Vector2(10f, 0f);
if (!typeof(T).IsEnum) if (isEnumType)
throw new InvalidOperationException("OsuTabControl only supports enums as the generic type argument");
foreach (var val in (T[])Enum.GetValues(typeof(T))) foreach (var val in (T[])Enum.GetValues(typeof(T)))
AddItem(val); AddItem(val);
} }
@ -136,7 +135,7 @@ namespace osu.Game.Graphics.UserInterface
Margin = new MarginPadding { Top = 5, Bottom = 5 }, Margin = new MarginPadding { Top = 5, Bottom = 5 },
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Text = (value as Enum)?.GetDescription(), Text = (value as Enum)?.GetDescription() ?? value.ToString(),
TextSize = 14, TextSize = 14,
Font = @"Exo2.0-Bold", // Font should only turn bold when active? Font = @"Exo2.0-Bold", // Font should only turn bold when active?
}, },

View File

@ -6,7 +6,6 @@ using OpenTK.Graphics;
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.Framework.Input; using osu.Framework.Input;

View File

@ -3,7 +3,6 @@
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
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.Framework.Input; using osu.Framework.Input;

View File

@ -1,20 +1,19 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 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.Input;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Game.Graphics; using OpenTK.Input;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Screens.Select namespace osu.Game.Graphics.UserInterface
{ {
/// <summary> /// <summary>
/// A textbox which holds focus eagerly. /// A textbox which holds focus eagerly.
/// </summary> /// </summary>
public class SearchTextBox : FocusedTextBox public class SearchTextBox : FocusedTextBox
{ {
protected virtual bool AllowCommit => false;
public SearchTextBox() public SearchTextBox()
{ {
Height = 35; Height = 35;
@ -45,8 +44,10 @@ namespace osu.Game.Screens.Select
case Key.Right: case Key.Right:
case Key.Up: case Key.Up:
case Key.Down: case Key.Down:
case Key.Enter:
return false; return false;
case Key.Enter:
if (!AllowCommit) return false;
break;
} }
} }

View File

@ -6,7 +6,6 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Framework.Threading; using osu.Framework.Threading;
using OpenTK; using OpenTK;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Audio; using osu.Framework.Audio;
using osu.Framework.Allocation; using osu.Framework.Allocation;

View File

@ -27,6 +27,8 @@ namespace osu.Game.Online.Chat
//internal bool Joined; //internal bool Joined;
public bool ReadOnly => Name != "#lazer";
public const int MAX_HISTORY = 300; public const int MAX_HISTORY = 300;
[JsonConstructor] [JsonConstructor]
@ -36,9 +38,9 @@ namespace osu.Game.Online.Chat
public event Action<IEnumerable<Message>> NewMessagesArrived; public event Action<IEnumerable<Message>> NewMessagesArrived;
public void AddNewMessages(IEnumerable<Message> messages) public void AddNewMessages(params Message[] messages)
{ {
messages = messages.Except(Messages).ToList(); messages = messages.Except(Messages).ToArray();
Messages.AddRange(messages); Messages.AddRange(messages);
@ -53,5 +55,7 @@ namespace osu.Game.Online.Chat
if (messageCount > MAX_HISTORY) if (messageCount > MAX_HISTORY)
Messages.RemoveRange(0, messageCount - MAX_HISTORY); Messages.RemoveRange(0, messageCount - MAX_HISTORY);
} }
public override string ToString() => Name;
} }
} }

View File

@ -0,0 +1,25 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Game.Users;
namespace osu.Game.Online.Chat
{
public class ErrorMessage : Message
{
private static int errorId = -1;
public ErrorMessage(string message) : base(errorId--)
{
Timestamp = DateTime.Now;
Content = message;
Sender = new User
{
Username = @"system",
Colour = @"ff0000",
};
}
}
}

View File

@ -37,6 +37,11 @@ namespace osu.Game.Online.Chat
{ {
} }
public Message(long id)
{
Id = id;
}
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
var objMessage = obj as Message; var objMessage = obj as Message;

View File

@ -19,7 +19,6 @@ using osu.Game.Screens;
using osu.Game.Screens.Menu; using osu.Game.Screens.Menu;
using OpenTK; using OpenTK;
using System.Linq; using System.Linq;
using osu.Framework.Graphics.Primitives;
using System.Threading.Tasks; using System.Threading.Tasks;
using osu.Framework.Threading; using osu.Framework.Threading;
using osu.Game.Database; using osu.Game.Database;
@ -62,14 +61,14 @@ namespace osu.Game
private readonly string[] args; private readonly string[] args;
private OptionsOverlay options; private SettingsOverlay settings;
public OsuGame(string[] args = null) public OsuGame(string[] args = null)
{ {
this.args = args; this.args = args;
} }
public void ToggleOptions() => options.ToggleVisibility(); public void ToggleSettings() => settings.ToggleVisibility();
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
@ -88,7 +87,7 @@ namespace osu.Game
Dependencies.Cache(this); Dependencies.Cache(this);
configRuleset = LocalConfig.GetBindable<int>(OsuConfig.Ruleset); configRuleset = LocalConfig.GetBindable<int>(OsuSetting.Ruleset);
Ruleset.Value = RulesetDatabase.GetRuleset(configRuleset.Value); Ruleset.Value = RulesetDatabase.GetRuleset(configRuleset.Value);
Ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0; Ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0;
} }
@ -160,8 +159,8 @@ namespace osu.Game
}); });
//overlay elements //overlay elements
LoadComponentAsync(chat = new ChatOverlay { Depth = 0 }, overlayContent.Add); LoadComponentAsync(chat = new ChatOverlay { Depth = -1 }, mainContent.Add);
LoadComponentAsync(options = new OptionsOverlay { Depth = -1 }, overlayContent.Add); LoadComponentAsync(settings = new SettingsOverlay { Depth = -1 }, overlayContent.Add);
LoadComponentAsync(musicController = new MusicController LoadComponentAsync(musicController = new MusicController
{ {
Depth = -2, Depth = -2,
@ -192,7 +191,7 @@ namespace osu.Game
}); });
}; };
Dependencies.Cache(options); Dependencies.Cache(settings);
Dependencies.Cache(chat); Dependencies.Cache(chat);
Dependencies.Cache(musicController); Dependencies.Cache(musicController);
Dependencies.Cache(notificationManager); Dependencies.Cache(notificationManager);
@ -204,15 +203,15 @@ namespace osu.Game
OnHome = delegate { intro?.ChildScreen?.MakeCurrent(); }, OnHome = delegate { intro?.ChildScreen?.MakeCurrent(); },
}, overlayContent.Add); }, overlayContent.Add);
options.StateChanged += delegate settings.StateChanged += delegate
{ {
switch (options.State) switch (settings.State)
{ {
case Visibility.Hidden: case Visibility.Hidden:
intro.MoveToX(0, OptionsOverlay.TRANSITION_LENGTH, EasingTypes.OutQuint); intro.MoveToX(0, SettingsOverlay.TRANSITION_LENGTH, EasingTypes.OutQuint);
break; break;
case Visibility.Visible: case Visibility.Visible:
intro.MoveToX(OptionsOverlay.SIDEBAR_WIDTH / 2, OptionsOverlay.TRANSITION_LENGTH, EasingTypes.OutQuint); intro.MoveToX(SettingsOverlay.SIDEBAR_WIDTH / 2, SettingsOverlay.TRANSITION_LENGTH, EasingTypes.OutQuint);
break; break;
} }
}; };
@ -247,7 +246,7 @@ namespace osu.Game
Toolbar.ToggleVisibility(); Toolbar.ToggleVisibility();
return true; return true;
case Key.O: case Key.O:
options.ToggleVisibility(); settings.ToggleVisibility();
return true; return true;
} }
} }
@ -276,7 +275,7 @@ namespace osu.Game
//central game screen change logic. //central game screen change logic.
if (!currentScreen.ShowOverlays) if (!currentScreen.ShowOverlays)
{ {
options.State = Visibility.Hidden; settings.State = Visibility.Hidden;
Toolbar.State = Visibility.Hidden; Toolbar.State = Visibility.Hidden;
musicController.State = Visibility.Hidden; musicController.State = Visibility.Hidden;
chat.State = Visibility.Hidden; chat.State = Visibility.Hidden;
@ -320,8 +319,7 @@ namespace osu.Game
{ {
base.UpdateAfterChildren(); base.UpdateAfterChildren();
if (intro?.ChildScreen != null) mainContent.Padding = new MarginPadding { Top = Toolbar.Position.Y + Toolbar.DrawHeight };
intro.ChildScreen.Padding = new MarginPadding { Top = Toolbar.Position.Y + Toolbar.DrawHeight };
Cursor.State = currentScreen?.HasLocalCursorDisplayed == false ? Visibility.Visible : Visibility.Hidden; Cursor.State = currentScreen?.HasLocalCursorDisplayed == false ? Visibility.Visible : Visibility.Hidden;
} }

View File

@ -125,8 +125,8 @@ namespace osu.Game
Dependencies.Cache(API = new APIAccess Dependencies.Cache(API = new APIAccess
{ {
Username = LocalConfig.Get<string>(OsuConfig.Username), Username = LocalConfig.Get<string>(OsuSetting.Username),
Token = LocalConfig.Get<string>(OsuConfig.Token) Token = LocalConfig.Get<string>(OsuSetting.Token)
}); });
API.Register(this); API.Register(this);
@ -137,7 +137,7 @@ namespace osu.Game
switch (state) switch (state)
{ {
case APIState.Online: case APIState.Online:
LocalConfig.Set(OsuConfig.Username, LocalConfig.Get<bool>(OsuConfig.SaveUsername) ? API.Username : string.Empty); LocalConfig.Set(OsuSetting.Username, LocalConfig.Get<bool>(OsuSetting.SaveUsername) ? API.Username : string.Empty);
break; break;
} }
} }
@ -166,7 +166,7 @@ namespace osu.Game
// TODO: This is temporary until we reimplement the local FPS display. // TODO: This is temporary until we reimplement the local FPS display.
// It's just to allow end-users to access the framework FPS display without knowing the shortcut key. // It's just to allow end-users to access the framework FPS display without knowing the shortcut key.
fpsDisplayVisible = LocalConfig.GetBindable<bool>(OsuConfig.ShowFpsDisplay); fpsDisplayVisible = LocalConfig.GetBindable<bool>(OsuSetting.ShowFpsDisplay);
fpsDisplayVisible.ValueChanged += val => fpsDisplayVisible.ValueChanged += val =>
{ {
FrameStatisticsMode = val ? FrameStatisticsMode.Minimal : FrameStatisticsMode.None; FrameStatisticsMode = val ? FrameStatisticsMode.Minimal : FrameStatisticsMode.None;
@ -192,7 +192,7 @@ namespace osu.Game
//refresh token may have changed. //refresh token may have changed.
if (LocalConfig != null && API != null) if (LocalConfig != null && API != null)
{ {
LocalConfig.Set(OsuConfig.Token, LocalConfig.Get<bool>(OsuConfig.SavePassword) ? API.Token : string.Empty); LocalConfig.Set(OsuSetting.Token, LocalConfig.Get<bool>(OsuSetting.SavePassword) ? API.Token : string.Empty);
LocalConfig.Save(); LocalConfig.Save();
} }

View File

@ -3,13 +3,13 @@
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.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Online.Chat;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
namespace osu.Game.Online.Chat.Drawables namespace osu.Game.Overlays.Chat
{ {
public class ChatLine : Container public class ChatLine : Container
{ {
@ -62,7 +62,10 @@ namespace osu.Game.Online.Chat.Drawables
return username_colours[message.UserId % username_colours.Length]; return username_colours[message.UserId % username_colours.Length];
} }
private const float padding = 200; public const float LEFT_PADDING = message_padding + padding * 2;
private const float padding = 15;
private const float message_padding = 200;
private const float text_size = 20; private const float text_size = 20;
public ChatLine(Message message) public ChatLine(Message message)
@ -72,13 +75,13 @@ namespace osu.Game.Online.Chat.Drawables
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Padding = new MarginPadding { Left = 15, Right = 15 }; Padding = new MarginPadding { Left = padding, Right = padding };
Children = new Drawable[] Children = new Drawable[]
{ {
new Container new Container
{ {
Size = new Vector2(padding, text_size), Size = new Vector2(message_padding, text_size),
Children = new Drawable[] Children = new Drawable[]
{ {
new OsuSpriteText new OsuSpriteText
@ -106,7 +109,7 @@ namespace osu.Game.Online.Chat.Drawables
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Left = padding + 15 }, Padding = new MarginPadding { Left = message_padding + padding },
Children = new Drawable[] Children = new Drawable[]
{ {
new OsuSpriteText new OsuSpriteText

View File

@ -0,0 +1,196 @@
// Copyright (c) 2007-2017 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.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Chat;
using OpenTK;
using OpenTK.Graphics;
namespace osu.Game.Overlays.Chat
{
public class ChatTabControl : OsuTabControl<Channel>
{
protected override TabItem<Channel> CreateTabItem(Channel value) => new ChannelTabItem(value);
private const float shear_width = 10;
public ChatTabControl()
{
TabContainer.Margin = new MarginPadding { Left = 50 };
TabContainer.Spacing = new Vector2(-shear_width, 0);
TabContainer.Masking = false;
AddInternal(new TextAwesome
{
Icon = FontAwesome.fa_comments,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
TextSize = 20,
Padding = new MarginPadding(10),
});
}
private class ChannelTabItem : TabItem<Channel>
{
private Color4 backgroundInactive;
private Color4 backgroundHover;
private Color4 backgroundActive;
private readonly SpriteText text;
private readonly SpriteText textBold;
private readonly Box box;
private readonly Box highlightBox;
public override bool Active
{
get { return base.Active; }
set
{
if (Active == value) return;
base.Active = value;
updateState();
}
}
private void updateState()
{
if (Active)
fadeActive();
else
fadeInactive();
}
private const float transition_length = 400;
private void fadeActive()
{
ResizeTo(new Vector2(Width, 1.1f), transition_length, EasingTypes.OutQuint);
box.FadeColour(backgroundActive, transition_length, EasingTypes.OutQuint);
highlightBox.FadeIn(transition_length, EasingTypes.OutQuint);
text.FadeOut(transition_length, EasingTypes.OutQuint);
textBold.FadeIn(transition_length, EasingTypes.OutQuint);
}
private void fadeInactive()
{
ResizeTo(new Vector2(Width, 1), transition_length, EasingTypes.OutQuint);
box.FadeColour(backgroundInactive, transition_length, EasingTypes.OutQuint);
highlightBox.FadeOut(transition_length, EasingTypes.OutQuint);
text.FadeIn(transition_length, EasingTypes.OutQuint);
textBold.FadeOut(transition_length, EasingTypes.OutQuint);
}
protected override bool OnHover(InputState state)
{
if (!Active)
box.FadeColour(backgroundHover, transition_length, EasingTypes.OutQuint);
return true;
}
protected override void OnHoverLost(InputState state)
{
updateState();
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
backgroundActive = colours.ChatBlue;
backgroundInactive = colours.Gray4;
backgroundHover = colours.Gray7;
highlightBox.Colour = colours.Yellow;
updateState();
}
public ChannelTabItem(Channel value) : base(value)
{
Width = 150;
RelativeSizeAxes = Axes.Y;
Anchor = Anchor.BottomLeft;
Origin = Anchor.BottomLeft;
Shear = new Vector2(shear_width / ChatOverlay.TAB_AREA_HEIGHT, 0);
Masking = true;
EdgeEffect = new EdgeEffect
{
Type = EdgeEffectType.Shadow,
Radius = 10,
Colour = Color4.Black.Opacity(0.2f),
};
Children = new Drawable[]
{
box = new Box
{
EdgeSmoothness = new Vector2(1, 0),
RelativeSizeAxes = Axes.Both,
},
highlightBox = new Box
{
Width = 5,
Alpha = 0,
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
EdgeSmoothness = new Vector2(1, 0),
RelativeSizeAxes = Axes.Y,
},
new Container
{
Shear = new Vector2(-shear_width / ChatOverlay.TAB_AREA_HEIGHT, 0),
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
new TextAwesome
{
Icon = FontAwesome.fa_hashtag,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Colour = Color4.Black,
X = -10,
Alpha = 0.2f,
TextSize = ChatOverlay.TAB_AREA_HEIGHT,
},
text = new OsuSpriteText
{
Margin = new MarginPadding(5),
Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft,
Text = value.ToString(),
TextSize = 18,
},
textBold = new OsuSpriteText
{
Alpha = 0,
Margin = new MarginPadding(5),
Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft,
Text = value.ToString(),
Font = @"Exo2.0-Bold",
TextSize = 18,
},
}
}
};
}
}
}
}

View File

@ -6,33 +6,24 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
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.Game.Online.Chat;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Online.Chat.Drawables namespace osu.Game.Overlays.Chat
{ {
public class DrawableChannel : Container public class DrawableChannel : Container
{ {
private readonly Channel channel; public readonly Channel Channel;
private readonly FillFlowContainer flow; private readonly FillFlowContainer flow;
private readonly ScrollContainer scroll; private readonly ScrollContainer scroll;
public DrawableChannel(Channel channel) public DrawableChannel(Channel channel)
{ {
this.channel = channel; Channel = channel;
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
Children = new Drawable[] Children = new Drawable[]
{ {
new OsuSpriteText
{
Text = channel.Name,
TextSize = 50,
Alpha = 0.3f,
Anchor = Anchor.Centre,
Origin = Anchor.Centre
},
scroll = new ScrollContainer scroll = new ScrollContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
@ -56,14 +47,14 @@ namespace osu.Game.Online.Chat.Drawables
{ {
base.LoadComplete(); base.LoadComplete();
newMessagesArrived(channel.Messages); newMessagesArrived(Channel.Messages);
scrollToEnd(); scrollToEnd();
} }
protected override void Dispose(bool isDisposing) protected override void Dispose(bool isDisposing)
{ {
base.Dispose(isDisposing); base.Dispose(isDisposing);
channel.NewMessagesArrived -= newMessagesArrived; Channel.NewMessagesArrived -= newMessagesArrived;
} }
private void newMessagesArrived(IEnumerable<Message> newMessages) private void newMessagesArrived(IEnumerable<Message> newMessages)

View File

@ -7,6 +7,7 @@ using System.Diagnostics;
using System.Linq; using System.Linq;
using OpenTK; using OpenTK;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Configuration;
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;
@ -15,24 +16,23 @@ 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;
using osu.Game.Online.Chat.Drawables;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Overlays.Chat;
namespace osu.Game.Overlays namespace osu.Game.Overlays
{ {
public class ChatOverlay : FocusedOverlayContainer, IOnlineComponent public class ChatOverlay : FocusedOverlayContainer, IOnlineComponent
{ {
private const float textbox_height = 40; private const float textbox_height = 60;
private ScheduledDelegate messageRequest; private ScheduledDelegate messageRequest;
private readonly Container content; private readonly Container currentChannelContainer;
protected override Container<Drawable> Content => content;
private readonly FocusedTextBox inputTextBox; private readonly FocusedTextBox inputTextBox;
@ -40,28 +40,50 @@ namespace osu.Game.Overlays
private const int transition_length = 500; private const int transition_length = 500;
public const float DEFAULT_HEIGHT = 0.4f;
public const float TAB_AREA_HEIGHT = 50;
private GetMessagesRequest fetchReq; private GetMessagesRequest fetchReq;
private readonly ChatTabControl channelTabs;
private readonly Box chatBackground;
private readonly Box tabBackground;
private Bindable<double> chatHeight;
public ChatOverlay() public ChatOverlay()
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.Both;
Size = new Vector2(1, 300); RelativePositionAxes = Axes.Both;
Size = new Vector2(1, DEFAULT_HEIGHT);
Anchor = Anchor.BottomLeft; Anchor = Anchor.BottomLeft;
Origin = Anchor.BottomLeft; Origin = Anchor.BottomLeft;
AddInternal(new Drawable[] const float padding = 5;
Children = new Drawable[]
{ {
new Box new Container
{
Name = @"chat area",
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Top = TAB_AREA_HEIGHT },
Children = new Drawable[]
{
chatBackground = new Box
{ {
Depth = float.MaxValue,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
Alpha = 0.9f,
}, },
content = new Container currentChannelContainer = new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Top = 5, Bottom = textbox_height + 5 }, Padding = new MarginPadding
{
Top = padding,
Bottom = textbox_height + padding
},
}, },
new Container new Container
{ {
@ -69,7 +91,13 @@ namespace osu.Game.Overlays
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Height = textbox_height, Height = textbox_height,
Padding = new MarginPadding(5), Padding = new MarginPadding
{
Top = padding * 2,
Bottom = padding * 2,
Left = ChatLine.LEFT_PADDING + padding * 2,
Right = padding * 2,
},
Children = new Drawable[] Children = new Drawable[]
{ {
inputTextBox = new FocusedTextBox inputTextBox = new FocusedTextBox
@ -83,7 +111,43 @@ namespace osu.Game.Overlays
} }
} }
} }
}); }
},
new Container
{
Name = @"tabs area",
RelativeSizeAxes = Axes.X,
Height = TAB_AREA_HEIGHT,
Children = new Drawable[]
{
tabBackground = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
},
channelTabs = new ChatTabControl
{
RelativeSizeAxes = Axes.Both,
},
}
},
};
channelTabs.Current.ValueChanged += newChannel => CurrentChannel = newChannel;
}
protected override bool OnDragStart(InputState state)
{
if (channelTabs.Hovering)
return true;
return base.OnDragStart(state);
}
protected override bool OnDrag(InputState state)
{
chatHeight.Value = Height - state.Mouse.Delta.Y / Parent.DrawSize.Y;
return base.OnDrag(state);
} }
public void APIStateChanged(APIAccess api, APIState state) public void APIStateChanged(APIAccess api, APIState state)
@ -117,7 +181,7 @@ namespace osu.Game.Overlays
protected override void PopOut() protected override void PopOut()
{ {
MoveToY(DrawSize.Y, transition_length, EasingTypes.InSine); MoveToY(Height, transition_length, EasingTypes.InSine);
FadeOut(transition_length, EasingTypes.InSine); FadeOut(transition_length, EasingTypes.InSine);
inputTextBox.HoldFocus = false; inputTextBox.HoldFocus = false;
@ -125,19 +189,33 @@ namespace osu.Game.Overlays
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(APIAccess api) private void load(APIAccess api, OsuConfigManager config, OsuColour colours)
{ {
this.api = api; this.api = api;
api.Register(this); api.Register(this);
chatHeight = config.GetBindable<double>(OsuSetting.ChatDisplayHeight);
chatHeight.ValueChanged += h =>
{
Height = (float)h;
tabBackground.FadeTo(Height == 1 ? 1 : 0.8f, 200);
};
chatHeight.TriggerChange();
chatBackground.Colour = colours.ChatBlue;
} }
private long? lastMessageId; private long? lastMessageId;
private List<Channel> careChannels; private List<Channel> careChannels;
private readonly List<DrawableChannel> loadedChannels = new List<DrawableChannel>();
private void initializeChannels() private void initializeChannels()
{ {
Clear(); currentChannelContainer.Clear();
loadedChannels.Clear();
careChannels = new List<Channel>(); careChannels = new List<Channel>();
@ -160,18 +238,77 @@ namespace osu.Game.Overlays
Scheduler.Add(delegate Scheduler.Add(delegate
{ {
loading.FadeOut(100); loading.FadeOut(100);
addChannel(channels.Find(c => c.Name == @"#lazer")); addChannel(channels.Find(c => c.Name == @"#lazer"));
addChannel(channels.Find(c => c.Name == @"#osu"));
addChannel(channels.Find(c => c.Name == @"#lobby"));
}); });
messageRequest = Scheduler.AddDelayed(fetchNewMessages, 1000, true); messageRequest = Scheduler.AddDelayed(fetchNewMessages, 1000, true);
}; };
api.Queue(req); api.Queue(req);
} }
private Channel currentChannel;
protected Channel CurrentChannel
{
get
{
return currentChannel;
}
set
{
if (currentChannel == value) return;
if (currentChannel != null)
currentChannelContainer.Clear(false);
currentChannel = value;
var loaded = loadedChannels.Find(d => d.Channel == value);
if (loaded == null)
loadedChannels.Add(loaded = new DrawableChannel(currentChannel));
inputTextBox.Current.Disabled = currentChannel.ReadOnly;
currentChannelContainer.Add(loaded);
channelTabs.Current.Value = value;
}
}
private void addChannel(Channel channel) private void addChannel(Channel channel)
{ {
Add(new DrawableChannel(channel)); if (channel == null) return;
careChannels.Add(channel); careChannels.Add(channel);
channelTabs.AddItem(channel);
// we need to get a good number of messages initially for each channel we care about.
fetchInitialMessages(channel);
if (CurrentChannel == null)
CurrentChannel = channel;
}
private void fetchInitialMessages(Channel channel)
{
var req = new GetMessagesRequest(new List<Channel> { channel }, null);
req.Success += delegate (List<Message> messages)
{
channel.AddNewMessages(messages.ToArray());
Debug.Write("success!");
};
req.Failure += delegate
{
Debug.Write("failure!");
};
api.Queue(req);
} }
private void fetchNewMessages() private void fetchNewMessages()
@ -185,7 +322,7 @@ namespace osu.Game.Overlays
//batch messages per channel. //batch messages per channel.
foreach (var id in ids) foreach (var id in ids)
careChannels.Find(c => c.Id == id)?.AddNewMessages(messages.Where(m => m.TargetId == id)); careChannels.Find(c => c.Id == id)?.AddNewMessages(messages.Where(m => m.TargetId == id).ToArray());
lastMessageId = messages.LastOrDefault()?.Id ?? lastMessageId; lastMessageId = messages.LastOrDefault()?.Id ?? lastMessageId;
@ -205,12 +342,18 @@ namespace osu.Game.Overlays
{ {
var postText = textbox.Text; var postText = textbox.Text;
if (!string.IsNullOrEmpty(postText) && api.LocalUser.Value != null) if (string.IsNullOrEmpty(postText) || api.LocalUser.Value == null) return;
{
var currentChannel = careChannels.FirstOrDefault();
if (currentChannel == null) return; if (currentChannel == null) return;
if (postText[0] == '/')
{
// TODO: handle commands
currentChannel.AddNewMessages(new ErrorMessage("Chat commands are not supported yet!"));
textbox.Text = string.Empty;
return;
}
var message = new Message var message = new Message
{ {
Sender = api.LocalUser.Value, Sender = api.LocalUser.Value,
@ -231,7 +374,7 @@ namespace osu.Game.Overlays
req.Success += m => req.Success += m =>
{ {
currentChannel.AddNewMessages(new[] { m }); currentChannel.AddNewMessages(m);
textbox.ReadOnly = false; textbox.ReadOnly = false;
textbox.Text = string.Empty; textbox.Text = string.Empty;
@ -241,4 +384,3 @@ namespace osu.Game.Overlays
} }
} }
} }
}

View File

@ -6,7 +6,6 @@ using System.Linq;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
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.Input; using osu.Framework.Input;
using osu.Game.Graphics; using osu.Game.Graphics;

View File

@ -4,17 +4,16 @@
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.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.General; using osu.Game.Overlays.Settings.Sections.General;
using OpenTK.Graphics; using OpenTK.Graphics;
namespace osu.Game.Overlays namespace osu.Game.Overlays
{ {
internal class LoginOverlay : FocusedOverlayContainer internal class LoginOverlay : FocusedOverlayContainer
{ {
private LoginOptions optionsSection; private LoginSettings settingsSection;
private const float transition_time = 400; private const float transition_time = 400;
@ -42,7 +41,7 @@ namespace osu.Game.Overlays
AutoSizeEasing = EasingTypes.OutQuint, AutoSizeEasing = EasingTypes.OutQuint,
Children = new Drawable[] Children = new Drawable[]
{ {
optionsSection = new LoginOptions settingsSection = new LoginSettings
{ {
Padding = new MarginPadding(10), Padding = new MarginPadding(10),
}, },
@ -64,17 +63,17 @@ namespace osu.Game.Overlays
{ {
base.PopIn(); base.PopIn();
optionsSection.Bounding = true; settingsSection.Bounding = true;
FadeIn(transition_time, EasingTypes.OutQuint); FadeIn(transition_time, EasingTypes.OutQuint);
optionsSection.TriggerFocus(); settingsSection.TriggerFocus();
} }
protected override void PopOut() protected override void PopOut()
{ {
base.PopOut(); base.PopOut();
optionsSection.Bounding = false; settingsSection.Bounding = false;
FadeOut(transition_time); FadeOut(transition_time);
} }
} }

View File

@ -6,7 +6,6 @@ using OpenTK.Graphics;
using OpenTK.Input; using OpenTK.Input;
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.Input; using osu.Framework.Input;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;

View File

@ -8,7 +8,6 @@ using osu.Framework.Configuration;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
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.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Backgrounds;

View File

@ -6,11 +6,9 @@ using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
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.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Select;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
using System; using System;
@ -62,6 +60,7 @@ namespace osu.Game.Overlays.Music
protected override Color4 BackgroundUnfocused => backgroundColour; protected override Color4 BackgroundUnfocused => backgroundColour;
protected override Color4 BackgroundFocused => backgroundColour; protected override Color4 BackgroundFocused => backgroundColour;
protected override bool AllowCommit => true;
public FilterTextBox() public FilterTextBox()
{ {

View File

@ -5,7 +5,6 @@ using System;
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.Game.Database; using osu.Game.Database;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
@ -132,6 +131,10 @@ namespace osu.Game.Overlays.Music
FadeTo(matching ? 1 : 0, 200); FadeTo(matching ? 1 : 0, 200);
} }
get
{
return matching;
}
} }
} }
} }

View File

@ -22,6 +22,8 @@ namespace osu.Game.Overlays.Music
} }
} }
public BeatmapSetInfo FirstVisibleSet => items.Children.FirstOrDefault(i => i.MatchingCurrentFilter)?.BeatmapSetInfo;
private void itemSelected(BeatmapSetInfo b) private void itemSelected(BeatmapSetInfo b)
{ {
OnSelect?.Invoke(b); OnSelect?.Invoke(b);

View File

@ -10,7 +10,6 @@ using osu.Framework.Configuration;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
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.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Database; using osu.Game.Database;
@ -84,6 +83,11 @@ namespace osu.Game.Overlays.Music
list.BeatmapSets = BeatmapSets = beatmaps.GetAllWithChildren<BeatmapSetInfo>().ToList(); list.BeatmapSets = BeatmapSets = beatmaps.GetAllWithChildren<BeatmapSetInfo>().ToList();
beatmapBacking.BindTo(game.Beatmap); beatmapBacking.BindTo(game.Beatmap);
filter.Search.OnCommit = (sender, newText) => {
var beatmap = list.FirstVisibleSet?.Beatmaps?.FirstOrDefault();
if (beatmap != null) playSpecified(beatmap);
};
} }
protected override void LoadComplete() protected override void LoadComplete()

View File

@ -12,7 +12,6 @@ using osu.Framework.Configuration;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
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.Textures; using osu.Framework.Graphics.Textures;
using osu.Framework.Input; using osu.Framework.Input;

View File

@ -6,7 +6,6 @@ using osu.Framework.Allocation;
using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Extensions.IEnumerableExtensions;
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.Game.Overlays.Notifications; using osu.Game.Overlays.Notifications;
using OpenTK.Graphics; using OpenTK.Graphics;

View File

@ -7,7 +7,6 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Colour;
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.Transforms; using osu.Framework.Graphics.Transforms;
using osu.Framework.Input; using osu.Framework.Input;

View File

@ -8,7 +8,6 @@ using osu.Framework.Allocation;
using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Extensions.IEnumerableExtensions;
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.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using OpenTK; using OpenTK;

View File

@ -7,14 +7,14 @@ using osu.Framework.Graphics;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace osu.Game.Overlays.Options.Sections.Audio namespace osu.Game.Overlays.Settings.Sections.Audio
{ {
public class AudioDevicesOptions : OptionsSubsection public class AudioDevicesSettings : SettingsSubsection
{ {
protected override string Header => "Devices"; protected override string Header => "Devices";
private AudioManager audio; private AudioManager audio;
private OptionDropdown<string> dropdown; private SettingsDropdown<string> dropdown;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audio) private void load(AudioManager audio)
@ -56,7 +56,7 @@ namespace osu.Game.Overlays.Options.Sections.Audio
Children = new Drawable[] Children = new Drawable[]
{ {
dropdown = new OptionDropdown<string> dropdown = new SettingsDropdown<string>
{ {
Bindable = audio.AudioDevice Bindable = audio.AudioDevice
}, },

View File

@ -4,9 +4,9 @@
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Game.Configuration; using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Sections.Audio namespace osu.Game.Overlays.Settings.Sections.Audio
{ {
public class MainMenuOptions : OptionsSubsection public class MainMenuSettings : SettingsSubsection
{ {
protected override string Header => "Main Menu"; protected override string Header => "Main Menu";
@ -15,15 +15,15 @@ namespace osu.Game.Overlays.Options.Sections.Audio
{ {
Children = new[] Children = new[]
{ {
new OptionCheckbox new SettingsCheckbox
{ {
LabelText = "Interface voices", LabelText = "Interface voices",
Bindable = config.GetBindable<bool>(OsuConfig.MenuVoice) Bindable = config.GetBindable<bool>(OsuSetting.MenuVoice)
}, },
new OptionCheckbox new SettingsCheckbox
{ {
LabelText = "osu! music theme", LabelText = "osu! music theme",
Bindable = config.GetBindable<bool>(OsuConfig.MenuMusic) Bindable = config.GetBindable<bool>(OsuSetting.MenuMusic)
}, },
}; };
} }

View File

@ -6,9 +6,9 @@ using osu.Framework.Graphics;
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.Settings.Sections.Audio
{ {
public class OffsetOptions : OptionsSubsection public class OffsetSettings : SettingsSubsection
{ {
protected override string Header => "Offset Adjustment"; protected override string Header => "Offset Adjustment";
@ -17,10 +17,10 @@ namespace osu.Game.Overlays.Options.Sections.Audio
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new OptionSlider<double, OffsetSlider> new SettingsSlider<double, OffsetSlider>
{ {
LabelText = "Audio Offset", LabelText = "Audio Offset",
Bindable = config.GetBindable<double>(OsuConfig.AudioOffset) Bindable = config.GetBindable<double>(OsuSetting.AudioOffset)
}, },
new OsuButton new OsuButton
{ {

View File

@ -5,9 +5,9 @@ using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
using osu.Framework.Graphics; using osu.Framework.Graphics;
namespace osu.Game.Overlays.Options.Sections.Audio namespace osu.Game.Overlays.Settings.Sections.Audio
{ {
public class VolumeOptions : OptionsSubsection public class VolumeSettings : SettingsSubsection
{ {
protected override string Header => "Volume"; protected override string Header => "Volume";
@ -16,9 +16,9 @@ namespace osu.Game.Overlays.Options.Sections.Audio
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new OptionSlider<double> { LabelText = "Master", Bindable = audio.Volume }, new SettingsSlider<double> { LabelText = "Master", Bindable = audio.Volume },
new OptionSlider<double> { LabelText = "Effect", Bindable = audio.VolumeSample }, new SettingsSlider<double> { LabelText = "Effect", Bindable = audio.VolumeSample },
new OptionSlider<double> { LabelText = "Music", Bindable = audio.VolumeTrack }, new SettingsSlider<double> { LabelText = "Music", Bindable = audio.VolumeTrack },
}; };
} }
} }

View File

@ -3,11 +3,11 @@
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Audio; using osu.Game.Overlays.Settings.Sections.Audio;
namespace osu.Game.Overlays.Options.Sections namespace osu.Game.Overlays.Settings.Sections
{ {
public class AudioSection : OptionsSection public class AudioSection : SettingsSection
{ {
public override string Header => "Audio"; public override string Header => "Audio";
public override FontAwesome Icon => FontAwesome.fa_headphones; public override FontAwesome Icon => FontAwesome.fa_headphones;
@ -16,10 +16,10 @@ namespace osu.Game.Overlays.Options.Sections
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new AudioDevicesOptions(), new AudioDevicesSettings(),
new VolumeOptions(), new VolumeSettings(),
new OffsetOptions(), new OffsetSettings(),
new MainMenuOptions(), new MainMenuSettings(),
}; };
} }
} }

View File

@ -8,9 +8,9 @@ using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Sections.Debug namespace osu.Game.Overlays.Settings.Sections.Debug
{ {
public class GCOptions : OptionsSubsection public class GCSettings : SettingsSubsection
{ {
protected override string Header => "Garbage Collector"; protected override string Header => "Garbage Collector";
@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Options.Sections.Debug
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new OptionEnumDropdown<GCLatencyMode> new SettingsEnumDropdown<GCLatencyMode>
{ {
LabelText = "Active mode", LabelText = "Active mode",
Bindable = config.GetBindable<GCLatencyMode>(FrameworkDebugConfig.ActiveGCMode) Bindable = config.GetBindable<GCLatencyMode>(FrameworkDebugConfig.ActiveGCMode)

View File

@ -5,9 +5,9 @@ using osu.Framework.Allocation;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
namespace osu.Game.Overlays.Options.Sections.Debug namespace osu.Game.Overlays.Settings.Sections.Debug
{ {
public class GeneralOptions : OptionsSubsection public class GeneralSettings : SettingsSubsection
{ {
protected override string Header => "General"; protected override string Header => "General";
@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Options.Sections.Debug
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new OptionCheckbox new SettingsCheckbox
{ {
LabelText = "Bypass caching", LabelText = "Bypass caching",
Bindable = config.GetBindable<bool>(FrameworkDebugConfig.BypassCaching) Bindable = config.GetBindable<bool>(FrameworkDebugConfig.BypassCaching)

View File

@ -3,11 +3,11 @@
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Debug; using osu.Game.Overlays.Settings.Sections.Debug;
namespace osu.Game.Overlays.Options.Sections namespace osu.Game.Overlays.Settings.Sections
{ {
public class DebugSection : OptionsSection public class DebugSection : SettingsSection
{ {
public override string Header => "Debug"; public override string Header => "Debug";
public override FontAwesome Icon => FontAwesome.fa_bug; public override FontAwesome Icon => FontAwesome.fa_bug;
@ -16,8 +16,8 @@ namespace osu.Game.Overlays.Options.Sections
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new GeneralOptions(), new GeneralSettings(),
new GCOptions(), new GCSettings(),
}; };
} }
} }

View File

@ -5,9 +5,9 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Configuration; using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Sections.Gameplay namespace osu.Game.Overlays.Settings.Sections.Gameplay
{ {
public class GeneralOptions : OptionsSubsection public class GeneralSettings : SettingsSubsection
{ {
protected override string Header => "General"; protected override string Header => "General";
@ -16,20 +16,20 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new OptionSlider<double> new SettingsSlider<double>
{ {
LabelText = "Background dim", LabelText = "Background dim",
Bindable = config.GetBindable<double>(OsuConfig.DimLevel) Bindable = config.GetBindable<double>(OsuSetting.DimLevel)
}, },
new OptionCheckbox new SettingsCheckbox
{ {
LabelText = "Show score overlay", LabelText = "Show score overlay",
Bindable = config.GetBindable<bool>(OsuConfig.ShowInterface) Bindable = config.GetBindable<bool>(OsuSetting.ShowInterface)
}, },
new OptionCheckbox new SettingsCheckbox
{ {
LabelText = "Always show key overlay", LabelText = "Always show key overlay",
Bindable = config.GetBindable<bool>(OsuConfig.KeyOverlay) Bindable = config.GetBindable<bool>(OsuSetting.KeyOverlay)
}, },
}; };
} }

View File

@ -6,9 +6,9 @@ using osu.Framework.Graphics;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Sections.Gameplay namespace osu.Game.Overlays.Settings.Sections.Gameplay
{ {
public class SongSelectOptions : OptionsSubsection public class SongSelectSettings : SettingsSubsection
{ {
protected override string Header => "Song Select"; protected override string Header => "Song Select";
@ -17,15 +17,15 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new OptionSlider<double, StarSlider> new SettingsSlider<double, StarSlider>
{ {
LabelText = "Display beatmaps from", LabelText = "Display beatmaps from",
Bindable = config.GetBindable<double>(OsuConfig.DisplayStarsMinimum) Bindable = config.GetBindable<double>(OsuSetting.DisplayStarsMinimum)
}, },
new OptionSlider<double, StarSlider> new SettingsSlider<double, StarSlider>
{ {
LabelText = "up to", LabelText = "up to",
Bindable = config.GetBindable<double>(OsuConfig.DisplayStarsMaximum) Bindable = config.GetBindable<double>(OsuSetting.DisplayStarsMaximum)
}, },
}; };
} }

View File

@ -3,11 +3,11 @@
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Gameplay; using osu.Game.Overlays.Settings.Sections.Gameplay;
namespace osu.Game.Overlays.Options.Sections namespace osu.Game.Overlays.Settings.Sections
{ {
public class GameplaySection : OptionsSection public class GameplaySection : SettingsSection
{ {
public override string Header => "Gameplay"; public override string Header => "Gameplay";
public override FontAwesome Icon => FontAwesome.fa_circle_o; public override FontAwesome Icon => FontAwesome.fa_circle_o;
@ -16,8 +16,8 @@ namespace osu.Game.Overlays.Options.Sections
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new GeneralOptions(), new GeneralSettings(),
new SongSelectOptions(), new SongSelectSettings(),
}; };
} }
} }

View File

@ -5,9 +5,9 @@ using osu.Framework.Allocation;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
namespace osu.Game.Overlays.Options.Sections.General namespace osu.Game.Overlays.Settings.Sections.General
{ {
public class LanguageOptions : OptionsSubsection public class LanguageSettings : SettingsSubsection
{ {
protected override string Header => "Language"; protected override string Header => "Language";
@ -16,10 +16,10 @@ namespace osu.Game.Overlays.Options.Sections.General
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new OptionCheckbox new SettingsCheckbox
{ {
LabelText = "Prefer metadata in original language", LabelText = "Prefer metadata in original language",
Bindable = frameworkConfig.GetBindable<bool>(FrameworkConfig.ShowUnicode) Bindable = frameworkConfig.GetBindable<bool>(FrameworkSetting.ShowUnicode)
}, },
}; };
} }

View File

@ -13,9 +13,9 @@ using osu.Game.Online.API;
using OpenTK; using OpenTK;
using osu.Framework.Input; using osu.Framework.Input;
namespace osu.Game.Overlays.Options.Sections.General namespace osu.Game.Overlays.Settings.Sections.General
{ {
public class LoginOptions : OptionsSubsection, IOnlineComponent public class LoginSettings : SettingsSubsection, IOnlineComponent
{ {
private bool bounding = true; private bool bounding = true;
private LoginForm form; private LoginForm form;
@ -132,15 +132,15 @@ namespace osu.Game.Overlays.Options.Sections.General
TabbableContentContainer = this, TabbableContentContainer = this,
OnCommit = (sender, newText) => performLogin() OnCommit = (sender, newText) => performLogin()
}, },
new OptionCheckbox new SettingsCheckbox
{ {
LabelText = "Remember username", LabelText = "Remember username",
Bindable = config.GetBindable<bool>(OsuConfig.SaveUsername), Bindable = config.GetBindable<bool>(OsuSetting.SaveUsername),
}, },
new OptionCheckbox new SettingsCheckbox
{ {
LabelText = "Stay logged in", LabelText = "Stay logged in",
Bindable = config.GetBindable<bool>(OsuConfig.SavePassword), Bindable = config.GetBindable<bool>(OsuSetting.SavePassword),
}, },
new OsuButton new OsuButton
{ {

View File

@ -7,9 +7,9 @@ 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.Sections.General namespace osu.Game.Overlays.Settings.Sections.General
{ {
public class UpdateOptions : OptionsSubsection public class UpdateSettings : SettingsSubsection
{ {
protected override string Header => "Updates"; protected override string Header => "Updates";
@ -18,10 +18,10 @@ namespace osu.Game.Overlays.Options.Sections.General
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new OptionEnumDropdown<ReleaseStream> new SettingsEnumDropdown<ReleaseStream>
{ {
LabelText = "Release stream", LabelText = "Release stream",
Bindable = config.GetBindable<ReleaseStream>(OsuConfig.ReleaseStream), Bindable = config.GetBindable<ReleaseStream>(OsuSetting.ReleaseStream),
}, },
new OsuButton new OsuButton
{ {

View File

@ -3,11 +3,11 @@
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.General; using osu.Game.Overlays.Settings.Sections.General;
namespace osu.Game.Overlays.Options.Sections namespace osu.Game.Overlays.Settings.Sections
{ {
public class GeneralSection : OptionsSection public class GeneralSection : SettingsSection
{ {
public override string Header => "General"; public override string Header => "General";
public override FontAwesome Icon => FontAwesome.fa_gear; public override FontAwesome Icon => FontAwesome.fa_gear;
@ -16,8 +16,8 @@ namespace osu.Game.Overlays.Options.Sections
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new LanguageOptions(), new LanguageSettings(),
new UpdateOptions(), new UpdateSettings(),
}; };
} }
} }

View File

@ -5,9 +5,9 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Configuration; using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Sections.Graphics namespace osu.Game.Overlays.Settings.Sections.Graphics
{ {
public class DetailOptions : OptionsSubsection public class DetailSettings : SettingsSubsection
{ {
protected override string Header => "Detail Settings"; protected override string Header => "Detail Settings";
@ -16,15 +16,15 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new OptionCheckbox new SettingsCheckbox
{ {
LabelText = "Snaking in sliders", LabelText = "Snaking in sliders",
Bindable = config.GetBindable<bool>(OsuConfig.SnakingInSliders) Bindable = config.GetBindable<bool>(OsuSetting.SnakingInSliders)
}, },
new OptionCheckbox new SettingsCheckbox
{ {
LabelText = "Snaking out sliders", LabelText = "Snaking out sliders",
Bindable = config.GetBindable<bool>(OsuConfig.SnakingOutSliders) Bindable = config.GetBindable<bool>(OsuSetting.SnakingOutSliders)
}, },
}; };
} }

View File

@ -5,43 +5,43 @@ using osu.Framework.Allocation;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
namespace osu.Game.Overlays.Options.Sections.Graphics namespace osu.Game.Overlays.Settings.Sections.Graphics
{ {
public class LayoutOptions : OptionsSubsection public class LayoutSettings : SettingsSubsection
{ {
protected override string Header => "Layout"; protected override string Header => "Layout";
private OptionSlider<double> letterboxPositionX; private SettingsSlider<double> letterboxPositionX;
private OptionSlider<double> letterboxPositionY; private SettingsSlider<double> letterboxPositionY;
private Bindable<bool> letterboxing; private Bindable<bool> letterboxing;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(FrameworkConfigManager config) private void load(FrameworkConfigManager config)
{ {
letterboxing = config.GetBindable<bool>(FrameworkConfig.Letterboxing); letterboxing = config.GetBindable<bool>(FrameworkSetting.Letterboxing);
Children = new Drawable[] Children = new Drawable[]
{ {
new OptionEnumDropdown<WindowMode> new SettingsEnumDropdown<WindowMode>
{ {
LabelText = "Screen mode", LabelText = "Screen mode",
Bindable = config.GetBindable<WindowMode>(FrameworkConfig.WindowMode), Bindable = config.GetBindable<WindowMode>(FrameworkSetting.WindowMode),
}, },
new OptionCheckbox new SettingsCheckbox
{ {
LabelText = "Letterboxing", LabelText = "Letterboxing",
Bindable = letterboxing, Bindable = letterboxing,
}, },
letterboxPositionX = new OptionSlider<double> letterboxPositionX = new SettingsSlider<double>
{ {
LabelText = "Horizontal position", LabelText = "Horizontal position",
Bindable = config.GetBindable<double>(FrameworkConfig.LetterboxPositionX) Bindable = config.GetBindable<double>(FrameworkSetting.LetterboxPositionX)
}, },
letterboxPositionY = new OptionSlider<double> letterboxPositionY = new SettingsSlider<double>
{ {
LabelText = "Vertical position", LabelText = "Vertical position",
Bindable = config.GetBindable<double>(FrameworkConfig.LetterboxPositionY) Bindable = config.GetBindable<double>(FrameworkSetting.LetterboxPositionY)
}, },
}; };

View File

@ -4,9 +4,9 @@
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Game.Configuration; using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Sections.Graphics namespace osu.Game.Overlays.Settings.Sections.Graphics
{ {
public class MainMenuOptions : OptionsSubsection public class MainMenuSettings : SettingsSubsection
{ {
protected override string Header => "User Interface"; protected override string Header => "User Interface";
@ -15,10 +15,10 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
{ {
Children = new[] Children = new[]
{ {
new OptionCheckbox new SettingsCheckbox
{ {
LabelText = "Parallax", LabelText = "Parallax",
Bindable = config.GetBindable<bool>(OsuConfig.MenuParallax) Bindable = config.GetBindable<bool>(OsuSetting.MenuParallax)
}, },
}; };
} }

View File

@ -6,9 +6,9 @@ using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Configuration; using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Sections.Graphics namespace osu.Game.Overlays.Settings.Sections.Graphics
{ {
public class RendererOptions : OptionsSubsection public class RendererSettings : SettingsSubsection
{ {
protected override string Header => "Renderer"; protected override string Header => "Renderer";
@ -19,15 +19,15 @@ namespace osu.Game.Overlays.Options.Sections.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 OptionEnumDropdown<FrameSync> new SettingsEnumDropdown<FrameSync>
{ {
LabelText = "Frame limiter", LabelText = "Frame limiter",
Bindable = config.GetBindable<FrameSync>(FrameworkConfig.FrameSync) Bindable = config.GetBindable<FrameSync>(FrameworkSetting.FrameSync)
}, },
new OptionCheckbox new SettingsCheckbox
{ {
LabelText = "Show FPS", LabelText = "Show FPS",
Bindable = osuConfig.GetBindable<bool>(OsuConfig.ShowFpsDisplay) Bindable = osuConfig.GetBindable<bool>(OsuSetting.ShowFpsDisplay)
}, },
}; };
} }

View File

@ -3,11 +3,11 @@
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Graphics; using osu.Game.Overlays.Settings.Sections.Graphics;
namespace osu.Game.Overlays.Options.Sections namespace osu.Game.Overlays.Settings.Sections
{ {
public class GraphicsSection : OptionsSection public class GraphicsSection : SettingsSection
{ {
public override string Header => "Graphics"; public override string Header => "Graphics";
public override FontAwesome Icon => FontAwesome.fa_laptop; public override FontAwesome Icon => FontAwesome.fa_laptop;
@ -16,10 +16,10 @@ namespace osu.Game.Overlays.Options.Sections
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new RendererOptions(), new RendererSettings(),
new LayoutOptions(), new LayoutSettings(),
new DetailOptions(), new DetailSettings(),
new MainMenuOptions(), new MainMenuSettings(),
}; };
} }
} }

View File

@ -4,13 +4,13 @@
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Sections.Input namespace osu.Game.Overlays.Settings.Sections.Input
{ {
public class KeyboardOptions : OptionsSubsection public class KeyboardSettings : SettingsSubsection
{ {
protected override string Header => "Keyboard"; protected override string Header => "Keyboard";
public KeyboardOptions() public KeyboardSettings()
{ {
Children = new Drawable[] Children = new Drawable[]
{ {

View File

@ -8,9 +8,9 @@ using osu.Framework.Input;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Sections.Input namespace osu.Game.Overlays.Settings.Sections.Input
{ {
public class MouseOptions : OptionsSubsection public class MouseSettings : SettingsSubsection
{ {
protected override string Header => "Mouse"; protected override string Header => "Mouse";
@ -19,20 +19,20 @@ namespace osu.Game.Overlays.Options.Sections.Input
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new OptionEnumDropdown<ConfineMouseMode> new SettingsEnumDropdown<ConfineMouseMode>
{ {
LabelText = "Confine mouse cursor", LabelText = "Confine mouse cursor",
Bindable = config.GetBindable<ConfineMouseMode>(FrameworkConfig.ConfineMouseMode), Bindable = config.GetBindable<ConfineMouseMode>(FrameworkSetting.ConfineMouseMode),
}, },
new OptionCheckbox new SettingsCheckbox
{ {
LabelText = "Disable mouse wheel during gameplay", LabelText = "Disable mouse wheel during gameplay",
Bindable = osuConfig.GetBindable<bool>(OsuConfig.MouseDisableWheel) Bindable = osuConfig.GetBindable<bool>(OsuSetting.MouseDisableWheel)
}, },
new OptionCheckbox new SettingsCheckbox
{ {
LabelText = "Disable mouse buttons during gameplay", LabelText = "Disable mouse buttons during gameplay",
Bindable = osuConfig.GetBindable<bool>(OsuConfig.MouseDisableButtons) Bindable = osuConfig.GetBindable<bool>(OsuSetting.MouseDisableButtons)
}, },
}; };
} }

View File

@ -3,11 +3,11 @@
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Input; using osu.Game.Overlays.Settings.Sections.Input;
namespace osu.Game.Overlays.Options.Sections namespace osu.Game.Overlays.Settings.Sections
{ {
public class InputSection : OptionsSection public class InputSection : SettingsSection
{ {
public override string Header => "Input"; public override string Header => "Input";
public override FontAwesome Icon => FontAwesome.fa_keyboard_o; public override FontAwesome Icon => FontAwesome.fa_keyboard_o;
@ -16,8 +16,8 @@ namespace osu.Game.Overlays.Options.Sections
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new MouseOptions(), new MouseSettings(),
new KeyboardOptions(), new KeyboardSettings(),
}; };
} }
} }

View File

@ -5,9 +5,9 @@ using osu.Framework.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
using OpenTK; using OpenTK;
namespace osu.Game.Overlays.Options.Sections namespace osu.Game.Overlays.Settings.Sections
{ {
public class MaintenanceSection : OptionsSection public class MaintenanceSection : SettingsSection
{ {
public override string Header => "Maintenance"; public override string Header => "Maintenance";
public override FontAwesome Icon => FontAwesome.fa_wrench; public override FontAwesome Icon => FontAwesome.fa_wrench;

View File

@ -4,9 +4,9 @@
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
namespace osu.Game.Overlays.Options.Sections namespace osu.Game.Overlays.Settings.Sections
{ {
public class OnlineSection : OptionsSection public class OnlineSection : SettingsSection
{ {
public override string Header => "Online"; public override string Header => "Online";
public override FontAwesome Icon => FontAwesome.fa_globe; public override FontAwesome Icon => FontAwesome.fa_globe;

View File

@ -8,9 +8,9 @@ using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using OpenTK; using OpenTK;
namespace osu.Game.Overlays.Options.Sections namespace osu.Game.Overlays.Settings.Sections
{ {
public class SkinSection : OptionsSection public class SkinSection : SettingsSection
{ {
public override string Header => "Skin"; public override string Header => "Skin";
public override FontAwesome Icon => FontAwesome.fa_paint_brush; public override FontAwesome Icon => FontAwesome.fa_paint_brush;
@ -21,15 +21,20 @@ namespace osu.Game.Overlays.Options.Sections
FlowContent.Spacing = new Vector2(0, 5); FlowContent.Spacing = new Vector2(0, 5);
Children = new Drawable[] Children = new Drawable[]
{ {
new OptionSlider<double, SizeSlider> new SettingsSlider<double, SizeSlider>
{ {
LabelText = "Menu cursor size", LabelText = "Menu cursor size",
Bindable = config.GetBindable<double>(OsuConfig.MenuCursorSize) Bindable = config.GetBindable<double>(OsuSetting.MenuCursorSize)
}, },
new OptionSlider<double, SizeSlider> new SettingsSlider<double, SizeSlider>
{ {
LabelText = "Gameplay cursor size", LabelText = "Gameplay cursor size",
Bindable = config.GetBindable<double>(OsuConfig.GameplayCursorSize) Bindable = config.GetBindable<double>(OsuSetting.GameplayCursorSize)
},
new SettingsCheckbox
{
LabelText = "Adjust gameplay cursor size based on current beatmap",
Bindable = config.GetBindable<bool>(OsuSetting.AutoCursorSize)
}, },
}; };
} }

View File

@ -4,9 +4,9 @@
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Settings
{ {
public class OptionCheckbox : OptionItem<bool> public class SettingsCheckbox : SettingsItem<bool>
{ {
private OsuCheckbox checkbox; private OsuCheckbox checkbox;

View File

@ -3,13 +3,12 @@
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Settings
{ {
public class OptionDropdown<T> : OptionItem<T> public class SettingsDropdown<T> : SettingsItem<T>
{ {
private Dropdown<T> dropdown; private Dropdown<T> dropdown;

View File

@ -6,14 +6,14 @@ using System.Reflection;
using System.ComponentModel; using System.ComponentModel;
using System.Collections.Generic; using System.Collections.Generic;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Settings
{ {
public class OptionEnumDropdown<T> : OptionDropdown<T> public class SettingsEnumDropdown<T> : SettingsDropdown<T>
{ {
public OptionEnumDropdown() public SettingsEnumDropdown()
{ {
if (!typeof(T).IsEnum) if (!typeof(T).IsEnum)
throw new InvalidOperationException("OptionsDropdown only supports enums as the generic type argument"); throw new InvalidOperationException("SettingsDropdown only supports enums as the generic type argument");
List<KeyValuePair<string, T>> items = new List<KeyValuePair<string, T>>(); List<KeyValuePair<string, T>> items = new List<KeyValuePair<string, T>>();
foreach(var val in (T[])Enum.GetValues(typeof(T))) foreach(var val in (T[])Enum.GetValues(typeof(T)))

View File

@ -5,16 +5,15 @@ using System.Collections.Generic;
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.Game.Database; using osu.Game.Database;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Settings
{ {
public class OptionsFooter : FillFlowContainer public class SettingsFooter : FillFlowContainer
{ {
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuGameBase game, OsuColour colours, RulesetDatabase rulesets) private void load(OsuGameBase game, OsuColour colours, RulesetDatabase rulesets)

View File

@ -0,0 +1,107 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using OpenTK.Graphics;
namespace osu.Game.Overlays.Settings
{
public class SettingsHeader : Container
{
public SearchTextBox SearchTextBox;
private Box background;
private readonly Func<float> currentScrollOffset;
public Action Exit;
/// <param name="currentScrollOffset">A reference to the current scroll position of the ScrollContainer we are contained within.</param>
public SettingsHeader(Func<float> currentScrollOffset)
{
this.currentScrollOffset = currentScrollOffset;
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Children = new Drawable[]
{
background = new Box
{
Colour = Color4.Black,
RelativeSizeAxes = Axes.Both,
},
new FillFlowContainer
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
new OsuSpriteText
{
Text = "settings",
TextSize = 40,
Margin = new MarginPadding {
Left = SettingsOverlay.CONTENT_MARGINS,
Top = Toolbar.Toolbar.TOOLTIP_HEIGHT
},
},
new OsuSpriteText
{
Colour = colours.Pink,
Text = "Change the way osu! behaves",
TextSize = 18,
Margin = new MarginPadding {
Left = SettingsOverlay.CONTENT_MARGINS,
Bottom = 30
},
},
SearchTextBox = new SearchTextBox
{
RelativeSizeAxes = Axes.X,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Width = 0.95f,
Margin = new MarginPadding {
Top = 20,
Bottom = 20
},
Exit = () => Exit(),
},
}
}
};
}
protected override void UpdateAfterChildren()
{
base.UpdateAfterChildren();
// the point at which we will start anchoring to the top.
float anchorOffset = SearchTextBox.Y;
float scrollPosition = currentScrollOffset();
// we want to anchor the search field to the top of the screen when scrolling.
Margin = new MarginPadding { Top = Math.Max(0, scrollPosition - anchorOffset) };
// we don't want the header to scroll when scrolling beyond the upper extent.
Y = Math.Min(0, scrollPosition);
// we get darker as scroll progresses
background.Alpha = Math.Min(1, scrollPosition / anchorOffset) * 0.5f;
}
}
}

View File

@ -5,14 +5,13 @@ using OpenTK.Graphics;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.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.Graphics.Sprites; using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Settings
{ {
public abstract class OptionItem<T> : FillFlowContainer, IFilterable public abstract class SettingsItem<T> : FillFlowContainer, IFilterable
{ {
protected abstract Drawable CreateControl(); protected abstract Drawable CreateControl();
@ -37,7 +36,7 @@ namespace osu.Game.Overlays.Options
} }
} }
// hold a reference to the provided bindable so we don't have to in every options section. // hold a reference to the provided bindable so we don't have to in every settings section.
private Bindable<T> bindable; private Bindable<T> bindable;
public Bindable<T> Bindable public Bindable<T> Bindable
@ -65,7 +64,7 @@ namespace osu.Game.Overlays.Options
} }
} }
protected OptionItem() protected SettingsItem()
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;

View File

@ -5,9 +5,9 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Settings
{ {
internal class OptionLabel : OptionItem<string> internal class SettingsLabel : SettingsItem<string>
{ {
protected override Drawable CreateControl() => null; protected override Drawable CreateControl() => null;

View File

@ -6,14 +6,15 @@ using OpenTK.Graphics;
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.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using System.Collections.Generic;
using System.Linq;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Settings
{ {
public abstract class OptionsSection : Container public abstract class SettingsSection : Container, IHasFilterableChildren
{ {
protected FillFlowContainer FlowContent; protected FillFlowContainer FlowContent;
protected override Container<Drawable> Content => FlowContent; protected override Container<Drawable> Content => FlowContent;
@ -21,9 +22,19 @@ namespace osu.Game.Overlays.Options
public abstract FontAwesome Icon { get; } public abstract FontAwesome Icon { get; }
public abstract string Header { get; } public abstract string Header { get; }
public IEnumerable<IFilterable> FilterableChildren => Children.OfType<IFilterable>();
public string[] FilterTerms => new[] { Header };
public bool MatchingCurrentFilter
{
set
{
FadeTo(value ? 1 : 0);
}
}
private readonly SpriteText headerLabel; private readonly SpriteText headerLabel;
protected OptionsSection() protected SettingsSection()
{ {
Margin = new MarginPadding { Top = 20 }; Margin = new MarginPadding { Top = 20 };
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
@ -45,8 +56,8 @@ namespace osu.Game.Overlays.Options
Padding = new MarginPadding Padding = new MarginPadding
{ {
Top = 20 + border_size, Top = 20 + border_size,
Left = OptionsOverlay.CONTENT_MARGINS, Left = SettingsOverlay.CONTENT_MARGINS,
Right = OptionsOverlay.CONTENT_MARGINS, Right = SettingsOverlay.CONTENT_MARGINS,
Bottom = 10, Bottom = 10,
}, },
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,

View File

@ -2,18 +2,17 @@
// 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.Framework.Graphics.Primitives;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Settings
{ {
public class OptionSlider<T> : OptionSlider<T, OsuSliderBar<T>> public class SettingsSlider<T> : SettingsSlider<T, OsuSliderBar<T>>
where T : struct where T : struct
{ {
} }
public class OptionSlider<T, U> : OptionItem<T> public class SettingsSlider<T, U> : SettingsItem<T>
where T : struct where T : struct
where U : SliderBar<T>, new() where U : SliderBar<T>, new()
{ {

View File

@ -4,12 +4,13 @@
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.Primitives;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using System.Collections.Generic;
using System.Linq;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Settings
{ {
public abstract class OptionsSubsection : FillFlowContainer public abstract class SettingsSubsection : FillFlowContainer, IHasFilterableChildren
{ {
protected override Container<Drawable> Content => content; protected override Container<Drawable> Content => content;
@ -17,7 +18,17 @@ namespace osu.Game.Overlays.Options
protected abstract string Header { get; } protected abstract string Header { get; }
protected OptionsSubsection() public IEnumerable<IFilterable> FilterableChildren => Children.OfType<IFilterable>();
public string[] FilterTerms => new[] { Header };
public bool MatchingCurrentFilter
{
set
{
FadeTo(value ? 1 : 0);
}
}
protected SettingsSubsection()
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;

View File

@ -4,9 +4,9 @@
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Settings
{ {
public class OptionTextBox : OptionItem<string> public class SettingsTextBox : SettingsItem<string>
{ {
protected override Drawable CreateControl() => new OsuTextBox(); protected override Drawable CreateControl() => new OsuTextBox();
} }

View File

@ -10,7 +10,7 @@ using osu.Framework.Input;
using osu.Framework.Threading; using osu.Framework.Threading;
using osu.Game.Overlays.Toolbar; using osu.Game.Overlays.Toolbar;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Settings
{ {
public class Sidebar : Container public class Sidebar : Container
{ {

View File

@ -12,7 +12,7 @@ using osu.Framework.Input;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Settings
{ {
public class SidebarButton : Container public class SidebarButton : Container
{ {
@ -23,8 +23,8 @@ namespace osu.Game.Overlays.Options
private readonly Container text; private readonly Container text;
public Action Action; public Action Action;
private OptionsSection section; private SettingsSection section;
public OptionsSection Section public SettingsSection Section
{ {
get get
{ {

View File

@ -6,17 +6,15 @@ using OpenTK.Graphics;
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.Game.Overlays.Options; using osu.Game.Overlays.Settings;
using System; using System;
using osu.Game.Graphics; using osu.Game.Overlays.Settings.Sections;
using osu.Game.Graphics.Sprites; using osu.Framework.Input;
using osu.Game.Overlays.Options.Sections;
namespace osu.Game.Overlays namespace osu.Game.Overlays
{ {
public class OptionsOverlay : FocusedOverlayContainer public class SettingsOverlay : FocusedOverlayContainer
{ {
internal const float CONTENT_MARGINS = 10; internal const float CONTENT_MARGINS = 10;
@ -31,19 +29,26 @@ namespace osu.Game.Overlays
private ScrollContainer scrollContainer; private ScrollContainer scrollContainer;
private Sidebar sidebar; private Sidebar sidebar;
private SidebarButton[] sidebarButtons; private SidebarButton[] sidebarButtons;
private OptionsSection[] sections; private SettingsSection[] sections;
private SettingsHeader header;
private SettingsFooter footer;
private SearchContainer searchContainer;
private float lastKnownScroll; private float lastKnownScroll;
public OptionsOverlay() public SettingsOverlay()
{ {
RelativeSizeAxes = Axes.Y; RelativeSizeAxes = Axes.Y;
AutoSizeAxes = Axes.X; AutoSizeAxes = Axes.X;
} }
[BackgroundDependencyLoader(permitNulls: true)] [BackgroundDependencyLoader(permitNulls: true)]
private void load(OsuGame game, OsuColour colours) private void load(OsuGame game)
{ {
sections = new OptionsSection[] sections = new SettingsSection[]
{ {
new GeneralSection(), new GeneralSection(),
new GraphicsSection(), new GraphicsSection(),
@ -69,39 +74,20 @@ namespace osu.Game.Overlays
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
Width = width, Width = width,
Margin = new MarginPadding { Left = SIDEBAR_WIDTH }, Margin = new MarginPadding { Left = SIDEBAR_WIDTH },
Children = new[]
{
new FillFlowContainer
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FillDirection.Vertical,
Children = new Drawable[] Children = new Drawable[]
{ {
new OsuSpriteText searchContainer = new SearchContainer
{
Text = "settings",
TextSize = 40,
Margin = new MarginPadding { Left = CONTENT_MARGINS, Top = Toolbar.Toolbar.TOOLTIP_HEIGHT },
},
new OsuSpriteText
{
Colour = colours.Pink,
Text = "Change the way osu! behaves",
TextSize = 18,
Margin = new MarginPadding { Left = CONTENT_MARGINS, Bottom = 30 },
},
new FillFlowContainer
{ {
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Children = sections, Children = sections,
}, },
new OptionsFooter() footer = new SettingsFooter(),
} header = new SettingsHeader(() => scrollContainer.Current)
} {
Exit = Hide,
},
} }
}, },
sidebar = new Sidebar sidebar = new Sidebar
@ -118,9 +104,20 @@ namespace osu.Game.Overlays
} }
}; };
header.SearchTextBox.Current.ValueChanged += newValue => searchContainer.SearchTerm = newValue;
scrollContainer.Padding = new MarginPadding { Top = game?.Toolbar.DrawHeight ?? 0 }; scrollContainer.Padding = new MarginPadding { Top = game?.Toolbar.DrawHeight ?? 0 };
} }
protected override void UpdateAfterChildren()
{
base.UpdateAfterChildren();
//we need to update these manually because we can't put the SettingsHeader inside the SearchContainer (due to its anchoring).
searchContainer.Y = header.DrawHeight;
footer.Y = searchContainer.Y + searchContainer.DrawHeight;
}
protected override void Update() protected override void Update()
{ {
base.Update(); base.Update();
@ -130,10 +127,10 @@ namespace osu.Game.Overlays
{ {
lastKnownScroll = currentScroll; lastKnownScroll = currentScroll;
OptionsSection bestCandidate = null; SettingsSection bestCandidate = null;
float bestDistance = float.MaxValue; float bestDistance = float.MaxValue;
foreach (OptionsSection section in sections) foreach (SettingsSection section in sections)
{ {
float distance = Math.Abs(scrollContainer.GetChildPosInContent(section) - currentScroll); float distance = Math.Abs(scrollContainer.GetChildPosInContent(section) - currentScroll);
if (distance < bestDistance) if (distance < bestDistance)
@ -157,6 +154,8 @@ namespace osu.Game.Overlays
scrollContainer.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint); scrollContainer.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint);
sidebar.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint); sidebar.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint);
FadeTo(1, TRANSITION_LENGTH / 2); FadeTo(1, TRANSITION_LENGTH / 2);
header.SearchTextBox.HoldFocus = true;
} }
protected override void PopOut() protected override void PopOut()
@ -166,6 +165,15 @@ namespace osu.Game.Overlays
scrollContainer.MoveToX(-width, TRANSITION_LENGTH, EasingTypes.OutQuint); scrollContainer.MoveToX(-width, TRANSITION_LENGTH, EasingTypes.OutQuint);
sidebar.MoveToX(-SIDEBAR_WIDTH, TRANSITION_LENGTH, EasingTypes.OutQuint); sidebar.MoveToX(-SIDEBAR_WIDTH, TRANSITION_LENGTH, EasingTypes.OutQuint);
FadeTo(0, TRANSITION_LENGTH / 2); FadeTo(0, TRANSITION_LENGTH / 2);
header.SearchTextBox.HoldFocus = false;
header.SearchTextBox.TriggerFocusLost();
}
protected override bool OnFocus(InputState state)
{
header.SearchTextBox.TriggerFocus(state);
return false;
} }
} }
} }

View File

@ -8,7 +8,6 @@ using osu.Framework.Audio.Sample;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
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.Input; using osu.Framework.Input;
using osu.Game.Graphics; using osu.Game.Graphics;

View File

@ -6,7 +6,6 @@ using osu.Framework.Allocation;
using osu.Framework.Caching; using osu.Framework.Caching;
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.Game.Database; using osu.Game.Database;
using OpenTK; using OpenTK;

View File

@ -16,9 +16,9 @@ namespace osu.Game.Overlays.Toolbar
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OptionsOverlay options) private void load(SettingsOverlay settings)
{ {
StateContainer = options; StateContainer = settings;
} }
} }
} }

View File

@ -82,7 +82,7 @@ namespace osu.Game.Screens.Menu
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Children = new[] Children = new[]
{ {
settingsButton = new Button(@"settings", @"options", FontAwesome.fa_gear, new Color4(85, 85, 85, 255), () => OnSettings?.Invoke(), -WEDGE_WIDTH, Key.O), settingsButton = new Button(@"settings", @"settings", FontAwesome.fa_gear, new Color4(85, 85, 85, 255), () => OnSettings?.Invoke(), -WEDGE_WIDTH, Key.O),
backButton = new Button(@"back", @"back", FontAwesome.fa_osu_left_o, new Color4(51, 58, 94, 255), onBack, -WEDGE_WIDTH), backButton = new Button(@"back", @"back", FontAwesome.fa_osu_left_o, new Color4(51, 58, 94, 255), onBack, -WEDGE_WIDTH),
iconFacade = new Container //need a container to make the osu! icon flow properly. iconFacade = new Container //need a container to make the osu! icon flow properly.
{ {
@ -245,8 +245,14 @@ namespace osu.Game.Screens.Menu
buttonArea.FadeIn(300); buttonArea.FadeIn(300);
if (lastState == MenuState.Initial) if (lastState == MenuState.Initial)
{
buttonArea.Delay(150, true); buttonArea.Delay(150, true);
if (osuLogo.Scale.X > 0.5f)
using (osuLogo.BeginDelayedSequence(200, true))
osuLogo.Impact();
}
Scheduler.AddDelayed(() => toolbar?.Show(), 150); Scheduler.AddDelayed(() => toolbar?.Show(), 150);
foreach (Button b in buttonsTopLevel) foreach (Button b in buttonsTopLevel)

View File

@ -4,7 +4,6 @@
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.Screens; using osu.Framework.Screens;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;

View File

@ -64,8 +64,8 @@ namespace osu.Game.Screens.Menu
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audio, OsuConfigManager config) private void load(AudioManager audio, OsuConfigManager config)
{ {
menuVoice = config.GetBindable<bool>(OsuConfig.MenuVoice); menuVoice = config.GetBindable<bool>(OsuSetting.MenuVoice);
menuMusic = config.GetBindable<bool>(OsuConfig.MenuMusic); menuMusic = config.GetBindable<bool>(OsuSetting.MenuMusic);
bgm = audio.Track.Get(@"circles"); bgm = audio.Track.Get(@"circles");
bgm.Looping = true; bgm.Looping = true;

Some files were not shown because too many files have changed in this diff Show More