mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:33:01 +08:00
Merge branch 'master' into legacy-score-v2
This commit is contained in:
commit
0dd4ad8c5d
26
app.manifest
26
app.manifest
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||
<assemblyIdentity version="1.0.0.0" name="osu!" />
|
||||
<SquirrelAwareVersion xmlns="urn:schema-squirrel-com:asm.v1">1</SquirrelAwareVersion>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
@ -14,33 +15,10 @@
|
||||
</trustInfo>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- Windows Vista -->
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
|
||||
<!-- Windows 7 -->
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
|
||||
<!-- Windows 8 -->
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
|
||||
<!-- Windows 8.1 -->
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
|
||||
<!-- Windows 10 -->
|
||||
<!-- Windows 10 and Windows 11 -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
|
||||
</application>
|
||||
</compatibility>
|
||||
<asmv3:application>
|
||||
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
||||
<dpiAware>true</dpiAware>
|
||||
</asmv3:windowsSettings>
|
||||
</asmv3:application>
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="*"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
</asmv1:assembly>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<AndroidManifestMerger>manifestmerger.jar</AndroidManifestMerger>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2023.707.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2023.710.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidManifestOverlay Include="$(MSBuildThisFileDirectory)osu.Android\Properties\AndroidManifestOverlay.xml" />
|
||||
|
@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||
<assemblyIdentity version="1.0.0.0" name="osu!" />
|
||||
<SquirrelAwareVersion xmlns="urn:schema-squirrel-com:asm.v1">1</SquirrelAwareVersion>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
<applicationRequestMinimum>
|
||||
<defaultAssemblyRequest permissionSetReference="Custom" />
|
||||
<PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" />
|
||||
</applicationRequestMinimum>
|
||||
</security>
|
||||
</trustInfo>
|
||||
<asmv3:application>
|
||||
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
||||
<dpiAware>true</dpiAware>
|
||||
</asmv3:windowsSettings>
|
||||
</asmv3:application>
|
||||
</asmv1:assembly>
|
@ -8,7 +8,6 @@
|
||||
<Title>osu!</Title>
|
||||
<Product>osu!(lazer)</Product>
|
||||
<ApplicationIcon>lazer.ico</ApplicationIcon>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<Version>0.0.0</Version>
|
||||
<FileVersion>0.0.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
@ -17,7 +17,7 @@ using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Overlays.Settings;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Osu.Scoring;
|
||||
using osu.Game.Rulesets.Osu.Beatmaps;
|
||||
using osu.Game.Rulesets.Osu.Judgements;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
@ -125,8 +125,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
graphs.Clear();
|
||||
legend.Clear();
|
||||
|
||||
runForProcessor("lazer-standardised", Color4.YellowGreen, new ScoreProcessor(new OsuRuleset()), ScoringMode.Standardised);
|
||||
runForProcessor("lazer-classic", Color4.MediumPurple, new ScoreProcessor(new OsuRuleset()), ScoringMode.Classic);
|
||||
runForProcessor("lazer-standardised", Color4.YellowGreen, new OsuScoreProcessor(), ScoringMode.Standardised);
|
||||
runForProcessor("lazer-classic", Color4.MediumPurple, new OsuScoreProcessor(), ScoringMode.Classic);
|
||||
|
||||
runScoreV1();
|
||||
runScoreV2();
|
||||
|
@ -3,11 +3,13 @@
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
@ -18,7 +20,7 @@ using osu.Game.Overlays.Chat;
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
[TestFixture]
|
||||
public partial class TestSceneChatTextBox : OsuTestScene
|
||||
public partial class TestSceneChatTextBox : OsuManualInputManagerTestScene
|
||||
{
|
||||
[Cached]
|
||||
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Pink);
|
||||
@ -30,6 +32,8 @@ namespace osu.Game.Tests.Visual.Online
|
||||
private OsuSpriteText searchText;
|
||||
private ChatTextBar bar;
|
||||
|
||||
private ChatTextBox textBox => bar.ChildrenOfType<ChatTextBox>().Single();
|
||||
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
{
|
||||
@ -115,6 +119,36 @@ namespace osu.Game.Tests.Visual.Online
|
||||
AddStep("Chat Mode Search", () => bar.ShowSearch.Value = true);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestLengthLimit()
|
||||
{
|
||||
var firstChannel = new Channel
|
||||
{
|
||||
Name = "#test1",
|
||||
Type = ChannelType.Public,
|
||||
Id = 4567,
|
||||
MessageLengthLimit = 20
|
||||
};
|
||||
var secondChannel = new Channel
|
||||
{
|
||||
Name = "#test2",
|
||||
Type = ChannelType.Public,
|
||||
Id = 5678,
|
||||
MessageLengthLimit = 5
|
||||
};
|
||||
|
||||
AddStep("switch to channel with 20 char length limit", () => currentChannel.Value = firstChannel);
|
||||
AddStep("type a message", () => textBox.Current.Value = "abcdefgh");
|
||||
|
||||
AddStep("switch to channel with 5 char length limit", () => currentChannel.Value = secondChannel);
|
||||
AddAssert("text box empty", () => textBox.Current.Value, () => Is.Empty);
|
||||
AddStep("type too much", () => textBox.Current.Value = "123456");
|
||||
AddAssert("text box has 5 chars", () => textBox.Current.Value, () => Has.Length.EqualTo(5));
|
||||
|
||||
AddStep("switch back to channel with 20 char length limit", () => currentChannel.Value = firstChannel);
|
||||
AddAssert("unsent message preserved without truncation", () => textBox.Current.Value, () => Is.EqualTo("abcdefgh"));
|
||||
}
|
||||
|
||||
private static Channel createPublicChannel(string name)
|
||||
=> new Channel { Name = name, Type = ChannelType.Public, Id = 1234 };
|
||||
|
||||
|
@ -12,6 +12,7 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Lists;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays.Chat;
|
||||
using osu.Game.Overlays.Chat.Listing;
|
||||
|
||||
namespace osu.Game.Online.Chat
|
||||
{
|
||||
@ -86,6 +87,12 @@ namespace osu.Game.Online.Chat
|
||||
[JsonProperty(@"last_read_id")]
|
||||
public long? LastReadId;
|
||||
|
||||
/// <remarks>
|
||||
/// Purposefully nullable for the sake of <see cref="ChannelListing.ChannelListingChannel"/>.
|
||||
/// </remarks>
|
||||
[JsonProperty(@"message_length_limit")]
|
||||
public int? MessageLengthLimit;
|
||||
|
||||
/// <summary>
|
||||
/// Signals if the current user joined this channel or not. Defaults to false.
|
||||
/// Note that this does not guarantee a join has completed. Check Id > 0 for confirmation.
|
||||
|
@ -156,7 +156,11 @@ namespace osu.Game.Overlays.Chat
|
||||
chatTextBox.Current.UnbindFrom(change.OldValue.TextBoxMessage);
|
||||
|
||||
if (newChannel != null)
|
||||
{
|
||||
// change length limit first before binding to avoid accidentally truncating pending message from new channel.
|
||||
chatTextBox.LengthLimit = newChannel.MessageLengthLimit;
|
||||
chatTextBox.Current.BindTo(newChannel.TextBoxMessage);
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
|
@ -101,26 +101,31 @@ namespace osu.Game.Screens.Edit.Compose
|
||||
|
||||
#region Clipboard operations
|
||||
|
||||
protected override void PerformCut()
|
||||
public override void Cut()
|
||||
{
|
||||
base.PerformCut();
|
||||
if (!CanCut.Value)
|
||||
return;
|
||||
|
||||
Copy();
|
||||
EditorBeatmap.RemoveRange(EditorBeatmap.SelectedHitObjects.ToArray());
|
||||
}
|
||||
|
||||
protected override void PerformCopy()
|
||||
public override void Copy()
|
||||
{
|
||||
base.PerformCopy();
|
||||
// on stable, pressing Ctrl-C would copy the current timestamp to system clipboard
|
||||
// regardless of whether anything was even selected at all.
|
||||
// UX-wise this is generally strange and unexpected, but make it work anyways to preserve muscle memory.
|
||||
// note that this means that `getTimestamp()` must handle no-selection case, too.
|
||||
host.GetClipboard()?.SetText(getTimestamp());
|
||||
|
||||
clipboard.Value = new ClipboardContent(EditorBeatmap).Serialize();
|
||||
|
||||
host.GetClipboard()?.SetText(formatSelectionAsString());
|
||||
if (CanCopy.Value)
|
||||
clipboard.Value = new ClipboardContent(EditorBeatmap).Serialize();
|
||||
}
|
||||
|
||||
protected override void PerformPaste()
|
||||
public override void Paste()
|
||||
{
|
||||
base.PerformPaste();
|
||||
if (!CanPaste.Value)
|
||||
return;
|
||||
|
||||
var objects = clipboard.Value.Deserialize<ClipboardContent>().HitObjects;
|
||||
|
||||
@ -147,7 +152,7 @@ namespace osu.Game.Screens.Edit.Compose
|
||||
CanPaste.Value = composer.IsLoaded && !string.IsNullOrEmpty(clipboard.Value);
|
||||
}
|
||||
|
||||
private string formatSelectionAsString()
|
||||
private string getTimestamp()
|
||||
{
|
||||
if (composer == null)
|
||||
return string.Empty;
|
||||
|
@ -44,29 +44,23 @@ namespace osu.Game.Screens.Edit
|
||||
/// <summary>
|
||||
/// Performs a "cut to clipboard" operation appropriate for the given screen.
|
||||
/// </summary>
|
||||
protected virtual void PerformCut()
|
||||
/// <remarks>
|
||||
/// Implementors are responsible for checking <see cref="CanCut"/> themselves.
|
||||
/// </remarks>
|
||||
public virtual void Cut()
|
||||
{
|
||||
}
|
||||
|
||||
public void Cut()
|
||||
{
|
||||
if (CanCut.Value)
|
||||
PerformCut();
|
||||
}
|
||||
|
||||
public BindableBool CanCopy { get; } = new BindableBool();
|
||||
|
||||
/// <summary>
|
||||
/// Performs a "copy to clipboard" operation appropriate for the given screen.
|
||||
/// </summary>
|
||||
protected virtual void PerformCopy()
|
||||
{
|
||||
}
|
||||
|
||||
/// <remarks>
|
||||
/// Implementors are responsible for checking <see cref="CanCopy"/> themselves.
|
||||
/// </remarks>
|
||||
public virtual void Copy()
|
||||
{
|
||||
if (CanCopy.Value)
|
||||
PerformCopy();
|
||||
}
|
||||
|
||||
public BindableBool CanPaste { get; } = new BindableBool();
|
||||
@ -74,14 +68,11 @@ namespace osu.Game.Screens.Edit
|
||||
/// <summary>
|
||||
/// Performs a "paste from clipboard" operation appropriate for the given screen.
|
||||
/// </summary>
|
||||
protected virtual void PerformPaste()
|
||||
{
|
||||
}
|
||||
|
||||
/// <remarks>
|
||||
/// Implementors are responsible for checking <see cref="CanPaste"/> themselves.
|
||||
/// </remarks>
|
||||
public virtual void Paste()
|
||||
{
|
||||
if (CanPaste.Value)
|
||||
PerformPaste();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -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.707.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2023.710.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" />
|
||||
|
@ -16,6 +16,6 @@
|
||||
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2023.707.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2023.710.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
Loading…
Reference in New Issue
Block a user