查看: 2162|回复: 2

[交流讨论] 请教大神,怎么关掉YPE商店界面“G”货币(即RMMV系统货币)

[复制链接]
梦石
0
星屑
788
在线时间
109 小时
注册时间
2008-2-10
回帖
199
发表于 2018-8-14 20:28:30 | 显示全部楼层 |阅读模式

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

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

×
  1. //=============================================================================
  2. // Yanfly Engine Plugins - Shop Menu Core
  3. // YEP_ShopMenuCore.js
  4. //=============================================================================

  5. var Imported = Imported || {};
  6. Imported.YEP_ShopMenuCore = true;

  7. var Yanfly = Yanfly || {};
  8. Yanfly.Shop = Yanfly.Shop || {};
  9. Yanfly.Shop.version = 1.05

  10. //=============================================================================
  11. /*:
  12. * @plugindesc v1.05 Revamps the shop menu appearance and provides the
  13. * framework for many new shop options.
  14. * @author Yanfly Engine Plugins
  15. *
  16. * @param ---General---
  17. * @default
  18. *
  19. * @param Command Order
  20. * @parent ---General---
  21. * @desc This is the order in which the command menu will appear. Use
  22. * a space to separate the individual commands.
  23. * @default Buy Sell Equip Custom Cancel
  24. *
  25. * @param Shop List Width
  26. * @parent ---General---
  27. * @desc This allows you to adjust the formula to determine the window width
  28. * for the main shop list windows.
  29. * @default Graphics.boxWidth / 2 + Graphics.boxWidth / 10
  30. *
  31. * @param Command Alignment
  32. * @parent ---General---
  33. * @type combo
  34. * @option left
  35. * @option center
  36. * @option right
  37. * @desc Text alignment used for the command windows.
  38. * left     center     right
  39. * @default center
  40. *
  41. * @param ---Status Window---
  42. * @default
  43. *
  44. * @param Default Mode
  45. * @parent ---Status Window---
  46. * @type combo
  47. * @option default
  48. * @option actor
  49. * @desc Display a comparison for all actors per stat or per actor?
  50. * default - All Actors     actor - Individual Actors
  51. * @default actor
  52. *
  53. * @param Stat Switching
  54. * @parent ---Status Window---
  55. * @type boolean
  56. * @on Enable
  57. * @off Disable
  58. * @desc Enable stat comparison switching by pressing left/right?
  59. * NO - false     YES - true
  60. * @default true
  61. *
  62. * @param Cannot Equip
  63. * @parent ---Status Window---
  64. * @desc If an actor cannot equip an item, this text is shown.
  65. * @default Can't Equip
  66. *
  67. * @param Stat Font Size
  68. * @parent ---Status Window---
  69. * @desc The font size used for stat comparisons.
  70. * Default: 28
  71. * @default 20
  72. *
  73. * @param Cannot Equip Font Size
  74. * @parent ---Status Window---
  75. * @type number
  76. * @min 1
  77. * @desc The font size used for cannot equip text.
  78. * Default: 28
  79. * @default 20
  80. *
  81. * @param ---Info Window---
  82. * @default
  83. *
  84. * @param Show Icon
  85. * @parent ---Info Window---
  86. * @type boolean
  87. * @on Show
  88. * @off Hide
  89. * @desc Show the icon in the info window?
  90. * NO - false     YES - true
  91. * @default true
  92. *
  93. * @param Icon Size
  94. * @parent ---Info Window---
  95. * @type number
  96. * @min 0
  97. * @desc This will be the width and height of the icon to be drawn.
  98. * This is normally 4x the default Icon Width and Icon Height.
  99. * @default 128
  100. *
  101. * @param Font Size
  102. * @parent ---Info Window---
  103. * @type number
  104. * @min 1
  105. * @desc This changes the font size for description items.
  106. * Default: 28
  107. * @default 20
  108. *
  109. * @param Recovery Format
  110. * @parent ---Info Window---
  111. * @desc This is the text format for HP/MP Recovery.
  112. * @default %1 Heal
  113. *
  114. * @param Add State
  115. * @parent ---Info Window---
  116. * @desc This is the text for adding states.
  117. * @default +State
  118. *
  119. * @param Add Buff
  120. * @parent ---Info Window---
  121. * @desc This is the text for adding buffs.
  122. * @default +Buff
  123. *
  124. * @param Remove State
  125. * @parent ---Info Window---
  126. * @desc This is the text for remove states.
  127. * @default -State
  128. *
  129. * @param Remove Buff
  130. * @parent ---Info Window---
  131. * @desc This is the text for remove buffs.
  132. * @default -Buff
  133. *
  134. * @param Maximum Icons
  135. * @parent ---Info Window---
  136. * @type number
  137. * @min 0
  138. * @desc Maximum number of icons drawn for states and buffs.
  139. * @default 4
  140. *
  141. * @help
  142. * ============================================================================
  143. * Introduction
  144. * ============================================================================
  145. *
  146. * The shop menu in RPG Maker MV is the same as it was in RPG Maker VX and RPG
  147. * Maker VX Ace. It's relatively basic and provides adequate information, but
  148. * not really enough to let the player know what they're actually buying or
  149. * even selling. This plugin enables shops to show more than just the basic
  150. * information displayed in RPG Maker MV and even allows for custom commands to
  151. * be inserted into the command window.
  152. *
  153. * This plugin also gives the player the option to tab between a parameter
  154. * comparison mode with the whole party displaying individual stats at a time
  155. * or individual actors displaying all stats at a time. The player can switch
  156. * between the two modes by pressing the 'tab' button on the keyboard or with
  157. * touch input on the name of the actor or parameter.
  158. *
  159. * ============================================================================
  160. * Instructions
  161. * ============================================================================
  162. *
  163. * You can add and remove commands from the Command Window by changing the
  164. * 'Command Order' parameter. Here is a list of commands you may use:
  165. *
  166. *   Buy
  167. *   - This is the buy item command.
  168. *
  169. *   Sell
  170. *   - This is the sell item command.
  171. *
  172. *   Equip
  173. *   - This is the equip command to directly access an actor's equipment.
  174. *
  175. *   Custom
  176. *   - If you have any custom shop menu items, they will be displayed here.
  177. *
  178. *   Cancel
  179. *   - This exits the shop.
  180. *
  181. * ============================================================================
  182. * Notetags
  183. * ============================================================================
  184. *
  185. * You can use the following notetag to alter various shop aspects
  186. *
  187. * Item, Weapon, and Armor Notetag:
  188. *
  189. *   <Price: x>
  190. *   This notetag allows you to exceed the default editor limit for item prices
  191. *   of 999,999 gold.
  192. *
  193. *   <Sell Price: x>
  194. *   This sets the selling price of the item to x.
  195. *
  196. *   <Cannot Sell>
  197. *   This makes it so that the item cannot be sold.
  198. *
  199. *   <Can Sell>
  200. *   This makes it so that the item can be sold even if it is at 0 gold.
  201. *
  202. * ============================================================================
  203. * Changelog
  204. * ============================================================================
  205. *
  206. * Version 1.05:
  207. * - Updated for RPG Maker MV version 1.5.0.
  208. *
  209. * Version 1.04:
  210. * - Compatibility Update with YEP_X_ItemPictureImg.js
  211. *
  212. * Version 1.03:
  213. * - Updated for RPG Maker MV version 1.1.0.
  214. *
  215. * Version 1.02:
  216. * - Fixed a visual bug that listed actor stats in the wrong order.
  217. *
  218. * Version 1.01a:
  219. * - Disabled LEFT/RIGHT movement from the status window while inputting an
  220. * item quantity to buy.
  221. * - Added a font reset on the number window upon refresh.
  222. * - Fixed a visual error with MP recovery displaying a 0 instead of ---.
  223. *
  224. * Version 1.00:
  225. * - Finished Plugin!
  226. */
  227. //=============================================================================

  228. //=============================================================================
  229. // Parameter Variables
  230. //=============================================================================

  231. Yanfly.Parameters = PluginManager.parameters('YEP_ShopMenuCore');
  232. Yanfly.Param = Yanfly.Param || {};

  233. Yanfly.Param.ShopCommandOrder = String(Yanfly.Parameters['Command Order']);
  234. Yanfly.Param.ShopListWidth = String(Yanfly.Parameters['Shop List Width']);
  235. Yanfly.Param.ShopCommandAlign = String(Yanfly.Parameters['Command Alignment']);

  236. Yanfly.Param.ShopDefaultMode = String(Yanfly.Parameters['Default Mode']);
  237. Yanfly.Param.ShopDefaultMode = Yanfly.Param.ShopDefaultMode.toLowerCase();
  238. Yanfly.Param.ShopStatSwitch = eval(String(Yanfly.Parameters['Stat Switching']));
  239. Yanfly.Param.ShopCantEquip = String(Yanfly.Parameters['Cannot Equip']);
  240. Yanfly.Param.ShopStatFontSize = Number(Yanfly.Parameters['Stat Font Size']);
  241. Yanfly.Param.ShopCantSize = Number(Yanfly.Parameters['Cannot Equip Font Size']);

  242. if (!Imported.YEP_ItemCore) {
  243.   Yanfly.Param.ItemFontSize = Number(Yanfly.Parameters['Font Size']);
  244.   Yanfly.Param.ItemShowIcon = String(Yanfly.Parameters['Show Icon']);
  245.   Yanfly.Param.ItemIconSize = Number(Yanfly.Parameters['Icon Size']);
  246.   Yanfly.Param.ItemRecoverFmt = String(Yanfly.Parameters['Recovery Format']);
  247.   Yanfly.Param.ItemAddState = String(Yanfly.Parameters['Add State']);
  248.   Yanfly.Param.ItemAddBuff = String(Yanfly.Parameters['Add Buff']);
  249.   Yanfly.Param.ItemRemoveState = String(Yanfly.Parameters['Remove State']);
  250.   Yanfly.Param.ItemRemoveBuff = String(Yanfly.Parameters['Remove Buff']);
  251.   Yanfly.Param.ItemMaxIcons = Number(Yanfly.Parameters['Maximum Icons']);
  252. };

  253. //=============================================================================
  254. // DataManager
  255. //=============================================================================

  256. Yanfly.Shop.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
  257. DataManager.isDatabaseLoaded = function() {
  258.   if (!Yanfly.Shop.DataManager_isDatabaseLoaded.call(this)) return false;
  259.   if (!Yanfly._loaded_YEP_ShopMenuCore) {
  260.     this.processShopNotetags($dataItems);
  261.     this.processShopNotetags($dataWeapons);
  262.     this.processShopNotetags($dataArmors);
  263.     Yanfly._loaded_YEP_ShopMenuCore = true;
  264.   }
  265.   return true;
  266. };

  267. DataManager.processShopNotetags = function(group) {
  268.   for (var n = 1; n < group.length; n++) {
  269.     var obj = group[n];
  270.     var notedata = obj.note.split(/[\r\n]+/);

  271.     obj.cannotSell = false;
  272.     obj.canSell = false;
  273.     obj.sellPrice = undefined;

  274.     for (var i = 0; i < notedata.length; i++) {
  275.       var line = notedata[i];
  276.       if (line.match(/<(?:PRICE):[ ](\d+)>/i)) {
  277.         obj.price = parseInt(RegExp.$1);
  278.       } else if (line.match(/<(?:SELL PRICE|SELLING PRICE):[ ](\d+)>/i)) {
  279.         obj.sellPrice = parseInt(RegExp.$1);
  280.       } else if (line.match(/<(?:CANNOT SELL)>/i)) {
  281.         obj.cannotSell = true;
  282.       } else if (line.match(/<(?:CAN SELL)>/i)) {
  283.         obj.canSell = true;
  284.       }
  285.     }
  286.   }
  287. };

  288. //=============================================================================
  289. // Game_Temp
  290. //=============================================================================

  291. Game_Temp.prototype.registerShopGoods = function() {
  292.     var scene = SceneManager._scene;
  293.     this._shopGoods = scene._goods;
  294.     this._shopPurchaseOnly = scene._purchaseOnly;
  295. };

  296. Game_Temp.prototype.clearShopGoods = function() {
  297.     this._shopGoods = undefined;
  298.     this._shopPurchaseOnly = undefined;
  299. };

  300. //=============================================================================
  301. // Window_ShopCommand
  302. //=============================================================================

  303. Window_ShopCommand.prototype.windowWidth = function() {
  304.     return 240;
  305. };

  306. Window_ShopCommand.prototype.maxCols = function() {
  307.     return 1;
  308. };

  309. Window_ShopCommand.prototype.numVisibleRows = function() {
  310.     return 4;
  311. };

  312. Window_ShopCommand.prototype.makeCommandList = function() {
  313.     this._commandOrder = Yanfly.Param.ShopCommandOrder.split(' ');
  314.     for (var i = 0; i < this._commandOrder.length; ++i) {
  315.       var command = this._commandOrder[i];
  316.       this.createCommand(command);
  317.     }
  318. };

  319. Window_ShopCommand.prototype.createCommand = function(command) {
  320.     command = command.toUpperCase();
  321.     if (command === 'BUY') {
  322.       this.addCommand(TextManager.buy, 'buy');
  323.     } else if (command === 'SELL') {
  324.       this.addCommand(TextManager.sell, 'sell', !this._purchaseOnly);
  325.     } else if (command === 'CANCEL') {
  326.       this.addCommand(TextManager.cancel, 'cancel');
  327.     } else if (['CUSTOM', 'ORIGINAL'].contains(command)) {
  328.       this.addCustomCommands();
  329.     } else if (command === 'EQUIP') {
  330.       this.addCommand(TextManager.equip, 'equip');
  331.     }
  332. };

  333. Window_ShopCommand.prototype.addCustomCommands = function() {
  334. };

  335. Window_ShopCommand.prototype.itemTextAlign = function() {
  336.     return Yanfly.Param.ShopCommandAlign;
  337. };

  338. //=============================================================================
  339. // Window_ShopInfo
  340. //=============================================================================

  341. function Window_ShopInfo() {
  342.     this.initialize.apply(this, arguments);
  343. }

  344. Window_ShopInfo.prototype = Object.create(Window_Base.prototype);
  345. Window_ShopInfo.prototype.constructor = Window_ShopInfo;

  346. Window_ShopInfo.prototype.initialize = function(x, y, width, height) {
  347.     Window_Base.prototype.initialize.call(this, x, y, width, height);
  348.     this._item = null;
  349.     this.deactivate();
  350.     this.refresh();
  351. };

  352. Window_ShopInfo.prototype.setItem = function(item) {
  353.     if (this._item === item) return;
  354.     this._item = item;
  355.     this.refresh();
  356. };

  357. Window_ShopInfo.prototype.refresh = function() {
  358.     this.contents.clear();
  359.     this.drawDarkRectEntries();
  360.     if (!this._item) return;
  361.     this.contents.fontSize = Yanfly.Param.ItemFontSize;
  362.     this.drawItemEntry();
  363. };

  364. Window_ShopInfo.prototype.drawDarkRectEntries = function() {
  365.     var rect = new Rectangle();
  366.     if (eval(Yanfly.Param.ItemShowIcon)) {
  367.       rect.width = Window_Base._faceWidth;
  368.       rect.height = Window_Base._faceHeight;
  369.       this.drawDarkRect(rect.x, rect.y, rect.width, rect.height);
  370.       rect.width = (this.contents.width - Window_Base._faceWidth) / 2;
  371.     } else {
  372.       rect.width = this.contents.width / 2;
  373.     }
  374.     rect.height = this.lineHeight();
  375.     for (var i = 0; i < 8; ++i) {
  376.       rect = this.getRectPosition(rect, i);
  377.       this.drawDarkRect(rect.x, rect.y, rect.width, rect.height);
  378.     }
  379. };

  380. Window_ShopInfo.prototype.drawDarkRect = function(dx, dy, dw, dh) {
  381.     var color = this.gaugeBackColor();
  382.     this.changePaintOpacity(false);
  383.     this.contents.fillRect(dx + 1, dy + 1, dw - 2, dh - 2, color);
  384.     this.changePaintOpacity(true);
  385. };

  386. Window_ShopInfo.prototype.getRectPosition = function(rect, i) {
  387.     if (i % 2 === 0) {
  388.       if (eval(Yanfly.Param.ItemShowIcon)) {
  389.         rect.x = Window_Base._faceWidth;
  390.       } else {
  391.         rect.x = 0;
  392.       }
  393.       rect.y = i / 2 * this.lineHeight();
  394.     } else {
  395.       if (eval(Yanfly.Param.ItemShowIcon)) {
  396.         rect.x = Window_Base._faceWidth + rect.width;
  397.       } else {
  398.         rect.x = rect.width;
  399.       }
  400.     }
  401.     return rect;
  402. };

  403. Window_ShopInfo.prototype.drawItemEntry = function() {
  404.     var item = this._item;
  405.     if (eval(Yanfly.Param.ItemShowIcon)) this.drawItemIcon(item);
  406.     if (DataManager.isItem(item)) this.drawItemInfo(item);
  407.     if (DataManager.isWeapon(item)) this.drawEquipInfo(item);
  408.     if (DataManager.isArmor(item)) this.drawEquipInfo(item);
  409. };

  410. Window_ShopInfo.prototype.drawItemIcon = function() {
  411.     this.drawLargeIcon();
  412. };

  413. if (Imported.YEP_X_ItemPictureImg) {

  414. Yanfly.IPI.Window_ShopInfo_drawItemIcon =
  415.   Window_ShopInfo.prototype.drawItemIcon;
  416. Window_ShopInfo.prototype.drawItemIcon = function() {
  417.   if (this.itemHasPictureImage()) {
  418.     this.readyItemPictureImage(this._item);
  419.   } else {
  420.     Yanfly.IPI.Window_ShopInfo_drawItemIcon.call(this);
  421.   }
  422. };

  423. Window_ShopInfo.prototype.itemHasPictureImage = function() {
  424.   if (!this._item) return false;
  425.   var filename = ItemManager.getItemPictureImageFilename(this._item);
  426.   return filename !== '';
  427. };

  428. Window_ShopInfo.prototype.readyItemPictureImage = function(item) {
  429.   if (item !== this._item) return;
  430.   var bitmap = ItemManager.getItemPictureImage(item);
  431.   if (bitmap.width <= 0) {
  432.     return setTimeout(this.readyItemPictureImage.bind(this, item), 250);
  433.   } else {
  434.     this.drawItemPictureImage(bitmap);
  435.   }
  436. };

  437. Window_ShopInfo.prototype.drawItemPictureImage = function(bitmap) {
  438.   var pw = bitmap.width;
  439.   var ph = bitmap.height;
  440.   var sx = 0;
  441.   var sy = 0;
  442.   var dw = pw;
  443.   var dh = ph;
  444.   if (dw > Yanfly.Param.ItemImageMaxWidth) {
  445.     var rate = Yanfly.Param.ItemImageMaxWidth / dw;
  446.     dw = Math.floor(dw * rate);
  447.     dh = Math.floor(dh * rate);
  448.   }
  449.   if (dh > Yanfly.Param.ItemImageMaxHeight) {
  450.     var rate = Yanfly.Param.ItemImageMaxHeight / dh;
  451.     dw = Math.floor(dw * rate);
  452.     dh = Math.floor(dh * rate);
  453.   }
  454.   var dx = (Window_Base._faceWidth - dw) / 2;
  455.   var dy = (Window_Base._faceHeight - dh) / 2;
  456.   this.contents.blt(bitmap, sx, sy, pw, ph, dx, dy, dw, dh);
  457. };

  458. }; // Imported.YEP_X_ItemPictureImg

  459. Window_ShopInfo.prototype.drawLargeIcon = function() {
  460.     var iconIndex = this._item.iconIndex;
  461.     var bitmap = ImageManager.loadSystem('IconSet');
  462.     var pw = Window_Base._iconWidth;
  463.     var ph = Window_Base._iconHeight;
  464.     var sx = iconIndex % 16 * pw;
  465.     var sy = Math.floor(iconIndex / 16) * ph;
  466.     var dw = Yanfly.Param.ItemIconSize;
  467.     var dh = Yanfly.Param.ItemIconSize;
  468.     var dx = (Window_Base._faceWidth - dw) / 2;
  469.     var dy = (Window_Base._faceHeight - dh) / 2;
  470.     this.contents._context.imageSmoothingEnabled = false;
  471.     this.contents.blt(bitmap, sx, sy, pw, ph, dx, dy, dw, dh);
  472.     this.contents._context.imageSmoothingEnabled = true;
  473. };

  474. Window_ShopInfo.prototype.drawEquipInfo = function(item) {
  475.     var rect = new Rectangle();
  476.     if (eval(Yanfly.Param.ItemShowIcon)) {
  477.       rect.width = (this.contents.width - Window_Base._faceWidth) / 2;
  478.     } else {
  479.       rect.width = this.contents.width / 2;
  480.     }
  481.     for (var i = 0; i < 8; ++i) {
  482.       rect = this.getRectPosition(rect, i);
  483.       var dx = rect.x + this.textPadding();
  484.       var dw = rect.width - this.textPadding() * 2;
  485.       this.changeTextColor(this.systemColor());
  486.       this.drawText(TextManager.param(i), dx, rect.y, dw);
  487.       this.changeTextColor(this.paramchangeTextColor(item.params[i]));
  488.       var text = Yanfly.Util.toGroup(item.params[i]);
  489.       if (item.params[i] >= 0) text = '+' + text;
  490.       if (text === '+0') this.changePaintOpacity(false);
  491.       this.drawText(text, dx, rect.y, dw, 'right');
  492.       this.changePaintOpacity(true);
  493.     }
  494. };

  495. Window_ShopInfo.prototype.drawItemInfo = function(item) {
  496.     var rect = new Rectangle();
  497.     if (eval(Yanfly.Param.ItemShowIcon)) {
  498.       rect.width = (this.contents.width - Window_Base._faceWidth) / 2;
  499.     } else {
  500.       rect.width = this.contents.width / 2;
  501.     }
  502.     for (var i = 0; i < 8; ++i) {
  503.       rect = this.getRectPosition(rect, i);
  504.       var dx = rect.x + this.textPadding();
  505.       var dw = rect.width - this.textPadding() * 2;
  506.       this.changeTextColor(this.systemColor());
  507.       var text = this.getItemInfoCategory(i);
  508.       this.drawText(text, dx, rect.y, dw);
  509.       this.drawItemData(i, dx, rect.y, dw);
  510.     }
  511. };

  512. Window_ShopInfo.prototype.getItemInfoCategory = function(i) {
  513.     var fmt = Yanfly.Param.ItemRecoverFmt;
  514.     if (i === 0) return fmt.format(TextManager.param(0));
  515.     if (i === 1) return fmt.format(TextManager.hp);
  516.     if (i === 2) return fmt.format(TextManager.param(1));
  517.     if (i === 3) return fmt.format(TextManager.mp);
  518.     if (i === 4) return Yanfly.Param.ItemAddState;
  519.     if (i === 5) return Yanfly.Param.ItemRemoveState;
  520.     if (i === 6) return Yanfly.Param.ItemAddBuff;
  521.     if (i === 7) return Yanfly.Param.ItemRemoveBuff;
  522.     return '';
  523. };

  524. Window_ShopInfo.prototype.drawItemData = function(i, dx, dy, dw) {
  525.     if (!this._item) return;
  526.     var effect;
  527.     var value = '---';
  528.     var pre = '';
  529.     var text = '';
  530.     var icons = [];
  531.     if (i === 0) {
  532.       effect = this.getEffect(Game_Action.EFFECT_RECOVER_HP);
  533.       value = (effect) ? effect.value1 : '---';
  534.       if (value === 0) value = '---';
  535.       if (value !== '---' && value !== 0) value *= 100;
  536.     }
  537.     if (i === 1) {
  538.       effect = this.getEffect(Game_Action.EFFECT_RECOVER_HP);
  539.       value = (effect) ? effect.value2 : '---';
  540.       if (value === 0) value = '---';
  541.     }
  542.     if (i === 2) {
  543.       effect = this.getEffect(Game_Action.EFFECT_RECOVER_MP);
  544.       value = (effect) ? effect.value1 : '---';
  545.       if (value === 0) value = '---';
  546.       if (value !== '---' && value !== 0) value *= 100;
  547.     }
  548.     if (i === 3) {
  549.       effect = this.getEffect(Game_Action.EFFECT_RECOVER_MP);
  550.       value = (effect) ? effect.value2 : '---';
  551.       if (value === 0) value = '---';
  552.     }
  553.     if (i >= 4) {
  554.       icons = this.getItemIcons(i, icons);
  555.     }
  556.     this.changeTextColor(this.normalColor());
  557.     if (value === '---') {
  558.       this.changePaintOpacity(false);
  559.     } else if (i < 4) {
  560.       if (value > 0) pre = '+';
  561.       value = Yanfly.Util.toGroup(parseInt(value));
  562.       if ([0, 2].contains(i)) text = '%';
  563.     }
  564.     if (icons.length > 0) {
  565.       this.changePaintOpacity(true);
  566.       dx = dx + dw - icons.length * Window_Base._iconWidth;
  567.       dx += this.textPadding() - 2;
  568.       for (var j = 0; j < icons.length; ++j) {
  569.         var icon = icons[j];
  570.         this.drawIcon(icon, dx, dy + 2);
  571.         dx += Window_Base._iconWidth;
  572.       }
  573.     } else {
  574.       text = pre + value + text;
  575.       this.drawText(text, dx, dy, dw, 'right');
  576.       this.changePaintOpacity(true);
  577.     }
  578. };

  579. Window_ShopInfo.prototype.getEffect = function(code) {
  580.     var targetEffect;
  581.     this._item.effects.forEach(function(effect) {
  582.       if (effect.code === code) targetEffect = effect;
  583.     }, this);
  584.     return targetEffect;
  585. };

  586. Window_ShopInfo.prototype.getItemIcons = function(i, array) {
  587.     this._item.effects.forEach(function(effect) {
  588.       if (i === 4 && effect.code === Game_Action.EFFECT_ADD_STATE) {
  589.         var state = $dataStates[effect.dataId];
  590.         if (state && state.iconIndex !== 0) array.push(state.iconIndex);
  591.       }
  592.       if (i === 5 && effect.code === Game_Action.EFFECT_REMOVE_STATE) {
  593.         var state = $dataStates[effect.dataId];
  594.         if (state && state.iconIndex !== 0) array.push(state.iconIndex);
  595.       }
  596.       if (i === 6 && effect.code === Game_Action.EFFECT_ADD_BUFF) {
  597.         var icon = Game_BattlerBase.ICON_BUFF_START + effect.dataId;
  598.         array.push(icon);
  599.       }
  600.       if (i === 6 && effect.code === Game_Action.EFFECT_ADD_DEBUFF) {
  601.         var icon = Game_BattlerBase.ICON_DEBUFF_START + effect.dataId;
  602.         array.push(icon);
  603.       }
  604.       if (i === 7 && effect.code === Game_Action.EFFECT_REMOVE_BUFF) {
  605.         var icon = Game_BattlerBase.ICON_BUFF_START + effect.dataId;
  606.         array.push(icon);
  607.       }
  608.       if (i === 7 && effect.code === Game_Action.EFFECT_REMOVE_DEBUFF) {
  609.         var icon = Game_BattlerBase.ICON_DEBUFF_START + effect.dataId;
  610.         array.push(icon);
  611.       }
  612.     }, this);
  613.     array = array.slice(0, Yanfly.Param.ItemMaxIcons);
  614.     return array;
  615. };

  616. //=============================================================================
  617. // Window_ShopNumber
  618. //=============================================================================

  619. Window_ShopNumber.prototype.windowWidth = function() {
  620.     return Math.ceil(eval(Yanfly.Param.ShopListWidth));
  621. };

  622. Window_ShopNumber.prototype.refresh = function() {
  623.     this.contents.clear();
  624.     this._index = 0;
  625.     this.resetFontSettings();
  626.     this.drawItemName(this._item, 0, this.lineHeight(), this.contents.width);
  627.     this.drawMultiplicationSign();
  628.     this.drawNumber();
  629.     this.drawTotalPrice();
  630. };

  631. Window_ShopNumber.prototype.itemY = function() {
  632.     return this.lineHeight() * 2;
  633. };

  634. Window_ShopNumber.prototype.drawTotalPrice = function() {
  635.     var ww = this.contents.width - this.textPadding();
  636.     var wy = this.itemY();
  637.     this.drawHorzLine(this.lineHeight() * 3);
  638.     this.drawTotalCurrency(ww, wy + this.lineHeight() * 1);
  639.     this.drawTotalCost(ww, wy + this.lineHeight() * 2);
  640.     this.drawHorzLine(wy + this.lineHeight() * 3);
  641.     this.drawTotalAfter(ww, wy + this.lineHeight() * 3);
  642. };

  643. Window_ShopNumber.prototype.drawTotalCurrency = function(ww, wy) {
  644.     var value = Yanfly.Util.toGroup(this.getTotalCurrency());
  645.     this.drawCurrencyValue(value, this._currencyUnit, 0, wy, ww);
  646. };

  647. Window_ShopNumber.prototype.getTotalCurrency = function() {
  648.     if (this._currencyUnit === TextManager.currencyUnit) {
  649.       return $gameParty.gold();
  650.     }
  651.     return 0;
  652. };

  653. Window_ShopNumber.prototype.drawTotalCost = function(ww, wy) {
  654.     var value = this._price * this._number;
  655.     if (!this.isSelling()) value *= -1;
  656.     value = Yanfly.Util.toGroup(value);
  657.     if (this.isSelling()) value = '+' + value;
  658.     this.drawCurrencyValue(value, this._currencyUnit, 0, wy, ww);
  659. };

  660. Window_ShopNumber.prototype.drawHorzLine = function(y) {
  661.   this.contents.paintOpacity = 128;
  662.   this.contents.fillRect(0, y, this.contentsWidth(), 2, this.normalColor());
  663.   this.contents.paintOpacity = 255;
  664. };

  665. Window_ShopNumber.prototype.drawTotalAfter = function(ww, wy) {
  666.     var value = this.getTotalCurrency();
  667.     value += (this._price * this._number) * (!this.isSelling() ? -1 : 1);
  668.     value = Yanfly.Util.toGroup(value);
  669.     this.drawCurrencyValue(value, this._currencyUnit, 0, wy, ww);
  670. };

  671. Window_ShopNumber.prototype.isSelling = function() {
  672.     var scene = SceneManager._scene;
  673.     return scene.isSelling();
  674. };

  675. Window_ShopNumber.prototype.cursorWidth = function() {
  676.     this.resetFontSettings();
  677.     var item = this._item
  678.     if (this._item && this._item.proxyBuy) {
  679.       var id = this._item.proxyBuy;
  680.       if (DataManager.isItem(this._item)) item = $dataItems[id];
  681.       if (DataManager.isWeapon(this._item)) item = $dataWeapons[id];
  682.       if (DataManager.isArmor(this._item)) item = $dataArmors[id];
  683.     }
  684.     var value = $gameParty.maxItems(item);
  685.     var digitWidth = this.textWidth(Yanfly.Util.toGroup(value));
  686.     return digitWidth + this.textPadding() * 2;
  687. };

  688. //=============================================================================
  689. // Window_ShowBuy
  690. //=============================================================================

  691. Window_ShopBuy.prototype.windowWidth = function() {
  692.     return Math.ceil(eval(Yanfly.Param.ShopListWidth));
  693. };

  694. Window_ShopBuy.prototype.setInfoWindow = function(infoWindow) {
  695.     this._infoWindow = infoWindow;
  696.     this.callUpdateHelp();
  697. };

  698. Yanfly.Shop.Window_ShopBuy_updateHelp = Window_ShopBuy.prototype.updateHelp;
  699. Window_ShopBuy.prototype.updateHelp = function() {
  700.     Yanfly.Shop.Window_ShopBuy_updateHelp.call(this);
  701.     if (this._infoWindow) this._infoWindow.setItem(this.item());
  702. };

  703. //=============================================================================
  704. // Window_ShopCategory
  705. //=============================================================================

  706. function Window_ShopCategory() {
  707.     this.initialize.apply(this, arguments);
  708. }

  709. Window_ShopCategory.prototype = Object.create(Window_ItemCategory.prototype);
  710. Window_ShopCategory.prototype.constructor = Window_ShopCategory;

  711. Window_ShopCategory.prototype.initialize = function() {
  712.     Window_ItemCategory.prototype.initialize.call(this);
  713. };

  714. Window_ShopCategory.prototype.windowWidth = function() {
  715.     return 240;
  716. };

  717. Window_ShopCategory.prototype.numVisibleRows = function() {
  718.     return 4;
  719. };

  720. Window_ShopCategory.prototype.maxCols = function() {
  721.     return 1;
  722. };

  723. Window_ShopCategory.prototype.itemTextAlign = function() {
  724.     return Yanfly.Param.ShopCommandAlign;
  725. };

  726. //=============================================================================
  727. // Window_ShopBuy
  728. //=============================================================================

  729. Window_ShopBuy.prototype.drawItem = function(index) {
  730.     var item = this._data[index];
  731.     var rect = this.itemRect(index);
  732.     rect.width -= this.textPadding();
  733.     this.changePaintOpacity(this.isEnabled(item));
  734.     this.drawBuyItem(item, rect);
  735.     this.drawBuyPrice(item, rect);
  736.     this.changePaintOpacity(true);
  737.     this.resetFontSettings();
  738. };

  739. Window_ShopBuy.prototype.drawBuyItem = function(item, rect) {
  740.     this.drawItemName(item, rect.x, rect.y, rect.width);
  741. };

  742. Window_ShopBuy.prototype.drawBuyPrice = function(item, rect) {
  743.     if (Imported.YEP_CoreEngine) {
  744.       this.contents.fontSize = Yanfly.Param.GoldFontSize;
  745.     }
  746.     var itemPrice = Yanfly.Util.toGroup(this.price(item));
  747.     this.drawCurrencyValue(itemPrice, this.currencyUnit(), rect.x, rect.y,
  748.         rect.width);
  749. };

  750. Window_ShopBuy.prototype.currencyUnit = function() {
  751.     return TextManager.currencyUnit;
  752. };

  753. //=============================================================================
  754. // Window_ShopSell
  755. //=============================================================================

  756. Window_ShopSell.prototype.maxCols = function() {
  757.     return 1;
  758. };

  759. Window_ShopSell.prototype.setInfoWindow = function(infoWindow) {
  760.     this._infoWindow = infoWindow;
  761.     this.callUpdateHelp();
  762. };

  763. Window_ShopSell.prototype.setStatusWindow = function(statusWindow) {
  764.     this._statusWindow = statusWindow;
  765.     this.callUpdateHelp();
  766. };

  767. Yanfly.Shop.Window_ShopSell_updateHelp = Window_ShopSell.prototype.updateHelp;
  768. Window_ShopSell.prototype.updateHelp = function() {
  769.     Yanfly.Shop.Window_ShopSell_updateHelp.call(this);
  770.     if (this._infoWindow) this._infoWindow.setItem(this.item());
  771.     if (this._statusWindow) this._statusWindow.setItem(this.item());
  772. };

  773. Yanfly.Shop.Window_ShopSell_isEnabled = Window_ShopSell.prototype.isEnabled;
  774. Window_ShopSell.prototype.isEnabled = function(item) {
  775.     if (item) {
  776.       if ($gamePlayer.isDebugThrough()) return true;
  777.       if (item.cannotSell) return false;
  778.       if (item.canSell) return true;
  779.     }
  780.     return Yanfly.Shop.Window_ShopSell_isEnabled.call(this, item);
  781. };

  782. //=============================================================================
  783. // Window_ShopStatus
  784. //=============================================================================

  785. Yanfly.Shop.Window_ShopStatus_initialize =
  786.     Window_ShopStatus.prototype.initialize;
  787. Window_ShopStatus.prototype.initialize = function(x, y, width, height) {
  788.     Yanfly.Shop.Window_ShopStatus_initialize.call(this, x, y, width, height);
  789.     if (Yanfly.Param.ShopStatSwitch) this._paramId = 2;
  790.     this._displayMode = Yanfly.Param.ShopDefaultMode;
  791.     this._actorIndex = 0;
  792.     this._maxActorIndex = $gameParty.members().length - 1;
  793.     this._clickZoneX = this.textWidth('<<') + this.standardPadding();
  794.     this._clickZoneY = this.standardPadding() + this.lineHeight() * 2;
  795. };

  796. Window_ShopStatus.prototype.displayMode = function() {
  797.     return this._displayMode;
  798. };

  799. Window_ShopStatus.prototype.setDisplayMode = function(mode) {
  800.     this._displayMode = mode;
  801. };

  802. Window_ShopStatus.prototype.isDefaultMode = function() {
  803.     return this.displayMode() === 'default';
  804. };

  805. Window_ShopStatus.prototype.isActorMode = function() {
  806.     return this.displayMode() === 'actor';
  807. };

  808. Window_ShopStatus.prototype.refresh = function() {
  809.     this.contents.clear();
  810.     if (!this._item) return;
  811.     this.resetTextColor();
  812.     this.resetFontSettings();
  813.     var x = this.textPadding();
  814.     this.drawPossession(x, 0);
  815.     if (!this.isEquipItem()) return;
  816.     this.resetTextColor();
  817.     this.resetFontSettings();
  818.     if (this.isDefaultMode()) this.drawDefaultData();
  819.     if (this.isActorMode()) this.drawActorData();
  820. };

  821. Window_ShopStatus.prototype.drawDefaultData = function() {
  822.     this.drawStatDisplayed();
  823.     this.drawEquipInfo(this.textPadding(), this.lineHeight() * 2);
  824. };

  825. Window_ShopStatus.prototype.drawStatDisplayed = function() {
  826.     var paramId = this.paramId();
  827.     var text = TextManager.param(paramId);
  828.     this.changeTextColor(this.normalColor());
  829.     this.drawText(text, 0, this.lineHeight(), this.contents.width, 'center');
  830.     if (!Yanfly.Param.ShopStatSwitch) return;
  831.     this.changeTextColor(this.systemColor());
  832.     var text = '<<';
  833.     this.drawText(text, 0, this.lineHeight(), this.contents.width, 'left');
  834.     var text = '>>';
  835.     this.drawText(text, 0, this.lineHeight(), this.contents.width, 'right');
  836. };

  837. Window_ShopStatus.prototype.drawActorData = function() {
  838.     var actor = this.getActor();
  839.     this.drawActorDisplayed(actor);
  840.     this.drawDarkRectEntries();
  841.     this.drawActorStatInfo(actor);
  842. };

  843. Window_ShopStatus.prototype.getActor = function() {
  844.     return $gameParty.members()[this._actorIndex];
  845. };

  846. Window_ShopStatus.prototype.drawActorDisplayed = function(actor) {
  847.     var text = actor.name();
  848.     this.changeTextColor(this.normalColor());
  849.     this.drawText(text, 0, this.lineHeight(), this.contents.width, 'center');
  850.     this.changeTextColor(this.systemColor());
  851.     var text = '<<';
  852.     this.drawText(text, 0, this.lineHeight(), this.contents.width, 'left');
  853.     var text = '>>';
  854.     this.drawText(text, 0, this.lineHeight(), this.contents.width, 'right');
  855. };

  856. Window_ShopStatus.prototype.drawDarkRectEntries = function() {
  857.     for (var i = 0; i < 8; ++i) {
  858.       var rect = this.getRectPosition(i);
  859.       this.drawDarkRect(rect.x, rect.y, rect.width, rect.height);
  860.     }
  861. };

  862. Window_ShopStatus.prototype.getRectPosition = function(index) {
  863.     var rect = new Rectangle();
  864.     rect.width = Math.floor(this.contents.width / 2);
  865.     rect.height = this.lineHeight();
  866.     rect.x = index % 2 === 0 ? 0 : rect.width;
  867.     rect.y = Math.floor(index / 2) * this.lineHeight() + this.lineHeight() * 2;
  868.     return rect;
  869. };

  870. Window_ShopStatus.prototype.drawDarkRect = function(dx, dy, dw, dh) {
  871.     var color = this.gaugeBackColor();
  872.     this.changePaintOpacity(false);
  873.     this.contents.fillRect(dx + 1, dy + 1, dw - 2, dh - 2, color);
  874.     this.changePaintOpacity(true);
  875. };

  876. Window_ShopStatus.prototype.drawActorStatInfo = function(actor) {
  877.     this.contents.fontSize = Yanfly.Param.ShopStatFontSize;
  878.     var item1 = this.currentEquippedItem(actor, this._item.etypeId);
  879.     var canEquip = actor.canEquip(this._item);
  880.     for (var i = 0; i < 8; ++i) {
  881.       this.changePaintOpacity(true);
  882.       var rect = this.getRectPosition(i);
  883.       rect.x += this.textPadding();
  884.       rect.width -= this.textPadding() * 2;
  885.       this.changeTextColor(this.systemColor());
  886.       var text = TextManager.param(i);
  887.       this.drawText(text, rect.x, rect.y, rect.width);
  888.       if (!canEquip) this.drawActorCantEquip(actor, rect);
  889.       if (canEquip) this.drawActorChange(actor, rect, item1, i);
  890.     }
  891.     this.changePaintOpacity(true);
  892. };

  893. Window_ShopStatus.prototype.drawActorCantEquip = function(actor, rect) {
  894.     this.changePaintOpacity(false);
  895.     this.resetTextColor();
  896.     this.contents.fontSize = Yanfly.Param.ShopCantSize;
  897.     var text = '-';
  898.     this.drawText(text, rect.x, rect.y, rect.width, 'right');
  899. };

  900. Window_ShopStatus.prototype.drawActorChange = function(actor, rect, item1, i) {
  901.     var change = this._item.params[i]
  902.     change -= (item1 ? item1.params[i] : 0);
  903.     this.changePaintOpacity(change !== 0);
  904.     this.changeTextColor(this.paramchangeTextColor(change));
  905.     var text = (change > 0 ? '+' : '') + Yanfly.Util.toGroup(change);
  906.     this.drawText(text, rect.x, rect.y, rect.width, 'right');
  907. };

  908. Window_ShopStatus.prototype.drawEquipInfo = function(x, y) {
  909.     var members = this.statusMembers();
  910.     for (var i = 0; i < members.length; i++) {
  911.       var wy = y;
  912.       wy += i * this.lineHeight();
  913.       this.drawActorEquipInfo(x, wy, members[i]);
  914.     }
  915. };

  916. Window_ShopStatus.prototype.drawActorEquipInfo = function(x, y, actor) {
  917.     var enabled = actor.canEquip(this._item);
  918.     this.changePaintOpacity(enabled);
  919.     this.resetTextColor();
  920.     this.resetFontSettings();
  921.     this.drawText(actor.name(), x, y, this.contents.width - x);
  922.     var item1 = this.currentEquippedItem(actor, this._item.etypeId);
  923.     if (enabled) {
  924.       this.contents.fontSize = Yanfly.Param.ShopStatFontSize;
  925.       this.drawActorParamChange(x, y, actor, item1);
  926.     } else {
  927.       this.contents.fontSize = Yanfly.Param.ShopCantSize;
  928.       var ww = this.contents.width - this.textPadding();
  929.       this.drawText(Yanfly.Param.ShopCantEquip, x, y, ww, 'right');
  930.     }
  931.     this.changePaintOpacity(true);
  932. };

  933. Window_ShopStatus.prototype.drawActorParamChange =
  934. function(x, y, actor, item1) {
  935.     var width = this.contents.width - this.textPadding() - x;
  936.     var paramId = this.paramId();
  937.     var change = this._item.params[paramId]
  938.     change -= (item1 ? item1.params[paramId] : 0);
  939.     this.changeTextColor(this.paramchangeTextColor(change));
  940.     var text = (change > 0 ? '+' : '') + Yanfly.Util.toGroup(change);
  941.     this.drawText(text, x, y, width, 'right');
  942. };

  943. Yanfly.Shop.Window_ShopStatus_update = Window_ShopStatus.prototype.update;
  944. Window_ShopStatus.prototype.update = function() {
  945.     Yanfly.Shop.Window_ShopStatus_update.call(this);
  946.     if (this.isUpdateTrigger()) this.updateParamSwitch();
  947. };

  948. Window_ShopStatus.prototype.isUpdateTrigger = function() {
  949.     if (this.isDefaultMode() && Yanfly.Param.ShopStatSwitch) return true;
  950.     if (this.isActorMode()) return true;
  951.     return false;
  952. };

  953. Window_ShopStatus.prototype.updateParamSwitch = function() {
  954.     if (!this.isEquipItem()) return;
  955.     if (this.isTouched(-1) || this.getInput('left')) {
  956.       SoundManager.playCursor();
  957.       this.adjustLeft();
  958.       this.refresh();
  959.     } else if (this.isTouched(1) || this.getInput('right')) {
  960.       SoundManager.playCursor();
  961.       this.adjustRight();
  962.       this.refresh();
  963.     } else if (Input.isRepeated('tab') || this.isTouched(0)) {
  964.       SoundManager.playCursor();
  965.       this.adjustMode();
  966.       this.refresh();
  967.     }
  968. };

  969. Window_ShopStatus.prototype.getInput = function(input) {
  970.     if (SceneManager._scene._numberWindow.active) return false;
  971.     return Input.isRepeated(input)
  972. };

  973. Window_ShopStatus.prototype.adjustLeft = function() {
  974.     if (this.isDefaultMode()) {
  975.       this._paramId -= 1;
  976.       if (this._paramId < 0) this._paramId = 7;
  977.     } else if (this.isActorMode()) {
  978.       this._actorIndex -= 1;
  979.       if (this._actorIndex < 0) this._actorIndex = this._maxActorIndex;
  980.     }
  981. };

  982. Window_ShopStatus.prototype.adjustRight = function() {
  983.     if (this.isDefaultMode()) {
  984.       this._paramId += 1;
  985.       if (this._paramId > 7) this._paramId = 0;
  986.     } else if (this.isActorMode()) {
  987.       this._actorIndex += 1;
  988.       if (this._actorIndex > this._maxActorIndex) this._actorIndex = 0;
  989.     }
  990. };

  991. Window_ShopStatus.prototype.adjustMode = function() {
  992.     if (this.isDefaultMode()) {
  993.       this.setDisplayMode('actor');
  994.     } else if (this.isActorMode()) {
  995.       this.setDisplayMode('default');
  996.     }
  997. };

  998. Window_ShopStatus.prototype.isTouched = function(position) {
  999.     if (!TouchInput.isTriggered()) return false;
  1000.     if (!this.isTouchedInsideFrame()) return false;
  1001.     var y = this.canvasToLocalY(TouchInput.y);
  1002.     if (y > this._clickZoneY) return false;
  1003.     var x = this.canvasToLocalX(TouchInput.x);
  1004.     if (position === -1 && x < this._clickZoneX) return true;
  1005.     if (position === 1 && x > this.width - this._clickZoneX) return true;
  1006.     if (position === 0) return true;
  1007.     return false;
  1008. };

  1009. Yanfly.Shop.Window_ShopStatus_paramId = Window_ShopStatus.prototype.paramId;
  1010. Window_ShopStatus.prototype.paramId = function() {
  1011.     if (Yanfly.Param.ShopStatSwitch) return this._paramId;
  1012.     return Yanfly.Shop.Window_ShopStatus_paramId.call(this);
  1013. };

  1014. Window_ShopStatus.prototype.isPageChangeRequested = function() {
  1015.     if (Input.isTriggered('shift')) return true;
  1016.     return false;
  1017. };

  1018. //=============================================================================
  1019. // Scene_Shop
  1020. //=============================================================================

  1021. Scene_Shop.prototype.failSafeGoods = function() {
  1022.   if (this._goods === undefined) {
  1023.     var goods = $gameTemp._shopGoods;
  1024.     var purchaseOnly = $gameTemp._shopPurchaseOnly;
  1025.     this.prepare(goods, purchaseOnly);
  1026.   }
  1027.   $gameTemp.clearShopGoods();
  1028. };

  1029. Scene_Shop.prototype.create = function() {
  1030.     Scene_MenuBase.prototype.create.call(this);
  1031.     this.failSafeGoods();
  1032.     this.createHelpWindow();
  1033.     this.createCommandWindow();
  1034.     this.createInfoWindow();
  1035.     this.createDummyWindow();
  1036.     this.createNumberWindow();
  1037.     this.createBuyWindow();
  1038.     this.createCategoryWindow();
  1039.     this.createSellWindow();
  1040.     this.createGoldWindow();
  1041.     this.createStatusWindow();
  1042.     this.createActorWindow();
  1043. };

  1044. Scene_Shop.prototype.createCommandWindow = function() {
  1045.     this._commandWindow = new Window_ShopCommand(0, this._purchaseOnly);
  1046.     this._commandWindow.y = this._helpWindow.height;
  1047.     this.addWindow(this._commandWindow);
  1048.     this.setCommandWindowHandlers();
  1049. };

  1050. Scene_Shop.prototype.setCommandWindowHandlers = function() {
  1051.     this._commandWindow.setHandler('buy',    this.commandBuy.bind(this));
  1052.     this._commandWindow.setHandler('sell',   this.commandSell.bind(this));
  1053.     this._commandWindow.setHandler('cancel', this.popScene.bind(this));
  1054.     this._commandWindow.setHandler('equip',  this.commandEquip.bind(this));
  1055. };

  1056. Scene_Shop.prototype.createInfoWindow = function() {
  1057.     var wx = this._commandWindow.width;
  1058.     var wy = this._commandWindow.y;
  1059.     var ww = Graphics.boxWidth - wx;
  1060.     var wh = this._commandWindow.height;
  1061.     this._infoWindow = new Window_ShopInfo(wx, wy, ww, wh);
  1062.     this.addWindow(this._infoWindow);
  1063. };

  1064. Scene_Shop.prototype.createDummyWindow = function() {
  1065.     var wy = this._commandWindow.y + this._commandWindow.height;
  1066.     var wh = Graphics.boxHeight - wy;
  1067.     var ww = Math.ceil(eval(Yanfly.Param.ShopListWidth));
  1068.     this._dummyWindow = new Window_Base(0, wy, ww, wh);
  1069.     this.addWindow(this._dummyWindow);
  1070. };

  1071. Scene_Shop.prototype.createBuyWindow = function() {
  1072.     var wy = this._dummyWindow.y;
  1073.     var wh = this._dummyWindow.height;
  1074.     this._buyWindow = new Window_ShopBuy(0, wy, wh, this._goods);
  1075.     this._buyWindow.setHelpWindow(this._helpWindow);
  1076.     this._buyWindow.setInfoWindow(this._infoWindow);
  1077.     this._buyWindow.hide();
  1078.     this._buyWindow.setHandler('ok',     this.onBuyOk.bind(this));
  1079.     this._buyWindow.setHandler('cancel', this.onBuyCancel.bind(this));
  1080.     this.addWindow(this._buyWindow);
  1081. };

  1082. Scene_Shop.prototype.createCategoryWindow = function() {
  1083.     this._categoryWindow = new Window_ShopCategory();
  1084.     this._categoryWindow.setHelpWindow(this._helpWindow);
  1085.     this._categoryWindow.y = this._commandWindow.y;
  1086.     this._categoryWindow.hide();
  1087.     this._categoryWindow.deactivate();
  1088.     this._categoryWindow.setHandler('ok',     this.onCategoryOk.bind(this));
  1089.     this._categoryWindow.setHandler('cancel', this.onCategoryCancel.bind(this));
  1090.     this.addWindow(this._categoryWindow);
  1091. };

  1092. Scene_Shop.prototype.createSellWindow = function() {
  1093.     var wy = this._dummyWindow.y;
  1094.     var ww = this._dummyWindow.width;
  1095.     var wh = this._dummyWindow.height;
  1096.     this._sellWindow = new Window_ShopSell(0, wy, ww, wh);
  1097.     this._sellWindow.setHelpWindow(this._helpWindow);
  1098.     this._sellWindow.hide();
  1099.     this._sellWindow.setInfoWindow(this._infoWindow);
  1100.     this._sellWindow.setHandler('ok',     this.onSellOk.bind(this));
  1101.     this._sellWindow.setHandler('cancel', this.onSellCancel.bind(this));
  1102.     this._categoryWindow.setItemWindow(this._sellWindow);
  1103.     this.addWindow(this._sellWindow);
  1104. };

  1105. Scene_Shop.prototype.createGoldWindow = function() {
  1106.     this._goldWindow = new Window_Gold(0, 0);
  1107.     this._goldWindow.x = this._buyWindow.width;
  1108.     this._goldWindow.y = Graphics.boxHeight - this._goldWindow.height;
  1109.     this._goldWindow.width = Graphics.boxWidth - this._goldWindow.x;
  1110.     this._goldWindow.createContents();
  1111.     this._goldWindow.refresh();
  1112.     this.addWindow(this._goldWindow);
  1113. };

  1114. Scene_Shop.prototype.createStatusWindow = function() {
  1115.     var wx = this._dummyWindow.width;
  1116.     var wy = this._dummyWindow.y;
  1117.     var ww = Graphics.boxWidth - wx;
  1118.     var wh = this._dummyWindow.height - this._goldWindow.height;
  1119.     this._statusWindow = new Window_ShopStatus(wx, wy, ww, wh);
  1120.     this.addWindow(this._statusWindow);
  1121.     this._buyWindow.setStatusWindow(this._statusWindow);
  1122.     this._sellWindow.setStatusWindow(this._statusWindow);
  1123. };

  1124. Yanfly.Shop.Scene_Shop_onBuyCancel = Scene_Shop.prototype.onBuyCancel;
  1125. Scene_Shop.prototype.onBuyCancel = function() {
  1126.     Yanfly.Shop.Scene_Shop_onBuyCancel.call(this);
  1127.     this._statusWindow.show();
  1128.     this._infoWindow.setItem(null);
  1129. };

  1130. Scene_Shop.prototype.doBuy = function(number) {
  1131.     if (Imported.YEP_ItemCore) $gameTemp.enableVarianceStock();
  1132.     this.doBuyGold(number);
  1133.     this.doBuyItem(number);
  1134.     if (Imported.YEP_ItemCore) $gameTemp.disableVarianceStock();
  1135. };

  1136. Scene_Shop.prototype.doBuyGold = function(number) {
  1137.     $gameParty.loseGold(number * this.buyingPrice());
  1138. };

  1139. Scene_Shop.prototype.doBuyItem = function(number) {
  1140.     $gameParty.gainItem(this._item, number);
  1141. };

  1142. Scene_Shop.prototype.doSell = function(number) {
  1143.     this.doSellGold(number);
  1144.     this.doSellItem(number);
  1145.     if (!Imported.YEP_ItemCore) return;
  1146.     if (!DataManager.isIndependent(this._item)) return;
  1147.     DataManager.removeIndependentItem(this._item);
  1148. };

  1149. Scene_Shop.prototype.doSellGold = function(number) {
  1150.     $gameParty.gainGold(number * this.sellingPrice());
  1151. };

  1152. Scene_Shop.prototype.doSellItem = function(number) {
  1153.     $gameParty.loseItem(this._item, number);
  1154. };

  1155. Yanfly.Shop.Scene_Shop_activateSellWindow =
  1156.     Scene_Shop.prototype.activateSellWindow;
  1157. Scene_Shop.prototype.activateSellWindow = function() {
  1158.     Yanfly.Shop.Scene_Shop_activateSellWindow.call(this);
  1159.     this._statusWindow.show();
  1160. };

  1161. Yanfly.Shop.Scene_Shop_onSellCancel = Scene_Shop.prototype.onSellCancel;
  1162. Scene_Shop.prototype.onSellCancel = function() {
  1163.     Yanfly.Shop.Scene_Shop_onSellCancel.call(this);
  1164.     this._infoWindow.setItem(null);
  1165. };

  1166. Scene_Shop.prototype.isSelling = function() {
  1167.     return this._commandWindow.currentSymbol() === 'sell';
  1168. };

  1169. Scene_Shop.prototype.createActorWindow = function() {
  1170.     this._actorWindow = new Window_MenuActor();
  1171.     this._actorWindow.setHandler('ok',     this.onActorOk.bind(this));
  1172.     this._actorWindow.setHandler('cancel', this.onActorCancel.bind(this));
  1173.     this.addWindow(this._actorWindow);
  1174. };

  1175. Scene_Shop.prototype.commandEquip = function() {  
  1176.     this._actorWindow.activate();
  1177.     this._actorWindow.show();
  1178.     this._actorWindow.select(0);
  1179. };

  1180. Scene_Shop.prototype.onActorOk = function() {
  1181.     this.onActorCommon();
  1182.     if (this._commandWindow.currentSymbol() === 'equip') {
  1183.       SceneManager.push(Scene_Equip);
  1184.     }
  1185. };

  1186. Scene_Shop.prototype.onActorCancel = function() {
  1187.     this._actorWindow.hide();
  1188.     this._actorWindow.deselect();
  1189.     this._commandWindow.activate();
  1190. };

  1191. Scene_Shop.prototype.onActorCommon = function() {
  1192.     $gameTemp.registerShopGoods();
  1193.     var index = this._actorWindow.index();
  1194.     var actor = $gameParty.members()[index];
  1195.     $gameParty.setMenuActor(actor);
  1196.     SoundManager.playOk();
  1197. };

  1198. Yanfly.Shop.Scene_Shop_sellingPrice = Scene_Shop.prototype.sellingPrice;
  1199. Scene_Shop.prototype.sellingPrice = function() {
  1200.     if (this._item && this._item.sellPrice !== undefined) {
  1201.       return this._item.sellPrice;
  1202.     }
  1203.     return Yanfly.Shop.Scene_Shop_sellingPrice.call(this);
  1204. };

  1205. //=============================================================================
  1206. // Utilities
  1207. //=============================================================================

  1208. Yanfly.Util = Yanfly.Util || {};

  1209. if (!Yanfly.Util.toGroup) {
  1210.     Yanfly.Util.toGroup = function(inVal) {
  1211.         return inVal;
  1212.     }
  1213. };

  1214. //=============================================================================
  1215. // End of File
  1216. //=============================================================================
复制代码
h
头像被屏蔽
梦石
0
星屑
19365
在线时间
36 小时
注册时间
2018-8-30
回帖
9
发表于 2018-8-30 18:14:41 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

梦石
0
星屑
3074
在线时间
685 小时
注册时间
2018-6-1
回帖
253
发表于 2018-8-30 18:16:31 | 显示全部楼层
关掉菜单的金钱窗口倒是很简单 直接注释掉
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部