summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUmang Kalra <umangkalra10@gmail.com>2022-08-16 22:57:28 +0530
committerUmang Kalra <umangkalra10@gmail.com>2022-08-20 22:53:07 +0530
commit7ef5dfcfc3e3fd208565906e19d87d4260bfb517 (patch)
treead831e0b8a17e834c154df5f136644ec037855f0
parent0c5f254956f0115e363ce08045dd178dc30b54f8 (diff)
Changed the title of change node type dialog
-rw-r--r--editor/create_dialog.cpp8
-rw-r--r--editor/create_dialog.h2
-rw-r--r--editor/scene_tree_dock.cpp3
-rw-r--r--modules/visual_script/editor/visual_script_editor.cpp2
4 files changed, 9 insertions, 6 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index e6168f4924..c84e8ec48f 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -38,7 +38,7 @@
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
-void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode, const String &p_select_type) {
+void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode, const String &p_select_type, const String &p_select_name) {
_fill_type_list();
icon_fallback = search_options->has_theme_icon(base_type, SNAME("EditorIcons")) ? base_type : "Object";
@@ -57,7 +57,11 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode, const St
_update_search();
if (p_replace_mode) {
- set_title(vformat(TTR("Change %s Type"), base_type));
+ if (!p_select_name.is_empty()) {
+ set_title(vformat(TTR("Convert %s from %s"), p_select_name, p_select_type));
+ } else {
+ set_title(vformat(TTR("Convert %s"), p_select_type));
+ }
set_ok_button_text(TTR("Change"));
} else {
set_title(vformat(TTR("Create New %s"), base_type));
diff --git a/editor/create_dialog.h b/editor/create_dialog.h
index 04094108ad..f7731d2726 100644
--- a/editor/create_dialog.h
+++ b/editor/create_dialog.h
@@ -120,7 +120,7 @@ public:
void set_preferred_search_result_type(const String &p_preferred_type) { preferred_search_result_type = p_preferred_type; }
String get_preferred_search_result_type() { return preferred_search_result_type; }
- void popup_create(bool p_dont_clear, bool p_replace_mode = false, const String &p_select_type = "Node");
+ void popup_create(bool p_dont_clear, bool p_replace_mode = false, const String &p_select_type = "Node", const String &p_select_name = "");
CreateDialog();
};
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 0f4f3dcfcf..f0884a4a91 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -510,9 +510,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
}
if (selected) {
- create_dialog->popup_create(false, true, selected->get_class());
+ create_dialog->popup_create(false, true, selected->get_class(), selected->get_name());
}
-
} break;
case TOOL_EXTEND_SCRIPT: {
attach_script_to_selected(true);
diff --git a/modules/visual_script/editor/visual_script_editor.cpp b/modules/visual_script/editor/visual_script_editor.cpp
index 7f8e9d8254..2c7d23a3c4 100644
--- a/modules/visual_script/editor/visual_script_editor.cpp
+++ b/modules/visual_script/editor/visual_script_editor.cpp
@@ -2936,7 +2936,7 @@ Control *VisualScriptEditor::get_edit_menu() {
}
void VisualScriptEditor::_change_base_type() {
- select_base_type->popup_create(true, true);
+ select_base_type->popup_create(true, true, script->get_instance_base_type());
}
void VisualScriptEditor::_toggle_tool_script() {