Advertisement
Kakakadafi

Kadafi_ItemSelectHelp

Aug 31st, 2016
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // Kadafi_ItemSelectHelp.js
  3. //=============================================================================
  4.  
  5. /*:
  6.  * @plugindesc
  7.  * Item Select Help Window
  8.  *
  9.  * @author Kadafi
  10.  *
  11.  * @help
  12.  */
  13.  
  14. //-----------------------------------------------------------------------------
  15. // Window_Message
  16. //-----------------------------------------------------------------------------
  17.  
  18. Window_Message.prototype.subWindows = function() {
  19.     return [this._helpWindow, this._goldWindow, this._choiceWindow,
  20.             this._numberWindow, this._itemWindow];
  21. };
  22.  
  23. var Window_Message_createSubWindows = Window_Message.prototype.createSubWindows;
  24. Window_Message.prototype.createSubWindows = function() {
  25.     this._helpWindow = new Window_Help();
  26.     this._helpWindow.openness = 0;
  27.     Window_Message_createSubWindows.call(this);
  28.     this._itemWindow.setHelpWindow(this._helpWindow);
  29. };
  30.  
  31. var Window_Message_startInput = Window_Message.prototype.startInput;
  32. Window_Message.prototype.startInput = function() {
  33.     if ($gameMessage.isItemChoice()) {
  34.         this._helpWindow.open();
  35.         this._itemWindow.start();
  36.         return true;
  37.     }
  38.     return Window_Message_startInput.call(this);
  39. };
  40.  
  41. var Window_Message_terminateMessage = Window_Message.prototype.terminateMessage;
  42. Window_Message.prototype.terminateMessage = function() {
  43.     Window_Message_terminateMessage.call(this);
  44.     this._helpWindow.close();
  45. };
  46.  
  47. //-----------------------------------------------------------------------------
  48. // Window_EventItem
  49. //-----------------------------------------------------------------------------
  50.  
  51. Window_EventItem.prototype.updatePlacement = function() {
  52.     if (this._messageWindow.y >= Graphics.boxHeight / 2) {
  53.         this._messageWindow._helpWindow.y = 0;
  54.     } else {
  55.         this._messageWindow._helpWindow.y = Graphics.boxHeight - this.height - this._messageWindow._helpWindow.height;
  56.     }
  57.     this.y = this._messageWindow._helpWindow.y + this._messageWindow._helpWindow.height;
  58. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement