mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-10-24 07:15:51 +00:00
feat: add bind for loading fastfiles to ModMan
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "Binds.h"
|
||||
|
||||
#include "FastFileBinds.h"
|
||||
#include "Web/Binds/DialogBinds.h"
|
||||
|
||||
namespace ui
|
||||
@@ -7,5 +8,6 @@ namespace ui
|
||||
void RegisterAllBinds(webview::webview& wv)
|
||||
{
|
||||
RegisterDialogHandlerBinds(wv);
|
||||
RegisterFastFileBinds(wv);
|
||||
}
|
||||
} // namespace ui
|
||||
|
||||
28
src/ModMan/Web/Binds/FastFileBinds.cpp
Normal file
28
src/ModMan/Web/Binds/FastFileBinds.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#include "FastFileBinds.h"
|
||||
|
||||
#include "Context/ModManContext.h"
|
||||
#include "Web/UiCommunication.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
namespace ui
|
||||
{
|
||||
void RegisterFastFileBinds(webview::webview& wv)
|
||||
{
|
||||
BindAsync<std::string>(wv,
|
||||
"loadFastFile",
|
||||
[&wv](const std::string& id, std::string path)
|
||||
{
|
||||
std::string idMove(id);
|
||||
ModManContext::Get().m_db_thread.Dispatch(
|
||||
[&wv, idMove, path]
|
||||
{
|
||||
ModManContext::Get().m_fast_file.LoadFastFile(path);
|
||||
PromiseResolve(wv, idMove, true);
|
||||
});
|
||||
});
|
||||
}
|
||||
} // namespace ui
|
||||
8
src/ModMan/Web/Binds/FastFileBinds.h
Normal file
8
src/ModMan/Web/Binds/FastFileBinds.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "Web/WebViewLib.h"
|
||||
|
||||
namespace ui
|
||||
{
|
||||
void RegisterFastFileBinds(webview::webview& wv);
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#define NOMINMAX
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push, 0)
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user