fixed use of obsolete methods

This commit is contained in:
Asval 2025-02-16 00:20:28 +01:00
parent 7bfadc4e20
commit 4c790af232
6 changed files with 14 additions and 8 deletions

View File

@ -1,13 +1,19 @@
using RestSharp;
using RestSharp.Interceptors;
namespace FModel.ViewModels.ApiEndpoints;
public abstract class AbstractApiProvider
{
protected readonly RestClient _client;
protected readonly Interceptor _interceptor;
protected AbstractApiProvider(RestClient client)
{
_client = client;
_interceptor = new CompatibilityInterceptor
{
OnBeforeDeserialization = resp => { resp.ContentType = "application/json; charset=utf-8"; }
};
}
}

View File

@ -66,7 +66,7 @@ public class DynamicApiEndpoint : AbstractApiProvider
{
var request = new FRestRequest(url)
{
OnBeforeDeserialization = resp => { resp.ContentType = "application/json; charset=utf-8"; }
Interceptors = [_interceptor]
};
var response = await _client.ExecuteAsync(request, token).ConfigureAwait(false);
Log.Information("[{Method}] [{Status}({StatusCode})] '{Resource}'", request.Method, response.StatusDescription, (int) response.StatusCode, response.ResponseUri?.OriginalString);

View File

@ -15,7 +15,7 @@ public class FortniteCentralApiEndpoint : AbstractApiProvider
{
var request = new FRestRequest("https://fortnitecentral.genxgames.gg/api/v1/hotfixes")
{
OnBeforeDeserialization = resp => { resp.ContentType = "application/json; charset=utf-8"; }
Interceptors = [_interceptor]
};
request.AddParameter("lang", language);
var response = await _client.ExecuteAsync<Dictionary<string, Dictionary<string, string>>>(request, token).ConfigureAwait(false);

View File

@ -153,7 +153,7 @@ public class SkeletalModel : UModel
GL.Disable(EnableCap.DepthTest);
GL.Disable(EnableCap.CullFace);
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Line);
GL.PolygonMode(TriangleFace.FrontAndBack, PolygonMode.Line);
foreach (var collision in Collisions)
{
var boneMatrix = Matrix4x4.Identity;
@ -162,7 +162,7 @@ public class SkeletalModel : UModel
collision.Render(shader, boneMatrix);
}
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
GL.PolygonMode(TriangleFace.FrontAndBack, PolygonMode.Fill);
GL.Enable(EnableCap.CullFace);
GL.Enable(EnableCap.DepthTest);
}

View File

@ -148,12 +148,12 @@ public class StaticModel : UModel
base.RenderCollision(shader);
GL.Disable(EnableCap.CullFace);
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Line);
GL.PolygonMode(TriangleFace.FrontAndBack, PolygonMode.Line);
foreach (var collision in Collisions)
{
collision.Render(shader, Matrix4x4.Identity);
}
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
GL.PolygonMode(TriangleFace.FrontAndBack, PolygonMode.Fill);
GL.Enable(EnableCap.CullFace);
}
}

View File

@ -255,7 +255,7 @@ public abstract class UModel : IRenderableModel
}
Vao.Bind();
GL.PolygonMode(MaterialFace.FrontAndBack, ShowWireframe ? PolygonMode.Line : PolygonMode.Fill);
GL.PolygonMode(TriangleFace.FrontAndBack, ShowWireframe ? PolygonMode.Line : PolygonMode.Fill);
foreach (var section in Sections)
{
if (!section.Show) continue;
@ -275,7 +275,7 @@ public abstract class UModel : IRenderableModel
GL.DrawElementsInstanced(PrimitiveType.Triangles, section.FacesCount, DrawElementsType.UnsignedInt, section.FirstFaceIndexPtr, TransformsCount);
}
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
GL.PolygonMode(TriangleFace.FrontAndBack, PolygonMode.Fill);
Vao.Unbind();
if (IsSelected)