mirror of
https://github.com/4sval/FModel.git
synced 2026-03-21 17:24:26 -05:00
fixed use of obsolete methods
This commit is contained in:
parent
7bfadc4e20
commit
4c790af232
|
|
@ -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"; }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user