Skip to content

Commit b0c09df

Browse files
committed
Merge branch 'master' into gameplay/key-counter-abstraction
2 parents 5f9b13a + 43d7386 commit b0c09df

File tree

147 files changed

+2612
-749
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+2612
-749
lines changed

.github/workflows/ci.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1717

1818
# FIXME: Tools won't run in .NET 6.0 unless you install 3.1.x LTS side by side.
1919
# https://itnext.io/how-to-support-multiple-net-sdks-in-github-actions-workflows-b988daa884e
2020
- name: Install .NET 3.1.x LTS
21-
uses: actions/setup-dotnet@v1
21+
uses: actions/setup-dotnet@v3
2222
with:
2323
dotnet-version: "3.1.x"
2424

2525
- name: Install .NET 6.0.x
26-
uses: actions/setup-dotnet@v1
26+
uses: actions/setup-dotnet@v3
2727
with:
2828
dotnet-version: "6.0.x"
2929

@@ -77,10 +77,10 @@ jobs:
7777
timeout-minutes: 60
7878
steps:
7979
- name: Checkout
80-
uses: actions/checkout@v2
80+
uses: actions/checkout@v3
8181

8282
- name: Install .NET 6.0.x
83-
uses: actions/setup-dotnet@v1
83+
uses: actions/setup-dotnet@v3
8484
with:
8585
dotnet-version: "6.0.x"
8686

@@ -94,7 +94,7 @@ jobs:
9494
# Attempt to upload results even if test fails.
9595
# https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#always
9696
- name: Upload Test Results
97-
uses: actions/upload-artifact@v2
97+
uses: actions/upload-artifact@v3
9898
if: ${{ always() }}
9999
with:
100100
name: osu-test-results-${{matrix.os.prettyname}}-${{matrix.threadingMode}}
@@ -106,10 +106,10 @@ jobs:
106106
timeout-minutes: 60
107107
steps:
108108
- name: Checkout
109-
uses: actions/checkout@v2
109+
uses: actions/checkout@v3
110110

111111
- name: Install .NET 6.0.x
112-
uses: actions/setup-dotnet@v1
112+
uses: actions/setup-dotnet@v3
113113
with:
114114
dotnet-version: "6.0.x"
115115

@@ -125,10 +125,10 @@ jobs:
125125
timeout-minutes: 60
126126
steps:
127127
- name: Checkout
128-
uses: actions/checkout@v2
128+
uses: actions/checkout@v3
129129

130130
- name: Install .NET 6.0.x
131-
uses: actions/setup-dotnet@v1
131+
uses: actions/setup-dotnet@v3
132132
with:
133133
dotnet-version: "6.0.x"
134134

.github/workflows/diffcalc.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ jobs:
4848
CONTINUE="no"
4949
fi
5050
51-
echo "::set-output name=continue::${CONTINUE}"
52-
echo "::set-output name=matrix::${MATRIX_JSON}"
51+
echo "continue=${CONTINUE}" >> $GITHUB_OUTPUT
52+
echo "matrix=${MATRIX_JSON}" >> $GITHUB_OUTPUT
5353
diffcalc:
5454
name: Run
5555
runs-on: self-hosted
@@ -80,34 +80,34 @@ jobs:
8080
env:
8181
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8282
run: |
83-
echo "::set-output name=branchname::$(curl -H "Authorization: token ${GITHUB_TOKEN}" ${{ github.event.issue.pull_request.url }} | jq '.head.ref' | sed 's/\"//g')"
84-
echo "::set-output name=repo::$(curl -H "Authorization: token ${GITHUB_TOKEN}" ${{ github.event.issue.pull_request.url }} | jq '.head.repo.full_name' | sed 's/\"//g')"
83+
echo "branchname=$(curl -H "Authorization: token ${GITHUB_TOKEN}" ${{ github.event.issue.pull_request.url }} | jq '.head.ref' | sed 's/\"//g')" >> $GITHUB_OUTPUT
84+
echo "repo=$(curl -H "Authorization: token ${GITHUB_TOKEN}" ${{ github.event.issue.pull_request.url }} | jq '.head.repo.full_name' | sed 's/\"//g')" >> $GITHUB_OUTPUT
8585
8686
# Checkout osu
8787
- name: Checkout osu (master)
88-
uses: actions/checkout@v2
88+
uses: actions/checkout@v3
8989
with:
9090
path: 'master/osu'
9191
- name: Checkout osu (pr)
92-
uses: actions/checkout@v2
92+
uses: actions/checkout@v3
9393
with:
9494
path: 'pr/osu'
9595
repository: ${{ steps.upstreambranch.outputs.repo }}
9696
ref: ${{ steps.upstreambranch.outputs.branchname }}
9797

9898
- name: Checkout osu-difficulty-calculator (master)
99-
uses: actions/checkout@v2
99+
uses: actions/checkout@v3
100100
with:
101101
repository: ppy/osu-difficulty-calculator
102102
path: 'master/osu-difficulty-calculator'
103103
- name: Checkout osu-difficulty-calculator (pr)
104-
uses: actions/checkout@v2
104+
uses: actions/checkout@v3
105105
with:
106106
repository: ppy/osu-difficulty-calculator
107107
path: 'pr/osu-difficulty-calculator'
108108

109109
- name: Install .NET 5.0.x
110-
uses: actions/setup-dotnet@v1
110+
uses: actions/setup-dotnet@v3
111111
with:
112112
dotnet-version: "5.0.x"
113113

.github/workflows/sentry-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1717
with:
1818
fetch-depth: 0
1919

Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- Contains required properties for osu!framework projects. -->
22
<Project>
33
<PropertyGroup Label="C#">
4-
<LangVersion>9.0</LangVersion>
4+
<LangVersion>10.0</LangVersion>
55
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ When it comes to contributing to the project, the two main things you can do to
105105

106106
If you wish to help with localisation efforts, head over to [crowdin](https://crowdin.com/project/osu-web).
107107

108-
For those interested, we love to reward quality contributions via [bounties](https://docs.google.com/spreadsheets/d/1jNXfj_S3Pb5PErA-czDdC9DUu4IgUbe1Lt8E7CYUJuE/view?&rm=minimal#gid=523803337), paid out via PayPal or osu!supporter tags. Don't hesitate to [request a bounty](https://docs.google.com/forms/d/e/1FAIpQLSet_8iFAgPMG526pBZ2Kic6HSh7XPM3fE8xPcnWNkMzINDdYg/viewform) for your work on this project.
108+
We love to reward quality contributions. If you have made a large contribution, or are a regular contributor, you are welcome to [submit an expense via opencollective](https://opencollective.com/ppy/expenses/new). If you have any questions, feel free to [reach out to peppy](mailto:pe@ppy.sh) before doing so.
109109

110110
## Licence
111111

UseLocalFramework.ps1

+43-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,53 @@
33
#
44
# https://github.com/ppy/osu-framework/wiki/Testing-local-framework-checkout-with-other-projects
55

6-
$CSPROJ="osu.Game/osu.Game.csproj"
6+
$GAME_CSPROJ="osu.Game/osu.Game.csproj"
7+
$ANDROID_PROPS="osu.Android.props"
8+
$IOS_PROPS="osu.iOS.props"
79
$SLN="osu.sln"
810

9-
dotnet remove $CSPROJ package ppy.osu.Framework;
10-
dotnet sln $SLN add ../osu-framework/osu.Framework/osu.Framework.csproj ../osu-framework/osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj;
11-
dotnet add $CSPROJ reference ../osu-framework/osu.Framework/osu.Framework.csproj
11+
dotnet remove $GAME_CSPROJ reference ppy.osu.Framework;
12+
dotnet remove $ANDROID_PROPS reference ppy.osu.Framework.Android;
13+
dotnet remove $IOS_PROPS reference ppy.osu.Framework.iOS;
14+
15+
dotnet sln $SLN add ../osu-framework/osu.Framework/osu.Framework.csproj `
16+
../osu-framework/osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj `
17+
../osu-framework/osu.Framework.Android/osu.Framework.Android.csproj `
18+
../osu-framework/osu.Framework.iOS/osu.Framework.iOS.csproj;
19+
20+
dotnet add $GAME_CSPROJ reference ../osu-framework/osu.Framework/osu.Framework.csproj;
21+
dotnet add $ANDROID_PROPS reference ../osu-framework/osu.Framework.Android/osu.Framework.Android.csproj;
22+
dotnet add $IOS_PROPS reference ../osu-framework/osu.Framework.iOS/osu.Framework.iOS.csproj;
23+
24+
# workaround for dotnet add not inserting $(MSBuildThisFileDirectory) on props files
25+
(Get-Content "osu.Android.props") -replace "`"..\\osu-framework", "`"`$(MSBuildThisFileDirectory)..\osu-framework" | Set-Content "osu.Android.props"
26+
(Get-Content "osu.iOS.props") -replace "`"..\\osu-framework", "`"`$(MSBuildThisFileDirectory)..\osu-framework" | Set-Content "osu.iOS.props"
27+
28+
# needed because iOS framework nupkg includes a set of properties to work around certain issues during building,
29+
# and those get ignored when referencing framework via project, threfore we have to manually include it via props reference.
30+
(Get-Content "osu.iOS.props") |
31+
Foreach-Object {
32+
if ($_ -match "</Project>")
33+
{
34+
" <Import Project=`"`$(MSBuildThisFileDirectory)../osu-framework/osu.Framework.iOS.props`"/>"
35+
}
36+
37+
$_
38+
} | Set-Content "osu.iOS.props"
1239

13-
$SLNF=Get-Content "osu.Desktop.slnf" | ConvertFrom-Json
1440
$TMP=New-TemporaryFile
41+
42+
$SLNF=Get-Content "osu.Desktop.slnf" | ConvertFrom-Json
1543
$SLNF.solution.projects += ("../osu-framework/osu.Framework/osu.Framework.csproj", "../osu-framework/osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj")
1644
ConvertTo-Json $SLNF | Out-File $TMP -Encoding UTF8
1745
Move-Item -Path $TMP -Destination "osu.Desktop.slnf" -Force
46+
47+
$SLNF=Get-Content "osu.Android.slnf" | ConvertFrom-Json
48+
$SLNF.solution.projects += ("../osu-framework/osu.Framework/osu.Framework.csproj", "../osu-framework/osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj", "../osu-framework/osu.Framework.Android/osu.Framework.Android.csproj")
49+
ConvertTo-Json $SLNF | Out-File $TMP -Encoding UTF8
50+
Move-Item -Path $TMP -Destination "osu.Android.slnf" -Force
51+
52+
$SLNF=Get-Content "osu.iOS.slnf" | ConvertFrom-Json
53+
$SLNF.solution.projects += ("../osu-framework/osu.Framework/osu.Framework.csproj", "../osu-framework/osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj", "../osu-framework/osu.Framework.iOS/osu.Framework.iOS.csproj")
54+
ConvertTo-Json $SLNF | Out-File $TMP -Encoding UTF8
55+
Move-Item -Path $TMP -Destination "osu.iOS.slnf" -Force

UseLocalFramework.sh

+33-6
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,41 @@
55
#
66
# https://github.com/ppy/osu-framework/wiki/Testing-local-framework-checkout-with-other-projects
77

8-
CSPROJ="osu.Game/osu.Game.csproj"
8+
GAME_CSPROJ="osu.Game/osu.Game.csproj"
9+
ANDROID_PROPS="osu.Android.props"
10+
IOS_PROPS="osu.iOS.props"
911
SLN="osu.sln"
1012

11-
dotnet remove $CSPROJ package ppy.osu.Framework
12-
dotnet sln $SLN add ../osu-framework/osu.Framework/osu.Framework.csproj ../osu-framework/osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj
13-
dotnet add $CSPROJ reference ../osu-framework/osu.Framework/osu.Framework.csproj
13+
dotnet remove $GAME_CSPROJ reference ppy.osu.Framework
14+
dotnet remove $ANDROID_PROPS reference ppy.osu.Framework.Android
15+
dotnet remove $IOS_PROPS reference ppy.osu.Framework.iOS
16+
17+
dotnet sln $SLN add ../osu-framework/osu.Framework/osu.Framework.csproj \
18+
../osu-framework/osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj \
19+
../osu-framework/osu.Framework.Android/osu.Framework.Android.csproj \
20+
../osu-framework/osu.Framework.iOS/osu.Framework.iOS.csproj
21+
22+
dotnet add $GAME_CSPROJ reference ../osu-framework/osu.Framework/osu.Framework.csproj
23+
dotnet add $ANDROID_PROPS reference ../osu-framework/osu.Framework.Android/osu.Framework.Android.csproj
24+
dotnet add $IOS_PROPS reference ../osu-framework/osu.Framework.iOS/osu.Framework.iOS.csproj
25+
26+
# workaround for dotnet add not inserting $(MSBuildThisFileDirectory) on props files
27+
sed -i.bak 's:"..\\osu-framework:"$(MSBuildThisFileDirectory)..\\osu-framework:g' ./osu.Android.props && rm osu.Android.props.bak
28+
sed -i.bak 's:"..\\osu-framework:"$(MSBuildThisFileDirectory)..\\osu-framework:g' ./osu.iOS.props && rm osu.iOS.props.bak
29+
30+
# needed because iOS framework nupkg includes a set of properties to work around certain issues during building,
31+
# and those get ignored when referencing framework via project, threfore we have to manually include it via props reference.
32+
sed -i.bak '/<\/Project>/i\
33+
<Import Project=\"$(MSBuildThisFileDirectory)../osu-framework/osu.Framework.iOS.props\"/>\
34+
' ./osu.iOS.props && rm osu.iOS.props.bak
1435

15-
SLNF="osu.Desktop.slnf"
1636
tmp=$(mktemp)
37+
1738
jq '.solution.projects += ["../osu-framework/osu.Framework/osu.Framework.csproj", "../osu-framework/osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj"]' osu.Desktop.slnf > $tmp
18-
mv -f $tmp $SLNF
39+
mv -f $tmp osu.Desktop.slnf
40+
41+
jq '.solution.projects += ["../osu-framework/osu.Framework/osu.Framework.csproj", "../osu-framework/osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj", "../osu-framework/osu.Framework.Android/osu.Framework.Android.csproj"]' osu.Android.slnf > $tmp
42+
mv -f $tmp osu.Android.slnf
43+
44+
jq '.solution.projects += ["../osu-framework/osu.Framework/osu.Framework.csproj", "../osu-framework/osu.Framework.NativeLibs/osu.Framework.NativeLibs.csproj", "../osu-framework/osu.Framework.iOS/osu.Framework.iOS.csproj"]' osu.iOS.slnf > $tmp
45+
mv -f $tmp osu.iOS.slnf

osu.Android.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<AndroidManifestMerger>manifestmerger.jar</AndroidManifestMerger>
1212
</PropertyGroup>
1313
<ItemGroup>
14-
<PackageReference Include="ppy.osu.Framework.Android" Version="2023.228.0" />
14+
<PackageReference Include="ppy.osu.Framework.Android" Version="2023.403.0" />
1515
</ItemGroup>
1616
<ItemGroup>
1717
<AndroidManifestOverlay Include="$(MSBuildThisFileDirectory)osu.Android\Properties\AndroidManifestOverlay.xml" />

osu.Desktop/OsuGameDesktop.cs

+11-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.Collections.Generic;
66
using System.Diagnostics;
77
using System.IO;
8-
using System.Linq;
98
using System.Reflection;
109
using System.Runtime.Versioning;
1110
using System.Threading.Tasks;
@@ -139,7 +138,17 @@ public override void SetHost(GameHost host)
139138

140139
desktopWindow.CursorState |= CursorState.Hidden;
141140
desktopWindow.Title = Name;
142-
desktopWindow.DragDrop += f => fileDrop(new[] { f });
141+
desktopWindow.DragDrop += f =>
142+
{
143+
// on macOS, URL associations are handled via SDL_DROPFILE events.
144+
if (f.StartsWith(OSU_PROTOCOL, StringComparison.Ordinal))
145+
{
146+
HandleLink(f);
147+
return;
148+
}
149+
150+
fileDrop(new[] { f });
151+
};
143152
}
144153

145154
protected override BatteryInfo CreateBatteryInfo() => new SDL2BatteryInfo();
@@ -151,10 +160,6 @@ private void fileDrop(string[] filePaths)
151160
{
152161
lock (importableFiles)
153162
{
154-
string firstExtension = Path.GetExtension(filePaths.First());
155-
156-
if (filePaths.Any(f => Path.GetExtension(f) != firstExtension)) return;
157-
158163
importableFiles.AddRange(filePaths);
159164

160165
Logger.Log($"Adding {filePaths.Length} files for import");

0 commit comments

Comments
 (0)