summaryrefslogtreecommitdiffstats
path: root/editor/shader_create_dialog.h
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2023-06-26 19:18:27 +0200
committerkobewi <kobewi4e@gmail.com>2023-08-08 16:14:35 +0200
commit7f41403a6ff5feddf831b9c09b694c21324b715c (patch)
tree478ace08d8527ce57da9fbd78aeb44030c8cdbea /editor/shader_create_dialog.h
parenteca6f0eb545166708c56633152974f40f51de2be (diff)
downloadredot-engine-7f41403a6ff5feddf831b9c09b694c21324b715c.tar.gz
Standardize dialog input validation as a new class
Diffstat (limited to 'editor/shader_create_dialog.h')
-rw-r--r--editor/shader_create_dialog.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/editor/shader_create_dialog.h b/editor/shader_create_dialog.h
index 729a7b5bd4..d6d9f10020 100644
--- a/editor/shader_create_dialog.h
+++ b/editor/shader_create_dialog.h
@@ -40,10 +40,17 @@
#include "scene/gui/panel_container.h"
class EditorFileDialog;
+class EditorValidationPanel;
class ShaderCreateDialog : public ConfirmationDialog {
GDCLASS(ShaderCreateDialog, ConfirmationDialog);
+ enum {
+ MSG_ID_SHADER,
+ MSG_ID_PATH,
+ MSG_ID_BUILT_IN,
+ };
+
struct ShaderTypeData {
List<String> extensions;
String default_extension;
@@ -53,10 +60,7 @@ class ShaderCreateDialog : public ConfirmationDialog {
List<ShaderTypeData> type_data;
GridContainer *gc = nullptr;
- Label *error_label = nullptr;
- Label *path_error_label = nullptr;
- Label *builtin_warning_label = nullptr;
- PanelContainer *status_panel = nullptr;
+ EditorValidationPanel *validation_panel = nullptr;
OptionButton *type_menu = nullptr;
OptionButton *mode_menu = nullptr;
OptionButton *template_menu = nullptr;
@@ -67,6 +71,7 @@ class ShaderCreateDialog : public ConfirmationDialog {
AcceptDialog *alert = nullptr;
String initial_base_path;
+ String path_error;
bool is_new_shader_created = true;
bool is_path_valid = false;
bool is_built_in = false;
@@ -93,8 +98,6 @@ class ShaderCreateDialog : 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_dialog();
protected: