浏览代码

[ts][player] Fix error message in case WebGL context could not be created.

Mario Zechner 1 年之前
父节点
当前提交
ee72ad3e22
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      spine-ts/spine-player/src/Player.ts

+ 2 - 1
spine-ts/spine-player/src/Player.ts

@@ -336,7 +336,7 @@ export class SpinePlayer implements Disposable {
 			this.sceneRenderer = new SceneRenderer(this.canvas, this.context, true);
 			this.sceneRenderer = new SceneRenderer(this.canvas, this.context, true);
 			if (config.showLoading) this.loadingScreen = new LoadingScreen(this.sceneRenderer);
 			if (config.showLoading) this.loadingScreen = new LoadingScreen(this.sceneRenderer);
 		} catch (e) {
 		} catch (e) {
-			this.showError("Sorry, your browser does not support WebGL.\nPlease use the latest version of Firefox, Chrome, Edge, or Safari.", e as any);
+			this.showError("Sorry, your browser does not support WebG, or you have disabled WebGL in your browser settingsL.\nPlease use the latest version of Firefox, Chrome, Edge, or Safari.", e as any);
 			return null;
 			return null;
 		}
 		}
 
 
@@ -1060,6 +1060,7 @@ export class SpinePlayer implements Disposable {
 				+ message.replace("\n", "<br><br>") + `</div>`));
 				+ message.replace("\n", "<br><br>") + `</div>`));
 			if (this.config.error) this.config.error(this, message);
 			if (this.config.error) this.config.error(this, message);
 			throw (error ? error : new Error(message));
 			throw (error ? error : new Error(message));
+			console.log(error);
 		}
 		}
 	}
 	}
 }
 }