1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 09:42:54 +08:00

Merge branch 'master' into editor-cyclic-selection

This commit is contained in:
Bartłomiej Dach 2023-07-20 20:19:46 +02:00 committed by GitHub
commit 708dd355cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 59 additions and 30 deletions

1
.gitignore vendored
View File

@ -339,6 +339,5 @@ inspectcode
# Fody (pulled in by Realm) - schema file
FodyWeavers.xsd
**/FodyWeavers.xml
.idea/.idea.osu.Desktop/.idea/misc.xml

View File

@ -10,7 +10,7 @@
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Framework.Android" Version="2023.716.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2023.720.0" />
</ItemGroup>
<PropertyGroup>
<!-- Fody does not handle Android build well, and warns when unchanged.

View File

@ -32,7 +32,7 @@ namespace osu.Game.Tests.Visual.Gameplay
private HUDOverlay hudOverlay = null!;
[Cached(typeof(ScoreProcessor))]
private ScoreProcessor scoreProcessor => gameplayState.ScoreProcessor;
private ScoreProcessor scoreProcessor { get; set; }
[Cached(typeof(HealthProcessor))]
private HealthProcessor healthProcessor = new DrainingHealthProcessor(0);
@ -47,6 +47,11 @@ namespace osu.Game.Tests.Visual.Gameplay
private Drawable hideTarget => hudOverlay.ChildrenOfType<SkinComponentsContainer>().First();
private Drawable keyCounterFlow => hudOverlay.ChildrenOfType<KeyCounterDisplay>().First().ChildrenOfType<FillFlowContainer<KeyCounter>>().Single();
public TestSceneHUDOverlay()
{
scoreProcessor = gameplayState.ScoreProcessor;
}
[BackgroundDependencyLoader]
private void load()
{

View File

@ -23,7 +23,7 @@ namespace osu.Game.Tests.Visual.Gameplay
public partial class TestSceneSkinEditorMultipleSkins : SkinnableTestScene
{
[Cached(typeof(ScoreProcessor))]
private ScoreProcessor scoreProcessor => gameplayState.ScoreProcessor;
private ScoreProcessor scoreProcessor { get; set; }
[Cached(typeof(HealthProcessor))]
private HealthProcessor healthProcessor = new DrainingHealthProcessor(0);
@ -37,6 +37,11 @@ namespace osu.Game.Tests.Visual.Gameplay
[Cached]
public readonly EditorClipboard Clipboard = new EditorClipboard();
public TestSceneSkinEditorMultipleSkins()
{
scoreProcessor = gameplayState.ScoreProcessor;
}
[SetUpSteps]
public void SetUpSteps()
{

View File

@ -30,7 +30,7 @@ namespace osu.Game.Tests.Visual.Gameplay
private HUDOverlay hudOverlay;
[Cached(typeof(ScoreProcessor))]
private ScoreProcessor scoreProcessor => gameplayState.ScoreProcessor;
private ScoreProcessor scoreProcessor { get; set; }
[Cached(typeof(HealthProcessor))]
private HealthProcessor healthProcessor = new DrainingHealthProcessor(0);
@ -47,6 +47,11 @@ namespace osu.Game.Tests.Visual.Gameplay
private Drawable hideTarget => hudOverlay.ChildrenOfType<SkinComponentsContainer>().First();
private Drawable keyCounterFlow => hudOverlay.ChildrenOfType<KeyCounterDisplay>().First().ChildrenOfType<FillFlowContainer<KeyCounter>>().Single();
public TestSceneSkinnableHUDOverlay()
{
scoreProcessor = gameplayState.ScoreProcessor;
}
[Test]
public void TestComboCounterIncrementing()
{

3
osu.Game/FodyWeavers.xml Normal file
View File

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<Realm DisableAnalytics="true" />
</Weavers>

View File

@ -379,6 +379,10 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// </summary>
private bool selectedBlueprintAlreadySelectedOnMouseDown;
/// <summary>
/// Sorts the supplied <paramref name="blueprints"/> by the order of preference when making a selection.
/// Blueprints at the start of the list will be prioritised over later items if the selection requested is ambiguous due to spatial overlap.
/// </summary>
protected virtual IEnumerable<SelectionBlueprint<T>> ApplySelectionOrder(IEnumerable<SelectionBlueprint<T>> blueprints) => blueprints.Reverse();
/// <summary>

View File

@ -23,6 +23,7 @@ using osu.Framework.Screens;
using osu.Game.Audio;
using osu.Game.Beatmaps;
using osu.Game.Input.Bindings;
using osu.Game.Online.API;
using osu.Game.Online.Rooms;
using osu.Game.Overlays;
using osu.Game.Overlays.Mods;
@ -76,6 +77,9 @@ namespace osu.Game.Screens.OnlinePlay.Match
[Resolved]
private RulesetStore rulesets { get; set; }
[Resolved]
private IAPIProvider api { get; set; } = null!;
[Resolved(canBeNull: true)]
protected OnlinePlayScreen ParentScreen { get; private set; }
@ -284,6 +288,8 @@ namespace osu.Game.Screens.OnlinePlay.Match
[Resolved(canBeNull: true)]
private IDialogOverlay dialogOverlay { get; set; }
protected virtual bool IsConnected => api.State.Value == APIState.Online;
public override bool OnBackButton()
{
if (Room.RoomID.Value == null)
@ -356,7 +362,12 @@ namespace osu.Game.Screens.OnlinePlay.Match
if (ExitConfirmed)
return true;
if (dialogOverlay == null || Room.RoomID.Value != null || Room.Playlist.Count == 0)
if (!IsConnected)
return true;
bool hasUnsavedChanges = Room.RoomID.Value == null && Room.Playlist.Count > 0;
if (dialogOverlay == null || !hasUnsavedChanges)
return true;
// if the dialog is already displayed, block exiting until the user explicitly makes a decision.

View File

@ -41,7 +41,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
// To work around this, temporarily remove the room and trigger an immediate listing poll.
if (e.Last is MultiplayerMatchSubScreen match)
{
RoomManager.RemoveRoom(match.Room);
RoomManager?.RemoveRoom(match.Room);
ListingPollingComponent.PollImmediately();
}
}

View File

@ -17,7 +17,6 @@ using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Graphics.Cursor;
using osu.Game.Online;
using osu.Game.Online.API;
using osu.Game.Online.Multiplayer;
using osu.Game.Online.Rooms;
using osu.Game.Overlays;
@ -50,9 +49,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
[Resolved]
private MultiplayerClient client { get; set; }
[Resolved]
private IAPIProvider api { get; set; }
[Resolved(canBeNull: true)]
private OsuGame game { get; set; }
@ -79,6 +75,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
handleRoomLost();
}
protected override bool IsConnected => base.IsConnected && client.IsConnected.Value;
protected override Drawable CreateMainContent() => new Container
{
RelativeSizeAxes = Axes.Both,
@ -254,13 +252,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
public override bool OnExiting(ScreenExitEvent e)
{
// the room may not be left immediately after a disconnection due to async flow,
// so checking the MultiplayerClient / IAPIAccess statuses is also required.
if (client.Room == null || !client.IsConnected.Value || api.State.Value != APIState.Online)
{
// room has not been created yet or we're offline; exit immediately.
// room has not been created yet or we're offline; exit immediately.
if (client.Room == null || !IsConnected)
return base.OnExiting(e);
}
if (!exitConfirmed && dialogOverlay != null)
{

View File

@ -1,8 +1,6 @@
// 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.
#nullable disable
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Screens;
@ -15,8 +13,8 @@ namespace osu.Game.Screens.OnlinePlay
public virtual string ShortTitle => Title;
[Resolved(CanBeNull = true)]
protected IRoomManager RoomManager { get; private set; }
[Resolved]
protected IRoomManager? RoomManager { get; private set; }
protected OnlinePlaySubScreen()
{

View File

@ -162,17 +162,20 @@ namespace osu.Game.Screens.Play.PlayerSettings
realmWriteTask = realm.WriteAsync(r =>
{
var settings = r.Find<BeatmapInfo>(beatmap.Value.BeatmapInfo.ID)?.UserSettings;
var setInfo = r.Find<BeatmapSetInfo>(beatmap.Value.BeatmapSetInfo.ID);
if (settings == null) // only the case for tests.
if (setInfo == null) // only the case for tests.
return;
double val = Current.Value;
// Apply to all difficulties in a beatmap set for now (they generally always share timing).
foreach (var b in setInfo.Beatmaps)
{
BeatmapUserSettings settings = b.UserSettings;
double val = Current.Value;
if (settings.Offset == val)
return;
settings.Offset = val;
if (settings.Offset != val)
settings.Offset = val;
}
});
}
}

View File

@ -36,7 +36,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Realm" Version="11.1.2" />
<PackageReference Include="ppy.osu.Framework" Version="2023.716.0" />
<PackageReference Include="ppy.osu.Framework" Version="2023.720.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2023.707.0" />
<PackageReference Include="Sentry" Version="3.28.1" />
<PackageReference Include="SharpCompress" Version="0.32.2" />

View File

@ -16,6 +16,6 @@
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Framework.iOS" Version="2023.716.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2023.720.0" />
</ItemGroup>
</Project>

View File

@ -140,6 +140,8 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ParameterHidesMember/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ParameterOnlyUsedForPreconditionCheck_002EGlobal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ParameterOnlyUsedForPreconditionCheck_002ELocal/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PartialMethodWithSinglePart/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PartialTypeWithSinglePart/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PatternAlwaysOfType/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PossibleInterfaceMemberAmbiguity/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PossibleMultipleEnumeration/@EntryIndexedValue">HINT</s:String>