Hey everyone, working on my next script conversion but I am running into a strange issue. Whenever I attempt to close the scene RMMV just freezes with no errors. I think it might be something with the code but I have not been able to figure it out yet. Will post my scene code below, if you need more of the code just ask.
I have tried binding scenePop to the actPane cancel event and doing it as shown above where I am calling SceneManager.pop() directly.
Thanks.
Code:
/* Scene_Bank */
Scene_Bank.prototype = Object.create(Scene_MenuBase.prototype);
Scene_Bank.prototype.constructor = Scene_Bank;
Scene_Bank.prototype.initialize = function(){
Scene_MenuBase.prototype.initialize.call(this);
};
Scene_Bank.prototype.create = function(){
Scene_MenuBase.prototype.create.call(this);
this.createHelpWindow();
this.createWindows();
};
Scene_Bank.prototype.createWindows = function(){
this.createBankDetailsWnd();
this.createActionPane();
//this.createDepoWnd();
this._bnkDetailsWnd.activate();
this._bnkDetailsWnd.show();
this._actPane.activate();
this._actPane.show();
this._actPane.select();
this._bnkDetailsWnd.refresh();
};
Scene_Bank.prototype.createActionPane = function(){
const winW = 140;
const winH = 300;
const winX = Graphics.width - winW;
const winY = Graphics.height - winH;
this._actPane = new Window_ActionPane(winX,winY,winW,winH);
this._actPane.setHandler('ok',this.bankActionSelected.bind(this));
this._actPane.setHandler('cancel',this.actionPaneCancel.bind(this));
this._actPane.setHelpWindow(this._helpWindow);
this._actPane.showHelpWindow();
this._actPane.refresh();
this.addWindow(this._actPane);
};
Scene_Bank.prototype.actionPaneCancel = function(){
updateBank(true);
this._actPane.hide();
this._actPane.deactivate();
this._bnkDetailsWnd.hide();
this._bnkDetailsWnd.deactivate();
SceneManager.pop();
}
Scene_Bank.prototype.createBankDetailsWnd = function(){
const winW = 335;
const winH = Graphics.height - this._helpWindow.height - 145;
const winX = 0;
const winY = this._helpWindow.height + 35;
this._bnkDetailsWnd = new Window_BankDetails(winX,winY,winW,winH,bank)
this._bnkDetailsWnd.show();
this._bnkDetailsWnd.refresh();
this.addWindow(this._bnkDetailsWnd);
};
Scene_Bank.prototype.createDepoWnd = function(){
const winW = 375;
const winH = 125;
const winX = Graphics.width - winW;
const winY = Graphics.height - winH;
this._depoWnd = new Window_Deposit(winX,winY,winW,winH,bank["balance"]);
this._depoWnd.setHandler('ok',this.depoOK.bind(this));
this._depoWnd.setHandler('cancel',this.depoCancel.bind(this));
this._depoWnd.refresh();
this.addWindow(this._depoWnd);
};
Scene_Bank.prototype.bankActionSelected = function(){
if (this._actPane.getSelectedAction() == "Deposit"){
this.createDepoWnd();
this._actPane.hide();
this._actPane.deactivate();
this._depoWnd.show();
this._depoWnd.activate();
this._depoWnd.select();
}
};
Scene_Bank.prototype.depoOK = function(){
$gameBanks.updateBank(bankId,this._depoWnd.getBank());
this._depoWnd.hide();
this._depoWnd.deactivate();
this._actPane.show();
this._actPane.activate();
this._bnkDetailsWnd.setBank(bank);
this._bnkDetailsWnd.refresh();
};
I have tried binding scenePop to the actPane cancel event and doing it as shown above where I am calling SceneManager.pop() directly.
Thanks.