mirror of
https://github.com/SK-la/Ez2Lazer.git
synced 2026-03-13 11:20:28 +00:00
同步更新
This commit is contained in:
@@ -15,10 +15,6 @@
|
||||
<PropertyGroup>
|
||||
<StartupObject>osu.Desktop.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PublishDir>F:\MUG OSU\Ez2Lazer_Publish\$(Configuration)</PublishDir>
|
||||
<OutputPath>bin\$(Configuration)\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="Project References">
|
||||
<ProjectReference Include="..\osu.Game.Tournament\osu.Game.Tournament.csproj" />
|
||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||
|
||||
@@ -174,6 +174,16 @@ namespace osu.Game.Localisation
|
||||
/// </summary>
|
||||
public static LocalisableString SelectedMods => new TranslatableString(getKey(@"selected_mods"), @"Selected Mods");
|
||||
|
||||
/// <summary>
|
||||
/// "hold for menu"
|
||||
/// </summary>
|
||||
public static LocalisableString HoldForMenu => new TranslatableString(getKey(@"hold_for_menu"), @"hold for menu");
|
||||
|
||||
/// <summary>
|
||||
/// "press for menu"
|
||||
/// </summary>
|
||||
public static LocalisableString PressForMenu => new TranslatableString(getKey(@"press_for_menu"), @"press for menu");
|
||||
|
||||
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,5 +53,10 @@ namespace osu.Game.Online.Metadata
|
||||
/// Signals to the server that the current user would like to stop receiving updates about the state of the multiplayer room with the given <paramref name="id"/>.
|
||||
/// </summary>
|
||||
Task EndWatchingMultiplayerRoom(long id);
|
||||
|
||||
/// <summary>
|
||||
/// Refresh this user's friend listing.
|
||||
/// </summary>
|
||||
Task RefreshFriends();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Users;
|
||||
|
||||
@@ -21,6 +22,16 @@ namespace osu.Game.Online.Metadata
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; } = null!;
|
||||
|
||||
private readonly IBindableList<APIRelation> localFriends = new BindableList<APIRelation>();
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
localFriends.BindTo(api.LocalUserState.Friends);
|
||||
localFriends.BindCollectionChanged((_, _) => RefreshFriends().FireAndForget());
|
||||
}
|
||||
|
||||
#region Beatmap metadata updates
|
||||
|
||||
public abstract Task<BeatmapUpdates> GetChangesSince(int queueId);
|
||||
@@ -152,6 +163,8 @@ namespace osu.Game.Online.Metadata
|
||||
|
||||
public abstract Task EndWatchingMultiplayerRoom(long id);
|
||||
|
||||
public abstract Task RefreshFriends();
|
||||
|
||||
public event Action<MultiplayerRoomScoreSetEvent>? MultiplayerRoomScoreSet;
|
||||
|
||||
Task IMetadataClient.MultiplayerRoomScoreSet(MultiplayerRoomScoreSetEvent roomScoreSetEvent)
|
||||
|
||||
@@ -288,6 +288,15 @@ namespace osu.Game.Online.Metadata
|
||||
Logger.Log($@"{nameof(OnlineMetadataClient)} stopped watching multiplayer room with ID {id}", LoggingTarget.Network);
|
||||
}
|
||||
|
||||
public override async Task RefreshFriends()
|
||||
{
|
||||
if (connector?.IsConnected.Value != true)
|
||||
throw new OperationCanceledException();
|
||||
|
||||
Debug.Assert(connection != null);
|
||||
await connection.InvokeAsync(nameof(IMetadataServer.RefreshFriends)).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public override async Task DisconnectRequested()
|
||||
{
|
||||
await base.DisconnectRequested().ConfigureAwait(false);
|
||||
|
||||
@@ -6,7 +6,6 @@ using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.LAsEzExtensions.Audio;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
@@ -17,7 +17,6 @@ using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Input.StateChanges;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Graphics.Backgrounds;
|
||||
@@ -393,27 +392,12 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
protected override void OnMouseUp(MouseUpEvent e)
|
||||
{
|
||||
// HORRIBLE HACK
|
||||
// This is here so that on mobile, the logo can correctly progress from main menu to song select v2 when held.
|
||||
// Once the temporary solution of holding the logo to access song select v2 is removed, this should be too.
|
||||
// Without this, the long-press-to-right-click flow intercepts the hold and converts it to a right click which would not trigger the logo
|
||||
// and therefore not progress to song select.
|
||||
if (e.Button == MouseButton.Right && e.CurrentState.Mouse.LastSource is ISourcedFromTouch)
|
||||
triggerClick();
|
||||
// END OF HORRIBLE HACK
|
||||
|
||||
if (e.Button != MouseButton.Left) return;
|
||||
|
||||
logoBounceContainer.ScaleTo(1f, 500, Easing.OutElastic);
|
||||
}
|
||||
|
||||
protected override bool OnClick(ClickEvent e)
|
||||
{
|
||||
triggerClick();
|
||||
return true;
|
||||
}
|
||||
|
||||
private void triggerClick()
|
||||
{
|
||||
flashLayer.ClearTransforms();
|
||||
flashLayer.Alpha = 0.4f;
|
||||
@@ -425,6 +409,8 @@ namespace osu.Game.Screens.Menu
|
||||
sampleClickChannel = sampleClick.GetChannel();
|
||||
sampleClickChannel.Play();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
|
||||
@@ -18,7 +18,6 @@ using osu.Game.Overlays.Mods;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Screens.Footer;
|
||||
using osu.Game.Screens.Menu;
|
||||
using osu.Game.Screens.SelectV2;
|
||||
using osu.Game.Utils;
|
||||
|
||||
@@ -48,6 +47,8 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
||||
{
|
||||
this.room = room;
|
||||
|
||||
ShowOsuLogo = false;
|
||||
|
||||
Padding = new MarginPadding { Horizontal = HORIZONTAL_OVERFLOW_PADDING };
|
||||
LeftPadding = new MarginPadding { Top = CORNER_RADIUS_HIDE_OFFSET + Header.HEIGHT };
|
||||
|
||||
@@ -202,21 +203,6 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override void LogoArriving(OsuLogo logo, bool resuming)
|
||||
{
|
||||
// Intentionally not calling base so the logo isn't shown.
|
||||
}
|
||||
|
||||
protected override void LogoExiting(OsuLogo logo)
|
||||
{
|
||||
// Intentionally not calling base so the logo isn't shown.
|
||||
}
|
||||
|
||||
protected override void LogoSuspending(OsuLogo logo)
|
||||
{
|
||||
// Intentionally not calling base so the logo isn't shown.
|
||||
}
|
||||
|
||||
public override IReadOnlyList<ScreenFooterButton> CreateFooterButtons()
|
||||
{
|
||||
var buttons = base.CreateFooterButtons().ToList();
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace osu.Game.Screens.SelectV2
|
||||
AddRange(new[]
|
||||
{
|
||||
unrankedBadge = new UnrankedBadge(),
|
||||
modDisplayBar = new Container
|
||||
modDisplayBar = new ModDisplayBarContainer
|
||||
{
|
||||
Y = -5f,
|
||||
Depth = float.MaxValue,
|
||||
@@ -343,6 +343,13 @@ namespace osu.Game.Screens.SelectV2
|
||||
}
|
||||
}
|
||||
|
||||
internal partial class ModDisplayBarContainer : Container
|
||||
{
|
||||
protected override bool OnMouseDown(MouseDownEvent e) => true;
|
||||
|
||||
protected override bool OnHover(HoverEvent e) => true;
|
||||
}
|
||||
|
||||
internal partial class UnrankedBadge : CompositeDrawable, IHasTooltip
|
||||
{
|
||||
public LocalisableString TooltipText { get; }
|
||||
@@ -386,6 +393,10 @@ namespace osu.Game.Screens.SelectV2
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected override bool OnMouseDown(MouseDownEvent e) => true;
|
||||
|
||||
protected override bool OnHover(HoverEvent e) => true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Bindables;
|
||||
|
||||
@@ -95,6 +95,11 @@ namespace osu.Game.Screens.SelectV2
|
||||
/// </summary>
|
||||
protected bool ControlGlobalMusic { get; init; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the osu! logo should be shown at the bottom-right of the screen.
|
||||
/// </summary>
|
||||
protected bool ShowOsuLogo { get; init; } = true;
|
||||
|
||||
protected MarginPadding LeftPadding { get; init; }
|
||||
|
||||
private ModSelectOverlay modSelectOverlay = null!;
|
||||
@@ -404,7 +409,8 @@ namespace osu.Game.Screens.SelectV2
|
||||
if (!this.IsCurrentScreen())
|
||||
return;
|
||||
|
||||
logo?.FadeTo(v.NewValue == Visibility.Visible ? 0f : 1f, 200, Easing.OutQuint);
|
||||
if (ShowOsuLogo)
|
||||
logo?.FadeTo(v.NewValue == Visibility.Visible ? 0f : 1f, 200, Easing.OutQuint);
|
||||
});
|
||||
|
||||
// 当 mod 变化时,只有在存在 Loop 类型的 mod 时才开启 DuplicateVirtualTrack 行为,避免状态混乱。
|
||||
@@ -850,6 +856,9 @@ namespace osu.Game.Screens.SelectV2
|
||||
{
|
||||
base.LogoArriving(logo, resuming);
|
||||
|
||||
if (!ShowOsuLogo)
|
||||
return;
|
||||
|
||||
if (logo.Alpha > 0.8f && resuming)
|
||||
Footer?.StartTrackingLogo(logo, 400, Easing.OutQuint);
|
||||
else
|
||||
@@ -873,6 +882,10 @@ namespace osu.Game.Screens.SelectV2
|
||||
protected override void LogoSuspending(OsuLogo logo)
|
||||
{
|
||||
base.LogoSuspending(logo);
|
||||
|
||||
if (!ShowOsuLogo)
|
||||
return;
|
||||
|
||||
Footer?.StopTrackingLogo();
|
||||
}
|
||||
|
||||
@@ -880,6 +893,9 @@ namespace osu.Game.Screens.SelectV2
|
||||
{
|
||||
base.LogoExiting(logo);
|
||||
|
||||
if (!ShowOsuLogo)
|
||||
return;
|
||||
|
||||
Footer?.StopTrackingLogo();
|
||||
|
||||
logo.ScaleTo(0.2f, 120, Easing.Out);
|
||||
|
||||
@@ -128,6 +128,8 @@ namespace osu.Game.Tests.Visual.Metadata
|
||||
|
||||
public override Task EndWatchingMultiplayerRoom(long id) => Task.CompletedTask;
|
||||
|
||||
public override Task RefreshFriends() => Task.CompletedTask;
|
||||
|
||||
public void Disconnect()
|
||||
{
|
||||
isConnected.Value = false;
|
||||
|
||||
Reference in New Issue
Block a user