mirror of
https://github.com/ppy/osu.git
synced 2025-02-11 03:32:55 +08:00
Merge branch 'master' into layout-rework
This commit is contained in:
commit
dc79c11b6a
@ -27,7 +27,7 @@ If you are looking to install or test osu! without setting up a development envi
|
|||||||
|
|
||||||
**Latest build:**
|
**Latest build:**
|
||||||
|
|
||||||
| [Windows (x64)](https://github.com/ppy/osu/releases/latest/download/install.exe) | [macOS 10.12+](https://github.com/ppy/osu/releases/latest/download/osu.app.zip) | [Linux (x64)](https://github.com/ppy/osu/releases/latest/download/osu.x86_64.AppImage) | [iOS(iOS 10+)](https://osu.ppy.sh/home/testflight) | [Android (5+)](https://github.com/ppy/osu/releases/latest/download/sh.ppy.osulazer.apk)
|
| [Windows (x64)](https://github.com/ppy/osu/releases/latest/download/install.exe) | [macOS 10.12+](https://github.com/ppy/osu/releases/latest/download/osu.app.zip) | [Linux (x64)](https://github.com/ppy/osu/releases/latest/download/osu.AppImage) | [iOS(iOS 10+)](https://osu.ppy.sh/home/testflight) | [Android (5+)](https://github.com/ppy/osu/releases/latest/download/sh.ppy.osulazer.apk)
|
||||||
| ------------- | ------------- | ------------- | ------------- | ------------- |
|
| ------------- | ------------- | ------------- | ------------- | ------------- |
|
||||||
|
|
||||||
- When running on Windows 7 or 8.1, **[additional prerequisites](https://docs.microsoft.com/en-us/dotnet/core/install/dependencies?tabs=netcore31&pivots=os-windows)** may be required to correctly run .NET Core applications if your operating system is not up-to-date with the latest service packs.
|
- When running on Windows 7 or 8.1, **[additional prerequisites](https://docs.microsoft.com/en-us/dotnet/core/install/dependencies?tabs=netcore31&pivots=os-windows)** may be required to correctly run .NET Core applications if your operating system is not up-to-date with the latest service packs.
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
<DebugType>portable</DebugType>
|
<DebugType>portable</DebugType>
|
||||||
<Optimize>False</Optimize>
|
<Optimize>False</Optimize>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<EnableLLVM>false</EnableLLVM>
|
|
||||||
<AndroidManagedSymbols>false</AndroidManagedSymbols>
|
<AndroidManagedSymbols>false</AndroidManagedSymbols>
|
||||||
<AndroidUseSharedRuntime>true</AndroidUseSharedRuntime>
|
<AndroidUseSharedRuntime>true</AndroidUseSharedRuntime>
|
||||||
<EmbedAssembliesIntoApk>false</EmbedAssembliesIntoApk>
|
<EmbedAssembliesIntoApk>false</EmbedAssembliesIntoApk>
|
||||||
@ -34,7 +33,6 @@
|
|||||||
<DebugSymbols>false</DebugSymbols>
|
<DebugSymbols>false</DebugSymbols>
|
||||||
<DebugType>None</DebugType>
|
<DebugType>None</DebugType>
|
||||||
<Optimize>True</Optimize>
|
<Optimize>True</Optimize>
|
||||||
<EnableLLVM>true</EnableLLVM>
|
|
||||||
<AndroidManagedSymbols>false</AndroidManagedSymbols>
|
<AndroidManagedSymbols>false</AndroidManagedSymbols>
|
||||||
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
|
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
|
||||||
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
|
||||||
@ -54,6 +52,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.221.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.221.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.225.0" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.229.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
<AssemblyName>osu.Android</AssemblyName>
|
<AssemblyName>osu.Android</AssemblyName>
|
||||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||||
<AndroidSupportedAbis>armeabi-v7a;x86;arm64-v8a</AndroidSupportedAbis>
|
<AndroidSupportedAbis>armeabi-v7a;x86;arm64-v8a</AndroidSupportedAbis>
|
||||||
|
<EnableLLVM>false</EnableLLVM> <!-- This currently causes random lockups during gameplay. https://github.com/mono/mono/issues/18973 -->
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<MandroidI18n>cjk;mideast;other;rare;west</MandroidI18n>
|
<MandroidI18n>cjk;mideast;other;rare;west</MandroidI18n>
|
||||||
|
@ -42,6 +42,9 @@ namespace osu.Game.Rulesets.Catch.Tests
|
|||||||
AddStep("show droplet", () => SetContents(createDrawableDroplet));
|
AddStep("show droplet", () => SetContents(createDrawableDroplet));
|
||||||
|
|
||||||
AddStep("show tiny droplet", () => SetContents(createDrawableTinyDroplet));
|
AddStep("show tiny droplet", () => SetContents(createDrawableTinyDroplet));
|
||||||
|
|
||||||
|
foreach (FruitVisualRepresentation rep in Enum.GetValues(typeof(FruitVisualRepresentation)))
|
||||||
|
AddStep($"show hyperdash {rep}", () => SetContents(() => createDrawable(rep, true)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Drawable createDrawableTinyDroplet()
|
private Drawable createDrawableTinyDroplet()
|
||||||
@ -82,9 +85,13 @@ namespace osu.Game.Rulesets.Catch.Tests
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private Drawable createDrawable(FruitVisualRepresentation rep)
|
private Drawable createDrawable(FruitVisualRepresentation rep, bool hyperdash = false)
|
||||||
{
|
{
|
||||||
Fruit fruit = new TestCatchFruit(rep) { Scale = 1.5f };
|
Fruit fruit = new TestCatchFruit(rep)
|
||||||
|
{
|
||||||
|
Scale = 1.5f,
|
||||||
|
HyperDashTarget = hyperdash ? new Banana() : null
|
||||||
|
};
|
||||||
|
|
||||||
return new DrawableFruit(fruit)
|
return new DrawableFruit(fruit)
|
||||||
{
|
{
|
||||||
|
@ -7,9 +7,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Rulesets.Catch.Objects.Drawables.Pieces;
|
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osuTK;
|
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
||||||
@ -64,15 +62,24 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
|||||||
|
|
||||||
if (hitObject.HyperDash)
|
if (hitObject.HyperDash)
|
||||||
{
|
{
|
||||||
AddInternal(new Pulp
|
AddInternal(new Circle
|
||||||
{
|
{
|
||||||
RelativePositionAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
AccentColour = { Value = Color4.Red },
|
BorderColour = Color4.Red,
|
||||||
|
BorderThickness = 12f * RADIUS_ADJUST,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
AlwaysPresent = true,
|
||||||
|
Alpha = 0.3f,
|
||||||
Blending = BlendingParameters.Additive,
|
Blending = BlendingParameters.Additive,
|
||||||
Alpha = 0.5f,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Scale = new Vector2(1.333f)
|
Colour = Color4.Red,
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ using osu.Framework.Graphics.Sprites;
|
|||||||
using osu.Game.Rulesets.Catch.Objects.Drawables;
|
using osu.Game.Rulesets.Catch.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Skinning
|
namespace osu.Game.Rulesets.Catch.Skinning
|
||||||
@ -49,6 +50,23 @@ namespace osu.Game.Rulesets.Catch.Skinning
|
|||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (drawableCatchObject.HitObject.HyperDash)
|
||||||
|
{
|
||||||
|
var hyperDash = new Sprite
|
||||||
|
{
|
||||||
|
Texture = skin.GetTexture(lookupName),
|
||||||
|
Colour = Color4.Red,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Blending = BlendingParameters.Additive,
|
||||||
|
Depth = 1,
|
||||||
|
Alpha = 0.7f,
|
||||||
|
Scale = new Vector2(1.2f)
|
||||||
|
};
|
||||||
|
|
||||||
|
AddInternal(hyperDash);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
|
@ -50,6 +50,9 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
|
|
||||||
public void OnResult(DrawableCatchHitObject fruit, JudgementResult result)
|
public void OnResult(DrawableCatchHitObject fruit, JudgementResult result)
|
||||||
{
|
{
|
||||||
|
if (result.Judgement is IgnoreJudgement)
|
||||||
|
return;
|
||||||
|
|
||||||
void runAfterLoaded(Action action)
|
void runAfterLoaded(Action action)
|
||||||
{
|
{
|
||||||
if (lastPlateableFruit == null)
|
if (lastPlateableFruit == null)
|
||||||
|
@ -7,6 +7,8 @@ using NUnit.Framework;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Overlays.Comments;
|
using osu.Game.Overlays.Comments;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Game.Overlays;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Online
|
namespace osu.Game.Tests.Visual.Online
|
||||||
{
|
{
|
||||||
@ -18,6 +20,9 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
typeof(VotePill)
|
typeof(VotePill)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
[Cached]
|
||||||
|
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
|
||||||
|
|
||||||
private VotePill votePill;
|
private VotePill votePill;
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -16,6 +16,8 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
{
|
{
|
||||||
public readonly Bindable<BeatmapInfo> Beatmap = new Bindable<BeatmapInfo>();
|
public readonly Bindable<BeatmapInfo> Beatmap = new Bindable<BeatmapInfo>();
|
||||||
|
|
||||||
|
protected override double LoadDelay => 500;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private BeatmapManager beatmaps { get; set; }
|
private BeatmapManager beatmaps { get; set; }
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ using System.Reflection;
|
|||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
|
||||||
using osu.Game.Overlays.Settings;
|
using osu.Game.Overlays.Settings;
|
||||||
|
|
||||||
namespace osu.Game.Configuration
|
namespace osu.Game.Configuration
|
||||||
@ -105,7 +104,8 @@ namespace osu.Game.Configuration
|
|||||||
var dropdownType = typeof(SettingsEnumDropdown<>).MakeGenericType(bindable.GetType().GetGenericArguments()[0]);
|
var dropdownType = typeof(SettingsEnumDropdown<>).MakeGenericType(bindable.GetType().GetGenericArguments()[0]);
|
||||||
var dropdown = (Drawable)Activator.CreateInstance(dropdownType);
|
var dropdown = (Drawable)Activator.CreateInstance(dropdownType);
|
||||||
|
|
||||||
dropdown.GetType().GetProperty(nameof(IHasCurrentValue<object>.Current))?.SetValue(dropdown, obj);
|
dropdownType.GetProperty(nameof(SettingsDropdown<object>.LabelText))?.SetValue(dropdown, attr.Label);
|
||||||
|
dropdownType.GetProperty(nameof(SettingsDropdown<object>.Bindable))?.SetValue(dropdown, bindable);
|
||||||
|
|
||||||
yield return dropdown;
|
yield return dropdown;
|
||||||
|
|
||||||
|
19
osu.Game/Online/API/Requests/GetRoomRequest.cs
Normal file
19
osu.Game/Online/API/Requests/GetRoomRequest.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Game.Online.Multiplayer;
|
||||||
|
|
||||||
|
namespace osu.Game.Online.API.Requests
|
||||||
|
{
|
||||||
|
public class GetRoomRequest : APIRequest<Room>
|
||||||
|
{
|
||||||
|
private readonly int roomId;
|
||||||
|
|
||||||
|
public GetRoomRequest(int roomId)
|
||||||
|
{
|
||||||
|
this.roomId = roomId;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override string Target => $"rooms/{roomId}";
|
||||||
|
}
|
||||||
|
}
|
@ -65,9 +65,7 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
|
|
||||||
public void MapObjects(BeatmapManager beatmaps, RulesetStore rulesets)
|
public void MapObjects(BeatmapManager beatmaps, RulesetStore rulesets)
|
||||||
{
|
{
|
||||||
// If we don't have an api beatmap, the request occurred as a result of room creation, so we can query the local beatmap instead
|
Beatmap.Value = apiBeatmap.ToBeatmap(rulesets);
|
||||||
// Todo: Is this a bug? Room creation only returns the beatmap ID
|
|
||||||
Beatmap.Value = apiBeatmap == null ? beatmaps.QueryBeatmap(b => b.OnlineBeatmapID == BeatmapID) : apiBeatmap.ToBeatmap(rulesets);
|
|
||||||
Ruleset.Value = rulesets.GetRuleset(RulesetID);
|
Ruleset.Value = rulesets.GetRuleset(RulesetID);
|
||||||
|
|
||||||
Ruleset rulesetInstance = Ruleset.Value.CreateInstance();
|
Ruleset rulesetInstance = Ruleset.Value.CreateInstance();
|
||||||
|
@ -59,8 +59,8 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
public Bindable<int?> MaxParticipants { get; private set; } = new Bindable<int?>();
|
public Bindable<int?> MaxParticipants { get; private set; } = new Bindable<int?>();
|
||||||
|
|
||||||
[Cached]
|
[Cached]
|
||||||
[JsonIgnore]
|
[JsonProperty("recent_participants")]
|
||||||
public BindableList<User> Participants { get; private set; } = new BindableList<User>();
|
public BindableList<User> RecentParticipants { get; private set; } = new BindableList<User>();
|
||||||
|
|
||||||
[Cached]
|
[Cached]
|
||||||
public Bindable<int> ParticipantCount { get; private set; } = new Bindable<int>();
|
public Bindable<int> ParticipantCount { get; private set; } = new Bindable<int>();
|
||||||
@ -118,25 +118,16 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
if (DateTimeOffset.Now >= EndDate.Value)
|
if (DateTimeOffset.Now >= EndDate.Value)
|
||||||
Status.Value = new RoomStatusEnded();
|
Status.Value = new RoomStatusEnded();
|
||||||
|
|
||||||
// transfer local beatmaps across to ensure we have Metadata available (CreateRoomRequest does not give us metadata as expected)
|
|
||||||
foreach (var item in other.Playlist)
|
|
||||||
{
|
|
||||||
var localItem = Playlist.FirstOrDefault(i => i.BeatmapID == item.BeatmapID);
|
|
||||||
|
|
||||||
if (localItem != null)
|
|
||||||
item.Beatmap.Value.Metadata = localItem.Beatmap.Value.Metadata;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Playlist.SequenceEqual(other.Playlist))
|
if (!Playlist.SequenceEqual(other.Playlist))
|
||||||
{
|
{
|
||||||
Playlist.Clear();
|
Playlist.Clear();
|
||||||
Playlist.AddRange(other.Playlist);
|
Playlist.AddRange(other.Playlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Participants.SequenceEqual(other.Participants))
|
if (!RecentParticipants.SequenceEqual(other.RecentParticipants))
|
||||||
{
|
{
|
||||||
Participants.Clear();
|
RecentParticipants.Clear();
|
||||||
Participants.AddRange(other.Participants);
|
RecentParticipants.AddRange(other.RecentParticipants);
|
||||||
}
|
}
|
||||||
|
|
||||||
Position = other.Position;
|
Position = other.Position;
|
||||||
|
@ -384,7 +384,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
|
|
||||||
protected override void OnExpandedChanged(ValueChangedEvent<bool> expanded)
|
protected override void OnExpandedChanged(ValueChangedEvent<bool> expanded)
|
||||||
{
|
{
|
||||||
text.Text = $@"{(expanded.NewValue ? "[+]" : "[-]")} replies ({count})";
|
text.Text = $@"{(expanded.NewValue ? "[-]" : "[+]")} replies ({count})";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,9 @@ namespace osu.Game.Overlays.Comments
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private IAPIProvider api { get; set; }
|
private IAPIProvider api { get; set; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OverlayColourProvider colourProvider { get; set; }
|
||||||
|
|
||||||
private readonly Comment comment;
|
private readonly Comment comment;
|
||||||
private Box background;
|
private Box background;
|
||||||
private Box hoverLayer;
|
private Box hoverLayer;
|
||||||
@ -68,7 +71,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
isVoted.Value = comment.IsVoted;
|
isVoted.Value = comment.IsVoted;
|
||||||
votesCount.Value = comment.VotesCount;
|
votesCount.Value = comment.VotesCount;
|
||||||
isVoted.BindValueChanged(voted => background.Colour = voted.NewValue ? AccentColour : OsuColour.Gray(0.05f), true);
|
isVoted.BindValueChanged(voted => background.Colour = voted.NewValue ? AccentColour : colourProvider.Background6, true);
|
||||||
votesCount.BindValueChanged(count => votesCounter.Text = $"+{count.NewValue}", true);
|
votesCount.BindValueChanged(count => votesCounter.Text = $"+{count.NewValue}", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,11 +22,6 @@ namespace osu.Game.Overlays.Settings.Sections.Debug
|
|||||||
Bindable = frameworkConfig.GetBindable<bool>(FrameworkSetting.ShowLogOverlay)
|
Bindable = frameworkConfig.GetBindable<bool>(FrameworkSetting.ShowLogOverlay)
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
|
||||||
LabelText = "Performance logging",
|
|
||||||
Bindable = config.GetBindable<bool>(DebugSetting.PerformanceLogging)
|
|
||||||
},
|
|
||||||
new SettingsCheckbox
|
|
||||||
{
|
{
|
||||||
LabelText = "Bypass front-to-back render pass",
|
LabelText = "Bypass front-to-back render pass",
|
||||||
Bindable = config.GetBindable<bool>(DebugSetting.BypassFrontToBackPass)
|
Bindable = config.GetBindable<bool>(DebugSetting.BypassFrontToBackPass)
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Platform;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Settings.Sections.Graphics
|
namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||||
@ -24,6 +25,11 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
LabelText = "Frame limiter",
|
LabelText = "Frame limiter",
|
||||||
Bindable = config.GetBindable<FrameSync>(FrameworkSetting.FrameSync)
|
Bindable = config.GetBindable<FrameSync>(FrameworkSetting.FrameSync)
|
||||||
},
|
},
|
||||||
|
new SettingsEnumDropdown<ExecutionMode>
|
||||||
|
{
|
||||||
|
LabelText = "Threading mode",
|
||||||
|
Bindable = config.GetBindable<ExecutionMode>(FrameworkSetting.ExecutionMode)
|
||||||
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Show FPS",
|
LabelText = "Show FPS",
|
||||||
|
@ -221,18 +221,6 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<DrawableHitObject, ArmedState> ApplyCustomUpdateState;
|
public event Action<DrawableHitObject, ArmedState> ApplyCustomUpdateState;
|
||||||
|
|
||||||
#pragma warning disable 618 // (legacy state management) - can be removed 20200227
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Enables automatic transform management of this hitobject. Implementation of transforms should be done in <see cref="UpdateInitialTransforms"/> and <see cref="UpdateStateTransforms"/> only. Rewinding and removing previous states is done automatically.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Going forward, this is the preferred way of implementing <see cref="DrawableHitObject"/>s. Previous functionality
|
|
||||||
/// is offered as a compatibility layer until all rulesets have been migrated across.
|
|
||||||
/// </remarks>
|
|
||||||
[Obsolete("Use UpdateInitialTransforms()/UpdateStateTransforms() instead")] // can be removed 20200227
|
|
||||||
protected virtual bool UseTransformStateManagement => true;
|
|
||||||
|
|
||||||
protected override void ClearInternal(bool disposeChildren = true) => throw new InvalidOperationException($"Should never clear a {nameof(DrawableHitObject)}");
|
protected override void ClearInternal(bool disposeChildren = true) => throw new InvalidOperationException($"Should never clear a {nameof(DrawableHitObject)}");
|
||||||
|
|
||||||
private void updateState(ArmedState newState, bool force = false)
|
private void updateState(ArmedState newState, bool force = false)
|
||||||
@ -240,8 +228,6 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
if (State.Value == newState && !force)
|
if (State.Value == newState && !force)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (UseTransformStateManagement)
|
|
||||||
{
|
|
||||||
LifetimeEnd = double.MaxValue;
|
LifetimeEnd = double.MaxValue;
|
||||||
|
|
||||||
double transformTime = HitObject.StartTime - InitialLifetimeOffset;
|
double transformTime = HitObject.StartTime - InitialLifetimeOffset;
|
||||||
@ -264,11 +250,6 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
|
|
||||||
if (state.Value != ArmedState.Idle && LifetimeEnd == double.MaxValue || HitObject.HitWindows == null)
|
if (state.Value != ArmedState.Idle && LifetimeEnd == double.MaxValue || HitObject.HitWindows == null)
|
||||||
Expire();
|
Expire();
|
||||||
}
|
|
||||||
else
|
|
||||||
state.Value = newState;
|
|
||||||
|
|
||||||
UpdateState(newState);
|
|
||||||
|
|
||||||
// apply any custom state overrides
|
// apply any custom state overrides
|
||||||
ApplyCustomUpdateState?.Invoke(this, newState);
|
ApplyCustomUpdateState?.Invoke(this, newState);
|
||||||
@ -303,30 +284,14 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
|
|
||||||
public override void ClearTransformsAfter(double time, bool propagateChildren = false, string targetMember = null)
|
public override void ClearTransformsAfter(double time, bool propagateChildren = false, string targetMember = null)
|
||||||
{
|
{
|
||||||
// When we are using automatic state management, parent calls to this should be blocked for safety.
|
// Parent calls to this should be blocked for safety, as we are manually handling this in updateState.
|
||||||
if (!UseTransformStateManagement)
|
|
||||||
base.ClearTransformsAfter(time, propagateChildren, targetMember);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ApplyTransformsAt(double time, bool propagateChildren = false)
|
public override void ApplyTransformsAt(double time, bool propagateChildren = false)
|
||||||
{
|
{
|
||||||
// When we are using automatic state management, parent calls to this should be blocked for safety.
|
// Parent calls to this should be blocked for safety, as we are manually handling this in updateState.
|
||||||
if (!UseTransformStateManagement)
|
|
||||||
base.ApplyTransformsAt(time, propagateChildren);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Legacy method to handle state changes.
|
|
||||||
/// Should generally not be used when <see cref="UseTransformStateManagement"/> is true; use <see cref="UpdateStateTransforms"/> instead.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="state">The new armed state.</param>
|
|
||||||
[Obsolete("Use UpdateInitialTransforms()/UpdateStateTransforms() instead")] // can be removed 20200227
|
|
||||||
protected virtual void UpdateState(ArmedState state)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma warning restore 618
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
protected sealed override void SkinChanged(ISkinSource skin, bool allowFallback)
|
protected sealed override void SkinChanged(ISkinSource skin, bool allowFallback)
|
||||||
|
@ -54,8 +54,6 @@ namespace osu.Game.Screens.Menu
|
|||||||
{
|
{
|
||||||
base.LogoArriving(logo, resuming);
|
base.LogoArriving(logo, resuming);
|
||||||
|
|
||||||
logo.Triangles = true;
|
|
||||||
|
|
||||||
if (!resuming)
|
if (!resuming)
|
||||||
{
|
{
|
||||||
PrepareMenuLoad();
|
PrepareMenuLoad();
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
public OverlinedParticipants(Direction direction)
|
public OverlinedParticipants(Direction direction)
|
||||||
: base("Participants")
|
: base("Recent participants")
|
||||||
{
|
{
|
||||||
OsuScrollContainer scroll;
|
OsuScrollContainer scroll;
|
||||||
ParticipantsList list;
|
ParticipantsList list;
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
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.Cursor;
|
using osu.Framework.Graphics.Cursor;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Online.API;
|
|
||||||
using osu.Game.Online.API.Requests;
|
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
using osu.Game.Users.Drawables;
|
using osu.Game.Users.Drawables;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -26,7 +24,9 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
base.RelativeSizeAxes = value;
|
base.RelativeSizeAxes = value;
|
||||||
fill.RelativeSizeAxes = value;
|
|
||||||
|
if (tiles != null)
|
||||||
|
tiles.RelativeSizeAxes = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,83 +36,75 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
base.AutoSizeAxes = value;
|
base.AutoSizeAxes = value;
|
||||||
fill.AutoSizeAxes = value;
|
|
||||||
|
if (tiles != null)
|
||||||
|
tiles.AutoSizeAxes = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private FillDirection direction = FillDirection.Full;
|
||||||
|
|
||||||
public FillDirection Direction
|
public FillDirection Direction
|
||||||
{
|
{
|
||||||
get => fill.Direction;
|
get => direction;
|
||||||
set => fill.Direction = value;
|
set
|
||||||
}
|
|
||||||
|
|
||||||
private readonly FillFlowContainer fill;
|
|
||||||
|
|
||||||
public ParticipantsList()
|
|
||||||
{
|
{
|
||||||
InternalChild = fill = new FillFlowContainer { Spacing = new Vector2(10) };
|
direction = value;
|
||||||
|
|
||||||
|
if (tiles != null)
|
||||||
|
tiles.Direction = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
RoomID.BindValueChanged(_ => updateParticipants(), true);
|
RecentParticipants.CollectionChanged += (_, __) => updateParticipants();
|
||||||
|
updateParticipants();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Resolved]
|
private ScheduledDelegate scheduledUpdate;
|
||||||
private IAPIProvider api { get; set; }
|
private FillFlowContainer<UserTile> tiles;
|
||||||
|
|
||||||
private GetRoomScoresRequest request;
|
|
||||||
|
|
||||||
private void updateParticipants()
|
private void updateParticipants()
|
||||||
{
|
{
|
||||||
var roomId = RoomID.Value ?? 0;
|
scheduledUpdate?.Cancel();
|
||||||
|
scheduledUpdate = Schedule(() =>
|
||||||
request?.Cancel();
|
|
||||||
|
|
||||||
// nice little progressive fade
|
|
||||||
int time = 500;
|
|
||||||
|
|
||||||
foreach (var c in fill.Children)
|
|
||||||
{
|
{
|
||||||
c.Delay(500 - time).FadeOut(time, Easing.Out);
|
tiles?.FadeOut(250, Easing.Out).Expire();
|
||||||
time = Math.Max(20, time - 20);
|
|
||||||
c.Expire();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (roomId == 0) return;
|
tiles = new FillFlowContainer<UserTile>
|
||||||
|
|
||||||
request = new GetRoomScoresRequest(roomId);
|
|
||||||
request.Success += scores => Schedule(() =>
|
|
||||||
{
|
{
|
||||||
if (roomId != RoomID.Value)
|
Alpha = 0,
|
||||||
return;
|
Direction = Direction,
|
||||||
|
AutoSizeAxes = AutoSizeAxes,
|
||||||
|
RelativeSizeAxes = RelativeSizeAxes,
|
||||||
|
Spacing = new Vector2(10)
|
||||||
|
};
|
||||||
|
|
||||||
fill.Clear();
|
for (int i = 0; i < RecentParticipants.Count; i++)
|
||||||
foreach (var s in scores)
|
tiles.Add(new UserTile { User = RecentParticipants[i] });
|
||||||
fill.Add(new UserTile(s.User));
|
|
||||||
|
|
||||||
fill.FadeInFromZero(1000, Easing.OutQuint);
|
AddInternal(tiles);
|
||||||
|
|
||||||
|
tiles.Delay(250).FadeIn(250, Easing.OutQuint);
|
||||||
});
|
});
|
||||||
|
|
||||||
api.Queue(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
|
||||||
{
|
|
||||||
request?.Cancel();
|
|
||||||
base.Dispose(isDisposing);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class UserTile : CompositeDrawable, IHasTooltip
|
private class UserTile : CompositeDrawable, IHasTooltip
|
||||||
{
|
{
|
||||||
private readonly User user;
|
public User User
|
||||||
|
{
|
||||||
public string TooltipText => user.Username;
|
get => avatar.User;
|
||||||
|
set => avatar.User = value;
|
||||||
public UserTile(User user)
|
}
|
||||||
|
|
||||||
|
public string TooltipText => User?.Username ?? string.Empty;
|
||||||
|
|
||||||
|
private readonly UpdateableAvatar avatar;
|
||||||
|
|
||||||
|
public UserTile()
|
||||||
{
|
{
|
||||||
this.user = user;
|
|
||||||
Size = new Vector2(TILE_SIZE);
|
Size = new Vector2(TILE_SIZE);
|
||||||
CornerRadius = 5f;
|
CornerRadius = 5f;
|
||||||
Masking = true;
|
Masking = true;
|
||||||
@ -124,11 +116,7 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = OsuColour.FromHex(@"27252d"),
|
Colour = OsuColour.FromHex(@"27252d"),
|
||||||
},
|
},
|
||||||
new UpdateableAvatar
|
avatar = new UpdateableAvatar { RelativeSizeAxes = Axes.Both },
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
User = user,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
private Bindable<FilterCriteria> filter { get; set; }
|
private Bindable<FilterCriteria> filter { get; set; }
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private Bindable<Room> currentRoom { get; set; }
|
private Bindable<Room> selectedRoom { get; set; }
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private IRoomManager roomManager { get; set; }
|
private IRoomManager roomManager { get; set; }
|
||||||
@ -122,7 +122,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
else
|
else
|
||||||
roomFlow.Children.ForEach(r => r.State = r.Room == room ? SelectionState.Selected : SelectionState.NotSelected);
|
roomFlow.Children.ForEach(r => r.State = r.Room == room ? SelectionState.Selected : SelectionState.NotSelected);
|
||||||
|
|
||||||
currentRoom.Value = room;
|
selectedRoom.Value = room;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Screens.Multi.Lounge
|
|||||||
private readonly LoadingLayer loadingLayer;
|
private readonly LoadingLayer loadingLayer;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private Bindable<Room> currentRoom { get; set; }
|
private Bindable<Room> selectedRoom { get; set; }
|
||||||
|
|
||||||
public LoungeSubScreen()
|
public LoungeSubScreen()
|
||||||
{
|
{
|
||||||
@ -101,8 +101,8 @@ namespace osu.Game.Screens.Multi.Lounge
|
|||||||
{
|
{
|
||||||
base.OnResuming(last);
|
base.OnResuming(last);
|
||||||
|
|
||||||
if (currentRoom.Value?.RoomID.Value == null)
|
if (selectedRoom.Value?.RoomID.Value == null)
|
||||||
currentRoom.Value = new Room();
|
selectedRoom.Value = new Room();
|
||||||
|
|
||||||
onReturning();
|
onReturning();
|
||||||
}
|
}
|
||||||
@ -143,7 +143,7 @@ namespace osu.Game.Screens.Multi.Lounge
|
|||||||
if (!this.IsCurrentScreen())
|
if (!this.IsCurrentScreen())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
currentRoom.Value = room;
|
selectedRoom.Value = room;
|
||||||
|
|
||||||
this.Push(new MatchSubScreen(room));
|
this.Push(new MatchSubScreen(room));
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ namespace osu.Game.Screens.Multi
|
|||||||
private readonly IBindable<bool> isIdle = new BindableBool();
|
private readonly IBindable<bool> isIdle = new BindableBool();
|
||||||
|
|
||||||
[Cached]
|
[Cached]
|
||||||
private readonly Bindable<Room> currentRoom = new Bindable<Room>();
|
private readonly Bindable<Room> selectedRoom = new Bindable<Room>();
|
||||||
|
|
||||||
[Cached]
|
[Cached]
|
||||||
private readonly Bindable<FilterCriteria> currentFilter = new Bindable<FilterCriteria>(new FilterCriteria());
|
private readonly Bindable<FilterCriteria> currentFilter = new Bindable<FilterCriteria>(new FilterCriteria());
|
||||||
@ -163,14 +163,39 @@ namespace osu.Game.Screens.Multi
|
|||||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||||
{
|
{
|
||||||
var dependencies = new CachedModelDependencyContainer<Room>(base.CreateChildDependencies(parent));
|
var dependencies = new CachedModelDependencyContainer<Room>(base.CreateChildDependencies(parent));
|
||||||
dependencies.Model.BindTo(currentRoom);
|
dependencies.Model.BindTo(selectedRoom);
|
||||||
return dependencies;
|
return dependencies;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updatePollingRate(bool idle)
|
private void updatePollingRate(bool idle)
|
||||||
{
|
{
|
||||||
roomManager.TimeBetweenPolls = !this.IsCurrentScreen() || !(screenStack.CurrentScreen is LoungeSubScreen) ? 0 : (idle ? 120000 : 15000);
|
if (!this.IsCurrentScreen())
|
||||||
Logger.Log($"Polling adjusted to {roomManager.TimeBetweenPolls}");
|
{
|
||||||
|
roomManager.TimeBetweenListingPolls = 0;
|
||||||
|
roomManager.TimeBetweenSelectionPolls = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (screenStack.CurrentScreen)
|
||||||
|
{
|
||||||
|
case LoungeSubScreen _:
|
||||||
|
roomManager.TimeBetweenListingPolls = idle ? 120000 : 15000;
|
||||||
|
roomManager.TimeBetweenSelectionPolls = idle ? 120000 : 15000;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MatchSubScreen _:
|
||||||
|
roomManager.TimeBetweenListingPolls = 0;
|
||||||
|
roomManager.TimeBetweenSelectionPolls = idle ? 30000 : 5000;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
roomManager.TimeBetweenListingPolls = 0;
|
||||||
|
roomManager.TimeBetweenSelectionPolls = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.Log($"Polling adjusted (listing: {roomManager.TimeBetweenListingPolls}, selection: {roomManager.TimeBetweenSelectionPolls})");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -222,6 +247,8 @@ namespace osu.Game.Screens.Multi
|
|||||||
base.OnResuming(last);
|
base.OnResuming(last);
|
||||||
|
|
||||||
beginHandlingTrack();
|
beginHandlingTrack();
|
||||||
|
|
||||||
|
updatePollingRate(isIdle.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnSuspending(IScreen next)
|
public override void OnSuspending(IScreen next)
|
||||||
@ -231,7 +258,7 @@ namespace osu.Game.Screens.Multi
|
|||||||
|
|
||||||
endHandlingTrack();
|
endHandlingTrack();
|
||||||
|
|
||||||
roomManager.TimeBetweenPolls = 0;
|
updatePollingRate(isIdle.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool OnExiting(IScreen next)
|
public override bool OnExiting(IScreen next)
|
||||||
|
@ -31,7 +31,7 @@ namespace osu.Game.Screens.Multi
|
|||||||
protected BindableList<PlaylistItem> Playlist { get; private set; }
|
protected BindableList<PlaylistItem> Playlist { get; private set; }
|
||||||
|
|
||||||
[Resolved(typeof(Room))]
|
[Resolved(typeof(Room))]
|
||||||
protected BindableList<User> Participants { get; private set; }
|
protected BindableList<User> RecentParticipants { get; private set; }
|
||||||
|
|
||||||
[Resolved(typeof(Room))]
|
[Resolved(typeof(Room))]
|
||||||
protected Bindable<int> ParticipantCount { get; private set; }
|
protected Bindable<int> ParticipantCount { get; private set; }
|
||||||
|
@ -2,10 +2,13 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Online;
|
using osu.Game.Online;
|
||||||
@ -17,20 +20,24 @@ using osu.Game.Screens.Multi.Lounge.Components;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.Multi
|
namespace osu.Game.Screens.Multi
|
||||||
{
|
{
|
||||||
public class RoomManager : PollingComponent, IRoomManager
|
public class RoomManager : CompositeDrawable, IRoomManager
|
||||||
{
|
{
|
||||||
public event Action RoomsUpdated;
|
public event Action RoomsUpdated;
|
||||||
|
|
||||||
private readonly BindableList<Room> rooms = new BindableList<Room>();
|
private readonly BindableList<Room> rooms = new BindableList<Room>();
|
||||||
public IBindableList<Room> Rooms => rooms;
|
public IBindableList<Room> Rooms => rooms;
|
||||||
|
|
||||||
private Room joinedRoom;
|
public double TimeBetweenListingPolls
|
||||||
|
{
|
||||||
|
get => listingPollingComponent.TimeBetweenPolls;
|
||||||
|
set => listingPollingComponent.TimeBetweenPolls = value;
|
||||||
|
}
|
||||||
|
|
||||||
[Resolved]
|
public double TimeBetweenSelectionPolls
|
||||||
private Bindable<FilterCriteria> currentFilter { get; set; }
|
{
|
||||||
|
get => selectionPollingComponent.TimeBetweenPolls;
|
||||||
[Resolved]
|
set => selectionPollingComponent.TimeBetweenPolls = value;
|
||||||
private IAPIProvider api { get; set; }
|
}
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private RulesetStore rulesets { get; set; }
|
private RulesetStore rulesets { get; set; }
|
||||||
@ -38,14 +45,26 @@ namespace osu.Game.Screens.Multi
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private BeatmapManager beatmaps { get; set; }
|
private BeatmapManager beatmaps { get; set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[Resolved]
|
||||||
private void load()
|
private IAPIProvider api { get; set; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private Bindable<Room> selectedRoom { get; set; }
|
||||||
|
|
||||||
|
private readonly ListingPollingComponent listingPollingComponent;
|
||||||
|
private readonly SelectionPollingComponent selectionPollingComponent;
|
||||||
|
|
||||||
|
private Room joinedRoom;
|
||||||
|
|
||||||
|
public RoomManager()
|
||||||
{
|
{
|
||||||
currentFilter.BindValueChanged(_ =>
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
if (IsLoaded)
|
listingPollingComponent = new ListingPollingComponent { RoomsReceived = onListingReceived },
|
||||||
PollImmediately();
|
selectionPollingComponent = new SelectionPollingComponent { RoomReceived = onSelectedRoomReceived }
|
||||||
});
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
@ -116,30 +135,28 @@ namespace osu.Game.Screens.Multi
|
|||||||
joinedRoom = null;
|
joinedRoom = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private GetRoomsRequest pollReq;
|
/// <summary>
|
||||||
|
/// Invoked when the listing of all <see cref="Room"/>s is received from the server.
|
||||||
protected override Task Poll()
|
/// </summary>
|
||||||
{
|
/// <param name="listing">The listing.</param>
|
||||||
if (!api.IsLoggedIn)
|
private void onListingReceived(List<Room> listing)
|
||||||
return base.Poll();
|
|
||||||
|
|
||||||
var tcs = new TaskCompletionSource<bool>();
|
|
||||||
|
|
||||||
pollReq?.Cancel();
|
|
||||||
pollReq = new GetRoomsRequest(currentFilter.Value.PrimaryFilter);
|
|
||||||
|
|
||||||
pollReq.Success += result =>
|
|
||||||
{
|
{
|
||||||
// Remove past matches
|
// Remove past matches
|
||||||
foreach (var r in rooms.ToList())
|
foreach (var r in rooms.ToList())
|
||||||
{
|
{
|
||||||
if (result.All(e => e.RoomID.Value != r.RoomID.Value))
|
if (listing.All(e => e.RoomID.Value != r.RoomID.Value))
|
||||||
rooms.Remove(r);
|
rooms.Remove(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < result.Count; i++)
|
for (int i = 0; i < listing.Count; i++)
|
||||||
{
|
{
|
||||||
var r = result[i];
|
if (selectedRoom.Value?.RoomID?.Value == listing[i].RoomID.Value)
|
||||||
|
{
|
||||||
|
// The listing request contains less data than the selection request, so data from the selection request is always preferred while the room is selected.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var r = listing[i];
|
||||||
r.Position.Value = i;
|
r.Position.Value = i;
|
||||||
|
|
||||||
update(r, r);
|
update(r, r);
|
||||||
@ -147,14 +164,23 @@ namespace osu.Game.Screens.Multi
|
|||||||
}
|
}
|
||||||
|
|
||||||
RoomsUpdated?.Invoke();
|
RoomsUpdated?.Invoke();
|
||||||
tcs.SetResult(true);
|
}
|
||||||
};
|
|
||||||
|
|
||||||
pollReq.Failure += _ => tcs.SetResult(false);
|
/// <summary>
|
||||||
|
/// Invoked when a <see cref="Room"/> is received from the server.
|
||||||
api.Queue(pollReq);
|
/// </summary>
|
||||||
|
/// <param name="toUpdate">The received <see cref="Room"/>.</param>
|
||||||
return tcs.Task;
|
private void onSelectedRoomReceived(Room toUpdate)
|
||||||
|
{
|
||||||
|
foreach (var room in rooms)
|
||||||
|
{
|
||||||
|
if (room.RoomID.Value == toUpdate.RoomID.Value)
|
||||||
|
{
|
||||||
|
toUpdate.Position.Value = room.Position.Value;
|
||||||
|
update(room, toUpdate);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -182,5 +208,100 @@ namespace osu.Game.Screens.Multi
|
|||||||
else
|
else
|
||||||
existing.CopyFrom(room);
|
existing.CopyFrom(room);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class SelectionPollingComponent : PollingComponent
|
||||||
|
{
|
||||||
|
public Action<Room> RoomReceived;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private IAPIProvider api { get; set; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private Bindable<Room> selectedRoom { get; set; }
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
selectedRoom.BindValueChanged(_ =>
|
||||||
|
{
|
||||||
|
if (IsLoaded)
|
||||||
|
PollImmediately();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private GetRoomRequest pollReq;
|
||||||
|
|
||||||
|
protected override Task Poll()
|
||||||
|
{
|
||||||
|
if (!api.IsLoggedIn)
|
||||||
|
return base.Poll();
|
||||||
|
|
||||||
|
if (selectedRoom.Value?.RoomID.Value == null)
|
||||||
|
return base.Poll();
|
||||||
|
|
||||||
|
var tcs = new TaskCompletionSource<bool>();
|
||||||
|
|
||||||
|
pollReq?.Cancel();
|
||||||
|
pollReq = new GetRoomRequest(selectedRoom.Value.RoomID.Value.Value);
|
||||||
|
|
||||||
|
pollReq.Success += result =>
|
||||||
|
{
|
||||||
|
RoomReceived?.Invoke(result);
|
||||||
|
tcs.SetResult(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
pollReq.Failure += _ => tcs.SetResult(false);
|
||||||
|
|
||||||
|
api.Queue(pollReq);
|
||||||
|
|
||||||
|
return tcs.Task;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ListingPollingComponent : PollingComponent
|
||||||
|
{
|
||||||
|
public Action<List<Room>> RoomsReceived;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private IAPIProvider api { get; set; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private Bindable<FilterCriteria> currentFilter { get; set; }
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
currentFilter.BindValueChanged(_ =>
|
||||||
|
{
|
||||||
|
if (IsLoaded)
|
||||||
|
PollImmediately();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private GetRoomsRequest pollReq;
|
||||||
|
|
||||||
|
protected override Task Poll()
|
||||||
|
{
|
||||||
|
if (!api.IsLoggedIn)
|
||||||
|
return base.Poll();
|
||||||
|
|
||||||
|
var tcs = new TaskCompletionSource<bool>();
|
||||||
|
|
||||||
|
pollReq?.Cancel();
|
||||||
|
pollReq = new GetRoomsRequest(currentFilter.Value.PrimaryFilter);
|
||||||
|
|
||||||
|
pollReq.Success += result =>
|
||||||
|
{
|
||||||
|
RoomsReceived?.Invoke(result);
|
||||||
|
tcs.SetResult(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
pollReq.Failure += _ => tcs.SetResult(false);
|
||||||
|
|
||||||
|
api.Queue(pollReq);
|
||||||
|
|
||||||
|
return tcs.Task;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,12 +13,5 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
MinValue = 0,
|
MinValue = 0,
|
||||||
MaxValue = 1
|
MaxValue = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
protected HealthDisplay()
|
|
||||||
{
|
|
||||||
Current.ValueChanged += health => SetHealth((float)health.NewValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract void SetHealth(float value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ using osu.Game.Rulesets.Judgements;
|
|||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play.HUD
|
namespace osu.Game.Screens.Play.HUD
|
||||||
@ -108,11 +109,23 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
if (result.Type == HitResult.Miss)
|
if (result.Type == HitResult.Miss)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Scheduler.AddOnce(flash);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void flash()
|
||||||
|
{
|
||||||
fill.FadeEdgeEffectTo(Math.Min(1, fill.EdgeEffect.Colour.Linear.A + (1f - base_glow_opacity) / glow_max_hits), 50, Easing.OutQuint)
|
fill.FadeEdgeEffectTo(Math.Min(1, fill.EdgeEffect.Colour.Linear.A + (1f - base_glow_opacity) / glow_max_hits), 50, Easing.OutQuint)
|
||||||
.Delay(glow_fade_delay)
|
.Delay(glow_fade_delay)
|
||||||
.FadeEdgeEffectTo(base_glow_opacity, glow_fade_time, Easing.OutQuint);
|
.FadeEdgeEffectTo(base_glow_opacity, glow_fade_time, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SetHealth(float value) => fill.ResizeTo(new Vector2(value, 1), 200, Easing.OutQuint);
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
|
||||||
|
fill.Width = Interpolation.ValueAt(
|
||||||
|
Math.Clamp(Clock.ElapsedFrameTime, 0, 200),
|
||||||
|
fill.Width, (float)Current.Value, 0, 200, Easing.OutQuint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -609,8 +609,8 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
var score = CreateScore();
|
var score = CreateScore();
|
||||||
if (DrawableRuleset.ReplayScore == null)
|
if (DrawableRuleset.ReplayScore == null)
|
||||||
scoreManager.Import(score).Wait();
|
scoreManager.Import(score).ContinueWith(_ => Schedule(() => this.Push(CreateResults(score))));
|
||||||
|
else
|
||||||
this.Push(CreateResults(score));
|
this.Push(CreateResults(score));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ using osu.Framework.Bindables;
|
|||||||
|
|
||||||
namespace osu.Game.Users
|
namespace osu.Game.Users
|
||||||
{
|
{
|
||||||
public class User
|
public class User : IEquatable<User>
|
||||||
{
|
{
|
||||||
[JsonProperty(@"id")]
|
[JsonProperty(@"id")]
|
||||||
public long Id = 1;
|
public long Id = 1;
|
||||||
@ -244,5 +244,13 @@ namespace osu.Game.Users
|
|||||||
[Description("Touch Screen")]
|
[Description("Touch Screen")]
|
||||||
Touch,
|
Touch,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool Equals(User other)
|
||||||
|
{
|
||||||
|
if (ReferenceEquals(null, other)) return false;
|
||||||
|
if (ReferenceEquals(this, other)) return true;
|
||||||
|
|
||||||
|
return Id == other.Id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.221.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.221.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2020.225.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.229.0" />
|
||||||
<PackageReference Include="Sentry" Version="2.0.3" />
|
<PackageReference Include="Sentry" Version="2.0.3" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
|
@ -49,9 +49,6 @@
|
|||||||
<DeviceSpecificBuild>true</DeviceSpecificBuild>
|
<DeviceSpecificBuild>true</DeviceSpecificBuild>
|
||||||
<IOSDebuggerPort>28126</IOSDebuggerPort>
|
<IOSDebuggerPort>28126</IOSDebuggerPort>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
|
||||||
<MtouchUseLlvm>true</MtouchUseLlvm>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<NativeReference Include="$(OutputPath)\libbass.a;$(OutputPath)\libbass_fx.a">
|
<NativeReference Include="$(OutputPath)\libbass.a;$(OutputPath)\libbass_fx.a">
|
||||||
<Kind>Static</Kind>
|
<Kind>Static</Kind>
|
||||||
@ -74,7 +71,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.221.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.221.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.225.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.229.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
||||||
<ItemGroup Label="Transitive Dependencies">
|
<ItemGroup Label="Transitive Dependencies">
|
||||||
@ -82,7 +79,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2020.225.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.229.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
<ProjectGuid>{3F082D0B-A964-43D7-BDF7-C256D76A50D0}</ProjectGuid>
|
<ProjectGuid>{3F082D0B-A964-43D7-BDF7-C256D76A50D0}</ProjectGuid>
|
||||||
<RootNamespace>osu.iOS</RootNamespace>
|
<RootNamespace>osu.iOS</RootNamespace>
|
||||||
<AssemblyName>osu.iOS</AssemblyName>
|
<AssemblyName>osu.iOS</AssemblyName>
|
||||||
|
<MtouchUseLlvm>false</MtouchUseLlvm> <!-- This currently causes random lockups during gameplay. https://github.com/mono/mono/issues/18973 -->
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="..\osu.iOS.props" />
|
<Import Project="..\osu.iOS.props" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
Loading…
Reference in New Issue
Block a user