In my script a function begins processing, however in the middle I call a custom scene based on Scene_ItemBase
SceneManager.push(Snow.Gather.Scenes.ToolChoice)However my script carries along without caring if the Scene is terminated or not, is there anyway to go about waiting for the scene to be terminated before continuing on without stopping the Scene in the process?( I've used a while loop to check but the entire game stalls, which I realised was a stupid idea in about 2 seconds before testing as well.)
Code for Scene and Windows:
SceneManager.push(Snow.Gather.Scenes.ToolChoice)However my script carries along without caring if the Scene is terminated or not, is there anyway to go about waiting for the scene to be terminated before continuing on without stopping the Scene in the process?( I've used a while loop to check but the entire game stalls, which I realised was a stupid idea in about 2 seconds before testing as well.)
Code for Scene and Windows:
Code:
// Windowsvar ItemChoiceWindow = function() { this.initialize.apply(this, arguments);}ItemChoiceWindow.prototype = Object.create(Window_ItemList.prototype);ItemChoiceWindow.prototype.constructor = ItemChoiceWindow;ItemChoiceWindow.prototype.initialize = function(x, y, width, height) { Window_ItemList.prototype.initialize.call(this, x, y, width, height); this._data = []; this.activate(); this.refresh(); this.select(0);}ItemChoiceWindow.prototype.makeItemList = function() { this._data = Snow.Gather.TempItems;}Snow.Gather.Windows.ItemChoiceWindow = ItemChoiceWindow;var ItemChoiceHelpWindow = function() { this.initialize.apply(this, arguments);}ItemChoiceHelpWindow.prototype = Object.create(Window_Base.prototype);ItemChoiceHelpWindow.prototype.constructor = ItemChoiceHelpWindow;Snow.Gather.Windows.ItemChoiceHelpWindow = ItemChoiceHelpWindow;// Scenesvar ToolChoice = function() { this.initialize.apply(this, arguments);}ToolChoice.prototype = Object.create(Scene_ItemBase.prototype);ToolChoice.prototype.constructor = ToolChoice;ToolChoice.prototype.initialize = function(data) { Scene_ItemBase.prototype.initialize.call(this);}ToolChoice.prototype.create = function() { Scene_ItemBase.prototype.create.call(this); this._createItemChoiceWindow(); this._createItemChoiceHelpWindow();}ToolChoice.prototype.start = function() { Scene_ItemBase.prototype.start.call(this);}ToolChoice.prototype._createItemChoiceWindow = function() { this._itemChoiceWindow = new Snow.Gather.Windows.ItemChoiceWindow(0, 100, Graphics.boxWidth, Graphics.boxHeight - 100); this._itemChoiceWindow.setHandler('ok', this._onItemChoiceWindowOK.bind(this)); this._itemChoiceWindow.setHandler('cancel', this._onItemChoiceWindowCancel.bind(this)); this.addWindow(this._itemChoiceWindow);}ToolChoice.prototype._createItemChoiceHelpWindow = function() { this._itemChoiceHelpWindow = new Snow.Gather.Windows.ItemChoiceHelpWindow(); this.addWindow(this._itemChoiceHelpWindow);}ToolChoice.prototype._onItemChoiceWindowOK = function() { var selected = this._itemChoiceWindow.item(); Snow.Gather.TempItems = selected; console.log(Snow.Gather.TempItems); this.popScene();}ToolChoice.prototype._onItemChoiceWindowCancel = function() { this.popScene();}Snow.Gather.Scenes.ToolChoice = ToolChoice;