mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 09:03:50 +09:00
Merge remote-tracking branch 'origin/master' into editor-beatmap-saving
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@ -331,3 +331,6 @@ fastlane/report.xml
|
|||||||
# inspectcode
|
# inspectcode
|
||||||
inspectcodereport.xml
|
inspectcodereport.xml
|
||||||
inspectcode
|
inspectcode
|
||||||
|
|
||||||
|
# BenchmarkDotNet
|
||||||
|
/BenchmarkDotNet.Artifacts
|
||||||
|
20
.idea/.idea.osu.Desktop/.idea/runConfigurations/Benchmarks.xml
generated
Normal file
20
.idea/.idea.osu.Desktop/.idea/runConfigurations/Benchmarks.xml
generated
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Benchmarks" type="DotNetProject" factoryName=".NET Project">
|
||||||
|
<option name="EXE_PATH" value="$PROJECT_DIR$/osu.Game.Benchmarks/bin/Release/netcoreapp3.1/osu.Game.Benchmarks.dll" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="--filter *" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/osu.Game.Benchmarks/bin/Release/netcoreapp3.1" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
|
<option name="USE_MONO" value="0" />
|
||||||
|
<option name="RUNTIME_ARGUMENTS" value="" />
|
||||||
|
<option name="PROJECT_PATH" value="$PROJECT_DIR$/osu.Game.Benchmarks/osu.Game.Benchmarks.csproj" />
|
||||||
|
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||||
|
<option name="PROJECT_TFM" value=".NETCoreApp,Version=v3.1" />
|
||||||
|
<method v="2">
|
||||||
|
<option name="Build" enabled="true" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
20
.idea/.idea.osu.Desktop/.idea/runConfigurations/osu_SDL.xml
generated
Normal file
20
.idea/.idea.osu.Desktop/.idea/runConfigurations/osu_SDL.xml
generated
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="osu! SDL" type="DotNetProject" factoryName=".NET Project" folderName="osu!">
|
||||||
|
<option name="EXE_PATH" value="$PROJECT_DIR$/osu.Desktop/bin/Debug/netcoreapp3.1/osu!.dll" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="--sdl" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/osu.Desktop" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
|
<option name="USE_MONO" value="0" />
|
||||||
|
<option name="RUNTIME_ARGUMENTS" value="" />
|
||||||
|
<option name="PROJECT_PATH" value="$PROJECT_DIR$/osu.Desktop/osu.Desktop.csproj" />
|
||||||
|
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||||
|
<option name="PROJECT_TFM" value=".NETCoreApp,Version=v3.0" />
|
||||||
|
<method v="2">
|
||||||
|
<option name="Build" enabled="true" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
19
.vscode/launch.json
vendored
19
.vscode/launch.json
vendored
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [{
|
"configurations": [
|
||||||
|
{
|
||||||
"name": "osu! (Debug)",
|
"name": "osu! (Debug)",
|
||||||
"type": "coreclr",
|
"type": "coreclr",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
@ -50,7 +51,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"console": "internalConsole"
|
"console": "internalConsole"
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"name": "osu! (Tests, Release)",
|
"name": "osu! (Tests, Release)",
|
||||||
"type": "coreclr",
|
"type": "coreclr",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
@ -139,6 +141,19 @@
|
|||||||
},
|
},
|
||||||
"console": "internalConsole"
|
"console": "internalConsole"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "Benchmark",
|
||||||
|
"type": "coreclr",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceRoot}/osu.Game.Benchmarks/bin/Release/netcoreapp3.1/osu.Game.Benchmarks.dll",
|
||||||
|
"args": [
|
||||||
|
"--filter",
|
||||||
|
"*"
|
||||||
|
],
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"preLaunchTask": "Build benchmarks",
|
||||||
|
"console": "internalConsole"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Cake: Debug Script",
|
"name": "Cake: Debug Script",
|
||||||
"type": "coreclr",
|
"type": "coreclr",
|
||||||
|
22
.vscode/tasks.json
vendored
22
.vscode/tasks.json
vendored
@ -2,7 +2,8 @@
|
|||||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
// for the documentation about the tasks.json format
|
// for the documentation about the tasks.json format
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"tasks": [{
|
"tasks": [
|
||||||
|
{
|
||||||
"label": "Build osu! (Debug)",
|
"label": "Build osu! (Debug)",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "dotnet",
|
"command": "dotnet",
|
||||||
@ -78,7 +79,8 @@
|
|||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"label": "Build tournament tests (Release)",
|
"label": "Build tournament tests (Release)",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "dotnet",
|
"command": "dotnet",
|
||||||
@ -94,6 +96,22 @@
|
|||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "Build benchmarks",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"build",
|
||||||
|
"--no-restore",
|
||||||
|
"osu.Game.Benchmarks",
|
||||||
|
"/p:Configuration=Release",
|
||||||
|
"/p:GenerateFullPaths=true",
|
||||||
|
"/m",
|
||||||
|
"/verbosity:m"
|
||||||
|
],
|
||||||
|
"group": "build",
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "Restore (netcoreapp3.1)",
|
"label": "Restore (netcoreapp3.1)",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
|
@ -54,6 +54,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.1230.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.1230.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.109.1" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.111.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
"path": "osu.sln",
|
"path": "osu.sln",
|
||||||
"projects": [
|
"projects": [
|
||||||
"osu.Desktop\\osu.Desktop.csproj",
|
"osu.Desktop\\osu.Desktop.csproj",
|
||||||
|
"osu.Game.Benchmarks\\osu.Game.Benchmarks.csproj",
|
||||||
"osu.Game.Rulesets.Catch.Tests\\osu.Game.Rulesets.Catch.Tests.csproj",
|
"osu.Game.Rulesets.Catch.Tests\\osu.Game.Rulesets.Catch.Tests.csproj",
|
||||||
"osu.Game.Rulesets.Catch\\osu.Game.Rulesets.Catch.csproj",
|
"osu.Game.Rulesets.Catch\\osu.Game.Rulesets.Catch.csproj",
|
||||||
"osu.Game.Rulesets.Mania.Tests\\osu.Game.Rulesets.Mania.Tests.csproj",
|
"osu.Game.Rulesets.Mania.Tests\\osu.Game.Rulesets.Mania.Tests.csproj",
|
||||||
|
@ -75,6 +75,9 @@ namespace osu.Desktop
|
|||||||
|
|
||||||
private void updateStatus()
|
private void updateStatus()
|
||||||
{
|
{
|
||||||
|
if (!client.IsInitialized)
|
||||||
|
return;
|
||||||
|
|
||||||
if (status.Value is UserStatusOffline)
|
if (status.Value is UserStatusOffline)
|
||||||
{
|
{
|
||||||
client.ClearPresence();
|
client.ClearPresence();
|
||||||
|
@ -22,8 +22,9 @@ namespace osu.Desktop
|
|||||||
{
|
{
|
||||||
// Back up the cwd before DesktopGameHost changes it
|
// Back up the cwd before DesktopGameHost changes it
|
||||||
var cwd = Environment.CurrentDirectory;
|
var cwd = Environment.CurrentDirectory;
|
||||||
|
bool useSdl = args.Contains("--sdl");
|
||||||
|
|
||||||
using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true))
|
using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true, useSdl: useSdl))
|
||||||
{
|
{
|
||||||
host.ExceptionThrown += handleException;
|
host.ExceptionThrown += handleException;
|
||||||
|
|
||||||
|
37
osu.Game.Benchmarks/BenchmarkBeatmapParsing.cs
Normal file
37
osu.Game.Benchmarks/BenchmarkBeatmapParsing.cs
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
// 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 System.IO;
|
||||||
|
using BenchmarkDotNet.Attributes;
|
||||||
|
using osu.Framework.IO.Stores;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Beatmaps.Formats;
|
||||||
|
using osu.Game.IO;
|
||||||
|
using osu.Game.IO.Archives;
|
||||||
|
using osu.Game.Resources;
|
||||||
|
|
||||||
|
namespace osu.Game.Benchmarks
|
||||||
|
{
|
||||||
|
public class BenchmarkBeatmapParsing : BenchmarkTest
|
||||||
|
{
|
||||||
|
private readonly MemoryStream beatmapStream = new MemoryStream();
|
||||||
|
|
||||||
|
public override void SetUp()
|
||||||
|
{
|
||||||
|
using (var resources = new DllResourceStore(OsuResources.ResourceAssembly))
|
||||||
|
using (var archive = resources.GetStream("Beatmaps/241526 Soleily - Renatus.osz"))
|
||||||
|
using (var reader = new ZipArchiveReader(archive))
|
||||||
|
reader.GetStream("Soleily - Renatus (Gamu) [Insane].osu").CopyTo(beatmapStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Benchmark]
|
||||||
|
public Beatmap BenchmarkBundledBeatmap()
|
||||||
|
{
|
||||||
|
beatmapStream.Seek(0, SeekOrigin.Begin);
|
||||||
|
var reader = new LineBufferedReader(beatmapStream); // no disposal
|
||||||
|
|
||||||
|
var decoder = Decoder.GetDecoder<Beatmap>(reader);
|
||||||
|
return decoder.Decode(reader);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
23
osu.Game.Benchmarks/BenchmarkTest.cs
Normal file
23
osu.Game.Benchmarks/BenchmarkTest.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// 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 BenchmarkDotNet.Attributes;
|
||||||
|
using BenchmarkDotNet.Running;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace osu.Game.Benchmarks
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
[MemoryDiagnoser]
|
||||||
|
public abstract class BenchmarkTest
|
||||||
|
{
|
||||||
|
[GlobalSetup]
|
||||||
|
[OneTimeSetUp]
|
||||||
|
public virtual void SetUp()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void RunBenchmark() => BenchmarkRunner.Run(GetType());
|
||||||
|
}
|
||||||
|
}
|
17
osu.Game.Benchmarks/Program.cs
Normal file
17
osu.Game.Benchmarks/Program.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// 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 BenchmarkDotNet.Running;
|
||||||
|
|
||||||
|
namespace osu.Game.Benchmarks
|
||||||
|
{
|
||||||
|
public static class Program
|
||||||
|
{
|
||||||
|
public static void Main(string[] args)
|
||||||
|
{
|
||||||
|
BenchmarkSwitcher
|
||||||
|
.FromAssembly(typeof(Program).Assembly)
|
||||||
|
.Run(args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
8
osu.Game.Benchmarks/Properties/launchSettings.json
Normal file
8
osu.Game.Benchmarks/Properties/launchSettings.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"profiles": {
|
||||||
|
"All Benchmarks": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"commandLineArgs": "--filter *"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
19
osu.Game.Benchmarks/osu.Game.Benchmarks.csproj
Normal file
19
osu.Game.Benchmarks/osu.Game.Benchmarks.csproj
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="BenchmarkDotNet" Version="0.12.0" />
|
||||||
|
<PackageReference Include="nunit" Version="3.12.0" />
|
||||||
|
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
@ -18,8 +18,6 @@ namespace osu.Game.Rulesets.Mania.UI.Components
|
|||||||
{
|
{
|
||||||
public class ColumnHitObjectArea : CompositeDrawable, IHasAccentColour
|
public class ColumnHitObjectArea : CompositeDrawable, IHasAccentColour
|
||||||
{
|
{
|
||||||
private const float hit_target_bar_height = 2;
|
|
||||||
|
|
||||||
private readonly IBindable<ScrollingDirection> direction = new Bindable<ScrollingDirection>();
|
private readonly IBindable<ScrollingDirection> direction = new Bindable<ScrollingDirection>();
|
||||||
|
|
||||||
private readonly Drawable hitTarget;
|
private readonly Drawable hitTarget;
|
||||||
@ -67,6 +65,8 @@ namespace osu.Game.Rulesets.Mania.UI.Components
|
|||||||
|
|
||||||
private class DefaultHitTarget : CompositeDrawable, IHasAccentColour
|
private class DefaultHitTarget : CompositeDrawable, IHasAccentColour
|
||||||
{
|
{
|
||||||
|
private const float hit_target_bar_height = 2;
|
||||||
|
|
||||||
private readonly IBindable<ScrollingDirection> direction = new Bindable<ScrollingDirection>();
|
private readonly IBindable<ScrollingDirection> direction = new Bindable<ScrollingDirection>();
|
||||||
|
|
||||||
private readonly Container hitTargetLine;
|
private readonly Container hitTargetLine;
|
||||||
|
@ -61,7 +61,7 @@ namespace osu.Game.Tournament
|
|||||||
string weightString = weight.ToString();
|
string weightString = weight.ToString();
|
||||||
|
|
||||||
// Only exo has an explicit "regular" weight, other fonts do not
|
// Only exo has an explicit "regular" weight, other fonts do not
|
||||||
if (weight == FontWeight.Regular && family != GetFamilyString(TournamentTypeface.Aquatico) && family != GetFamilyString(TournamentTypeface.Aquatico))
|
if (weight == FontWeight.Regular && family != GetFamilyString(TournamentTypeface.Aquatico))
|
||||||
weightString = string.Empty;
|
weightString = string.Empty;
|
||||||
|
|
||||||
return weightString;
|
return weightString;
|
||||||
|
@ -24,6 +24,7 @@ namespace osu.Game.Input.Bindings
|
|||||||
|
|
||||||
public IEnumerable<KeyBinding> GlobalKeyBindings => new[]
|
public IEnumerable<KeyBinding> GlobalKeyBindings => new[]
|
||||||
{
|
{
|
||||||
|
new KeyBinding(InputKey.F6, GlobalAction.ToggleNowPlaying),
|
||||||
new KeyBinding(InputKey.F8, GlobalAction.ToggleChat),
|
new KeyBinding(InputKey.F8, GlobalAction.ToggleChat),
|
||||||
new KeyBinding(InputKey.F9, GlobalAction.ToggleSocial),
|
new KeyBinding(InputKey.F9, GlobalAction.ToggleSocial),
|
||||||
new KeyBinding(InputKey.F10, GlobalAction.ToggleGameplayMouseButtons),
|
new KeyBinding(InputKey.F10, GlobalAction.ToggleGameplayMouseButtons),
|
||||||
@ -137,5 +138,8 @@ namespace osu.Game.Input.Bindings
|
|||||||
|
|
||||||
[Description("Play / pause")]
|
[Description("Play / pause")]
|
||||||
MusicPlay,
|
MusicPlay,
|
||||||
|
|
||||||
|
[Description("Toggle now playing overlay")]
|
||||||
|
ToggleNowPlaying,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
30
osu.Game/Online/API/Requests/MarkChannelAsReadRequest.cs
Normal file
30
osu.Game/Online/API/Requests/MarkChannelAsReadRequest.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// 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 System.Net.Http;
|
||||||
|
using osu.Framework.IO.Network;
|
||||||
|
using osu.Game.Online.Chat;
|
||||||
|
|
||||||
|
namespace osu.Game.Online.API.Requests
|
||||||
|
{
|
||||||
|
public class MarkChannelAsReadRequest : APIRequest
|
||||||
|
{
|
||||||
|
private readonly Channel channel;
|
||||||
|
private readonly Message message;
|
||||||
|
|
||||||
|
public MarkChannelAsReadRequest(Channel channel, Message message)
|
||||||
|
{
|
||||||
|
this.channel = channel;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override string Target => $"chat/channels/{channel.Id}/mark-as-read/{message.Id}";
|
||||||
|
|
||||||
|
protected override WebRequest CreateWebRequest()
|
||||||
|
{
|
||||||
|
var req = base.CreateWebRequest();
|
||||||
|
req.Method = HttpMethod.Put;
|
||||||
|
return req;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -36,6 +36,11 @@ namespace osu.Game.Online.Chat
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly SortedList<Message> Messages = new SortedList<Message>(Comparer<Message>.Default);
|
public readonly SortedList<Message> Messages = new SortedList<Message>(Comparer<Message>.Default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Contains all the messages that weren't read by the user.
|
||||||
|
/// </summary>
|
||||||
|
public IEnumerable<Message> UnreadMessages => Messages.Where(m => LastReadId < m.Id);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Contains all the messages that are still pending for submission to the server.
|
/// Contains all the messages that are still pending for submission to the server.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -75,6 +80,9 @@ namespace osu.Game.Online.Chat
|
|||||||
[JsonProperty(@"last_message_id")]
|
[JsonProperty(@"last_message_id")]
|
||||||
public long? LastMessageId;
|
public long? LastMessageId;
|
||||||
|
|
||||||
|
[JsonProperty(@"last_read_id")]
|
||||||
|
public long? LastReadId;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Signalles if the current user joined this channel or not. Defaults to false.
|
/// Signalles if the current user joined this channel or not. Defaults to false.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -445,6 +445,28 @@ namespace osu.Game.Online.Chat
|
|||||||
return tcs.Task;
|
return tcs.Task;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Marks the <paramref name="channel"/> as read
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="channel">The channel that will be marked as read</param>
|
||||||
|
public void MarkChannelAsRead(Channel channel)
|
||||||
|
{
|
||||||
|
if (channel.LastMessageId == channel.LastReadId)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var message = channel.Messages.LastOrDefault();
|
||||||
|
|
||||||
|
if (message == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var req = new MarkChannelAsReadRequest(channel, message);
|
||||||
|
|
||||||
|
req.Success += () => channel.LastReadId = message.Id;
|
||||||
|
req.Failure += e => Logger.Error(e, $"Failed to mark channel {channel} up to '{message}' as read");
|
||||||
|
|
||||||
|
api.Queue(req);
|
||||||
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(IAPIProvider api)
|
private void load(IAPIProvider api)
|
||||||
{
|
{
|
||||||
|
@ -61,6 +61,8 @@ namespace osu.Game
|
|||||||
|
|
||||||
private NotificationOverlay notifications;
|
private NotificationOverlay notifications;
|
||||||
|
|
||||||
|
private NowPlayingOverlay nowPlaying;
|
||||||
|
|
||||||
private DirectOverlay direct;
|
private DirectOverlay direct;
|
||||||
|
|
||||||
private SocialOverlay social;
|
private SocialOverlay social;
|
||||||
@ -624,7 +626,7 @@ namespace osu.Game
|
|||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
}, rightFloatingOverlayContent.Add, true);
|
}, rightFloatingOverlayContent.Add, true);
|
||||||
|
|
||||||
loadComponentSingleFile(new NowPlayingOverlay
|
loadComponentSingleFile(nowPlaying = new NowPlayingOverlay
|
||||||
{
|
{
|
||||||
GetToolbarHeight = () => ToolbarOffset,
|
GetToolbarHeight = () => ToolbarOffset,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
@ -822,6 +824,10 @@ namespace osu.Game
|
|||||||
|
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
|
case GlobalAction.ToggleNowPlaying:
|
||||||
|
nowPlaying.ToggleVisibility();
|
||||||
|
return true;
|
||||||
|
|
||||||
case GlobalAction.ToggleChat:
|
case GlobalAction.ToggleChat:
|
||||||
chatOverlay.ToggleVisibility();
|
chatOverlay.ToggleVisibility();
|
||||||
return true;
|
return true;
|
||||||
|
@ -279,6 +279,10 @@ namespace osu.Game.Overlays
|
|||||||
currentChannelContainer.Clear(false);
|
currentChannelContainer.Clear(false);
|
||||||
currentChannelContainer.Add(loaded);
|
currentChannelContainer.Add(loaded);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mark channel as read when channel switched
|
||||||
|
if (e.NewValue.Messages.Any())
|
||||||
|
channelManager.MarkChannelAsRead(e.NewValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
private float startDragChatHeight;
|
private float startDragChatHeight;
|
||||||
|
@ -11,6 +11,7 @@ using osu.Framework.Graphics.Cursor;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
@ -19,6 +20,10 @@ namespace osu.Game.Overlays.News
|
|||||||
{
|
{
|
||||||
public class NewsArticleCover : Container
|
public class NewsArticleCover : Container
|
||||||
{
|
{
|
||||||
|
private const int hover_duration = 300;
|
||||||
|
|
||||||
|
private readonly Box gradient;
|
||||||
|
|
||||||
public NewsArticleCover(ArticleInfo info)
|
public NewsArticleCover(ArticleInfo info)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
@ -47,11 +52,11 @@ namespace osu.Game.Overlays.News
|
|||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
},
|
},
|
||||||
new Box
|
gradient = new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = ColourInfo.GradientVertical(Color4.Black.Opacity(0.1f), Color4.Black.Opacity(0.6f)),
|
Colour = ColourInfo.GradientVertical(Color4.Black.Opacity(0.1f), Color4.Black.Opacity(0.7f)),
|
||||||
Alpha = 1f,
|
Alpha = 0
|
||||||
},
|
},
|
||||||
new DateContainer(info.Time)
|
new DateContainer(info.Time)
|
||||||
{
|
{
|
||||||
@ -90,6 +95,18 @@ namespace osu.Game.Overlays.News
|
|||||||
bg.OnLoadComplete += d => d.FadeIn(250, Easing.In);
|
bg.OnLoadComplete += d => d.FadeIn(250, Easing.In);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool OnHover(HoverEvent e)
|
||||||
|
{
|
||||||
|
gradient.FadeIn(hover_duration, Easing.OutQuint);
|
||||||
|
return base.OnHover(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnHoverLost(HoverLostEvent e)
|
||||||
|
{
|
||||||
|
base.OnHoverLost(e);
|
||||||
|
gradient.FadeOut(hover_duration, Easing.OutQuint);
|
||||||
|
}
|
||||||
|
|
||||||
[LongRunningLoad]
|
[LongRunningLoad]
|
||||||
private class NewsBackground : Sprite
|
private class NewsBackground : Sprite
|
||||||
{
|
{
|
||||||
|
@ -323,8 +323,6 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
Colour = Color4.Black.Opacity(0.25f),
|
Colour = Color4.Black.Opacity(0.25f),
|
||||||
Radius = 4,
|
Radius = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
ItemsContainer.Padding = new MarginPadding();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
|
@ -163,10 +163,6 @@ namespace osu.Game.Overlays.Settings
|
|||||||
|
|
||||||
public string TooltipText => "Revert to default";
|
public string TooltipText => "Revert to default";
|
||||||
|
|
||||||
protected override bool OnMouseDown(MouseDownEvent e) => true;
|
|
||||||
|
|
||||||
protected override bool OnMouseUp(MouseUpEvent e) => true;
|
|
||||||
|
|
||||||
protected override bool OnClick(ClickEvent e)
|
protected override bool OnClick(ClickEvent e)
|
||||||
{
|
{
|
||||||
if (bindable != null && !bindable.Disabled)
|
if (bindable != null && !bindable.Disabled)
|
||||||
|
@ -10,7 +10,6 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using System;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -118,17 +117,9 @@ namespace osu.Game.Screens.Select.Details
|
|||||||
mod.ApplyToDifficulty(adjustedDifficulty);
|
mod.ApplyToDifficulty(adjustedDifficulty);
|
||||||
}
|
}
|
||||||
|
|
||||||
//mania specific
|
// Account for mania differences
|
||||||
if ((Beatmap?.Ruleset?.ID ?? 0) == 3)
|
firstValue.Title = (Beatmap?.Ruleset?.ID ?? 0) == 3 ? "Key Amount" : "Circle Size";
|
||||||
{
|
|
||||||
firstValue.Title = "Key Amount";
|
|
||||||
firstValue.Value = ((int)MathF.Round(baseDifficulty?.CircleSize ?? 0), (int)MathF.Round(adjustedDifficulty?.CircleSize ?? 0));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
firstValue.Title = "Circle Size";
|
|
||||||
firstValue.Value = (baseDifficulty?.CircleSize ?? 0, adjustedDifficulty?.CircleSize);
|
firstValue.Value = (baseDifficulty?.CircleSize ?? 0, adjustedDifficulty?.CircleSize);
|
||||||
}
|
|
||||||
|
|
||||||
starDifficulty.Value = ((float)(Beatmap?.StarDifficulty ?? 0), null);
|
starDifficulty.Value = ((float)(Beatmap?.StarDifficulty ?? 0), null);
|
||||||
|
|
||||||
|
@ -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="2019.1230.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.1230.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2020.109.1" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.111.0" />
|
||||||
<PackageReference Include="Sentry" Version="1.2.0" />
|
<PackageReference Include="Sentry" Version="1.2.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" />
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.1230.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.1230.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.109.1" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.111.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 +82,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.109.1" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.111.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" />
|
||||||
|
14
osu.sln
14
osu.sln
@ -65,6 +65,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||||||
osu.TestProject.props = osu.TestProject.props
|
osu.TestProject.props = osu.TestProject.props
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Benchmarks", "osu.Game.Benchmarks\osu.Game.Benchmarks.csproj", "{93632F2D-2BB4-46C1-A7B8-F8CF2FB27118}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -399,6 +401,18 @@ Global
|
|||||||
{5CC222DC-5716-4499-B897-DCBDDA4A5CF9}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
{5CC222DC-5716-4499-B897-DCBDDA4A5CF9}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||||
{5CC222DC-5716-4499-B897-DCBDDA4A5CF9}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
{5CC222DC-5716-4499-B897-DCBDDA4A5CF9}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||||
{5CC222DC-5716-4499-B897-DCBDDA4A5CF9}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
|
{5CC222DC-5716-4499-B897-DCBDDA4A5CF9}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
|
||||||
|
{93632F2D-2BB4-46C1-A7B8-F8CF2FB27118}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{93632F2D-2BB4-46C1-A7B8-F8CF2FB27118}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{93632F2D-2BB4-46C1-A7B8-F8CF2FB27118}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||||
|
{93632F2D-2BB4-46C1-A7B8-F8CF2FB27118}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||||
|
{93632F2D-2BB4-46C1-A7B8-F8CF2FB27118}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||||
|
{93632F2D-2BB4-46C1-A7B8-F8CF2FB27118}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||||
|
{93632F2D-2BB4-46C1-A7B8-F8CF2FB27118}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{93632F2D-2BB4-46C1-A7B8-F8CF2FB27118}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{93632F2D-2BB4-46C1-A7B8-F8CF2FB27118}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||||
|
{93632F2D-2BB4-46C1-A7B8-F8CF2FB27118}.Release|iPhone.Build.0 = Release|Any CPU
|
||||||
|
{93632F2D-2BB4-46C1-A7B8-F8CF2FB27118}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||||
|
{93632F2D-2BB4-46C1-A7B8-F8CF2FB27118}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
Reference in New Issue
Block a user