|
@@ -37,6 +37,7 @@ bool EditorExportPreset::_set(const StringName &p_name, const Variant &p_value)
|
|
|
EditorExport::singleton->save_presets();
|
|
|
if (update_visibility.has(p_name)) {
|
|
|
if (update_visibility[p_name]) {
|
|
|
+ update_value_overrides();
|
|
|
notify_property_list_changed();
|
|
|
}
|
|
|
return true;
|
|
@@ -46,6 +47,11 @@ bool EditorExportPreset::_set(const StringName &p_name, const Variant &p_value)
|
|
|
}
|
|
|
|
|
|
bool EditorExportPreset::_get(const StringName &p_name, Variant &r_ret) const {
|
|
|
+ if (value_overrides.has(p_name)) {
|
|
|
+ r_ret = value_overrides[p_name];
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
if (values.has(p_name)) {
|
|
|
r_ret = values[p_name];
|
|
|
return true;
|
|
@@ -59,6 +65,10 @@ void EditorExportPreset::_bind_methods() {
|
|
|
}
|
|
|
|
|
|
String EditorExportPreset::_get_property_warning(const StringName &p_name) const {
|
|
|
+ if (value_overrides.has(p_name)) {
|
|
|
+ return String();
|
|
|
+ }
|
|
|
+
|
|
|
String warning = platform->get_export_option_warning(this, p_name);
|
|
|
if (!warning.is_empty()) {
|
|
|
warning += "\n";
|
|
@@ -83,7 +93,7 @@ String EditorExportPreset::_get_property_warning(const StringName &p_name) const
|
|
|
|
|
|
void EditorExportPreset::_get_property_list(List<PropertyInfo> *p_list) const {
|
|
|
for (const KeyValue<StringName, PropertyInfo> &E : properties) {
|
|
|
- if (platform->get_export_option_visibility(this, E.key)) {
|
|
|
+ if (!value_overrides.has(E.key) && platform->get_export_option_visibility(this, E.key)) {
|
|
|
p_list->push_back(E.value);
|
|
|
}
|
|
|
}
|
|
@@ -119,6 +129,37 @@ void EditorExportPreset::update_files() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void EditorExportPreset::update_value_overrides() {
|
|
|
+ Vector<Ref<EditorExportPlugin>> export_plugins = EditorExport::get_singleton()->get_export_plugins();
|
|
|
+ HashMap<StringName, Variant> new_value_overrides;
|
|
|
+
|
|
|
+ value_overrides.clear();
|
|
|
+
|
|
|
+ for (int i = 0; i < export_plugins.size(); i++) {
|
|
|
+ if (!export_plugins[i]->supports_platform(platform)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ export_plugins.write[i]->set_export_preset(Ref<EditorExportPreset>(this));
|
|
|
+
|
|
|
+ Dictionary plugin_overrides = export_plugins[i]->_get_export_options_overrides(platform);
|
|
|
+ if (!plugin_overrides.is_empty()) {
|
|
|
+ Array keys = plugin_overrides.keys();
|
|
|
+ for (int x = 0; x < keys.size(); x++) {
|
|
|
+ StringName key = keys[x];
|
|
|
+ Variant value = plugin_overrides[key];
|
|
|
+ if (new_value_overrides.has(key) && new_value_overrides[key] != value) {
|
|
|
+ WARN_PRINT_ED(vformat("Editor export plugin '%s' overrides pre-existing export option override '%s' with new value.", export_plugins[i]->get_name(), key));
|
|
|
+ }
|
|
|
+ new_value_overrides[key] = value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ value_overrides = new_value_overrides;
|
|
|
+ notify_property_list_changed();
|
|
|
+}
|
|
|
+
|
|
|
Vector<String> EditorExportPreset::get_files_to_export() const {
|
|
|
Vector<String> files;
|
|
|
for (const String &E : selected_files) {
|