Route UI state save through platform services
This commit is contained in:
@@ -207,6 +207,7 @@ public:
|
||||
void publish_exported_image(std::string path);
|
||||
void flush_platform_storage();
|
||||
[[nodiscard]] std::vector<std::string> document_browse_roots() const;
|
||||
void save_platform_ui_state();
|
||||
[[nodiscard]] bool platform_enables_live_asset_reloading();
|
||||
void update_platform_frame(float delta_time_seconds);
|
||||
void report_rendered_frames(int frames);
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
|
||||
#ifdef __QUEST__
|
||||
#include "oculus_vr.h"
|
||||
#elif __WEB__
|
||||
void webgl_pick_file(std::function<void(std::string)> callback);
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -292,6 +292,11 @@ std::vector<std::string> App::document_browse_roots() const
|
||||
return active_platform_services().document_browse_roots(work_path, data_path);
|
||||
}
|
||||
|
||||
void App::save_platform_ui_state()
|
||||
{
|
||||
active_platform_services().save_ui_state();
|
||||
}
|
||||
|
||||
bool App::platform_enables_live_asset_reloading()
|
||||
{
|
||||
return active_platform_services().enables_live_asset_reloading();
|
||||
|
||||
@@ -1679,13 +1679,7 @@ void App::ui_save()
|
||||
|
||||
Settings::set("ui", d);
|
||||
Settings::set("ui-rtl", Serializer::Boolean(ui_rtl));
|
||||
|
||||
#if _WIN32
|
||||
extern void win32_save_window_state();
|
||||
win32_save_window_state();
|
||||
#elif __OSX__
|
||||
[osx_app save_ui_state];
|
||||
#endif
|
||||
save_platform_ui_state();
|
||||
|
||||
Settings::save();
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ public:
|
||||
[[nodiscard]] virtual std::vector<std::string> document_browse_roots(
|
||||
std::string_view work_path,
|
||||
std::string_view data_path) = 0;
|
||||
virtual void save_ui_state() = 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;
|
||||
|
||||
@@ -313,6 +313,13 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
void save_ui_state() override
|
||||
{
|
||||
#ifdef __OSX__
|
||||
[App::I->osx_app save_ui_state];
|
||||
#endif
|
||||
}
|
||||
|
||||
[[nodiscard]] bool enables_live_asset_reloading() override
|
||||
{
|
||||
#if defined(__OSX__)
|
||||
|
||||
@@ -19,6 +19,7 @@ void win32_renderdoc_frame_start();
|
||||
void win32_renderdoc_frame_end();
|
||||
void win32_update_fps(int frames);
|
||||
void win32_update_stylus(float dt);
|
||||
void win32_save_window_state();
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -386,6 +387,11 @@ public:
|
||||
return { std::string(work_path) };
|
||||
}
|
||||
|
||||
void save_ui_state() override
|
||||
{
|
||||
win32_save_window_state();
|
||||
}
|
||||
|
||||
[[nodiscard]] bool enables_live_asset_reloading() override
|
||||
{
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user