mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Reworked look and feel of Add Script Dialog.
Untangled a lot of Controls logic code and placed it in one place. Which squashed few bugs and made code easier to maintain.
This commit is contained in:
@@ -34,8 +34,10 @@
|
||||
#include "editor/editor_settings.h"
|
||||
#include "scene/gui/check_button.h"
|
||||
#include "scene/gui/dialogs.h"
|
||||
#include "scene/gui/grid_container.h"
|
||||
#include "scene/gui/line_edit.h"
|
||||
#include "scene/gui/option_button.h"
|
||||
#include "scene/gui/panel_container.h"
|
||||
|
||||
class ScriptCreateDialog : public ConfirmationDialog {
|
||||
GDCLASS(ScriptCreateDialog, ConfirmationDialog);
|
||||
@@ -47,6 +49,7 @@ class ScriptCreateDialog : public ConfirmationDialog {
|
||||
Button *parent_browse_button;
|
||||
OptionButton *language_menu;
|
||||
LineEdit *file_path;
|
||||
Button *path_button;
|
||||
EditorFileDialog *file_browse;
|
||||
CheckButton *internal;
|
||||
VBoxContainer *path_vb;
|
||||
@@ -56,20 +59,33 @@ class ScriptCreateDialog : public ConfirmationDialog {
|
||||
bool is_browsing_parent;
|
||||
String initial_bp;
|
||||
EditorSettings *editor_settings;
|
||||
bool is_new_script_created;
|
||||
bool is_path_valid;
|
||||
bool has_named_classes;
|
||||
bool can_inherit_from_file;
|
||||
bool is_parent_name_valid;
|
||||
bool is_class_name_valid;
|
||||
bool is_built_in;
|
||||
int current_language;
|
||||
bool re_check_path;
|
||||
|
||||
void _path_changed(const String &p_path = String());
|
||||
void _lang_changed(int l = 0);
|
||||
void _built_in_pressed();
|
||||
bool _validate(const String &p_strin);
|
||||
void _class_name_changed(const String &p_name);
|
||||
void _parent_name_changed(const String &p_parent);
|
||||
void _browse_path(bool browse_parent);
|
||||
void _file_selected(const String &p_file);
|
||||
virtual void ok_pressed();
|
||||
void _create_new();
|
||||
void _load_exist();
|
||||
void _update_controls();
|
||||
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:
|
||||
void _notification(int p_what);
|
||||
static void _bind_methods();
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user