Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Ossra = Ossra || {};
- function Window_HelpRedux() {
- this.initialize.apply(this, arguments);
- }
- Window_HelpRedux.prototype = Object.create(Window_Help.prototype);
- Window_HelpRedux.prototype.constructor = Window_HelpRedux;
- Window_HelpRedux.prototype.initialize = function(numLines) {
- var width = this.width();
- this.setHeight(this.fittingHeight(numLines || 2));
- var height = this.height;
- Window_Base.prototype.initialize.call(this, 0, 0, width, height);
- this._text = '';
- };
- Window_HelpRedux.prototype.width = function() {
- if(this._width === null || this._width === undefined){
- this._width = 300;
- }
- return this._width;
- };
- Window_HelpRedux.prototype.setWidth = function(value) {
- this._width = value;
- };
- Window_HelpRedux.prototype.height = function() {
- if(this._height === null || this._height === undefined){
- this._height = this.fittingHeight(2);
- }
- return this._height;
- };
- Window_HelpRedux.prototype.setHeight = function(vakue) {
- this._height = value;
- };
- Window_HelpRedux.prototype.setText = function(text) {
- if (this._text !== text) {
- this._text = text;
- this.refresh();
- }
- };
- Window_HelpRedux.prototype.clear = function() {
- this.setText('');
- };
- Window_HelpRedux.prototype.setItem = function(item) {
- this.setText(item ? item.description : '');
- };
- Window_HelpRedux.prototype.refresh = function() {
- this.contents.clear();
- this.drawTextEx(this._text, this.textPadding(), 0);
- };
- Ossra.Window_EventItem_updatePlacement = Window_EventItem.prototype.updatePlacement;
- Window_EventItem.prototype.updatePlacement = function() {
- Ossra.Window_EventItem_updatePlacement.call(this);
- if (this._helpWindow) {
- this._helpWindow.y = this.y;
- this.y = this._helpWindow.y + this._helpWindow.height;
- }
- };
- Window_EventItem.prototype.setHelpWindow = function(helpWindow) {
- Window_ItemList.prototype.setHelpWindow.call(this, helpWindow);
- if (this._helpWindow) {
- this._helpWindow.hide();
- this._helpWindow.close();
- }
- };
- Window_EventItem.prototype.open = function() {
- Window_ItemList.prototype.open.call(this);
- if (this._helpWindow) {
- this._helpWindow.show();
- this._helpWindow.open();
- }
- };
- Window_EventItem.prototype.close = function() {
- Window_ItemList.prototype.close.call(this);
- if (this._helpWindow) {
- this._helpWindow.hide();
- this._helpWindow.close();
- }
- };
- Ossra.Window_Message_subWindows = Window_Message.prototype.subWindows;
- Window_Message.prototype.subWindows = function() {
- var tmpWindows = Ossra.Window_Message_subWindows.call(this);
- tmpWindows.push(this._helpWindow)
- return tmpWindows;
- };
- Ossra.Window_Message_createSubWindows = Window_Message.prototype.createSubWindows;
- Window_Message.prototype.createSubWindows = function() {
- Ossra.Window_Message_createSubWindows.call(this);
- this._helpWindow = new Window_HelpRedux();
- this._itemWindow.setHelpWindow(this._helpWindow);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement