Initial commit of new UI c# component
This commit is contained in:
47
Il2CppInspector.Redux.GUI/Il2CppHub.cs
Normal file
47
Il2CppInspector.Redux.GUI/Il2CppHub.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
|
||||
namespace Il2CppInspector.Redux.GUI;
|
||||
|
||||
internal class Il2CppHub : Hub
|
||||
{
|
||||
public UiContext State
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!Context.Items.TryGetValue("context", out var context)
|
||||
|| context is not UiContext ctx)
|
||||
{
|
||||
Context.Items["context"] = ctx = new UiContext();
|
||||
}
|
||||
|
||||
return ctx;
|
||||
}
|
||||
}
|
||||
|
||||
public UiClient Client => new(Clients.Caller);
|
||||
|
||||
public async Task OnUiLaunched()
|
||||
{
|
||||
await State.Initialize(Client);
|
||||
}
|
||||
|
||||
public async Task SubmitInputFiles(List<string> inputFiles)
|
||||
{
|
||||
await State.LoadInputFiles(Client, inputFiles);
|
||||
}
|
||||
|
||||
public async Task QueueExport(string exportTypeId, string outputDirectory, Dictionary<string, string> settings)
|
||||
{
|
||||
await State.QueueExport(Client, exportTypeId, outputDirectory, settings);
|
||||
}
|
||||
|
||||
public async Task StartExport()
|
||||
{
|
||||
await State.StartExport(Client);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<string>> GetPotentialUnityVersions()
|
||||
{
|
||||
return await State.GetPotentialUnityVersions();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user