Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
eecd8bc
Add evalRouteScript()
Sigureya Dec 3, 2018
5d15e41
add setupEvent()
Sigureya Dec 3, 2018
e5736e1
add evalScript()
Sigureya Dec 3, 2018
c2ef6d3
Fixed stack trace display.
Sigureya Dec 3, 2018
e4a3879
catchException() update
Sigureya Dec 3, 2018
e93f73f
Plug-in part of error log system.
Sigureya Dec 4, 2018
ff55f0b
Delete Game_Log.js
Sigureya Dec 4, 2018
eeb68ad
add Log Method
Sigureya Dec 4, 2018
dd1a32e
Add Log Method
Sigureya Dec 4, 2018
f658e4f
add debugName()
Sigureya Dec 4, 2018
5cc3e63
add DebugName()
Sigureya Dec 4, 2018
2f765f7
add debugName()
Sigureya Dec 4, 2018
6d8227f
add debugName()
Sigureya Dec 4, 2018
eb52c36
Add LogMethod(any)
Sigureya Dec 4, 2018
8a6dc70
add Log method
Sigureya Dec 4, 2018
fac955d
add Log System
Sigureya Dec 4, 2018
140ff65
Add Log System
Sigureya Dec 4, 2018
3abeacb
add LogSystem
Sigureya Dec 4, 2018
75d7e4b
Add LogSystemView
Sigureya Dec 4, 2018
5b9514e
add eventLog view
Sigureya Dec 4, 2018
3f0eaee
Add LogSystem Core
Sigureya Dec 4, 2018
8fc2eb9
add Game_Log.js
Sigureya Dec 4, 2018
6d787be
swap ( "Game_Log.js","Game_Interpreter.js")
Sigureya Dec 5, 2018
088215c
spell miss fix
Sigureya Dec 5, 2018
f3faf8d
spell miss fix
Sigureya Dec 5, 2018
7d9b8ad
BattleEvent fix & eventPageFix
Sigureya Dec 5, 2018
a0a53f7
clear Fix and message fix
Sigureya Dec 5, 2018
103452e
add show line
Sigureya Dec 5, 2018
de7f1f1
remove unused function
Sigureya Dec 8, 2018
acc3d21
アイテムからのコモンイベント呼び出しに対応
Sigureya Dec 8, 2018
5cb877a
無限ループで死んでいたのを修正 その他いろいろ
Sigureya Dec 11, 2018
e17d234
CommonEventLog Fix
Sigureya Dec 11, 2018
8d4739d
LogCommonEvent fix
Sigureya Dec 11, 2018
ae64fe6
remove setParent()
Sigureya Dec 11, 2018
db61025
fix errorLog Scirpt
Sigureya Dec 11, 2018
82d707c
style fix
Sigureya Dec 11, 2018
d77e556
setErrorDetailEnabled() param
Sigureya Dec 12, 2018
568d4c6
EnabledFlag
Sigureya Dec 12, 2018
b5b3cf7
change style
Sigureya Dec 13, 2018
55bd7f1
save style change
Sigureya Dec 13, 2018
f48f85a
save style change & massage bulid change
Sigureya Dec 13, 2018
ce2cb97
method name fix
Sigureya Dec 13, 2018
b4ab001
method name fix
Sigureya Dec 13, 2018
12a552e
remove unused method
Sigureya Dec 14, 2018
49df204
method move & delete getErrorLog()
Sigureya Dec 14, 2018
b0279f8
Critical Bug fix
Sigureya Dec 14, 2018
c3b3094
Error log lines fix
Sigureya Dec 14, 2018
9c87202
RouteError showLines
Sigureya Dec 14, 2018
16c837f
moveroute line
Sigureya Dec 14, 2018
774fd8d
moveroute line
Sigureya Dec 14, 2018
ffc463c
memberInit
Sigureya Dec 14, 2018
70fb3a9
more better pattern
Sigureya Dec 14, 2018
13410b0
log fix
Sigureya Dec 14, 2018
9c6e1bf
Add Log
Sigureya Dec 14, 2018
746c413
parallel fix
Sigureya Dec 14, 2018
3eeaf29
error lines fix
Sigureya Dec 14, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 40 additions & 15 deletions js/rpg_core/Graphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ function Graphics() {
Graphics._cssFontLoading = document.fonts && document.fonts.ready && document.fonts.ready.then;
Graphics._fontLoaded = null;
Graphics._videoVolume = 1;
Graphics._showErrorDetailEnabled = false;
Graphics._progressEnabled = false;
Graphics._errorMessage = "";

/**
* Initializes the graphics system.
Expand Down Expand Up @@ -411,24 +414,46 @@ Graphics.printError = function(name, message) {
this._clearUpperCanvas();
};

/**
* Shows the stacktrace of error.
*
* @static
* @method printStackTrace
*/
Graphics.printStackTrace = function(stack) {
if (this._errorPrinter) {
stack = (stack || '')
.replace(/file:.*js\//g, '')
.replace(/http:.*js\//g, '')
.replace(/https:.*js\//g, '')
.replace(/chrome-extension:.*js\//g, '')
.replace(/\n/g, '<br>');
this._makeStackTrace(decodeURIComponent(stack));
Graphics._makeErrorStackLog =function(e){
if(e.stack){
var log = e.stack.replace(/file:.*js\//g, '')
.replace(/http:.*js\//g, '')
.replace(/https:.*js\//g, '')
.replace(/chrome-extension:.*js\//g, '')
.replace(/\n/g, '<br>');
return log;
}
return '';
};
Graphics._makeEventInfo = function(e){
if(e.rpgmvErrorLog){
return e.rpgmvErrorLog.createErrorHTML();
}
return "";
};

Graphics.createErrorHTML = function(error){
return this._makeEventInfo(error)+ this._makeErrorStackLog(error);
};

Graphics.setErrorDetailEnabled =function(state){
this._showErrorDetailEnabled = !!state;
};

Graphics.printErrorDetail =function(e){
if ( this._showErrorDetailEnabled && this._errorPrinter){
var html = this.createErrorHTML(e);
var detail = document.createElement('div');
var style = detail.style;
style.color = 'white';
style.textAlign = 'left';
style.fontSize = '18px';
detail.innerHTML = html + '<br>' ;
this._errorPrinter.appendChild(detail);
}
};


/**
* Sets the error message.
*
Expand Down
11 changes: 9 additions & 2 deletions js/rpg_managers/SceneManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,18 @@ SceneManager.onKeyDown = function(event) {
}
};

SceneManager.showErrorLog = function(e){
console.error(e.stack);
if(e.rpgmvErrorLog){
console.error(e.rpgmvErrorLog.createConsoleMessage() );
}
};

SceneManager.catchException = function(e) {
if (e instanceof Error) {
Graphics.printError(e.name, e.message);
Graphics.printStackTrace(e.stack);
console.error(e.stack);
Graphics.printErrorDetail(e);
this.showErrorLog(e);
} else {
Graphics.printError('UnknownError', e);
}
Expand Down
21 changes: 20 additions & 1 deletion js/rpg_objects/Game_Character.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Game_Character.prototype.restoreMoveRoute = function() {
this._moveRoute = this._originalMoveRoute;
this._moveRouteIndex = this._originalMoveRouteIndex;
this._originalMoveRoute = null;
this._moveRouteLog = null;
};

Game_Character.prototype.isMoveRouteForcing = function() {
Expand Down Expand Up @@ -262,10 +263,28 @@ Game_Character.prototype.processMoveCommand = function(command) {
AudioManager.playSe(params[0]);
break;
case gc.ROUTE_SCRIPT:
eval(params[0]);
this.evalRouteScript(params[0]);
break;
}
};
Game_Character.prototype.evalRouteScript = function(script){
var gc = Game_Character;
try {
eval(script);
} catch (error) {

if(this._moveRouteLog){
this._moveRouteLog.setMoveRouteIndex(this._moveRouteIndex);
this._moveRouteLog.addLog('target:'+this.debugName());
this._moveRouteLog.addLog("script:"+script);
this.saveErrorCode(error);
}
throw(error);
}
};
Game_Character.prototype.saveErrorCode =function(exeption){
exeption.rpgmvErrorLog = this._moveRouteLog;
};

Game_Character.prototype.deltaXFrom = function(x) {
return $gameMap.deltaX(this.x, x);
Expand Down
9 changes: 9 additions & 0 deletions js/rpg_objects/Game_CharacterBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Game_CharacterBase.prototype.initMembers = function() {
this._jumpCount = 0;
this._jumpPeak = 0;
this._movementSuccess = true;
this._moveRouteLog =null;
};

Game_CharacterBase.prototype.pos = function(x, y) {
Expand Down Expand Up @@ -588,3 +589,11 @@ Game_CharacterBase.prototype.endAnimation = function() {
Game_CharacterBase.prototype.endBalloon = function() {
this._balloonPlaying = false;
};

Game_CharacterBase.prototype.setMoveRouteLog = function(callLog){
this._moveRouteLog = callLog;
};
Game_CharacterBase.prototype.debugName = function(){
return "CharacterBase";
};

6 changes: 5 additions & 1 deletion js/rpg_objects/Game_CommonEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ Game_CommonEvent.prototype.isActive = function() {
return event.trigger === 2 && $gameSwitches.value(event.switchId);
};

Game_CommonEvent.prototype.setupEvent = function(){
this._interpreter.setup(this.list());
this._interpreter.setEventCallLog(new Game_LogCommonEvent(this._commonEventId));
};
Game_CommonEvent.prototype.update = function() {
if (this._interpreter) {
if (!this._interpreter.isRunning()) {
this._interpreter.setup(this.list());
this.setupEvent();
}
this._interpreter.update();
}
Expand Down
24 changes: 23 additions & 1 deletion js/rpg_objects/Game_Event.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ Game_Event.prototype.list = function() {
return this.page().list;
};

Game_Event.prototype.debugName = function(){
var event = this.event();
if(event){
return "MapEvent:"+ this._eventId +"("+ event.name+")";
}
return "";
};

Game_Event.prototype.createLogClass = function(){
return new Game_LogMapEvent(
this._mapId,
this._eventId,
this._pageIndex
);
};

Game_Event.prototype.isCollidedWithCharacters = function(x, y) {
return (Game_Character.prototype.isCollidedWithCharacters.call(this, x, y) ||
this.isCollidedWithPlayerCharacters(x, y));
Expand Down Expand Up @@ -280,14 +296,19 @@ Game_Event.prototype.setupPageSettings = function() {
this.setThrough(page.through);
this.setMoveRoute(page.moveRoute);
this._moveType = page.moveType;

if(this._moveType === 3){
var log =new Game_LogMoveRoute(this.createLogClass());
this.setMoveRouteLog( log);
}

this._trigger = page.trigger;
if (this._trigger === 4) {
this._interpreter = new Game_Interpreter();
} else {
this._interpreter = null;
}
};

Game_Event.prototype.isOriginalPattern = function() {
return this.pattern() === this._originalPattern;
};
Expand Down Expand Up @@ -322,6 +343,7 @@ Game_Event.prototype.updateParallel = function() {
if (this._interpreter) {
if (!this._interpreter.isRunning()) {
this._interpreter.setup(this.list(), this._eventId);
this._interpreter.setEventCallLog(this.createLogClass());
}
this._interpreter.update();
}
Expand Down
5 changes: 5 additions & 0 deletions js/rpg_objects/Game_Follower.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@ Game_Follower.prototype.chaseCharacter = function(character) {
}
this.setMoveSpeed($gamePlayer.realMoveSpeed());
};

Game_Follower.prototype.debugName = function(){
return "follower[" + this._memberIndex+"]";
};

Loading