mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Merge pull request #64757 from nathanfranke/change-node-dialog
Simplify title of Create/Change Node Dialog
This commit is contained in:
commit
cdb121dffa
@ -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));
|
||||
|
@ -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();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user