Advertisement
deadelf79

DE79_DirectShopNoCategoriesComposer

Feb 24th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // DE79_DirectShopNoCategoriesComposer.js
  3. //=============================================================================
  4.  
  5. /*:
  6.  * @plugindesc fix compatibility between JK_DirectShop and NoItemCategories
  7.  * @author Pirobi
  8.  * *
  9.  * @help This plugin does not provide plugin commands.
  10.  * Version 1.0
  11.  *
  12. */
  13.  
  14. (function() {
  15.    
  16.     Scene_Shop.prototype.createCategoryWindow = function() {
  17.         this._categoryWindow = new Window_ItemCategory();
  18.         this._categoryWindow.setHelpWindow(this._helpWindow);
  19.         this._categoryWindow.y = (this._sellOnly) ? this._helpWindow.y + this._helpWindow.height : this._dummyWindow.y;
  20.         this._categoryWindow.hide();
  21.         this._categoryWindow.deactivate();
  22.         this._categoryWindow.setHandler('ok',     this.onCategoryOk.bind(this));
  23.         this._categoryWindow.setHandler('cancel', this.onCategoryCancel.bind(this));
  24.         this.addWindow(this._categoryWindow);
  25.     };
  26.    
  27.     Scene_Shop.prototype.createSellWindow = function() {
  28.         var wy = (this._sellOnly) ? this._helpWindow.height : this._helpWindow.height + this._categoryWindow.height;
  29.         var wh = (this._sellOnly) ? Graphics.boxHeight - wy - this._goldWindow.height : Graphics.boxHeight - wy;
  30.         this._sellWindow = new Window_ShopSell(0, wy, Graphics.boxWidth, wh);
  31.         this._sellWindow.setHelpWindow(this._helpWindow);
  32.         this._sellWindow.hide();
  33.         this._sellWindow.setHandler('ok',     this.onSellOk.bind(this));
  34.         if (this._sellOnly) {
  35.             this._sellWindow.setHandler('cancel', this.popScene.bind(this));
  36.             this._sellWindow.activate();
  37.             this._sellWindow.select(0);
  38.         } else {
  39.             this._sellWindow.setHandler('cancel', this.onSellCancel.bind(this));
  40.             this._sellWindow.select(0);
  41.         }
  42.         this.addWindow(this._sellWindow);
  43.     };
  44.  
  45. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement