diff --git a/spine-ts/spine-construct3/src/c3runtime/instance.ts b/spine-ts/spine-construct3/src/c3runtime/instance.ts index 812459b19..125b44a69 100644 --- a/spine-ts/spine-construct3/src/c3runtime/instance.ts +++ b/spine-ts/spine-construct3/src/c3runtime/instance.ts @@ -71,11 +71,8 @@ class DrawingInstance extends globalThis.ISDKWorldInstanceBase { return; } - // workaround to request a redraw: https://github.com/Scirra/Construct-feature-requests/issues/615 - this.x++; - this.x--; - this.update(this.dt); + this.runtime.sdk.updateRender(); } private async loadSkeleton () { diff --git a/spine-ts/spine-construct3/ts-defs/plugins/File system/IFileSystemObjectType.d.ts b/spine-ts/spine-construct3/ts-defs/plugins/File system/IFileSystemObjectType.d.ts new file mode 100644 index 000000000..720a60b4c --- /dev/null +++ b/spine-ts/spine-construct3/ts-defs/plugins/File system/IFileSystemObjectType.d.ts @@ -0,0 +1,95 @@ + +/** Represents the File System object. + * @see {@link https://www.construct.net/make-games/manuals/construct-3/scripting/scripting-reference/plugin-interfaces/file-system | IFileSystemObjectType documentation } */ + +interface FSAcceptType { + description: string, + accept: { + [key: string]: string[] + } +} + +type FSStartInLocation = "default" | "desktop" | "documents" | "downloads" | "music" | "pictures" | "videos"; +type FSFolderPickerMode = "read" | "readwrite"; +type FSWriteFileMode = "overwrite" | "append"; +type FSReadFileMode = "text" | "binary"; + +interface FSSaveFilePickerOpts { + pickerTag: string; + acceptTypes?: FSAcceptType[]; + showAcceptAll?: boolean; + suggestedName?: string; + id?: string; + startIn?: FSStartInLocation; +} + +interface FSOpenFilePickerOpts { + pickerTag: string; + acceptTypes?: FSAcceptType[]; + showAcceptAll?: boolean; + multiple?: boolean; + id?: string; + startIn?: FSStartInLocation +} + +interface FSFolderPickerOpts { + pickerTag: string; + mode?: FSFolderPickerMode; + id?: string; + startIn?: FSStartInLocation +} + +interface FSWriteFileOpts { + pickerTag: string; + folderPath?: string; + fileTag?: string; + data: string | ArrayBuffer; + mode?: FSWriteFileMode +} + +interface FSReadFileOpts { + pickerTag: string; + folderPath?: string; + fileTag?: string; + mode: FSReadFileMode; +} + +interface FSListContentResult { + files: string[], + folders: string[] +} + +interface FSDropEvent extends ConstructEvent { + files: File[] +} + +interface FSObjectTypeEventMap extends ObjectClassEventMap { + "drop": FSDropEvent +} + +declare class IFileSystemObjectType extends IObjectType +{ + addEventListener>(type: K, listener: (ev: FSObjectTypeEventMap[K]) => any): void; + removeEventListener>(type: K, listener: (ev: FSObjectTypeEventMap[K]) => any): void; + + readonly isSupported: boolean; + readonly desktopFeaturesSupported: boolean; + + hasPickerTag(pickerTag: string): boolean; + + showSaveFilePicker(opts: FSSaveFilePickerOpts): Promise; + showOpenFilePicker(opts: FSOpenFilePickerOpts): Promise; + showFolderPicker(opts: FSFolderPickerOpts): Promise; + + writeFile(opts: FSWriteFileOpts): Promise; + readFile(opts: FSReadFileOpts): Promise; + + createFolder(pickerTag: string, folderPath: string, fileTag?: string): Promise; + copyFile(pickerTag: string, srcFolderPath: string, destFolderPath: string, fileTag?: string): Promise; + moveFile(pickerTag: string, srcFolderPath: string, destFolderPath: string, fileTag?: string): Promise; + delete(pickerTag: string, folderPath?: string, isRecursive?: boolean, fileTag?: string): Promise; + listContent(pickerTag: string, folderPath?: string, isRecursive?: boolean, fileTag?: string): Promise; + + shellOpen(pickerTag: string, filePath?: string, fileTag?: string): Promise; + runFile(pickerTag: string, filePath?: string, args?: string, fileTag?: string): Promise; +} diff --git a/spine-ts/spine-construct3/ts-defs/runtime/ISDKUtils.d.ts b/spine-ts/spine-construct3/ts-defs/runtime/ISDKUtils.d.ts index 90284b51a..ad188dc12 100644 --- a/spine-ts/spine-construct3/ts-defs/runtime/ISDKUtils.d.ts +++ b/spine-ts/spine-construct3/ts-defs/runtime/ISDKUtils.d.ts @@ -2,6 +2,8 @@ /** Utility class for scripting APIs intended for the Addon SDK. */ declare class ISDKUtils { + updateRender(): void; + addLoadPromise(promise: Promise): void; sendWrapperExtensionMessage(wrapperComponentId: string, messageId: string, params?: WrapperExtensionParameterType[]): void;