summaryrefslogtreecommitdiffstats
path: root/editor/debugger/debug_adapter/debug_adapter_parser.cpp
diff options
context:
space:
mode:
authorYuri Sizov <yuris@humnom.net>2023-04-12 21:02:28 +0200
committerYuri Sizov <yuris@humnom.net>2023-04-19 17:12:28 +0200
commit8a74d8438f5dee92927d953a7954ad3c3022cbd9 (patch)
tree96cce146518007954f44c79c359dda170bd32265 /editor/debugger/debug_adapter/debug_adapter_parser.cpp
parent27253f3eb2c78a9ad5114c92eae2036b10e1d7e0 (diff)
downloadredot-engine-8a74d8438f5dee92927d953a7954ad3c3022cbd9.tar.gz
Extract editor run toolbar into its own component
- Simplify and update its logic. - Simplify EditorScript. - Improve EditorNode and other relevant includes. - Fix scene-based path in the movie writer when reloading a scene.
Diffstat (limited to 'editor/debugger/debug_adapter/debug_adapter_parser.cpp')
-rw-r--r--editor/debugger/debug_adapter/debug_adapter_parser.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/editor/debugger/debug_adapter/debug_adapter_parser.cpp b/editor/debugger/debug_adapter/debug_adapter_parser.cpp
index fc806ded5e..e3686a0217 100644
--- a/editor/debugger/debug_adapter/debug_adapter_parser.cpp
+++ b/editor/debugger/debug_adapter/debug_adapter_parser.cpp
@@ -32,9 +32,8 @@
#include "editor/debugger/editor_debugger_node.h"
#include "editor/debugger/script_editor_debugger.h"
-#include "editor/editor_node.h"
-#include "editor/editor_run_native.h"
#include "editor/export/editor_export_platform.h"
+#include "editor/gui/editor_run_bar.h"
#include "editor/plugins/script_editor_plugin.h"
void DebugAdapterParser::_bind_methods() {
@@ -162,7 +161,7 @@ Dictionary DebugAdapterParser::req_initialize(const Dictionary &p_params) const
Dictionary DebugAdapterParser::req_disconnect(const Dictionary &p_params) const {
if (!DebugAdapterProtocol::get_singleton()->get_current_peer()->attached) {
- EditorNode::get_singleton()->run_stop();
+ EditorRunBar::get_singleton()->stop_playing();
}
return prepare_success_response(p_params);
@@ -188,7 +187,7 @@ Dictionary DebugAdapterParser::req_launch(const Dictionary &p_params) const {
String platform_string = args.get("platform", "host");
if (platform_string == "host") {
- EditorNode::get_singleton()->run_play();
+ EditorRunBar::get_singleton()->play_main_scene();
} else {
int device = args.get("device", -1);
int idx = -1;
@@ -212,8 +211,8 @@ Dictionary DebugAdapterParser::req_launch(const Dictionary &p_params) const {
return prepare_error_response(p_params, DAP::ErrorType::UNKNOWN_PLATFORM);
}
- EditorNode *editor = EditorNode::get_singleton();
- Error err = platform_string == "android" ? editor->run_play_native(device * 10000 + idx) : editor->run_play_native(idx);
+ EditorRunBar *run_bar = EditorRunBar::get_singleton();
+ Error err = platform_string == "android" ? run_bar->start_native_device(device * 10000 + idx) : run_bar->start_native_device(idx);
if (err) {
if (err == ERR_INVALID_PARAMETER && platform_string == "android") {
return prepare_error_response(p_params, DAP::ErrorType::MISSING_DEVICE);
@@ -257,13 +256,13 @@ Dictionary DebugAdapterParser::req_restart(const Dictionary &p_params) const {
}
Dictionary DebugAdapterParser::req_terminate(const Dictionary &p_params) const {
- EditorNode::get_singleton()->run_stop();
+ EditorRunBar::get_singleton()->stop_playing();
return prepare_success_response(p_params);
}
Dictionary DebugAdapterParser::req_pause(const Dictionary &p_params) const {
- EditorNode::get_singleton()->get_pause_button()->set_pressed(true);
+ EditorRunBar::get_singleton()->get_pause_button()->set_pressed(true);
EditorDebuggerNode::get_singleton()->_paused();
DebugAdapterProtocol::get_singleton()->notify_stopped_paused();
@@ -272,7 +271,7 @@ Dictionary DebugAdapterParser::req_pause(const Dictionary &p_params) const {
}
Dictionary DebugAdapterParser::req_continue(const Dictionary &p_params) const {
- EditorNode::get_singleton()->get_pause_button()->set_pressed(false);
+ EditorRunBar::get_singleton()->get_pause_button()->set_pressed(false);
EditorDebuggerNode::get_singleton()->_paused();
DebugAdapterProtocol::get_singleton()->notify_continued();