mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:07:52 +08:00
Merge branch 'master' into realm-integration/score-and-beatmaps
This commit is contained in:
commit
5601f6f1fe
@ -51,7 +51,7 @@
|
||||
<Reference Include="Java.Interop" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.114.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.115.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.111.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Transitive Dependencies">
|
||||
|
@ -10,14 +10,11 @@ using System.Runtime.Versioning;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Win32;
|
||||
using osu.Desktop.Security;
|
||||
using osu.Desktop.Overlays;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game;
|
||||
using osu.Desktop.Updater;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Screens.Menu;
|
||||
using osu.Game.Updater;
|
||||
using osu.Desktop.Windows;
|
||||
using osu.Framework.Threading;
|
||||
@ -27,13 +24,9 @@ namespace osu.Desktop
|
||||
{
|
||||
internal class OsuGameDesktop : OsuGame
|
||||
{
|
||||
private readonly bool noVersionOverlay;
|
||||
private VersionManager versionManager;
|
||||
|
||||
public OsuGameDesktop(string[] args = null)
|
||||
: base(args)
|
||||
{
|
||||
noVersionOverlay = args?.Any(a => a == "--no-version-overlay") ?? false;
|
||||
}
|
||||
|
||||
public override StableStorage GetStorageForStableInstall()
|
||||
@ -114,9 +107,6 @@ namespace osu.Desktop
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
if (!noVersionOverlay)
|
||||
LoadComponentAsync(versionManager = new VersionManager { Depth = int.MinValue }, ScreenContainer.Add);
|
||||
|
||||
LoadComponentAsync(new DiscordRichPresence(), Add);
|
||||
|
||||
if (RuntimeInfo.OS == RuntimeInfo.Platform.Windows)
|
||||
@ -125,23 +115,6 @@ namespace osu.Desktop
|
||||
LoadComponentAsync(new ElevatedPrivilegesChecker(), Add);
|
||||
}
|
||||
|
||||
protected override void ScreenChanged(IScreen lastScreen, IScreen newScreen)
|
||||
{
|
||||
base.ScreenChanged(lastScreen, newScreen);
|
||||
|
||||
switch (newScreen)
|
||||
{
|
||||
case IntroScreen _:
|
||||
case MainMenu _:
|
||||
versionManager?.Show();
|
||||
break;
|
||||
|
||||
default:
|
||||
versionManager?.Hide();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetHost(GameHost host)
|
||||
{
|
||||
base.SetHost(host);
|
||||
|
@ -4,11 +4,14 @@ Version: 2.5
|
||||
[Mania]
|
||||
Keys: 4
|
||||
ColumnLineWidth: 3,1,3,1,1
|
||||
Hit0: mania/hit0
|
||||
Hit50: mania/hit50
|
||||
Hit100: mania/hit100
|
||||
Hit200: mania/hit200
|
||||
Hit300: mania/hit300
|
||||
Hit300g: mania/hit300g
|
||||
// some skins found in the wild had configuration keys where the @2x suffix was included in the values.
|
||||
// the expected compatibility behaviour is that the presence of the @2x suffix shouldn't change anything
|
||||
// if @2x assets are present.
|
||||
Hit0: mania/hit0@2x
|
||||
Hit50: mania/hit50@2x
|
||||
Hit100: mania/hit100@2x
|
||||
Hit200: mania/hit200@2x
|
||||
Hit300: mania/hit300@2x
|
||||
Hit300g: mania/hit300g@2x
|
||||
StageLeft: mania/stage-left
|
||||
StageRight: mania/stage-right
|
@ -5,8 +5,10 @@ using System;
|
||||
using System.Linq;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Mania.Scoring;
|
||||
using osu.Game.Rulesets.Mania.Skinning.Legacy;
|
||||
using osu.Game.Rulesets.Mania.UI;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
@ -23,15 +25,24 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
||||
{
|
||||
if (hitWindows.IsHitResultAllowed(result))
|
||||
{
|
||||
AddStep("Show " + result.GetDescription(), () => SetContents(_ =>
|
||||
new DrawableManiaJudgement(new JudgementResult(new HitObject { StartTime = Time.Current }, new Judgement())
|
||||
{
|
||||
Type = result
|
||||
}, null)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
}));
|
||||
AddStep("Show " + result.GetDescription(), () =>
|
||||
{
|
||||
SetContents(_ =>
|
||||
new DrawableManiaJudgement(new JudgementResult(new HitObject { StartTime = Time.Current }, new Judgement())
|
||||
{
|
||||
Type = result
|
||||
}, null)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
});
|
||||
|
||||
// for test purposes, undo the Y adjustment related to the `ScorePosition` legacy positioning config value
|
||||
// (see `LegacyManiaJudgementPiece.load()`).
|
||||
// this prevents the judgements showing somewhere below or above the bounding box of the judgement.
|
||||
foreach (var legacyPiece in this.ChildrenOfType<LegacyManiaJudgementPiece>())
|
||||
legacyPiece.Y = 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -154,6 +154,8 @@ namespace osu.Game
|
||||
|
||||
private MainMenu menuScreen;
|
||||
|
||||
private VersionManager versionManager;
|
||||
|
||||
[CanBeNull]
|
||||
private IntroScreen introScreen;
|
||||
|
||||
@ -746,6 +748,9 @@ namespace osu.Game
|
||||
ScreenStack.ScreenPushed += screenPushed;
|
||||
ScreenStack.ScreenExited += screenExited;
|
||||
|
||||
if (!args?.Any(a => a == @"--no-version-overlay") ?? true)
|
||||
loadComponentSingleFile(versionManager = new VersionManager { Depth = int.MinValue }, ScreenContainer.Add);
|
||||
|
||||
loadComponentSingleFile(osuLogo, logo =>
|
||||
{
|
||||
logoContainer.Add(logo);
|
||||
@ -1129,10 +1134,16 @@ namespace osu.Game
|
||||
{
|
||||
case IntroScreen intro:
|
||||
introScreen = intro;
|
||||
versionManager?.Show();
|
||||
break;
|
||||
|
||||
case MainMenu menu:
|
||||
menuScreen = menu;
|
||||
versionManager?.Show();
|
||||
break;
|
||||
|
||||
default:
|
||||
versionManager?.Hide();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -7,13 +7,12 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Game;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Desktop.Overlays
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class VersionManager : VisibilityContainer
|
||||
{
|
@ -21,6 +21,7 @@ using osu.Game.Overlays.Mods;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Screens.OnlinePlay.Match.Components;
|
||||
using osu.Game.Screens.OnlinePlay.Multiplayer;
|
||||
|
||||
namespace osu.Game.Screens.OnlinePlay.Match
|
||||
{
|
||||
@ -101,6 +102,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
beatmapAvailabilityTracker,
|
||||
new MultiplayerRoomSounds(),
|
||||
new GridContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
|
@ -0,0 +1,65 @@
|
||||
// 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.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
|
||||
namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
{
|
||||
public class MultiplayerRoomSounds : MultiplayerRoomComposite
|
||||
{
|
||||
private Sample hostChangedSample;
|
||||
private Sample userJoinedSample;
|
||||
private Sample userLeftSample;
|
||||
private Sample userKickedSample;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio)
|
||||
{
|
||||
hostChangedSample = audio.Samples.Get(@"Multiplayer/host-changed");
|
||||
userJoinedSample = audio.Samples.Get(@"Multiplayer/player-joined");
|
||||
userLeftSample = audio.Samples.Get(@"Multiplayer/player-left");
|
||||
userKickedSample = audio.Samples.Get(@"Multiplayer/player-kicked");
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
Host.BindValueChanged(hostChanged);
|
||||
}
|
||||
|
||||
protected override void UserJoined(MultiplayerRoomUser user)
|
||||
{
|
||||
base.UserJoined(user);
|
||||
|
||||
userJoinedSample?.Play();
|
||||
}
|
||||
|
||||
protected override void UserLeft(MultiplayerRoomUser user)
|
||||
{
|
||||
base.UserLeft(user);
|
||||
|
||||
userLeftSample?.Play();
|
||||
}
|
||||
|
||||
protected override void UserKicked(MultiplayerRoomUser user)
|
||||
{
|
||||
base.UserKicked(user);
|
||||
|
||||
userKickedSample?.Play();
|
||||
}
|
||||
|
||||
private void hostChanged(ValueChangedEvent<APIUser> value)
|
||||
{
|
||||
// only play sound when the host changes from an already-existing host.
|
||||
if (value.OldValue == null) return;
|
||||
|
||||
hostChangedSample?.Play();
|
||||
}
|
||||
}
|
||||
}
|
@ -4,12 +4,10 @@
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Cursor;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
||||
@ -18,10 +16,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
||||
{
|
||||
private FillFlowContainer<ParticipantPanel> panels;
|
||||
|
||||
private Sample userJoinSample;
|
||||
private Sample userLeftSample;
|
||||
private Sample userKickedSample;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio)
|
||||
{
|
||||
@ -41,31 +35,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
userJoinSample = audio.Samples.Get(@"Multiplayer/player-joined");
|
||||
userLeftSample = audio.Samples.Get(@"Multiplayer/player-left");
|
||||
userKickedSample = audio.Samples.Get(@"Multiplayer/player-kicked");
|
||||
}
|
||||
|
||||
protected override void UserJoined(MultiplayerRoomUser user)
|
||||
{
|
||||
base.UserJoined(user);
|
||||
|
||||
userJoinSample?.Play();
|
||||
}
|
||||
|
||||
protected override void UserLeft(MultiplayerRoomUser user)
|
||||
{
|
||||
base.UserLeft(user);
|
||||
|
||||
userLeftSample?.Play();
|
||||
}
|
||||
|
||||
protected override void UserKicked(MultiplayerRoomUser user)
|
||||
{
|
||||
base.UserKicked(user);
|
||||
|
||||
userKickedSample?.Play();
|
||||
}
|
||||
|
||||
protected override void OnRoomUpdated()
|
||||
|
@ -474,13 +474,18 @@ namespace osu.Game.Skinning
|
||||
{
|
||||
foreach (string name in getFallbackNames(componentName))
|
||||
{
|
||||
// some component names (especially user-controlled ones, like `HitX` in mania)
|
||||
// may contain `@2x` scale specifications.
|
||||
// stable happens to check for that and strip them, so do the same to match stable behaviour.
|
||||
string lookupName = name.Replace(@"@2x", string.Empty);
|
||||
|
||||
float ratio = 2;
|
||||
var texture = Textures?.Get($"{name}@2x", wrapModeS, wrapModeT);
|
||||
var texture = Textures?.Get(@$"{lookupName}@2x", wrapModeS, wrapModeT);
|
||||
|
||||
if (texture == null)
|
||||
{
|
||||
ratio = 1;
|
||||
texture = Textures?.Get(name, wrapModeS, wrapModeT);
|
||||
texture = Textures?.Get(lookupName, wrapModeS, wrapModeT);
|
||||
}
|
||||
|
||||
if (texture == null)
|
||||
|
@ -37,7 +37,7 @@
|
||||
</PackageReference>
|
||||
<PackageReference Include="Realm" Version="10.7.1" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2022.111.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.114.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.115.0" />
|
||||
<PackageReference Include="Sentry" Version="3.12.1" />
|
||||
<PackageReference Include="SharpCompress" Version="0.30.1" />
|
||||
<PackageReference Include="NUnit" Version="3.13.2" />
|
||||
|
@ -61,7 +61,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.111.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.114.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.115.0" />
|
||||
</ItemGroup>
|
||||
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net5.0 / net6.0) -->
|
||||
<PropertyGroup>
|
||||
|
Loading…
Reference in New Issue
Block a user