summaryrefslogtreecommitdiff
path: root/platform/javascript
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2019-10-11 13:47:28 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2019-10-23 10:59:03 +0200
commit53637e4b1c94ec69987d0c45e4472d464df8f022 (patch)
tree8eac8243e155c4a89587437ca672c9a06474349f /platform/javascript
parent2ae3631318522f12a8f6fb85834b56874a01efed (diff)
Improve EditorExportPlatform interface.
Convert all get_device* methods to get_option* and normalize their usage as icon, label, tooltip.
Diffstat (limited to 'platform/javascript')
-rw-r--r--platform/javascript/export/export.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp
index 4de98f7039..e49b1a7bb9 100644
--- a/platform/javascript/export/export.cpp
+++ b/platform/javascript/export/export.cpp
@@ -61,11 +61,11 @@ public:
virtual List<String> get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const;
virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0);
- virtual bool poll_devices();
- virtual int get_device_count() const;
- virtual String get_device_name(int p_device) const { return TTR("Run in Browser"); }
- virtual String get_device_info(int p_device) const { return TTR("Run exported HTML in the system's default browser."); }
- virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags);
+ virtual bool poll_export();
+ virtual int get_options_count() const;
+ virtual String get_options_name(int p_index) const { return p_index ? TTR("Stop HTTP Server") : TTR("Run in Browser"); }
+ virtual String get_option_tooltip(int p_index) const { return p_index ? TTR("Stop HTTP Server") : TTR("Run exported HTML in the system's default browser."); }
+ virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_option, int p_debug_flags);
virtual Ref<Texture> get_run_icon() const;
virtual void get_platform_features(List<String> *r_features) {
@@ -337,7 +337,7 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese
return OK;
}
-bool EditorExportPlatformJavaScript::poll_devices() {
+bool EditorExportPlatformJavaScript::poll_export() {
Ref<EditorExportPreset> preset;
@@ -355,12 +355,12 @@ bool EditorExportPlatformJavaScript::poll_devices() {
return runnable_when_last_polled != prev;
}
-int EditorExportPlatformJavaScript::get_device_count() const {
+int EditorExportPlatformJavaScript::get_options_count() const {
return runnable_when_last_polled;
}
-Error EditorExportPlatformJavaScript::run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags) {
+Error EditorExportPlatformJavaScript::run(const Ref<EditorExportPreset> &p_preset, int p_option, int p_debug_flags) {
String basepath = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmp_js_export");
String path = basepath + ".html";