设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 75|回复: 4
打印 上一主题 下一主题

[有事请教] 想请教WAY_StorageSystem.js有没有修改的方法?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
239
在线时间
30 小时
注册时间
2024-4-10
帖子
43
跳转到指定楼层
1
发表于 2024-4-25 23:24:31 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
我想设置仓库插件,之前找了PH_Warehouse.js
但那个插件视窗没办法编辑,没办法做成我需要的样子

所以改找了WAY_StorageSystem.js,可以做成我需要的样子,但还是有几点想问问有没有办法修改

第一个,我缩小道具栏视窗后文字被挤压得很难看,有没有办法让文字可以拓展到红圈的位置呢


第二个问题,有办法删除这个视窗吗,插件内说是数字视窗,我制作中的游戏没打算堆叠物品,所以可以不用选择数量,想问问有没有办法把这个视窗删除,或者是至少删除 选择数量的按钮留下打勾就好....



感谢各位热心帮忙,谢谢


JAVASCRIPT 代码复制
  1. /* globals WAY, WAYModuleLoader, $gameStorageSystems */
  2. //===========================================================================
  3. // WAY_StorageSystem.js
  4. //===========================================================================
  5.  
  6. /*:
  7. @plugindesc v2.4.1 This plugin allows you create different storage systems where
  8. the player can store his items. <WAY_StorageSystem>
  9.  
  10. @param config
  11. @text Storage Systems
  12. @desc Add Storage Systems to your game.
  13. @type struct<storage>[]
  14. @default
  15.  
  16. @author waynee95
  17.  
  18. @help
  19. ============================================================================
  20.  ■ Usage
  21. ============================================================================
  22.  
  23. >>> This plugin uses the new MV1.5.0 Plugin Parameter, so I recommend you to
  24. update your editor. Your project can still be lower than MV1.5.0
  25.  
  26. 储存系统插件,但并不限制玩家背包。
  27.  
  28. 插件兼容YEP_ItemCore和YEP_X_ItemCategories。
  29.  
  30.  
  31. 把这个插件放在列表的底部。
  32.  
  33. 如何创建存储:
  34. 1. 打开插件管理器
  35. 2. 选择插件
  36. 3. 选项空行
  37. 4. 配置存储系统
  38.  
  39. 存储系统id从0开始
  40.  
  41.  
  42. ============================================================================
  43.  ■ 参数概述
  44. ============================================================================
  45. 菜单背景 - 设置图片作为背景
  46.  
  47. 仓库标题 - 可以使用控制字符\i[x], \c[x].
  48.  
  49. 信息窗口文本 - %1会替换为当前存储容量
  50.  
  51.  
  52. 最大容量 - 仓库最大容量
  53.  
  54. 物品堆栈大小 - 不为none的话,一组堆栈(例如8个药水)才算一格容量。
  55. 如果最大容量为20,最多可以存放20 x 8个药水。
  56.  
  57.  
  58.  
  59.  
  60. 显示分类 - 是否显示分类,仅视觉效果,可以全部显示在一个列表里。
  61.  
  62.  
  63. 用YEP_X_ItemCategories的话这里必须设置为true。
  64.  
  65.  
  66. 允许存放的物品 - 哪些物品可以存入仓库。
  67.  
  68. 分以下几类:
  69.  - items
  70.  - weapons
  71.  - armors
  72.  - keyitems
  73.  
  74. 如果需要更多类别,可以使用YEP_X_ItemCategories。只需将类别名称添加到允许类型列表中。
  75.  
  76.  
  77. 模式 - 只存放还是只取出还是两者皆有,只取出可以作为战利品箱。
  78.  
  79.  
  80.  
  81. 如果你想自定义添加/删除项目按钮的文本,你可以在场景设置/命令窗口设置中这样做。
  82.  
  83.  
  84. 音效同理。
  85.  
  86.  
  87. ============================================================================
  88.  ■ Scene Settings
  89. ============================================================================
  90. 可以更改场景外观,每个场景都是独立的。
  91.  
  92.  
  93. 创建窗口的顺序如下:
  94.  
  95. 帮助窗口 - 字面意思
  96. 标题窗口 - 仓库标题
  97. 命令窗口 - 如果您想添加/删除项目,则可以选择该窗口。
  98. 类别窗口 - 物品分类窗口
  99. 物品窗口 - 根据分类窗口显示对应分类
  100. *            
  101. 信息窗口 - 显示当前/最大容量
  102. 数字窗口 - 添加/删除的物品数量
  103.  
  104. ============================================================================
  105.  ■ Notetags
  106. ============================================================================
  107. 物品,武器,护甲注备栏:
  108.  
  109. <Cannot Store>
  110. 这物品不能存入仓库。
  111.  
  112. <Can Store Only In: x>
  113. <Can Store Only In: x, x, x>
  114. 只能存入指定仓库。
  115.  
  116.  
  117. ============================================================================
  118.  ■ 插件命令
  119. ============================================================================
  120. 主要关键词: StorageSystem
  121.  
  122. -----------------------
  123. StorageSystem open id
  124. -----------------------
  125. open - 打开仓库
  126. 请记住,id从0开始!
  127.  
  128. id - 指定你要打开的仓库的ID,没有则打开最后一个打开的。
  129.     
  130.  
  131. -----------------------
  132. StorageSystem add id item amount
  133. -----------------------
  134. add - 添加物品
  135.  
  136. id - 仓库ID。
  137.  
  138. item - 添加物品的ID,用$dataItems[id], $dataWeapons[id], $dataArmors[id].
  139. 例子:StorageSystem add 0 $dataItems[1] 1
  140.  
  141. amount - 数目
  142.  
  143. -----------------------
  144. StorageSystem remove id item amount
  145. -----------------------
  146. remove - 移除道具
  147.  
  148. id - 仓库ID。
  149.  
  150. item - 同上
  151.  
  152.  
  153. amount - 数目
  154.  
  155. -----------------------
  156. StorageSystem clear id
  157. -----------------------
  158. clear - 清空仓库
  159.  
  160. id - 仓库ID。
  161.  
  162. -----------------------
  163. StorageSystem change id number
  164. -----------------------
  165. change - 修改最大容量
  166.  
  167. id - 仓库ID。
  168.  
  169. number - 修改的数值
  170.  
  171. ============================================================================
  172.  ■ Scriptcalls
  173. ============================================================================
  174. 全局对象: $gameStorageSystems
  175.  
  176. $gameStorageSystems.open(id) - 打开仓库,则使用最后打开的id
  177.  
  178.  
  179. $gameStorageSystems.storage(id) - 返回给定id的仓库
  180. *                                 
  181.  
  182. $gameStorageSystems.current() - 返回最后一个打开的仓库
  183.  
  184. 对存储系统对象的脚本调用如下。
  185. 用$gameStorageSystems.current()或$gameStorageSystems.storage(id)替换。
  186. 例子:$gameStorageSystems.storage(0).title()
  187.  
  188. storage.title() - 返回标题名称。
  189.  
  190. storage.capacity() - 返回当前容量。
  191.  
  192. storage.maxCapacity() - 返回最大容量。
  193.  
  194. storage.items() - 返回所有存储的物品
  195.  
  196. storage.weapons() - 归还所有储存的武器。
  197.  
  198. storage.armors() - 返回所有储存的盔甲。
  199.  
  200. storage.allItems() - 返回存储的所有内容。
  201.  
  202. storage.isEmpty() - 返回true或false。
  203.  
  204. storage.addItem(item, amount) - 向仓库添加物品,用:
  205. $dataItems[id], $dataWeapons[id], $dataArmors[id].
  206.  
  207. storage.removeItem(item, amount) - 移除,同上
  208.  
  209.  
  210. storage.clear() - 清空仓库
  211.  
  212. storage.changeMaxCapacity(number) - 设置最大容量
  213.  
  214.  
  215. ============================================================================
  216.  ■ Terms of Use
  217. ============================================================================
  218. This work is licensed under the MIT license.
  219.  
  220. More info here: https://github.com/waynee95/mv-plugins/blob/master/LICENSE
  221.  
  222. ============================================================================
  223.  ■ Contact Information
  224. ============================================================================
  225. Forum Link: https://forums.rpgmakerweb.com/index.php?members/waynee95.88436/
  226. Website: http://waynee95.me/
  227. Discord Name: waynee95#4261
  228. Ko-fi: https://ko-fi.com/waynee95
  229. */
  230. "use strict";
  231.  
  232. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  233.  
  234. if (typeof WAY === "undefined") {
  235.   console.error("You need to install WAY_Core!"); // eslint-disable-line no-console
  236.  
  237.   if (Utils.isNwjs() && Utils.isOptionValid("test")) {
  238.     var gui = require("nw.gui"); // eslint-disable-line
  239.  
  240.  
  241.     gui.Window.get().showDevTools();
  242.   }
  243.  
  244.   SceneManager.stop();
  245. } else {
  246.   WAYModuleLoader.registerPlugin("WAY_StorageSystem", "2.4.1", "waynee95", {
  247.     name: "WAY_Core",
  248.     version: ">= 2.0.0"
  249.   });
  250. }
  251.  
  252. window.$gameStorageSystems = null;
  253.  
  254. (function ($) {
  255.   var _WAY$Util = WAY.Util,
  256.       getNotetag = _WAY$Util.getNotetag,
  257.       toArray = _WAY$Util.toArray;
  258.   var $dataStorage = $.parameters.config;
  259.  
  260.   if ($dataStorage === null) {
  261.     console.warn("WAY_StorageSystem\nPlugin Parameters are not setup properly!");
  262.  
  263.     if (Utils.isNwjs() && Utils.isOptionValid("test")) {
  264.       require("nw.gui").Window.get().showDevTools();
  265.     }
  266.   }
  267.  
  268.   WAY.EventEmitter.on("load-item-notetags", parseNotetags);
  269.   WAY.EventEmitter.on("load-weapon-notetags", parseNotetags);
  270.   WAY.EventEmitter.on("load-armor-notetags", parseNotetags);
  271.  
  272.   function parseNotetags(obj) {
  273.     obj.cannotStore = getNotetag(obj.note, "Cannot Store", false);
  274.     obj.onlyInStorage = getNotetag(obj.note, "Can Store Only In", [], toArray);
  275.   } //==========================================================================
  276.   // PluginManager
  277.   //==========================================================================
  278.  
  279.  
  280.   PluginManager.addCommand("StorageSystem", {
  281.     open: function open() {
  282.       var storageId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $gameStorageSystems._lastActive;
  283.       $gameStorageSystems.open(storageId);
  284.     },
  285.     add: function add(storageId, item, amount) {
  286.       $gameStorageSystems.storage(storageId).addItem(eval(item), parseInt(amount));
  287.     },
  288.     remove: function remove(storageId, item, amount) {
  289.       $gameStorageSystems.storage(storageId).removeItem(eval(item), parseInt(amount));
  290.     },
  291.     clear: function clear(storageId) {
  292.       $gameStorageSystems.storage(storageId).clear();
  293.     },
  294.     change: function change(storageId, maxCapacity) {
  295.       $gameStorageSystems.storage(storageId).changeMaxCapacity(maxCapacity);
  296.     }
  297.   }); //==========================================================================
  298.   // DataManager
  299.   //==========================================================================
  300.  
  301.   var _DataManager_createGameObjects = DataManager.createGameObjects;
  302.  
  303.   DataManager.createGameObjects = function () {
  304.     _DataManager_createGameObjects.call(this);
  305.  
  306.     $gameStorageSystems = new Game_StorageSystems();
  307.   };
  308.  
  309.   var _DataManager_makeSaveContents = DataManager.makeSaveContents;
  310.  
  311.   DataManager.makeSaveContents = function () {
  312.     var contents = _DataManager_makeSaveContents.call(this);
  313.  
  314.     contents.storageSystems = $gameStorageSystems;
  315.     return contents;
  316.   };
  317.  
  318.   var _DataManager_extractSaveContents = DataManager.extractSaveContents;
  319.  
  320.   DataManager.extractSaveContents = function (contents) {
  321.     _DataManager_extractSaveContents.call(this, contents);
  322.  
  323.     $gameStorageSystems = contents.storageSystems;
  324.  
  325.     if ($gameStorageSystems === undefined) {
  326.       $gameStorageSystems = new Game_StorageSystems();
  327.     }
  328.   };
  329.  
  330.   if (Imported.YEP_X_NewGamePlus) {
  331.     var _DataManager_prepareNewGamePlusData = DataManager.prepareNewGamePlusData;
  332.  
  333.     DataManager.prepareNewGamePlusData = function () {
  334.       _DataManager_prepareNewGamePlusData.call(this);
  335.  
  336.       this._ngpData.storageSystems = JsonEx.makeDeepCopy($gameStorageSystems);
  337.     };
  338.  
  339.     var _DataManager_carryOverNewGamePlusData = DataManager.carryOverNewGamePlusData;
  340.  
  341.     DataManager.carryOverNewGamePlusData = function () {
  342.       _DataManager_carryOverNewGamePlusData.call(this);
  343.  
  344.       $gameStorageSystems = this._ngpData.storageSystems;
  345.     };
  346.   } // Imported YEP_X_NewGamePlus
  347.   //==========================================================================
  348.   // Game_StorageSystems
  349.   //==========================================================================
  350.  
  351.  
  352.   Game_StorageSystems.prototype.initialize = function () {
  353.     this._data = [];
  354.     this._lastActive = 0;
  355.   };
  356.  
  357.   Game_StorageSystems.prototype.storage = function (storageId) {
  358.     if (_typeof($dataStorage[storageId]) !== "object") {
  359.       return;
  360.     }
  361.  
  362.     if ($dataStorage[storageId]) {
  363.       if (!this._data[storageId]) {
  364.         this._data[storageId] = new Game_StorageSystem(storageId);
  365.       }
  366.  
  367.       return this._data[storageId];
  368.     }
  369.  
  370.     return null;
  371.   };
  372.  
  373.   Game_StorageSystems.prototype.current = function () {
  374.     return this.storage(this._lastActive);
  375.   };
  376.  
  377.   Game_StorageSystems.prototype.open = function (storageId) {
  378.     if (typeof storageId !== "undefined") {
  379.       this._lastActive = storageId;
  380.     }
  381.  
  382.     if (!this.current()) {
  383.       return;
  384.     }
  385.  
  386.     SceneManager.push(Scene_Storage);
  387.   }; //==========================================================================
  388.   // Game_StorageSystem
  389.   //==========================================================================
  390.  
  391.  
  392.   Game_StorageSystem.prototype.initialize = function (storageId) {
  393.     var storage = $dataStorage[storageId];
  394.     this._storageId = parseInt(storageId);
  395.     this._title = storage.titleText;
  396.     this._allowedTypes = storage.allowedTypes;
  397.     this._maxCapacity = storage.maxCapacity;
  398.     this._stackSize = storage.stackSize !== "none" ? parseInt(storage.stackSize) : "none";
  399.     this.clear();
  400.   };
  401.  
  402.   Game_StorageSystem.prototype.data = function () {
  403.     return $dataStorage[this._storageId];
  404.   };
  405.  
  406.   Game_StorageSystem.prototype.title = function () {
  407.     return this._title;
  408.   };
  409.  
  410.   Game_StorageSystem.prototype.allowedTypes = function () {
  411.     return this._allowedTypes;
  412.   };
  413.  
  414.   Game_StorageSystem.prototype.maxCapacity = function () {
  415.     return this._maxCapacity;
  416.   };
  417.  
  418.   Game_StorageSystem.prototype.changeMaxCapacity = function (capacity) {
  419.     this._maxCapacity = capacity;
  420.   };
  421.  
  422.   Game_StorageSystem.prototype.capacity = function () {
  423.     var sum = 0;
  424.  
  425.     if (this._stackSize === "none") {
  426.       sum = this.allItems().map(function (item) {
  427.         return this.numItems(item);
  428.       }, this).reduce(function (total, current) {
  429.         return total + current;
  430.       }, 0);
  431.     } else {
  432.       sum = this.allItems().length;
  433.     }
  434.  
  435.     return sum;
  436.   };
  437.  
  438.   Game_StorageSystem.prototype.capacityRate = function () {
  439.     return this.capacity() / this.maxCapacity();
  440.   };
  441.  
  442.   Game_StorageSystem.prototype.items = function () {
  443.     return Object.keys(this._items).map(function (id) {
  444.       return $dataItems[id];
  445.     });
  446.   };
  447.  
  448.   Game_StorageSystem.prototype.weapons = function () {
  449.     return Object.keys(this._weapons).map(function (id) {
  450.       return $dataWeapons[id];
  451.     });
  452.   };
  453.  
  454.   Game_StorageSystem.prototype.armors = function () {
  455.     return Object.keys(this._armors).map(function (id) {
  456.       return $dataArmors[id];
  457.     });
  458.   };
  459.  
  460.   Game_StorageSystem.prototype.equipItems = function () {
  461.     return this.weapons().concat(this.armors());
  462.   };
  463.  
  464.   Game_StorageSystem.prototype.allItems = function () {
  465.     return this.items().concat(this.equipItems());
  466.   };
  467.  
  468.   Game_StorageSystem.prototype.isEmpty = function () {
  469.     return this.allItems().length === 0;
  470.   };
  471.  
  472.   Game_StorageSystem.prototype.addItem = function (item, amount) {
  473.     if (!this.canStoreItem(item)) return;
  474.     var container = this.itemContainer(item);
  475.  
  476.     if (container) {
  477.       var oldNumber = this.numItems(item);
  478.  
  479.       if (amount > 0) {
  480.         amount = Math.min(amount, this.maxItems(item));
  481.       } else {
  482.         amount = Math.max(amount, -this.numItems(item));
  483.       }
  484.  
  485.       container[item.id] = oldNumber + amount;
  486.  
  487.       if (container[item.id] === 0) {
  488.         delete container[item.id];
  489.       }
  490.     }
  491.   };
  492.  
  493.   Game_StorageSystem.prototype.removeItem = function (item, amount) {
  494.     if (arguments < 2) {
  495.       this.addItem(item, -this.numItems(item));
  496.     } else {
  497.       this.addItem(item, -amount);
  498.     }
  499.   };
  500.  
  501.   Game_StorageSystem.prototype.clear = function () {
  502.     this._items = {};
  503.     this._weapons = {};
  504.     this._armors = {};
  505.   };
  506.  
  507.   Game_StorageSystem.prototype.isTypeAllowed = function (type) {
  508.     return type && this._allowedTypes.contains(type.toLowerCase());
  509.   };
  510.  
  511.   Game_StorageSystem.prototype.canStoreItem = function (item) {
  512.     if (item && item.onlyInStorage.length > 0) {
  513.       return item.onlyInStorage.contains(this._storageId);
  514.     }
  515.  
  516.     return true;
  517.   };
  518.  
  519.   Game_StorageSystem.prototype.numItems = function (item) {
  520.     var container = this.itemContainer(item);
  521.     return container ? container[item.id] || 0 : 0;
  522.   };
  523.  
  524.   Game_StorageSystem.prototype.maxItems = function (item) {
  525.     if (this._stackSize === "none") {
  526.       return this.maxCapacity() - this.capacity();
  527.     }
  528.  
  529.     return Math.max(parseInt(this._stackSize, 10) - this.numItems(item), 0);
  530.   };
  531.  
  532.   Game_StorageSystem.prototype.itemContainer = function (item) {
  533.     if (!item) {
  534.       return null;
  535.     } else if (DataManager.isItem(item)) {
  536.       return this._items;
  537.     } else if (DataManager.isWeapon(item)) {
  538.       return this._weapons;
  539.     } else if (DataManager.isArmor(item)) {
  540.       return this._armors;
  541.     }
  542.  
  543.     return null;
  544.   };
  545.  
  546.   Game_StorageSystem.prototype.getItemCategory = function (item) {
  547.     if (DataManager.isItem(item) && item.itypeId === 1) {
  548.       return "Items";
  549.     } else if (DataManager.isItem(item) && item.itypeId === 2) {
  550.       return "KeyItems";
  551.     } else if (DataManager.isWeapon(item)) {
  552.       return "Weapons";
  553.     } else if (DataManager.isArmor(item)) {
  554.       return "Armors";
  555.     }
  556.  
  557.     return false;
  558.   }; //==========================================================================
  559.   // Window_Base
  560.   //==========================================================================
  561.  
  562.  
  563.   if (!Window_Base.prototype.textWidthEx) {
  564.     Window_Base.prototype.textWidthEx = function (text) {
  565.       return this.drawTextEx(text, 0, this.contents.height);
  566.     };
  567.   } //==========================================================================
  568.   // Window_StorageTitle
  569.   //==========================================================================
  570.  
  571.  
  572.   Window_StorageTitle.prototype = Object.create(Window_Base.prototype);
  573.   Window_StorageTitle.prototype.constructor = Window_StorageTitle;
  574.  
  575.   Window_StorageTitle.prototype.initialize = function (x, y, w, h) {
  576.     Window_Base.prototype.initialize.call(this, x, y, w, h);
  577.     this._title = $gameStorageSystems.current().title();
  578.     this.refresh();
  579.   };
  580.  
  581.   Window_StorageTitle.prototype.refresh = function () {
  582.     this.contents.clear();
  583.     var text = this._title;
  584.     var dw = this.contents.width + this.textPadding();
  585.     var tw = this.textWidthEx(text);
  586.     var dx = Math.floor(Math.max(0, dw - tw) / 2);
  587.     this.drawTextEx(text, this.textPadding() + dx, 0);
  588.   }; //==========================================================================
  589.   // Window_StorageCommand
  590.   //==========================================================================
  591.  
  592.  
  593.   Window_StorageCommand.prototype = Object.create(Window_HorzCommand.prototype);
  594.   Window_StorageCommand.prototype.constructor = Window_StorageCommand;
  595.  
  596.   Window_StorageCommand.prototype.initialize = function (x, y) {
  597.     this.setup();
  598.     Window_HorzCommand.prototype.initialize.call(this, x, y);
  599.     this.select(0);
  600.   };
  601.  
  602.   Window_StorageCommand.prototype.setup = function () {
  603.     var data = $gameStorageSystems.current().data();
  604.     this._storageMode = data.storageMode;
  605.     data = data.command;
  606.     this._align = data.align;
  607.     this._rows = data.rows;
  608.     this._cols = data.cols;
  609.     this._width = eval(data.width);
  610.     this._addText = data.addText;
  611.     this._removeText = data.removeText;
  612.   };
  613.  
  614.   Window_StorageCommand.prototype.itemAlign = function () {
  615.     return this._align;
  616.   };
  617.  
  618.   Window_StorageCommand.prototype.windowWidth = function () {
  619.     return this._width;
  620.   };
  621.  
  622.   Window_StorageCommand.prototype.numVisibleRows = function () {
  623.     return this._rows;
  624.   };
  625.  
  626.   Window_StorageCommand.prototype.maxCols = function () {
  627.     return this._cols;
  628.   };
  629.  
  630.   Window_StorageCommand.prototype.makeCommandList = function () {
  631.     if (this._storageMode === "Remove") {
  632.       this.addCommand(this._removeText, "remove");
  633.     } else if (this._storageMode === "Add") {
  634.       this.addCommand(this._addText, "add");
  635.     } else {
  636.       this.addCommand(this._addText, "add");
  637.       this.addCommand(this._removeText, "remove");
  638.     }
  639.   };
  640.  
  641.   Window_StorageCommand.prototype.lastOption = function () {
  642.     return this._index;
  643.   }; //==========================================================================
  644.   // Window_StorageCategory
  645.   //==========================================================================
  646.  
  647.  
  648.   Window_StorageCategory.prototype = Object.create(Window_HorzCommand.prototype);
  649.   Window_StorageCategory.prototype.constructor = Window_StorageCategory;
  650.  
  651.   Window_StorageCategory.prototype.initialize = function (x, y) {
  652.     this.setup();
  653.     Window_HorzCommand.prototype.initialize.call(this, x, y);
  654.   };
  655.  
  656.   Window_StorageCategory.prototype.setup = function () {
  657.     var data = $gameStorageSystems.current().data().category;
  658.     this._align = data.align;
  659.     this._rows = data.rows;
  660.     this._cols = data.cols;
  661.     this._width = eval(data.width);
  662.   };
  663.  
  664.   Window_StorageCategory.prototype.itemAlign = function () {
  665.     return this._align;
  666.   };
  667.  
  668.   Window_StorageCategory.prototype.windowWidth = function () {
  669.     return this._width;
  670.   };
  671.  
  672.   Window_StorageCategory.prototype.numVisibleRows = function () {
  673.     return this._rows;
  674.   };
  675.  
  676.   Window_StorageCategory.prototype.maxCols = function () {
  677.     return this._cols;
  678.   };
  679.  
  680.   if (!Imported.YEP_X_ItemCategories) {
  681.     Window_StorageCategory.prototype.makeCommandList = function () {
  682.       var data = $gameStorageSystems.current().allowedTypes();
  683.       var length = data.length;
  684.  
  685.       for (var i = 0; i < length; i++) {
  686.         var category = data[i].trim();
  687.         this.addItemCategory(category);
  688.       }
  689.     };
  690.  
  691.     Window_StorageCategory.prototype.addItemCategory = function (category) {
  692.       if (category.match(/KeyItems/i)) {
  693.         return this.addCommand(TextManager.keyItem, "keyItem");
  694.       } else if (category.match(/Items/i)) {
  695.         return this.addCommand(TextManager.item, "item");
  696.       } else if (category.match(/Weapons/i)) {
  697.         return this.addCommand(TextManager.weapon, "weapon");
  698.       } else if (category.match(/Armors/i)) {
  699.         return this.addCommand(TextManager.armor, "armor");
  700.       }
  701.     };
  702.   } else {
  703.     // Imported.YEP_X_ItemCategories
  704.     Window_StorageCategory.prototype.makeCommandList = function () {
  705.       var data = $gameStorageSystems.current().allowedTypes();
  706.       var length = data.length;
  707.  
  708.       for (var i = 0; i < length; i++) {
  709.         var category = data[i].trim();
  710.         Window_ItemCategory.prototype.addItemCategory.call(this, category);
  711.       }
  712.     };
  713.   } // Imported.YEP_X_ItemCategories
  714.  
  715.  
  716.   Window_StorageCategory.prototype.update = function () {
  717.     Window_HorzCommand.prototype.update.call(this);
  718.  
  719.     if (this.visible) {
  720.       this._itemWindow.setCategory(this.currentSymbol());
  721.  
  722.       this._itemWindow.setExt(this.currentExt());
  723.     }
  724.   };
  725.  
  726.   Window_StorageCategory.prototype.setItemWindow = function (itemWindow) {
  727.     this._itemWindow = itemWindow;
  728.     this.update();
  729.   }; //==========================================================================
  730.   // Window_StorageItemList
  731.   //==========================================================================
  732.  
  733.  
  734.   Window_StorageItemList.prototype = Object.create(Window_ItemList.prototype);
  735.   Window_StorageItemList.prototype.constructor = Window_StorageItemList;
  736.  
  737.   Window_StorageItemList.prototype.initialize = function (x, y, w, h) {
  738.     this.setup();
  739.     Window_ItemList.prototype.initialize.call(this, x, y, w, h);
  740.     this._mode = "none";
  741.     this._storage = $gameStorageSystems.current();
  742.   };
  743.  
  744.   Window_StorageItemList.prototype.setup = function () {
  745.     var data = $gameStorageSystems.current().data().item;
  746.     this._cols = data.cols;
  747.   };
  748.  
  749.   Window_StorageItemList.prototype.maxCols = function () {
  750.     return this._cols;
  751.   };
  752.  
  753.   Window_StorageItemList.prototype.setExt = function (ext) {
  754.     if (this._ext !== ext) {
  755.       this._ext = ext;
  756.       this.refresh();
  757.       this.resetScroll();
  758.     }
  759.   };
  760.  
  761.   Window_StorageItemList.prototype.setMode = function (mode) {
  762.     if (this._mode !== mode) {
  763.       this._mode = mode;
  764.       this.refresh();
  765.       this.resetScroll();
  766.     }
  767.   };
  768.  
  769.   Window_StorageItemList.prototype.refresh = function () {
  770.     Window_ItemList.prototype.refresh.call(this);
  771.  
  772.     if (this._helpWindow) {
  773.       this._helpWindow.setItem(this.item());
  774.  
  775.       this._helpWindow.refresh();
  776.     }
  777.   };
  778.  
  779.   Window_StorageItemList.prototype.mode = function () {
  780.     return this._mode;
  781.   };
  782.  
  783.   if (!Imported.YEP_X_ItemCategories) {
  784.     Window_StorageItemList.prototype.includes = function (item) {
  785.       if (!this._storage.canStoreItem(item)) {
  786.         return false;
  787.       }
  788.  
  789.       switch (this._category) {
  790.         case "item":
  791.           return DataManager.isItem(item) && item.itypeId === 1;
  792.  
  793.         case "weapon":
  794.           return DataManager.isWeapon(item);
  795.  
  796.         case "armor":
  797.           return DataManager.isArmor(item);
  798.  
  799.         case "keyItem":
  800.           return DataManager.isItem(item) && item.itypeId === 2;
  801.  
  802.         case "AllItems":
  803.           return this._storage.isTypeAllowed(this._storage.getItemCategory(item));
  804.  
  805.         default:
  806.           return false;
  807.       }
  808.     };
  809.   } else {
  810.     // Imported.YEP_X_ItemCategories
  811.     Window_StorageItemList.prototype.includes = function (item) {
  812.       if (!item) return false;
  813.  
  814.       if (!this._storage.canStoreItem(item)) {
  815.         return false;
  816.       }
  817.  
  818.       if (this._category === "AllItems") return true;
  819.       return Window_ItemList.prototype.includes.call(this, item);
  820.     };
  821.   } // Imported.YEP_X_ItemCategories
  822.  
  823.  
  824.   Window_StorageItemList.prototype.makeItemList = function () {
  825.     if (this._mode === "add") {
  826.       this._data = $gameParty.allItems().filter(function (item) {
  827.         return this.includes(item);
  828.       }, this);
  829.     } else if (this._mode === "remove") {
  830.       this._data = this._storage.allItems().filter(function (item) {
  831.         return this.includes(item);
  832.       }, this);
  833.     }
  834.  
  835.     if (this.includes(null)) {
  836.       this._data.push(null);
  837.     }
  838.   };
  839.  
  840.   Window_StorageItemList.prototype.drawItemNumber = function (item, x, y, width) {
  841.     this.drawText("x", x, y, width - this.textWidth("00"), "right");
  842.     var itemNum = this._mode === "add" ? $gameParty.numItems(item) : this._storage.numItems(item);
  843.     this.drawText(itemNum, x, y, width, "right");
  844.   };
  845.  
  846.   Window_StorageItemList.prototype.isEnabled = function (item) {
  847.     if (!item) {
  848.       return false;
  849.     }
  850.  
  851.     if (item.cannotStore) {
  852.       return false;
  853.     }
  854.  
  855.     if (this._mode === "add") {
  856.       if (this._storage.numItems(item) > 0) {
  857.         return this._storage.maxItems(item) > 0;
  858.       }
  859.  
  860.       return this._storage.capacity() < this._storage.maxCapacity();
  861.     } else {
  862.       return $gameParty.maxItems(item) - $gameParty.numItems(item) > 0;
  863.     }
  864.   }; //==========================================================================
  865.   // Window_StorageInfo
  866.   //==========================================================================
  867.  
  868.  
  869.   Window_StorageInfo.prototype = Object.create(Window_Base.prototype);
  870.   Window_StorageInfo.prototype.constructor = Window_StorageInfo;
  871.  
  872.   Window_StorageInfo.prototype.initialize = function (x, y, w, h) {
  873.     Window_Base.prototype.initialize.call(this, x, y, w, h);
  874.     this._storage = $gameStorageSystems.current();
  875.     this._text = this._storage.data().infoText;
  876.     this.refresh();
  877.   };
  878.  
  879.   Window_StorageInfo.prototype.text = function () {
  880.     return this._text.replace("%1", this._storage.capacity() + "/" + this._storage.maxCapacity());
  881.   };
  882.  
  883.   Window_StorageInfo.prototype.refresh = function () {
  884.     this.contents.clear();
  885.     this.drawTextEx(this.text(), this.textPadding(), 0);
  886.   }; //==========================================================================
  887.   // Window_StorageNumber
  888.   //==========================================================================
  889.  
  890.  
  891.   Window_StorageNumber.prototype = Object.create(Window_ShopNumber.prototype);
  892.   Window_StorageNumber.prototype.constructor = Window_StorageNumber;
  893.  
  894.   Window_StorageNumber.prototype.initialize = function (x, y, w, h) {
  895.     Window_Selectable.prototype.initialize.call(this, x, y, w, h);
  896.     this._storage = $gameStorageSystems.current();
  897.     this._item = null;
  898.     this._max = 1;
  899.     this._number = 1;
  900.     this.createButtons();
  901.   };
  902.  
  903.   Window_StorageNumber.prototype.setup = function (item, mode) {
  904.     this._item = item;
  905.     this._number = 1;
  906.  
  907.     if (mode === "add") {
  908.       this._max = $gameParty.numItems(item);
  909.  
  910.       if (this._max > this._storage.maxItems(item)) {
  911.         this._max = this._storage.maxItems(item);
  912.       }
  913.     } else {
  914.       this._max = this._storage.numItems(item);
  915.  
  916.       if (this._max > $gameParty.maxItems(item)) {
  917.         this._max = $gameParty.maxItems(item);
  918.       }
  919.     }
  920.  
  921.     if (this._max < 0) {
  922.       this._max = 0;
  923.     }
  924.  
  925.     this.placeButtons();
  926.     this.updateButtonsVisiblity();
  927.     this.refresh();
  928.   };
  929.  
  930.   Window_StorageNumber.prototype.refresh = function () {
  931.     this.contents.clear();
  932.     this.drawItemName(this._item, 0, this.itemY());
  933.     this.drawNumber();
  934.     this.drawMax();
  935.   };
  936.  
  937.   Window_StorageNumber.prototype.drawNumber = function () {
  938.     var x = this.cursorX();
  939.     var y = this.itemY();
  940.     var width = this.cursorWidth() - this.textPadding();
  941.     this.resetTextColor();
  942.     this.drawText(this._number, x, y, width, "right");
  943.   };
  944.  
  945.   Window_StorageNumber.prototype.drawMax = function () {
  946.     var width = this.contentsWidth() - this.textPadding();
  947.     this.resetTextColor();
  948.     this.drawText(this._max, 0, this.priceY(), width, "right");
  949.   }; //==========================================================================
  950.   // Scene_Storage
  951.   //==========================================================================
  952.  
  953.  
  954.   Scene_Storage.prototype = Object.create(Scene_MenuBase.prototype);
  955.   Scene_Storage.prototype.constructor = Scene_Storage;
  956.  
  957.   Scene_Storage.prototype.initialize = function () {
  958.     this.setup();
  959.     Scene_MenuBase.prototype.initialize.call(this);
  960.     this._storage = $gameStorageSystems.current();
  961.   };
  962.  
  963.   Scene_Storage.prototype.setup = function () {
  964.     var data = $gameStorageSystems.current().data();
  965.     this._background = data.background;
  966.     this._blurredBackground = data.blurredBackground;
  967.     this._displayCategories = data.displayCategories;
  968.     this._helpData = data.help;
  969.     this._titleData = data.title;
  970.     this._commandData = data.command;
  971.     this._categoryData = data.category;
  972.     this._infoData = data.info;
  973.     this._itemData = data.item;
  974.     this._numberData = data.number;
  975.   };
  976.  
  977.   Scene_Storage.prototype.createBackground = function () {
  978.     if (this._blurredBackground) {
  979.       this._backgroundSprite = new Sprite();
  980.       this._backgroundSprite.bitmap = SceneManager.backgroundBitmap();
  981.       this.addChild(this._backgroundSprite);
  982.     } else if (this._background !== "") {
  983.       this._backgroundSprite = new Sprite();
  984.       this._backgroundSprite.bitmap = ImageManager.loadPicture(this._background);
  985.       this.addChild(this._backgroundSprite);
  986.     }
  987.   };
  988.  
  989.   Scene_Storage.prototype.create = function () {
  990.     Scene_MenuBase.prototype.create.call(this);
  991.     this.createHelpWindow();
  992.     this.createTitleWindow();
  993.     this.createCommandWindow();
  994.  
  995.     if (this._displayCategories) {
  996.       this.createCategoryWindow();
  997.     }
  998.  
  999.     this.createInfoWindow();
  1000.     this.createItemWindow();
  1001.     this.createNumberWindow();
  1002.   };
  1003.  
  1004.   Scene_Storage.prototype.createHelpWindow = function () {
  1005.     this._helpWindow = new Window_Help();
  1006.     this.addWindow(this._helpWindow);
  1007.     this._helpWindow.x = eval(this._helpData.x);
  1008.     this._helpWindow.y = eval(this._helpData.y);
  1009.     this._helpWindow.width = eval(this._helpData.width);
  1010.     this._helpWindow.height = eval(this._helpData.height);
  1011.   };
  1012.  
  1013.   Scene_Storage.prototype.createTitleWindow = function () {
  1014.     var wx = eval(this._titleData.x);
  1015.     var wy = eval(this._titleData.y);
  1016.     var ww = eval(this._titleData.width);
  1017.     var wh = eval(this._titleData.height);
  1018.     this._titleWindow = new Window_StorageTitle(wx, wy, ww, wh);
  1019.     this.addWindow(this._titleWindow);
  1020.   };
  1021.  
  1022.   Scene_Storage.prototype.createCommandWindow = function () {
  1023.     var wx = eval(this._commandData.x);
  1024.     var wy = eval(this._commandData.y);
  1025.     this._commandWindow = new Window_StorageCommand(wx, wy);
  1026.  
  1027.     if (this._displayCategories) {
  1028.       this._commandWindow.setHandler("add", this.onCommandOk.bind(this));
  1029.  
  1030.       this._commandWindow.setHandler("remove", this.onCommandOk.bind(this));
  1031.     } else {
  1032.       this._commandWindow.setHandler("add", this.onCategoryOk.bind(this));
  1033.  
  1034.       this._commandWindow.setHandler("remove", this.onCategoryOk.bind(this));
  1035.     }
  1036.  
  1037.     this._commandWindow.setHandler("cancel", this.onCommandCancel.bind(this));
  1038.  
  1039.     this.addWindow(this._commandWindow);
  1040.   };
  1041.  
  1042.   Scene_Storage.prototype.createCategoryWindow = function () {
  1043.     var wx = eval(this._categoryData.x);
  1044.     var wy = eval(this._categoryData.y);
  1045.     this._categoryWindow = new Window_StorageCategory(wx, wy);
  1046.  
  1047.     this._categoryWindow.setHandler("ok", this.onCategoryOk.bind(this));
  1048.  
  1049.     this._categoryWindow.setHandler("cancel", this.onCategoryCancel.bind(this));
  1050.  
  1051.     this._categoryWindow.deactivate();
  1052.  
  1053.     this._categoryWindow.hide();
  1054.  
  1055.     this.addWindow(this._categoryWindow);
  1056.   };
  1057.  
  1058.   Scene_Storage.prototype.createInfoWindow = function () {
  1059.     var wx = eval(this._infoData.x);
  1060.     var wy = eval(this._infoData.y);
  1061.     var ww = eval(this._infoData.width);
  1062.     this._infoWindow = new Window_StorageInfo(wx, wy, ww, 80);
  1063.     this.addWindow(this._infoWindow);
  1064.   };
  1065.  
  1066.   Scene_Storage.prototype.createItemWindow = function () {
  1067.     var wx = eval(this._itemData.x);
  1068.     var wy = eval(this._itemData.y);
  1069.     var ww = eval(this._itemData.width);
  1070.     var wh = eval(this._itemData.height);
  1071.     this._itemWindow = new Window_StorageItemList(wx, wy, ww, wh);
  1072.  
  1073.     this._itemWindow.setHelpWindow(this._helpWindow);
  1074.  
  1075.     if (this._displayCategories) {
  1076.       this._categoryWindow.setItemWindow(this._itemWindow);
  1077.     }
  1078.  
  1079.     this._itemWindow.setHandler("ok", this.onItemOk.bind(this));
  1080.  
  1081.     this._itemWindow.setHandler("cancel", this.onItemCancel.bind(this));
  1082.  
  1083.     this.addWindow(this._itemWindow);
  1084.     this.showWholeStorage();
  1085.   };
  1086.  
  1087.   Scene_Storage.prototype.showWholeStorage = function () {
  1088.     this._itemWindow.setMode("remove");
  1089.  
  1090.     this._itemWindow.setCategory("AllItems");
  1091.  
  1092.     this._itemWindow.refresh();
  1093.   };
  1094.  
  1095.   Scene_Storage.prototype.createNumberWindow = function () {
  1096.     var wx = eval(this._numberData.x);
  1097.     var wy = eval(this._numberData.y);
  1098.     var ww = eval(this._numberData.width);
  1099.     var wh = eval(this._numberData.height);
  1100.     this._numberWindow = new Window_StorageNumber(wx, wy, ww, wh);
  1101.  
  1102.     this._numberWindow.setHandler("ok", this.onNumberOk.bind(this));
  1103.  
  1104.     this._numberWindow.setHandler("cancel", this.onNumberCancel.bind(this));
  1105.  
  1106.     this._numberWindow.hide();
  1107.  
  1108.     this.addWindow(this._numberWindow);
  1109.   };
  1110.  
  1111.   Scene_Storage.prototype.activateItemWindow = function () {
  1112.     this._infoWindow.refresh();
  1113.  
  1114.     this._itemWindow.refresh();
  1115.  
  1116.     this._itemWindow.activate();
  1117.   };
  1118.  
  1119.   Scene_Storage.prototype.item = function () {
  1120.     return this._itemWindow.item();
  1121.   };
  1122.  
  1123.   Scene_Storage.prototype.onCommandCancel = function () {
  1124.     SceneManager.pop();
  1125.   };
  1126.  
  1127.   Scene_Storage.prototype.onCommandOk = function () {
  1128.     this._itemWindow.setMode(this._commandWindow.currentSymbol());
  1129.  
  1130.     this._commandWindow.deactivate();
  1131.  
  1132.     this._commandWindow.hide();
  1133.  
  1134.     this._categoryWindow.activate();
  1135.  
  1136.     this._categoryWindow.select(0);
  1137.  
  1138.     this._categoryWindow.show();
  1139.   };
  1140.  
  1141.   Scene_Storage.prototype.onCategoryOk = function () {
  1142.     this._itemWindow.activate();
  1143.  
  1144.     this._itemWindow.selectLast();
  1145.  
  1146.     if (!this._displayCategories) {
  1147.       this._itemWindow.setMode(this._commandWindow.currentSymbol());
  1148.  
  1149.       this._itemWindow.setCategory("AllItems");
  1150.  
  1151.       this._itemWindow.refresh();
  1152.     }
  1153.   };
  1154.  
  1155.   Scene_Storage.prototype.onCategoryCancel = function () {
  1156.     this._categoryWindow.deselect();
  1157.  
  1158.     this._categoryWindow.deactivate();
  1159.  
  1160.     this._categoryWindow.hide();
  1161.  
  1162.     this._commandWindow.show();
  1163.  
  1164.     this._commandWindow.activate();
  1165.  
  1166.     this.showWholeStorage();
  1167.   };
  1168.  
  1169.   Scene_Storage.prototype.onItemOk = function () {
  1170.     this._item = this._itemWindow.item();
  1171.  
  1172.     this._itemWindow.deactivate();
  1173.  
  1174.     this._numberWindow.setup(this._item, this._itemWindow.mode());
  1175.  
  1176.     this._numberWindow.show();
  1177.  
  1178.     this._numberWindow.activate();
  1179.   };
  1180.  
  1181.   Scene_Storage.prototype.storeItem = function (amount) {
  1182.     this._storage.addItem(this.item(), amount);
  1183.  
  1184.     $gameParty.loseItem(this.item(), amount);
  1185.   };
  1186.  
  1187.   Scene_Storage.prototype.depositItem = function (amount) {
  1188.     this._storage.removeItem(this.item(), amount);
  1189.  
  1190.     $gameParty.gainItem(this.item(), amount);
  1191.   };
  1192.  
  1193.   Scene_Storage.prototype.onItemCancel = function () {
  1194.     this._itemWindow.deselect();
  1195.  
  1196.     this._helpWindow.clear();
  1197.  
  1198.     if (this._displayCategories) {
  1199.       this._categoryWindow.activate();
  1200.     } else {
  1201.       this._itemWindow.setCategory("none");
  1202.  
  1203.       this._commandWindow.activate();
  1204.  
  1205.       this.showWholeStorage();
  1206.     }
  1207.   };
  1208.  
  1209.   Scene_Storage.prototype.onNumberOk = function () {
  1210.     var okSound = this._numberData.okSound;
  1211.  
  1212.     if (okSound && okSound.name) {
  1213.       AudioManager.playSe(okSound);
  1214.     } else {
  1215.       SoundManager.playShop();
  1216.     }
  1217.  
  1218.     var mode = this._itemWindow.mode();
  1219.  
  1220.     if (mode === "add") {
  1221.       this.storeItem(this._numberWindow.number());
  1222.     } else if (mode === "remove") {
  1223.       this.depositItem(this._numberWindow.number());
  1224.     }
  1225.  
  1226.     this.endNumberInput();
  1227.   };
  1228.  
  1229.   Scene_Storage.prototype.endNumberInput = function () {
  1230.     this._numberWindow.hide();
  1231.  
  1232.     this._itemWindow.refresh();
  1233.  
  1234.     this._infoWindow.refresh();
  1235.  
  1236.     this._itemWindow.activate();
  1237.   };
  1238.  
  1239.   Scene_Storage.prototype.onNumberCancel = function () {
  1240.     SoundManager.playCancel();
  1241.     this.endNumberInput();
  1242.   };
  1243. })(WAYModuleLoader.getModule("WAY_StorageSystem")); //-----------------------------------------------------------------------------
  1244.  
  1245.  
  1246. function Window_StorageTitle() {
  1247.   this.initialize.apply(this, arguments);
  1248. }
  1249.  
  1250. function Window_StorageCommand() {
  1251.   this.initialize.apply(this, arguments);
  1252. }
  1253.  
  1254. function Window_StorageCategory() {
  1255.   this.initialize.apply(this, arguments);
  1256. }
  1257.  
  1258. function Window_StorageItemList() {
  1259.   this.initialize.apply(this, arguments);
  1260. }
  1261.  
  1262. function Window_StorageInfo() {
  1263.   this.initialize.apply(this, arguments);
  1264. }
  1265.  
  1266. function Window_StorageNumber() {
  1267.   this.initialize.apply(this, arguments);
  1268. }
  1269.  
  1270. function Scene_Storage() {
  1271.   this.initialize.apply(this, arguments);
  1272. }
  1273.  
  1274. function Game_StorageSystems() {
  1275.   this.initialize.apply(this, arguments);
  1276. }
  1277.  
  1278. function Game_StorageSystem() {
  1279.   this.initialize.apply(this, arguments);
  1280. } //-----------------------------------------------------------------------------
  1281.  
  1282. /*~struct~storage:
  1283. @param blurredBackground
  1284. @text 使用模糊透明背景
  1285. @type boolean
  1286. @default false
  1287.  
  1288. @param background
  1289. @text 菜单背景
  1290. @type file
  1291. @dir img/pictures
  1292. @default
  1293.  
  1294. @param titleText
  1295. @text 存储标题
  1296. @type text
  1297. @default \i[210]STORAGE SYSTEM
  1298.  
  1299. @param infoText
  1300. @text 信息窗口文本
  1301. @type text
  1302. @default Capacity: %1\i[208]
  1303.  
  1304. @param maxCapacity
  1305. @text 最大容量
  1306. @type number
  1307. @min 1
  1308. @max 9999
  1309. @default 20
  1310.  
  1311. @param stackSize
  1312. @text 堆栈大小
  1313. @type combo
  1314. @option none
  1315. @option 8
  1316. @option 16
  1317. @option 32
  1318. @option 64
  1319. @default none
  1320.  
  1321. @param displayCategories
  1322. @text 显示类别
  1323. @type boolean
  1324. @default true
  1325.  
  1326. @param allowedTypes
  1327. @text 允许物品类型
  1328. @type text[]
  1329. @default ["items","armors","weapons","keyitems"]
  1330.  
  1331. @param storageMode
  1332. @text 存储模式
  1333. @type combo
  1334. @option "Add/Remove"
  1335. @option "Add"
  1336. @option "Remove"
  1337. @default "Add/Remove"
  1338.  
  1339. @param Scene Settings
  1340. @default Customize window parameters.
  1341.  
  1342. @param help
  1343. @text 帮助窗口设置
  1344. @type struct<help>
  1345. @default {"x":"0","y":"Graphics.boxHeight - this._helpWindow.height - 80","width":"Graphics.boxWidth","height":"108"}
  1346. @parent Scene Settings
  1347.  
  1348. @param title
  1349. @text 标题窗口设置
  1350. @type struct<title>
  1351. @default {"x":"0","y":"0","width":"Graphics.boxWidth","height":"72"}
  1352. @parent Scene Settings
  1353.  
  1354. @param command
  1355. @text 命令窗口设置
  1356. @type struct<command>
  1357. @default {"align":"center","x":"0","y":"72","width":"Graphics.boxWidth","rows":"1","cols":"2","addText":"Add","removeText":"Remove"}
  1358. @parent Scene Settings
  1359.  
  1360. @param category
  1361. @text 类别窗口设置
  1362. @type struct<category>
  1363. @default {"align":"center","x":"0","y":"72","width":"Graphics.boxWidth","rows":"1","cols":"4"}
  1364. @parent Scene Settings
  1365.  
  1366. @param item
  1367. @text 道具窗口设置
  1368. @type struct<item>
  1369. @default {"x":"0","y":"144","width":"Graphics.boxWidth","height":"Graphics.boxHeight - 224 - this._helpWindow.height","cols":"2"}
  1370. @parent Scene Settings
  1371.  
  1372. @param info
  1373. @text 信息窗口设置
  1374. @type struct<info>
  1375. @default {"x":"0","y":"Graphics.boxHeight - 80","width":"Graphics.boxWidth"}
  1376. @parent Scene Settings
  1377.  
  1378. @param number
  1379. @text 数字窗口设置
  1380. @type struct<number>
  1381. @default {"x":"Graphics.boxWidth / 2 - 250","y":"168","width":"500","height":"450"}
  1382. @parent Scene Settings
  1383. */
  1384.  
  1385. /*~struct~help:
  1386. @param x
  1387. @text Help Window X
  1388. @type text
  1389. @default 0
  1390.  
  1391. @param y
  1392. @text Help Window Y
  1393. @type text
  1394. @default Graphics.boxHeight - this._helpWindow.height - 80
  1395.  
  1396. @param width
  1397. @text Help Window Width
  1398. @type text
  1399. @default Graphics.boxWidth
  1400.  
  1401. @param height
  1402. @text Help Window Height
  1403. @type text
  1404. @default 108
  1405. */
  1406.  
  1407. /*~struct~title:
  1408. @param x
  1409. @text Title Window X
  1410. @type text
  1411. @default 0
  1412.  
  1413. @param y
  1414. @text Title Window Y
  1415. @type text
  1416. @default 0
  1417.  
  1418. @param width
  1419. @text Title Window Width
  1420. @type text
  1421. @default Graphics.boxWidth
  1422.  
  1423. @param height
  1424. @text Title Window Height
  1425. @type text
  1426. @default 72
  1427. */
  1428.  
  1429. /*~struct~command:
  1430. @param align
  1431. @text Command Window Align
  1432. @type select
  1433. @option left
  1434. @option center
  1435. @option right
  1436. @default center
  1437.  
  1438. @param x
  1439. @text Command Window X
  1440. @type text
  1441. @default 0
  1442.  
  1443. @param y
  1444. @text Command Window Y
  1445. @type text
  1446. @default 72
  1447.  
  1448. @param width
  1449. @text Command Window Width
  1450. @type text
  1451. @default Graphics.boxWidth
  1452.  
  1453. @param rows
  1454. @text Command Window Rows
  1455. @type number
  1456. @min 1
  1457. @default 1
  1458.  
  1459. @param cols
  1460. @text Command Window Cols
  1461. @type number
  1462. @min 1
  1463. @default 2
  1464.  
  1465. @param addText
  1466. @text Add Text
  1467. @type text
  1468. @default Add
  1469.  
  1470. @param removeText
  1471. @text Remove Text
  1472. @type text
  1473. @default Remove
  1474. */
  1475.  
  1476. /*~struct~category:
  1477. @param align
  1478. @text Category Window Align
  1479. @type select
  1480. @option left
  1481. @option center
  1482. @option right
  1483. @default center
  1484.  
  1485. @param x
  1486. @text Category Window X
  1487. @type text
  1488. @default 0
  1489.  
  1490. @param y
  1491. @text Category Window Y
  1492. @type text
  1493. @default 72
  1494.  
  1495. @param width
  1496. @text Category Window Width
  1497. @type text
  1498. @default Graphics.boxWidth
  1499.  
  1500. @param rows
  1501. @text Category Window Rows
  1502. @type number
  1503. @min 1
  1504. @default 1
  1505.  
  1506. @param cols
  1507. @text Category Window Cols
  1508. @type number
  1509. @min 1
  1510. @default 4
  1511. */
  1512.  
  1513. /*~struct~item:
  1514. @param x
  1515. @text Item Window X
  1516. @type text
  1517. @default 0
  1518.  
  1519. @param y
  1520. @text Item Window Y
  1521. @type text
  1522. @default 144
  1523.  
  1524. @param width
  1525. @text Item Window Width
  1526. @type text
  1527. @default Graphics.boxWidth
  1528.  
  1529. @param height
  1530. @text Item Window Height
  1531. @type text
  1532. @default Graphics.boxHeight - 224
  1533.  
  1534. @param cols
  1535. @text Item Window Cols
  1536. @type number
  1537. @min 1
  1538. @default 2
  1539. */
  1540.  
  1541. /*~struct~info:
  1542. @param x
  1543. @text Info Window X
  1544. @type text
  1545. @default 0
  1546.  
  1547. @param y
  1548. @text Info Window Y
  1549. @type text
  1550. @default Graphics.boxHeight - 80
  1551.  
  1552. @param width
  1553. @text Info Window Width
  1554. @type text
  1555. @default Graphics.boxWidth
  1556. */
  1557.  
  1558. /*~struct~number:
  1559. @param x
  1560. @text Number Window X
  1561. @type text
  1562. @default
  1563.  
  1564. @param y
  1565. @text Number Window Y
  1566. @type text
  1567. @default
  1568.  
  1569. @param width
  1570. @text Number Window Width
  1571. @type text
  1572. @default
  1573.  
  1574. @param height
  1575. @text Number Window Height
  1576. @type text
  1577. @default
  1578.  
  1579. @param okSound
  1580. @text Ok Sound
  1581. @type struct<sound>
  1582. @default
  1583. */
  1584.  
  1585. /*~struct~sound:
  1586. @param name
  1587. @text SE name
  1588. @type file
  1589. @dir audio/se
  1590. @default
  1591.  
  1592. @param volume
  1593. @text SE Volume
  1594. @type number
  1595. @default 90
  1596.  
  1597. @param pitch
  1598. @text SE Pitch
  1599. @type number
  1600. @default 100
  1601.  
  1602. @param pan
  1603. @text SE Pan
  1604. @type number
  1605. @default 0
  1606. */
  1607. //-----------------------------------------------------------------------------



倉庫WAY.rar (14.12 KB, 下载次数: 1)

Lv2.观梦者

梦石
0
星屑
580
在线时间
303 小时
注册时间
2012-4-8
帖子
192
2
发表于 2024-4-26 00:15:21 | 只看该作者
道具数量窗口删除可以试试

  1.   Scene_Storage.prototype.onItemOk = function () {
  2.     this._item = this._itemWindow.item();

  3.     this._itemWindow.deactivate();

  4.     this._numberWindow.setup(this._item, this._itemWindow.mode());

  5.     // this._numberWindow.show();

  6.     // this._numberWindow.activate();

  7.     // 直接选择,默认数量 1
  8.     this.onNumberOk();
  9.   };
复制代码


如果是不用堆叠的话,直接删除道具的数量显示?

  1.   Window_StorageItemList.prototype.drawItem = function(index) {
  2.       var item = this._data[index];
  3.       if (item) {
  4.           var rect = this.itemRect(index);
  5.           rect.width -= this.textPadding();
  6.           this.changePaintOpacity(this.isEnabled(item));
  7.           this.drawItemName(item, rect.x, rect.y, rect.width);
  8.           this.changePaintOpacity(1);
  9.       }
  10.   };
复制代码


显示道具名字文本会怪,因为他自带自适应,自适应就会缩放,如果不适应,就穿出那一行了,rm 好像没有文本切割的方法(懒得做)

点评

不建议缩放,原则上应该从设计开始就避免这种情况,除非特殊需求或者真的要妥协显示  发表于 2024-4-26 21:10
根本原因在于他这个文本缩放的方式只适用于字母文字不适用于方块字,方块字要缩小得保持正方形,而不是单纯变瘦。可以看看这个帖子https://rpg.blue/thread-490916-1-1.html   发表于 2024-4-26 19:05
pokemon 和 digimon 正在路上
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
239
在线时间
30 小时
注册时间
2024-4-10
帖子
43
3
 楼主| 发表于 2024-4-26 01:24:36 | 只看该作者
505681468 发表于 2024-4-26 00:15
道具数量窗口删除可以试试

感謝,幫了大忙,我再試試看
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-7 12:22

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表