summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Franke <me@nathan.sh>2022-08-22 19:03:19 -0500
committerNathan Franke <me@nathan.sh>2022-09-07 21:44:33 -0500
commita258101971ce84d2a0a0cffa3c7861551a085c3a (patch)
tree6779bdffd52c9c0b0180e80b506c65552aaced97
parent5803a1ddc5024bcea6fa5482bee206ccac94d62e (diff)
simplify title of create/change node dialog
The create dialog in replace mode now always has the title `Change type of "%s"`, where `%s` is either "MyNodeName" or "MyVisualScript.vs".
-rw-r--r--editor/create_dialog.cpp10
-rw-r--r--editor/create_dialog.h2
2 files changed, 4 insertions, 8 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 2d70934c9c..4ac32d7317 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, const String &p_select_name) {
+void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode, const String &p_current_type, const String &p_current_name) {
_fill_type_list();
icon_fallback = search_options->has_theme_icon(base_type, SNAME("EditorIcons")) ? base_type : "Object";
@@ -50,18 +50,14 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode, const St
}
if (p_replace_mode) {
- search_box->set_text(p_select_type);
+ search_box->set_text(p_current_type);
}
search_box->grab_focus();
_update_search();
if (p_replace_mode) {
- 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_title(vformat(TTR("Change Type of \"%s\""), p_current_name));
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 f7731d2726..f2e741624f 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", const String &p_select_name = "");
+ void popup_create(bool p_dont_clear, bool p_replace_mode = false, const String &p_current_type = "", const String &p_current_name = "");
CreateDialog();
};