Advertisement
Astfgl

AstfglIM

Oct 20th, 2017
4,197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //===================================================================================
  2. // Astfgl Item menu
  3. // Date 20/10/2017
  4. // Free to use both commercialyy and non commercially, repost and
  5. // edit, as long as the final product is kept under the same terms of use.
  6. // Credits required, any of Astfgl, Astgfl (Pierre MATEO), Pierre MATEO
  7. //====================================================================================
  8.  
  9. /*:
  10.  * @plugindesc Item Menu
  11.  * @author Astfgl
  12.  * @help All parameters are evaled, meaning you can use a formula, or in game variables.
  13.  * For example you can put $gameVariables.value(1) in the columns parameter field.
  14.  * Then, each time you open the menu, the number of columns will be what's
  15.  * inside variable 1.
  16.  *
  17.  * @param x
  18.  * @desc The x coordinate of the item window
  19.  * @default Graphics.boxWidth / 2 - SceneManager._scene._itemWindow.width / 2
  20.  *
  21.  * @param y
  22.  * @desc The y coordinate of the item window
  23.  * @default Graphics.boxHeight / 2 - SceneManager._scene._itemWindow.height / 2
  24.  *
  25.  * @param width
  26.  * @desc The width coordinate of the item window
  27.  * @default 300
  28.  *
  29.  * @param height
  30.  * @desc The height coordinate of the item window
  31.  * @default 500
  32.  *
  33.  * @param columns
  34.  * @desc The number of columns
  35.  * @default 1
  36.  *
  37.  *
  38.  * @param category
  39.  * @desc The starting category of the item list window. 'item','weapon','armor','keyItem'.
  40.  * @default 'keyItem'
  41. */
  42.  
  43. (function(){
  44.     var params = PluginManager.parameters("AstfglIM");
  45.    
  46.     var _Astfgl_newSIC = Scene_Item.prototype.create
  47.     Scene_Item.prototype.create = function() {
  48.         _Astfgl_newSIC.call(this);
  49.         this._helpWindow.hide();
  50.         this._categoryWindow.hide();
  51.         this._categoryWindow.deactivate();
  52.         this._categoryWindow.selectSymbol(eval(params.category));
  53.         this.onCategoryOk();
  54.         this._itemWindow.setHandler('cancel', this.popScene.bind(this));
  55.         this._itemWindow.width = eval(params.width) || 0;
  56.         this._itemWindow.height = eval(params.height) || 0;
  57.         this._itemWindow.x = eval(params.x) || 0;
  58.         this._itemWindow.y = eval(params.y) || 0;
  59.     }
  60.    
  61.     Window_ItemList.prototype.maxCols = function() {
  62.         return eval(params.columns);
  63.     };
  64.    
  65. })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement