mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-23 16:27:47 +01:00
Change Redrawing to be simpler and not use a queue or settings.
This commit is contained in:
parent
7540694050
commit
b08bf388cc
7 changed files with 182 additions and 428 deletions
|
|
@ -24,8 +24,7 @@ public class ModsController : WebApiController
|
|||
x.Data.Meta,
|
||||
BasePath = x.Data.BasePath.FullName,
|
||||
Files = x.Data.Resources.ModFiles.Select( fi => fi.FullName ),
|
||||
} )
|
||||
?? null;
|
||||
} );
|
||||
}
|
||||
|
||||
[Route( HttpVerbs.Post, "/mods" )]
|
||||
|
|
|
|||
|
|
@ -7,14 +7,13 @@ using Dalamud.Logging;
|
|||
using Lumina.Data;
|
||||
using Penumbra.GameData.ByteString;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Util;
|
||||
using Penumbra.Mods;
|
||||
|
||||
namespace Penumbra.Api;
|
||||
|
||||
public class PenumbraApi : IDisposable, IPenumbraApi
|
||||
{
|
||||
public int ApiVersion { get; } = 3;
|
||||
public int ApiVersion { get; } = 4;
|
||||
private Penumbra? _penumbra;
|
||||
private Lumina.GameData? _lumina;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,32 +4,31 @@ using EmbedIO.Routing;
|
|||
using EmbedIO.WebApi;
|
||||
using Penumbra.GameData.Enums;
|
||||
|
||||
namespace Penumbra.Api
|
||||
namespace Penumbra.Api;
|
||||
|
||||
public class RedrawController : WebApiController
|
||||
{
|
||||
public class RedrawController : WebApiController
|
||||
private readonly Penumbra _penumbra;
|
||||
|
||||
public RedrawController( Penumbra penumbra )
|
||||
=> _penumbra = penumbra;
|
||||
|
||||
[Route( HttpVerbs.Post, "/redraw" )]
|
||||
public async Task Redraw()
|
||||
{
|
||||
private readonly Penumbra _penumbra;
|
||||
var data = await HttpContext.GetRequestDataAsync< RedrawData >();
|
||||
_penumbra.Api.RedrawObject( data.Name, data.Type );
|
||||
}
|
||||
|
||||
public RedrawController( Penumbra penumbra )
|
||||
=> _penumbra = penumbra;
|
||||
[Route( HttpVerbs.Post, "/redrawAll" )]
|
||||
public void RedrawAll()
|
||||
{
|
||||
_penumbra.Api.RedrawAll( RedrawType.Redraw );
|
||||
}
|
||||
|
||||
[Route( HttpVerbs.Post, "/redraw" )]
|
||||
public async Task Redraw()
|
||||
{
|
||||
RedrawData data = await HttpContext.GetRequestDataAsync<RedrawData>();
|
||||
_penumbra.Api.RedrawObject( data.Name, data.Type );
|
||||
}
|
||||
|
||||
[Route( HttpVerbs.Post, "/redrawAll" )]
|
||||
public void RedrawAll()
|
||||
{
|
||||
_penumbra.Api.RedrawAll(RedrawType.WithoutSettings);
|
||||
}
|
||||
|
||||
public class RedrawData
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public RedrawType Type { get; set; } = RedrawType.WithSettings;
|
||||
}
|
||||
public class RedrawData
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public RedrawType Type { get; set; } = RedrawType.Redraw;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue