From 34bd5a1479ba702c86fd79e2ef9414d363382544 Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Tue, 4 Nov 2025 17:05:39 +0100 Subject: [PATCH] Add is skeleton loaded condition. --- spine-ts/spine-construct3/src/aces.json | 5 +++++ spine-ts/spine-construct3/src/c3runtime/conditions.ts | 11 +++++++---- spine-ts/spine-construct3/src/lang/en-US.json | 5 +++++ spine-ts/spine-construct3/src/lang/zh-CN.json | 5 +++++ 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/spine-ts/spine-construct3/src/aces.json b/spine-ts/spine-construct3/src/aces.json index 3d3723a90..5e604423b 100644 --- a/spine-ts/spine-construct3/src/aces.json +++ b/spine-ts/spine-construct3/src/aces.json @@ -33,6 +33,11 @@ "id": "is-flipped-x", "scriptName": "IsFlippedX", "isTrigger": false + }, + { + "id": "is-skeleton-loaded", + "scriptName": "IsSkeletonLoaded", + "isTrigger": false } ], "actions": [ diff --git a/spine-ts/spine-construct3/src/c3runtime/conditions.ts b/spine-ts/spine-construct3/src/c3runtime/conditions.ts index 9fd515aa0..0ea55e31a 100644 --- a/spine-ts/spine-construct3/src/c3runtime/conditions.ts +++ b/spine-ts/spine-construct3/src/c3runtime/conditions.ts @@ -1,14 +1,14 @@ -import type { SDKInstanceClass } from "./instance.ts"; +import type { SDKInstanceClass as SpineC3Instance } from "./instance.ts"; const C3 = globalThis.C3; C3.Plugins.EsotericSoftware_SpineConstruct3.Cnds = { - OnSkeletonLoaded (this: SDKInstanceClass) { + OnSkeletonLoaded (this: SpineC3Instance) { return true; }, - OnAnimationEvent (this: SDKInstanceClass, event: string, track: number, animation: string) { + OnAnimationEvent (this: SpineC3Instance, event: string, track: number, animation: string) { console.log(this.triggeredEventName === event && this.triggeredEventTrack === track && this.triggeredEventAnimation === animation); @@ -16,7 +16,10 @@ C3.Plugins.EsotericSoftware_SpineConstruct3.Cnds = && this.triggeredEventTrack === track && this.triggeredEventAnimation === animation; }, - IsFlippedX (this: SDKInstanceClass) { + IsFlippedX (this: SpineC3Instance) { return this.propFlipX; }, + IsSkeletonLoaded (this: SpineC3Instance) { + return this.skeletonLoaded; + }, }; diff --git a/spine-ts/spine-construct3/src/lang/en-US.json b/spine-ts/spine-construct3/src/lang/en-US.json index f4dc98061..6011e00b5 100644 --- a/spine-ts/spine-construct3/src/lang/en-US.json +++ b/spine-ts/spine-construct3/src/lang/en-US.json @@ -103,6 +103,11 @@ "list-name": "Is flipped X", "display-text": "Is flipped X", "description": "Check if the skeleton is flipped horizontally" + }, + "is-skeleton-loaded": { + "list-name": "Is skeleton loaded", + "display-text": "Is skeleton loaded", + "description": "Check if the skeleton has finished loading" } }, "actions": { diff --git a/spine-ts/spine-construct3/src/lang/zh-CN.json b/spine-ts/spine-construct3/src/lang/zh-CN.json index 1bfb084db..52e6c5ffb 100644 --- a/spine-ts/spine-construct3/src/lang/zh-CN.json +++ b/spine-ts/spine-construct3/src/lang/zh-CN.json @@ -103,6 +103,11 @@ "list-name": "是否水平翻转", "display-text": "是否水平翻转", "description": "检查骨架是否水平翻转" + }, + "is-skeleton-loaded": { + "list-name": "骨架是否已加载", + "display-text": "骨架是否已加载", + "description": "检查骨架是否已完成加载" } }, "actions": {