-added option to keep debugger open, fixes #3031
This commit is contained in:
parent
e2e6f3ec00
commit
cd4c3f4d12
@ -981,7 +981,22 @@ void ScriptEditor::_menu_option(int p_option) {
|
|||||||
case WINDOW_PREV: {
|
case WINDOW_PREV: {
|
||||||
_history_back();
|
_history_back();
|
||||||
} break;
|
} break;
|
||||||
|
case DEBUG_SHOW: {
|
||||||
|
if (debugger) {
|
||||||
|
bool visible = debug_menu->get_popup()->is_item_checked( debug_menu->get_popup()->get_item_index(DEBUG_SHOW) );
|
||||||
|
debug_menu->get_popup()->set_item_checked( debug_menu->get_popup()->get_item_index(DEBUG_SHOW), !visible);
|
||||||
|
if (visible)
|
||||||
|
debugger->hide();
|
||||||
|
else
|
||||||
|
debugger->show();
|
||||||
|
}
|
||||||
|
} break;
|
||||||
|
case DEBUG_SHOW_KEEP_OPEN: {
|
||||||
|
bool visible = debug_menu->get_popup()->is_item_checked( debug_menu->get_popup()->get_item_index(DEBUG_SHOW_KEEP_OPEN) );
|
||||||
|
if (debugger)
|
||||||
|
debugger->set_hide_on_stop(visible);
|
||||||
|
debug_menu->get_popup()->set_item_checked( debug_menu->get_popup()->get_item_index(DEBUG_SHOW_KEEP_OPEN), !visible);
|
||||||
|
} break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1335,16 +1350,7 @@ void ScriptEditor::_menu_option(int p_option) {
|
|||||||
debugger->debug_continue();
|
debugger->debug_continue();
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case DEBUG_SHOW: {
|
|
||||||
if (debugger) {
|
|
||||||
bool visible = debug_menu->get_popup()->is_item_checked( debug_menu->get_popup()->get_item_index(DEBUG_SHOW) );
|
|
||||||
debug_menu->get_popup()->set_item_checked( debug_menu->get_popup()->get_item_index(DEBUG_SHOW), !visible);
|
|
||||||
if (visible)
|
|
||||||
debugger->hide();
|
|
||||||
else
|
|
||||||
debugger->show();
|
|
||||||
}
|
|
||||||
} break;
|
|
||||||
case HELP_CONTEXTUAL: {
|
case HELP_CONTEXTUAL: {
|
||||||
String text = current->get_text_edit()->get_selection_text();
|
String text = current->get_text_edit()->get_selection_text();
|
||||||
if (text == "")
|
if (text == "")
|
||||||
@ -2394,6 +2400,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
|
|||||||
debug_menu->get_popup()->add_item("Continue",DEBUG_CONTINUE);
|
debug_menu->get_popup()->add_item("Continue",DEBUG_CONTINUE);
|
||||||
debug_menu->get_popup()->add_separator();
|
debug_menu->get_popup()->add_separator();
|
||||||
debug_menu->get_popup()->add_check_item("Show Debugger",DEBUG_SHOW);
|
debug_menu->get_popup()->add_check_item("Show Debugger",DEBUG_SHOW);
|
||||||
|
debug_menu->get_popup()->add_check_item("Keep Debuger Open",DEBUG_SHOW_KEEP_OPEN);
|
||||||
debug_menu->get_popup()->connect("item_pressed", this,"_menu_option");
|
debug_menu->get_popup()->connect("item_pressed", this,"_menu_option");
|
||||||
|
|
||||||
debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_NEXT), true);
|
debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_NEXT), true);
|
||||||
|
@ -151,6 +151,7 @@ class ScriptEditor : public VBoxContainer {
|
|||||||
DEBUG_BREAK,
|
DEBUG_BREAK,
|
||||||
DEBUG_CONTINUE,
|
DEBUG_CONTINUE,
|
||||||
DEBUG_SHOW,
|
DEBUG_SHOW,
|
||||||
|
DEBUG_SHOW_KEEP_OPEN,
|
||||||
HELP_CONTEXTUAL,
|
HELP_CONTEXTUAL,
|
||||||
WINDOW_MOVE_LEFT,
|
WINDOW_MOVE_LEFT,
|
||||||
WINDOW_MOVE_RIGHT,
|
WINDOW_MOVE_RIGHT,
|
||||||
|
@ -737,8 +737,10 @@ void ScriptEditorDebugger::stop(){
|
|||||||
le_set->set_disabled(true);
|
le_set->set_disabled(true);
|
||||||
|
|
||||||
|
|
||||||
|
if (hide_on_stop) {
|
||||||
hide();
|
hide();
|
||||||
emit_signal("show_debugger",false);
|
emit_signal("show_debugger",false);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1160,6 +1162,10 @@ void ScriptEditorDebugger:: _error_stack_selected(int p_idx){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScriptEditorDebugger::set_hide_on_stop(bool p_hide) {
|
||||||
|
|
||||||
|
hide_on_stop=p_hide;
|
||||||
|
}
|
||||||
|
|
||||||
void ScriptEditorDebugger::_bind_methods() {
|
void ScriptEditorDebugger::_bind_methods() {
|
||||||
|
|
||||||
@ -1462,6 +1468,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor){
|
|||||||
live_debug=false;
|
live_debug=false;
|
||||||
last_path_id=false;
|
last_path_id=false;
|
||||||
error_count=0;
|
error_count=0;
|
||||||
|
hide_on_stop=true;
|
||||||
last_error_count=0;
|
last_error_count=0;
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,6 +71,8 @@ class ScriptEditorDebugger : public Control {
|
|||||||
int error_count;
|
int error_count;
|
||||||
int last_error_count;
|
int last_error_count;
|
||||||
|
|
||||||
|
bool hide_on_stop;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TextureButton *tb;
|
TextureButton *tb;
|
||||||
@ -182,6 +184,8 @@ public:
|
|||||||
|
|
||||||
void update_live_edit_root();
|
void update_live_edit_root();
|
||||||
|
|
||||||
|
void set_hide_on_stop(bool p_hide);
|
||||||
|
|
||||||
|
|
||||||
virtual Size2 get_minimum_size() const;
|
virtual Size2 get_minimum_size() const;
|
||||||
ScriptEditorDebugger(EditorNode *p_editor=NULL);
|
ScriptEditorDebugger(EditorNode *p_editor=NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user