This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!Object.prototype.hasOwnProperty('iterate')) { | |
Object.defineProperty(Object.prototype, 'iterate', { | |
value : function (handler) { | |
Object.keys(this).forEach(function (key, index) { | |
handler.call(this, key, this[key], index); | |
}, this); | |
} | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Number.prototype.times = function(handler) { | |
var i = 0; while(i < this) handler.call(this, i++); | |
}; | |
Number(4).times(function(i) { | |
console.log(i) | |
}.bind(this)); | |
// 0 | |
// 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var path = window.location.pathname.replace(/(\/www|)\/[^\/]*$/, '/img/pictures/'); | |
if (path.match(/^\/([A-Z]\:)/)) { | |
path = path.slice(1); | |
} | |
console.log(fs.readdirSync(path)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var eventId = 1; | |
SceneManager._scene._spriteset._characterSprites.forEach(function(sprite) { | |
if (sprite._character instanceof Game_Event && sprite._character.eventId() === eventId) { | |
sprite._animationSprites.forEach(function(animation) { | |
animation.remove(); | |
}); | |
} | |
}); | |
SceneManager._scene._spriteset._characterSprites.forEach(function(sprite) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Game_Map.prototype.refereshVehicles = function() { | |
this._vehicles.forEach(function(vehicle) { | |
vehicle.refresh(); | |
}); | |
}; | |
Game_Map.prototype.refreshVehicles = function() { | |
this._vehicles.forEach(function(vehicle) { | |
vehicle.refresh(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var value = BattleManager._subject instanceof Game_Actor; | |
$gameSwitches.setValue(100, value); | |
alert($gameSwitches.value(100)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* アイコンを表示するために変更した箇所 開始 */ | |
var _Window_Options_drawItem = Window_Options.prototype.drawItem; | |
Window_Options.prototype.drawItem = function(index) { | |
_Window_Options_drawItem.apply(this, arguments); | |
var rect = this.itemRectForText(index); | |
this.drawIcon(this.statusIcon(index), rect.width - Window_Base._iconWidth, rect.y + 2); | |
}; | |
Window_Options.prototype.statusIcon = function(index) { | |
var symbol = this.commandSymbol(index); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getClassName = function(object) { | |
return object.constructor.toString().replace(/function\s+(.*)\s*\([\s\S]*/m, '$1'); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pictName = 'ピクチャ名'; | |
var bitmap = ImageManager.loadPicture(pictName); | |
bitmap.addLoadListener(function() { | |
$gameScreen.picture(ピクチャ番号)._name = pictName; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var min = $gameVariables.value(1); | |
var max = $gameVariables.value(2); | |
$gameVariables.setValue(3, min + Math.randomInt(max - min + 1)); |
OlderNewer