查看: 1005|回复: 4

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

[复制链接]
梦石
0
星屑
268
在线时间
33 小时
注册时间
2024-4-10
回帖
33
发表于 2024-4-25 23:24:31 | 显示全部楼层 |阅读模式

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

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

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

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

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

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


感谢各位热心帮忙,谢谢


  1. /* globals WAY, WAYModuleLoader, $gameStorageSystems */
  2. //===========================================================================
  3. // WAY_StorageSystem.js
  4. //===========================================================================

  5. /*:
  6. @plugindesc v2.4.1 This plugin allows you create different storage systems where
  7. the player can store his items. <WAY_StorageSystem>

  8. @param config
  9. @text Storage Systems
  10. @desc Add Storage Systems to your game.
  11. @type struct<storage>[]
  12. @default

  13. @author waynee95

  14. @help
  15. ============================================================================
  16. ■ Usage
  17. ============================================================================

  18. >>> This plugin uses the new MV1.5.0 Plugin Parameter, so I recommend you to
  19. update your editor. Your project can still be lower than MV1.5.0

  20. 储存系统插件,但并不限制玩家背包。

  21. 插件兼容YEP_ItemCore和YEP_X_ItemCategories。


  22. 把这个插件放在列表的底部。

  23. 如何创建存储:
  24. 1. 打开插件管理器
  25. 2. 选择插件
  26. 3. 选项空行
  27. 4. 配置存储系统

  28. 存储系统id从0开始


  29. ============================================================================
  30. ■ 参数概述
  31. ============================================================================
  32. 菜单背景 - 设置图片作为背景

  33. 仓库标题 - 可以使用控制字符\i[x], \c[x].

  34. 信息窗口文本 - %1会替换为当前存储容量


  35. 最大容量 - 仓库最大容量

  36. 物品堆栈大小 - 不为none的话,一组堆栈(例如8个药水)才算一格容量。
  37. 如果最大容量为20,最多可以存放20 x 8个药水。




  38. 显示分类 - 是否显示分类,仅视觉效果,可以全部显示在一个列表里。


  39. 用YEP_X_ItemCategories的话这里必须设置为true。


  40. 允许存放的物品 - 哪些物品可以存入仓库。

  41. 分以下几类:
  42. - items
  43. - weapons
  44. - armors
  45. - keyitems

  46. 如果需要更多类别,可以使用YEP_X_ItemCategories。只需将类别名称添加到允许类型列表中。


  47. 模式 - 只存放还是只取出还是两者皆有,只取出可以作为战利品箱。



  48. 如果你想自定义添加/删除项目按钮的文本,你可以在场景设置/命令窗口设置中这样做。


  49. 音效同理。


  50. ============================================================================
  51. ■ Scene Settings
  52. ============================================================================
  53. 可以更改场景外观,每个场景都是独立的。


  54. 创建窗口的顺序如下:

  55. 帮助窗口 - 字面意思
  56. 标题窗口 - 仓库标题
  57. 命令窗口 - 如果您想添加/删除项目,则可以选择该窗口。
  58. 类别窗口 - 物品分类窗口
  59. 物品窗口 - 根据分类窗口显示对应分类
  60. *            
  61. 信息窗口 - 显示当前/最大容量
  62. 数字窗口 - 添加/删除的物品数量

  63. ============================================================================
  64. ■ Notetags
  65. ============================================================================
  66. 物品,武器,护甲注备栏:

  67. <Cannot Store>
  68. 这物品不能存入仓库。

  69. <Can Store Only In: x>
  70. <Can Store Only In: x, x, x>
  71. 只能存入指定仓库。


  72. ============================================================================
  73. ■ 插件命令
  74. ============================================================================
  75. 主要关键词: StorageSystem

  76. -----------------------
  77. StorageSystem open id
  78. -----------------------
  79. open - 打开仓库
  80. 请记住,id从0开始!

  81. id - 指定你要打开的仓库的ID,没有则打开最后一个打开的。
  82.      

  83. -----------------------
  84. StorageSystem add id item amount
  85. -----------------------
  86. add - 添加物品

  87. id - 仓库ID。

  88. item - 添加物品的ID,用$dataItems[id], $dataWeapons[id], $dataArmors[id].
  89. 例子:StorageSystem add 0 $dataItems[1] 1

  90. amount - 数目

  91. -----------------------
  92. StorageSystem remove id item amount
  93. -----------------------
  94. remove - 移除道具

  95. id - 仓库ID。

  96. item - 同上


  97. amount - 数目

  98. -----------------------
  99. StorageSystem clear id
  100. -----------------------
  101. clear - 清空仓库

  102. id - 仓库ID。

  103. -----------------------
  104. StorageSystem change id number
  105. -----------------------
  106. change - 修改最大容量

  107. id - 仓库ID。

  108. number - 修改的数值

  109. ============================================================================
  110. ■ Scriptcalls
  111. ============================================================================
  112. 全局对象: $gameStorageSystems

  113. $gameStorageSystems.open(id) - 打开仓库,则使用最后打开的id


  114. $gameStorageSystems.storage(id) - 返回给定id的仓库
  115. *                                 

  116. $gameStorageSystems.current() - 返回最后一个打开的仓库

  117. 对存储系统对象的脚本调用如下。
  118. 用$gameStorageSystems.current()或$gameStorageSystems.storage(id)替换。
  119. 例子:$gameStorageSystems.storage(0).title()

  120. storage.title() - 返回标题名称。

  121. storage.capacity() - 返回当前容量。

  122. storage.maxCapacity() - 返回最大容量。

  123. storage.items() - 返回所有存储的物品

  124. storage.weapons() - 归还所有储存的武器。

  125. storage.armors() - 返回所有储存的盔甲。

  126. storage.allItems() - 返回存储的所有内容。

  127. storage.isEmpty() - 返回true或false。

  128. storage.addItem(item, amount) - 向仓库添加物品,用:
  129. $dataItems[id], $dataWeapons[id], $dataArmors[id].

  130. storage.removeItem(item, amount) - 移除,同上


  131. storage.clear() - 清空仓库

  132. storage.changeMaxCapacity(number) - 设置最大容量


  133. ============================================================================
  134. ■ Terms of Use
  135. ============================================================================
  136. This work is licensed under the MIT license.

  137. More info here: https://github.com/waynee95/mv-plugins/blob/master/LICENSE

  138. ============================================================================
  139. ■ Contact Information
  140. ============================================================================
  141. Forum Link: https://forums.rpgmakerweb.com/index.php?members/waynee95.88436/
  142. Website: http://waynee95.me/
  143. Discord Name: waynee95#4261
  144. Ko-fi: https://ko-fi.com/waynee95
  145. */
  146. "use strict";

  147. 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); }

  148. if (typeof WAY === "undefined") {
  149.   console.error("You need to install WAY_Core!"); // eslint-disable-line no-console

  150.   if (Utils.isNwjs() && Utils.isOptionValid("test")) {
  151.     var gui = require("nw.gui"); // eslint-disable-line


  152.     gui.Window.get().showDevTools();
  153.   }

  154.   SceneManager.stop();
  155. } else {
  156.   WAYModuleLoader.registerPlugin("WAY_StorageSystem", "2.4.1", "waynee95", {
  157.     name: "WAY_Core",
  158.     version: ">= 2.0.0"
  159.   });
  160. }

  161. window.$gameStorageSystems = null;

  162. (function ($) {
  163.   var _WAY$Util = WAY.Util,
  164.       getNotetag = _WAY$Util.getNotetag,
  165.       toArray = _WAY$Util.toArray;
  166.   var $dataStorage = $.parameters.config;

  167.   if ($dataStorage === null) {
  168.     console.warn("WAY_StorageSystem\nPlugin Parameters are not setup properly!");

  169.     if (Utils.isNwjs() && Utils.isOptionValid("test")) {
  170.       require("nw.gui").Window.get().showDevTools();
  171.     }
  172.   }

  173.   WAY.EventEmitter.on("load-item-notetags", parseNotetags);
  174.   WAY.EventEmitter.on("load-weapon-notetags", parseNotetags);
  175.   WAY.EventEmitter.on("load-armor-notetags", parseNotetags);

  176.   function parseNotetags(obj) {
  177.     obj.cannotStore = getNotetag(obj.note, "Cannot Store", false);
  178.     obj.onlyInStorage = getNotetag(obj.note, "Can Store Only In", [], toArray);
  179.   } //==========================================================================
  180.   // PluginManager
  181.   //==========================================================================


  182.   PluginManager.addCommand("StorageSystem", {
  183.     open: function open() {
  184.       var storageId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $gameStorageSystems._lastActive;
  185.       $gameStorageSystems.open(storageId);
  186.     },
  187.     add: function add(storageId, item, amount) {
  188.       $gameStorageSystems.storage(storageId).addItem(eval(item), parseInt(amount));
  189.     },
  190.     remove: function remove(storageId, item, amount) {
  191.       $gameStorageSystems.storage(storageId).removeItem(eval(item), parseInt(amount));
  192.     },
  193.     clear: function clear(storageId) {
  194.       $gameStorageSystems.storage(storageId).clear();
  195.     },
  196.     change: function change(storageId, maxCapacity) {
  197.       $gameStorageSystems.storage(storageId).changeMaxCapacity(maxCapacity);
  198.     }
  199.   }); //==========================================================================
  200.   // DataManager
  201.   //==========================================================================

  202.   var _DataManager_createGameObjects = DataManager.createGameObjects;

  203.   DataManager.createGameObjects = function () {
  204.     _DataManager_createGameObjects.call(this);

  205.     $gameStorageSystems = new Game_StorageSystems();
  206.   };

  207.   var _DataManager_makeSaveContents = DataManager.makeSaveContents;

  208.   DataManager.makeSaveContents = function () {
  209.     var contents = _DataManager_makeSaveContents.call(this);

  210.     contents.storageSystems = $gameStorageSystems;
  211.     return contents;
  212.   };

  213.   var _DataManager_extractSaveContents = DataManager.extractSaveContents;

  214.   DataManager.extractSaveContents = function (contents) {
  215.     _DataManager_extractSaveContents.call(this, contents);

  216.     $gameStorageSystems = contents.storageSystems;

  217.     if ($gameStorageSystems === undefined) {
  218.       $gameStorageSystems = new Game_StorageSystems();
  219.     }
  220.   };

  221.   if (Imported.YEP_X_NewGamePlus) {
  222.     var _DataManager_prepareNewGamePlusData = DataManager.prepareNewGamePlusData;

  223.     DataManager.prepareNewGamePlusData = function () {
  224.       _DataManager_prepareNewGamePlusData.call(this);

  225.       this._ngpData.storageSystems = JsonEx.makeDeepCopy($gameStorageSystems);
  226.     };

  227.     var _DataManager_carryOverNewGamePlusData = DataManager.carryOverNewGamePlusData;

  228.     DataManager.carryOverNewGamePlusData = function () {
  229.       _DataManager_carryOverNewGamePlusData.call(this);

  230.       $gameStorageSystems = this._ngpData.storageSystems;
  231.     };
  232.   } // Imported YEP_X_NewGamePlus
  233.   //==========================================================================
  234.   // Game_StorageSystems
  235.   //==========================================================================


  236.   Game_StorageSystems.prototype.initialize = function () {
  237.     this._data = [];
  238.     this._lastActive = 0;
  239.   };

  240.   Game_StorageSystems.prototype.storage = function (storageId) {
  241.     if (_typeof($dataStorage[storageId]) !== "object") {
  242.       return;
  243.     }

  244.     if ($dataStorage[storageId]) {
  245.       if (!this._data[storageId]) {
  246.         this._data[storageId] = new Game_StorageSystem(storageId);
  247.       }

  248.       return this._data[storageId];
  249.     }

  250.     return null;
  251.   };

  252.   Game_StorageSystems.prototype.current = function () {
  253.     return this.storage(this._lastActive);
  254.   };

  255.   Game_StorageSystems.prototype.open = function (storageId) {
  256.     if (typeof storageId !== "undefined") {
  257.       this._lastActive = storageId;
  258.     }

  259.     if (!this.current()) {
  260.       return;
  261.     }

  262.     SceneManager.push(Scene_Storage);
  263.   }; //==========================================================================
  264.   // Game_StorageSystem
  265.   //==========================================================================


  266.   Game_StorageSystem.prototype.initialize = function (storageId) {
  267.     var storage = $dataStorage[storageId];
  268.     this._storageId = parseInt(storageId);
  269.     this._title = storage.titleText;
  270.     this._allowedTypes = storage.allowedTypes;
  271.     this._maxCapacity = storage.maxCapacity;
  272.     this._stackSize = storage.stackSize !== "none" ? parseInt(storage.stackSize) : "none";
  273.     this.clear();
  274.   };

  275.   Game_StorageSystem.prototype.data = function () {
  276.     return $dataStorage[this._storageId];
  277.   };

  278.   Game_StorageSystem.prototype.title = function () {
  279.     return this._title;
  280.   };

  281.   Game_StorageSystem.prototype.allowedTypes = function () {
  282.     return this._allowedTypes;
  283.   };

  284.   Game_StorageSystem.prototype.maxCapacity = function () {
  285.     return this._maxCapacity;
  286.   };

  287.   Game_StorageSystem.prototype.changeMaxCapacity = function (capacity) {
  288.     this._maxCapacity = capacity;
  289.   };

  290.   Game_StorageSystem.prototype.capacity = function () {
  291.     var sum = 0;

  292.     if (this._stackSize === "none") {
  293.       sum = this.allItems().map(function (item) {
  294.         return this.numItems(item);
  295.       }, this).reduce(function (total, current) {
  296.         return total + current;
  297.       }, 0);
  298.     } else {
  299.       sum = this.allItems().length;
  300.     }

  301.     return sum;
  302.   };

  303.   Game_StorageSystem.prototype.capacityRate = function () {
  304.     return this.capacity() / this.maxCapacity();
  305.   };

  306.   Game_StorageSystem.prototype.items = function () {
  307.     return Object.keys(this._items).map(function (id) {
  308.       return $dataItems[id];
  309.     });
  310.   };

  311.   Game_StorageSystem.prototype.weapons = function () {
  312.     return Object.keys(this._weapons).map(function (id) {
  313.       return $dataWeapons[id];
  314.     });
  315.   };

  316.   Game_StorageSystem.prototype.armors = function () {
  317.     return Object.keys(this._armors).map(function (id) {
  318.       return $dataArmors[id];
  319.     });
  320.   };

  321.   Game_StorageSystem.prototype.equipItems = function () {
  322.     return this.weapons().concat(this.armors());
  323.   };

  324.   Game_StorageSystem.prototype.allItems = function () {
  325.     return this.items().concat(this.equipItems());
  326.   };

  327.   Game_StorageSystem.prototype.isEmpty = function () {
  328.     return this.allItems().length === 0;
  329.   };

  330.   Game_StorageSystem.prototype.addItem = function (item, amount) {
  331.     if (!this.canStoreItem(item)) return;
  332.     var container = this.itemContainer(item);

  333.     if (container) {
  334.       var oldNumber = this.numItems(item);

  335.       if (amount > 0) {
  336.         amount = Math.min(amount, this.maxItems(item));
  337.       } else {
  338.         amount = Math.max(amount, -this.numItems(item));
  339.       }

  340.       container[item.id] = oldNumber + amount;

  341.       if (container[item.id] === 0) {
  342.         delete container[item.id];
  343.       }
  344.     }
  345.   };

  346.   Game_StorageSystem.prototype.removeItem = function (item, amount) {
  347.     if (arguments < 2) {
  348.       this.addItem(item, -this.numItems(item));
  349.     } else {
  350.       this.addItem(item, -amount);
  351.     }
  352.   };

  353.   Game_StorageSystem.prototype.clear = function () {
  354.     this._items = {};
  355.     this._weapons = {};
  356.     this._armors = {};
  357.   };

  358.   Game_StorageSystem.prototype.isTypeAllowed = function (type) {
  359.     return type && this._allowedTypes.contains(type.toLowerCase());
  360.   };

  361.   Game_StorageSystem.prototype.canStoreItem = function (item) {
  362.     if (item && item.onlyInStorage.length > 0) {
  363.       return item.onlyInStorage.contains(this._storageId);
  364.     }

  365.     return true;
  366.   };

  367.   Game_StorageSystem.prototype.numItems = function (item) {
  368.     var container = this.itemContainer(item);
  369.     return container ? container[item.id] || 0 : 0;
  370.   };

  371.   Game_StorageSystem.prototype.maxItems = function (item) {
  372.     if (this._stackSize === "none") {
  373.       return this.maxCapacity() - this.capacity();
  374.     }

  375.     return Math.max(parseInt(this._stackSize, 10) - this.numItems(item), 0);
  376.   };

  377.   Game_StorageSystem.prototype.itemContainer = function (item) {
  378.     if (!item) {
  379.       return null;
  380.     } else if (DataManager.isItem(item)) {
  381.       return this._items;
  382.     } else if (DataManager.isWeapon(item)) {
  383.       return this._weapons;
  384.     } else if (DataManager.isArmor(item)) {
  385.       return this._armors;
  386.     }

  387.     return null;
  388.   };

  389.   Game_StorageSystem.prototype.getItemCategory = function (item) {
  390.     if (DataManager.isItem(item) && item.itypeId === 1) {
  391.       return "Items";
  392.     } else if (DataManager.isItem(item) && item.itypeId === 2) {
  393.       return "KeyItems";
  394.     } else if (DataManager.isWeapon(item)) {
  395.       return "Weapons";
  396.     } else if (DataManager.isArmor(item)) {
  397.       return "Armors";
  398.     }

  399.     return false;
  400.   }; //==========================================================================
  401.   // Window_Base
  402.   //==========================================================================


  403.   if (!Window_Base.prototype.textWidthEx) {
  404.     Window_Base.prototype.textWidthEx = function (text) {
  405.       return this.drawTextEx(text, 0, this.contents.height);
  406.     };
  407.   } //==========================================================================
  408.   // Window_StorageTitle
  409.   //==========================================================================


  410.   Window_StorageTitle.prototype = Object.create(Window_Base.prototype);
  411.   Window_StorageTitle.prototype.constructor = Window_StorageTitle;

  412.   Window_StorageTitle.prototype.initialize = function (x, y, w, h) {
  413.     Window_Base.prototype.initialize.call(this, x, y, w, h);
  414.     this._title = $gameStorageSystems.current().title();
  415.     this.refresh();
  416.   };

  417.   Window_StorageTitle.prototype.refresh = function () {
  418.     this.contents.clear();
  419.     var text = this._title;
  420.     var dw = this.contents.width + this.textPadding();
  421.     var tw = this.textWidthEx(text);
  422.     var dx = Math.floor(Math.max(0, dw - tw) / 2);
  423.     this.drawTextEx(text, this.textPadding() + dx, 0);
  424.   }; //==========================================================================
  425.   // Window_StorageCommand
  426.   //==========================================================================


  427.   Window_StorageCommand.prototype = Object.create(Window_HorzCommand.prototype);
  428.   Window_StorageCommand.prototype.constructor = Window_StorageCommand;

  429.   Window_StorageCommand.prototype.initialize = function (x, y) {
  430.     this.setup();
  431.     Window_HorzCommand.prototype.initialize.call(this, x, y);
  432.     this.select(0);
  433.   };

  434.   Window_StorageCommand.prototype.setup = function () {
  435.     var data = $gameStorageSystems.current().data();
  436.     this._storageMode = data.storageMode;
  437.     data = data.command;
  438.     this._align = data.align;
  439.     this._rows = data.rows;
  440.     this._cols = data.cols;
  441.     this._width = eval(data.width);
  442.     this._addText = data.addText;
  443.     this._removeText = data.removeText;
  444.   };

  445.   Window_StorageCommand.prototype.itemAlign = function () {
  446.     return this._align;
  447.   };

  448.   Window_StorageCommand.prototype.windowWidth = function () {
  449.     return this._width;
  450.   };

  451.   Window_StorageCommand.prototype.numVisibleRows = function () {
  452.     return this._rows;
  453.   };

  454.   Window_StorageCommand.prototype.maxCols = function () {
  455.     return this._cols;
  456.   };

  457.   Window_StorageCommand.prototype.makeCommandList = function () {
  458.     if (this._storageMode === "Remove") {
  459.       this.addCommand(this._removeText, "remove");
  460.     } else if (this._storageMode === "Add") {
  461.       this.addCommand(this._addText, "add");
  462.     } else {
  463.       this.addCommand(this._addText, "add");
  464.       this.addCommand(this._removeText, "remove");
  465.     }
  466.   };

  467.   Window_StorageCommand.prototype.lastOption = function () {
  468.     return this._index;
  469.   }; //==========================================================================
  470.   // Window_StorageCategory
  471.   //==========================================================================


  472.   Window_StorageCategory.prototype = Object.create(Window_HorzCommand.prototype);
  473.   Window_StorageCategory.prototype.constructor = Window_StorageCategory;

  474.   Window_StorageCategory.prototype.initialize = function (x, y) {
  475.     this.setup();
  476.     Window_HorzCommand.prototype.initialize.call(this, x, y);
  477.   };

  478.   Window_StorageCategory.prototype.setup = function () {
  479.     var data = $gameStorageSystems.current().data().category;
  480.     this._align = data.align;
  481.     this._rows = data.rows;
  482.     this._cols = data.cols;
  483.     this._width = eval(data.width);
  484.   };

  485.   Window_StorageCategory.prototype.itemAlign = function () {
  486.     return this._align;
  487.   };

  488.   Window_StorageCategory.prototype.windowWidth = function () {
  489.     return this._width;
  490.   };

  491.   Window_StorageCategory.prototype.numVisibleRows = function () {
  492.     return this._rows;
  493.   };

  494.   Window_StorageCategory.prototype.maxCols = function () {
  495.     return this._cols;
  496.   };

  497.   if (!Imported.YEP_X_ItemCategories) {
  498.     Window_StorageCategory.prototype.makeCommandList = function () {
  499.       var data = $gameStorageSystems.current().allowedTypes();
  500.       var length = data.length;

  501.       for (var i = 0; i < length; i++) {
  502.         var category = data[i].trim();
  503.         this.addItemCategory(category);
  504.       }
  505.     };

  506.     Window_StorageCategory.prototype.addItemCategory = function (category) {
  507.       if (category.match(/KeyItems/i)) {
  508.         return this.addCommand(TextManager.keyItem, "keyItem");
  509.       } else if (category.match(/Items/i)) {
  510.         return this.addCommand(TextManager.item, "item");
  511.       } else if (category.match(/Weapons/i)) {
  512.         return this.addCommand(TextManager.weapon, "weapon");
  513.       } else if (category.match(/Armors/i)) {
  514.         return this.addCommand(TextManager.armor, "armor");
  515.       }
  516.     };
  517.   } else {
  518.     // Imported.YEP_X_ItemCategories
  519.     Window_StorageCategory.prototype.makeCommandList = function () {
  520.       var data = $gameStorageSystems.current().allowedTypes();
  521.       var length = data.length;

  522.       for (var i = 0; i < length; i++) {
  523.         var category = data[i].trim();
  524.         Window_ItemCategory.prototype.addItemCategory.call(this, category);
  525.       }
  526.     };
  527.   } // Imported.YEP_X_ItemCategories


  528.   Window_StorageCategory.prototype.update = function () {
  529.     Window_HorzCommand.prototype.update.call(this);

  530.     if (this.visible) {
  531.       this._itemWindow.setCategory(this.currentSymbol());

  532.       this._itemWindow.setExt(this.currentExt());
  533.     }
  534.   };

  535.   Window_StorageCategory.prototype.setItemWindow = function (itemWindow) {
  536.     this._itemWindow = itemWindow;
  537.     this.update();
  538.   }; //==========================================================================
  539.   // Window_StorageItemList
  540.   //==========================================================================


  541.   Window_StorageItemList.prototype = Object.create(Window_ItemList.prototype);
  542.   Window_StorageItemList.prototype.constructor = Window_StorageItemList;

  543.   Window_StorageItemList.prototype.initialize = function (x, y, w, h) {
  544.     this.setup();
  545.     Window_ItemList.prototype.initialize.call(this, x, y, w, h);
  546.     this._mode = "none";
  547.     this._storage = $gameStorageSystems.current();
  548.   };

  549.   Window_StorageItemList.prototype.setup = function () {
  550.     var data = $gameStorageSystems.current().data().item;
  551.     this._cols = data.cols;
  552.   };

  553.   Window_StorageItemList.prototype.maxCols = function () {
  554.     return this._cols;
  555.   };

  556.   Window_StorageItemList.prototype.setExt = function (ext) {
  557.     if (this._ext !== ext) {
  558.       this._ext = ext;
  559.       this.refresh();
  560.       this.resetScroll();
  561.     }
  562.   };

  563.   Window_StorageItemList.prototype.setMode = function (mode) {
  564.     if (this._mode !== mode) {
  565.       this._mode = mode;
  566.       this.refresh();
  567.       this.resetScroll();
  568.     }
  569.   };

  570.   Window_StorageItemList.prototype.refresh = function () {
  571.     Window_ItemList.prototype.refresh.call(this);

  572.     if (this._helpWindow) {
  573.       this._helpWindow.setItem(this.item());

  574.       this._helpWindow.refresh();
  575.     }
  576.   };

  577.   Window_StorageItemList.prototype.mode = function () {
  578.     return this._mode;
  579.   };

  580.   if (!Imported.YEP_X_ItemCategories) {
  581.     Window_StorageItemList.prototype.includes = function (item) {
  582.       if (!this._storage.canStoreItem(item)) {
  583.         return false;
  584.       }

  585.       switch (this._category) {
  586.         case "item":
  587.           return DataManager.isItem(item) && item.itypeId === 1;

  588.         case "weapon":
  589.           return DataManager.isWeapon(item);

  590.         case "armor":
  591.           return DataManager.isArmor(item);

  592.         case "keyItem":
  593.           return DataManager.isItem(item) && item.itypeId === 2;

  594.         case "AllItems":
  595.           return this._storage.isTypeAllowed(this._storage.getItemCategory(item));

  596.         default:
  597.           return false;
  598.       }
  599.     };
  600.   } else {
  601.     // Imported.YEP_X_ItemCategories
  602.     Window_StorageItemList.prototype.includes = function (item) {
  603.       if (!item) return false;

  604.       if (!this._storage.canStoreItem(item)) {
  605.         return false;
  606.       }

  607.       if (this._category === "AllItems") return true;
  608.       return Window_ItemList.prototype.includes.call(this, item);
  609.     };
  610.   } // Imported.YEP_X_ItemCategories


  611.   Window_StorageItemList.prototype.makeItemList = function () {
  612.     if (this._mode === "add") {
  613.       this._data = $gameParty.allItems().filter(function (item) {
  614.         return this.includes(item);
  615.       }, this);
  616.     } else if (this._mode === "remove") {
  617.       this._data = this._storage.allItems().filter(function (item) {
  618.         return this.includes(item);
  619.       }, this);
  620.     }

  621.     if (this.includes(null)) {
  622.       this._data.push(null);
  623.     }
  624.   };

  625.   Window_StorageItemList.prototype.drawItemNumber = function (item, x, y, width) {
  626.     this.drawText("x", x, y, width - this.textWidth("00"), "right");
  627.     var itemNum = this._mode === "add" ? $gameParty.numItems(item) : this._storage.numItems(item);
  628.     this.drawText(itemNum, x, y, width, "right");
  629.   };

  630.   Window_StorageItemList.prototype.isEnabled = function (item) {
  631.     if (!item) {
  632.       return false;
  633.     }

  634.     if (item.cannotStore) {
  635.       return false;
  636.     }

  637.     if (this._mode === "add") {
  638.       if (this._storage.numItems(item) > 0) {
  639.         return this._storage.maxItems(item) > 0;
  640.       }

  641.       return this._storage.capacity() < this._storage.maxCapacity();
  642.     } else {
  643.       return $gameParty.maxItems(item) - $gameParty.numItems(item) > 0;
  644.     }
  645.   }; //==========================================================================
  646.   // Window_StorageInfo
  647.   //==========================================================================


  648.   Window_StorageInfo.prototype = Object.create(Window_Base.prototype);
  649.   Window_StorageInfo.prototype.constructor = Window_StorageInfo;

  650.   Window_StorageInfo.prototype.initialize = function (x, y, w, h) {
  651.     Window_Base.prototype.initialize.call(this, x, y, w, h);
  652.     this._storage = $gameStorageSystems.current();
  653.     this._text = this._storage.data().infoText;
  654.     this.refresh();
  655.   };

  656.   Window_StorageInfo.prototype.text = function () {
  657.     return this._text.replace("%1", this._storage.capacity() + "/" + this._storage.maxCapacity());
  658.   };

  659.   Window_StorageInfo.prototype.refresh = function () {
  660.     this.contents.clear();
  661.     this.drawTextEx(this.text(), this.textPadding(), 0);
  662.   }; //==========================================================================
  663.   // Window_StorageNumber
  664.   //==========================================================================


  665.   Window_StorageNumber.prototype = Object.create(Window_ShopNumber.prototype);
  666.   Window_StorageNumber.prototype.constructor = Window_StorageNumber;

  667.   Window_StorageNumber.prototype.initialize = function (x, y, w, h) {
  668.     Window_Selectable.prototype.initialize.call(this, x, y, w, h);
  669.     this._storage = $gameStorageSystems.current();
  670.     this._item = null;
  671.     this._max = 1;
  672.     this._number = 1;
  673.     this.createButtons();
  674.   };

  675.   Window_StorageNumber.prototype.setup = function (item, mode) {
  676.     this._item = item;
  677.     this._number = 1;

  678.     if (mode === "add") {
  679.       this._max = $gameParty.numItems(item);

  680.       if (this._max > this._storage.maxItems(item)) {
  681.         this._max = this._storage.maxItems(item);
  682.       }
  683.     } else {
  684.       this._max = this._storage.numItems(item);

  685.       if (this._max > $gameParty.maxItems(item)) {
  686.         this._max = $gameParty.maxItems(item);
  687.       }
  688.     }

  689.     if (this._max < 0) {
  690.       this._max = 0;
  691.     }

  692.     this.placeButtons();
  693.     this.updateButtonsVisiblity();
  694.     this.refresh();
  695.   };

  696.   Window_StorageNumber.prototype.refresh = function () {
  697.     this.contents.clear();
  698.     this.drawItemName(this._item, 0, this.itemY());
  699.     this.drawNumber();
  700.     this.drawMax();
  701.   };

  702.   Window_StorageNumber.prototype.drawNumber = function () {
  703.     var x = this.cursorX();
  704.     var y = this.itemY();
  705.     var width = this.cursorWidth() - this.textPadding();
  706.     this.resetTextColor();
  707.     this.drawText(this._number, x, y, width, "right");
  708.   };

  709.   Window_StorageNumber.prototype.drawMax = function () {
  710.     var width = this.contentsWidth() - this.textPadding();
  711.     this.resetTextColor();
  712.     this.drawText(this._max, 0, this.priceY(), width, "right");
  713.   }; //==========================================================================
  714.   // Scene_Storage
  715.   //==========================================================================


  716.   Scene_Storage.prototype = Object.create(Scene_MenuBase.prototype);
  717.   Scene_Storage.prototype.constructor = Scene_Storage;

  718.   Scene_Storage.prototype.initialize = function () {
  719.     this.setup();
  720.     Scene_MenuBase.prototype.initialize.call(this);
  721.     this._storage = $gameStorageSystems.current();
  722.   };

  723.   Scene_Storage.prototype.setup = function () {
  724.     var data = $gameStorageSystems.current().data();
  725.     this._background = data.background;
  726.     this._blurredBackground = data.blurredBackground;
  727.     this._displayCategories = data.displayCategories;
  728.     this._helpData = data.help;
  729.     this._titleData = data.title;
  730.     this._commandData = data.command;
  731.     this._categoryData = data.category;
  732.     this._infoData = data.info;
  733.     this._itemData = data.item;
  734.     this._numberData = data.number;
  735.   };

  736.   Scene_Storage.prototype.createBackground = function () {
  737.     if (this._blurredBackground) {
  738.       this._backgroundSprite = new Sprite();
  739.       this._backgroundSprite.bitmap = SceneManager.backgroundBitmap();
  740.       this.addChild(this._backgroundSprite);
  741.     } else if (this._background !== "") {
  742.       this._backgroundSprite = new Sprite();
  743.       this._backgroundSprite.bitmap = ImageManager.loadPicture(this._background);
  744.       this.addChild(this._backgroundSprite);
  745.     }
  746.   };

  747.   Scene_Storage.prototype.create = function () {
  748.     Scene_MenuBase.prototype.create.call(this);
  749.     this.createHelpWindow();
  750.     this.createTitleWindow();
  751.     this.createCommandWindow();

  752.     if (this._displayCategories) {
  753.       this.createCategoryWindow();
  754.     }

  755.     this.createInfoWindow();
  756.     this.createItemWindow();
  757.     this.createNumberWindow();
  758.   };

  759.   Scene_Storage.prototype.createHelpWindow = function () {
  760.     this._helpWindow = new Window_Help();
  761.     this.addWindow(this._helpWindow);
  762.     this._helpWindow.x = eval(this._helpData.x);
  763.     this._helpWindow.y = eval(this._helpData.y);
  764.     this._helpWindow.width = eval(this._helpData.width);
  765.     this._helpWindow.height = eval(this._helpData.height);
  766.   };

  767.   Scene_Storage.prototype.createTitleWindow = function () {
  768.     var wx = eval(this._titleData.x);
  769.     var wy = eval(this._titleData.y);
  770.     var ww = eval(this._titleData.width);
  771.     var wh = eval(this._titleData.height);
  772.     this._titleWindow = new Window_StorageTitle(wx, wy, ww, wh);
  773.     this.addWindow(this._titleWindow);
  774.   };

  775.   Scene_Storage.prototype.createCommandWindow = function () {
  776.     var wx = eval(this._commandData.x);
  777.     var wy = eval(this._commandData.y);
  778.     this._commandWindow = new Window_StorageCommand(wx, wy);

  779.     if (this._displayCategories) {
  780.       this._commandWindow.setHandler("add", this.onCommandOk.bind(this));

  781.       this._commandWindow.setHandler("remove", this.onCommandOk.bind(this));
  782.     } else {
  783.       this._commandWindow.setHandler("add", this.onCategoryOk.bind(this));

  784.       this._commandWindow.setHandler("remove", this.onCategoryOk.bind(this));
  785.     }

  786.     this._commandWindow.setHandler("cancel", this.onCommandCancel.bind(this));

  787.     this.addWindow(this._commandWindow);
  788.   };

  789.   Scene_Storage.prototype.createCategoryWindow = function () {
  790.     var wx = eval(this._categoryData.x);
  791.     var wy = eval(this._categoryData.y);
  792.     this._categoryWindow = new Window_StorageCategory(wx, wy);

  793.     this._categoryWindow.setHandler("ok", this.onCategoryOk.bind(this));

  794.     this._categoryWindow.setHandler("cancel", this.onCategoryCancel.bind(this));

  795.     this._categoryWindow.deactivate();

  796.     this._categoryWindow.hide();

  797.     this.addWindow(this._categoryWindow);
  798.   };

  799.   Scene_Storage.prototype.createInfoWindow = function () {
  800.     var wx = eval(this._infoData.x);
  801.     var wy = eval(this._infoData.y);
  802.     var ww = eval(this._infoData.width);
  803.     this._infoWindow = new Window_StorageInfo(wx, wy, ww, 80);
  804.     this.addWindow(this._infoWindow);
  805.   };

  806.   Scene_Storage.prototype.createItemWindow = function () {
  807.     var wx = eval(this._itemData.x);
  808.     var wy = eval(this._itemData.y);
  809.     var ww = eval(this._itemData.width);
  810.     var wh = eval(this._itemData.height);
  811.     this._itemWindow = new Window_StorageItemList(wx, wy, ww, wh);

  812.     this._itemWindow.setHelpWindow(this._helpWindow);

  813.     if (this._displayCategories) {
  814.       this._categoryWindow.setItemWindow(this._itemWindow);
  815.     }

  816.     this._itemWindow.setHandler("ok", this.onItemOk.bind(this));

  817.     this._itemWindow.setHandler("cancel", this.onItemCancel.bind(this));

  818.     this.addWindow(this._itemWindow);
  819.     this.showWholeStorage();
  820.   };

  821.   Scene_Storage.prototype.showWholeStorage = function () {
  822.     this._itemWindow.setMode("remove");

  823.     this._itemWindow.setCategory("AllItems");

  824.     this._itemWindow.refresh();
  825.   };

  826.   Scene_Storage.prototype.createNumberWindow = function () {
  827.     var wx = eval(this._numberData.x);
  828.     var wy = eval(this._numberData.y);
  829.     var ww = eval(this._numberData.width);
  830.     var wh = eval(this._numberData.height);
  831.     this._numberWindow = new Window_StorageNumber(wx, wy, ww, wh);

  832.     this._numberWindow.setHandler("ok", this.onNumberOk.bind(this));

  833.     this._numberWindow.setHandler("cancel", this.onNumberCancel.bind(this));

  834.     this._numberWindow.hide();

  835.     this.addWindow(this._numberWindow);
  836.   };

  837.   Scene_Storage.prototype.activateItemWindow = function () {
  838.     this._infoWindow.refresh();

  839.     this._itemWindow.refresh();

  840.     this._itemWindow.activate();
  841.   };

  842.   Scene_Storage.prototype.item = function () {
  843.     return this._itemWindow.item();
  844.   };

  845.   Scene_Storage.prototype.onCommandCancel = function () {
  846.     SceneManager.pop();
  847.   };

  848.   Scene_Storage.prototype.onCommandOk = function () {
  849.     this._itemWindow.setMode(this._commandWindow.currentSymbol());

  850.     this._commandWindow.deactivate();

  851.     this._commandWindow.hide();

  852.     this._categoryWindow.activate();

  853.     this._categoryWindow.select(0);

  854.     this._categoryWindow.show();
  855.   };

  856.   Scene_Storage.prototype.onCategoryOk = function () {
  857.     this._itemWindow.activate();

  858.     this._itemWindow.selectLast();

  859.     if (!this._displayCategories) {
  860.       this._itemWindow.setMode(this._commandWindow.currentSymbol());

  861.       this._itemWindow.setCategory("AllItems");

  862.       this._itemWindow.refresh();
  863.     }
  864.   };

  865.   Scene_Storage.prototype.onCategoryCancel = function () {
  866.     this._categoryWindow.deselect();

  867.     this._categoryWindow.deactivate();

  868.     this._categoryWindow.hide();

  869.     this._commandWindow.show();

  870.     this._commandWindow.activate();

  871.     this.showWholeStorage();
  872.   };

  873.   Scene_Storage.prototype.onItemOk = function () {
  874.     this._item = this._itemWindow.item();

  875.     this._itemWindow.deactivate();

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

  877.     this._numberWindow.show();

  878.     this._numberWindow.activate();
  879.   };

  880.   Scene_Storage.prototype.storeItem = function (amount) {
  881.     this._storage.addItem(this.item(), amount);

  882.     $gameParty.loseItem(this.item(), amount);
  883.   };

  884.   Scene_Storage.prototype.depositItem = function (amount) {
  885.     this._storage.removeItem(this.item(), amount);

  886.     $gameParty.gainItem(this.item(), amount);
  887.   };

  888.   Scene_Storage.prototype.onItemCancel = function () {
  889.     this._itemWindow.deselect();

  890.     this._helpWindow.clear();

  891.     if (this._displayCategories) {
  892.       this._categoryWindow.activate();
  893.     } else {
  894.       this._itemWindow.setCategory("none");

  895.       this._commandWindow.activate();

  896.       this.showWholeStorage();
  897.     }
  898.   };

  899.   Scene_Storage.prototype.onNumberOk = function () {
  900.     var okSound = this._numberData.okSound;

  901.     if (okSound && okSound.name) {
  902.       AudioManager.playSe(okSound);
  903.     } else {
  904.       SoundManager.playShop();
  905.     }

  906.     var mode = this._itemWindow.mode();

  907.     if (mode === "add") {
  908.       this.storeItem(this._numberWindow.number());
  909.     } else if (mode === "remove") {
  910.       this.depositItem(this._numberWindow.number());
  911.     }

  912.     this.endNumberInput();
  913.   };

  914.   Scene_Storage.prototype.endNumberInput = function () {
  915.     this._numberWindow.hide();

  916.     this._itemWindow.refresh();

  917.     this._infoWindow.refresh();

  918.     this._itemWindow.activate();
  919.   };

  920.   Scene_Storage.prototype.onNumberCancel = function () {
  921.     SoundManager.playCancel();
  922.     this.endNumberInput();
  923.   };
  924. })(WAYModuleLoader.getModule("WAY_StorageSystem")); //-----------------------------------------------------------------------------


  925. function Window_StorageTitle() {
  926.   this.initialize.apply(this, arguments);
  927. }

  928. function Window_StorageCommand() {
  929.   this.initialize.apply(this, arguments);
  930. }

  931. function Window_StorageCategory() {
  932.   this.initialize.apply(this, arguments);
  933. }

  934. function Window_StorageItemList() {
  935.   this.initialize.apply(this, arguments);
  936. }

  937. function Window_StorageInfo() {
  938.   this.initialize.apply(this, arguments);
  939. }

  940. function Window_StorageNumber() {
  941.   this.initialize.apply(this, arguments);
  942. }

  943. function Scene_Storage() {
  944.   this.initialize.apply(this, arguments);
  945. }

  946. function Game_StorageSystems() {
  947.   this.initialize.apply(this, arguments);
  948. }

  949. function Game_StorageSystem() {
  950.   this.initialize.apply(this, arguments);
  951. } //-----------------------------------------------------------------------------

  952. /*~struct~storage:
  953. @param blurredBackground
  954. @text 使用模糊透明背景
  955. @type boolean
  956. @default false

  957. @param background
  958. @text 菜单背景
  959. @type file
  960. @dir img/pictures
  961. @default

  962. @param titleText
  963. @text 存储标题
  964. @type text
  965. @default \i[210]STORAGE SYSTEM

  966. @param infoText
  967. @text 信息窗口文本
  968. @type text
  969. @default Capacity: %1\i[208]

  970. @param maxCapacity
  971. @text 最大容量
  972. @type number
  973. @min 1
  974. @max 9999
  975. @default 20

  976. @param stackSize
  977. @text 堆栈大小
  978. @type combo
  979. @option none
  980. @option 8
  981. @option 16
  982. @option 32
  983. @option 64
  984. @default none

  985. @param displayCategories
  986. @text 显示类别
  987. @type boolean
  988. @default true

  989. @param allowedTypes
  990. @text 允许物品类型
  991. @type text[]
  992. @default ["items","armors","weapons","keyitems"]

  993. @param storageMode
  994. @text 存储模式
  995. @type combo
  996. @option "Add/Remove"
  997. @option "Add"
  998. @option "Remove"
  999. @default "Add/Remove"

  1000. @param Scene Settings
  1001. @default Customize window parameters.

  1002. @param help
  1003. @text 帮助窗口设置
  1004. @type struct<help>
  1005. @default {"x":"0","y":"Graphics.boxHeight - this._helpWindow.height - 80","width":"Graphics.boxWidth","height":"108"}
  1006. @parent Scene Settings

  1007. @param title
  1008. @text 标题窗口设置
  1009. @type struct<title>
  1010. @default {"x":"0","y":"0","width":"Graphics.boxWidth","height":"72"}
  1011. @parent Scene Settings

  1012. @param command
  1013. @text 命令窗口设置
  1014. @type struct<command>
  1015. @default {"align":"center","x":"0","y":"72","width":"Graphics.boxWidth","rows":"1","cols":"2","addText":"Add","removeText":"Remove"}
  1016. @parent Scene Settings

  1017. @param category
  1018. @text 类别窗口设置
  1019. @type struct<category>
  1020. @default {"align":"center","x":"0","y":"72","width":"Graphics.boxWidth","rows":"1","cols":"4"}
  1021. @parent Scene Settings

  1022. @param item
  1023. @text 道具窗口设置
  1024. @type struct<item>
  1025. @default {"x":"0","y":"144","width":"Graphics.boxWidth","height":"Graphics.boxHeight - 224 - this._helpWindow.height","cols":"2"}
  1026. @parent Scene Settings

  1027. @param info
  1028. @text 信息窗口设置
  1029. @type struct<info>
  1030. @default {"x":"0","y":"Graphics.boxHeight - 80","width":"Graphics.boxWidth"}
  1031. @parent Scene Settings

  1032. @param number
  1033. @text 数字窗口设置
  1034. @type struct<number>
  1035. @default {"x":"Graphics.boxWidth / 2 - 250","y":"168","width":"500","height":"450"}
  1036. @parent Scene Settings
  1037. */

  1038. /*~struct~help:
  1039. @param x
  1040. @text Help Window X
  1041. @type text
  1042. @default 0

  1043. @param y
  1044. @text Help Window Y
  1045. @type text
  1046. @default Graphics.boxHeight - this._helpWindow.height - 80

  1047. @param width
  1048. @text Help Window Width
  1049. @type text
  1050. @default Graphics.boxWidth

  1051. @param height
  1052. @text Help Window Height
  1053. @type text
  1054. @default 108
  1055. */

  1056. /*~struct~title:
  1057. @param x
  1058. @text Title Window X
  1059. @type text
  1060. @default 0

  1061. @param y
  1062. @text Title Window Y
  1063. @type text
  1064. @default 0

  1065. @param width
  1066. @text Title Window Width
  1067. @type text
  1068. @default Graphics.boxWidth

  1069. @param height
  1070. @text Title Window Height
  1071. @type text
  1072. @default 72
  1073. */

  1074. /*~struct~command:
  1075. @param align
  1076. @text Command Window Align
  1077. @type select
  1078. @option left
  1079. @option center
  1080. @option right
  1081. @default center

  1082. @param x
  1083. @text Command Window X
  1084. @type text
  1085. @default 0

  1086. @param y
  1087. @text Command Window Y
  1088. @type text
  1089. @default 72

  1090. @param width
  1091. @text Command Window Width
  1092. @type text
  1093. @default Graphics.boxWidth

  1094. @param rows
  1095. @text Command Window Rows
  1096. @type number
  1097. @min 1
  1098. @default 1

  1099. @param cols
  1100. @text Command Window Cols
  1101. @type number
  1102. @min 1
  1103. @default 2

  1104. @param addText
  1105. @text Add Text
  1106. @type text
  1107. @default Add

  1108. @param removeText
  1109. @text Remove Text
  1110. @type text
  1111. @default Remove
  1112. */

  1113. /*~struct~category:
  1114. @param align
  1115. @text Category Window Align
  1116. @type select
  1117. @option left
  1118. @option center
  1119. @option right
  1120. @default center

  1121. @param x
  1122. @text Category Window X
  1123. @type text
  1124. @default 0

  1125. @param y
  1126. @text Category Window Y
  1127. @type text
  1128. @default 72

  1129. @param width
  1130. @text Category Window Width
  1131. @type text
  1132. @default Graphics.boxWidth

  1133. @param rows
  1134. @text Category Window Rows
  1135. @type number
  1136. @min 1
  1137. @default 1

  1138. @param cols
  1139. @text Category Window Cols
  1140. @type number
  1141. @min 1
  1142. @default 4
  1143. */

  1144. /*~struct~item:
  1145. @param x
  1146. @text Item Window X
  1147. @type text
  1148. @default 0

  1149. @param y
  1150. @text Item Window Y
  1151. @type text
  1152. @default 144

  1153. @param width
  1154. @text Item Window Width
  1155. @type text
  1156. @default Graphics.boxWidth

  1157. @param height
  1158. @text Item Window Height
  1159. @type text
  1160. @default Graphics.boxHeight - 224

  1161. @param cols
  1162. @text Item Window Cols
  1163. @type number
  1164. @min 1
  1165. @default 2
  1166. */

  1167. /*~struct~info:
  1168. @param x
  1169. @text Info Window X
  1170. @type text
  1171. @default 0

  1172. @param y
  1173. @text Info Window Y
  1174. @type text
  1175. @default Graphics.boxHeight - 80

  1176. @param width
  1177. @text Info Window Width
  1178. @type text
  1179. @default Graphics.boxWidth
  1180. */

  1181. /*~struct~number:
  1182. @param x
  1183. @text Number Window X
  1184. @type text
  1185. @default

  1186. @param y
  1187. @text Number Window Y
  1188. @type text
  1189. @default

  1190. @param width
  1191. @text Number Window Width
  1192. @type text
  1193. @default

  1194. @param height
  1195. @text Number Window Height
  1196. @type text
  1197. @default

  1198. @param okSound
  1199. @text Ok Sound
  1200. @type struct<sound>
  1201. @default
  1202. */

  1203. /*~struct~sound:
  1204. @param name
  1205. @text SE name
  1206. @type file
  1207. @dir audio/se
  1208. @default

  1209. @param volume
  1210. @text SE Volume
  1211. @type number
  1212. @default 90

  1213. @param pitch
  1214. @text SE Pitch
  1215. @type number
  1216. @default 100

  1217. @param pan
  1218. @text SE Pan
  1219. @type number
  1220. @default 0
  1221. */
  1222. //-----------------------------------------------------------------------------
复制代码



倉庫WAY.rar (14.12 KB, 下载次数: 3)
梦石
0
星屑
1333
在线时间
471 小时
注册时间
2012-4-8
回帖
314
发表于 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 正在路上
回复

使用道具 举报

梦石
0
星屑
268
在线时间
33 小时
注册时间
2024-4-10
回帖
33
 楼主| 发表于 2024-4-26 01:24:36 | 显示全部楼层
505681468 发表于 2024-4-26 00:15
道具数量窗口删除可以试试

感謝,幫了大忙,我再試試看
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部