@@ -11,9 +11,6 @@ function Graphics() {
1111Graphics . _cssFontLoading = document . fonts && document . fonts . ready && document . fonts . ready . then ;
1212Graphics . _fontLoaded = null ;
1313Graphics . _videoVolume = 1 ;
14- Graphics . _errorMessage = "" ;
15- Graphics . _showErrorDetailEnabled = false ;
16- Graphics . _progressEnabled = false ;
1714
1815/**
1916 * Initializes the graphics system.
@@ -429,46 +426,24 @@ Graphics.printError = function(name, message) {
429426 this . _clearUpperCanvas ( ) ;
430427} ;
431428
432- Graphics . _makeErrorStackLog = function ( e ) {
433- if ( e . stack ) {
434- var log = e . stack . replace ( / f i l e : .* j s \/ / g, '' )
435- . replace ( / h t t p : .* j s \/ / g, '' )
436- . replace ( / h t t p s : .* j s \/ / g, '' )
437- . replace ( / c h r o m e - e x t e n s i o n : .* j s \/ / g, '' )
438- . replace ( / \n / g, '<br>' ) ;
439- return log ;
440- }
441- return '' ;
442- } ;
443- Graphics . _makeEventInfo = function ( e ) {
444- if ( e . rpgmvErrorLog ) {
445- return e . rpgmvErrorLog . createErrorHTML ( ) ;
446- }
447- return "" ;
448- } ;
449-
450- Graphics . createErrorHTML = function ( error ) {
451- return this . _makeEventInfo ( error ) + this . _makeErrorStackLog ( error ) ;
452- } ;
453-
454- Graphics . setErrorDetailEnabled = function ( state ) {
455- this . _showErrorDetailEnabled = ! ! state ;
456- } ;
457-
458- Graphics . printErrorDetail = function ( e ) {
459- if ( this . _showErrorDetailEnabled && this . _errorPrinter ) {
460- var html = this . createErrorHTML ( e ) ;
461- var detail = document . createElement ( 'div' ) ;
462- var style = detail . style ;
463- style . color = 'white' ;
464- style . textAlign = 'left' ;
465- style . fontSize = '18px' ;
466- detail . innerHTML = html + '<br>' ;
467- this . _errorPrinter . appendChild ( detail ) ;
429+ /**
430+ * Shows the stacktrace of error.
431+ *
432+ * @static
433+ * @method printStackTrace
434+ */
435+ Graphics . printStackTrace = function ( stack ) {
436+ if ( this . _errorPrinter ) {
437+ stack = ( stack || '' )
438+ . replace ( / f i l e : .* j s \/ / g, '' )
439+ . replace ( / h t t p : .* j s \/ / g, '' )
440+ . replace ( / h t t p s : .* j s \/ / g, '' )
441+ . replace ( / c h r o m e - e x t e n s i o n : .* j s \/ / g, '' )
442+ . replace ( / \n / g, '<br>' ) ;
443+ this . _makeStackTrace ( decodeURIComponent ( stack ) ) ;
468444 }
469445} ;
470446
471-
472447/**
473448 * Sets the error message.
474449 *
@@ -925,6 +900,21 @@ Graphics._makeErrorMessage = function() {
925900 this . _errorPrinter . appendChild ( mainMessage ) ;
926901} ;
927902
903+ /**
904+ * @static
905+ * @method _makeStackTrace
906+ * @private
907+ */
908+ Graphics . _makeStackTrace = function ( stack ) {
909+ var stackTrace = document . createElement ( 'div' ) ;
910+ var style = stackTrace . style ;
911+ style . color = 'white' ;
912+ style . textAlign = 'left' ;
913+ style . fontSize = '18px' ;
914+ stackTrace . innerHTML = '<br><hr>' + stack + '<hr>' ;
915+ this . _errorPrinter . appendChild ( stackTrace ) ;
916+ } ;
917+
928918/**
929919 * @static
930920 * @method _createCanvas
0 commit comments