//-----------------------------------------------------------------------------
// Scene_Message
//
// The superclass of Scene_Map and Scene_Battle.
/**
* The superclass of Scene_Map and Scene_Battle.
*
* @class
* @extends Scene_Base
*/
function Scene_Message() {
this.initialize(...arguments);
}
Scene_Message.prototype = Object.create(Scene_Base.prototype);
Scene_Message.prototype.constructor = Scene_Message;
Scene_Message.prototype.initialize = function() {
Scene_Base.prototype.initialize.call(this);
};
/**
* Check if the message window is closing
*
* @return {boolean} If the message window is currently closing
*/
Scene_Message.prototype.isMessageWindowClosing = function() {
return this._messageWindow.isClosing();
};
/**
* Create all of the windows in the scene
*/
Scene_Message.prototype.createAllWindows = function() {
this.createMessageWindow();
this.createScrollTextWindow();
this.createGoldWindow();
this.createNameBoxWindow();
this.createChoiceListWindow();
this.createNumberInputWindow();
this.createEventItemWindow();
this.associateWindows();
};
/**
* Create the message window
*/
Scene_Message.prototype.createMessageWindow = function() {
const rect = this.messageWindowRect();
this._messageWindow = new Window_Message(rect);
this.addWindow(this._messageWindow);
};
/**
* Get the rectangle that represents the message window's x/y/width/height
*
* @return {Rectangle} The rectangle that represents the message window
*/
Scene_Message.prototype.messageWindowRect = function() {
const ww = Graphics.boxWidth;
const wh = this.calcWindowHeight(4, false) + 8;
const wx = (Graphics.boxWidth - ww) / 2;
const wy = 0;
return new Rectangle(wx, wy, ww, wh);
};
/**
* Creates the scroll text window
*/
Scene_Message.prototype.createScrollTextWindow = function() {
const rect = this.scrollTextWindowRect();
this._scrollTextWindow = new Window_ScrollText(rect);
this.addWindow(this._scrollTextWindow);
};
/**
* Get the rectangle that represents the scroll text window's x/y/width/height
*
* @return {Rectangle} The rectangle that represents the scroll text window
*/
Scene_Message.prototype.scrollTextWindowRect = function() {
const wx = 0;
const wy = 0;
const ww = Graphics.boxWidth;
const wh = Graphics.boxHeight;
return new Rectangle(wx, wy, ww, wh);
};
/**
* Creates the gold window
*/
Scene_Message.prototype.createGoldWindow = function() {
const rect = this.goldWindowRect();
this._goldWindow = new Window_Gold(rect);
this._goldWindow.openness = 0;
this.addWindow(this._goldWindow);
};
/**
* Get the rectangle that represents the gold window's x/y/width/height
*
* @return {Rectangle} The rectangle that represents the gold window
*/
Scene_Message.prototype.goldWindowRect = function() {
const ww = this.mainCommandWidth();
const wh = this.calcWindowHeight(1, true);
const wx = Graphics.boxWidth - ww;
const wy = 0;
return new Rectangle(wx, wy, ww, wh);
};
/**
* Creates the name box window
*/
Scene_Message.prototype.createNameBoxWindow = function() {
this._nameBoxWindow = new Window_NameBox();
this.addWindow(this._nameBoxWindow);
};
/**
* Creates the choice list window
*/
Scene_Message.prototype.createChoiceListWindow = function() {
this._choiceListWindow = new Window_ChoiceList();
this.addWindow(this._choiceListWindow);
};
/**
* Creates the number input window
*/
Scene_Message.prototype.createNumberInputWindow = function() {
this._numberInputWindow = new Window_NumberInput();
this.addWindow(this._numberInputWindow);
};
/**
* Creates the event item window
*/
Scene_Message.prototype.createEventItemWindow = function() {
const rect = this.eventItemWindowRect();
this._eventItemWindow = new Window_EventItem(rect);
this.addWindow(this._eventItemWindow);
};
/**
* Get the rectangle that represents the event item window's x/y/width/height
*
* @return {Rectangle} The rectangle that represents the message event item
*/
Scene_Message.prototype.eventItemWindowRect = function() {
const wx = 0;
const wy = 0;
const ww = Graphics.boxWidth;
const wh = this.calcWindowHeight(4, true);
return new Rectangle(wx, wy, ww, wh);
};
/**
* Associates the windows with each other
*/
Scene_Message.prototype.associateWindows = function() {
const messageWindow = this._messageWindow;
messageWindow.setGoldWindow(this._goldWindow);
messageWindow.setNameBoxWindow(this._nameBoxWindow);
messageWindow.setChoiceListWindow(this._choiceListWindow);
messageWindow.setNumberInputWindow(this._numberInputWindow);
messageWindow.setEventItemWindow(this._eventItemWindow);
this._nameBoxWindow.setMessageWindow(messageWindow);
this._choiceListWindow.setMessageWindow(messageWindow);
this._numberInputWindow.setMessageWindow(messageWindow);
this._eventItemWindow.setMessageWindow(messageWindow);
};
/**
* Cancel the message window wait
* @since 1.8.0
*/
Scene_Message.prototype.cancelMessageWait = function() {
this._messageWindow.cancelWait();
};