Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SDL2{Desktop}Window usages in line with framework IWindow changes #24102

Merged
merged 3 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion osu.Android.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<AndroidManifestMerger>manifestmerger.jar</AndroidManifestMerger>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Framework.Android" Version="2023.625.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2023.707.0" />
</ItemGroup>
<ItemGroup>
<AndroidManifestOverlay Include="$(MSBuildThisFileDirectory)osu.Android\Properties\AndroidManifestOverlay.xml" />
Expand Down
8 changes: 3 additions & 5 deletions osu.Desktop/OsuGameDesktop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,12 @@ public override void SetHost(GameHost host)
{
base.SetHost(host);

var desktopWindow = (SDL2DesktopWindow)host.Window;

var iconStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico");
if (iconStream != null)
desktopWindow.SetIconFromStream(iconStream);
host.Window.SetIconFromStream(iconStream);

desktopWindow.CursorState |= CursorState.Hidden;
desktopWindow.Title = Name;
host.Window.CursorState |= CursorState.Hidden;
host.Window.Title = Name;
}

protected override BatteryInfo CreateBatteryInfo() => new SDL2BatteryInfo();
Expand Down
4 changes: 2 additions & 2 deletions osu.Game/OsuGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ public override void SetHost(GameHost host)
{
base.SetHost(host);

if (host.Window is SDL2Window sdlWindow)
if (host.Window != null)
{
sdlWindow.DragDrop += path =>
host.Window.DragDrop += path =>
{
// on macOS/iOS, URL associations are handled via SDL_DROPFILE events.
if (path.StartsWith(OSU_PROTOCOL, StringComparison.Ordinal))
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/osu.Game.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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.625.0" />
<PackageReference Include="ppy.osu.Framework" Version="2023.707.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" />
Expand Down
2 changes: 1 addition & 1 deletion osu.iOS.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Framework.iOS" Version="2023.625.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2023.707.0" />
</ItemGroup>
</Project>