diff options
Diffstat (limited to 'editor/rename_dialog.cpp')
-rw-r--r-- | editor/rename_dialog.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp index 0f15d4b119..d86e2656d4 100644 --- a/editor/rename_dialog.cpp +++ b/editor/rename_dialog.cpp @@ -35,12 +35,18 @@ #include "editor_scale.h" #include "editor_settings.h" #include "editor_themes.h" -#include "modules/regex/regex.h" #include "plugins/script_editor_plugin.h" #include "scene/gui/control.h" #include "scene/gui/label.h" #include "scene/gui/tab_container.h" +#include "modules/modules_enabled.gen.h" +#ifdef MODULE_REGEX_ENABLED +#include "modules/regex/regex.h" +#else +#error "Can't build editor rename dialog without RegEx module." +#endif + RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_undo_redo) { scene_tree_editor = p_scene_tree_editor; undo_redo = p_undo_redo; @@ -385,11 +391,11 @@ void RenameDialog::_update_preview(String new_text) { if (new_name == preview_node->get_name()) { // New name is identical to the old one. Don't color it as much to avoid distracting the user. - const Color accent_color = EditorNode::get_singleton()->get_gui_base()->get_theme_color("accent_color", "Editor"); - const Color text_color = EditorNode::get_singleton()->get_gui_base()->get_theme_color("default_color", "RichTextLabel"); + const Color accent_color = EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("accent_color"), SNAME("Editor")); + const Color text_color = EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("default_color"), SNAME("RichTextLabel")); lbl_preview->add_theme_color_override("font_color", accent_color.lerp(text_color, 0.5)); } else { - lbl_preview->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color("success_color", "Editor")); + lbl_preview->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("success_color"), SNAME("Editor"))); } } @@ -475,7 +481,7 @@ void RenameDialog::_error_handler(void *p_self, const char *p_func, const char * self->has_errors = true; self->lbl_preview_title->set_text(TTR("Regular Expression Error:")); - self->lbl_preview->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color("error_color", "Editor")); + self->lbl_preview->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("error_color"), SNAME("Editor"))); self->lbl_preview->set_text(vformat(TTR("At character %s"), err_str)); } @@ -588,7 +594,7 @@ void RenameDialog::rename() { continue; } - scene_tree_editor->emit_signal("node_prerename", n, new_name); + scene_tree_editor->emit_signal(SNAME("node_prerename"), n, new_name); undo_redo->add_do_method(scene_tree_editor, "_rename_node", n->get_instance_id(), new_name); undo_redo->add_undo_method(scene_tree_editor, "_rename_node", n->get_instance_id(), n->get_name()); } |