소스 검색

[ts][player] more clean-up.

badlogic 6 년 전
부모
커밋
3c61589312
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      spine-ts/widget/src/Player.ts

+ 5 - 3
spine-ts/widget/src/Player.ts

@@ -96,10 +96,10 @@
 		}
 		}
 
 
 		/* Optional: callback when the widget and its assets have been successfully loaded. */
 		/* Optional: callback when the widget and its assets have been successfully loaded. */
-		success: (widget: SpineWidget) => void
+		success: (widget: SpinePlayer) => void
 
 
-		/* Optional: callbacl when the widget could not be loaded. */
-		error: (widget: SpineWidget, msg: string) => void
+		/* Optional: callback when the widget could not be loaded. */
+		error: (widget: SpinePlayer, msg: string) => void
 	}
 	}
 
 
 	class Popup {
 	class Popup {
@@ -294,6 +294,7 @@
 			let errorDom = findWithClass(this.dom, "spine-player-error")[0];
 			let errorDom = findWithClass(this.dom, "spine-player-error")[0];
 			errorDom.classList.remove("spine-player-hidden");
 			errorDom.classList.remove("spine-player-hidden");
 			errorDom.innerHTML = `<p style="text-align: center; align-self: center;">${error}</p>`;
 			errorDom.innerHTML = `<p style="text-align: center; align-self: center;">${error}</p>`;
+			this.config.error(this, error);
 		}
 		}
 
 
 		render(): HTMLElement {
 		render(): HTMLElement {
@@ -754,6 +755,7 @@
 			// Setup the input processor and controllable bones
 			// Setup the input processor and controllable bones
 			this.setupInput();
 			this.setupInput();
 
 
+			this.config.success(this);
 			this.loaded = true;
 			this.loaded = true;
 		}
 		}