Route document browse roots through platform services
This commit is contained in:
@@ -206,6 +206,7 @@ public:
|
||||
void clear_platform_recorded_files(std::string path);
|
||||
void publish_exported_image(std::string path);
|
||||
void flush_platform_storage();
|
||||
[[nodiscard]] std::vector<std::string> document_browse_roots() const;
|
||||
[[nodiscard]] bool platform_enables_live_asset_reloading();
|
||||
void update_platform_frame(float delta_time_seconds);
|
||||
void report_rendered_frames(int frames);
|
||||
|
||||
@@ -238,11 +238,7 @@ void App::dialog_browse()
|
||||
// load thumbnail test
|
||||
auto dialog = std::make_shared<NodeDialogBrowse>();
|
||||
dialog->set_manager(&layout);
|
||||
#ifdef __IOS__
|
||||
dialog->search_paths = {work_path, data_path + "/Inbox"};
|
||||
#else
|
||||
dialog->search_paths = {work_path};
|
||||
#endif
|
||||
dialog->search_paths = document_browse_roots();
|
||||
dialog->init();
|
||||
dialog->create();
|
||||
dialog->loaded();
|
||||
|
||||
@@ -287,6 +287,11 @@ void App::flush_platform_storage()
|
||||
active_platform_services().flush_persistent_storage();
|
||||
}
|
||||
|
||||
std::vector<std::string> App::document_browse_roots() const
|
||||
{
|
||||
return active_platform_services().document_browse_roots(work_path, data_path);
|
||||
}
|
||||
|
||||
bool App::platform_enables_live_asset_reloading()
|
||||
{
|
||||
return active_platform_services().enables_live_asset_reloading();
|
||||
|
||||
@@ -43,6 +43,9 @@ public:
|
||||
virtual void clear_recorded_files(std::string_view recording_path) = 0;
|
||||
virtual void publish_exported_image(std::string_view path) = 0;
|
||||
virtual void flush_persistent_storage() = 0;
|
||||
[[nodiscard]] virtual std::vector<std::string> document_browse_roots(
|
||||
std::string_view work_path,
|
||||
std::string_view data_path) = 0;
|
||||
[[nodiscard]] virtual bool enables_live_asset_reloading() = 0;
|
||||
virtual void update_platform_frame(float delta_time_seconds) = 0;
|
||||
virtual void report_rendered_frames(int frames) = 0;
|
||||
|
||||
@@ -298,6 +298,21 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
[[nodiscard]] std::vector<std::string> document_browse_roots(
|
||||
std::string_view work_path,
|
||||
std::string_view data_path) override
|
||||
{
|
||||
#ifdef __IOS__
|
||||
return {
|
||||
std::string(work_path),
|
||||
std::string(data_path) + "/Inbox",
|
||||
};
|
||||
#else
|
||||
(void)data_path;
|
||||
return { std::string(work_path) };
|
||||
#endif
|
||||
}
|
||||
|
||||
[[nodiscard]] bool enables_live_asset_reloading() override
|
||||
{
|
||||
#if defined(__OSX__)
|
||||
|
||||
@@ -378,6 +378,14 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
[[nodiscard]] std::vector<std::string> document_browse_roots(
|
||||
std::string_view work_path,
|
||||
std::string_view data_path) override
|
||||
{
|
||||
(void)data_path;
|
||||
return { std::string(work_path) };
|
||||
}
|
||||
|
||||
[[nodiscard]] bool enables_live_asset_reloading() override
|
||||
{
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user