diff options
author | kobewi <kobewi4e@gmail.com> | 2023-06-26 19:18:27 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2023-08-08 16:14:35 +0200 |
commit | 7f41403a6ff5feddf831b9c09b694c21324b715c (patch) | |
tree | 478ace08d8527ce57da9fbd78aeb44030c8cdbea /editor/script_create_dialog.h | |
parent | eca6f0eb545166708c56633152974f40f51de2be (diff) | |
download | redot-engine-7f41403a6ff5feddf831b9c09b694c21324b715c.tar.gz |
Standardize dialog input validation as a new class
Diffstat (limited to 'editor/script_create_dialog.h')
-rw-r--r-- | editor/script_create_dialog.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/editor/script_create_dialog.h b/editor/script_create_dialog.h index fa42b96746..ea2f480c57 100644 --- a/editor/script_create_dialog.h +++ b/editor/script_create_dialog.h @@ -41,17 +41,20 @@ class CreateDialog; class EditorFileDialog; +class EditorValidationPanel; class ScriptCreateDialog : public ConfirmationDialog { GDCLASS(ScriptCreateDialog, ConfirmationDialog); + enum { + MSG_ID_SCRIPT, + MSG_ID_PATH, + MSG_ID_BUILT_IN, + MSG_ID_TEMPLATE, + }; + LineEdit *class_name = nullptr; - Label *error_label = nullptr; - Label *path_error_label = nullptr; - Label *builtin_warning_label = nullptr; - Label *script_name_warning_label = nullptr; - Label *template_info_label = nullptr; - PanelContainer *status_panel = nullptr; + EditorValidationPanel *validation_panel = nullptr; LineEdit *parent_name = nullptr; Button *parent_browse_button = nullptr; Button *parent_search_button = nullptr; @@ -67,6 +70,7 @@ class ScriptCreateDialog : public ConfirmationDialog { AcceptDialog *alert = nullptr; CreateDialog *select_class = nullptr; bool is_browsing_parent = false; + String path_error; String template_inactive_message; String initial_bp; bool is_new_script_created = true; @@ -113,8 +117,6 @@ class ScriptCreateDialog : public ConfirmationDialog { virtual void ok_pressed() override; void _create_new(); void _load_exist(); - void _msg_script_valid(bool valid, const String &p_msg = String()); - void _msg_path_valid(bool valid, const String &p_msg = String()); void _update_template_menu(); void _update_dialog(); ScriptLanguage::ScriptTemplate _get_current_template() const; |