Advertisement
ezmash

No Item Categories (MV)

Jan 19th, 2016
635
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // No Item Categories
  3. // by Shaz
  4. // Last Updated: 2016.01.20
  5. //=============================================================================
  6.  
  7. /*:
  8.  * @plugindesc Removes category list from Items window
  9.  * @author Shaz
  10.  *
  11.  * @help This plugin has no plugin commands
  12.  *
  13.  * Note - this plugin overwrites a number of functions from Scene_Item and
  14.  * Scene_Shop.  It will likely not be compatible with other plugins if they
  15.  * overwrite or alias the same functions.
  16.  *
  17.  */
  18.  
  19. (function() {
  20.   Window_ItemList.prototype.includes = function(item) {
  21.     return !DataManager.isItem(item) || [1,2].contains(item.itypeId);
  22.   };
  23.  
  24.   Scene_Item.prototype.createCategoryWindow = function() {
  25.     return;
  26.   };
  27.  
  28.   Scene_Item.prototype.createItemWindow = function() {
  29.       var wy = this._helpWindow.height;
  30.       var wh = Graphics.boxHeight - wy;
  31.       this._itemWindow = new Window_ItemList(0, wy, Graphics.boxWidth, wh);
  32.       this._itemWindow.setHelpWindow(this._helpWindow);
  33.       this._itemWindow.setHandler('ok',     this.onItemOk.bind(this));
  34.       this._itemWindow.setHandler('cancel', this.popScene.bind(this));
  35.       this.addWindow(this._itemWindow);
  36.       this._itemWindow.refresh();
  37.       this._itemWindow.activate();
  38.   };
  39.  
  40.   Scene_Shop.prototype.createCategoryWindow = function() {
  41.     return;
  42.   };
  43.  
  44.   Scene_Shop.prototype.createSellWindow = function() {
  45.       var wy = this._dummyWindow.y;
  46.       var wh = Graphics.boxHeight - wy;
  47.       this._sellWindow = new Window_ShopSell(0, wy, Graphics.boxWidth, wh);
  48.       this._sellWindow.setHelpWindow(this._helpWindow);
  49.       this._sellWindow.hide();
  50.       this._sellWindow.setHandler('ok',     this.onSellOk.bind(this));
  51.       this._sellWindow.setHandler('cancel', this.onSellCancel.bind(this));
  52.       this.addWindow(this._sellWindow);
  53.   };
  54.  
  55.   Scene_Shop.prototype.commandSell = function() {
  56.       this._dummyWindow.hide();
  57.       this._sellWindow.show();
  58.       this._sellWindow.activate();
  59.       this._sellWindow.refresh();
  60.   };
  61.  
  62.   Scene_Shop.prototype.onSellOk = function() {
  63.       this._item = this._sellWindow.item();
  64.       this._sellWindow.hide();
  65.       this._numberWindow.setup(this._item, this.maxSell(), this.sellingPrice());
  66.       this._numberWindow.setCurrencyUnit(this.currencyUnit());
  67.       this._numberWindow.show();
  68.       this._numberWindow.activate();
  69.       this._statusWindow.setItem(this._item);
  70.       this._statusWindow.show();
  71.   };
  72.  
  73.   Scene_Shop.prototype.onSellCancel = function() {
  74.     this._commandWindow.activate();
  75.     this._dummyWindow.show();
  76.     this._sellWindow.hide();
  77.     this._statusWindow.setItem(null);
  78.     this._helpWindow.clear();
  79.   };
  80.  
  81.   Scene_Shop.prototype.activateSellWindow = function() {
  82.       this._sellWindow.refresh();
  83.       this._sellWindow.show();
  84.       this._sellWindow.activate();
  85.       this._statusWindow.hide();
  86.   };
  87.  
  88. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement