summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp4
-rw-r--r--editor/plugins/script_editor_plugin.cpp16
-rw-r--r--editor/plugins/script_editor_plugin.h3
-rw-r--r--editor/plugins/script_text_editor.cpp4
-rw-r--r--editor/plugins/script_text_editor.h2
5 files changed, 22 insertions, 7 deletions
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index 28c5b89741..c3e1f60ccc 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -254,6 +254,10 @@ void AnimationPlayerEditor::_play_bw_from_pressed() {
}
void AnimationPlayerEditor::_stop_pressed() {
+ if (!player) {
+ return;
+ }
+
player->stop(false);
play->set_pressed(false);
stop->set_pressed(true);
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 0024870665..aedc96d20e 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -509,9 +509,8 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save) {
if (p_save) {
apply_scripts();
}
- if (current->get_edit_menu()) {
- memdelete(current->get_edit_menu());
- }
+ current->clear_edit_menu();
+
} else {
EditorHelp *help = tab_container->get_child(selected)->cast_to<EditorHelp>();
_add_recent_script(help->get_class());
@@ -1885,6 +1884,9 @@ void ScriptEditor::set_window_layout(Ref<ConfigFile> p_layout) {
for (int i = 0; i < helps.size(); i++) {
String path = helps[i];
+ if (path == "") { // invalid, skip
+ continue;
+ }
_help_class_open(path);
}
@@ -2180,13 +2182,15 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
script_list = memnew(ItemList);
list_split->add_child(script_list);
- script_list->set_custom_minimum_size(Size2(0, 0));
+ script_list->set_custom_minimum_size(Size2(150 * EDSCALE, 100)); //need to give a bit of limit to avoid it from disappearing
+ script_list->set_v_size_flags(SIZE_EXPAND_FILL);
script_split->set_split_offset(140);
- list_split->set_split_offset(500);
+ //list_split->set_split_offset(500);
members_overview = memnew(ItemList);
list_split->add_child(members_overview);
- members_overview->set_custom_minimum_size(Size2(0, 0));
+ members_overview->set_custom_minimum_size(Size2(0, 100)); //need to give a bit of limit to avoid it from disappearing
+ members_overview->set_v_size_flags(SIZE_EXPAND_FILL);
tab_container = memnew(TabContainer);
tab_container->add_style_override("panel", p_editor->get_gui_base()->get_stylebox("ScriptPanel", "EditorStyles"));
diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h
index 3b444c0883..da8248a1a7 100644
--- a/editor/plugins/script_editor_plugin.h
+++ b/editor/plugins/script_editor_plugin.h
@@ -106,6 +106,7 @@ public:
virtual void set_tooltip_request_func(String p_method, Object *p_obj) = 0;
virtual Control *get_edit_menu() = 0;
+ virtual void clear_edit_menu() = 0;
ScriptEditorBase() {}
};
@@ -363,6 +364,8 @@ public:
bool can_take_away_focus() const;
+ VSplitContainer *get_left_list_split() { return list_split; }
+
ScriptEditorDebugger *get_debugger() { return debugger; }
void set_live_auto_reload_running_scripts(bool p_enabled);
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 60fd9d8e30..83741c7fb8 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -1093,6 +1093,10 @@ Control *ScriptTextEditor::get_edit_menu() {
return edit_hb;
}
+void ScriptTextEditor::clear_edit_menu() {
+ memdelete(edit_hb);
+}
+
void ScriptTextEditor::reload(bool p_soft) {
TextEdit *te = code_editor->get_text_edit();
diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h
index ba40645161..e55847832f 100644
--- a/editor/plugins/script_text_editor.h
+++ b/editor/plugins/script_text_editor.h
@@ -156,7 +156,7 @@ public:
virtual void set_debugger_active(bool p_active);
Control *get_edit_menu();
-
+ virtual void clear_edit_menu();
static void register_editor();
ScriptTextEditor();