浏览代码

[ts] Fix parsing of spacing mode proportional for JSON files.

badlogic 4 年之前
父节点
当前提交
6d7f29718b

+ 2 - 2
spine-ts/build/spine-all.d.ts

@@ -889,7 +889,7 @@ declare module spine {
 		getValue(map: any, prop: string, defaultValue: any): any;
 		static blendModeFromString(str: string): BlendMode;
 		static positionModeFromString(str: string): PositionMode;
-		static spacingModeFromString(str: string): SpacingMode.Length | SpacingMode.Fixed | SpacingMode.Percent;
+		static spacingModeFromString(str: string): SpacingMode;
 		static rotateModeFromString(str: string): RotateMode;
 		static transformModeFromString(str: string): TransformMode;
 	}
@@ -1487,7 +1487,7 @@ declare module spine.webgl {
 		static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL: boolean;
 		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement | ImageBitmap, useMipMaps?: boolean);
 		setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
-		static validateMagFilter(magFilter: TextureFilter): TextureFilter.Nearest | TextureFilter.Linear | TextureFilter.Linear;
+		static validateMagFilter(magFilter: TextureFilter): TextureFilter.Nearest | TextureFilter.Linear;
 		setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
 		update(useMipMaps: boolean): void;
 		restore(): void;

+ 5 - 1
spine-ts/build/spine-all.js

@@ -6,6 +6,8 @@ var __extends = (this && this.__extends) || (function () {
 		return extendStatics(d, b);
 	};
 	return function (d, b) {
+		if (typeof b !== "function" && b !== null)
+			throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
 		extendStatics(d, b);
 		function __() { this.constructor = d; }
 		d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7423,7 +7425,9 @@ var spine;
 				return spine.SpacingMode.Fixed;
 			if (str == "percent")
 				return spine.SpacingMode.Percent;
-			throw new Error("Unknown position mode: " + str);
+			if (str == "proportional")
+				return spine.SpacingMode.Proportional;
+			throw new Error("Unknown spacing mode: " + str);
 		};
 		SkeletonJson.rotateModeFromString = function (str) {
 			str = str.toLowerCase();

文件差异内容过多而无法显示
+ 0 - 0
spine-ts/build/spine-all.js.map


+ 1 - 1
spine-ts/build/spine-canvas.d.ts

@@ -889,7 +889,7 @@ declare module spine {
 		getValue(map: any, prop: string, defaultValue: any): any;
 		static blendModeFromString(str: string): BlendMode;
 		static positionModeFromString(str: string): PositionMode;
-		static spacingModeFromString(str: string): SpacingMode.Length | SpacingMode.Fixed | SpacingMode.Percent;
+		static spacingModeFromString(str: string): SpacingMode;
 		static rotateModeFromString(str: string): RotateMode;
 		static transformModeFromString(str: string): TransformMode;
 	}

+ 5 - 1
spine-ts/build/spine-canvas.js

@@ -6,6 +6,8 @@ var __extends = (this && this.__extends) || (function () {
 		return extendStatics(d, b);
 	};
 	return function (d, b) {
+		if (typeof b !== "function" && b !== null)
+			throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
 		extendStatics(d, b);
 		function __() { this.constructor = d; }
 		d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7423,7 +7425,9 @@ var spine;
 				return spine.SpacingMode.Fixed;
 			if (str == "percent")
 				return spine.SpacingMode.Percent;
-			throw new Error("Unknown position mode: " + str);
+			if (str == "proportional")
+				return spine.SpacingMode.Proportional;
+			throw new Error("Unknown spacing mode: " + str);
 		};
 		SkeletonJson.rotateModeFromString = function (str) {
 			str = str.toLowerCase();

文件差异内容过多而无法显示
+ 0 - 0
spine-ts/build/spine-canvas.js.map


+ 1 - 1
spine-ts/build/spine-core.d.ts

@@ -889,7 +889,7 @@ declare module spine {
 		getValue(map: any, prop: string, defaultValue: any): any;
 		static blendModeFromString(str: string): BlendMode;
 		static positionModeFromString(str: string): PositionMode;
-		static spacingModeFromString(str: string): SpacingMode.Length | SpacingMode.Fixed | SpacingMode.Percent;
+		static spacingModeFromString(str: string): SpacingMode;
 		static rotateModeFromString(str: string): RotateMode;
 		static transformModeFromString(str: string): TransformMode;
 	}

+ 5 - 1
spine-ts/build/spine-core.js

@@ -6,6 +6,8 @@ var __extends = (this && this.__extends) || (function () {
 		return extendStatics(d, b);
 	};
 	return function (d, b) {
+		if (typeof b !== "function" && b !== null)
+			throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
 		extendStatics(d, b);
 		function __() { this.constructor = d; }
 		d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7423,7 +7425,9 @@ var spine;
 				return spine.SpacingMode.Fixed;
 			if (str == "percent")
 				return spine.SpacingMode.Percent;
-			throw new Error("Unknown position mode: " + str);
+			if (str == "proportional")
+				return spine.SpacingMode.Proportional;
+			throw new Error("Unknown spacing mode: " + str);
 		};
 		SkeletonJson.rotateModeFromString = function (str) {
 			str = str.toLowerCase();

文件差异内容过多而无法显示
+ 0 - 0
spine-ts/build/spine-core.js.map


+ 2 - 2
spine-ts/build/spine-player.d.ts

@@ -889,7 +889,7 @@ declare module spine {
 		getValue(map: any, prop: string, defaultValue: any): any;
 		static blendModeFromString(str: string): BlendMode;
 		static positionModeFromString(str: string): PositionMode;
-		static spacingModeFromString(str: string): SpacingMode.Length | SpacingMode.Fixed | SpacingMode.Percent;
+		static spacingModeFromString(str: string): SpacingMode;
 		static rotateModeFromString(str: string): RotateMode;
 		static transformModeFromString(str: string): TransformMode;
 	}
@@ -1456,7 +1456,7 @@ declare module spine.webgl {
 		static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL: boolean;
 		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement | ImageBitmap, useMipMaps?: boolean);
 		setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
-		static validateMagFilter(magFilter: TextureFilter): TextureFilter.Nearest | TextureFilter.Linear | TextureFilter.Linear;
+		static validateMagFilter(magFilter: TextureFilter): TextureFilter.Nearest | TextureFilter.Linear;
 		setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
 		update(useMipMaps: boolean): void;
 		restore(): void;

+ 5 - 1
spine-ts/build/spine-player.js

@@ -6,6 +6,8 @@ var __extends = (this && this.__extends) || (function () {
 		return extendStatics(d, b);
 	};
 	return function (d, b) {
+		if (typeof b !== "function" && b !== null)
+			throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
 		extendStatics(d, b);
 		function __() { this.constructor = d; }
 		d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7423,7 +7425,9 @@ var spine;
 				return spine.SpacingMode.Fixed;
 			if (str == "percent")
 				return spine.SpacingMode.Percent;
-			throw new Error("Unknown position mode: " + str);
+			if (str == "proportional")
+				return spine.SpacingMode.Proportional;
+			throw new Error("Unknown spacing mode: " + str);
 		};
 		SkeletonJson.rotateModeFromString = function (str) {
 			str = str.toLowerCase();

文件差异内容过多而无法显示
+ 0 - 0
spine-ts/build/spine-player.js.map


+ 1 - 1
spine-ts/build/spine-threejs.d.ts

@@ -889,7 +889,7 @@ declare module spine {
 		getValue(map: any, prop: string, defaultValue: any): any;
 		static blendModeFromString(str: string): BlendMode;
 		static positionModeFromString(str: string): PositionMode;
-		static spacingModeFromString(str: string): SpacingMode.Length | SpacingMode.Fixed | SpacingMode.Percent;
+		static spacingModeFromString(str: string): SpacingMode;
 		static rotateModeFromString(str: string): RotateMode;
 		static transformModeFromString(str: string): TransformMode;
 	}

+ 5 - 1
spine-ts/build/spine-threejs.js

@@ -6,6 +6,8 @@ var __extends = (this && this.__extends) || (function () {
 		return extendStatics(d, b);
 	};
 	return function (d, b) {
+		if (typeof b !== "function" && b !== null)
+			throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
 		extendStatics(d, b);
 		function __() { this.constructor = d; }
 		d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7423,7 +7425,9 @@ var spine;
 				return spine.SpacingMode.Fixed;
 			if (str == "percent")
 				return spine.SpacingMode.Percent;
-			throw new Error("Unknown position mode: " + str);
+			if (str == "proportional")
+				return spine.SpacingMode.Proportional;
+			throw new Error("Unknown spacing mode: " + str);
 		};
 		SkeletonJson.rotateModeFromString = function (str) {
 			str = str.toLowerCase();

文件差异内容过多而无法显示
+ 0 - 0
spine-ts/build/spine-threejs.js.map


+ 2 - 2
spine-ts/build/spine-webgl.d.ts

@@ -889,7 +889,7 @@ declare module spine {
 		getValue(map: any, prop: string, defaultValue: any): any;
 		static blendModeFromString(str: string): BlendMode;
 		static positionModeFromString(str: string): PositionMode;
-		static spacingModeFromString(str: string): SpacingMode.Length | SpacingMode.Fixed | SpacingMode.Percent;
+		static spacingModeFromString(str: string): SpacingMode;
 		static rotateModeFromString(str: string): RotateMode;
 		static transformModeFromString(str: string): TransformMode;
 	}
@@ -1456,7 +1456,7 @@ declare module spine.webgl {
 		static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL: boolean;
 		constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement | ImageBitmap, useMipMaps?: boolean);
 		setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
-		static validateMagFilter(magFilter: TextureFilter): TextureFilter.Nearest | TextureFilter.Linear | TextureFilter.Linear;
+		static validateMagFilter(magFilter: TextureFilter): TextureFilter.Nearest | TextureFilter.Linear;
 		setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
 		update(useMipMaps: boolean): void;
 		restore(): void;

+ 5 - 1
spine-ts/build/spine-webgl.js

@@ -6,6 +6,8 @@ var __extends = (this && this.__extends) || (function () {
 		return extendStatics(d, b);
 	};
 	return function (d, b) {
+		if (typeof b !== "function" && b !== null)
+			throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
 		extendStatics(d, b);
 		function __() { this.constructor = d; }
 		d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7423,7 +7425,9 @@ var spine;
 				return spine.SpacingMode.Fixed;
 			if (str == "percent")
 				return spine.SpacingMode.Percent;
-			throw new Error("Unknown position mode: " + str);
+			if (str == "proportional")
+				return spine.SpacingMode.Proportional;
+			throw new Error("Unknown spacing mode: " + str);
 		};
 		SkeletonJson.rotateModeFromString = function (str) {
 			str = str.toLowerCase();

文件差异内容过多而无法显示
+ 0 - 0
spine-ts/build/spine-webgl.js.map


+ 2 - 1
spine-ts/core/src/SkeletonJson.ts

@@ -1028,7 +1028,8 @@ module spine {
 			if (str == "length") return SpacingMode.Length;
 			if (str == "fixed") return SpacingMode.Fixed;
 			if (str == "percent") return SpacingMode.Percent;
-			throw new Error(`Unknown position mode: ${str}`);
+			if (str == "proportional") return SpacingMode.Proportional;
+			throw new Error(`Unknown spacing mode: ${str}`);
 		}
 
 		static rotateModeFromString (str: string) {

部分文件因为文件数量过多而无法显示