From 3c677970cda1da0d8d2d5ea39f861e77f3ba72a5 Mon Sep 17 00:00:00 2001 From: phosphene47 Date: Thu, 27 Dec 2018 17:25:28 +0900 Subject: [PATCH 01/24] Add menu background skinning for supporters --- .../Backgrounds/BackgroundScreenDefault.cs | 45 +++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs index 989883c8b3..f924cf9805 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs @@ -2,10 +2,14 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.MathUtils; using osu.Framework.Threading; using osu.Game.Graphics.Backgrounds; +using osu.Game.Online.API; +using osu.Game.Skinning; +using osu.Game.Users; namespace osu.Game.Screens.Backgrounds { @@ -16,11 +20,21 @@ namespace osu.Game.Screens.Backgrounds private string backgroundName => $@"Menu/menu-background-{currentDisplay % background_count + 1}"; + private Bindable user; + private Bindable skin; + [BackgroundDependencyLoader] - private void load() + private void load(IAPIProvider api, SkinManager skinManager) { + user = api.LocalUser.GetBoundCopy(); + skin = skinManager.CurrentSkin.GetBoundCopy(); + + user.ValueChanged += _ => Next(); + skin.ValueChanged += _ => Next(); + currentDisplay = RNG.Next(0, background_count); - display(new Background(backgroundName)); + + Next(); } private void display(Background newBackground) @@ -39,8 +53,33 @@ namespace osu.Game.Screens.Backgrounds nextTask?.Cancel(); nextTask = Scheduler.AddDelayed(() => { - LoadComponentAsync(new Background(backgroundName) { Depth = currentDisplay }, display); + Background background; + + if (user.Value?.IsSupporter ?? false) + background = new SkinnedBackground(skin.Value, backgroundName); + else + background = new Background(backgroundName); + + background.Depth = currentDisplay; + + LoadComponentAsync(background, display); }, 100); } + + private class SkinnedBackground : Background + { + private readonly Skin skin; + + public SkinnedBackground(Skin skin, string fallbackTextureName) : base(fallbackTextureName) + { + this.skin = skin; + } + + [BackgroundDependencyLoader] + private void load() + { + Sprite.Texture = skin.GetTexture("menu-background") ?? Sprite.Texture; + } + } } } From 3abfaea7acef21fafb3d283e2a024432b05c2ce4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 16 Jan 2019 17:21:26 +0900 Subject: [PATCH 02/24] Stop cursor from sticking to edges of scaled game window --- osu.Game/Graphics/Containers/ScalingContainer.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/ScalingContainer.cs b/osu.Game/Graphics/Containers/ScalingContainer.cs index 8d21d6de10..62760b39ea 100644 --- a/osu.Game/Graphics/Containers/ScalingContainer.cs +++ b/osu.Game/Graphics/Containers/ScalingContainer.cs @@ -28,6 +28,8 @@ namespace osu.Game.Graphics.Containers private readonly Container content; protected override Container Content => content; + public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; + private readonly Container sizableContainer; private Drawable backgroundLayer; @@ -41,7 +43,7 @@ namespace osu.Game.Graphics.Containers this.targetMode = targetMode; RelativeSizeAxes = Axes.Both; - InternalChild = sizableContainer = new Container + InternalChild = sizableContainer = new AlwaysInputContainer { RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.Both, @@ -55,6 +57,8 @@ namespace osu.Game.Graphics.Containers private readonly bool applyUIScale; private Bindable uiScale; + public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; + public ScalingDrawSizePreservingFillContainer(bool applyUIScale) { this.applyUIScale = applyUIScale; @@ -143,5 +147,15 @@ namespace osu.Game.Graphics.Containers sizableContainer.MoveTo(targetPosition, 500, Easing.OutQuart); sizableContainer.ResizeTo(targetSize, 500, Easing.OutQuart).OnComplete(_ => { sizableContainer.Masking = requiresMasking; }); } + + private class AlwaysInputContainer : Container + { + public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; + + public AlwaysInputContainer() + { + RelativeSizeAxes = Axes.Both; + } + } } } From a8e9adafdb0c35b567fba55b39ed82e7836fc5f2 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 16 Jan 2019 19:58:01 +0900 Subject: [PATCH 03/24] Fix final section not being saved --- osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs index 8fc2b69267..4f01dbe2f3 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs @@ -57,6 +57,10 @@ namespace osu.Game.Rulesets.Osu.Difficulty s.Process(h); } + // The peak strain will not be saved for the last section in the above loop + foreach (Skill s in skills) + s.SaveCurrentPeak(); + double aimRating = Math.Sqrt(skills[0].DifficultyValue()) * difficulty_multiplier; double speedRating = Math.Sqrt(skills[1].DifficultyValue()) * difficulty_multiplier; double starRating = aimRating + speedRating + Math.Abs(aimRating - speedRating) / 2; From b6fb3a5c05ae4511b4b36e26b1a51fddfffbac6a Mon Sep 17 00:00:00 2001 From: ekrctb Date: Thu, 17 Jan 2019 15:14:30 +0900 Subject: [PATCH 04/24] Cancel request on disposal for RoomInspector --- osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs b/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs index 63730ff635..2d523aa82b 100644 --- a/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs +++ b/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs @@ -297,6 +297,12 @@ namespace osu.Game.Screens.Multi.Lounge.Components api.Queue(request); } + protected override void Dispose(bool isDisposing) + { + request?.Cancel(); + base.Dispose(isDisposing); + } + private class UserTile : CompositeDrawable, IHasTooltip { private readonly User user; From f982b6da55f3108ce53b67935757941792dae122 Mon Sep 17 00:00:00 2001 From: ekrctb Date: Thu, 17 Jan 2019 16:00:11 +0900 Subject: [PATCH 05/24] Don't hide 'hold for menu' even hud is hidden --- osu.Game/Screens/Play/HUDOverlay.cs | 52 ++++++++++++++--------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 11cee98bdf..cc665d99a1 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -24,8 +24,6 @@ namespace osu.Game.Screens.Play { private const int duration = 100; - private readonly Container content; - public readonly KeyCounterCollection KeyCounter; public readonly RollingCounter ComboCounter; public readonly ScoreCounter ScoreCounter; @@ -37,6 +35,7 @@ namespace osu.Game.Screens.Play public readonly PlayerSettingsOverlay PlayerSettingsOverlay; private Bindable showHud; + private readonly Container visibilityContainer; private readonly BindableBool replayLoaded = new BindableBool(); private static bool hasShownNotificationOnce; @@ -45,34 +44,35 @@ namespace osu.Game.Screens.Play { RelativeSizeAxes = Axes.Both; - Add(content = new Container + Children = new Drawable[] { - RelativeSizeAxes = Axes.Both, - AlwaysPresent = true, // The hud may be hidden but certain elements may need to still be updated - Children = new Drawable[] + visibilityContainer = new Container { + RelativeSizeAxes = Axes.Both, + AlwaysPresent = true, // The hud may be hidden but certain elements may need to still be updated + Children = new Drawable[] { + ComboCounter = CreateComboCounter(), + ScoreCounter = CreateScoreCounter(), + AccuracyCounter = CreateAccuracyCounter(), + HealthDisplay = CreateHealthDisplay(), + Progress = CreateProgress(), + ModDisplay = CreateModsContainer(), + PlayerSettingsOverlay = CreatePlayerSettingsOverlay(), + } + }, + new FillFlowContainer { - ComboCounter = CreateComboCounter(), - ScoreCounter = CreateScoreCounter(), - AccuracyCounter = CreateAccuracyCounter(), - HealthDisplay = CreateHealthDisplay(), - Progress = CreateProgress(), - ModDisplay = CreateModsContainer(), - PlayerSettingsOverlay = CreatePlayerSettingsOverlay(), - new FillFlowContainer + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight, + Position = -new Vector2(5, TwoLayerButton.SIZE_RETRACTED.Y), + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Children = new Drawable[] { - Anchor = Anchor.BottomRight, - Origin = Anchor.BottomRight, - Position = -new Vector2(5, TwoLayerButton.SIZE_RETRACTED.Y), - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Vertical, - Children = new Drawable[] - { - KeyCounter = CreateKeyCounter(adjustableClock as IFrameBasedClock), - HoldToQuit = CreateHoldForMenuButton(), - } + KeyCounter = CreateKeyCounter(adjustableClock as IFrameBasedClock), + HoldToQuit = CreateHoldForMenuButton(), } } - }); + }; BindProcessor(scoreProcessor); BindRulesetContainer(rulesetContainer); @@ -91,7 +91,7 @@ namespace osu.Game.Screens.Play private void load(OsuConfigManager config, NotificationOverlay notificationOverlay) { showHud = config.GetBindable(OsuSetting.ShowInterface); - showHud.ValueChanged += hudVisibility => content.FadeTo(hudVisibility ? 1 : 0, duration); + showHud.ValueChanged += hudVisibility => visibilityContainer.FadeTo(hudVisibility ? 1 : 0, duration); showHud.TriggerChange(); if (!showHud && !hasShownNotificationOnce) From 6bfae52305c759ded078d53f2dd93d38c196ac36 Mon Sep 17 00:00:00 2001 From: ekrctb Date: Thu, 17 Jan 2019 17:03:53 +0900 Subject: [PATCH 06/24] Fix sliders don't show tooltip until first change --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 2bd84ab2b4..e0f38a13d0 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -92,6 +92,12 @@ namespace osu.Game.Graphics.UserInterface AccentColour = colours.Pink; } + protected override void LoadComplete() + { + updateTooltipText(Current.Value); + base.LoadComplete(); + } + protected override bool OnHover(HoverEvent e) { Nub.Glowing = true; From 2bc3464802c75a45ee5cfc852de2acd0e618d8fb Mon Sep 17 00:00:00 2001 From: ekrctb Date: Thu, 17 Jan 2019 17:27:34 +0900 Subject: [PATCH 07/24] Hide Room tab when Settings tab is active --- osu.Game/Screens/Multi/Match/MatchSubScreen.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Multi/Match/MatchSubScreen.cs b/osu.Game/Screens/Multi/Match/MatchSubScreen.cs index 14cdd90128..bc3b2c74d4 100644 --- a/osu.Game/Screens/Multi/Match/MatchSubScreen.cs +++ b/osu.Game/Screens/Multi/Match/MatchSubScreen.cs @@ -51,6 +51,8 @@ namespace osu.Game.Screens.Multi.Match MatchChatDisplay chat; Components.Header header; + Info info; + GridContainer bottomRow; MatchSettingsOverlay settings; Children = new Drawable[] @@ -61,10 +63,10 @@ namespace osu.Game.Screens.Multi.Match Content = new[] { new Drawable[] { header = new Components.Header(room) { Depth = -1 } }, - new Drawable[] { new Info(room) { OnStart = onStart } }, + new Drawable[] { info = new Info(room) { OnStart = onStart } }, new Drawable[] { - new GridContainer + bottomRow = new GridContainer { RelativeSizeAxes = Axes.Both, Content = new[] @@ -110,9 +112,17 @@ namespace osu.Game.Screens.Multi.Match header.Tabs.Current.ValueChanged += t => { if (t is SettingsMatchPage) + { settings.Show(); + info.Hide(); + bottomRow.Hide(); + } else + { settings.Hide(); + info.Show(); + bottomRow.Show(); + } }; chat.Exit += Exit; From 491537b8ba7c9e2a5fc408a56f931d7937c5de69 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 17 Jan 2019 18:13:05 +0900 Subject: [PATCH 08/24] Add fade duration Not really visible in the existing usage, but once we enable the settings tab it will be required. Tested by manually enabling it. --- osu.Game/Screens/Multi/Match/MatchSubScreen.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Multi/Match/MatchSubScreen.cs b/osu.Game/Screens/Multi/Match/MatchSubScreen.cs index bc3b2c74d4..a7932e1131 100644 --- a/osu.Game/Screens/Multi/Match/MatchSubScreen.cs +++ b/osu.Game/Screens/Multi/Match/MatchSubScreen.cs @@ -111,17 +111,18 @@ namespace osu.Game.Screens.Multi.Match header.OnRequestSelectBeatmap = () => Push(new MatchSongSelect { Selected = addPlaylistItem }); header.Tabs.Current.ValueChanged += t => { + const float fade_duration = 500; if (t is SettingsMatchPage) { settings.Show(); - info.Hide(); - bottomRow.Hide(); + info.FadeOut(fade_duration, Easing.OutQuint); + bottomRow.FadeOut(fade_duration, Easing.OutQuint); } else { settings.Hide(); - info.Show(); - bottomRow.Show(); + info.FadeIn(fade_duration, Easing.OutQuint); + bottomRow.FadeIn(fade_duration, Easing.OutQuint); } }; From ba9cdf2ce2706794f3481679cfe853b8d3650f99 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 17 Jan 2019 18:17:47 +0900 Subject: [PATCH 09/24] Add null check to fix crash on deselecting multiplayer room --- osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs b/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs index 2d523aa82b..665481934e 100644 --- a/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs +++ b/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs @@ -266,7 +266,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components private void updateParticipants() { - var roomId = room.RoomID.Value ?? 0; + var roomId = room?.RoomID.Value ?? 0; request?.Cancel(); From 59f7c5a26e466d06070610ff0dfd14740e0914dd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 17 Jan 2019 18:44:22 +0900 Subject: [PATCH 10/24] Fix room inspector cover not resetting when no room selected --- .../Lounge/Components/ParticipantInfo.cs | 10 +++++-- osu.Game/Screens/Multi/RoomBindings.cs | 29 +++++++++---------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/osu.Game/Screens/Multi/Lounge/Components/ParticipantInfo.cs b/osu.Game/Screens/Multi/Lounge/Components/ParticipantInfo.cs index 34fc7fe886..228bacf3f3 100644 --- a/osu.Game/Screens/Multi/Lounge/Components/ParticipantInfo.cs +++ b/osu.Game/Screens/Multi/Lounge/Components/ParticipantInfo.cs @@ -93,10 +93,14 @@ namespace osu.Game.Screens.Multi.Lounge.Components Host.BindValueChanged(v => { hostText.Clear(); - hostText.AddText("hosted by "); - hostText.AddLink(v.Username, null, LinkAction.OpenUserProfile, v.Id.ToString(), "Open profile", s => s.Font = "Exo2.0-BoldItalic"); + flagContainer.Clear(); - flagContainer.Child = new DrawableFlag(v.Country) { RelativeSizeAxes = Axes.Both }; + if (v != null) + { + hostText.AddText("hosted by "); + hostText.AddLink(v.Username, null, LinkAction.OpenUserProfile, v.Id.ToString(), "Open profile", s => s.Font = "Exo2.0-BoldItalic"); + flagContainer.Child = new DrawableFlag(v.Country) { RelativeSizeAxes = Axes.Both }; + } }); ParticipantCount.BindValueChanged(v => summary.Text = $"{v:#,0}{" participant".Pluralize(v == 1)}"); diff --git a/osu.Game/Screens/Multi/RoomBindings.cs b/osu.Game/Screens/Multi/RoomBindings.cs index 30e2918b69..e7f9e323bc 100644 --- a/osu.Game/Screens/Multi/RoomBindings.cs +++ b/osu.Game/Screens/Multi/RoomBindings.cs @@ -53,23 +53,20 @@ namespace osu.Game.Screens.Multi Duration.UnbindFrom(room.Duration); } - room = value; + room = value ?? new Room(); - if (room != null) - { - RoomID.BindTo(room.RoomID); - Name.BindTo(room.Name); - Host.BindTo(room.Host); - Status.BindTo(room.Status); - Type.BindTo(room.Type); - Playlist.BindTo(room.Playlist); - Participants.BindTo(room.Participants); - ParticipantCount.BindTo(room.ParticipantCount); - MaxParticipants.BindTo(room.MaxParticipants); - EndDate.BindTo(room.EndDate); - Availability.BindTo(room.Availability); - Duration.BindTo(room.Duration); - } + RoomID.BindTo(room.RoomID); + Name.BindTo(room.Name); + Host.BindTo(room.Host); + Status.BindTo(room.Status); + Type.BindTo(room.Type); + Playlist.BindTo(room.Playlist); + Participants.BindTo(room.Participants); + ParticipantCount.BindTo(room.ParticipantCount); + MaxParticipants.BindTo(room.MaxParticipants); + EndDate.BindTo(room.EndDate); + Availability.BindTo(room.Availability); + Duration.BindTo(room.Duration); } } From d16f4af92b35692caa3f43c0a4b3934cd39618d7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 17 Jan 2019 19:18:40 +0900 Subject: [PATCH 11/24] Use TransferValueOnCommit for mouse sensitivity --- .../Settings/Sections/Input/MouseSettings.cs | 53 +------------------ 1 file changed, 1 insertion(+), 52 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs index c4d180790c..be264e8cdf 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs @@ -78,66 +78,15 @@ namespace osu.Game.Overlays.Settings.Sections.Input private class SensitivitySetting : SettingsSlider { - public override Bindable Bindable - { - get { return ((SensitivitySlider)Control).Sensitivity; } - - set - { - BindableDouble doubleValue = (BindableDouble)value; - - // create a second layer of bindable so we can only handle state changes when not being dragged. - ((SensitivitySlider)Control).Sensitivity = doubleValue; - - // this bindable will still act as the "interactive" bindable displayed during a drag. - base.Bindable = new BindableDouble(doubleValue.Value) - { - Default = doubleValue.Default, - MinValue = doubleValue.MinValue, - MaxValue = doubleValue.MaxValue - }; - - // one-way binding to update the sliderbar with changes from external actions. - doubleValue.DisabledChanged += disabled => base.Bindable.Disabled = disabled; - doubleValue.ValueChanged += newValue => base.Bindable.Value = newValue; - } - } - public SensitivitySetting() { KeyboardStep = 0.01f; + TransferValueOnCommit = true; } } private class SensitivitySlider : OsuSliderBar { - public Bindable Sensitivity; - - public SensitivitySlider() - { - Current.ValueChanged += newValue => - { - if (!isDragging && Sensitivity != null) - Sensitivity.Value = newValue; - }; - } - - private bool isDragging; - - protected override bool OnDragStart(DragStartEvent e) - { - isDragging = true; - return base.OnDragStart(e); - } - - protected override bool OnDragEnd(DragEndEvent e) - { - isDragging = false; - Current.TriggerChange(); - - return base.OnDragEnd(e); - } - public override string TooltipText => Current.Disabled ? "Enable raw input to adjust sensitivity" : Current.Value.ToString(@"0.##x"); } } From 93a08bdb2384ef078197b49506cf1a701c2e063c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 17 Jan 2019 20:23:15 +0900 Subject: [PATCH 12/24] Remove stray using --- osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs index be264e8cdf..e5cde37254 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs @@ -5,7 +5,6 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Input; -using osu.Framework.Input.Events; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; From b904bd9e8f2fd02bc45cae0c2bb219cf6285415b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 17 Jan 2019 22:13:41 +0900 Subject: [PATCH 13/24] Update framework --- osu.Game/osu.Game.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 344667c41a..9365169873 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -18,7 +18,7 @@ - + From 2f0abeb4e9f0176af4daa1376cc14cc86462614e Mon Sep 17 00:00:00 2001 From: Llaurence Date: Thu, 17 Jan 2019 18:19:30 +0100 Subject: [PATCH 14/24] Update 'Building and Running' in README.md --- README.md | 65 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 55 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a2f6472371..3dd96773f2 100644 --- a/README.md +++ b/README.md @@ -13,23 +13,68 @@ We are accepting bug reports (please report with as much detail as possible). Fe - A desktop platform with the [.NET Core SDK 2.2](https://www.microsoft.com/net/learn/get-started) or higher installed. - When working with the codebase, we recommend using an IDE with intellisense and syntax highlighting, such as [Visual Studio Community Edition](https://www.visualstudio.com/) (Windows), [Visual Studio Code](https://code.visualstudio.com/) (with the C# plugin installed) or [Jetbrains Rider](https://www.jetbrains.com/rider/) (commercial). -# Building and running +# Running osu! -If you are not interested in developing the game, please head over to the [releases](https://github.com/ppy/osu/releases) to download a precompiled build with automatic updating enabled (download and run the install executable for your platform). +## Releases -Clone the repository including submodules +If you are not interested in developing the game, please head over to the [releases](https://github.com/ppy/osu/releases) to download a precompiled build with automatic updating enabled. -`git clone --recurse-submodules https://github.com/ppy/osu` +- Windows 64 bit users should download and run `install.exe`. +- MacOS users should download and run `osu.app.zip`. -Build and run +There is currently no release for Windows 32 bit, Linux, or any other platform. If you are not running Windows 64 bit or MacOS, you should build osu! from the source code (see bellow). -- Using Visual Studio 2017, Rider or Visual Studio Code (configurations are included) -- From command line using `dotnet run --project osu.Desktop`. When building for non-development purposes, add `-c Release` to gain higher performance. -- To run with code analysis, instead use `powershell ./build.ps1` or `build.sh`. This is currently only supported under windows due to [resharper cli shortcomings](https://youtrack.jetbrains.com/issue/RSRP-410004). Alternative, you can install resharper or use rider to get inline support in your IDE of choice. +## Downloading the source code -Note: If you run from command line under linux, you will need to prefix the output folder to your `LD_LIBRARY_PATH`. See `.vscode/launch.json` for an example +Clone the repository **including submodules**: -If you run into issues building you may need to restore nuget packages (commonly via `dotnet restore`). Visual Studio Code users must run `Restore` task from debug tab before attempt to build. +``` +git clone --recurse-submodules https://github.com/ppy/osu +cd osu +``` + +> If you forgot the `--recurse-submodules` option, run this command inside the `osu` directory: +> +> `git submodule update --init --recursive` + +To update the source code to the latest commit, run the following command inside the `osu` directory: + +``` +git pull --recurse-submodules +``` + +## Building + +Configuration for Visual Studio 2017, Rider and Visual Studio Code is included in the source code. + +> Visual Studio Code users must run the `Restore` task before any build attempt. + +You can also build osu! from the command-line, with `dotnet`: + +``` +dotnet restore +dotnet run --project osu.Desktop -c Release +``` + +The `-c Release` option **must be omitted** when building for development purposes. + +### A note for Linux users + +On Linux, the environment variable `LD_LIBRARY_PATH` must point to the build directory (replace `Release` with `Debug` in the following paths if you do not want to include the `-c Release` flag). + +The build directory is located at `osu.Desktop/bin/Release/netcoreappX.X`, where `X.X` is the version of the .NET Core SDK (see Requirements). The required value can be found in `osu.Desktop/osu.Desktop.csproj`, look for a line starting with "TargetFramework". + +For example, you can run osu! with the following commands: + +``` +export NETCORE_VERSION="$(grep TargetFramework osu.Desktop/osu.Desktop.csproj | sed -r 's/.*>(.*)<\/.*/\1/')" +export LD_LIBRARY_PATH="$(pwd)/osu.Desktop/bin/Release/$NETCORE_VERSION" +dotnet run --project osu.Desktop -c Release +``` + +## Code analysis + +Code analysis can be run with `powershell ./build.ps1` or `build.sh`. This is currently only supported under windows due to [resharper cli shortcomings](https://youtrack.jetbrains.com/issue/RSRP-410004). Alternative, you can install resharper or use rider to get inline support in your IDE of choice. # Contributing From 0c26145fd105fff9470fa46dc9455f9b00ece4e8 Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Thu, 17 Jan 2019 19:23:44 +0000 Subject: [PATCH 15/24] bellow -> below Co-Authored-By: Llaurence <40535137+Llaurence@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3dd96773f2..36dfe4fc7c 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ If you are not interested in developing the game, please head over to the [relea - Windows 64 bit users should download and run `install.exe`. - MacOS users should download and run `osu.app.zip`. -There is currently no release for Windows 32 bit, Linux, or any other platform. If you are not running Windows 64 bit or MacOS, you should build osu! from the source code (see bellow). +There is currently no release for Windows 32 bit, Linux, or any other platform. If you are not running Windows 64 bit or MacOS, you should build osu! from the source code (see below). ## Downloading the source code From 209deb842af7769308f7de07e691fe1a48bb0419 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 18 Jan 2019 16:14:52 +0900 Subject: [PATCH 16/24] Add note about iOS --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 36dfe4fc7c..9c484503fe 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ If you are not interested in developing the game, please head over to the [relea - Windows 64 bit users should download and run `install.exe`. - MacOS users should download and run `osu.app.zip`. +- iOS users can join the [TestFlight beta program](https://t.co/xQJmHkfC18). There is currently no release for Windows 32 bit, Linux, or any other platform. If you are not running Windows 64 bit or MacOS, you should build osu! from the source code (see below). From 32940074afe8ed640a67809bb1fa080d62f71c5c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 18 Jan 2019 08:50:36 +0000 Subject: [PATCH 17/24] Windows 64 bit -> Windows (x64) Co-Authored-By: Llaurence <40535137+Llaurence@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c484503fe..955c38d0b4 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ We are accepting bug reports (please report with as much detail as possible). Fe If you are not interested in developing the game, please head over to the [releases](https://github.com/ppy/osu/releases) to download a precompiled build with automatic updating enabled. -- Windows 64 bit users should download and run `install.exe`. +- Windows (x64) users should download and run `install.exe`. - MacOS users should download and run `osu.app.zip`. - iOS users can join the [TestFlight beta program](https://t.co/xQJmHkfC18). From 55286922602ef99c5dd3b68e2260ef2014a11d0b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 18 Jan 2019 08:51:06 +0000 Subject: [PATCH 18/24] Specify macOS version Co-Authored-By: Llaurence <40535137+Llaurence@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 955c38d0b4..59a2f821c6 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ We are accepting bug reports (please report with as much detail as possible). Fe If you are not interested in developing the game, please head over to the [releases](https://github.com/ppy/osu/releases) to download a precompiled build with automatic updating enabled. - Windows (x64) users should download and run `install.exe`. -- MacOS users should download and run `osu.app.zip`. +- macOS users (10.12 "Sierra" and higher) should download and run `osu.app.zip`. - iOS users can join the [TestFlight beta program](https://t.co/xQJmHkfC18). There is currently no release for Windows 32 bit, Linux, or any other platform. If you are not running Windows 64 bit or MacOS, you should build osu! from the source code (see below). From 6aaedb880837fdb82991a0622ae0be2cab97e597 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 18 Jan 2019 08:51:57 +0000 Subject: [PATCH 19/24] Reword the "other platforms have no prebuilt binaries" sentence Co-Authored-By: Llaurence <40535137+Llaurence@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 59a2f821c6..c6fd17ad2d 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ If you are not interested in developing the game, please head over to the [relea - macOS users (10.12 "Sierra" and higher) should download and run `osu.app.zip`. - iOS users can join the [TestFlight beta program](https://t.co/xQJmHkfC18). -There is currently no release for Windows 32 bit, Linux, or any other platform. If you are not running Windows 64 bit or MacOS, you should build osu! from the source code (see below). +If your platform is not listed above, there is still a chance you can manually build it by following the instructions below. ## Downloading the source code From 94648658f79af3c576f2dbb29b86f0999e8995cf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 18 Jan 2019 08:52:31 +0000 Subject: [PATCH 20/24] Links to ides sites Co-Authored-By: Llaurence <40535137+Llaurence@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c6fd17ad2d..cd813704d4 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ git pull --recurse-submodules ## Building -Configuration for Visual Studio 2017, Rider and Visual Studio Code is included in the source code. +Build configurations for [Visual Studio 2017+](https://visualstudio.microsoft.com/vs/), [Jetbrains Rider](https://www.jetbrains.com/rider/) and [Visual Studio Code](https://code.visualstudio.com/) are included in the source code. > Visual Studio Code users must run the `Restore` task before any build attempt. From 2db28468821b747f83845b1287ece0956f834d44 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 18 Jan 2019 08:52:52 +0000 Subject: [PATCH 21/24] Remove "with dotnet" Co-Authored-By: Llaurence <40535137+Llaurence@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cd813704d4..8faf83786f 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Build configurations for [Visual Studio 2017+](https://visualstudio.microsoft.co > Visual Studio Code users must run the `Restore` task before any build attempt. -You can also build osu! from the command-line, with `dotnet`: +You can also build osu! from the command-line: ``` dotnet restore From c3c1e1930148ecc6efffef6e85090ea126775608 Mon Sep 17 00:00:00 2001 From: Llaurence Date: Fri, 18 Jan 2019 10:07:42 +0100 Subject: [PATCH 22/24] Release -> Debug by default, linux note rewrite --- README.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8faf83786f..1961f59ef5 100644 --- a/README.md +++ b/README.md @@ -53,24 +53,23 @@ Build configurations for [Visual Studio 2017+](https://visualstudio.microsoft.co You can also build osu! from the command-line: ``` -dotnet restore -dotnet run --project osu.Desktop -c Release +dotnet run --project osu.Desktop ``` -The `-c Release` option **must be omitted** when building for development purposes. +If you are not interested in debugging osu!, you can add `-c Release` to gain performance. In this case, you must replace `Debug` with `Release` in the following section. + +If the build fails, try to restore nuget packages with `dotnet restore`. ### A note for Linux users -On Linux, the environment variable `LD_LIBRARY_PATH` must point to the build directory (replace `Release` with `Debug` in the following paths if you do not want to include the `-c Release` flag). +On Linux, the environment variable `LD_LIBRARY_PATH` must point to the build directory, located at `osu.Desktop/bin/Debug/$NETCORE_VERSION`. -The build directory is located at `osu.Desktop/bin/Release/netcoreappX.X`, where `X.X` is the version of the .NET Core SDK (see Requirements). The required value can be found in `osu.Desktop/osu.Desktop.csproj`, look for a line starting with "TargetFramework". +`$NETCORE_VERSION` is the version of .NET Core SDK. You can have it with `grep TargetFramework osu.Desktop/osu.Desktop.csproj | sed -r 's/.*>(.*)<\/.*/\1/'`. -For example, you can run osu! with the following commands: +For example, you can run osu! with the following command: ``` -export NETCORE_VERSION="$(grep TargetFramework osu.Desktop/osu.Desktop.csproj | sed -r 's/.*>(.*)<\/.*/\1/')" -export LD_LIBRARY_PATH="$(pwd)/osu.Desktop/bin/Release/$NETCORE_VERSION" -dotnet run --project osu.Desktop -c Release +LD_LIBRARY_PATH="$(pwd)/osu.Desktop/bin/Debug/netcoreapp2.2" dotnet run --project osu.Desktop ``` ## Code analysis From e5610b61eb7ab130eaacb2c36d2cb6968660de0e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 20 Jan 2019 11:13:15 +0900 Subject: [PATCH 23/24] Final pass --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1961f59ef5..c031b10ccd 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ We are accepting bug reports (please report with as much detail as possible). Fe # Requirements - A desktop platform with the [.NET Core SDK 2.2](https://www.microsoft.com/net/learn/get-started) or higher installed. -- When working with the codebase, we recommend using an IDE with intellisense and syntax highlighting, such as [Visual Studio Community Edition](https://www.visualstudio.com/) (Windows), [Visual Studio Code](https://code.visualstudio.com/) (with the C# plugin installed) or [Jetbrains Rider](https://www.jetbrains.com/rider/) (commercial). +- When working with the codebase, we recommend using an IDE with intellisense and syntax highlighting, such as [Visual Studio 2017+](https://visualstudio.microsoft.com/vs/), [Jetbrains Rider](https://www.jetbrains.com/rider/) or [Visual Studio Code](https://code.visualstudio.com/). # Running osu! @@ -29,7 +29,7 @@ If your platform is not listed above, there is still a chance you can manually b Clone the repository **including submodules**: -``` +```shell git clone --recurse-submodules https://github.com/ppy/osu cd osu ``` @@ -40,19 +40,19 @@ cd osu To update the source code to the latest commit, run the following command inside the `osu` directory: -``` +```shell git pull --recurse-submodules ``` ## Building -Build configurations for [Visual Studio 2017+](https://visualstudio.microsoft.com/vs/), [Jetbrains Rider](https://www.jetbrains.com/rider/) and [Visual Studio Code](https://code.visualstudio.com/) are included in the source code. +Build configurations for the recommended IDEs (listed above) are included. You should use the provided Build/Run functionality of your IDE to get things going. When testing or building new components, it's highly encouraged you use the `VisualTests` project/configuration. More information on this provided below. > Visual Studio Code users must run the `Restore` task before any build attempt. You can also build osu! from the command-line: -``` +```shell dotnet run --project osu.Desktop ``` @@ -68,7 +68,7 @@ On Linux, the environment variable `LD_LIBRARY_PATH` must point to the build dir For example, you can run osu! with the following command: -``` +```shell LD_LIBRARY_PATH="$(pwd)/osu.Desktop/bin/Debug/netcoreapp2.2" dotnet run --project osu.Desktop ``` From ffed411eafe2263ba71f3d3ad4314c304ded9676 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 20 Jan 2019 11:23:33 +0900 Subject: [PATCH 24/24] Minor fixes --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c031b10ccd..fc9ef51c6b 100644 --- a/README.md +++ b/README.md @@ -50,13 +50,13 @@ Build configurations for the recommended IDEs (listed above) are included. You s > Visual Studio Code users must run the `Restore` task before any build attempt. -You can also build osu! from the command-line: +You can also build and run osu! from the command-line with a single command: ```shell dotnet run --project osu.Desktop ``` -If you are not interested in debugging osu!, you can add `-c Release` to gain performance. In this case, you must replace `Debug` with `Release` in the following section. +If you are not interested in debugging osu!, you can add `-c Release` to gain performance. In this case, you must replace `Debug` with `Release` in any commands mentioned in this document. If the build fails, try to restore nuget packages with `dotnet restore`.