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

Project1

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

[已经解决] 請問人物倉庫的製作方法

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
22 小时
注册时间
2016-3-20
帖子
7
跳转到指定楼层
1
发表于 2016-3-20 23:23:18 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
請問人物倉庫的製作方法
腳本嗎?

Lv1.梦旅人

梦石
0
星屑
65
在线时间
385 小时
注册时间
2007-7-27
帖子
4106

开拓者

2
发表于 2016-3-21 02:27:18 | 只看该作者
When in doubt, YEP(不)
但是很多基本功能YEP都做了,如果有需要可以先在yep里面找一下
比如这个
http://yanfly.moe/2015/11/20/yep-29-party-system/

评分

参与人数 1星屑 +166 收起 理由
余烬之中 + 166 认可答案

查看全部评分

吸吸
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
497
在线时间
266 小时
注册时间
2015-12-8
帖子
873
3
发表于 2016-3-22 13:16:45 | 只看该作者
trentswd 发表于 2016-3-21 02:27
When in doubt, YEP(不)
但是很多基本功能YEP都做了,如果有需要可以先在yep里面找一下
比如这个

話說有沒有道具倉庫阿{:2_276:}
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
642
在线时间
165 小时
注册时间
2012-4-18
帖子
264
4
发表于 2016-3-23 09:40:58 | 只看该作者
小叮鈴 发表于 2016-3-22 13:16
話說有沒有道具倉庫阿

我有一个道具仓库脚本,不过和YEP_ItemCore插件冲突了。不知道如果不开独立道具会不会还是冲突的,我测试的时候发现确实可以存取,但是当时开着YEP_ItemCore的独立道具(所有装备自成一格,不堆叠),然后就发生了恶性事件,装备存了就被老板黑吃了,占去仓库空间,但是看不见也取不出来= =,给你看看吧。
  1. /*:
  2. PH - Warehouse/Storage
  3. @plugindesc This plugin allows the creation of warehouses where you can store items in the game.
  4. @author PrimeHover
  5. @version 1.0.0
  6. @date 11/14/2015
  7. ---------------------------------------------------------------------------------------
  8. This work is licensed under the Creative Commons Attribution 4.0 International License.
  9. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/
  10. ---------------------------------------------------------------------------------------
  11. @param ---Vocabulary---
  12. @desc Use the spaces below to personalize the vocabulary of the plugin
  13. @default
  14. @param Withdraw Text
  15. @desc Text shown in option "Withdraw"
  16. @default Withdraw
  17. @param Deposit Text
  18. @desc Text shown in option "Deposit"
  19. @default Deposit
  20. @param Available Space Text
  21. @desc Text shown in the information window
  22. @default Available Space:
  23. @help
  24. Plugin Commands:
  25. - PHWarehouse create <Title of the Warehouse:50>               # Creates a warehouse with 50 spaces if it does not exist
  26. - PHWarehouse show <Title of the Warehouse>                    # Shows a warehouse
  27. - PHWarehouse remove <Title of the Warehouse>                  # Removes a warehouse
  28. The first command creates and opens a warehouse with the given title.
  29. If it already exists, the command will be ignored.
  30. Substitute "50" for the maximum number of spaces that the warehouse will have.
  31. If you leave the number in blank, the default size will be 50.
  32. Sizes cannot be changed.
  33. The second command opens the warehouse in the screen.
  34. The third command deletes an existent warehouse.
  35. Any remaining item in that specific warehouse will be removed as well.
  36. ========================================
  37. Script Calls: Use the commands below as a script command in a variable or conditional statement.
  38. - PHWarehouse.getMaxCapacity("Title of the Warehouse");        # Gets the maximum capacity of a warehouse (returns a number)
  39. - PHWarehouse.getCurrentCapacity("Title of the Warehouse");    # Gets the current capacity of a warehouse (returns a number)
  40. - PHWarehouse.exist("Title of the Warehouse");                 # Checks if a warehouse exists (returns true or false)
  41. */
  42. /* Global variable for management of the warehouses */
  43. var PHWarehouse;
  44. (function() {
  45.     /* Getting the parameters */
  46.     var parameters = PluginManager.parameters('PH_Warehouse');
  47.     var withdrawText = String(parameters['Withdraw Text']);
  48.     var depositText = String(parameters['Deposit Text']);
  49.     var availableSpaceText = String(parameters['Available Space Text']);
  50.     /* ---------------------------------------------------------- *
  51.      *                      WAREHOUSE MANAGER                     *
  52.      * ---------------------------------------------------------- */
  53.     function PHWarehouseManager() {
  54.         this._warehouses = {};
  55.         this._lastActive = "";
  56.         this._lastOption = 0; // 0 = Withdraw, 1 = Deposit
  57.         this._lastCategory = "item";
  58.     }
  59.     /* Creates a warehouse if it does not exist */
  60.     PHWarehouseManager.prototype.createWarehouse = function(_sentence) {
  61.         var matches = this.checkSentence(_sentence);
  62.         var results;
  63.         var title;
  64.         var capacity = 50;
  65.         if (matches != null) {
  66.             results = matches[1].split(":");
  67.             title = results[0];
  68.             if (!this._warehouses.hasOwnProperty(title)) {
  69.                 if (results.length == 2) {
  70.                     capacity = parseInt(results[1]);
  71.                     if (isNaN(capacity) || capacity <= 0) {
  72.                         capacity = 50;
  73.                     }
  74.                 }
  75.                 this._warehouses[title] = {
  76.                     title: title,
  77.                     maxCapacity: capacity,
  78.                     currentCapacity: 0,
  79.                     items: {
  80.                         item: [],
  81.                         weapon: [],
  82.                         armor: [],
  83.                         keyItem: []
  84.                     },
  85.                     qtty: {
  86.                         item: {},
  87.                         weapon: {},
  88.                         armor: {},
  89.                         keyItem: {}
  90.                     }
  91.                 };
  92.             }
  93.             this._lastActive = title;
  94.         }
  95.     };
  96.     /* Opens a warehouse */
  97.     PHWarehouseManager.prototype.openWarehouse = function(_sentence) {
  98.         var matches = this.checkSentence(_sentence);
  99.         if (matches != null) {
  100.             this._lastActive = matches[1];
  101.         }
  102.     };
  103.     /* Get all the items from the current warehouse */
  104.     PHWarehouseManager.prototype.getItems = function() {
  105.         var totalItems = this.getCommonItems();
  106.         totalItems = totalItems.concat(this.getArmors());
  107.         totalItems = totalItems.concat(this.getKeyItems());
  108.         totalItems = totalItems.concat(this.getWeapons());
  109.         return totalItems;
  110.     };
  111.     /* Get weapon items */
  112.     PHWarehouseManager.prototype.getWeapons = function() {
  113.         var totalItems = [];
  114.         for (var i = 0; i < this._warehouses[this._lastActive].items.weapon.length; i++) {
  115.             for (var j = 0; j < $dataWeapons.length; j++) {
  116.                 if ($dataWeapons[j] != null && this._warehouses[this._lastActive].items.weapon[i] == $dataWeapons[j].id) {
  117.                     totalItems.push($dataWeapons[j]);
  118.                 }
  119.             }
  120.         }
  121.         return totalItems;
  122.     };
  123.     /* Get common items */
  124.     PHWarehouseManager.prototype.getCommonItems = function() {
  125.         var totalItems = [];
  126.         for (var i = 0; i < this._warehouses[this._lastActive].items.item.length; i++) {
  127.             for (var j = 0; j < $dataItems.length; j++) {
  128.                 if ($dataItems[j] != null && this._warehouses[this._lastActive].items.item[i] == $dataItems[j].id) {
  129.                     totalItems.push($dataItems[j]);
  130.                 }
  131.             }
  132.         }
  133.         return totalItems;
  134.     };
  135.     /* Get armor items */
  136.     PHWarehouseManager.prototype.getArmors = function() {
  137.         var totalItems = [];
  138.         for (var i = 0; i < this._warehouses[this._lastActive].items.armor.length; i++) {
  139.             for (var j = 0; j < $dataArmors.length; j++) {
  140.                 if ($dataArmors[j] != null && this._warehouses[this._lastActive].items.armor[i] == $dataArmors[j].id) {
  141.                     totalItems.push($dataArmors[j]);
  142.                 }
  143.             }
  144.         }
  145.         return totalItems;
  146.     };
  147.     /* Get key items */
  148.     PHWarehouseManager.prototype.getKeyItems = function() {
  149.         var totalItems = [];
  150.         for (var i = 0; i < this._warehouses[this._lastActive].items.keyItem.length; i++) {
  151.             for (var j = 0; j < $dataItems.length; j++) {
  152.                 if ($dataItems[j] != null && this._warehouses[this._lastActive].items.keyItem[i] == $dataItems[j].id) {
  153.                     totalItems.push($dataItems[j]);
  154.                 }
  155.             }
  156.         }
  157.         return totalItems;
  158.     };
  159.     /* Get the quantity for the corresponding item */
  160.     PHWarehouseManager.prototype.getQuantity = function(item) {
  161.         return this._warehouses[this._lastActive].qtty[this._lastCategory][item.id];
  162.     };
  163.     /* Checks whether or not the warehouse is already full */
  164.     PHWarehouseManager.prototype.checkCapacity = function() {
  165.         if (this._warehouses[this._lastActive].currentCapacity < this._warehouses[this._lastActive].maxCapacity) {
  166.             return true;
  167.         }
  168.         return false;
  169.     };
  170.     /* Deposit on warehouse */
  171.     PHWarehouseManager.prototype.deposit = function(item) {
  172.         if (this.checkCapacity()) {
  173.             var hasItem = false;
  174.             if (this._warehouses[this._lastActive].items[this._lastCategory].indexOf(item.id) > -1) {
  175.                 hasItem = true;
  176.             }
  177.             if (hasItem) {
  178.                 this._warehouses[this._lastActive].qtty[this._lastCategory][item.id]++;
  179.             } else {
  180.                 this._warehouses[this._lastActive].items[this._lastCategory].push(item.id);
  181.                 this._warehouses[this._lastActive].qtty[this._lastCategory][item.id] = 1;
  182.             }
  183.             this._warehouses[this._lastActive].currentCapacity++;
  184.         }
  185.     };
  186.     /* Withdraw from a warehouse */
  187.     PHWarehouseManager.prototype.withdraw = function(item) {
  188.         var hasItem = false;
  189.         var index = this._warehouses[this._lastActive].items[this._lastCategory].indexOf(item.id);
  190.         if (index > -1) {
  191.             hasItem = true;
  192.         }
  193.         if (hasItem) {
  194.             this._warehouses[this._lastActive].qtty[this._lastCategory][item.id]--;
  195.             if (this._warehouses[this._lastActive].qtty[this._lastCategory][item.id] == 0) {
  196.                 this._warehouses[this._lastActive].items[this._lastCategory].splice(index, 1);
  197.                 delete this._warehouses[this._lastActive].qtty[this._lastCategory][item.id];
  198.             }
  199.             this._warehouses[this._lastActive].currentCapacity--;
  200.         }
  201.     };
  202.     /* Remove a warehouse */
  203.     PHWarehouseManager.prototype.removeWarehouse = function(_sentence) {
  204.         var matches = this.checkSentence(_sentence);
  205.         if (matches != null) {
  206.             if (this._warehouses.hasOwnProperty(matches[1])) {
  207.                 delete this._warehouses[matches[1]];
  208.             }
  209.         }
  210.     };
  211.     /* Check sentences coming from the arguments */
  212.     PHWarehouseManager.prototype.checkSentence = function(_sentence) {
  213.         var regExp = /\<([^)]+)\>/;
  214.         return regExp.exec(_sentence);
  215.     };
  216.     /* ACCESSOR METHODS */
  217.     /* Return the value of the maximum capacity of the warehouse for the given title */
  218.     PHWarehouseManager.prototype.getMaxCapacity = function(title) {
  219.         if (this._warehouses.hasOwnProperty(title)) {
  220.             return this._warehouses[title].maxCapacity;
  221.         }
  222.         return 0;
  223.     };
  224.     /* Return the value of the current capacity of the warehouse for the given title */
  225.     PHWarehouseManager.prototype.getCurrentCapacity = function(title) {
  226.         if (this._warehouses.hasOwnProperty(title)) {
  227.             return this._warehouses[title].currentCapacity;
  228.         }
  229.         return 0;
  230.     };
  231.     /* Return whether or not the warehouse for the given title exists */
  232.     PHWarehouseManager.prototype.exist = function(title) {
  233.         if (this._warehouses.hasOwnProperty(title) && this._warehouses[title] !== undefined) {
  234.             return true;
  235.         }
  236.         return false;
  237.     };
  238.     /* ---------------------------------------------------------- *
  239.      *                      LOADING PROCESS                       *
  240.      * ---------------------------------------------------------- */
  241.     /*
  242.      * Creating PHWarehouse variable after loading the whole database
  243.      */
  244.     var _DataManager_loadDatabase_ = DataManager.loadDatabase;
  245.     DataManager.loadDatabase = function() {
  246.         _DataManager_loadDatabase_.call(this);
  247.         PHWarehouse = new PHWarehouseManager();
  248.     };
  249.     /* Saves the warehouses when the player saves the game */
  250.     var _DataManager_makeSaveContents_ = DataManager.makeSaveContents;
  251.     DataManager.makeSaveContents = function() {
  252.         var contents = _DataManager_makeSaveContents_.call(this);
  253.         contents.phwarehouse = PHWarehouse._warehouses;
  254.         return contents;
  255.     };
  256.     /* Retrieve the warehouses from the save content */
  257.     var _DataManager_extractSaveContents_ = DataManager.extractSaveContents;
  258.     DataManager.extractSaveContents = function(contents) {
  259.         _DataManager_extractSaveContents_.call(this, contents);
  260.         PHWarehouse = new PHWarehouseManager();
  261.         PHWarehouse._warehouses = contents.phwarehouse;
  262.     };
  263.     var getAllArguments = function(args) {
  264.         var str = args[1].toString();
  265.         for (var i = 2; i < args.length; i++) {
  266.             str += ' ' + args[i].toString();
  267.         }
  268.         return str;
  269.     };
  270.     var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  271.     Game_Interpreter.prototype.pluginCommand = function(command, args) {
  272.         _Game_Interpreter_pluginCommand.call(this, command, args);
  273.         if (command === 'PHWarehouse') {
  274.             switch (args[0]) {
  275.                 case 'create':
  276.                     PHWarehouse.createWarehouse(getAllArguments(args));
  277.                     break;
  278.                 case 'show':
  279.                     PHWarehouse.openWarehouse(getAllArguments(args));
  280.                     SceneManager.push(Scene_Warehouse);
  281.                     break;
  282.                 case 'remove':
  283.                     PHWarehouse.removeWarehouse(getAllArguments(args));
  284.                     break;
  285.             }
  286.         }
  287.     };
  288.     /* ---------------------------------------------------------- *
  289.      *                       WINDOW PROCESS                       *
  290.      * ---------------------------------------------------------- */
  291.     function Window_WarehouseTitle() {
  292.         this.initialize.apply(this, arguments);
  293.     }
  294.     Window_WarehouseTitle.prototype = Object.create(Window_Base.prototype);
  295.     Window_WarehouseTitle.prototype.constructor = Window_WarehouseTitle;
  296.     Window_WarehouseTitle.prototype.initialize = function() {
  297.         Window_Base.prototype.initialize.call(this, 0, 0, Graphics.boxWidth, this.fittingHeight(1));
  298.         this.refresh();
  299.     };
  300.     Window_WarehouseTitle.prototype.refresh = function() {
  301.         this.contents.clear();
  302.         this.changeTextColor(this.crisisColor());
  303.         this.drawText(PHWarehouse._lastActive, 0, 0, Graphics.boxWidth, "center");
  304.     };
  305.     function Window_WarehouseOption() {
  306.         this.initialize.apply(this, arguments);
  307.     }
  308.     Window_WarehouseOption.prototype = Object.create(Window_Selectable.prototype);
  309.     Window_WarehouseOption.prototype.constructor = Window_WarehouseOption;
  310.     Window_WarehouseOption.prototype.initialize = function() {
  311.         Window_Selectable.prototype.initialize.call(this, 0, this.fittingHeight(1), Graphics.boxWidth, this.fittingHeight(1));
  312.         this.withdrawText = withdrawText;
  313.         this.depositText = depositText;
  314.         this.refresh();
  315.         this.select(0);
  316.         this.activate();
  317.     };
  318.     Window_WarehouseOption.prototype.maxItems = function() {
  319.         return 2;
  320.     };
  321.     Window_WarehouseOption.prototype.maxCols = function() {
  322.         return 2;
  323.     };
  324.     Window_WarehouseOption.prototype.changeOption = function() {
  325.         PHWarehouse._lastOption = this._index;
  326.     };
  327.     Window_WarehouseOption.prototype.refresh = function() {
  328.         var rectWithdraw = this.itemRectForText(0);
  329.         var rectDeposit = this.itemRectForText(1);
  330.         this.drawText(this.withdrawText, rectWithdraw.x, rectWithdraw.y, rectWithdraw.width, "center");
  331.         this.drawText(this.depositText, rectDeposit.x, rectDeposit.y, rectDeposit.width, "center");
  332.     };
  333.     function Window_WarehouseCategory() {
  334.         this.initialize.apply(this, arguments);
  335.     }
  336.     Window_WarehouseCategory.prototype = Object.create(Window_ItemCategory.prototype);
  337.     Window_WarehouseCategory.prototype.constructor = Window_WarehouseCategory;
  338.     Window_WarehouseCategory.prototype.initialize = function() {
  339.         Window_ItemCategory.prototype.initialize.call(this);
  340.         this.y = this.fittingHeight(3);
  341.         this.deselect();
  342.         this.deactivate();
  343.     };
  344.     Window_WarehouseCategory.prototype.changeCategory = function() {
  345.         PHWarehouse._lastCategory = this.currentSymbol() || "item";
  346.     };
  347.     Window_WarehouseCategory.prototype.setItemWindow = function(itemWindow) {
  348.         this._itemWindow = itemWindow;
  349.         this.update();
  350.     };
  351.     Window_WarehouseCategory.prototype.update = function() {
  352.         Window_ItemCategory.prototype.update.call(this);
  353.         this.changeCategory();
  354.         this._itemWindow.refresh();
  355.     };
  356.     function Window_WarehouseItemList() {
  357.         this.initialize.apply(this, arguments);
  358.     }
  359.     Window_WarehouseItemList.prototype = Object.create(Window_ItemList.prototype);
  360.     Window_WarehouseItemList.prototype.constructor = Window_WarehouseItemList;
  361.     Window_WarehouseItemList.prototype.initialize = function() {
  362.         Window_ItemList.prototype.initialize.call(this, 0, this.fittingHeight(5), Graphics.boxWidth, Graphics.boxHeight - this.fittingHeight(7));
  363.     };
  364.     Window_WarehouseItemList.prototype.isCurrentItemEnabled = function() {
  365.         if (this._data.length > 0) {
  366.             if (PHWarehouse._lastOption == 1 && PHWarehouse.checkCapacity()) {
  367.                 return true;
  368.             } else if (PHWarehouse._lastOption == 0) {
  369.                 return true;
  370.             } else {
  371.                 return false;
  372.             }
  373.         }
  374.         return false;
  375.     };
  376.     Window_WarehouseItemList.prototype.makeWarehouseItemList = function() {
  377.         var data = PHWarehouse.getItems();
  378.         this._data = data.filter(function(item) {
  379.             return this.includes(item);
  380.         }, this);
  381.         if (this.includes(null)) {
  382.             this._data.push(null);
  383.         }
  384.     };
  385.     Window_WarehouseItemList.prototype.loadItems = function() {
  386.         // Deposit
  387.         if (PHWarehouse._lastOption == 1) {
  388.             this.makeItemList();
  389.         }
  390.         // Withdraw
  391.         else if (PHWarehouse._lastOption == 0) {
  392.             this.makeWarehouseItemList();
  393.         }
  394.     };
  395.     Window_WarehouseItemList.prototype.drawItem = function(index) {
  396.         var item = this._data[index];
  397.         if (item) {
  398.             var numberWidth = this.numberWidth();
  399.             var rect = this.itemRect(index);
  400.             rect.width -= this.textPadding();
  401.             this.drawItemName(item, rect.x, rect.y, rect.width - numberWidth);
  402.             if (PHWarehouse._lastOption == 1) {
  403.                 this.drawItemNumber(item, rect.x, rect.y, rect.width);
  404.             } else if (PHWarehouse._lastOption == 0) {
  405.                 this.drawWarehouseItemNumber(item, rect.x, rect.y, rect.width);
  406.             }
  407.         }
  408.     };
  409.     Window_WarehouseItemList.prototype.drawWarehouseItemNumber = function(item, x, y, width) {
  410.         var qtty = PHWarehouse.getQuantity(item);
  411.         if (typeof Yanfly !== "undefined") {
  412.             this.contents.fontSize = Yanfly.Param.ItemQuantitySize;
  413.             this.drawText('\u00d7' + qtty, x, y, width, 'right');
  414.             this.resetFontSettings();
  415.         } else {
  416.             this.drawText(':', x, y, width - this.textWidth('00'), 'right');
  417.             this.drawText(qtty, x, y, width, 'right');
  418.         }
  419.     };
  420.     Window_WarehouseItemList.prototype.refresh = function() {
  421.         this.contents.clear();
  422.         this.loadItems();
  423.         this.drawAllItems();
  424.     };
  425.     Window_WarehouseItemList.prototype.moveItem = function() {
  426.         // Deposit
  427.         if (PHWarehouse._lastOption == 1) {
  428.             if (PHWarehouse.checkCapacity()) {
  429.                 PHWarehouse.deposit(this.item());
  430.                 $gameParty.loseItem(this.item(), 1);
  431.             }
  432.         }
  433.         // Withdraw
  434.         else if (PHWarehouse._lastOption == 0) {
  435.             PHWarehouse.withdraw(this.item());
  436.             $gameParty.gainItem(this.item(), 1);
  437.         }
  438.     };
  439.     function Window_WarehouseInfo() {
  440.         this.initialize.apply(this, arguments);
  441.     }
  442.     Window_WarehouseInfo.prototype = Object.create(Window_Base.prototype);
  443.     Window_WarehouseInfo.prototype.constructor = Window_WarehouseInfo;
  444.     Window_WarehouseInfo.prototype.initialize = function() {
  445.         Window_Base.prototype.initialize.call(this, 0, Graphics.boxHeight - this.fittingHeight(1), Graphics.boxWidth, this.fittingHeight(1));
  446.         this.availableSpaceText = availableSpaceText + " ";
  447.         this.refresh();
  448.     };
  449.     Window_WarehouseInfo.prototype.refresh = function() {
  450.         this.contents.clear();
  451.         this.availableSpaceValue = (PHWarehouse._warehouses[PHWarehouse._lastActive].maxCapacity - PHWarehouse._warehouses[PHWarehouse._lastActive].currentCapacity) + " / " + PHWarehouse._warehouses[PHWarehouse._lastActive].maxCapacity;
  452.         this.changeTextColor(this.normalColor());
  453.         this.drawText(this.availableSpaceText + this.availableSpaceValue, 0, 0, this.x);
  454.     };
  455.     /* ---------------------------------------------------------- *
  456.      *                        SCENE PROCESS                       *
  457.      * ---------------------------------------------------------- */
  458.     function Scene_Warehouse() {
  459.         this.initialize.apply(this, arguments);
  460.     }
  461.     Scene_Warehouse.prototype = Object.create(Scene_MenuBase.prototype);
  462.     Scene_Warehouse.prototype.constructor = Scene_Warehouse;
  463.     Scene_Warehouse.prototype.initialize = function() {
  464.         Scene_MenuBase.prototype.initialize.call(this);
  465.     };
  466.     Scene_Warehouse.prototype.create = function() {
  467.         Scene_MenuBase.prototype.create.call(this);
  468.         this.createTitle();
  469.         this.createOptions();
  470.         this.createCategory();
  471.         this.createItemList();
  472.         this.createInfoLocation();
  473.     };
  474.     Scene_Warehouse.prototype.createTitle = function() {
  475.         this._titleWindow = new Window_WarehouseTitle();
  476.         this.addWindow(this._titleWindow);
  477.     };
  478.     Scene_Warehouse.prototype.createOptions = function() {
  479.         this._optionWindow = new Window_WarehouseOption();
  480.         this._optionWindow.setHandler('cancel', this.popScene.bind(this));
  481.         this._optionWindow.setHandler('ok', this.onOptionOk.bind(this));
  482.         this.addWindow(this._optionWindow);
  483.     };
  484.     Scene_Warehouse.prototype.createCategory = function() {
  485.         this._categoryWindow = new Window_WarehouseCategory();
  486.         this._categoryWindow.setHandler('cancel', this.onCategoryCancel.bind(this));
  487.         this._categoryWindow.setHandler('ok', this.onCategoryOk.bind(this));
  488.         this.addWindow(this._categoryWindow);
  489.     };
  490.     Scene_Warehouse.prototype.createItemList = function() {
  491.         this._itemWindow = new Window_WarehouseItemList();
  492.         this._itemWindow.setHandler('ok', this.onItemOk.bind(this));
  493.         this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
  494.         this.addWindow(this._itemWindow);
  495.         this._categoryWindow.setItemWindow(this._itemWindow);
  496.     };
  497.     Scene_Warehouse.prototype.createInfoLocation = function() {
  498.         this._infoLocationWindow = new Window_WarehouseInfo();
  499.         this.addWindow(this._infoLocationWindow);
  500.     };
  501.     Scene_Warehouse.prototype.onOptionOk = function() {
  502.         this._optionWindow.changeOption();
  503.         this._categoryWindow.activate();
  504.         this._categoryWindow.select(0);
  505.         this._optionWindow.deactivate();
  506.     };
  507.     Scene_Warehouse.prototype.onCategoryOk = function() {
  508.         this._itemWindow.activate();
  509.         if (this._itemWindow._data.length > 0) {
  510.             this._itemWindow.select(0);
  511.         }
  512.         this._categoryWindow.deactivate();
  513.     };
  514.     Scene_Warehouse.prototype.onCategoryCancel = function() {
  515.         this._categoryWindow.deselect();
  516.         this._optionWindow.activate();
  517.     };
  518.     Scene_Warehouse.prototype.onItemCancel = function() {
  519.         this._itemWindow.deselect();
  520.         this._categoryWindow.activate();
  521.     };
  522.     Scene_Warehouse.prototype.onItemOk = function() {
  523.         SoundManager.playEquip();
  524.         this._itemWindow.moveItem();
  525.         this._infoLocationWindow.refresh();
  526.         this._itemWindow.activate();
  527.     };
  528. })();
复制代码
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-28 03:35

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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