add js save dialog
This commit is contained in:
@@ -19,6 +19,8 @@ std::string win32_clipboard_get_text();
|
||||
#include <tinyfiledialogs.h>
|
||||
#elif __WEB__
|
||||
void webgl_pick_file(std::function<void(std::string)> callback);
|
||||
void webgl_pick_file_save(const std::string& path,
|
||||
const std::string& name, std::function<void(bool)> callback);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -235,8 +237,18 @@ void App::pick_file_save(const std::string& type, std::function<void(std::string
|
||||
mb->destroy();
|
||||
};
|
||||
}
|
||||
#elif __WEB__
|
||||
void App::pick_file_save(const std::string& type, std::function<void(std::string)> writer,
|
||||
std::function<void(bool saved)> callback)
|
||||
{
|
||||
redraw = true;
|
||||
auto path = data_path + "/file-save." + type;
|
||||
LOG("App::pick_file_save %s", path.c_str());
|
||||
writer(path);
|
||||
webgl_pick_file_save(path, "file." + type, callback);
|
||||
}
|
||||
#else
|
||||
void App::pick_file_save(std::vector<std::string> types, std::function<void (std::string)> callback)
|
||||
void App::pick_file_save(std::vector<std::string> types, std::function<void(std::string)> callback)
|
||||
{
|
||||
redraw = true;
|
||||
#if __OSX__
|
||||
|
||||
Reference in New Issue
Block a user