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

This commit is contained in:
badlogic 2021-04-14 17:45:39 +02:00
parent 1211c2a345
commit 6d7f29718b
19 changed files with 47 additions and 22 deletions

View File

@ -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;

View File

@ -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();

File diff suppressed because one or more lines are too long

View File

@ -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;
}

View File

@ -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();

File diff suppressed because one or more lines are too long

View File

@ -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;
}

View File

@ -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();

File diff suppressed because one or more lines are too long

View File

@ -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;

View File

@ -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();

File diff suppressed because one or more lines are too long

View File

@ -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;
}

View File

@ -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();

File diff suppressed because one or more lines are too long

View File

@ -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;

View File

@ -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();

File diff suppressed because one or more lines are too long

View File

@ -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) {