Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Reta = Reta || {};
- //=============================================================================
- /*:
- * @plugindesc Allows for creators to make custom actors on the fly
- * @author Reta
- *
- * @param Bitmap1
- * @default TV_Body_p01,0,0,0,0
- *
- * @param Bitmap2
- * @default TV_AccB_p05,0,0,0,0
- *
- * @param Bitmap3
- * @default TV_Clothing1_p04,0,0,0,0
- *
- * @param Bitmap4
- * @default TV_Clothing1_p04,0,0,0,0
- *
- * @param Bitmap5
- * @default TV_FrontHair1_p12,0,0,0,0
- *
- * @param Bitmap6
- * @default TV_RearHair1_p01,0,0,0,0
- *
- * @param Bitmap7
- * @default TV_RearHair2_p01,0,0,0,0
- *
- * @param Actor1
- * @default 1
- *
- * @param Actor2
- * @default 2
- *
- * @param Actor3
- * @default 3
- *
- * @param Actor4
- * @default 4
- * @help
- */
- //=============================================================================
- //=============================================================================
- // Parameter Variables
- //=============================================================================
- (function(){
- Reta.Param = Reta.Param || {};
- Reta.parameters = PluginManager.parameters('CustomActors');
- Reta.Param.Bitmap = [];
- Reta.Param.actorId = [Reta.parameters['Actor1'] , Reta.parameters['Actor2'] , Reta.parameters['Actor3'] , Reta.parameters['Actor4']];
- Reta.Param.init = function (){
- var temp = String(Reta.parameters['Bitmap1']).split(',');
- this.Bitmap[0] = [ temp[0], temp.slice(1)];
- temp = String(Reta.parameters['Bitmap7']).split(',');
- this.Bitmap[1] = [ temp[0], temp.slice(1)];
- temp = String(Reta.parameters['Bitmap3']).split(',');
- this.Bitmap[2] = [ temp[0], temp.slice(1)];
- temp = String(Reta.parameters['Bitmap6']).split(',');
- this.Bitmap[3] = [ temp[0], temp.slice(1)];
- temp = String(Reta.parameters['Bitmap5']).split(',');
- this.Bitmap[4] = [ temp[0], temp.slice(1)];
- temp = String(Reta.parameters['Bitmap2']).split(',');
- this.Bitmap[5] = [ temp[0], temp.slice(1)];
- };
- function clone (existingArray) {
- var newObj = (existingArray instanceof Array) ? [] : {};
- for (i in existingArray) {
- if (i == 'clone') continue;
- if (existingArray[i] && existingArray[i] instanceof Array) {
- newObj[i] = clone(existingArray[i]);
- } else {
- newObj[i] = existingArray[i]
- }
- }
- return newObj;
- }
- function deepClone(arr) {
- var len = arr.length;
- var newArr = new Array(len);
- for (var i=0; i<len; i++) {
- if (Array.isArray(arr[i])) {
- newArr[i] = deepClone(arr[i]);
- }
- else {
- newArr[i] = arr[i];
- }
- }
- return newArr;
- }
- Reta.Param.init();
- ImageData.prototype.clone = function(){
- var contextBMP = new Bitmap(this.width, this.height);
- var context = contextBMP.context;
- var cloneData = context.createImageData(this.width, this.height);
- console.log(this);
- for(var i = 0; i < this.data.length; i+=4)
- {
- cloneData.data[i+0]=this.data[i+0];
- cloneData.data[i+1]=this.data[i+1];
- cloneData.data[i+2]=this.data[i+2];
- cloneData.data[i+3]=this.data[i+3];
- }
- //cloneData.data = deepClone(this.data);
- return cloneData;
- }
- Reta.Param.setDirectory = function(){
- for(i = 0; i < this.Bitmap.length; i++)
- {
- this.Bitmap[i][0] = "custom/" + this.Bitmap[i][0];
- }
- };
- Reta.Param.setDirectory();
- var _getAllFilesFromFolder = function(dir) {
- var filesystem = require("fs");
- var results = [];
- filesystem.readdirSync(dir).forEach(function(file) {
- var curFS = dir+'/'+file;
- var stat = filesystem.statSync(curFS);
- if (stat && stat.isDirectory()) {
- results = results.concat(_getAllFilesFromFolder(curFS))
- } else results.push(curFS);
- });
- return results;
- };
- Reta.Param.Dir = _getAllFilesFromFolder("www/img/custom");
- Array.prototype.pixelSort = function (pixel, max){
- for(var j = 0; j < pixel.length; j+=4){
- if(pixel[3+j] > 0){
- var temp = pixel.subarray(j,3+j);
- var test = false;
- for(var i = 0; i < this.length; i++)
- {
- if(this[i][0] === temp[0]
- && this[i][1] === temp[1]
- && this[i][2] === temp[2]){
- test = true;
- break;
- }
- }
- //console.log(test);
- if(test === false){
- //console.log("found one");
- this[this.length] = temp;
- if(this.length >= max) return true;
- }
- }
- }
- }
- //=============================================================================
- // Image Manager
- //=============================================================================
- Reta.Sprite_Proto_initialize = Sprite.prototype.initialize;
- Sprite.prototype.initialize = function(bitmap) {
- Reta.Sprite_Proto_initialize.call(this, bitmap);
- this._isComposite = false;
- }
- Reta.ImageManager_isBigCharacter = function(filename)
- {
- if(filename instanceof Array)
- {
- //console.log("Array Reta.ImageManager_isBigCharacter");
- return true;
- }
- else
- {
- return ImageManager.isBigCharacter(filename);
- }
- };
- Reta.ImageManager_isObjectCharacter = function(filename) {
- if(filename instanceof Array)
- {
- var sign = filename[0][0].match(/^[\!\$]+/);
- return sign && sign[0].contains('!');
- }
- else
- {
- return ImageManager.isObjectCharacter(filename);
- }
- };
- //=============================================================================
- // Sprite Character
- //=============================================================================
- Sprite_Character.prototype.initMembers = function() {
- this.anchor.x = 0.5;
- this.anchor.y = 1;
- this._character = null;
- this._balloonDuration = 0;
- this._tilesetId = 0;
- this._upperBody = null;
- this._lowerBody = null;
- this._layers = [null];
- };
- Sprite_Character.prototype.setCharacterBitmap = function() {
- //if(!this.random)this.random = Math.floor(Math.random()*20000);
- if(this._character instanceof Game_Follower || this._character instanceof Game_Player)
- {
- console.log(true);
- if(this._character.actor()._characterBitmap instanceof Bitmap)
- {
- this.bitmap = this._character.actor()._characterBitmap;
- this.bitmap._setDirty;
- this._isBigCharacter = true;
- }
- }
- else
- {
- this.bitmap = ImageManager.loadCharacter(this._characterName);
- this._isBigCharacter = Reta.ImageManager_isBigCharacter(this._characterName);
- }
- };
- //Reta.Sprite_Character_Proto_updateBitmap = Sprite_Character.prototype.updateBitmap;
- Sprite_Character.prototype.updateBitmap = function() {
- if(this._characterName instanceof Array)
- {
- //console.log("Array Reta.Sprite_Character_Proto_updateBitmap ");
- if (this.isImageChanged())
- {
- this._tilesetId = $gameMap.tilesetId();
- this._tileId = this._character.tileId();
- //this._characterName.every(function(element, index) { element = this._character.characterName()[index] } )
- console.log("Changed Image");
- console.log(this._characterName);
- console.log(this._character.characterName().slice());
- this._characterName = this._character.characterName().slice();
- this._characterIndex = this._character.characterIndex();
- if (this._tileId > 0) {
- this.setTileBitmap();
- } else {
- this.setCharacterBitmap();
- }
- }
- }
- else{
- //Reta.Sprite_Character_Proto_updateBitmap.call(this);
- if (this.isImageChanged())
- {
- this._tilesetId = $gameMap.tilesetId();
- this._tileId = this._character.tileId();
- //this._characterName.every(function(element, index) { element = this._character.characterName()[index] } )
- this._characterName = this._character.characterName();
- this._characterIndex = this._character.characterIndex();
- if (this._tileId > 0) {
- this.setTileBitmap();
- } else {
- this.setCharacterBitmap();
- }
- }
- }
- };
- //Reta.Sprite_Character_Proto_isImageChanged = Sprite_Character.prototype.isImageChanged;
- Sprite_Character.prototype.isImageChanged = function() {
- if(this._characterName instanceof Array)
- {
- //console.log("Array Reta.Sprite_Character_Proto_isImageChanged ");
- //console.log(this._characterName.every(function(element, index) { return element === this._character.characterName()[index] } ));
- return (this._tilesetId !== $gameMap.tilesetId() ||
- this._tileId !== this._character.tileId() ||
- //this._characterName.every(function(element, index) { return element === this._character.characterName()[index] } ) ||
- this._characterName[0][0] !== this._character.characterName()[0][0] ||
- this._characterIndex !== this._character.characterIndex());
- }
- else{
- //Reta.Sprite_Character_Proto_isImageChanged.call(this);
- return (this._tilesetId !== $gameMap.tilesetId() ||
- this._tileId !== this._character.tileId() ||
- this._characterName !== this._character.characterName() ||
- this._characterIndex !== this._character.characterIndex());
- }
- };
- Sprite_Character.prototype.createLayeredSprites = function(number) {
- if (!this._layers[number]) {
- this._layers[number] = new Sprite();
- this._layers[number].anchor.x = this.anchor.x;
- this._layers[number].anchor.y = this.anchor.y;
- this._layers[number]._character = this._character;
- this._layers[number]._characterIndex = this._characterIndex;
- //this._layers[number].
- this.addChild(this._layers[number]);
- }
- };
- Sprite_Character.prototype.updateCharacterFrame = function() {
- var pw = this.patternWidth();
- var ph = this.patternHeight();
- var sx = (this.characterBlockX() + this.characterPatternX()) * pw;
- var sy = (this.characterBlockY() + this.characterPatternY()) * ph;
- //console.log("Update Frame");
- this.updateHalfBodySprites();
- if (this._bushDepth > 0) {
- var d = this._bushDepth;
- this._upperBody.setFrame(sx, sy, pw, ph - d);
- this._lowerBody.setFrame(sx, sy + ph - d, pw, d);
- this.setFrame(sx, sy, 0, ph);
- for(i = 0; i < this._layers.length; i++)
- {
- this.createLayeredSprites(i);
- if(this._layers[i] == null)
- {
- break;
- }
- else
- //console.log("Update Frame child Bush");
- this._layers[i].setFrame(sx, sy, 0, ph);
- }
- } else {
- this.setFrame(sx, sy, pw, ph);
- for(i = 0; i < this._layers.length; i++)
- {
- this.createLayeredSprites(i);
- if(this._layers[i] == null)
- {
- break;
- }
- else
- {
- //console.log("Update Frame child");
- this._layers[i].setFrame(sx, sy, pw, ph);
- }
- }
- }
- };
- //=============================================================================
- // Game Character
- //=============================================================================
- Reta.Game_CharacterBase_Proto_initMembers = Game_CharacterBase.prototype.initMembers;
- Game_CharacterBase.prototype.initMembers = function()
- {
- //console.log("Array Reta.Game_Character_Proto_initMembers ");
- Reta.Game_CharacterBase_Proto_initMembers.call(this);
- this._defaultCharacterName = '';
- };
- //Reta.Game_CharacterBase_Proto_characterName = Game_CharacterBase.prototype.characterName;
- Game_CharacterBase.prototype.characterName = function() {
- if(this._characterName instanceof Array)
- {
- //console.log("Array Reta.GCBcN ");
- return this._characterName.slice();
- }
- else
- {
- return this._characterName;
- }
- };
- //Reta.Game_CharacterBase_Proto_setImage = Game_CharacterBase.prototype.setImage;
- Game_CharacterBase.prototype.setImage = function(characterName, characterIndex) {
- if(characterName instanceof Array)
- {
- //console.log("Array Reta.GCBsI ");
- this._tileId = 0;
- this._characterName = characterName.slice();
- this._characterIndex = characterIndex;
- // console.log(this._characterName[0][0]);
- this._isObjectCharacter = Reta.ImageManager_isObjectCharacter(characterName);
- }
- else
- {
- //Reta.Game_CharacterBase_Proto_setImage.call(this, characterName, characterIndex);
- // console.log("Array Reta.GCBsI ");
- this._tileId = 0;
- this._characterName = characterName;
- this._characterIndex = characterIndex;
- this._isObjectCharacter = Reta.ImageManager_isObjectCharacter(characterName);
- }
- };
- //=============================================================================
- // Game Actor
- //=============================================================================
- Reta.Game_Actor_Proto_initMembers = Game_Actor.prototype.initMembers;
- Game_Actor.prototype.initMembers = function() {
- Reta.Game_Actor_Proto_initMembers.call(this);
- this._magic = 'undefined';
- this._characterBitmap = {};
- this._faceBitmap = {};
- this._battlerBitmap = {};
- this._characterArray = [];
- }
- Reta.Game_Actor_Proto_Setup = Game_Actor.prototype.setup;
- Game_Actor.prototype.setup = function (actorId)
- {
- Reta.Game_Actor_Proto_Setup.call(this, actorId);
- //this._isComposite = false;
- this._magic = 'undefined';
- for( i = 0; i < Reta.Param.actorId.length ; i++)
- {
- if($dataActors[Number(Reta.Param.actorId[i])] == this.actor())
- {
- // console.log("Before Set Image" + i);
- this._characterArray = deepClone(Reta.Param.Bitmap);
- for(j = 0; j < this._characterArray[5][1].length; j++)
- {
- this._characterArray[5][1][j] = Math.floor(Math.random() * 69);
- }
- //this.setCharacterImage(this._imageArray, 0);
- // console.log(this._imageArray);
- //this._isComposite = true;
- }
- }
- console.log(this._characterArray);
- this.setBitmaps();
- };
- Game_Actor.prototype.setBitmaps = function(){
- if(this._characterArray instanceof Array && this._characterArray != [])
- {
- var tempmap = ImageManager.loadCharacter(this._characterArray[0][0]);
- this._characterBitmap = new Bitmap(tempmap.width, tempmap.height);
- tempmap.addLoadListener(function(){
- this._characterBitmap.blt(tempmap, 0, 0, tempmap.width, tempmap.height,0,0);
- for(var i = 1; i < this._characterArray.length; i++)
- {
- var characterRGB = this._characterArray[i][1];
- var bitmap = ImageManager.loadCharacter(this._characterArray[i][0]);
- var overlay = new Bitmap(bitmap.width, bitmap.height);
- var sub = ImageManager.loadCharacter(this._characterArray[i][0] + '_c');
- bitmap.addLoadListener(function(){
- overlay.blt(bitmap, 0, 0, overlay.width, overlay.height, 0,0)
- for (var j = 0; j < characterRGB.length; j++)
- {
- if(characterRGB[j] < 70 && characterRGB[j] >= 0){
- overlay.setGradient(characterRGB[j],j,sub);
- }
- }
- this._characterBitmap.blt(overlay, 0, 0, bitmap.width, bitmap.height,0 ,0);
- }.bind(this, characterRGB));
- }
- }.bind(this));
- }
- };
- //Reta.Game_Actor_Proto_characterName = Game_Actor.prototype.characterName;
- Game_Actor.prototype.characterName = function() {
- if(this._characterName instanceof Array)
- { //console.log("Array Reta.GAcN ");
- return this._characterName.slice();
- }
- else
- return this._characterName;
- };
- //Reta.Game_Actor_Proto_initImages = Game_Actor.prototype.initImages;
- Game_Actor.prototype.initImages = function() {
- var actor = this.actor();
- if(actor.characterName instanceof Array)
- {
- // console.log("Array Reta.GAiI ");
- console.log("INIT IMAGES");
- console.log(this._characterName);
- this._characterName = actor.characterName.slice();
- console.log(this._characterName);
- }
- else
- {
- this._characterName = actor.characterName;
- }
- this._characterIndex = actor.characterIndex;
- this._faceName = actor.faceName;
- this._faceIndex = actor.faceIndex;
- this._battlerName = actor.battlerName;
- };
- //Reta.Game_Actor_Proto_setCharacterImage = Game_Actor.prototype.setCharacterImage;
- Game_Actor.prototype.setCharacterImage = function(characterName, characterIndex) {
- if(characterName instanceof Array)
- {
- // console.log("Array Reta.GAcI ");
- console.log("SET CHARACTER IMAGE");
- console.log(this._characterName);
- this._defaultCharacterName = this.characterName;
- this._characterName = characterName.slice();
- this._characterIndex = characterIndex;
- console.log(this._characterName);
- }
- else{
- //Reta.Game_Actor_Proto_setCharacterImage.call(this, characterName, characterIndex);
- this._characterName = characterName;
- this._characterIndex = characterIndex;
- }
- };
- Game_Player.prototype.actor = function(){
- return $gameParty.leader();
- };
- //=============================================================================
- // Bitmap
- //=============================================================================
- Reta.Bitmap_Proto_Init = Bitmap.prototype.initialize;
- Bitmap.prototype.initialize = function(width, height)
- {
- Reta.Bitmap_Proto_Init.call(this, width, height);
- };
- Bitmap.prototype.setAlphaColor = function(alpha)
- {
- var context = this._context;
- var imageData = context.getImageData(0, 0, this.width, this.height);
- var pixels = imageData.data;
- for (var i = 0; i < pixels.length; i += 4)
- {
- if(pixels[i + 3] > 0) pixels[i + 3] = alpha;
- }
- context.putImageData(imageData, 0, 0);
- };
- //70*4-1
- Bitmap.prototype.setGradient = function(number, subNumber, sub){
- var gradient = ImageManager.loadCharacter('custom/gradients');
- //var sub = ImageManager.loadCharacter(characterName + "_c");
- if(number < 0 || number > 69) {
- // console.log("Invalid Gradient");
- return;
- }
- function rgbToHsl(r, g, b)
- {
- var cmin = Math.min(r, g, b);
- var cmax = Math.max(r, g, b);
- var h = 0;
- var s = 0;
- var l = (cmin + cmax) / 2;
- var delta = cmax - cmin;
- if (delta > 0) {
- if (r === cmax) {
- h = 60 * (((g - b) / delta + 6) % 6);
- } else if (g === cmax) {
- h = 60 * ((b - r) / delta + 2);
- } else {
- h = 60 * ((r - g) / delta + 4);
- }
- s = delta / (255 - Math.abs(2 * l - 255));
- }
- return [h, s, l];
- }
- function hslToRgb(h, s, l)
- {
- var c = (255 - Math.abs(2 * l - 255)) * s;
- var x = c * (1 - Math.abs((h / 60) % 2 - 1));
- var m = l - c / 2;
- var cm = c + m;
- var xm = x + m;
- if (h < 60) {
- return [cm, xm, m];
- } else if (h < 120) {
- return [xm, cm, m];
- } else if (h < 180) {
- return [m, cm, xm];
- } else if (h < 240) {
- return [m, xm, cm];
- } else if (h < 300) {
- return [xm, m, cm];
- } else {
- return [cm, m, xm];
- }
- }
- sub.addLoadListener(function(){
- gradient.addLoadListener(function(){
- var context = this._context;
- var imageData = context.getImageData(0, 0, this.width, this.height);
- var pixels = imageData.data;
- var gradientContext = gradient._context;
- var gradientImageData = gradientContext.getImageData(0, 0, 256, 280);
- var gradientPixels = gradientImageData.data;
- var gradientRow = (256/*Gradient Width*/ * number * 4/*Single Gradient Height*/);
- var subContext = sub._context;
- var subImageData = subContext.getImageData(0, 0, this.width, this.height);
- var subPixels = subImageData.data;
- var subColor = [];
- //console.log("sub Color Test = " + subColor.pixelSort(subPixels.subarray(), subNumber+1));
- subColor.pixelSort(subPixels.subarray(), subNumber+1);
- //console.log(subColor);
- if(subColor === undefined || subColor[0] === undefined) return;
- while(subColor[subNumber] === undefined) {
- subNumber--;
- if(subNumber < 0) return;
- }
- for (var i = 0; i < pixels.length; i += 4) {
- if(subPixels[i + 0] == subColor[subNumber][0] && subPixels[i + 1] == subColor[subNumber][1] && subPixels[i + 2] == subColor[subNumber][2])
- {
- var hsl = rgbToHsl(pixels[i + 0], pixels[i + 1], pixels[i + 2]);
- //console.log(hsl);
- var code = 255-Math.floor(hsl[2]);
- pixels[i + 0] = gradientPixels[((gradientRow + code)*4) + 0];
- pixels[i + 1] = gradientPixels[((gradientRow + code)*4) + 1];
- pixels[i + 2] = gradientPixels[((gradientRow + code)*4) + 2];
- //console.log([pixels[i+0],pixels[i+1],pixels[i+2]]);
- }
- }
- context.putImageData(imageData, 0, 0);
- this._setDirty();
- }.bind(this))}.bind(this))
- }
- Bitmap.prototype.reload = function() {
- var bitmap = new Bitmap();
- bitmap._image = new Image();
- bitmap._image.src = this._url;
- bitmap._image.onload = Bitmap.prototype._onLoad.bind(bitmap);
- bitmap._image.onerror = Bitmap.prototype._onError.bind(bitmap);
- bitmap._url = this._url;
- bitmap._isLoading = true;
- return bitmap;
- };
- //=============================================================================
- // Data Manager
- //=============================================================================
- Reta.DataManager_loadAllSavefileImages = function() {
- var globalInfo = DataManager.loadGlobalInfo();
- if (globalInfo) {
- for (var i = 1; i < globalInfo.length; i++) {
- if (DataManager.isThisGameFile(i)) {
- var info = globalInfo[i];
- this.DataManager_loadSavefileImages(info);
- }
- }
- }
- };
- Reta.DataManager_loadSavefileImages = function(info) {
- if (info.characters) {
- for (var i = 0; i < info.characters.length; i++) {
- if(info.characters[i][0] instanceof Array)
- {
- for(j = 0; j < info.characters[i][0].length; j++)
- {
- ImageManager.loadCharacter(info.characters[i][0][j][0]);
- }
- } else {
- ImageManager.loadCharacter(info.characters[i][0]);
- }
- }
- }
- if (info.faces) {
- for (var j = 0; j < info.faces.length; j++) {
- ImageManager.loadFace(info.faces[j][0]);
- }
- }
- };
- //=============================================================================
- // Scene File
- //=============================================================================
- Scene_File.prototype.create = function() {
- Scene_MenuBase.prototype.create.call(this);
- Reta.DataManager_loadAllSavefileImages();
- this.createHelpWindow();
- this.createListWindow();
- };
- //=============================================================================
- // Window Base
- //=============================================================================
- Window_Base.prototype.initialize = function(x, y, width, height) {
- Window.prototype.initialize.call(this);
- this.loadWindowskin();
- this.move(x, y, width, height);
- this.updatePadding();
- this.updateBackOpacity();
- this.updateTone();
- this.createContents();
- this._layers = [];
- this._opening = false;
- this._closing = false;
- this._dimmerSprite = null;
- };
- Reta.Window_Base_Proto_drawCharacter = Window_Base.prototype.drawCharacter;
- Window_Base.prototype.drawCharacter = function(characterName, characterIndex, x, y) {
- if(characterName instanceof Array)
- {
- var number = 0;
- for(i = 0; i < characterName.length; i++)
- {
- var bitmap = ImageManager.loadCharacter(characterName[i][0]);
- var overlay = new Bitmap(bitmap.width, bitmap.height);
- var storemap = new Bitmap(bitmap.width, bitmap.height);
- var characterRGB = characterName[i][1].slice();
- var characterNameCur = characterName[i][0];
- var big = Reta.ImageManager_isBigCharacter(characterName);
- var pw = bitmap.width / (big ? 3 : 12);
- var ph = bitmap.height / (big ? 4 : 8);
- var n = characterIndex;
- var sx = (n % 4 * 3 + 1) * pw;
- var sy = (Math.floor(n / 4) * 4) * ph;
- bitmap.addLoadListener(function(){
- overlay.blt(bitmap, 0,0, overlay.width, overlay.height, 0,0);
- //console.log(overlay._url);
- var sub = ImageManager.loadCharacter(characterNameCur + "_c");
- for (var i = 0; i < characterRGB.length; i++)
- {
- if(characterRGB[i] < 70 && characterRGB[i] >= 0){
- overlay.setGradient(characterRGB[i],i,sub);
- }
- }
- this.contents.blt(overlay, sx, sy, pw, ph, x - pw / 2, y - ph);
- storemap.blt(overlay, 0, 0, bitmap.width, bitmap.height,0, 0);
- number++;
- if(number >= characterName.length){
- var context = storemap._context;
- var imageData = context.getImageData(0, 0, storemap.width, storemap.height);
- characterName[0] = characterNameCur;
- characterName[1] = imageData.data.subarray();
- }
- }.bind(this));
- }
- }
- else
- {
- Reta.Window_Base_Proto_drawCharacter.call(this, characterName, characterIndex, x, y);
- }
- };
- Window_Base.prototype.drawLayeredCharacter = function(number, width, height){
- if (!this._layers[number])
- {
- this._layers[number] = new Bitmap(this.contentsWidth(), this.contentsHeight());
- //this._layers[number].a
- this.addChild(this._layers[number]);
- }
- }
- Reta.DataManager_saveGameWithoutRescue = DataManager.saveGameWithoutRescue;
- DataManager.saveGameWithoutRescue = function(savefileId) {
- var temp = [];
- for(var i = 0; i < $gameActors._data.length; i++){
- if($gameActors._data[i])
- {
- temp[i] = $gameActors._data[i]._characterBitmap;
- $gameActors._data[i]._characterBitmap = {};
- }
- }
- var returnValue = Reta.DataManager_saveGameWithoutRescue.call(this, savefileId);
- for(var i = 0; i < $gameActors._data.length; i++){
- if($gameActors._data[i])
- {
- $gameActors._data[i]._characterBitmap = temp[i];
- }
- }
- return returnValue;
- };
- Window_SavefileList.prototype.drawContents = function(info, rect, valid) {
- console.log(info);
- var bottom = rect.y + rect.height;
- if (rect.width >= 420) {
- this.drawGameTitle(info, rect.x + 192, rect.y, rect.width - 192);
- if (valid) {
- this.drawPartyCharacters(info, rect.x + 220, bottom - 4);
- }
- }
- var lineHeight = this.lineHeight();
- var y2 = bottom - lineHeight;
- if (y2 >= lineHeight) {
- this.drawPlaytime(info, rect.x, y2, rect.width);
- }
- };
- })();
Add Comment
Please, Sign In to add comment