diff options
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r-- | editor/editor_node.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index a1998a1d7c..df1e8005ed 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -903,7 +903,7 @@ void EditorNode::_set_scene_metadata(const String &p_file, int p_idx) { } Error err = cf->save(path); - ERR_FAIL_COND(err != OK); + ERR_FAIL_COND_MSG(err != OK, "Cannot save config file to '" + path + "'."); } bool EditorNode::_find_and_save_resource(RES p_res, Map<RES, bool> &processed, int32_t flags) { @@ -2212,27 +2212,27 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { case EDIT_UNDO: { if (Input::get_singleton()->get_mouse_button_mask() & 0x7) { - log->add_message("Can't UNDO while mouse buttons are pressed."); + log->add_message("Can't undo while mouse buttons are pressed.", EditorLog::MSG_TYPE_EDITOR); } else { String action = editor_data.get_undo_redo().get_current_action_name(); if (!editor_data.get_undo_redo().undo()) { - log->add_message("There is nothing to UNDO."); + log->add_message("Nothing to undo.", EditorLog::MSG_TYPE_EDITOR); } else if (action != "") { - log->add_message("UNDO: " + action); + log->add_message("Undo: " + action, EditorLog::MSG_TYPE_EDITOR); } } } break; case EDIT_REDO: { if (Input::get_singleton()->get_mouse_button_mask() & 0x7) { - log->add_message("Can't REDO while mouse buttons are pressed."); + log->add_message("Can't redo while mouse buttons are pressed.", EditorLog::MSG_TYPE_EDITOR); } else { if (!editor_data.get_undo_redo().redo()) { - log->add_message("There is nothing to REDO."); + log->add_message("Nothing to redo.", EditorLog::MSG_TYPE_EDITOR); } else { String action = editor_data.get_undo_redo().get_current_action_name(); - log->add_message("REDO: " + action); + log->add_message("Redo: " + action, EditorLog::MSG_TYPE_EDITOR); } } } break; @@ -2519,7 +2519,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { bool was_visible = OS::get_singleton()->is_console_visible(); OS::get_singleton()->set_console_visible(!was_visible); - EditorSettings::get_singleton()->set_setting("interface/editor/hide_console_window", !was_visible); + EditorSettings::get_singleton()->set_setting("interface/editor/hide_console_window", was_visible); } break; case EDITOR_SCREENSHOT: { @@ -2597,7 +2597,7 @@ void EditorNode::_save_screenshot(NodePath p_path) { img->flip_y(); viewport->set_clear_mode(Viewport::CLEAR_MODE_ALWAYS); Error error = img->save_png(p_path); - ERR_FAIL_COND(error != OK); + ERR_FAIL_COND_MSG(error != OK, "Cannot save screenshot to file '" + p_path + "'."); } void EditorNode::_tool_menu_option(int p_idx) { @@ -3133,7 +3133,14 @@ void EditorNode::_clear_undo_history() { void EditorNode::set_current_scene(int p_idx) { + //Save the folding in case the scene gets reloaded. + if (editor_data.get_scene_path(p_idx) != "") + editor_folding.save_scene_folding(editor_data.get_edited_scene_root(p_idx), editor_data.get_scene_path(p_idx)); + if (editor_data.check_and_update_scene(p_idx)) { + if (editor_data.get_scene_path(p_idx) != "") + editor_folding.load_scene_folding(editor_data.get_edited_scene_root(p_idx), editor_data.get_scene_path(p_idx)); + call_deferred("_clear_undo_history"); } @@ -3676,7 +3683,7 @@ Ref<Texture> EditorNode::get_object_icon(const Object *p_object, const String &p } Ref<Texture> EditorNode::get_class_icon(const String &p_class, const String &p_fallback) const { - ERR_FAIL_COND_V(p_class.empty(), NULL); + ERR_FAIL_COND_V_MSG(p_class.empty(), NULL, "Class name cannot be empty."); if (gui_base->has_icon(p_class, "EditorIcons")) { return gui_base->get_icon(p_class, "EditorIcons"); |