Skip to content

Commit

Permalink
Remove "Open Anyway" when opening model
Browse files Browse the repository at this point in the history
  • Loading branch information
KoBeWi committed Oct 17, 2024
1 parent 04692d8 commit b01017a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
12 changes: 5 additions & 7 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3935,10 +3935,10 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b
}
}

if (!p_force_open_imported && FileAccess::exists(p_scene + ".import")) {
if (!p_force_open_imported && FileAccess::exists(p_scene + ".import")) { // TODO: p_force_open_imported can be removed.
open_imported->set_text(vformat(TTR("Scene '%s' was automatically imported, so it can't be modified.\nTo make changes to it, a new inherited scene can be created."), p_scene.get_file()));
open_imported->popup_centered();
new_inherited_button->grab_focus();
open_imported->get_ok_button()->grab_focus();
open_import_request = p_scene;
return OK;
}
Expand Down Expand Up @@ -6431,7 +6431,7 @@ bool EditorNode::call_build() {
return builds_successful;
}

void EditorNode::_inherit_imported(const String &p_action) {
void EditorNode::_inherit_imported() {
open_imported->hide();
load_scene(open_import_request, true, true);
}
Expand Down Expand Up @@ -7822,10 +7822,8 @@ EditorNode::EditorNode() {
set_process(true);

open_imported = memnew(ConfirmationDialog);
open_imported->set_ok_button_text(TTR("Open Anyway"));
new_inherited_button = open_imported->add_button(TTR("New Inherited"), !DisplayServer::get_singleton()->get_swap_cancel_ok(), "inherit");
open_imported->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_open_imported));
open_imported->connect("custom_action", callable_mp(this, &EditorNode::_inherit_imported));
open_imported->set_ok_button_text(TTR("New Inherited"));
open_imported->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_inherit_imported));
gui_base->add_child(open_imported);

quick_open_dialog = memnew(EditorQuickOpenDialog);
Expand Down
3 changes: 1 addition & 2 deletions editor/editor_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ class EditorNode : public Node {
DependencyEditor *dependency_fixer = nullptr;
OrphanResourcesDialog *orphan_resources = nullptr;
ConfirmationDialog *open_imported = nullptr;
Button *new_inherited_button = nullptr;
String open_import_request;

EditorDockManager *editor_dock_manager = nullptr;
Expand Down Expand Up @@ -635,7 +634,7 @@ class EditorNode : public Node {

void _toggle_distraction_free_mode();

void _inherit_imported(const String &p_action);
void _inherit_imported();
void _open_imported();

void _update_update_spinner();
Expand Down

0 comments on commit b01017a

Please sign in to comment.