summaryrefslogtreecommitdiffstats
path: root/editor/project_settings_editor.cpp
diff options
context:
space:
mode:
authorEric M <itsjusteza@gmail.com>2023-01-13 21:36:44 +1000
committerEric M <itsjusteza@gmail.com>2023-01-13 21:48:43 +1000
commit7c73b6c71cad819cd7c53c8ccf14f7e909203c0d (patch)
treeb7576b8970eacd19681730a8fdd605935472c0d6 /editor/project_settings_editor.cpp
parent3c9bf4bc210a8e6a208f30ca59de4d4d7e18c04d (diff)
downloadredot-engine-7c73b6c71cad819cd7c53c8ccf14f7e909203c0d.tar.gz
Fix Project Settings array/dicts initial value being shared instances of the current value.
Diffstat (limited to 'editor/project_settings_editor.cpp')
-rw-r--r--editor/project_settings_editor.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index 69c21177f9..7ef8bfcf6a 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -370,17 +370,7 @@ void ProjectSettingsEditor::_action_edited(const String &p_name, const Dictionar
} else {
// Events changed
- int act_event_count = ((Array)p_action["events"]).size();
- int old_event_count = ((Array)old_val["events"]).size();
-
- if (act_event_count == old_event_count) {
- undo_redo->create_action(TTR("Edit Input Action Event"));
- } else if (act_event_count > old_event_count) {
- undo_redo->create_action(TTR("Add Input Action Event"));
- } else {
- undo_redo->create_action(TTR("Remove Input Action Event"));
- }
-
+ undo_redo->create_action(TTR("Change Input Action Event(s)"));
undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", property_name, p_action);
undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", property_name, old_val);
}
@@ -527,6 +517,8 @@ void ProjectSettingsEditor::_update_action_map_editor() {
if (is_builtin_input) {
action_info.editable = false;
action_info.icon = builtin_icon;
+ action_info.has_initial = true;
+ action_info.action_initial = ProjectSettings::get_singleton()->property_get_revert(property_name);
}
actions.push_back(action_info);