You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
WIP visual scripting, not working yet but you can check out stuff
This commit is contained in:
@@ -73,41 +73,44 @@ public:
|
||||
|
||||
class ScriptEditorDebugger;
|
||||
|
||||
class ScriptTextEditor : public CodeTextEditor {
|
||||
|
||||
OBJ_TYPE( ScriptTextEditor, CodeTextEditor );
|
||||
|
||||
Ref<Script> script;
|
||||
|
||||
|
||||
Vector<String> functions;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
virtual void _validate_script();
|
||||
virtual void _code_complete_script(const String& p_code, List<String>* r_options);
|
||||
virtual void _load_theme_settings();
|
||||
void _notification(int p_what);
|
||||
static void _bind_methods();
|
||||
class ScriptEditorBase : public Control {
|
||||
|
||||
OBJ_TYPE( ScriptEditorBase, Control );
|
||||
|
||||
public:
|
||||
|
||||
virtual void apply_code();
|
||||
Ref<Script> get_edited_script() const;
|
||||
Vector<String> get_functions() ;
|
||||
void set_edited_script(const Ref<Script>& p_script);
|
||||
void reload_text();
|
||||
String get_name() ;
|
||||
Ref<Texture> get_icon() ;
|
||||
bool is_unsaved();
|
||||
ScriptTextEditor();
|
||||
virtual void apply_code()=0;
|
||||
virtual Ref<Script> get_edited_script() const=0;
|
||||
virtual Vector<String> get_functions()=0;
|
||||
virtual void set_edited_script(const Ref<Script>& p_script)=0;
|
||||
virtual void reload_text()=0;
|
||||
virtual String get_name()=0;
|
||||
virtual Ref<Texture> get_icon()=0;
|
||||
virtual bool is_unsaved()=0;
|
||||
virtual Variant get_edit_state()=0;
|
||||
virtual void set_edit_state(const Variant& p_state)=0;
|
||||
virtual void goto_line(int p_line)=0;
|
||||
virtual void trim_trailing_whitespace()=0;
|
||||
virtual void ensure_focus()=0;
|
||||
virtual void tag_saved_version()=0;
|
||||
virtual void reload(bool p_soft)=0;
|
||||
virtual void get_breakpoints(List<int> *p_breakpoints)=0;
|
||||
virtual bool goto_method(const String& p_method)=0;
|
||||
virtual void add_callback(const String& p_function,StringArray p_args)=0;
|
||||
virtual void update_settings()=0;
|
||||
|
||||
virtual void set_tooltip_request_func(String p_method,Object* p_obj)=0;
|
||||
virtual Control *get_edit_menu()=0;
|
||||
|
||||
ScriptEditorBase() {}
|
||||
};
|
||||
|
||||
|
||||
typedef ScriptEditorBase* (*CreateScriptEditorFunc)(const Ref<Script>& p_script);
|
||||
|
||||
|
||||
class EditorScriptCodeCompletionCache;
|
||||
|
||||
class ScriptEditor : public VBoxContainer {
|
||||
@@ -128,43 +131,19 @@ class ScriptEditor : public VBoxContainer {
|
||||
FILE_SAVE_THEME_AS,
|
||||
FILE_CLOSE,
|
||||
CLOSE_DOCS,
|
||||
EDIT_UNDO,
|
||||
EDIT_REDO,
|
||||
EDIT_CUT,
|
||||
EDIT_COPY,
|
||||
EDIT_PASTE,
|
||||
EDIT_SELECT_ALL,
|
||||
EDIT_COMPLETE,
|
||||
EDIT_AUTO_INDENT,
|
||||
EDIT_TRIM_TRAILING_WHITESAPCE,
|
||||
EDIT_TOGGLE_COMMENT,
|
||||
EDIT_MOVE_LINE_UP,
|
||||
EDIT_MOVE_LINE_DOWN,
|
||||
EDIT_INDENT_RIGHT,
|
||||
EDIT_INDENT_LEFT,
|
||||
EDIT_CLONE_DOWN,
|
||||
FILE_TOOL_RELOAD,
|
||||
FILE_TOOL_RELOAD_SOFT,
|
||||
SEARCH_FIND,
|
||||
SEARCH_FIND_NEXT,
|
||||
SEARCH_FIND_PREV,
|
||||
SEARCH_REPLACE,
|
||||
SEARCH_LOCATE_FUNCTION,
|
||||
SEARCH_GOTO_LINE,
|
||||
SEARCH_HELP,
|
||||
SEARCH_CLASSES,
|
||||
SEARCH_WEBSITE,
|
||||
DEBUG_TOGGLE_BREAKPOINT,
|
||||
DEBUG_REMOVE_ALL_BREAKPOINTS,
|
||||
DEBUG_GOTO_NEXT_BREAKPOINT,
|
||||
DEBUG_GOTO_PREV_BREAKPOINT,
|
||||
DEBUG_NEXT,
|
||||
DEBUG_STEP,
|
||||
DEBUG_BREAK,
|
||||
DEBUG_CONTINUE,
|
||||
DEBUG_SHOW,
|
||||
DEBUG_SHOW_KEEP_OPEN,
|
||||
HELP_CONTEXTUAL,
|
||||
SEARCH_HELP,
|
||||
SEARCH_CLASSES,
|
||||
SEARCH_WEBSITE,
|
||||
HELP_SEARCH_FIND,
|
||||
HELP_SEARCH_FIND_NEXT,
|
||||
WINDOW_MOVE_LEFT,
|
||||
WINDOW_MOVE_RIGHT,
|
||||
WINDOW_NEXT,
|
||||
@@ -175,10 +154,8 @@ class ScriptEditor : public VBoxContainer {
|
||||
HBoxContainer *menu_hb;
|
||||
MenuButton *file_menu;
|
||||
MenuButton *edit_menu;
|
||||
MenuButton *search_menu;
|
||||
MenuButton *script_search_menu;
|
||||
MenuButton *debug_menu;
|
||||
MenuButton *help_menu;
|
||||
Timer *autosave_timer;
|
||||
uint64_t idle;
|
||||
|
||||
@@ -191,7 +168,6 @@ class ScriptEditor : public VBoxContainer {
|
||||
HSplitContainer *script_split;
|
||||
TabContainer *tab_container;
|
||||
EditorFileDialog *file_dialog;
|
||||
GotoLineDialog *goto_line_dialog;
|
||||
ConfirmationDialog *erase_tab_confirm;
|
||||
ScriptCreateDialog *script_create_dialog;
|
||||
ScriptEditorDebugger* debugger;
|
||||
@@ -205,13 +181,17 @@ class ScriptEditor : public VBoxContainer {
|
||||
ToolButton *script_back;
|
||||
ToolButton *script_forward;
|
||||
|
||||
enum {
|
||||
SCRIPT_EDITOR_FUNC_MAX=32
|
||||
};
|
||||
|
||||
static int script_editor_func_count;
|
||||
static CreateScriptEditorFunc script_editor_funcs[SCRIPT_EDITOR_FUNC_MAX];
|
||||
|
||||
struct ScriptHistory {
|
||||
|
||||
Control *control;
|
||||
int scroll_pos;
|
||||
int cursor_column;
|
||||
int cursor_row;
|
||||
Variant state;
|
||||
};
|
||||
|
||||
Vector<ScriptHistory> history;
|
||||
@@ -246,7 +226,7 @@ class ScriptEditor : public VBoxContainer {
|
||||
bool auto_reload_running_scripts;
|
||||
void _live_auto_reload_running_scripts();
|
||||
|
||||
ScriptEditorQuickOpen *quick_open;
|
||||
void _update_selected_editor_menu();
|
||||
|
||||
EditorScriptCodeCompletionCache *completion_cache;
|
||||
|
||||
@@ -286,6 +266,7 @@ class ScriptEditor : public VBoxContainer {
|
||||
|
||||
void _unhandled_input(const InputEvent& p_event);
|
||||
|
||||
void _help_search(String p_text);
|
||||
|
||||
void _history_forward();
|
||||
void _history_back();
|
||||
@@ -323,8 +304,7 @@ public:
|
||||
|
||||
void get_breakpoints(List<String> *p_breakpoints);
|
||||
|
||||
void swap_lines(TextEdit *tx, int line1, int line2);
|
||||
void _breakpoint_toggled(const int p_row);
|
||||
//void swap_lines(TextEdit *tx, int line1, int line2);
|
||||
|
||||
void save_all_scripts();
|
||||
|
||||
@@ -342,6 +322,7 @@ public:
|
||||
ScriptEditorDebugger *get_debugger() { return debugger; }
|
||||
void set_live_auto_reload_running_scripts(bool p_enabled);
|
||||
|
||||
static void register_create_script_editor_function(CreateScriptEditorFunc p_func);
|
||||
ScriptEditor(EditorNode *p_editor);
|
||||
~ScriptEditor();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user