summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_export.cpp5
-rw-r--r--editor/editor_export.h3
-rw-r--r--editor/project_export.cpp12
-rw-r--r--editor/project_export.h1
4 files changed, 18 insertions, 3 deletions
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index d2976808fe..8f6e28550f 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -75,11 +75,14 @@ bool EditorExportPreset::_get(const StringName &p_name, Variant &r_ret) const {
return false;
}
+
void EditorExportPreset::_get_property_list(List<PropertyInfo> *p_list) const {
for (const List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
- p_list->push_back(E->get());
+ if (platform->get_option_visibility(E->get().name, values)) {
+ p_list->push_back(E->get());
+ }
}
}
diff --git a/editor/editor_export.h b/editor/editor_export.h
index 1c9f5b3354..966c3cb63b 100644
--- a/editor/editor_export.h
+++ b/editor/editor_export.h
@@ -76,6 +76,7 @@ protected:
public:
Ref<EditorExportPlatform> get_platform() const;
+
bool has(const StringName &p_property) const { return values.has(p_property); }
Vector<String> get_files_to_export() const;
@@ -170,6 +171,8 @@ public:
virtual Ref<EditorExportPreset> create_preset();
virtual void get_export_options(List<ExportOption> *r_options) = 0;
+ virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const { return true; }
+
virtual String get_name() const = 0;
virtual Ref<Texture> get_logo() const = 0;
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index 015031a1ee..12c6ea6c51 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -229,12 +229,12 @@ void ProjectExportDialog::_edit_preset(int p_index) {
if (needs_templates)
export_templates_error->show();
- get_ok()->set_disabled(true);
+ export_button->set_disabled(true);
} else {
export_error->show();
export_templates_error->hide();
- get_ok()->set_disabled(false);
+ export_button->set_disabled(false);
}
updating = false;
@@ -313,6 +313,12 @@ void ProjectExportDialog::_patch_deleted() {
}
}
+void ProjectExportDialog::_update_parameters(const String &p_edited_property) {
+
+ _edit_preset(presets->get_current());
+ parameters->update_tree();
+}
+
void ProjectExportDialog::_runnable_pressed() {
if (updating)
@@ -676,6 +682,7 @@ void ProjectExportDialog::_bind_methods() {
ClassDB::bind_method("_add_preset", &ProjectExportDialog::_add_preset);
ClassDB::bind_method("_edit_preset", &ProjectExportDialog::_edit_preset);
+ ClassDB::bind_method("_update_parameters", &ProjectExportDialog::_update_parameters);
ClassDB::bind_method("_runnable_pressed", &ProjectExportDialog::_runnable_pressed);
ClassDB::bind_method("_name_changed", &ProjectExportDialog::_name_changed);
ClassDB::bind_method("_delete_preset", &ProjectExportDialog::_delete_preset);
@@ -753,6 +760,7 @@ ProjectExportDialog::ProjectExportDialog() {
parameters->hide_top_label();
parameters->set_v_size_flags(SIZE_EXPAND_FILL);
parameters->set_hide_script(true);
+ parameters->connect("property_edited", this, "_update_parameters");
VBoxContainer *resources_vb = memnew(VBoxContainer);
sections->add_child(resources_vb);
diff --git a/editor/project_export.h b/editor/project_export.h
index 0dc59a09e2..485222ef03 100644
--- a/editor/project_export.h
+++ b/editor/project_export.h
@@ -97,6 +97,7 @@ private:
void _patch_deleted();
void _runnable_pressed();
+ void _update_parameters(const String &p_edited_property);
void _name_changed(const String &p_string);
void _add_preset(int p_platform);
void _edit_preset(int p_index);