mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 05:31:01 +00:00 
			
		
		
		
	Merge pull request #100120 from allenwp/make-editor-shortcuts-global
Force fixed undo history to make editor shortcuts use global history.
This commit is contained in:
		
						commit
						91dc363dca
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -349,7 +349,10 @@ void EditorSettingsDialog::_update_shortcut_events(const String &p_path, const A | ||||||
| 	Ref<Shortcut> current_sc = EditorSettings::get_singleton()->get_shortcut(p_path); | 	Ref<Shortcut> current_sc = EditorSettings::get_singleton()->get_shortcut(p_path); | ||||||
| 
 | 
 | ||||||
| 	EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton(); | 	EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton(); | ||||||
| 	undo_redo->create_action(vformat(TTR("Edit Shortcut: %s"), p_path)); | 	undo_redo->create_action(vformat(TTR("Edit Shortcut: %s"), p_path), UndoRedo::MERGE_DISABLE, EditorSettings::get_singleton()); | ||||||
|  | 	// History must be fixed based on the EditorSettings object because current_sc would
 | ||||||
|  | 	// incorrectly make this action use the scene history.
 | ||||||
|  | 	undo_redo->force_fixed_history(); | ||||||
| 	undo_redo->add_do_method(current_sc.ptr(), "set_events", p_events); | 	undo_redo->add_do_method(current_sc.ptr(), "set_events", p_events); | ||||||
| 	undo_redo->add_undo_method(current_sc.ptr(), "set_events", current_sc->get_events()); | 	undo_redo->add_undo_method(current_sc.ptr(), "set_events", current_sc->get_events()); | ||||||
| 	undo_redo->add_do_method(EditorSettings::get_singleton(), "mark_setting_changed", "shortcuts"); | 	undo_redo->add_do_method(EditorSettings::get_singleton(), "mark_setting_changed", "shortcuts"); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Thaddeus Crews
						Thaddeus Crews