Well, I'm trying to make an addon for a plugin of mine. The addon is complete and works fine, the unique problem that I'm having now is that this addon adds a new window in the save menu and that this is appearing above windows that should be above it.
I'm using aliases to make this change, as I want it to be a flexible change. So, the aliasing method I'm using to add this window is:
var _alias_SceneFile_create_for_var = Scene_File.prototype.create; Scene_File.prototype.create = function() { _alias_SceneFile_create_for_var.call(this); this._variablesWindow = new Window_Variables(); this._variablesWindow.setMode(this.mode()); this._variablesWindow.opacity = 0; this._listWindow.variablesWindow = this._variablesWindow; this._listWindow.callUpdateHelp(); this._listWindow.refresh(); this.addChild(this._variablesWindow);};
Where the previous window is an alias too, it's this:
var _Scene_File_create = Scene_File.prototype.create; Scene_File.prototype.create = function() { _Scene_File_create.call(this); this._listWindow.height = this._listWindow.fittingHeight(8); var x = 0; var y = this._listWindow.y + this._listWindow.height; var width = Graphics.boxWidth; var height = Graphics.boxHeight - y; this._statusWindow = new Window_SavefileStatus(x, y, width, height); this._statusWindow.setMode(this.mode()); this._listWindow.statusWindow = this._statusWindow; this._listWindow.callUpdateHelp(); this._listWindow.refresh(); this.addWindow(this._statusWindow); this._actionWindow = new Window_FileAction(); this._actionWindow.setHandler('salvar', this.commandSave.bind(this)); this._actionWindow.setHandler('carregar', this.commandLoad.bind(this)); this._actionWindow.setHandler('deletar', this.commandErase.bind(this)); this._actionWindow.setHandler('cancel', this.commandCancel.bind(this)); this.addChild(this._actionWindow); this._actionWindow.hide(); this._statusWindow.refresh(); };What I want is this:
What I'm getting is that:
I tryied to do this:
var _alias_SceneFile_create_for_var = Scene_File.prototype.create; Scene_File.prototype.create = function() { _alias_SceneFile_create_for_var.call(this); this._variablesWindow = new Window_Variables(); this._variablesWindow.setMode(this.mode()); this._variablesWindow.opacity = 0; this._listWindow.variablesWindow = this._variablesWindow; this._listWindow.callUpdateHelp(); this._listWindow.refresh(); this.addChild(this._variablesWindow); this.addChild(this._actionWindow); this._actionWindow.hide();};That's even the way I get the first picture. But that way I get a worse problem, because the action window do not disappears from the screen after it's used.
I tryied removechild too, but didn't work.
How do I do to fix this problem? I tryied aliasing the methods of the command action window too, to see if it makes the problem end, but got no effect. ):
How do we work properly with z indexing in rmmv?
I'm using aliases to make this change, as I want it to be a flexible change. So, the aliasing method I'm using to add this window is:
var _alias_SceneFile_create_for_var = Scene_File.prototype.create; Scene_File.prototype.create = function() { _alias_SceneFile_create_for_var.call(this); this._variablesWindow = new Window_Variables(); this._variablesWindow.setMode(this.mode()); this._variablesWindow.opacity = 0; this._listWindow.variablesWindow = this._variablesWindow; this._listWindow.callUpdateHelp(); this._listWindow.refresh(); this.addChild(this._variablesWindow);};
Where the previous window is an alias too, it's this:
var _Scene_File_create = Scene_File.prototype.create; Scene_File.prototype.create = function() { _Scene_File_create.call(this); this._listWindow.height = this._listWindow.fittingHeight(8); var x = 0; var y = this._listWindow.y + this._listWindow.height; var width = Graphics.boxWidth; var height = Graphics.boxHeight - y; this._statusWindow = new Window_SavefileStatus(x, y, width, height); this._statusWindow.setMode(this.mode()); this._listWindow.statusWindow = this._statusWindow; this._listWindow.callUpdateHelp(); this._listWindow.refresh(); this.addWindow(this._statusWindow); this._actionWindow = new Window_FileAction(); this._actionWindow.setHandler('salvar', this.commandSave.bind(this)); this._actionWindow.setHandler('carregar', this.commandLoad.bind(this)); this._actionWindow.setHandler('deletar', this.commandErase.bind(this)); this._actionWindow.setHandler('cancel', this.commandCancel.bind(this)); this.addChild(this._actionWindow); this._actionWindow.hide(); this._statusWindow.refresh(); };What I want is this:
var _alias_SceneFile_create_for_var = Scene_File.prototype.create; Scene_File.prototype.create = function() { _alias_SceneFile_create_for_var.call(this); this._variablesWindow = new Window_Variables(); this._variablesWindow.setMode(this.mode()); this._variablesWindow.opacity = 0; this._listWindow.variablesWindow = this._variablesWindow; this._listWindow.callUpdateHelp(); this._listWindow.refresh(); this.addChild(this._variablesWindow); this.addChild(this._actionWindow); this._actionWindow.hide();};That's even the way I get the first picture. But that way I get a worse problem, because the action window do not disappears from the screen after it's used.
I tryied removechild too, but didn't work.
How do I do to fix this problem? I tryied aliasing the methods of the command action window too, to see if it makes the problem end, but got no effect. ):
How do we work properly with z indexing in rmmv?