Skip to content

Commit 20f6db1

Browse files
committed
Revert "Merge pull request rpgtkoolmv#196 from Sigureya/ErrorLog2018_12"
This reverts commit 55b06d6, reversing changes made to 33b23be.
1 parent f507eec commit 20f6db1

16 files changed

+50
-419
lines changed

js/rpg_core/Graphics.js

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ function Graphics() {
1111
Graphics._cssFontLoading = document.fonts && document.fonts.ready && document.fonts.ready.then;
1212
Graphics._fontLoaded = null;
1313
Graphics._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(/file:.*js\//g, '')
435-
.replace(/http:.*js\//g, '')
436-
.replace(/https:.*js\//g, '')
437-
.replace(/chrome-extension:.*js\//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(/file:.*js\//g, '')
439+
.replace(/http:.*js\//g, '')
440+
.replace(/https:.*js\//g, '')
441+
.replace(/chrome-extension:.*js\//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

js/rpg_managers/SceneManager.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,18 +197,11 @@ SceneManager.onKeyDown = function(event) {
197197
}
198198
};
199199

200-
SceneManager.showErrorLog = function(e){
201-
console.error(e.stack);
202-
if(e.rpgmvErrorLog){
203-
console.error(e.rpgmvErrorLog.createConsoleMessage() );
204-
}
205-
};
206-
207200
SceneManager.catchException = function(e) {
208201
if (e instanceof Error) {
209202
Graphics.printError(e.name, e.message);
210-
Graphics.printErrorDetail(e);
211-
this.showErrorLog(e);
203+
Graphics.printStackTrace(e.stack);
204+
console.error(e.stack);
212205
} else {
213206
Graphics.printError('UnknownError', e);
214207
}

js/rpg_objects/Game_Character.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ Game_Character.prototype.restoreMoveRoute = function() {
8080
this._moveRoute = this._originalMoveRoute;
8181
this._moveRouteIndex = this._originalMoveRouteIndex;
8282
this._originalMoveRoute = null;
83-
this._moveRouteLog = null;
8483
};
8584

8685
Game_Character.prototype.isMoveRouteForcing = function() {
@@ -263,28 +262,10 @@ Game_Character.prototype.processMoveCommand = function(command) {
263262
AudioManager.playSe(params[0]);
264263
break;
265264
case gc.ROUTE_SCRIPT:
266-
this.evalRouteScript(params[0]);
265+
eval(params[0]);
267266
break;
268267
}
269268
};
270-
Game_Character.prototype.evalRouteScript = function(script){
271-
var gc = Game_Character;
272-
try {
273-
eval(script);
274-
} catch (error) {
275-
276-
if(this._moveRouteLog){
277-
this._moveRouteLog.setMoveRouteIndex(this._moveRouteIndex);
278-
this._moveRouteLog.addLog('target:'+this.debugName());
279-
this._moveRouteLog.addLog("script:"+script);
280-
this.saveErrorCode(error);
281-
}
282-
throw(error);
283-
}
284-
};
285-
Game_Character.prototype.saveErrorCode =function(exeption){
286-
exeption.rpgmvErrorLog = this._moveRouteLog;
287-
};
288269

289270
Game_Character.prototype.deltaXFrom = function(x) {
290271
return $gameMap.deltaX(this.x, x);

js/rpg_objects/Game_CharacterBase.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ Game_CharacterBase.prototype.initMembers = function() {
4848
this._jumpCount = 0;
4949
this._jumpPeak = 0;
5050
this._movementSuccess = true;
51-
this._moveRouteLog =null;
5251
};
5352

5453
Game_CharacterBase.prototype.pos = function(x, y) {
@@ -589,11 +588,3 @@ Game_CharacterBase.prototype.endAnimation = function() {
589588
Game_CharacterBase.prototype.endBalloon = function() {
590589
this._balloonPlaying = false;
591590
};
592-
593-
Game_CharacterBase.prototype.setMoveRouteLog = function(callLog){
594-
this._moveRouteLog = callLog;
595-
};
596-
Game_CharacterBase.prototype.debugName = function(){
597-
return "CharacterBase";
598-
};
599-

js/rpg_objects/Game_CommonEvent.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,10 @@ Game_CommonEvent.prototype.isActive = function() {
3636
return event.trigger === 2 && $gameSwitches.value(event.switchId);
3737
};
3838

39-
Game_CommonEvent.prototype.setupEvent = function(){
40-
this._interpreter.setup(this.list());
41-
this._interpreter.setEventCallLog(new Game_LogCommonEvent(this._commonEventId));
42-
};
4339
Game_CommonEvent.prototype.update = function() {
4440
if (this._interpreter) {
4541
if (!this._interpreter.isRunning()) {
46-
this.setupEvent();
42+
this._interpreter.setup(this.list());
4743
}
4844
this._interpreter.update();
4945
}

js/rpg_objects/Game_Event.js

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,6 @@ Game_Event.prototype.list = function() {
4848
return this.page().list;
4949
};
5050

51-
Game_Event.prototype.debugName = function(){
52-
var event = this.event();
53-
if(event){
54-
return "MapEvent: "+ this._eventId +"("+ event.name+")";
55-
}
56-
return "";
57-
};
58-
59-
Game_Event.prototype.createLogClass = function(){
60-
return new Game_LogMapEvent(
61-
this._mapId,
62-
this._eventId,
63-
this._pageIndex
64-
);
65-
};
66-
6751
Game_Event.prototype.isCollidedWithCharacters = function(x, y) {
6852
return (Game_Character.prototype.isCollidedWithCharacters.call(this, x, y) ||
6953
this.isCollidedWithPlayerCharacters(x, y));
@@ -296,19 +280,14 @@ Game_Event.prototype.setupPageSettings = function() {
296280
this.setThrough(page.through);
297281
this.setMoveRoute(page.moveRoute);
298282
this._moveType = page.moveType;
299-
300-
if(this._moveType === 3){
301-
var log =new Game_LogMoveRoute(this.createLogClass());
302-
this.setMoveRouteLog( log);
303-
}
304-
305283
this._trigger = page.trigger;
306284
if (this._trigger === 4) {
307285
this._interpreter = new Game_Interpreter();
308286
} else {
309287
this._interpreter = null;
310288
}
311289
};
290+
312291
Game_Event.prototype.isOriginalPattern = function() {
313292
return this.pattern() === this._originalPattern;
314293
};
@@ -343,7 +322,6 @@ Game_Event.prototype.updateParallel = function() {
343322
if (this._interpreter) {
344323
if (!this._interpreter.isRunning()) {
345324
this._interpreter.setup(this.list(), this._eventId);
346-
this._interpreter.setEventCallLog(this.createLogClass());
347325
}
348326
this._interpreter.update();
349327
}

js/rpg_objects/Game_Follower.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,3 @@ Game_Follower.prototype.chaseCharacter = function(character) {
5555
}
5656
this.setMoveSpeed($gamePlayer.realMoveSpeed());
5757
};
58-
59-
Game_Follower.prototype.debugName = function(){
60-
return "follower[" + this._memberIndex+"]";
61-
};
62-

0 commit comments

Comments
 (0)