1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-25 05:58:35 +01:00

Compare commits

..

4 commits

6 changed files with 47 additions and 12 deletions

View file

@ -17,10 +17,18 @@ Additions
Improvements
- Generify GenericFont's string drawing
Fixes
- Fixed StaticSpriteBatch handling rotated sprites incorrectly
### MLEM.Ui
Improvements
- Allow for checkboxes and radio buttons to be disabled
### MLEM.Data
Improvements
- Rethrow exceptions when no RawContentManager readers could be constructed
- Make Newtonsoft.Json dependency optional
## 5.2.0
### MLEM
Additions

View file

@ -99,6 +99,7 @@ namespace MLEM.Data.Content {
private static List<RawContentReader> CollectContentReaders() {
var ret = new List<RawContentReader>();
var assemblyExceptions = new List<Exception>();
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) {
try {
if (assembly.IsDynamic)
@ -114,10 +115,12 @@ namespace MLEM.Data.Content {
throw new NotSupportedException($"The type {type} cannot be constructed by a RawContentManager. Does it have a visible parameterless constructor?", e);
}
}
} catch {
// ignored
} catch (Exception e) {
assemblyExceptions.Add(e);
}
}
if (ret.Count <= 0)
throw new AggregateException("Failed to construct any RawContentReader instances", assemblyExceptions);
return ret;
}

View file

@ -19,13 +19,15 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<ProjectReference Include="..\MLEM\MLEM.csproj" />
<!--TODO remove lidgren support eventually (methods marked as obsolete since 5.2.0)-->
<PackageReference Include="Lidgren.Network" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json.Bson" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
</PackageReference>

View file

@ -367,18 +367,38 @@ namespace MLEM.Graphics {
private Item Add(Texture2D texture, Vector2 pos, Vector2 offset, Vector2 size, float sin, float cos, Color color, Vector2 texTl, Vector2 texBr, float depth) {
return this.Add(texture, depth,
new VertexPositionColorTexture(new Vector3(pos.X + offset.X * cos - offset.Y * sin, pos.Y + offset.X * sin + offset.Y * cos, depth), color, texTl),
new VertexPositionColorTexture(new Vector3(pos.X + (offset.X + size.X) * cos - offset.Y * sin, pos.Y + (offset.X + size.X) + offset.Y * cos, depth), color, new Vector2(texBr.X, texTl.Y)),
new VertexPositionColorTexture(new Vector3(pos.X + offset.X * cos - (offset.Y + size.Y) * sin, pos.Y + offset.X * sin + (offset.Y + size.Y) * cos, depth), color, new Vector2(texTl.X, texBr.Y)),
new VertexPositionColorTexture(new Vector3(pos.X + (offset.X + size.X) * cos - (offset.Y + size.Y) * sin, pos.Y + (offset.X + size.X) * sin + (offset.Y + size.Y) * cos, depth), color, texBr));
new VertexPositionColorTexture(new Vector3(
pos.X + offset.X * cos - offset.Y * sin,
pos.Y + offset.X * sin + offset.Y * cos, depth),
color, texTl),
new VertexPositionColorTexture(new Vector3(
pos.X + (offset.X + size.X) * cos - offset.Y * sin,
pos.Y + (offset.X + size.X) * sin + offset.Y * cos, depth),
color, new Vector2(texBr.X, texTl.Y)),
new VertexPositionColorTexture(new Vector3(
pos.X + offset.X * cos - (offset.Y + size.Y) * sin,
pos.Y + offset.X * sin + (offset.Y + size.Y) * cos, depth),
color, new Vector2(texTl.X, texBr.Y)),
new VertexPositionColorTexture(new Vector3(
pos.X + (offset.X + size.X) * cos - (offset.Y + size.Y) * sin,
pos.Y + (offset.X + size.X) * sin + (offset.Y + size.Y) * cos, depth),
color, texBr));
}
private Item Add(Texture2D texture, Vector2 pos, Vector2 size, Color color, Vector2 texTl, Vector2 texBr, float depth) {
return this.Add(texture, depth,
new VertexPositionColorTexture(new Vector3(pos, depth), color, texTl),
new VertexPositionColorTexture(new Vector3(pos.X + size.X, pos.Y, depth), color, new Vector2(texBr.X, texTl.Y)),
new VertexPositionColorTexture(new Vector3(pos.X, pos.Y + size.Y, depth), color, new Vector2(texTl.X, texBr.Y)),
new VertexPositionColorTexture(new Vector3(pos.X + size.X, pos.Y + size.Y, depth), color, texBr));
new VertexPositionColorTexture(
new Vector3(pos, depth),
color, texTl),
new VertexPositionColorTexture(
new Vector3(pos.X + size.X, pos.Y, depth),
color, new Vector2(texBr.X, texTl.Y)),
new VertexPositionColorTexture(
new Vector3(pos.X, pos.Y + size.Y, depth),
color, new Vector2(texTl.X, texBr.Y)),
new VertexPositionColorTexture(
new Vector3(pos.X + size.X, pos.Y + size.Y, depth),
color, texBr));
}
private Item Add(Texture2D texture, float depth, VertexPositionColorTexture tl, VertexPositionColorTexture tr, VertexPositionColorTexture bl, VertexPositionColorTexture br) {

View file

@ -19,6 +19,7 @@
<PackageReference Include="MonoGame.Extended.Tiled" Version="3.8.0" />
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.0.1641" />
<PackageReference Include="FontStashSharp.MonoGame" Version="1.0.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ItemGroup>

View file

@ -18,8 +18,9 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.0" />
<PackageReference Include="NunitXml.TestLogger" Version="3.0.117" />
</ItemGroup>