From 116fb7212217f98878d02c7094069c5f5d1de319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=90=E6=B2=90=E5=91=80?= <163636894+zimuya4153@users.noreply.github.com> Date: Sat, 12 Oct 2024 12:20:12 +0800 Subject: [PATCH] feat: Modify GMLIB_BinaryStream writeVec2 method to accept an object with x and z properties --- lib/GMLIB_API-JS.d.ts | 6 +++--- lib/GMLIB_API-JS.js | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/GMLIB_API-JS.d.ts b/lib/GMLIB_API-JS.d.ts index 74586bb..467b345 100644 --- a/lib/GMLIB_API-JS.d.ts +++ b/lib/GMLIB_API-JS.d.ts @@ -1217,10 +1217,10 @@ declare class GMLIB_BinaryStream { value: IntPos ): GMLIB_BinaryStream; - /** 写入方向角对象 */ + /** */ writeVec2( - /** 方向角对象 */ - value: DirectionAngle + /** 数据 */ + value: { "x": number, "z": number } ): GMLIB_BinaryStream; /** 写入字符串 */ diff --git a/lib/GMLIB_API-JS.js b/lib/GMLIB_API-JS.js index 87cf26b..d127112 100644 --- a/lib/GMLIB_API-JS.js +++ b/lib/GMLIB_API-JS.js @@ -2372,14 +2372,14 @@ class GMLIB_BinaryStream { } /** - * 写入方向角对象 - * @param {DirectionAngle} value 方向角对象 + * + * @param {{"x":number,"z":number}} value 数值 * @returns {GMLIB_BinaryStream} */ - writeVec2({ pitch, yaw }) { + writeVec2({ x, z }) { if (this.#destroy) throw new Error("The BinaryStream has been destroyed"); - this.writeFloat(pitch); - this.writeFloat(yaw); + this.writeFloat(x); + this.writeFloat(z); return this; }