Guest User

Candacis_AdventureItems.js

a guest
Oct 13th, 2017
499
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // Candacis - Adventure Items
  3. // Candacis_AdventureItems.js
  4. //=============================================================================
  5.  
  6. var Imported = Imported || {};
  7. Imported.Candacis_AdventureItems = true;
  8.  
  9. var Liquidize = Liquidize || {};
  10. Liquidize.AI = Liquidize.AI || {};
  11. Liquidize.AI.version = 1.00;
  12.  
  13. //=============================================================================
  14. /*:
  15.  * @plugindesc v1.00 this plugin creates a adventure item menu that lets you
  16.  * combine and separate items.
  17.  * @author Liquidize
  18.  *
  19.  * @help
  20.  * ============================================================================
  21.  * Introduction
  22.  * ============================================================================
  23.  * This plugin is a rudimentary system that allows the user to have a new menu
  24.  * pop up that lets the player combine,separate, and examine items. It is fairly
  25.  * basic and could be expanded upon rather easily.
  26.  * ============================================================================
  27.  * Parameters
  28.  * ============================================================================
  29.  *
  30.  * @param Menu Name
  31.  * @type text
  32.  * @desc Text to display on the menu.
  33.  * @default Adventure
  34.  *
  35.  * ============================================================================
  36.  *  Notetags
  37.  * ============================================================================
  38.  *
  39.  * ITEMS/ARMORS/WEAPONS
  40.  *
  41.  * <Item Separation: true/false> - This notetag lets you specify whether that Item
  42.  * can be separated into its base components.  By default Items are able to be
  43.  * so you do not need to set this unless you do not want the item to be.
  44.  *
  45.  * <Item Combo: ....>  This notetag sets the combination of items that combine
  46.  * to create this item. The item's are the ID's of the items, separated by a comma.
  47.  * If the item is an ARMOR item, prefix the id with an 'a', if the item is a weapon
  48.  * prefix the item id with a 'w'. See the example below.
  49.  *
  50.  * EXAMPLE:
  51.  * <Item Combo: 1,a4,w3>
  52.  *
  53.  *     The above example would be made by combining ITEM with id 1, ARMOR with
  54.  *     id 4 and WEAPON with id 3.
  55.  *
  56.  * ============================================================================
  57.  * Special Notes
  58.  * ============================================================================
  59.  * None
  60.  *
  61.  * ============================================================================
  62.  * Changelog
  63.  * ============================================================================
  64.  *
  65.  * Version 1.00:
  66.  * - Finished Plugin!
  67.  */
  68. //=============================================================================
  69.  
  70. //=============================================================================
  71. // Parameter Variables
  72. //=============================================================================
  73.  
  74. Liquidize.Parameters = PluginManager.parameters("Candacis_AdventureItems");
  75. Liquidize.Param = Liquidize.Param || {};
  76. Liquidize.Param.AdventureMenuName = String(Liquidize.Parameters["Menu Name"]);
  77.  
  78. Liquidize.AI.ItemCombos = [];
  79.  
  80. //=============================================================================
  81. // DataManager
  82. //=============================================================================
  83.  
  84. Liquidize.AI.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
  85. DataManager.isDatabaseLoaded = function () {
  86.     if (!Liquidize.AI.DataManager_isDatabaseLoaded.call(this)) return false;
  87.     if (!Liquidize._loaded_Adventures_Items) {
  88.         this.processItemComboNotetags($dataItems);
  89.         this.processItemComboNotetags($dataArmors);
  90.         this.processItemComboNotetags($dataWeapons);
  91.         Liquidize._loaded_Adventures_Items = true;
  92.     }
  93.     return true;
  94. };
  95.  
  96. DataManager.processItemComboNotetags = function (group) {
  97.     var note1 = /<(?:ITEM COMBO): ([?a|w\d+(,(?!$))?]+)>/i;
  98.     var note2 = /<(?:ITEM SEPARATION): (true|false)>/i;
  99.     for (var n = 1; n < group.length; n++) {
  100.         var obj = group[n];
  101.         var notedata = obj.note.split(/[\r\n]+/);
  102.  
  103.         obj.itemCombo = null;
  104.         obj.canSeparate = true;
  105.  
  106.         for (var i = 0; i < notedata.length; i++) {
  107.             var line = notedata[i];
  108.             if (line.match(note1)) {
  109.               var combos = RegExp.$1.split(",");
  110.               if (combos.length > 0) {
  111.                   obj.itemCombo = combos;
  112.                   var comboObj = {};
  113.                   comboObj.combo = obj.itemCombo;
  114.                   var prefix = "";
  115.                   if (DataManager.isArmor(obj)) prefix = "a";
  116.                   if (DataManager.isWeapon(obj)) prefix = "w";
  117.                   var comboId = prefix + obj.id;
  118.                   comboObj.output = comboId;
  119.                   Liquidize.AI.ItemCombos.push(comboObj);
  120.               }
  121.             } else if (line.match(note2)) {
  122.                 obj.canSeparate = !!RegExp.$1;
  123.             }
  124.         }
  125.     }
  126. };
  127.  
  128. DataManager.isItemCombinationForItem = function(haystack, needles) {
  129.     if (needles.length < haystack.length) return false;
  130.     var haystackMap = {};
  131.     for (var i = 0; i < haystack.length; i++)
  132.         haystackMap[haystack[i]] = true;
  133.     for (var j = 0; j < needles.length; j++)
  134.         if (!(needles[j] in haystackMap))
  135.             return false;
  136.     return true;
  137. };
  138.  
  139. DataManager.isItemCombination = function(items) {
  140.     if (items.length === 0) return null;
  141.     for (var i = 0; i < Liquidize.AI.ItemCombos.length; i++) {
  142.         if (this.isItemCombinationForItem(Liquidize.AI.ItemCombos[i].combo,items)) return Liquidize.AI.ItemCombos[i].output;
  143.     }
  144.     return null;
  145. };
  146.  
  147. //=============================================================================
  148. // ImageManager
  149. //=============================================================================
  150.  
  151. //=============================================================================
  152. // Window_AdventureItemCommand
  153. //=============================================================================
  154.  
  155. function Window_AdventureItemCommand() {
  156.     this.initialize.apply(this, arguments);
  157. }
  158.  
  159. Window_AdventureItemCommand.prototype = Object.create(Window_HorzCommand.prototype);
  160. Window_AdventureItemCommand.prototype.constructor = Window_AdventureItemCommand;
  161.  
  162. Window_AdventureItemCommand.prototype.initialize = function() {
  163.     Window_HorzCommand.prototype.initialize.call(this, 0, 0);
  164. };
  165.  
  166. Window_AdventureItemCommand.prototype.windowWidth = function() {
  167.     return Graphics.boxWidth;
  168. };
  169.  
  170. Window_AdventureItemCommand.prototype.maxCols = function() {
  171.     return 4;
  172. };
  173.  
  174. Window_AdventureItemCommand.prototype.update = function() {
  175.     Window_HorzCommand.prototype.update.call(this);
  176.     if (this._itemWindow) {
  177.         this._itemWindow.setCategory(this.currentSymbol());
  178.     }
  179. };
  180.  
  181. Window_AdventureItemCommand.prototype.makeCommandList = function() {
  182.     this.addCommand("Examine",    'examine',this.canExamineOrCombine());
  183.     this.addCommand("Combine",   'combine',this.canExamineOrCombine());
  184.     this.addCommand("Separate", 'separate',this.canSeparate());
  185. };
  186.  
  187. Window_AdventureItemCommand.prototype.setItemWindow = function(itemWindow) {
  188.     this._itemWindow = itemWindow;
  189.     this.update();
  190. };
  191.  
  192. Window_AdventureItemCommand.prototype.canSeparate = function() {
  193.     var item =  this._itemWindow ? this._itemWindow.item() : null;
  194.     if (!this.active) return false;
  195.     if (!item || !item.canSeparate) return false;
  196.     return true;
  197. };
  198.  
  199. Window_AdventureItemCommand.prototype.canExamineOrCombine = function() {
  200.     var item =  this._itemWindow ? this._itemWindow.item() : null;
  201.     if (!this.active) return false;
  202.     if (!item) return false;
  203.     return true;
  204. };
  205.  
  206.  
  207. //=============================================================================
  208. // Window_CombineCommand
  209. //=============================================================================
  210.  
  211. function Window_CombineCommand() {
  212.     this.initialize.apply(this, arguments);
  213. }
  214.  
  215. Window_CombineCommand.prototype = Object.create(Window_HorzCommand.prototype);
  216. Window_CombineCommand.prototype.constructor = Window_CombineCommand;
  217.  
  218. Window_CombineCommand.prototype.initialize = function(x,y,width,height) {
  219.     Window_HorzCommand.prototype.initialize.call(this, x, y);
  220.     this.width = width;
  221.     this.height = height;
  222.     this.refresh();
  223. };
  224.  
  225. Window_CombineCommand.prototype.maxCols = function() {
  226.     return 2;
  227. };
  228.  
  229. Window_CombineCommand.prototype.update = function() {
  230.     Window_HorzCommand.prototype.update.call(this);
  231.     if (this._itemWindow) {
  232.         this._itemWindow.setCategory(this.currentSymbol());
  233.     }
  234. };
  235.  
  236. Window_CombineCommand.prototype.makeCommandList = function() {
  237.     this.addCommand("Add",    'add',true);
  238.     this.addCommand("Combine",  'docombine',true);
  239. };
  240.  
  241. Window_CombineCommand.prototype.setItemWindow = function(itemWindow) {
  242.     this._itemWindow = itemWindow;
  243.     this.update();
  244. };
  245.  
  246. //=============================================================================
  247. // Window_AdventureItems
  248. //=============================================================================
  249.  
  250. function Window_AdventureItems() {
  251.     this.initialize.apply(this, arguments);
  252. }
  253.  
  254. Window_AdventureItems.prototype = Object.create(Window_ItemList.prototype);
  255. Window_AdventureItems.prototype.constructor = Window_AdventureItems;
  256.  
  257. Window_AdventureItems.prototype.initialize = function(x, y,width,height) {
  258.     Window_ItemList.prototype.initialize.call(this, x, y,width,height);
  259.     this.mode = 0;
  260.     this._lastSelectedItem = null;
  261.     this.refresh();
  262. };
  263.  
  264. Window_AdventureItems.prototype.drawItem = function(index) {
  265.     var item = this._data[index];
  266.     if (item) {
  267.         var rect = this.itemRect(index);
  268.         rect.width -= 4;
  269.         this.changePaintOpacity(this.isEnabled(item));
  270.         this.drawItemName(item, rect.x, rect.y,rect.width);
  271.         this.changePaintOpacity(1);
  272.     }
  273. };
  274.  
  275. Window_AdventureItems.prototype.isCurrentItemEnabled = function() {
  276.     return true;
  277. };
  278.  
  279. Window_AdventureItems.prototype.includes = function(item) {
  280.     return true;
  281. };
  282.  
  283. Window_AdventureItems.prototype.setLastSelectedItem = function(item) {
  284.     this._lastSelectedItem = this._data.indexOf(item) >= 0 ? this._data.indexOf(item) : -1
  285. };
  286.  
  287. Window_AdventureItems.prototype.selectLastItem = function() {
  288.   this.select(this._lastSelectedItem >= 0 ? this._lastSelectedItem : 0);
  289. };
  290.  
  291. //=============================================================================
  292. // Window_AdventureCombineItems
  293. //=============================================================================
  294.  
  295. function Window_AdventureCombineItems() {
  296.     this.initialize.apply(this, arguments);
  297. }
  298.  
  299. Window_AdventureCombineItems.prototype = Object.create(Window_ItemList.prototype);
  300. Window_AdventureCombineItems.prototype.constructor = Window_AdventureCombineItems;
  301.  
  302. Window_AdventureCombineItems.prototype.initialize = function(x, y,width,height) {
  303.     Window_ItemList.prototype.initialize.call(this, x, y,width,height);
  304.     this._data = [];
  305.     this.refresh();
  306. };
  307.  
  308. Window_AdventureCombineItems.prototype.makeItemList = function() {
  309. };
  310.  
  311. Window_AdventureCombineItems.prototype.maxCols = function() {
  312.     return 1;
  313. };
  314.  
  315. Window_AdventureCombineItems.prototype.drawItem = function(index) {
  316.     var item = this._data[index];
  317.     if (item) {
  318.         var rect = this.itemRect(index);
  319.         rect.width -= 4;
  320.         this.drawItemName(item, rect.x, rect.y,rect.width);
  321.     }
  322. };
  323.  
  324. Window_AdventureCombineItems.prototype.isCurrentItemEnabled = function() {
  325. };
  326.  
  327. Window_AdventureCombineItems.prototype.includes = function(item) {
  328. };
  329.  
  330. Window_AdventureCombineItems.prototype.addItem = function(item) {
  331.     if (!this._data) return;
  332.     this._data.push(item);
  333.     this.refresh();
  334. };
  335.  
  336. Window_AdventureCombineItems.prototype.combo = function() {
  337.     return this._data;
  338. };
  339.  
  340. Window_AdventureCombineItems.prototype.clearCombo = function() {
  341.     this._data = [];
  342.     this.refresh();
  343. };
  344.  
  345. //=============================================================================
  346. // Window_AdventureItemExamine
  347. //=============================================================================
  348.  
  349. function Window_AdventureItemExamine() {
  350.     this.initialize.apply(this, arguments);
  351. }
  352.  
  353. Window_AdventureItemExamine.prototype = Object.create(Window_Selectable.prototype);
  354. Window_AdventureItemExamine.prototype.constructor = Window_AdventureItemExamine;
  355.  
  356. Window_AdventureItemExamine.prototype.initialize = function(x,y,width,height) {
  357.     Window_Selectable.prototype.initialize.call(this, x, y, width, height);
  358.     this._text = "";
  359. };
  360.  
  361. Window_AdventureItemExamine.prototype.setText = function(text) {
  362.     if (this._text !== text) {
  363.         this._text = text;
  364.         this.refresh();
  365.     }
  366. };
  367.  
  368. Window_AdventureItemExamine.prototype.clear = function() {
  369.     this.setText("");
  370. };
  371.  
  372. Window_AdventureItemExamine.prototype.setItem = function(item) {
  373.     if (item) {
  374.         this.setText(item.description ? item.description : "");
  375.     } else {
  376.         this.setText("");
  377.     }
  378. };
  379.  
  380. Window_AdventureItemExamine.prototype.refresh = function() {
  381.     this.contents.clear();
  382.     this.drawTextEx(this._text, this.textPadding(), 0);
  383. };
  384.  
  385.  
  386. //=============================================================================
  387. // Window_MenuCommand
  388. //=============================================================================
  389.  
  390. Liquidize.AI.Window_MenuCommand_addOriginalCommands = Window_MenuCommand.prototype.addOriginalCommands;
  391. Window_MenuCommand.prototype.addOriginalCommands = function() {
  392.     this.addCommand(Liquidize.Param.AdventureMenuName, 'adventure', true);
  393. };
  394.  
  395. //=============================================================================
  396. // Scene_Menu
  397. //=============================================================================
  398.  
  399. Liquidize.AI.Scene_Menu_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
  400. Scene_Menu.prototype.createCommandWindow = function() {
  401.     Liquidize.AI.Scene_Menu_createCommandWindow.call(this);
  402.     this._commandWindow.setHandler('adventure',this.commandAdventure.bind(this));
  403. };
  404.  
  405. Scene_Menu.prototype.commandAdventure = function() {
  406.     SceneManager.push(Scene_AdventureItem);
  407. };
  408.  
  409.  
  410. //=============================================================================
  411. // Scene_AdventureItem
  412. //=============================================================================
  413.  
  414. function Scene_AdventureItem() {
  415.     this.initialize.apply(this, arguments);
  416. }
  417.  
  418. Scene_AdventureItem.prototype = Object.create(Scene_Base.prototype);
  419. Scene_AdventureItem.prototype.constructor = Scene_AdventureItem;
  420.  
  421. Scene_AdventureItem.prototype.initialize = function() {
  422.     Scene_Base.prototype.initialize.call(this);
  423. };
  424.  
  425. Scene_AdventureItem.prototype.create = function() {
  426.     Scene_Base.prototype.create.call(this);
  427.     this.createBackground();
  428.     this.createWindowLayer();
  429.     this.createAllWindows();
  430. };
  431.  
  432.  
  433. Scene_AdventureItem.prototype.createBackground = function() {
  434.     this._backgroundSprite = new Sprite();
  435.     this._backgroundSprite.bitmap = SceneManager.backgroundBitmap();
  436.     this.addChild(this._backgroundSprite);
  437. };
  438.  
  439. Scene_AdventureItem.prototype.setBackgroundOpacity = function(opacity) {
  440.     this._backgroundSprite.opacity = opacity;
  441. };
  442.  
  443. Scene_AdventureItem.prototype.createAllWindows = function() {
  444.     this.createAdventureItemCommandWindow();
  445.     this.createCombinationWindow();
  446.     this.createCombinationCommandWindow();
  447.     this.createExamineWindow();
  448.     this.createAdventureItemList();
  449. };
  450.  
  451. Scene_AdventureItem.prototype.createAdventureItemCommandWindow = function() {
  452.     this._commandWindow = new Window_AdventureItemCommand();
  453.     this._commandWindow.setHandler('cancel', this.onCommandCancel.bind(this));
  454.     this._commandWindow.setHandler('examine',this.onCommandExamine.bind(this));
  455.     this._commandWindow.setHandler('combine',this.onCommandCombine.bind(this));
  456.     this._commandWindow.setHandler('separate', this.onCommandSeparate.bind(this));
  457.     this._commandWindow.deactivate();
  458.     this.addWindow(this._commandWindow);
  459. };
  460.  
  461. Scene_AdventureItem.prototype.onCommandSeparate = function() {
  462.     var item = this._adventureItemList.item();
  463.     if (item && item.canSeparate) {
  464.         if (!item.itemCombo || !item.itemCombo.length >= 1) {
  465.             SoundManager.playBuzzer();
  466.             this._commandWindow.activate();
  467.             return false;
  468.         }
  469.         item.itemCombo.forEach(function(comboItem) {
  470.             var prefix = comboItem.split('')[0];
  471.             var actualItem = null;
  472.             if (prefix === 'a') {
  473.                 actualItem = $dataArmors[prefix[1]];
  474.             } else if (prefix === 'w') {
  475.                 actualItem = $dataWeapons[prefix[1]];
  476.             } else {
  477.                 actualItem = $dataItems[prefix];
  478.             }
  479.             $gameParty.gainItem(actualItem,1,false);
  480.         },this);
  481.         $gameParty.gainItem(item,-1,false);
  482.         this._adventureItemList.refresh();
  483.         this._commandWindow.refresh();
  484.         this.onCommandCancel();
  485.         SoundManager.playOk();
  486.     } else {
  487.         SoundManager.playBuzzer();
  488.         this._commandWindow.activate();
  489.     }
  490. };
  491.  
  492. Scene_AdventureItem.prototype.onCommandCombine = function() {
  493.     this._commandWindow.deactivate();
  494.     this._comboWindow.addItem(this._adventureItemList.item());
  495.     this._comboCommandWindow.activate();
  496.     this._adventureItemList.mode = 1;
  497. };
  498.  
  499. Scene_AdventureItem.prototype.onCommandExamine = function() {
  500.     this._commandWindow.deactivate();
  501.     this._examineWindow.setItem(this._adventureItemList.item());
  502.     this._examineWindow.activate();
  503.     this._examineWindow.show();
  504.     this._adventureItemList.hide();
  505. };
  506.  
  507. Scene_AdventureItem.prototype.onCommandCancel = function() {
  508.     this._commandWindow.refresh();
  509.     this._commandWindow.deactivate();
  510.     this._adventureItemList.activate();
  511. };
  512.  
  513. Scene_AdventureItem.prototype.onComboCommandCancel = function() {
  514.     this._comboCommandWindow.deactivate();
  515.     this._commandWindow.activate();
  516.     this._adventureItemList.mode = 0;
  517.     this._adventureItemList.selectLastItem();
  518. };
  519.  
  520. Scene_AdventureItem.prototype.onCommandAdd = function() {
  521.   this._comboCommandWindow.deactivate();
  522.   this._adventureItemList.mode = 1;
  523.   this._adventureItemList.activate();
  524. };
  525.  
  526. Scene_AdventureItem.prototype.createCombinationWindow = function() {
  527.     var width = 200;
  528.     var height = Graphics.boxHeight - this._commandWindow.height * 2;
  529.     var y = this._commandWindow.y + this._commandWindow.height;
  530.     this._comboWindow = new Window_AdventureCombineItems(0,y,width,height);
  531.     this._comboWindow.deactivate();
  532.     this.addWindow(this._comboWindow);
  533. };
  534.  
  535. Scene_AdventureItem.prototype.createCombinationCommandWindow = function() {
  536.     var width = 200;
  537.     var height = Graphics.boxHeight - (this._comboWindow.y + this._comboWindow.height);
  538.     var y = this._comboWindow.y + this._comboWindow.height;
  539.     this._comboCommandWindow = new Window_CombineCommand(0,y,width,height);
  540.     this._comboCommandWindow.setHandler('cancel',this.onComboCommandCancel.bind(this));
  541.     this._comboCommandWindow.setHandler('docombine',this.processItemCombine.bind(this));
  542.     this._comboCommandWindow.setHandler('add',this.onCommandAdd.bind(this));
  543.     this._comboCommandWindow.deactivate();
  544.     this.addWindow(this._comboCommandWindow);
  545. };
  546.  
  547. Scene_AdventureItem.prototype.createAdventureItemList = function() {
  548.     var width = Graphics.boxWidth - this._comboWindow.width;
  549.     var height = Graphics.boxHeight - this._commandWindow.height;
  550.     var x = this._comboWindow.x + this._comboWindow.width;
  551.     var y = this._commandWindow.y + this._commandWindow.height;
  552.     this._adventureItemList = new Window_AdventureItems(x,y,width,height);
  553.     this._adventureItemList.setHandler('ok',     this.onItemOk.bind(this));
  554.     this._adventureItemList.setHandler('cancel', this.popScene.bind(this));
  555.     this._adventureItemList.activate();
  556.     this._commandWindow.setItemWindow(this._adventureItemList);
  557.     this.addWindow(this._adventureItemList);
  558. };
  559.  
  560. Scene_AdventureItem.prototype.createExamineWindow = function() {
  561.     var width = Graphics.boxWidth - this._comboWindow.width;
  562.     var height = Graphics.boxHeight - this._commandWindow.height;
  563.     var x = this._comboWindow.x + this._comboWindow.width;
  564.     var y = this._commandWindow.y + this._commandWindow.height;
  565.     this._examineWindow = new Window_AdventureItemExamine(x,y,width,height);
  566.     this._examineWindow.setHandler('cancel', this.onExamineCancel.bind(this));
  567.     this.addWindow(this._examineWindow);
  568. };
  569.  
  570. Scene_AdventureItem.prototype.onExamineCancel = function() {
  571.     this._examineWindow.deactivate();
  572.     this._commandWindow.activate();
  573.     this._examineWindow.hide();
  574.     this._adventureItemList.show();
  575. };
  576.  
  577. Scene_AdventureItem.prototype.processItemCombine = function() {
  578.         var prefixedCombos = [];
  579.         for (var i = 0; i < this._comboWindow.combo().length; i++) {
  580.             var item = this._comboWindow.combo()[i];
  581.             var prefix = "";
  582.             if (DataManager.isArmor(item)) prefix = "a";
  583.             if (DataManager.isWeapon(item)) prefix = "w";
  584.             var comboId = prefix + item.id;
  585.             prefixedCombos.push(comboId);
  586.         }
  587.         var combined = DataManager.isItemCombination(prefixedCombos);
  588.         if (combined !== null) {
  589.             SoundManager.playOk();
  590.             var prefix = combined.split('')[0];
  591.             var item = null;
  592.             if (prefix === 'a') {
  593.                 item = $dataArmors[prefix[1]];
  594.             } else if (prefix === 'w') {
  595.                 item = $dataWeapons[prefix[1]];
  596.             } else {
  597.                 item = $dataItems[prefix];
  598.             }
  599.             $gameParty.gainItem(item,1,false);
  600.             this._comboWindow.combo().forEach(function (item) {
  601.                 $gameParty.gainItem(item,-1,false);
  602.             },this);
  603.             this._comboWindow.clearCombo();
  604.             this.onComboCommandCancel();
  605.             this._adventureItemList.refresh();
  606.             this._commandWindow.refresh();
  607.         } else {
  608.             SoundManager.playBuzzer();
  609.             this._comboWindow.clearCombo();
  610.             this.onComboCommandCancel();
  611.         }
  612. };
  613.  
  614. Scene_AdventureItem.prototype.onItemOk = function() {
  615.     if (this._adventureItemList.mode === 1) {
  616.         this._comboWindow.addItem(this._adventureItemList.item());
  617.         this._adventureItemList.mode = 0;
  618.         this._adventureItemList.deactivate();
  619.         this._comboCommandWindow.activate();
  620.     } else {
  621.         this._adventureItemList.setLastSelectedItem(this._adventureItemList.item());
  622.         this._adventureItemList.deactivate();
  623.         this._commandWindow.activate();
  624.         this._commandWindow.refresh();
  625.     }
  626. };
Advertisement
Add Comment
Please, Sign In to add comment