浏览代码

Merge pull request #66871 from akien-mga/3.x-web-implement-OS-get_cursor_shape

HTML5: Add missing `OS::get_cursor_shape()` implementation
Rémi Verschelde 2 年之前
父节点
当前提交
62b679fa3b
共有 2 个文件被更改,包括 5 次插入0 次删除
  1. 4 0
      platform/javascript/os_javascript.cpp
  2. 1 0
      platform/javascript/os_javascript.h

+ 4 - 0
platform/javascript/os_javascript.cpp

@@ -454,6 +454,10 @@ void OS_JavaScript::set_cursor_shape(CursorShape p_shape) {
 	godot_js_display_cursor_set_shape(godot2dom_cursor(cursor_shape));
 }
 
+OS::CursorShape OS_JavaScript::get_cursor_shape() const {
+	return cursor_shape;
+}
+
 void OS_JavaScript::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
 	if (p_cursor.is_valid()) {
 		Ref<Texture> texture = p_cursor;

+ 1 - 0
platform/javascript/os_javascript.h

@@ -162,6 +162,7 @@ public:
 	virtual Point2 get_mouse_position() const;
 	virtual int get_mouse_button_state() const;
 	virtual void set_cursor_shape(CursorShape p_shape);
+	virtual CursorShape get_cursor_shape() const;
 	virtual void set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot);
 	virtual void set_mouse_mode(MouseMode p_mode);
 	virtual MouseMode get_mouse_mode() const;