Skip to content

Commit 884f8b3

Browse files
committed
Updated nuget packages for monogame stuff
1 parent 7bcb15a commit 884f8b3

File tree

16 files changed

+1306
-33
lines changed

16 files changed

+1306
-33
lines changed

DeveMazeGeneratorCore.MonoGame.Blazor/DeveMazeGeneratorCore.MonoGame.Blazor.csproj

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,32 +59,31 @@
5959

6060
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
6161
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.32" />
62-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer"
63-
Version="6.0.32" PrivateAssets="all" />
62+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.32" PrivateAssets="all" />
6463
</ItemGroup>
6564
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
66-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.7" />
67-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer"
68-
Version="8.0.7" PrivateAssets="all" />
65+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.17" />
66+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.17" PrivateAssets="all" />
6967
</ItemGroup>
7068

7169
<ItemGroup>
72-
<PackageReference Include="nkast.Xna.Framework.Blazor" Version="3.13.9001" />
73-
<PackageReference Include="nkast.Xna.Framework" Version="3.13.9001" />
74-
<PackageReference Include="nkast.Xna.Framework.Content" Version="3.13.9001" />
75-
<PackageReference Include="nkast.Xna.Framework.Graphics" Version="3.13.9001" />
76-
<PackageReference Include="nkast.Xna.Framework.Audio" Version="3.13.9001" />
77-
<PackageReference Include="nkast.Xna.Framework.Media" Version="3.13.9001" />
78-
<PackageReference Include="nkast.Xna.Framework.Input" Version="3.13.9001" />
79-
<PackageReference Include="nkast.Xna.Framework.Game" Version="3.13.9001" />
70+
<PackageReference Include="nkast.Kni.Platform.Blazor.GL" Version="4.2.9001" />
71+
<PackageReference Include="nkast.Xna.Framework" Version="4.2.9001" />
72+
<PackageReference Include="nkast.Xna.Framework.Content" Version="4.2.9001" />
73+
<PackageReference Include="nkast.Xna.Framework.Devices" Version="4.2.9001" />
74+
<PackageReference Include="nkast.Xna.Framework.Graphics" Version="4.2.9001" />
75+
<PackageReference Include="nkast.Xna.Framework.Audio" Version="4.2.9001" />
76+
<PackageReference Include="nkast.Xna.Framework.Media" Version="4.2.9001" />
77+
<PackageReference Include="nkast.Xna.Framework.Input" Version="4.2.9001" />
78+
<PackageReference Include="nkast.Xna.Framework.Game" Version="4.2.9001" />
79+
<PackageReference Include="nkast.Xna.Framework.Storage" Version="4.2.9001" />
80+
<PackageReference Include="nkast.Xna.Framework.XR" Version="4.2.9001" />
8081
<!-- <PackageReference Include="tainicom.Wasm.Canvas" Version="3.2.10" />
8182
<PackageReference Include="tainicom.Wasm.XHR" Version="3.2.10" />
8283
<PackageReference Include="tainicom.Wasm.Dom" Version="3.2.10" />
8384
<PackageReference Include="tainicom.Xna.Framework" Version="3.8.9012" /> -->
8485
</ItemGroup>
8586

86-
<Import
87-
Project="..\DeveMazeGeneratorCore.MonoGame.Shared\DeveMazeGeneratorCore.MonoGame.Shared.projitems"
88-
Label="Shared" />
87+
<Import Project="..\DeveMazeGeneratorCore.MonoGame.Shared\DeveMazeGeneratorCore.MonoGame.Shared.projitems" Label="Shared" />
8988

9089
</Project>

DeveMazeGeneratorCore.MonoGame.Blazor/wwwroot/css/app.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ a, .btn-link {
6868
right: 0px;
6969
bottom: 0px;
7070
left: 0px;
71+
72+
/* Disable text highlighting and magnifying glass on iPhone/webkit */
73+
-webkit-user-select: none;
7174
}
7275

7376

@@ -77,4 +80,7 @@ a, .btn-link {
7780
right: 0px;
7881
bottom: 0px;
7982
left: 0px;
83+
84+
/* Disable text highlighting and magnifying glass on iPhone/webkit */
85+
-webkit-user-select: none;
8086
}

DeveMazeGeneratorCore.MonoGame.Blazor/wwwroot/index.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<script src="_framework/blazor.webassembly.js" autostart="false"></script>
2727
<script type="module">
2828
import { BrotliDecode } from './js/decode.min.js';
29+
window.BrotliDecode = BrotliDecode;
2930
// Set this to enable Brotli (.br) decompression on static webServers
3031
// that don't support content compression and http://.
3132
var enableBrotliDecompression = true;
@@ -51,16 +52,17 @@
5152
}
5253
});
5354
</script>
54-
<script src="_content/nkast.Wasm.Dom/js/JSObject.8.0.1.js"></script>
55-
<script src="_content/nkast.Wasm.Dom/js/Window.8.0.1.js"></script>
56-
<script src="_content/nkast.Wasm.Dom/js/Document.8.0.1.js"></script>
57-
<script src="_content/nkast.Wasm.Dom/js/Navigator.8.0.1.js"></script>
58-
<script src="_content/nkast.Wasm.Dom/js/Gamepad.8.0.1.js"></script>
59-
<script src="_content/nkast.Wasm.Dom/js/Media.8.0.1.js"></script>
60-
<script src="_content/nkast.Wasm.XHR/js/XHR.8.0.1.js"></script>
61-
<script src="_content/nkast.Wasm.Canvas/js/Canvas.8.0.1.js"></script>
62-
<script src="_content/nkast.Wasm.Canvas/js/CanvasGLContext.8.0.1.js"></script>
63-
<script src="_content/nkast.Wasm.Audio/js/Audio.8.0.1.js"></script>
55+
<script src="_content/nkast.Wasm.JSInterop/js/JSObject.8.0.11.js"></script>
56+
<script src="_content/nkast.Wasm.Dom/js/Window.8.0.11.js"></script>
57+
<script src="_content/nkast.Wasm.Dom/js/Document.8.0.11.js"></script>
58+
<script src="_content/nkast.Wasm.Dom/js/Navigator.8.0.11.js"></script>
59+
<script src="_content/nkast.Wasm.Dom/js/Gamepad.8.0.11.js"></script>
60+
<script src="_content/nkast.Wasm.Dom/js/Media.8.0.11.js"></script>
61+
<script src="_content/nkast.Wasm.XHR/js/XHR.8.0.11.js"></script>
62+
<script src="_content/nkast.Wasm.Canvas/js/Canvas.8.0.11.js"></script>
63+
<script src="_content/nkast.Wasm.Canvas/js/CanvasGLContext.8.0.11.js"></script>
64+
<script src="_content/nkast.Wasm.Audio/js/Audio.8.0.11.js"></script>
65+
<script src="_content/nkast.Wasm.XR/js/XR.8.0.11.js"></script>
6466

6567
<script>
6668
function tickJS() {

DeveMazeGeneratorCore.MonoGame.Core/DeveMazeGeneratorCore.MonoGame.Core.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>net8.0</TargetFramework>
44
<Platforms>AnyCPU;x64</Platforms>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.1.303">
7+
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.4.1">
88
<PrivateAssets>All</PrivateAssets>
99
</PackageReference>
10-
<PackageReference Include="System.Text.Json" Version="8.0.4" />
10+
<PackageReference Include="System.Text.Json" Version="10.0.0" />
1111
</ItemGroup>
1212
<ItemGroup>
1313
<ProjectReference Include="..\DeveMazeGeneratorCore\DeveMazeGeneratorCore.csproj" />

DeveMazeGeneratorCore.MonoGame.DesktopGL/DeveMazeGeneratorCore.MonoGame.DesktopGL.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
</MonoGameContentReference>
1919
</ItemGroup>
2020
<ItemGroup>
21-
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.1.303" />
22-
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.1.303" />
21+
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.4.1" />
22+
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.4.1" />
2323
</ItemGroup>
2424
<ItemGroup>
2525
<TrimmerRootAssembly Include="Microsoft.Xna.Framework.Content.ContentTypeReader" Visible="false" />

DeveMazeGeneratorCore.MonoGame.WindowsDX/DeveMazeGeneratorCore.MonoGame.WindowsDX.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
<TrimmerRootAssembly Include="Microsoft.Xna.Framework.Content.ContentTypeReader" Visible="false" />
1919
</ItemGroup>
2020
<ItemGroup>
21-
<PackageReference Include="MonoGame.Framework.WindowsDX" Version="3.8.1.303" />
22-
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.1.303" />
21+
<PackageReference Include="MonoGame.Framework.WindowsDX" Version="3.8.4.1" />
22+
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.4.1" />
2323
</ItemGroup>
2424
<ItemGroup>
2525
<ProjectReference Include="..\DeveMazeGeneratorCore.MonoGame.Core\DeveMazeGeneratorCore.MonoGame.Core.csproj" />

MigrationGuide/migrate_37.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Migrating from 3.7
2+
3+
Previously MonoGame installed on your machine through an installer, but from 3.8 onwards everything is installed through NuGet packages and Visual Studio Extensions.
4+
5+
> **Note** MonoGame 3.8 project templates are not compatible with earlier versions of MonoGame. If you wish to work on or build older MonoGame projects, then you will still need to install [MonoGame 3.7.1](https://www.monogame.net/downloads/) or earlier to open them.
6+
7+
## WindowsDX and DesktopGL
8+
9+
WindowsDX and DesktopGL templates now use SDK-style projects.
10+
To migrate old projects we recommend creating a new project with the 3.8+ templates and copying the csproj to your project folder. Make sure you back up your old project.
11+
12+
> For more information about SDK-style projects see the [documentation](https://docs.microsoft.com/en-us/dotnet/core/tools/csproj).
13+
14+
## Other Platforms
15+
16+
To migrate open up your project file in a text editor.
17+
The reference to the MonoGame assembly looks like this:
18+
19+
```xml
20+
</ItemGroup>
21+
<Reference Include="MonoGame.Framework">
22+
<HintPath>$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\{Platform}\MonoGame.Framework.dll</HintPath>
23+
</Reference>
24+
</ItemGroup>
25+
```
26+
27+
The task to build your content is imported at the end of the project file like this:
28+
29+
```xml
30+
<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" />
31+
```
32+
33+
You can remove these references and add a reference to the MonoGame NuGet packages instead.
34+
35+
```xml
36+
<ItemGroup>
37+
<PackageReference Include="MonoGame.Framework.{Platform}" Version="3.8.1" />
38+
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.1" />
39+
</ItemGroup>
40+
```
41+
42+
## Tooling
43+
44+
MonoGame tools (MGCB, 2MGFX, and the Pipeline Tool) are now distributed as [.NET Tools](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools) automatically when using any of the MonoGame 3.8.1 templates.
45+
46+
The templates also build your .mgcb files automatically thanks to the `MonoGame.Content.Builder.Task` NuGet package.
47+
48+
The Pipeline Tool has been renamed MonoGame Content Builder Editor (MGCB Editor) and does not require an installation anymore (providing that you are using the MonoGame 3.8.1 templates). The Visual Studio 2022 extensions make .mgcb files within your solution clickable and will open the MGCB Editor on them.

MigrationGuide/migrate_38.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Migrating from 3.8.0
2+
3+
Migrating from 3.8.0 should be straightforward for most platforms.
4+
5+
The major difference is that 3.8.1 now requires .NET 6 and Visual Studio 2022. You can follow the [environment setup tutorial](./getting_started/0_getting_started.md) to make sure that you are not missing any components.
6+
7+
The MGCB Editor is no longer a global .NET tool and we recommend that you use the new Visual Studio 2022 extension which helps accessing it without the need of CLI commands.
8+
9+
## WindowsDX, DesktopGL, and UWP
10+
11+
Upgrading from 3.8.0 should be as straightforward as upgrading your ```TargetFramework``` and MonoGame version.
12+
13+
Edit your csproj file to change your ```TargetFramework```:
14+
15+
```xml
16+
<TargetFramework>net6.0</TargetFramework>
17+
```
18+
19+
Then edit your MonoGame ```PackageReference``` to point to 3.8.1:
20+
21+
```xml
22+
<PackageReference Include="MonoGame.Framework.{Platform}" Version="3.8.1.*" />
23+
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.1.*" />
24+
```
25+
26+
### Accessing MGCB and MCGB Editor without a global tool
27+
28+
MGCB Editor is no longer a .NET global tool, and doesn't need to be installed or registered.
29+
30+
However, if you are migrating from 3.8.0, you will need to setup a configuration file. Next to your ```.csproj```, create a folder nammed ```.config``` and a file within it nammed ```dotnet-tools.json``` with this content:
31+
32+
```json
33+
{
34+
"version": 1,
35+
"isRoot": true,
36+
"tools": {
37+
"dotnet-mgcb": {
38+
"version": "3.8.1.263",
39+
"commands": [
40+
"mgcb"
41+
]
42+
},
43+
"dotnet-mgcb-editor": {
44+
"version": "3.8.1.263",
45+
"commands": [
46+
"mgcb-editor"
47+
]
48+
},
49+
"dotnet-mgcb-editor-linux": {
50+
"version": "3.8.1.263",
51+
"commands": [
52+
"mgcb-editor-linux"
53+
]
54+
},
55+
"dotnet-mgcb-editor-windows": {
56+
"version": "3.8.1.263",
57+
"commands": [
58+
"mgcb-editor-windows"
59+
]
60+
},
61+
"dotnet-mgcb-editor-mac": {
62+
"version": "3.8.1.263",
63+
"commands": [
64+
"mgcb-editor-mac"
65+
]
66+
}
67+
}
68+
}
69+
```
70+
71+
Please note that you can't use the ```3.8.1.*``` wildcard in the ```dotnet-tools.json``` file (tool versions have to be fully qualified). We strongly recommand that the versions match the MonoGame version referenced in your ```.csproj``` (if you're using the ```*``` wildcard, make sure that they don't end up mismatching if the nugets are updated without you noticing).
72+
73+
You will also need to add this to your ```.csproj```:
74+
75+
```xml
76+
<Target Name="RestoreDotnetTools" BeforeTargets="Restore">
77+
<Message Text="Restoring dotnet tools" Importance="High" />
78+
<Exec Command="dotnet tool restore" />
79+
</Target>
80+
```
81+
82+
With these changes, .NET will automatically install the MGCB Editor for you when launching Visual Studio 2022 (if you want to install it manually and skip adding the Target, run ```dotnet tool restore``` within the project directory).
83+
84+
Then, if you installed the Visual Studio extension, you should also be able to just double-click an ```.mgcb``` file to open the MGCB Editor. You can also open the MGCB Editor with the CLI via ```dotnet mgcb-editor``` when executed from within the project directory.
85+
86+
This new configuration has the advantage of allowing to have per-project versions of MGCB and its Editor (instead of per-machine like a global tool).
87+
88+
## iOS/iPadOS, and Android
89+
90+
.NET 6 introduced breaking changes in how csproj are defined for iOS/iPadOS and Android. We recommand that you create new projects using the 3.8.1 templates and that you copy over your project files there.

0 commit comments

Comments
 (0)