|
38 | 38 | HashMap<String, GameViewDebuggerMacOS::ParseMessageFunc> GameViewDebuggerMacOS::parse_message_handlers; |
39 | 39 |
|
40 | 40 | bool GameViewDebuggerMacOS::_msg_set_context_id(const Array &p_args) { |
41 | | - ERR_FAIL_COND_V_MSG(p_args.size() != 1, false, "set_context_id: invalid number of arguments"); |
| 41 | + ERR_FAIL_COND_V_MSG(p_args.size() != 1, false, "set_context_id: invalid number of arguments."); |
42 | 42 |
|
43 | 43 | embedded_process->set_context_id(p_args[0]); |
44 | 44 | return true; |
45 | 45 | } |
46 | 46 |
|
47 | 47 | bool GameViewDebuggerMacOS::_msg_cursor_set_shape(const Array &p_args) { |
48 | | - ERR_FAIL_COND_V_MSG(p_args.size() != 1, false, "cursor_set_shape: invalid number of arguments"); |
| 48 | + ERR_FAIL_COND_V_MSG(p_args.size() != 1, false, "cursor_set_shape: invalid number of arguments."); |
49 | 49 |
|
50 | 50 | Control::CursorShape shape = Control::CursorShape(p_args[0]); |
51 | 51 | embedded_process->get_layer_host()->set_default_cursor_shape(static_cast<Control::CursorShape>(shape)); |
|
54 | 54 | } |
55 | 55 |
|
56 | 56 | bool GameViewDebuggerMacOS::_msg_cursor_set_custom_image(const Array &p_args) { |
57 | | - ERR_FAIL_COND_V_MSG(p_args.size() != 3, false, "cursor_set_custom_image: invalid number of arguments"); |
| 57 | + ERR_FAIL_COND_V_MSG(p_args.size() != 3, false, "cursor_set_custom_image: invalid number of arguments."); |
58 | 58 |
|
59 | 59 | Ref<Image> image; |
60 | 60 | image.instantiate(); |
|
71 | 71 | } |
72 | 72 |
|
73 | 73 | bool GameViewDebuggerMacOS::_msg_mouse_set_mode(const Array &p_args) { |
74 | | - ERR_FAIL_COND_V_MSG(p_args.size() != 1, false, "mouse_set_mode: invalid number of arguments"); |
| 74 | + ERR_FAIL_COND_V_MSG(p_args.size() != 1, false, "mouse_set_mode: invalid number of arguments."); |
75 | 75 |
|
76 | 76 | DisplayServer::MouseMode mode = DisplayServer::MouseMode(p_args[0]); |
77 | 77 | embedded_process->mouse_set_mode(mode); |
|
80 | 80 | } |
81 | 81 |
|
82 | 82 | bool GameViewDebuggerMacOS::_msg_window_set_ime_active(const Array &p_args) { |
83 | | - ERR_FAIL_COND_V_MSG(p_args.size() != 1, false, "window_set_ime_active: invalid number of arguments"); |
| 83 | + ERR_FAIL_COND_V_MSG(p_args.size() != 1, false, "window_set_ime_active: invalid number of arguments."); |
84 | 84 |
|
85 | 85 | bool active = p_args[0]; |
86 | 86 | DisplayServer::WindowID wid = embedded_process->get_window()->get_window_id(); |
|
89 | 89 | } |
90 | 90 |
|
91 | 91 | bool GameViewDebuggerMacOS::_msg_window_set_ime_position(const Array &p_args) { |
92 | | - ERR_FAIL_COND_V_MSG(p_args.size() != 1, false, "window_set_ime_position: invalid number of arguments"); |
| 92 | + ERR_FAIL_COND_V_MSG(p_args.size() != 1, false, "window_set_ime_position: invalid number of arguments."); |
93 | 93 |
|
94 | 94 | Point2i pos = p_args[0]; |
95 | 95 | Point2i xpos = embedded_process->get_layer_host()->get_global_transform_with_canvas().xform(pos); |
|
99 | 99 | } |
100 | 100 |
|
101 | 101 | bool GameViewDebuggerMacOS::_msg_joy_start(const Array &p_args) { |
102 | | - ERR_FAIL_COND_V_MSG(p_args.size() != 3, false, "joy_start: invalid number of arguments"); |
| 102 | + ERR_FAIL_COND_V_MSG(p_args.size() != 3, false, "joy_start: invalid number of arguments."); |
103 | 103 |
|
104 | 104 | int joy_id = p_args[0]; |
105 | 105 | float duration = p_args[1]; |
|
109 | 109 | } |
110 | 110 |
|
111 | 111 | bool GameViewDebuggerMacOS::_msg_joy_stop(const Array &p_args) { |
112 | | - ERR_FAIL_COND_V_MSG(p_args.size() != 1, false, "joy_stop: invalid number of arguments"); |
| 112 | + ERR_FAIL_COND_V_MSG(p_args.size() != 1, false, "joy_stop: invalid number of arguments."); |
113 | 113 |
|
114 | 114 | int joy_id = p_args[0]; |
115 | 115 | Input::get_singleton()->stop_joy_vibration(joy_id); |
116 | 116 | return true; |
117 | 117 | } |
118 | 118 |
|
| 119 | +bool GameViewDebuggerMacOS::_msg_warp_mouse(const Array &p_args) { |
| 120 | + ERR_FAIL_COND_V_MSG(p_args.size() != 1, false, "warp_mouse: invalid number of arguments."); |
| 121 | + |
| 122 | + Vector2i pos = p_args[0]; |
| 123 | + embedded_process->get_layer_host()->warp_mouse(pos); |
| 124 | + return true; |
| 125 | +} |
| 126 | + |
119 | 127 | void GameViewDebuggerMacOS::_init_capture_message_handlers() { |
120 | 128 | parse_message_handlers["game_view:set_context_id"] = &GameViewDebuggerMacOS::_msg_set_context_id; |
121 | 129 | parse_message_handlers["game_view:cursor_set_shape"] = &GameViewDebuggerMacOS::_msg_cursor_set_shape; |
|
125 | 133 | parse_message_handlers["game_view:window_set_ime_position"] = &GameViewDebuggerMacOS::_msg_window_set_ime_position; |
126 | 134 | parse_message_handlers["game_view:joy_start"] = &GameViewDebuggerMacOS::_msg_joy_start; |
127 | 135 | parse_message_handlers["game_view:joy_stop"] = &GameViewDebuggerMacOS::_msg_joy_stop; |
| 136 | + parse_message_handlers["game_view:warp_mouse"] = &GameViewDebuggerMacOS::_msg_warp_mouse; |
128 | 137 | } |
129 | 138 |
|
130 | 139 | bool GameViewDebuggerMacOS::capture(const String &p_message, const Array &p_data, int p_session) { |
|
0 commit comments