diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/input_default.cpp | 6 | ||||
-rw-r--r-- | main/main.cpp | 6 | ||||
-rw-r--r-- | main/tests/test_gdscript.cpp | 3 |
3 files changed, 10 insertions, 5 deletions
diff --git a/main/input_default.cpp b/main/input_default.cpp index 65910b34bc..e9f1eeff6a 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -355,7 +355,7 @@ void InputDefault::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool Ref<InputEventMouseButton> button_event; button_event.instance(); - button_event->set_device(-1); + button_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE); button_event->set_position(st->get_position()); button_event->set_global_position(st->get_position()); button_event->set_pressed(st->is_pressed()); @@ -384,7 +384,7 @@ void InputDefault::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool Ref<InputEventMouseMotion> motion_event; motion_event.instance(); - motion_event->set_device(-1); + motion_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE); motion_event->set_position(sd->get_position()); motion_event->set_global_position(sd->get_position()); motion_event->set_relative(sd->get_relative()); @@ -602,7 +602,7 @@ void InputDefault::ensure_touch_mouse_raised() { Ref<InputEventMouseButton> button_event; button_event.instance(); - button_event->set_device(-1); + button_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE); button_event->set_position(mouse_pos); button_event->set_global_position(mouse_pos); button_event->set_pressed(false); diff --git a/main/main.cpp b/main/main.cpp index 1ef8491a60..fc9ec3b2d9 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -856,6 +856,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } if (editor || project_manager) { + Engine::get_singleton()->set_editor_hint(true); use_custom_res = false; input_map->load_default(); //keys for editor } else { @@ -1208,6 +1209,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) { GLOBAL_DEF("display/mouse_cursor/custom_image", String()); GLOBAL_DEF("display/mouse_cursor/custom_image_hotspot", Vector2()); + GLOBAL_DEF("display/mouse_cursor/tooltip_position_offset", Point2(10, 10)); ProjectSettings::get_singleton()->set_custom_property_info("display/mouse_cursor/custom_image", PropertyInfo(Variant::STRING, "display/mouse_cursor/custom_image", PROPERTY_HINT_FILE, "*.png,*.webp")); if (String(ProjectSettings::get_singleton()->get("display/mouse_cursor/custom_image")) != String()) { @@ -1880,7 +1882,9 @@ bool Main::iteration() { uint64_t idle_begin = OS::get_singleton()->get_ticks_usec(); - OS::get_singleton()->get_main_loop()->idle(step * time_scale); + if (OS::get_singleton()->get_main_loop()->idle(step * time_scale)) { + exit = true; + } message_queue->flush(); VisualServer::get_singleton()->sync(); //sync if still drawing from previous frames. diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp index 55e31a18c3..7a711e8cc9 100644 --- a/main/tests/test_gdscript.cpp +++ b/main/tests/test_gdscript.cpp @@ -127,6 +127,7 @@ static String _parser_expr(const GDScriptParser::Node *p_expr) { case GDScriptParser::OperatorNode::OP_PARENT_CALL: txt += "."; + FALLTHROUGH; case GDScriptParser::OperatorNode::OP_CALL: { ERR_FAIL_COND_V(c_node->arguments.size() < 1, ""); @@ -563,7 +564,7 @@ static void _disassemble_class(const Ref<GDScript> &p_class, const Vector<String case GDScriptFunction::OPCODE_OPERATOR: { int op = code[ip + 1]; - txt += "op "; + txt += " op "; String opname = Variant::get_operator_name(Variant::Operator(op)); |