/*:
* @plugindesc Modifies SRD_StatDistribution to remove the command window
* ALOE_SRD_StatDistribution_Mod
* @author Aloe Guvner
*
* @help
* The following modifications are done:
* 1. The command window no longer appears
* 2. The distribution window is auto selected
* 3. Pressing "Finish" from the distribution exits the scene
* 4. Pressing cancel from the distribution window also exist the scene
* 5. PageUp & PageDown switches actors in the distribution window
*
*/
(function(){
/** Overwrite this method to create the window but not add it visually to the scene */
Scene_Distribute.prototype.createCommandWindow = function() {
const wy = this._helpWindow.height;
this._commandWindow = new Window_DistributeCommand(0, wy);
this._commandWindow.setHelpWindow(this._helpWindow);
};
var Scene_Distribute_distributeFinish = Scene_Distribute.prototype.distributeFinish;
Scene_Distribute.prototype.distributeFinish = function() {
Scene_Distribute_distributeFinish.call(this);
this.popScene();
};
var Scene_Distribute_distributeCancel = Scene_Distribute.prototype.distributeCancel;
Scene_Distribute.prototype.distributeCancel = function() {
Scene_Distribute_distributeCancel.call(this);
this.popScene();
};
var Scene_Distribute_create = Scene_Distribute.prototype.create;
Scene_Distribute.prototype.create = function() {
Scene_Distribute_create.call(this);
this.commandSpend();
};
var Scene_Distribute_createDistributeWindow = Scene_Distribute.prototype.createDistributeWindow;
Scene_Distribute.prototype.createDistributeWindow = function() {
Scene_Distribute_createDistributeWindow.call(this);
this._distributeWindow.setHandler('pagedown', this.distributeNextActor.bind(this));
this._distributeWindow.setHandler('pageup', this.distributePreviousActor.bind(this));
};
Scene_Distribute.prototype.distributeNextActor = function() {
this._distributeWindow.restartInfo();
this.distributeEnd();
this.nextActor();
this.commandSpend();
};
Scene_Distribute.prototype.distributePreviousActor = function() {
this._distributeWindow.restartInfo();
this.distributeEnd();
this.previousActor();
this.commandSpend();
};
})();