diff --git a/osu-framework b/osu-framework index 92b49515ee..2b9a56e8b3 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 92b49515eeae2f6a7c96247b8c3eda97e5514780 +Subproject commit 2b9a56e8b3bb6c99bf4c75307639e6726fe8d3ec diff --git a/osu-resources b/osu-resources index ca807cf81a..c0781d1d55 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit ca807cf81ae3706972937d4e1009376cfaa0b266 +Subproject commit c0781d1d557c3e5a00f6cf1780049e382f92c0c8 diff --git a/osu.Desktop.VisualTests/OpenTK.dll.config b/osu.Desktop.VisualTests/OpenTK.dll.config new file mode 100644 index 0000000000..5620e3d9e2 --- /dev/null +++ b/osu.Desktop.VisualTests/OpenTK.dll.config @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/osu.Desktop.VisualTests/Tests/TestCaseOptions.cs b/osu.Desktop.VisualTests/Tests/TestCaseOptions.cs new file mode 100644 index 0000000000..781c3034fa --- /dev/null +++ b/osu.Desktop.VisualTests/Tests/TestCaseOptions.cs @@ -0,0 +1,29 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.GameModes.Testing; +using osu.Framework.Graphics; +using osu.Game.Graphics.UserInterface; +using OpenTK.Input; +using osu.Game.Overlays; +using osu.Framework.Graphics.Containers; + +namespace osu.Desktop.VisualTests.Tests +{ + class TestCaseOptions : TestCase + { + public override string Name => @"Options"; + + public override string Description => @"Tests the options overlay"; + + private OptionsOverlay options; + + public override void Reset() + { + base.Reset(); + + Children = new[] { options = new OptionsOverlay() }; + options.ToggleVisibility(); + } + } +} diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index 65fb72e2a6..9e23ee97b9 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -80,13 +80,9 @@ - - $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1337\lib\net20\OpenTK.dll - True - False - ..\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll + $(SolutionDir)\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll @@ -101,12 +97,18 @@ $(SolutionDir)\packages\SQLite.Net-PCL.3.1.1\lib\net40\SQLite.Net.Platform.Generic.dll + + $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll + + + osu.licenseheader + @@ -166,6 +168,7 @@ + diff --git a/osu.Desktop.VisualTests/packages.config b/osu.Desktop.VisualTests/packages.config index 8c24263ce5..720b1d8382 100644 --- a/osu.Desktop.VisualTests/packages.config +++ b/osu.Desktop.VisualTests/packages.config @@ -1,6 +1,7 @@  + diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index e1b3397c42..319f565938 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -2,6 +2,7 @@ //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; +using osu.Framework.Platform; using osu.Game.GameModes.Play; using osu.Game.Online.API; @@ -13,31 +14,322 @@ namespace osu.Game.Configuration { Set(OsuConfig.Width, 1366, 640); Set(OsuConfig.Height, 768, 480); - Set(OsuConfig.MouseSensitivity, 1.0); + Set(OsuConfig.MouseSpeed, 1.0); Set(OsuConfig.Username, string.Empty); Set(OsuConfig.Password, string.Empty); Set(OsuConfig.Token, string.Empty); Set(OsuConfig.PlayMode, PlayMode.Osu); - - Set(OsuConfig.VolumeGlobal, 0.8, 0, 1); + + Set(OsuConfig.BeatmapDirectory, @"Songs"); // TODO: use this + + Set(OsuConfig.VolumeUniversal, 0.8, 0, 1); Set(OsuConfig.VolumeMusic, 1.0, 0, 1); Set(OsuConfig.VolumeEffect, 1.0, 0, 1); + + Set(OsuConfig.AllowPublicInvites, true); + Set(OsuConfig.AutoChatHide, true); + Set(OsuConfig.AutomaticDownload, true); + Set(OsuConfig.AutomaticDownloadNoVideo, false); + Set(OsuConfig.BlockNonFriendPM, false); + Set(OsuConfig.BloomSoftening, false); + Set(OsuConfig.BossKeyFirstActivation, true); + Set(OsuConfig.ChatAudibleHighlight, true); + Set(OsuConfig.ChatChannels, string.Empty); + Set(OsuConfig.ChatFilter, false); + Set(OsuConfig.ChatHighlightName, true); + Set(OsuConfig.ChatMessageNotification, true); + Set(OsuConfig.ChatLastChannel, string.Empty); + Set(OsuConfig.ChatRemoveForeign, false); + //Set(OsuConfig.ChatSortMode, UserSortMode.Rank); + Set(OsuConfig.ComboBurst, true); + Set(OsuConfig.ComboFire, false); + Set(OsuConfig.ComboFireHeight, 3); + Set(OsuConfig.ConfirmExit, false); + Set(OsuConfig.AutoSendNowPlaying, true); + Set(OsuConfig.CursorSize, 1.0, 0.5f, 2); + Set(OsuConfig.AutomaticCursorSizing, false); + Set(OsuConfig.DimLevel, 30, 0, 100); + Set(OsuConfig.Display, 1); + Set(OsuConfig.DisplayCityLocation, false); + Set(OsuConfig.DistanceSpacingEnabled, true); + Set(OsuConfig.EditorTip, 0); + Set(OsuConfig.VideoEditor, Get(OsuConfig.Fullscreen)); + Set(OsuConfig.EditorDefaultSkin, false); + Set(OsuConfig.EditorSnakingSliders, true); + Set(OsuConfig.EditorHitAnimations, false); + Set(OsuConfig.EditorFollowPoints, true); + Set(OsuConfig.EditorStacking, true); + Set(OsuConfig.ForceSliderRendering, false); + Set(OsuConfig.FpsCounter, false); + Set(OsuConfig.FrameTimeDisplay, false); + Set(OsuConfig.GuideTips, @""); + Set(OsuConfig.CursorRipple, false); + Set(OsuConfig.HighlightWords, string.Empty); + Set(OsuConfig.HighResolution, false); + Set(OsuConfig.HitLighting, true); + Set(OsuConfig.IgnoreBarline, false); + Set(OsuConfig.IgnoreBeatmapSamples, false); + Set(OsuConfig.IgnoreBeatmapSkins, false); + Set(OsuConfig.IgnoreList, string.Empty); + Set(OsuConfig.KeyOverlay, false); + Set(OsuConfig.Language, @"unknown"); + Set(OsuConfig.AllowNowPlayingHighlights, false); + Set(OsuConfig.LastVersion, string.Empty); + Set(OsuConfig.LastVersionPermissionsFailed, string.Empty); + Set(OsuConfig.LoadSubmittedThread, true); + Set(OsuConfig.LobbyPlayMode, -1); + Set(OsuConfig.ShowInterface, true); + Set(OsuConfig.ShowInterfaceDuringRelax, false); + Set(OsuConfig.LobbyShowExistingOnly, false); + Set(OsuConfig.LobbyShowFriendsOnly, false); + Set(OsuConfig.LobbyShowFull, false); + Set(OsuConfig.LobbyShowInProgress, true); + Set(OsuConfig.LobbyShowPassworded, true); + Set(OsuConfig.LogPrivateMessages, false); + Set(OsuConfig.LowResolution, false); + //Set(OsuConfig.ManiaSpeed, SpeedMania.SPEED_DEFAULT, SpeedMania.SPEED_MIN, SpeedMania.SPEED_MAX); + Set(OsuConfig.UsePerBeatmapManiaSpeed, true); + Set(OsuConfig.ManiaSpeedBPMScale, true); + Set(OsuConfig.MenuTip, 0); + Set(OsuConfig.MouseDisableButtons, false); + Set(OsuConfig.MouseDisableWheel, false); + Set(OsuConfig.MouseSpeed, 1, 0.4, 6); + Set(OsuConfig.Offset, 0, -300, 300); + //Set(OsuConfig.ScoreMeterScale, 1, 0.5, OsuGame.Tournament ? 10 : 2); + Set(OsuConfig.DistanceSpacing, 0.8, 0.1, 6); + Set(OsuConfig.EditorBeatDivisor, 1, 1, 16); + Set(OsuConfig.EditorGridSize, 32, 4, 32); + Set(OsuConfig.EditorGridSizeDesign, 32, 4, 32); + Set(OsuConfig.HeightFullscreen, 9999, 240, 9999); + Set(OsuConfig.CustomFrameLimit, 240, 240, 999); + Set(OsuConfig.WidthFullscreen, 9999, 320, 9999); + Set(OsuConfig.MsnIntegration, false); + Set(OsuConfig.MyPcSucks, false); + Set(OsuConfig.NotifyFriends, true); + Set(OsuConfig.NotifySubmittedThread, true); + Set(OsuConfig.PopupDuringGameplay, true); + //Set(OsuConfig.ProgressBarType, ProgressBarTypes.Pie); + //Set(OsuConfig.RankType, RankingType.Top); + Set(OsuConfig.RefreshRate, 60); + Set(OsuConfig.OverrideRefreshRate, Get(OsuConfig.RefreshRate) != 60); + //Set(OsuConfig.ScaleMode, ScaleMode.WidescreenConservative); + Set(OsuConfig.ScoreboardVisible, true); + //Set(OsuConfig.ScoreMeter, OsuGame.Tournament ? ScoreMeterType.Colour : ScoreMeterType.Error); + Set(OsuConfig.ScreenshotId, 0); + Set(OsuConfig.MenuSnow, false); + Set(OsuConfig.MenuTriangles, true); + Set(OsuConfig.SongSelectThumbnails, true); + //Set(OsuConfig.ScreenshotFormat, ImageFileFormat.Jpg); + Set(OsuConfig.ShowReplayComments, true); + Set(OsuConfig.ShowSpectators, true); + Set(OsuConfig.ShowStoryboard, true); + //Set(OsuConfig.Skin, SkinManager.DEFAULT_SKIN); + Set(OsuConfig.SkinSamples, true); + Set(OsuConfig.SkipTablet, false); + Set(OsuConfig.SnakingSliders, true); + Set(OsuConfig.Tablet, false); + Set(OsuConfig.UpdatePending, false); + Set(OsuConfig.UseSkinCursor, false); + Set(OsuConfig.UseTaikoSkin, false); + Set(OsuConfig.Video, true); + Set(OsuConfig.Wiimote, false); + Set(OsuConfig.YahooIntegration, false); + Set(OsuConfig.ForceFrameFlush, false); + Set(OsuConfig.DetectPerformanceIssues, true); + Set(OsuConfig.Fullscreen, true); + Set(OsuConfig.MenuMusic, true); + Set(OsuConfig.MenuVoice, true); + Set(OsuConfig.MenuParallax, true); + Set(OsuConfig.RawInput, false); + Set(OsuConfig.AbsoluteToOsuWindow, Get(OsuConfig.RawInput)); + Set(OsuConfig.ShowMenuTips, true); + Set(OsuConfig.HiddenShowFirstApproach, true); + Set(OsuConfig.ComboColourSliderBall, true); + Set(OsuConfig.AlternativeChatFont, false); + Set(OsuConfig.Password, string.Empty); + Set(OsuConfig.Username, string.Empty); + Set(OsuConfig.DisplayStarsMaximum, 10, 0, 10); + Set(OsuConfig.DisplayStarsMinimum, 0, 0, 10); + Set(OsuConfig.AudioDevice, string.Empty); + //Set(OsuConfig.ReleaseStream, ReleaseStream.Lazer, true); + Set(OsuConfig.UpdateFailCount, 0); + //Set(OsuConfig.SavePassword, Password != null); + Set(OsuConfig.SaveUsername, true); + //Set(OsuConfig.TreeSortMode, TreeGroupMode.Show_All); + //Set(OsuConfig.TreeSortMode2, TreeSortMode.Title); + Set(OsuConfig.Letterboxing, Get(OsuConfig.Fullscreen)); + Set(OsuConfig.LetterboxPositionX, 0, -100, 100); + Set(OsuConfig.LetterboxPositionY, 0, -100, 100); + //Set(OsuConfig.FrameSync, FrameSync.Limit120); + //Set(OsuConfig.ShowUnicode, unicodeDefault); + Set(OsuConfig.PermanentSongInfo, false); + Set(OsuConfig.Ticker, false); + Set(OsuConfig.CompatibilityContext, false); + Set(OsuConfig.CanForceOptimusCompatibility, true); + } + + public OsuConfigManager(BasicStorage storage) : base(storage) + { } } enum OsuConfig { - Width, - Height, - MouseSensitivity, - Username, - Password, - Token, + // New osu: PlayMode, - VolumeGlobal, + Token, + // Imported from old osu: + BeatmapDirectory, + VolumeUniversal, VolumeEffect, - VolumeMusic + VolumeMusic, + AllowPublicInvites, + AutoChatHide, + AutomaticDownload, + AutomaticDownloadNoVideo, + BlockNonFriendPM, + Bloom, + BloomSoftening, + BossKeyFirstActivation, + ChatAudibleHighlight, + ChatChannels, + ChatFilter, + ChatHighlightName, + ChatMessageNotification, + ChatLastChannel, + ChatRemoveForeign, + ChatSortMode, + ComboBurst, + ComboFire, + ComboFireHeight, + ConfirmExit, + AutoSendNowPlaying, + CursorSize, + AutomaticCursorSizing, + DimLevel, + Display, + DisplayCityLocation, + DistanceSpacingEnabled, + EditorTip, + VideoEditor, + EditorDefaultSkin, + EditorSnakingSliders, + EditorHitAnimations, + EditorFollowPoints, + EditorStacking, + ForceSliderRendering, + FpsCounter, + FrameTimeDisplay, + GuideTips, + CursorRipple, + HighlightWords, + HighResolution, + HitLighting, + IgnoreBarline, + IgnoreBeatmapSamples, + IgnoreBeatmapSkins, + IgnoreList, + KeyOverlay, + Language, + LastPlayMode, + AllowNowPlayingHighlights, + LastVersion, + LastVersionPermissionsFailed, + LoadSubmittedThread, + LobbyPlayMode, + ShowInterface, + ShowInterfaceDuringRelax, + LobbyShowExistingOnly, + LobbyShowFriendsOnly, + LobbyShowFull, + LobbyShowInProgress, + LobbyShowPassworded, + LogPrivateMessages, + LowResolution, + ManiaSpeed, + UsePerBeatmapManiaSpeed, + ManiaSpeedBPMScale, + MenuTip, + MouseDisableButtons, + MouseDisableWheel, + MouseSpeed, + Offset, + ScoreMeterScale, + DistanceSpacing, + EditorBeatDivisor, + EditorGridSize, + EditorGridSizeDesign, + Height, + Width, + HeightFullscreen, + CustomFrameLimit, + WidthFullscreen, + MsnIntegration, + MyPcSucks, + NotifyFriends, + NotifySubmittedThread, + PopupDuringGameplay, + ProgressBarType, + RankType, + RefreshRate, + OverrideRefreshRate, + ScaleMode, + ScoreboardVisible, + ScoreMeter, + ScreenshotId, + MenuSnow, + MenuTriangles, + SongSelectThumbnails, + ScreenshotFormat, + ShowReplayComments, + ShowSpectators, + ShowStoryboard, + Skin, + SkinSamples, + SkipTablet, + SnakingSliders, + Tablet, + UpdatePending, + UserFilter, + UseSkinCursor, + UseTaikoSkin, + Video, + Wiimote, + YahooIntegration, + ForceFrameFlush, + DetectPerformanceIssues, + Fullscreen, + MenuMusic, + MenuVoice, + MenuParallax, + RawInput, + AbsoluteToOsuWindow, + ConfineMouse, + ShowMenuTips, + HiddenShowFirstApproach, + ComboColourSliderBall, + AlternativeChatFont, + Password, + Username, + DisplayStarsMaximum, + DisplayStarsMinimum, + AudioDevice, + ReleaseStream, + UpdateFailCount, + SavePassword, + SaveUsername, + TreeSortMode, + TreeSortMode2, + Letterboxing, + LetterboxPositionX, + LetterboxPositionY, + FrameSync, + ShowUnicode, + PermanentSongInfo, + Ticker, + CompatibilityContext, + CanForceOptimusCompatibility, } } diff --git a/osu.Game/GameModes/Menu/ButtonSystem.cs b/osu.Game/GameModes/Menu/ButtonSystem.cs index 25371cb506..10ccf864e6 100644 --- a/osu.Game/GameModes/Menu/ButtonSystem.cs +++ b/osu.Game/GameModes/Menu/ButtonSystem.cs @@ -84,7 +84,7 @@ namespace osu.Game.GameModes.Menu Spacing = new Vector2(-wedge_width, 0), Children = new[] { - settingsButton = new Button(@"settings", @"options", FontAwesome.gear, new Color4(85, 85, 85, 255), OnSettings, -wedge_width, Key.O), + settingsButton = new Button(@"settings", @"options", FontAwesome.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, Key.Escape), iconFacade = new Container //need a container to make the osu! icon flow properly. { diff --git a/osu.Game/Graphics/UserInterface/LoadingAnimation.cs b/osu.Game/Graphics/UserInterface/LoadingAnimation.cs new file mode 100644 index 0000000000..2edc5397f4 --- /dev/null +++ b/osu.Game/Graphics/UserInterface/LoadingAnimation.cs @@ -0,0 +1,13 @@ +using System; +using osu.Framework.Graphics.Sprites; + +namespace osu.Game.Graphics.UserInterface +{ + public class LoadingAnimation : SpriteText + { + public LoadingAnimation() + { + Text = "Loading"; + } + } +} \ No newline at end of file diff --git a/osu.Game/Graphics/UserInterface/OsuButton.cs b/osu.Game/Graphics/UserInterface/OsuButton.cs new file mode 100644 index 0000000000..fea9f907bc --- /dev/null +++ b/osu.Game/Graphics/UserInterface/OsuButton.cs @@ -0,0 +1,15 @@ +using System; +using OpenTK.Graphics; +using osu.Framework.Graphics.UserInterface; + +namespace osu.Game.Graphics.UserInterface +{ + public class OsuButton : Button + { + public OsuButton() + { + Height = 25; + Colour = new Color4(14, 132, 165, 255); + } + } +} \ No newline at end of file diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index af078395df..7f14c6c942 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -61,7 +61,7 @@ namespace osu.Game Schedule(delegate { Beatmaps.Import(args); }); //attach our bindables to the audio subsystem. - Audio.Volume.Weld(Config.GetBindable(OsuConfig.VolumeGlobal)); + Audio.Volume.Weld(Config.GetBindable(OsuConfig.VolumeUniversal)); Audio.VolumeSample.Weld(Config.GetBindable(OsuConfig.VolumeEffect)); Audio.VolumeTrack.Weld(Config.GetBindable(OsuConfig.VolumeMusic)); diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 7a4c72715e..a506044bee 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Textures; using osu.Framework.IO.Stores; +using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Beatmaps.IO; using osu.Game.Configuration; @@ -21,12 +22,12 @@ namespace osu.Game { public class OsuGameBase : BaseGame { - internal OsuConfigManager Config = new OsuConfigManager(); + internal OsuConfigManager Config; public BeatmapDatabase Beatmaps { get; private set; } protected override string MainResourceFile => @"osu.Game.Resources.dll"; - public Options Options; + public OptionsOverlay Options; public APIAccess API; protected override Container Content => ratioContainer; @@ -43,7 +44,7 @@ namespace osu.Game Children = new Drawable[] { - Options = new Options(), + Options = new OptionsOverlay(), Cursor = new OsuCursorContainer() }; @@ -76,6 +77,13 @@ namespace osu.Game }; } + public override void SetHost(BasicGameHost host) + { + if (Config == null) + Config = new OsuConfigManager(host.Storage); + base.SetHost(host); + } + protected override void Update() { base.Update(); diff --git a/osu.Game/Overlays/Options.cs b/osu.Game/Overlays/Options.cs deleted file mode 100644 index b413d175c5..0000000000 --- a/osu.Game/Overlays/Options.cs +++ /dev/null @@ -1,62 +0,0 @@ -//Copyright (c) 2007-2016 ppy Pty Ltd . -//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using OpenTK; -using OpenTK.Graphics; -using OpenTK.Input; -using osu.Framework; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.Transformations; -using osu.Framework.Input; - -namespace osu.Game.Overlays -{ - public class Options : OverlayContainer - { - private const float width = 300; - - protected override void Load(BaseGame game) - { - base.Load(game); - - Depth = float.MaxValue; - RelativeSizeAxes = Axes.Y; - Size = new Vector2(width, 1); - Position = new Vector2(-width, 0); - - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = new Color4(0.1f, 0.1f, 0.1f, 0.9f) - } - }; - } - - protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) - { - switch (args.Key) - { - case Key.Escape: - if (State == Visibility.Hidden) return false; - - State = Visibility.Hidden; - return true; - } - return base.OnKeyDown(state, args); - } - - protected override void PopIn() - { - MoveToX(0, 300, EasingTypes.Out); - } - - protected override void PopOut() - { - MoveToX(-width, 300, EasingTypes.Out); - } - } -} diff --git a/osu.Game/Overlays/Options/AlertsPrivacyOptions.cs b/osu.Game/Overlays/Options/AlertsPrivacyOptions.cs new file mode 100644 index 0000000000..61dec55107 --- /dev/null +++ b/osu.Game/Overlays/Options/AlertsPrivacyOptions.cs @@ -0,0 +1,30 @@ +using System; +using osu.Framework.Graphics; +using osu.Framework.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class AlertsPrivacyOptions : OptionsSubsection + { + protected override string Header => "Alerts & Privacy"; + + public AlertsPrivacyOptions() + { + // TODO: this should probably be split into Alerts and Privacy + Children = new Drawable[] + { + new BasicCheckBox { LabelText = "Chat ticker" }, + new BasicCheckBox { LabelText = "Automatically hide chat during gameplay" }, + new BasicCheckBox { LabelText = "Show a notification popup when someone says your name" }, + new BasicCheckBox { LabelText = "Show chat message notifications" }, + new BasicCheckBox { LabelText = "Play a sound when someone says your name" }, + new BasicCheckBox { LabelText = "Share your city location with others" }, + new BasicCheckBox { LabelText = "Show spectators" }, + new BasicCheckBox { LabelText = "Automatically link beatmaps to spectators" }, + new BasicCheckBox { LabelText = "Show notification popups instantly during gameplay" }, + new BasicCheckBox { LabelText = "Show notification popups when friends change status" }, + new BasicCheckBox { LabelText = "Allow multiplayer game invites from all users" }, + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/AudioDevicesOptions.cs b/osu.Game/Overlays/Options/AudioDevicesOptions.cs new file mode 100644 index 0000000000..99636fe4f5 --- /dev/null +++ b/osu.Game/Overlays/Options/AudioDevicesOptions.cs @@ -0,0 +1,18 @@ +using System; +using osu.Framework.Graphics.Sprites; + +namespace osu.Game.Overlays.Options +{ + public class AudioDevicesOptions : OptionsSubsection + { + protected override string Header => "Devices"; + + public AudioDevicesOptions() + { + Children = new[] + { + new SpriteText { Text = "Output device: TODO dropdown" } + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/AudioOptions.cs b/osu.Game/Overlays/Options/AudioOptions.cs new file mode 100644 index 0000000000..f0d2eeebd0 --- /dev/null +++ b/osu.Game/Overlays/Options/AudioOptions.cs @@ -0,0 +1,20 @@ +using System; +using osu.Framework.Graphics; + +namespace osu.Game.Overlays.Options +{ + public class AudioOptions : OptionsSection + { + protected override string Header => "Audio"; + + public AudioOptions() + { + Children = new Drawable[] + { + new AudioDevicesOptions(), + new VolumeOptions(), + new OffsetAdjustmentOptions(), + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/DetailOptions.cs b/osu.Game/Overlays/Options/DetailOptions.cs new file mode 100644 index 0000000000..482b9c86cd --- /dev/null +++ b/osu.Game/Overlays/Options/DetailOptions.cs @@ -0,0 +1,27 @@ +using System; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class DetailOptions : OptionsSubsection + { + protected override string Header => "Detail Settings"; + + public DetailOptions() + { + Children = new Drawable[] + { + new BasicCheckBox { LabelText = "Snaking sliders" }, + new BasicCheckBox { LabelText = "Background video" }, + new BasicCheckBox { LabelText = "Storyboards" }, + new BasicCheckBox { LabelText = "Combo bursts" }, + new BasicCheckBox { LabelText = "Hit lighting" }, + new BasicCheckBox { LabelText = "Shaders" }, + new BasicCheckBox { LabelText = "Softening filter" }, + new SpriteText { Text = "Screenshot format TODO: dropdown" } + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/EditorOptions.cs b/osu.Game/Overlays/Options/EditorOptions.cs new file mode 100644 index 0000000000..2b3f1a9743 --- /dev/null +++ b/osu.Game/Overlays/Options/EditorOptions.cs @@ -0,0 +1,27 @@ +using System; +using OpenTK; +using osu.Framework.Graphics; +using osu.Framework.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class EditorOptions : OptionsSection + { + protected override string Header => "Editor"; + + public EditorOptions() + { + content.Spacing = new Vector2(0, 5); + Children = new Drawable[] + { + new BasicCheckBox { LabelText = "Background video" }, + new BasicCheckBox { LabelText = "Always use default skin" }, + new BasicCheckBox { LabelText = "Snaking sliders" }, + new BasicCheckBox { LabelText = "Hit animations" }, + new BasicCheckBox { LabelText = "Follow points" }, + new BasicCheckBox { LabelText = "Stacking" }, + }; + } + } +} + diff --git a/osu.Game/Overlays/Options/GameplayOptions.cs b/osu.Game/Overlays/Options/GameplayOptions.cs new file mode 100644 index 0000000000..41f811708a --- /dev/null +++ b/osu.Game/Overlays/Options/GameplayOptions.cs @@ -0,0 +1,19 @@ +using System; +using osu.Framework.Graphics; + +namespace osu.Game.Overlays.Options +{ + public class GameplayOptions : OptionsSection + { + protected override string Header => "Gameplay"; + + public GameplayOptions() + { + Children = new Drawable[] + { + new GeneralGameplayOptions(), + new SongSelectGameplayOptions(), + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/GeneralGameplayOptions.cs b/osu.Game/Overlays/Options/GeneralGameplayOptions.cs new file mode 100644 index 0000000000..920c8b3a49 --- /dev/null +++ b/osu.Game/Overlays/Options/GeneralGameplayOptions.cs @@ -0,0 +1,27 @@ +using System; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class GeneralGameplayOptions : OptionsSubsection + { + protected override string Header => "General"; + + public GeneralGameplayOptions() + { + Children = new Drawable[] + { + new SpriteText { Text = "Background dim: TODO slider" }, + new SpriteText { Text = "Progress display: TODO dropdown" }, + new SpriteText { Text = "Score meter type: TODO dropdown" }, + new SpriteText { Text = "Score meter size: TODO slider" }, + new BasicCheckBox { LabelText = "Always show key overlay" }, + new BasicCheckBox { LabelText = "Show approach circle on first \"Hidden\" object" }, + new BasicCheckBox { LabelText = "Scale osu!mania scroll speed with BPM" }, + new BasicCheckBox { LabelText = "Remember osu!mania scroll speed per beatmap" }, + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/GeneralOptions.cs b/osu.Game/Overlays/Options/GeneralOptions.cs new file mode 100644 index 0000000000..46adbe53d6 --- /dev/null +++ b/osu.Game/Overlays/Options/GeneralOptions.cs @@ -0,0 +1,26 @@ +using System; +using OpenTK.Graphics; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; +using osu.Framework.Platform; +using osu.Game.Online.API; + +namespace osu.Game.Overlays.Options +{ + public class GeneralOptions : OptionsSection + { + protected override string Header => "General"; + + public GeneralOptions() + { + Children = new Drawable[] + { + new LoginOptions(), + new LanguageOptions(), + new UpdateOptions(), + }; + } + } +} + diff --git a/osu.Game/Overlays/Options/GraphicsOptions.cs b/osu.Game/Overlays/Options/GraphicsOptions.cs new file mode 100644 index 0000000000..8051a815aa --- /dev/null +++ b/osu.Game/Overlays/Options/GraphicsOptions.cs @@ -0,0 +1,23 @@ +using System; +using osu.Framework.Graphics; + +namespace osu.Game.Overlays.Options +{ + public class GraphicsOptions : OptionsSection + { + protected override string Header => "Graphics"; + + public GraphicsOptions() + { + Children = new Drawable[] + { + new RendererOptions(), + new LayoutOptions(), + new DetailOptions(), + new MainMenuOptions(), + new SongSelectGraphicsOptions(), + }; + } + } +} + diff --git a/osu.Game/Overlays/Options/InGameChatOptions.cs b/osu.Game/Overlays/Options/InGameChatOptions.cs new file mode 100644 index 0000000000..32ca68758b --- /dev/null +++ b/osu.Game/Overlays/Options/InGameChatOptions.cs @@ -0,0 +1,27 @@ +using System; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class InGameChatOptions : OptionsSubsection + { + protected override string Header => "In-game Chat"; + + public InGameChatOptions() + { + Children = new Drawable[] + { + new BasicCheckBox { LabelText = "Filter offensive words" }, + new BasicCheckBox { LabelText = "Filter foreign characters" }, + new BasicCheckBox { LabelText = "Log private messages" }, + new BasicCheckBox { LabelText = "Block private messages from non-friends" }, + new SpriteText { Text = "Chat ignore list (space-seperated list)" }, + new TextBox { Height = 20, RelativeSizeAxes = Axes.X }, + new SpriteText { Text = "Chat highlight words (space-seperated list)" }, + new TextBox { Height = 20, RelativeSizeAxes = Axes.X }, + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/InputOptions.cs b/osu.Game/Overlays/Options/InputOptions.cs new file mode 100644 index 0000000000..189beb86c9 --- /dev/null +++ b/osu.Game/Overlays/Options/InputOptions.cs @@ -0,0 +1,21 @@ +using System; +using osu.Framework.Graphics; + +namespace osu.Game.Overlays.Options +{ + public class InputOptions : OptionsSection + { + protected override string Header => "Input"; + + public InputOptions() + { + Children = new Drawable[] + { + new MouseOptions(), + new KeyboardOptions(), + new OtherInputOptions(), + }; + } + } +} + diff --git a/osu.Game/Overlays/Options/KeyboardOptions.cs b/osu.Game/Overlays/Options/KeyboardOptions.cs new file mode 100644 index 0000000000..fbcc97bebb --- /dev/null +++ b/osu.Game/Overlays/Options/KeyboardOptions.cs @@ -0,0 +1,28 @@ +using System; +using osu.Framework.Graphics; +using osu.Game.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class KeyboardOptions : OptionsSubsection + { + protected override string Header => "Keyboard"; + + public KeyboardOptions() + { + Children = new Drawable[] + { + new OsuButton + { + RelativeSizeAxes = Axes.X, + Text = "Change keyboard bindings" + }, + new OsuButton + { + RelativeSizeAxes = Axes.X, + Text = "osu!mania layout" + } + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/LanguageOptions.cs b/osu.Game/Overlays/Options/LanguageOptions.cs new file mode 100644 index 0000000000..c5363c3457 --- /dev/null +++ b/osu.Game/Overlays/Options/LanguageOptions.cs @@ -0,0 +1,22 @@ +using System; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class LanguageOptions : OptionsSubsection + { + protected override string Header => "Language"; + + public LanguageOptions() + { + Children = new Drawable[] + { + new SpriteText { Text = "TODO: Dropdown" }, + new BasicCheckBox { LabelText = "Prefer metadata in original language" }, + new BasicCheckBox { LabelText = "Use alternative font for chat display" }, + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/LayoutOptions.cs b/osu.Game/Overlays/Options/LayoutOptions.cs new file mode 100644 index 0000000000..1d0d503549 --- /dev/null +++ b/osu.Game/Overlays/Options/LayoutOptions.cs @@ -0,0 +1,26 @@ +using System; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class LayoutOptions : OptionsSubsection + { + protected override string Header => "Layout"; + + public LayoutOptions() + { + Children = new Drawable[] + { + new SpriteText { Text = "Resolution: TODO dropdown" }, + new BasicCheckBox { LabelText = "Fullscreen mode" }, + new BasicCheckBox { LabelText = "Letterboxing" }, + new SpriteText { Text = "Horizontal position" }, + new SpriteText { Text = "TODO: slider" }, + new SpriteText { Text = "Vertical position" }, + new SpriteText { Text = "TODO: slider" }, + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/LoginOptions.cs b/osu.Game/Overlays/Options/LoginOptions.cs new file mode 100644 index 0000000000..a6ae1775cd --- /dev/null +++ b/osu.Game/Overlays/Options/LoginOptions.cs @@ -0,0 +1,68 @@ +using System; +using OpenTK; +using OpenTK.Graphics; +using osu.Framework; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; +using osu.Game.Graphics.UserInterface; +using osu.Game.Online.API; + +namespace osu.Game.Overlays.Options +{ + public class LoginOptions : OptionsSubsection + { + private Container loginForm; + protected override string Header => "Sign In"; + + public LoginOptions() + { + Children = new[] + { + loginForm = new Container + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Children = new[] { new LoadingAnimation() } + } + }; + } + + protected override void Load(BaseGame game) + { + base.Load(game); + var osuGame = game as OsuGameBase; + if (osuGame == null) + return; + loginForm.Children = new Drawable[] + { + new LoginForm(osuGame.API) + }; + } + + class LoginForm : FlowContainer + { + public LoginForm(APIAccess api) + { + Direction = FlowDirection.VerticalOnly; + AutoSizeAxes = Axes.Y; + RelativeSizeAxes = Axes.X; + Spacing = new Vector2(0, 5); + // TODO: Wire things up + Children = new Drawable[] + { + new SpriteText { Text = "Username" }, + new TextBox { Height = 20, RelativeSizeAxes = Axes.X, Text = api?.Username ?? string.Empty }, + new SpriteText { Text = "Password" }, + new TextBox { Height = 20, RelativeSizeAxes = Axes.X }, + new OsuButton + { + RelativeSizeAxes = Axes.X, + Text = "Log in", + } + }; + } + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/MainMenuOptions.cs b/osu.Game/Overlays/Options/MainMenuOptions.cs new file mode 100644 index 0000000000..6b575431f7 --- /dev/null +++ b/osu.Game/Overlays/Options/MainMenuOptions.cs @@ -0,0 +1,22 @@ +using System; +using osu.Framework.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class MainMenuOptions : OptionsSubsection + { + protected override string Header => "Main Menu"; + + public MainMenuOptions() + { + Children = new[] + { + new BasicCheckBox { LabelText = "Snow" }, + new BasicCheckBox { LabelText = "Parallax" }, + new BasicCheckBox { LabelText = "Menu tips" }, + new BasicCheckBox { LabelText = "Interface voices" }, + new BasicCheckBox { LabelText = "osu! music theme" }, + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/MaintenanceOptions.cs b/osu.Game/Overlays/Options/MaintenanceOptions.cs new file mode 100644 index 0000000000..c139804f4c --- /dev/null +++ b/osu.Game/Overlays/Options/MaintenanceOptions.cs @@ -0,0 +1,47 @@ +using System; +using OpenTK; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class MaintenanceOptions : OptionsSection + { + protected override string Header => "Maintenance"; + + public MaintenanceOptions() + { + content.Spacing = new Vector2(0, 5); + Children = new Drawable[] + { + new OsuButton + { + RelativeSizeAxes = Axes.X, + Text = "Delete all unranked maps", + }, + new OsuButton + { + RelativeSizeAxes = Axes.X, + Text = "Repair folder permissions", + }, + new OsuButton + { + RelativeSizeAxes = Axes.X, + Text = "Mark all maps as played", + }, + new OsuButton + { + RelativeSizeAxes = Axes.X, + Text = "Run osu! updater", + }, + new SpriteText + { + Text = "TODO: osu version here", + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + }, + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/MouseOptions.cs b/osu.Game/Overlays/Options/MouseOptions.cs new file mode 100644 index 0000000000..a6236d515d --- /dev/null +++ b/osu.Game/Overlays/Options/MouseOptions.cs @@ -0,0 +1,26 @@ +using System; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class MouseOptions : OptionsSubsection + { + protected override string Header => "Mouse"; + + public MouseOptions() + { + Children = new Drawable[] + { + new SpriteText { Text = "Sensitivity: TODO slider" }, + new BasicCheckBox { LabelText = "Raw input" }, + new BasicCheckBox { LabelText = "Map absolute raw input to the osu! window" }, + new SpriteText { Text = "Confine mouse cursor: TODO dropdown" }, + new BasicCheckBox { LabelText = "Disable mouse wheel in play mode" }, + new BasicCheckBox { LabelText = "Disable mouse buttons in play mode" }, + new BasicCheckBox { LabelText = "Cursor ripples" }, + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/OffsetAdjustmentOptions.cs b/osu.Game/Overlays/Options/OffsetAdjustmentOptions.cs new file mode 100644 index 0000000000..62e124fa4f --- /dev/null +++ b/osu.Game/Overlays/Options/OffsetAdjustmentOptions.cs @@ -0,0 +1,25 @@ +using System; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class OffsetAdjustmentOptions : OptionsSubsection + { + protected override string Header => "Offset Adjustment"; + + public OffsetAdjustmentOptions() + { + Children = new Drawable[] + { + new SpriteText { Text = "Universal Offset: TODO slider" }, + new OsuButton + { + RelativeSizeAxes = Axes.X, + Text = "Offset wizard" + } + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/OnlineIntegrationOptions.cs b/osu.Game/Overlays/Options/OnlineIntegrationOptions.cs new file mode 100644 index 0000000000..2fe2bb2e70 --- /dev/null +++ b/osu.Game/Overlays/Options/OnlineIntegrationOptions.cs @@ -0,0 +1,22 @@ +using System; +using osu.Framework.Graphics; +using osu.Framework.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class OnlineIntegrationOptions : OptionsSubsection + { + protected override string Header => "Integration"; + + public OnlineIntegrationOptions() + { + Children = new Drawable[] + { + new BasicCheckBox { LabelText = "Integrate with Yahoo! status display" }, + new BasicCheckBox { LabelText = "Integrate with MSN Live status display" }, + new BasicCheckBox { LabelText = "Automatically start osu!direct downloads" }, + new BasicCheckBox { LabelText = "Prefer no-video downloads" }, + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/OnlineOptions.cs b/osu.Game/Overlays/Options/OnlineOptions.cs new file mode 100644 index 0000000000..a22d416ab5 --- /dev/null +++ b/osu.Game/Overlays/Options/OnlineOptions.cs @@ -0,0 +1,20 @@ +using System; +using osu.Framework.Graphics; + +namespace osu.Game.Overlays.Options +{ + public class OnlineOptions : OptionsSection + { + protected override string Header => "Online"; + + public OnlineOptions() + { + Children = new Drawable[] + { + new AlertsPrivacyOptions(), + new OnlineIntegrationOptions(), + new InGameChatOptions(), + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/OptionsSection.cs b/osu.Game/Overlays/Options/OptionsSection.cs new file mode 100644 index 0000000000..79776cc800 --- /dev/null +++ b/osu.Game/Overlays/Options/OptionsSection.cs @@ -0,0 +1,64 @@ +using System; +using OpenTK; +using OpenTK.Graphics; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.Sprites; + +namespace osu.Game.Overlays.Options +{ + public abstract class OptionsSection : Container + { + protected FlowContainer content; + protected override Container Content => content; + + protected abstract string Header { get; } + + public OptionsSection() + { + const int headerSize = 30, headerMargin = 25; + const int borderSize = 2; + AutoSizeAxes = Axes.Y; + RelativeSizeAxes = Axes.X; + AddInternal(new Drawable[] + { + new Box + { + Colour = new Color4(3, 3, 3, 255), + RelativeSizeAxes = Axes.X, + Height = borderSize, + }, + new Container + { + Padding = new MarginPadding + { + Top = 10 + borderSize, + Left = OptionsOverlay.SideMargins, + Right = OptionsOverlay.SideMargins, + Bottom = 10, + }, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Children = new[] + { + new SpriteText + { + TextSize = headerSize, + Colour = new Color4(247, 198, 35, 255), + Text = Header, + }, + content = new FlowContainer + { + Margin = new MarginPadding { Top = headerSize + headerMargin }, + Direction = FlowDirection.VerticalOnly, + Spacing = new Vector2(0, 25), + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + }, + } + }, + }); + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/OptionsSubsection.cs b/osu.Game/Overlays/Options/OptionsSubsection.cs new file mode 100644 index 0000000000..ed3a6a0ca7 --- /dev/null +++ b/osu.Game/Overlays/Options/OptionsSubsection.cs @@ -0,0 +1,42 @@ +using System; +using OpenTK; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; + +namespace osu.Game.Overlays.Options +{ + public abstract class OptionsSubsection : Container + { + private Container content; + protected override Container Content => content; + + protected abstract string Header { get; } + + public OptionsSubsection() + { + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + AddInternal(new Drawable[] + { + content = new FlowContainer + { + Direction = FlowDirection.VerticalOnly, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Spacing = new Vector2(0, 5), + Children = new[] + { + new SpriteText + { + TextSize = 25, + Text = Header, + // TODO: Bold + } + } + }, + }); + } + } +} + diff --git a/osu.Game/Overlays/Options/OtherInputOptions.cs b/osu.Game/Overlays/Options/OtherInputOptions.cs new file mode 100644 index 0000000000..c91dc82e20 --- /dev/null +++ b/osu.Game/Overlays/Options/OtherInputOptions.cs @@ -0,0 +1,21 @@ +using System; +using osu.Framework.Graphics; +using osu.Framework.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class OtherInputOptions : OptionsSubsection + { + protected override string Header => "Other"; + + public OtherInputOptions() + { + Children = new Drawable[] + { + new BasicCheckBox { LabelText = "OS TabletPC support" }, + new BasicCheckBox { LabelText = "Wiimote/TaTaCon Drum Support" }, + }; + } + } +} + diff --git a/osu.Game/Overlays/Options/RendererOptions.cs b/osu.Game/Overlays/Options/RendererOptions.cs new file mode 100644 index 0000000000..bee07de2e3 --- /dev/null +++ b/osu.Game/Overlays/Options/RendererOptions.cs @@ -0,0 +1,24 @@ +using System; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class RendererOptions : OptionsSubsection + { + protected override string Header => "Renderer"; + + public RendererOptions() + { + // NOTE: Compatability mode omitted + Children = new Drawable[] + { + new SpriteText { Text = "Frame limiter: TODO dropdown" }, + new BasicCheckBox { LabelText = "Show FPS counter" }, + new BasicCheckBox { LabelText = "Reduce dropped frames" }, + new BasicCheckBox { LabelText = "Detect performance issues" }, + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/SkinOptions.cs b/osu.Game/Overlays/Options/SkinOptions.cs new file mode 100644 index 0000000000..ae7ae3f2ab --- /dev/null +++ b/osu.Game/Overlays/Options/SkinOptions.cs @@ -0,0 +1,45 @@ +using System; +using OpenTK; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; +using osu.Game.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class SkinOptions : OptionsSection + { + protected override string Header => "Skin"; + + public SkinOptions() + { + content.Spacing = new Vector2(0, 5); + Children = new Drawable[] + { + new SpriteText { Text = "TODO: Skin preview textures" }, + new SpriteText { Text = "Current skin: TODO dropdown" }, + new OsuButton + { + RelativeSizeAxes = Axes.X, + Text = "Preview gameplay", + }, + new OsuButton + { + RelativeSizeAxes = Axes.X, + Text = "Open skin folder", + }, + new OsuButton + { + RelativeSizeAxes = Axes.X, + Text = "Export as .osk", + }, + new BasicCheckBox { LabelText = "Ignore all beatmap skins" }, + new BasicCheckBox { LabelText = "Use skin's sound samples" }, + new BasicCheckBox { LabelText = "Use Taiko skin for Taiko mode" }, + new BasicCheckBox { LabelText = "Always use skin cursor" }, + new SpriteText { Text = "Cursor size: TODO slider" }, + new BasicCheckBox { LabelText = "Automatic cursor size" }, + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/SongSelectGameplayOptions.cs b/osu.Game/Overlays/Options/SongSelectGameplayOptions.cs new file mode 100644 index 0000000000..edbb1d43c5 --- /dev/null +++ b/osu.Game/Overlays/Options/SongSelectGameplayOptions.cs @@ -0,0 +1,21 @@ +using System; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; + +namespace osu.Game.Overlays.Options +{ + public class SongSelectGameplayOptions : OptionsSubsection + { + protected override string Header => "Song Select"; + + public SongSelectGameplayOptions() + { + Children = new Drawable[] + { + new SpriteText { Text = "Display beatmaps from: TODO slider" }, + new SpriteText { Text = "up to: TODO slider" }, + }; + } + } +} + diff --git a/osu.Game/Overlays/Options/SongSelectGraphicsOptions.cs b/osu.Game/Overlays/Options/SongSelectGraphicsOptions.cs new file mode 100644 index 0000000000..b6a6e0f51e --- /dev/null +++ b/osu.Game/Overlays/Options/SongSelectGraphicsOptions.cs @@ -0,0 +1,18 @@ +using System; +using osu.Framework.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class SongSelectGraphicsOptions : OptionsSubsection + { + protected override string Header => "Song Select"; + + public SongSelectGraphicsOptions() + { + Children = new[] + { + new BasicCheckBox { LabelText = "Show thumbnails" } + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/UpdateOptions.cs b/osu.Game/Overlays/Options/UpdateOptions.cs new file mode 100644 index 0000000000..000d38cfb3 --- /dev/null +++ b/osu.Game/Overlays/Options/UpdateOptions.cs @@ -0,0 +1,39 @@ +using System; +using OpenTK.Graphics; +using osu.Framework; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; +using osu.Framework.Platform; +using osu.Game.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class UpdateOptions : OptionsSubsection + { + private BasicStorage storage; + protected override string Header => "Updates"; + + public UpdateOptions() + { + Children = new Drawable[] + { + new SpriteText { Text = "TODO: Dropdown" }, + new SpriteText { Text = "Your osu! is up to date" }, // TODO: map this to reality + new OsuButton + { + RelativeSizeAxes = Axes.X, + Text = "Open osu! folder", + Action = () => storage?.OpenInNativeExplorer(), + } + }; + } + + protected override void Load(BaseGame game) + { + base.Load(game); + this.storage = game.Host.Storage; + } + } +} + diff --git a/osu.Game/Overlays/Options/VolumeOptions.cs b/osu.Game/Overlays/Options/VolumeOptions.cs new file mode 100644 index 0000000000..654841d177 --- /dev/null +++ b/osu.Game/Overlays/Options/VolumeOptions.cs @@ -0,0 +1,23 @@ +using System; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class VolumeOptions : OptionsSubsection + { + protected override string Header => "Volume"; + + public VolumeOptions() + { + Children = new Drawable[] + { + new SpriteText { Text = "Master: TODO slider" }, + new SpriteText { Text = "Music: TODO slider" }, + new SpriteText { Text = "Effect: TODO slider" }, + new BasicCheckBox { LabelText = "Ignore beatmap hitsounds" } + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/OptionsOverlay.cs b/osu.Game/Overlays/OptionsOverlay.cs new file mode 100644 index 0000000000..5f6e3ba3e3 --- /dev/null +++ b/osu.Game/Overlays/OptionsOverlay.cs @@ -0,0 +1,111 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Diagnostics; +using OpenTK; +using OpenTK.Graphics; +using OpenTK.Input; +using osu.Framework; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Transformations; +using osu.Framework.Graphics.UserInterface; +using osu.Framework.Input; +using osu.Framework.Platform; +using osu.Game.Configuration; +using osu.Game.Online.API; +using osu.Game.Overlays.Options; + +namespace osu.Game.Overlays +{ + public class OptionsOverlay : OverlayContainer + { + internal const float SideMargins = 10; + private const float width = 400; + + public OptionsOverlay() + { + Depth = float.MaxValue; + RelativeSizeAxes = Axes.Y; + Size = new Vector2(width, 1); + Position = new Vector2(-width, 0); + + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.8f, + }, + // TODO: Links on the side to jump to a section + new ScrollContainer + { + RelativeSizeAxes = Axes.Both, + ScrollDraggerOnLeft = true, + Children = new[] + { + new FlowContainer + { + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + Direction = FlowDirection.VerticalOnly, + Children = new Drawable[] + { + new SpriteText + { + Text = "settings", + TextSize = 40, + Margin = new MarginPadding { Left = SideMargins, Top = 30 }, + }, + new SpriteText + { + Colour = new Color4(235, 117, 139, 255), + Text = "Change the way osu! behaves", + TextSize = 18, + Margin = new MarginPadding { Left = SideMargins, Bottom = 30 }, + }, + new GeneralOptions(), + new GraphicsOptions(), + new GameplayOptions(), + new AudioOptions(), + new SkinOptions(), + new InputOptions(), + new EditorOptions(), + new OnlineOptions(), + new MaintenanceOptions(), + } + } + } + } + }; + } + + protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true; + + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + switch (args.Key) + { + case Key.Escape: + if (State == Visibility.Hidden) return false; + + State = Visibility.Hidden; + return true; + } + return base.OnKeyDown(state, args); + } + + protected override void PopIn() + { + MoveToX(0, 300, EasingTypes.Out); + } + + protected override void PopOut() + { + MoveToX(-width, 300, EasingTypes.Out); + } + } +} diff --git a/osu.Game/Overlays/Toolbar.cs b/osu.Game/Overlays/Toolbar.cs index b6fde4d59d..d6ac57a94c 100644 --- a/osu.Game/Overlays/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar.cs @@ -61,14 +61,14 @@ namespace osu.Game.Overlays Icon = FontAwesome.gear, TooltipMain = "Settings", TooltipSub = "Change your settings", - Action = OnSettings + Action = () => OnSettings?.Invoke() }, new ToolbarButton { Icon = FontAwesome.home, TooltipMain = "Home", TooltipSub = "Return to the main menu", - Action = OnHome + Action = () => OnHome?.Invoke() }, modeSelector = new ToolbarModeSelector { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index b73bc8ffda..b2a8cee6a5 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -177,7 +177,7 @@ - + @@ -196,6 +196,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -215,6 +247,9 @@ + + +