Please bare with me as I'm still in stage 1 of learning how to create plugins.
Now I wanted to test myself by creating a new window in the equip scene.
I plan to add many contents in this window but for now, I'm testing myself by just displaying the actor's name.
Just that and I'm already having an error at initialization @_@
The error is as the title say and here's my code...
I've been trying to make this work for the whole day. My mind is already going to explode but I still can't figure out what's wrong @_@
Now I wanted to test myself by creating a new window in the equip scene.
I plan to add many contents in this window but for now, I'm testing myself by just displaying the actor's name.
Just that and I'm already having an error at initialization @_@
The error is as the title say and here's my code...
Code:
(function () {
"use strict";
function Window_MiniDetails() {
this.initialize.apply(this, arguments);
};
Window_MiniDetails.prototype = Object.create(Window_Base.prototype);
Window_MiniDetails.prototype.constructor = Window_MiniDetails;
Window_MiniDetails.prototype.initialize = function() {
var lh = Window_Base.prototype.lineHeight()*2;
Window_Base.prototype.initialize.call(this, 0, 0, Graphics.boxWidth, lh);
this._actor = null;
this.refresh();
};
Window_MiniDetails.prototype.setActor = function(actor) {
if (this._actor === actor) return;
this._actor = actor;
this.refresh();
};
Window_MiniDetails.prototype.refresh = function() {
this.contents.clear();
if (!this._actor) return;
this.drawContents;
};
Window_MiniDetails.prototype.drawContents = function() {
this.drawActorName(this._actor, this.textPadding(), 0);
};
var SceneEquip_create = Scene_Equip.prototype.create
Scene_Equip.prototype.create = function() {
SceneEquip_create.call(this);
this.createMiniDetails();
this.refreshActor();
};
Scene_Equip.prototype.createMiniDetails = function() {
this._MiniDetailsWindow = Window_MiniDetails();
this._MiniDetailsWindow = new Window_MiniDetails();
this.addWindow(this._MiniDetailsWindow);
};
var SceneEquip_refreshActor = Scene_Equip.prototype.refreshActor;
Scene_Equip.prototype.refreshActor = function() {
SceneEquip_refreshActor.call(this);
if (this._MiniDetailsWindow) this._MiniDetailsWindow.setActor(this.actor());
};
})();
I've been trying to make this work for the whole day. My mind is already going to explode but I still can't figure out what's wrong @_@