查看: 2274|回复: 11

[有事请教] 求助~MOG_SceneItem增加道具欄問題

[复制链接]
梦石
0
星屑
3465
在线时间
359 小时
注册时间
2017-5-3
回帖
45
发表于 2019-7-2 10:08:27 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 oscar1543689 于 2019-7-2 10:08 编辑

我在MOG_SceneItem的基礎上,成功增加了道具欄。但是新增的道具欄下卻無法顯示任何物品,這到底是出了甚麼問題呢?求助各位大神解答

以下是我修改的代碼
我在PLUGIN PARAMETERS,loadBitmapscreate ,Buttons,addCatIndex,Includes都修改了些參數
是成功新增了道具欄,但卻不顯示任何物品。


  1. //=============================================================================
  2. // MOG_SceneItem.js
  3. //=============================================================================

  4. /*:
  5. * @plugindesc (v1.1) Modifica a cena de menu de items.
  6. * @author Moghunter
  7. *
  8. * @param Item Width
  9. * @desc Largura da janela de items.
  10. * @default 370
  11. *
  12. * @param Item Height
  13. * @desc Altura da janela de items.
  14. * @default 400
  15. *
  16. * @param Item X-Axis
  17. * @desc Definição X-Axis da janela de items.
  18. * @default 0
  19. *
  20. * @param Item Y-Axis
  21. * @desc Definição Y-Axis da janela de items.
  22. * @default 96
  23. *
  24. * @param W Layout X-Axis
  25. * @desc Definição X-Axis do layout janela de items.
  26. * @default 0
  27. *
  28. * @param W Layout Y-Axis
  29. * @desc Definição Y-Axis do layout janela de items.
  30. * @default 0
  31. *
  32. * @param Help X-Axis
  33. * @desc Definição X-Axis da janela de ajuda.
  34. * @default 0
  35. *
  36. * @param Help Y-Axis
  37. * @desc Definição Y-Axis da janela de ajuda.
  38. * @default 516
  39. *
  40. * @param Com Item X-Axis
  41. * @desc Definição X-Axis do comando Item.
  42. * @default 280
  43. *
  44. * @param Com Item Y-Axis
  45. * @desc Definição Y-Axis do comando Item.
  46. * @default 50
  47. *
  48. * @param Com Weapon X-Axis
  49. * @desc Definição X-Axis do comando Weapon.
  50. * @default 420
  51. *
  52. * @param Com Weapon Y-Axis
  53. * @desc Definição Y-Axis do comando Weapon.
  54. * @default 50
  55. *
  56. * @param Com Armour X-Axis
  57. * @desc Definição X-Axis do comando Armour.
  58. * @default 560
  59. *
  60. * @param Com Armour Y-Axis
  61. * @desc Definição Y-Axis do comando Armour.
  62. * @default 50
  63. *
  64. * @param Com Key X-Axis
  65. * @desc Definição X-Axis do comando Key.
  66. * @default 700
  67. *
  68. * @param Com Key Y-Axis
  69. * @desc Definição Y-Axis do comando Key.
  70. * @default 50
  71. *
  72. * @param Actor Windows X-Axis
  73. * @desc Definição X-Axis da janela do personagem.
  74. * @default 600
  75. *
  76. * @param Actor Windows Y-Axis
  77. * @desc Definição Y-Axis da janela do personagem .
  78. * @default 200
  79. *
  80. * @param Actor Face X-Axis
  81. * @desc Definição X-Axis da face do personagem.
  82. * @default 90
  83. *
  84. * @param Actor Face Y-Axis
  85. * @desc Definição Y-Axis da face do personagem .
  86. * @default -65
  87. *
  88. * @param Actor States X-Axis
  89. * @desc Definição X-Axis da condição do personagem.
  90. * @default 23
  91. *
  92. * @param Actor States Y-Axis
  93. * @desc Definição Y-Axis da condição do personagem .
  94. * @default 15
  95. *
  96. * @param Actor Parameters X-Axis
  97. * @desc Definição X-Axis dos parâmetros do personagem.
  98. * @default 0
  99. *
  100. * @param Actor Parameters Y-Axis
  101. * @desc Definição Y-Axis da parâmetros do personagem .
  102. * @default 0
  103. *
  104. * @param Actor Parameters FontSize
  105. * @desc Definição do tamanho da fonte dos parâmetros.
  106. * @default 20
  107. *
  108. * @param Party Window X-Axis
  109. * @desc Definição X-Axis da janela do grupo.
  110. * @default 10
  111. *
  112. * @param Party Window Y-Axis
  113. * @desc Definição Y-Axis da janela do grupo.
  114. * @default 240
  115. *
  116. * @param Party Font Size
  117. * @desc Definição do tamanho do texto.
  118. * @default 20
  119. *
  120. * @param Party Name X-Axis
  121. * @desc Definição X-Axis do nome.
  122. * @default 20
  123. *
  124. * @param Party Name X-Axis
  125. * @desc Definição Y-Axis do nome.
  126. * @default 40
  127. *
  128. * @param Party HPNumber X-Axis
  129. * @desc Definição X-Axis do número de HP.
  130. * @default 20
  131. *
  132. * @param Party HPNumber Y-Axis
  133. * @desc Definição Y-Axis do número de HP.
  134. * @default 3
  135. *
  136. * @param Party MPNumber X-Axis
  137. * @desc Definição X-Axis do número de MP.
  138. * @default 118
  139. *
  140. * @param Party MPNumber Y-Axis
  141. * @desc Definição Y-Axis do número de MP.
  142. * @default 3
  143. *
  144. * @param Party HPMeter X-Axis
  145. * @desc Definição X-Axis do medidor de HP.
  146. * @default 16
  147. *
  148. * @param Party HPMeter Y-Axis
  149. * @desc Definição Y-Axis do medidor de HP.
  150. * @default 30
  151. *
  152. * @param Party MPMeter X-Axis
  153. * @desc Definição X-Axis do medidor de MP.
  154. * @default 113
  155. *
  156. * @param Party MPMeter Y-Axis
  157. * @desc Definição Y-Axis do medidor de MP.
  158. * @default 30
  159. *
  160. * @param Party Status X-Axis
  161. * @desc Definição X-Axis das condições.
  162. * @default 165
  163. *
  164. * @param Party Status Y-Axis
  165. * @desc Definição Y-Axis das condições.
  166. * @default 30
  167. *
  168. * @help  
  169. * =============================================================================
  170. * +++ MOG - Scene Item (v1.1) +++
  171. * By Moghunter
  172. * [url]https://atelierrgss.wordpress.com/[/url]
  173. * =============================================================================
  174. * Modifica a cena de items.
  175. *
  176. * =============================================================================
  177. * UTILIZAÇÃO
  178. * =============================================================================
  179. * As imagens do sistema deverão ser gravados na pasta.
  180. *
  181. * /img/menus/item/
  182. *
  183. * =============================================================================
  184. * HISTÓRICO
  185. * =============================================================================
  186. * (v1.1) - Correção do crash ao usar itens de eventos comum.
  187. *
  188. */

  189. //=============================================================================
  190. // ** PLUGIN PARAMETERS
  191. //=============================================================================
  192.   var Imported = Imported || {};
  193.   Imported.MOG_SceneMenu = true;
  194.   var Moghunter = Moghunter || {};

  195.    Moghunter.parameters = PluginManager.parameters('MOG_SceneItem');
  196.   
  197.         Moghunter.scItem_ItemWindowWidth = Number(Moghunter.parameters['Item Width'] || 370);
  198.         Moghunter.scItem_ItemWindowHeight = Number(Moghunter.parameters['Item Height'] || 400);
  199.         Moghunter.scItem_ItemWindowX = Number(Moghunter.parameters['Item X-Axis'] || 0);
  200.         Moghunter.scItem_ItemWindowY = Number(Moghunter.parameters['Item Y-Axis'] || 96);
  201.         Moghunter.scItem_HelpWindowX = Number(Moghunter.parameters['Help X-Axis'] || 0);
  202.         Moghunter.scItem_HelpWindowY = Number(Moghunter.parameters['Help Y-Axis'] || 516);
  203.         Moghunter.scItem_WlayoutX = Number(Moghunter.parameters['W Layout X-Axis'] || 0);
  204.         Moghunter.scItem_WlayoutY = Number(Moghunter.parameters['W Layout Y-Axis'] || 0);  
  205.         Moghunter.scItem_Com1_X = Number(Moghunter.parameters['Com Item X-Axis'] || 280);
  206.         Moghunter.scItem_Com1_Y = Number(Moghunter.parameters['Com Item Y-Axis'] || 50);  
  207.         Moghunter.scItem_Com2_X = Number(Moghunter.parameters['Com Weapon X-Axis'] || 420);
  208.         Moghunter.scItem_Com2_Y = Number(Moghunter.parameters['Com Weapon Y-Axis'] || 50);                         
  209.         Moghunter.scItem_Com3_X = Number(Moghunter.parameters['Com Armour X-Axis'] || 560);
  210.         Moghunter.scItem_Com3_Y = Number(Moghunter.parameters['Com Armour Y-Axis'] || 50);  
  211.         Moghunter.scItem_Com4_X = Number(Moghunter.parameters['Com Key X-Axis'] || 700);
  212.         Moghunter.scItem_Com4_Y = Number(Moghunter.parameters['Com Key Y-Axis'] || 50);
  213.         Moghunter.scItem_Com5_X = Number(Moghunter.parameters['Com Materia X-Axis'] || 820);
  214.         Moghunter.scItem_Com5_Y = Number(Moghunter.parameters['Com Materia Y-Axis'] || 50);  
  215.                                                
  216.         Moghunter.scItem_ActorWinX = Number(Moghunter.parameters['Actor Windows X-Axis'] || 600);
  217.         Moghunter.scItem_ActorWinY = Number(Moghunter.parameters['Actor Windows Y-Axis'] || 200);                                
  218.     Moghunter.scItem_ActorFaceX = Number(Moghunter.parameters['Actor Face X-Axis'] || 90);
  219.     Moghunter.scItem_ActorFaceY = Number(Moghunter.parameters['Actor Face Y-Axis'] || -65);
  220.     Moghunter.scItem_ActorStatesX = Number(Moghunter.parameters['Actor States X-Axis'] || 23);
  221.     Moghunter.scItem_ActorStatesY = Number(Moghunter.parameters['Actor States Y-Axis'] || 15);
  222.     Moghunter.scItem_ActorParX = Number(Moghunter.parameters['Actor Parameters X-Axis'] || 0);
  223.     Moghunter.scItem_ActorParY = Number(Moghunter.parameters['Actor Parameters Y-Axis'] || 0);
  224.         Moghunter.scItem_ActorParFontSize = Number(Moghunter.parameters['Actor Parameters FontSize'] || 20);
  225.     Moghunter.scItem_PartyX = Number(Moghunter.parameters['Party Window X-Axis'] || 10);
  226.     Moghunter.scItem_PartyY = Number(Moghunter.parameters['Party Window Y-Axis'] || 240);
  227.         Moghunter.scItem_PartyFontSize = Number(Moghunter.parameters['Party Font Size'] || 20);
  228.     Moghunter.scItem_PartyNameX = Number(Moghunter.parameters['Party Name X-Axis'] || 20);
  229.     Moghunter.scItem_PartyNameY = Number(Moghunter.parameters['Party Name Y-Axis'] || 40);       
  230.     Moghunter.scItem_PartyHPNumberX = Number(Moghunter.parameters['Party HPNumber X-Axis'] || 20);
  231.     Moghunter.scItem_PartyHPNumberY = Number(Moghunter.parameters['Party HPNumber Y-Axis'] || 3);       
  232.     Moghunter.scItem_PartyMPNumberX = Number(Moghunter.parameters['Party MPNumber X-Axis'] || 118);
  233.     Moghunter.scItem_PartyMPNumberY = Number(Moghunter.parameters['Party MPNumber Y-Axis'] || 3);               
  234.     Moghunter.scItem_PartyHPMeterX = Number(Moghunter.parameters['Party HPMeter X-Axis'] || 16);
  235.     Moghunter.scItem_PartyHPMeterY = Number(Moghunter.parameters['Party HPMeter Y-Axis'] || 30);       
  236.     Moghunter.scItem_PartyMPMeterX = Number(Moghunter.parameters['Party MPMeter X-Axis'] || 113);
  237.     Moghunter.scItem_PartyMPMeterY = Number(Moghunter.parameters['Party MPMeter Y-Axis'] || 30);       
  238.     Moghunter.scItem_PartyStatusX = Number(Moghunter.parameters['Party Status X-Axis'] || 165);
  239.     Moghunter.scItem_PartyStatusY = Number(Moghunter.parameters['Party Stauts Y-Axis'] || 39);       
  240.        
  241. //=============================================================================
  242. // ** ImageManager
  243. //=============================================================================

  244. //==============================
  245. // * Item
  246. //==============================
  247. ImageManager.loadMenusitem = function(filename) {
  248.     return this.loadBitmap('img/menus/item/', filename, 0, true);
  249. };

  250. //==============================
  251. // * Actor
  252. //==============================
  253. ImageManager.loadMenusActor = function(filename) {
  254.     return this.loadBitmap('img/menus/actorwindow/', filename, 0, true);
  255. };

  256. //=============================================================================
  257. // ** Scene Item
  258. //=============================================================================

  259. //==============================
  260. // * creaate
  261. //==============================
  262. var _mog_scnItem_create = Scene_Item.prototype.create;
  263. Scene_Item.prototype.create = function() {
  264.     _mog_scnItem_create.call(this);
  265.         this.loadBitmaps();
  266.     this._helpWindow.opacity = 0;
  267.         this._helpWindow.x = Moghunter.scItem_HelpWindowX;
  268.         this._helpWindow.y = Moghunter.scItem_HelpWindowY;
  269.     this._categoryWindow.visible = false;
  270.         this._categoryWindow.active = false;
  271.     this._itemWindow.active = true;
  272.         this._itemWindow.select(0);
  273.         this._itemWindow.contentsOpacity = 0;
  274.         this._itemWindow.x = this._itemPosOrg[0] - 50;
  275.         this._actorStatusIndex = this._actorWindow._index;
  276.         this._actorStatus = $gameParty.members()[this._actorWindow._index];
  277.         this._wani = [-1,1,null];
  278. };

  279. //==============================
  280. // * create Background
  281. //==============================
  282. var _mog_scItem_createBackground = Scene_Item.prototype.createBackground;
  283. Scene_Item.prototype.createBackground = function() {
  284.         _mog_scItem_createBackground.call(this);
  285.         this._field = new Sprite();
  286.         this.addChild(this._field);       
  287. }

  288. //==============================
  289. // * loadBitmaps
  290. //==============================
  291. Scene_Item.prototype.loadBitmaps = function() {
  292.         this._layImg = (ImageManager.loadMenusitem("Layout"));
  293.         this._layItemImg = (ImageManager.loadMenusitem("ItemLayout"));
  294.         this._comImg = [];
  295.         for (var i = 0; i < 5; i++) {
  296.                 this._comImg[i] = ImageManager.loadMenusitem("Com_" + i);
  297.         };
  298. };

  299. //==============================
  300. // * create Sprites
  301. //==============================
  302. Scene_Item.prototype.createSprites = function() {
  303.         this.createLayout();
  304.         this.createItemLayout();
  305.         this.createButtons();
  306.         this.createPartyData();
  307. };

  308. //==============================
  309. // * create Sprites
  310. //==============================
  311. Scene_Item.prototype.createLayout = function() {
  312.         this._layout = new Sprite(this._layImg);
  313.         this._field.addChild(this._layout);
  314. };

  315. //==============================
  316. // * create Item Layout
  317. //==============================
  318. Scene_Item.prototype.createItemLayout = function() {
  319.         this._layoutItem = new Sprite(this._layItemImg);
  320.         this._layoutItem.opacity = 0;
  321.         this._field.addChild(this._layoutItem);
  322. };

  323. //==============================
  324. // * create Buttons
  325. //==============================
  326. Scene_Item.prototype.createButtons = function() {
  327.     this._buttons = [];
  328.         this._buttonsAni = [];
  329.     for (var i = 0; i < 5; i++) {
  330.                  this._buttonsAni[i] = 0;
  331.                  this._buttons[i] = new Sprite(this._comImg[i]);
  332.                  this._buttons[i].anchor.x = 0.5;
  333.                  this._buttons[i].anchor.y = 0.5;
  334.                 if (i === 0) {
  335.                          this._buttons[i].x = Moghunter.scItem_Com1_X;
  336.                          this._buttons[i].y = Moghunter.scItem_Com1_Y;
  337.                  } else if (i === 1) {
  338.                          this._buttons[i].x = Moghunter.scItem_Com2_X;
  339.                          this._buttons[i].y = Moghunter.scItem_Com2_Y;
  340.                  } else if (i === 2) {
  341.                          this._buttons[i].x = Moghunter.scItem_Com3_X;
  342.                          this._buttons[i].y = Moghunter.scItem_Com3_Y;
  343.                  } else if (i === 3) {
  344.                          this._buttons[i].x = Moghunter.scItem_Com4_X;
  345.                          this._buttons[i].y = Moghunter.scItem_Com4_Y;
  346.                  } else if (i === 4) {
  347.                          this._buttons[i].x = Moghunter.scItem_Com5_X;
  348.                          this._buttons[i].y = Moghunter.scItem_Com5_Y;       
  349.                  };
  350.                  this._field.addChild(this._buttons[i]);
  351.         };
  352. };
  353.   
  354. //==============================
  355. // * update Buttons
  356. //==============================
  357. Scene_Item.prototype.updateButtons = function() {
  358.         for (var i = 0; i < this._buttons.length; i++) {
  359.                  if (this._categoryWindow._index === i && !this._actorWindow.active) {
  360.                          if (this._buttonsAni[i] === 0) {
  361.                              this._buttons[i].scale.x += 0.010;
  362.                                  if (this._buttons[i].scale.x >= 1.30) {
  363.                                          this._buttons[i].scale.x = 1.30;
  364.                                          this._buttonsAni[i] = 1;
  365.                                  };
  366.                          } else  {
  367.                                  this._buttons[i].scale.x -= 0.010;
  368.                                  if (this._buttons[i].scale.x <= 1.00) {
  369.                                          this._buttons[i].scale.x = 1.00;
  370.                                          this._buttonsAni[i] = 0;
  371.                                  };                                 
  372.                          };       
  373.                          this._buttons[i].opacity += 20;                 
  374.                  } else {
  375.                      this._buttonsAni[i] = 0
  376.                          if (this._buttons[i].scale.x >= 1.00) {
  377.                                  this._buttons[i].scale.x -= 0.010;
  378.                                  if (this._buttons[i].scale.x <= 1.00) {
  379.                                          this._buttons[i].scale.x = 1.00;
  380.                                  };       
  381.                          };       
  382.                          if (this._buttons[i].opacity > 180) {
  383.                                  this._buttons[i].opacity -= 15;
  384.                          };         
  385.                  };
  386.                  
  387.                  this._buttons[i].scale.y = this._buttons[i].scale.x;
  388.         };
  389. };


  390. //==============================
  391. // * update Item Layout
  392. //==============================
  393. Scene_Item.prototype.updateItemLayout = function() {
  394.         this._layoutItem.x = this._itemWindow.x + Moghunter.scItem_WlayoutX;
  395.         this._layoutItem.y = this._itemWindow.y + Moghunter.scItem_WlayoutY;
  396.         this._layoutItem.opacity = this._itemWindow.contentsOpacity;

  397. };

  398. //==============================
  399. // * create Item Window
  400. //==============================
  401. Scene_Item.prototype.createItemWindow = function() {
  402.         var ww = Moghunter.scItem_ItemWindowWidth;
  403.         var wh = Moghunter.scItem_ItemWindowHeight;
  404.         var wx = Moghunter.scItem_ItemWindowX + ((Graphics.boxWidth / 2) - (ww / 2));
  405.     var wy = Moghunter.scItem_ItemWindowY;
  406.     this._itemWindow = new Window_ItemListM(wx, wy, ww, wh);
  407.     this._itemWindow.setHelpWindow(this._helpWindow);
  408.     this._itemWindow.setHandler('ok',     this.onItemOk.bind(this));
  409.     this._itemWindow.setHandler('cancel', this.popScene.bind(this));
  410.     this.addWindow(this._itemWindow);
  411.     this._categoryWindow.setItemWindow(this._itemWindow);
  412.         this._itemPosOrg = [this._itemWindow.x,this._itemWindow.y];
  413.         this._itemWindow.contentsOpacity = 0;
  414. };

  415. //==============================
  416. // * update Default Window
  417. //==============================
  418. Scene_Item.prototype.updateDefaultWindow = function() {
  419.     this._helpWindow.opacity = 0;
  420.         this._categoryWindow.opacity = 0;
  421.         this._categoryWindow.x =  -this._categoryWindow.width;
  422. };

  423. //==============================
  424. // * update Commands
  425. //==============================
  426. Scene_Item.prototype.updateCommands = function() {
  427.     if (this._itemWindow.active && this._wani[0] === 0) {
  428.                   if (Input.isTriggered('right')) {this._wani = [1,0,null]; SoundManager.playCursor()};
  429.           if (Input.isTriggered('left')) {this._wani = [-1,0,null]; SoundManager.playCursor()};
  430.         };
  431. };

  432. //==============================
  433. // * addCatIndex
  434. //==============================
  435. Scene_Item.prototype.addCatIndex = function(value) {
  436.      this._categoryWindow._index += value;
  437.          if (this._categoryWindow._index > 4) {this._categoryWindow._index = 0};
  438.          if (this._categoryWindow._index < 0) {this._categoryWindow._index = 4};
  439.          if (this._wani[3] != null) {this._categoryWindow._index = this._wani[3]}
  440.          this._categoryWindow.update();
  441.          this._itemWindow.select(0);
  442.          this._itemWindow.updateHelp();
  443. };

  444. //==============================
  445. // * addCatIndex
  446. //==============================
  447. Scene_Item.prototype.updateItemWindow = function() {
  448.     if (this._wani[0] != 0) {
  449.                 if (this._wani[0] === 1){
  450.                         this.waniSlideRight();
  451.                 } else {
  452.                         this.waniSlideLeft();
  453.                 };
  454.         };
  455.         if (this._wani[0] === 0) {
  456.             if (this._itemWindow.active) {
  457.             this._itemWindow.contentsOpacity += 15;
  458.             } else {
  459.                     if (this._itemWindow.contentsOpacity > 160) {
  460.                                 this._itemWindow.contentsOpacity -= 15;
  461.                         };
  462.             };
  463.         };
  464. };

  465. //==============================
  466. // * wani Slide Right
  467. //==============================
  468. Scene_Item.prototype.waniSlideRight = function() {
  469.         if (this._wani[1] === 0 ) {
  470.             this._itemWindow.x += 5
  471.                 this._itemWindow.contentsOpacity -= 25;
  472.                 if (this._itemWindow.contentsOpacity <= 0) {
  473.                         this._wani[1] = 1;
  474.                         this._itemWindow.x = this._itemPosOrg[0] - 50;
  475.                         this.addCatIndex(this._wani[0])
  476.                 };
  477.         } else {
  478.             this._itemWindow.x += 5
  479.                 this._itemWindow.contentsOpacity += 25;       
  480.                 if (this._itemWindow.x >= this._itemPosOrg[0]) {
  481.                         this._itemWindow.x = this._itemPosOrg[0];
  482.                         this._itemWindow.contentsOpacity = 255;
  483.                         this._wani = [0,0,null];
  484.                 };
  485.         };
  486. };

  487. //==============================
  488. // * wani Slide Left
  489. //==============================
  490. Scene_Item.prototype.waniSlideLeft = function() {
  491.         if (this._wani[1] === 0 ) {
  492.             this._itemWindow.x -= 5
  493.                 this._itemWindow.contentsOpacity -= 25;
  494.                 if (this._itemWindow.contentsOpacity <= 0) {
  495.                         this._wani[1] = 1;
  496.                         this._itemWindow.x = this._itemPosOrg[0] + 50;
  497.                         this.addCatIndex(this._wani[0])
  498.                 };
  499.         } else {
  500.             this._itemWindow.x -= 5
  501.                 this._itemWindow.contentsOpacity += 25;       
  502.                 if (this._itemWindow.x <= this._itemPosOrg[0]) {
  503.                         this._itemWindow.x = this._itemPosOrg[0];
  504.                         this._itemWindow.contentsOpacity = 255;
  505.             this._wani = [0,0,null];
  506.                 };
  507.         };
  508. };

  509. //==============================
  510. // * checkTouchOn Sprites
  511. //==============================
  512. Scene_Item.prototype.checkTouchOnSprites = function() {
  513.          if (this._itemWindow.active) {
  514.                  for (var i = 0; i < this._buttons.length; i++) {
  515.                           if (this.isOnSprite(this._buttons[i])) {this.setTouchType(i)};
  516.                  };
  517.          } else if (this._actorWindow.active) {
  518.                  var touch = false;
  519.              for (var i = 0; i < this._partyWindow.length; i++) {
  520.                        if (this.isOnSprite2(this._partyWindow[i])) {this.setTouchParty(i);touch = true};
  521.                  };
  522.                  if (!this._actorWindow._cursorAll) {
  523.                         for (var i = 0; i < this._partyArrow.length; i++) {
  524.                                 if (this.isOnSprite( this._partyArrow[i])) {this.setTouchArrow(i);touch = true};
  525.                         };
  526.                  };
  527.                  if (!touch) {
  528.                          if (this.isOnSprite3(this._itemWindow)) {this.setTouchCancelPartyWindow();touch = true};
  529.                  };       
  530.                  if (!touch) {
  531.                          for (var i = 0; i < this._buttons.length; i++) {
  532.                                   if (this.isOnSprite(this._buttons[i])) {this.setTouchType(i)
  533.                               this.setTouchCancelPartyWindow();
  534.                                   };
  535.                          };
  536.                  };                                  
  537.          };
  538. };

  539. //==============================
  540. // * setTouchCancelPartyWindow
  541. //==============================
  542. Scene_Item.prototype.setTouchCancelPartyWindow = function() {
  543.           this._itemWindow.active = true;
  544.           this._actorWindow.active = false;
  545.           this._actorWindow._cursorAll = false;
  546. };

  547. //==============================
  548. // * Set Touch Party
  549. //==============================
  550. Scene_Item.prototype.setTouchParty = function(index) {
  551.           var pIndex = this._actorWindow._index
  552.       this._actorWindow._index = index;
  553.           this._actorWindow.processOk();
  554.       this._actorWindow._index = pIndex;
  555. };

  556. //==============================
  557. // * Set Touch Arrow
  558. //==============================
  559. Scene_Item.prototype.setTouchArrow = function(index) {
  560.    if (index === 0) {
  561.             this.addIndexActorWindow(1);  
  562.    } else {
  563.            this.addIndexActorWindow(-1);
  564.    };
  565. };

  566. //==============================
  567. // * Set Touch Type
  568. //==============================
  569. Scene_Item.prototype.setTouchType = function(index) {
  570.    this._wani = [1,0,index];
  571.     SoundManager.playCursor();
  572. };

  573. //==============================
  574. // * add Index Actor Window
  575. //==============================
  576. Scene_Item.prototype.addIndexActorWindow = function(value) {
  577.     this._actorWindow._index += value;
  578.         if (this._actorWindow._index >= $gameParty.members().length) {this._actorWindow._index = 0};
  579.         if (this._actorWindow._index < 0) {this._actorWindow._index = $gameParty.members().length - 1};
  580.         SoundManager.playCursor();
  581. };

  582. //==============================
  583. // * on Sprite
  584. //==============================
  585. Scene_Item.prototype.isOnSprite = function(sprite) {
  586.          var cw = sprite.bitmap.width / 2;
  587.          var ch = sprite.bitmap.height / 2;
  588.          if (sprite.visible === false) {return false};
  589.          if (sprite.opacity === 0) {return false};
  590.          if (TouchInput.x < sprite.x - cw) {return false};
  591.          if (TouchInput.x > sprite.x + cw) {return false};
  592.          if (TouchInput.y < sprite.y - ch) {return false};
  593.          if (TouchInput.y > sprite.y + ch) {return false};
  594.          return true;       
  595. };

  596. //==============================
  597. // * on Sprite
  598. //==============================
  599. Scene_Item.prototype.isOnSprite2 = function(sprite) {
  600.          var cw = sprite.bitmap.width;
  601.          var ch = sprite.bitmap.height;
  602.          if (sprite.visible === false) {return false};
  603.          if (sprite.opacity === 0) {return false};
  604.          if (TouchInput.x < sprite.x ) {return false};
  605.          if (TouchInput.x > sprite.x + cw) {return false};
  606.          if (TouchInput.y < sprite.y ) {return false};
  607.          if (TouchInput.y > sprite.y + ch) {return false};
  608.          return true;       
  609. };

  610. //==============================
  611. // * on Sprite
  612. //==============================
  613. Scene_Item.prototype.isOnSprite3 = function(sprite) {
  614.          var cw = sprite.width;
  615.          var ch = sprite.height;
  616.          if (sprite.visible === false) {return false};
  617.          if (sprite.contentsOpacity === 0) {return false};
  618.          if (TouchInput.x < sprite.x ) {return false};
  619.          if (TouchInput.x > sprite.x + cw) {return false};
  620.          if (TouchInput.y < sprite.y ) {return false};
  621.          if (TouchInput.y > sprite.y + ch) {return false};
  622.          return true;       
  623. };

  624. //==============================
  625. // * update Touch Screen
  626. //==============================
  627. Scene_Item.prototype.updateTouchScreen = function() {
  628.     if (TouchInput.isTriggered()) {this.checkTouchOnSprites()};
  629. };


  630. //==============================
  631. // * update Actor Status
  632. //==============================
  633. Scene_Item.prototype.updateActorStatus = function() {
  634.         if (this._actorStatusIndex != this._actorWindow._index) {this.refreshStatusActor()};
  635.         this._actorWindow.visible = false;
  636.         this._actorWindow.x = -this._actorWindow.width;
  637.         if (this._actorDataWindow) {this.updateActorDataWindow()};
  638. };

  639. //==============================
  640. // * update Actor Data Window
  641. //==============================
  642. Scene_Item.prototype.updateActorDataWindow = function() {
  643.         if (this._actorWindow.active) {
  644.             var nx = Moghunter.scItem_ActorWinX;
  645.             var ny = Moghunter.scItem_ActorWinY;
  646.                  this._actorDataWindow.opacity += 15;
  647.     } else {
  648.             var nx = Moghunter.scItem_ActorWinX + 100;
  649.             var ny = Moghunter.scItem_ActorWinY;       
  650.                 this._actorDataWindow.opacity -= 15;
  651.     };
  652.     this._actorDataWindow.x = this.commandMoveTo(this._actorDataWindow.x,nx,20);
  653.         this._actorDataWindow.y = this.commandMoveTo(this._actorDataWindow.y,ny,20);
  654.         this.updatePartyWindow();
  655. };

  656. //==============================
  657. // * Command Move To
  658. //==============================
  659. Scene_Item.prototype.commandMoveTo = function(value,real_value,speed) {
  660.         if (value == real_value) {return value};
  661.         var dnspeed = 3 + (Math.abs(value - real_value) / speed);
  662.         if (value > real_value) {value -= dnspeed;
  663.             if (value < real_value) {value = real_value};}
  664.     else if (value < real_value) {value  += dnspeed;
  665.             if (value  > real_value) {value  = real_value};               
  666.     };
  667.         return Math.floor(value);
  668. };       

  669. //==============================
  670. // * refresh Status Actor
  671. //==============================
  672. Scene_Item.prototype.refreshStatusActor = function() {
  673.         this._actorStatusIndex = this._actorWindow._index;
  674.         this._actorStatus = $gameParty.members()[this._actorWindow._index];
  675.         if (this._actorStatus && !this._actorDataWindow) {this.createActorDataWindow()
  676.         } else {
  677.            if (this._actorStatus) {
  678.                    this._actorDataWindow.setActor(this._actorStatus)
  679.                this._actorDataWindow.x = Moghunter.scItem_ActorWinX + 100;
  680.                    this._actorDataWindow.y = Moghunter.scItem_ActorWinY;       
  681.                this._actorDataWindow.opacity = 0;                  
  682.           };       
  683.         };
  684. };

  685. //==============================
  686. // * create Actor Data Window
  687. //==============================
  688. Scene_Item.prototype.createActorDataWindow = function() {
  689.         this._actorDataWindow = new ActorDataWindow();
  690.         this._actorDataWindow.x = Moghunter.scItem_ActorWinX + 100;
  691.         this._actorDataWindow.y = Moghunter.scItem_ActorWinY;       
  692.         this._actorDataWindow.opacity = 0;
  693.         this._actorDataWindow.setActor(this._actorStatus);
  694.         this.addChild(this._actorDataWindow);
  695. };

  696. //==============================
  697. // * create Party Data
  698. //==============================
  699. Scene_Item.prototype.createPartyData = function() {
  700.     this._partyWindow = [];
  701.         this._partyPos = [];
  702.         this._partyAni = [];
  703.         this._partyPos[0] = [Moghunter.scItem_PartyX,Moghunter.scItem_PartyY];
  704.         this._partyPos[1] = [Moghunter.scItem_PartyX - 290,Moghunter.scItem_PartyY];
  705.         this._partyPos[2] = [Moghunter.scItem_PartyX - 20,Moghunter.scItem_PartyY - 100];
  706.         this._partyPos[3] = [Moghunter.scItem_PartyX - 20,Moghunter.scItem_PartyY + 100];
  707.         for (var i = 0; i < $gameParty.members().length; i++) {
  708.                 this._partyWindow[i] = new PartyWindowData($gameParty.members()[i]);
  709.                 this._partyWindow[i].opacity = 0;
  710.                 this._partyAni[i] = [0,0];
  711.                 this.addChild(this._partyWindow[i]);
  712.         };
  713.         this.createPartyArrow();
  714.         this.createAllMembersScope();
  715. };

  716. //==============================
  717. // * refresh Part Data
  718. //==============================
  719. Scene_Item.prototype.refreshPartyData = function() {
  720.         for (var i = 0; i < this._partyWindow.length; i++) {
  721.                 this._partyWindow[i].refresh();
  722.         };
  723.         this._actorDataWindow.refresh();
  724. };

  725. //==============================
  726. // * update Party Window
  727. //==============================
  728. Scene_Item.prototype.updatePartyWindow = function() {
  729.          for (var i = 0; i < this._partyWindow.length; i++) {
  730.                  if (this._actorWindow.active) {
  731.                          var c = this._actorWindow._index;
  732.                          var n = this._actorWindow._index + 1;
  733.                          var p = this._actorWindow._index - 1;
  734.                          if (n >= $gameParty.members().length) {n = 0};
  735.                          if (p < 0) {p = $gameParty.members().length - 1};
  736.                          if (i === c) {
  737.                          var nx = this._partyPos[0][0];
  738.                              var ny = this._partyPos[0][1];
  739.                                  this._partyWindow[i].opacity += 25;
  740.                                  this.updateSlidePartyWin(i);       
  741.                          } else {
  742.                                  this._partyAni[i] = [0,0];
  743.                                  if (p === i) {
  744.                                          var nx = this._partyPos[2][0];
  745.                                          var ny = this._partyPos[2][1];
  746.                                  } else if (n === i) {
  747.                                          var nx = this._partyPos[3][0];
  748.                                          var ny = this._partyPos[3][1];                                         
  749.                                  } else {
  750.                                          var nx = this._partyPos[1][0];
  751.                                          var ny = this._partyPos[1][1];                                 
  752.                                  };
  753.                                  if (this._partyWindow[i].opacity > 160) {
  754.                                          this._partyWindow[i].opacity -= 15;
  755.                                          if (this._partyWindow[i].opacity < 160) {
  756.                                                  this._partyWindow[i].opacity = 160;
  757.                                          };
  758.                              } else if (this._partyWindow[i].opacity < 160) {
  759.                                          this._partyWindow[i].opacity += 15;
  760.                                          if (this._partyWindow[i].opacity > 160) {
  761.                                                  this._partyWindow[i].opacity = 160;
  762.                                          };                                         
  763.                                  };
  764.                          };
  765.                  } else {
  766.                      var nx = this._partyPos[1][0];
  767.                          var ny = this._partyPos[1][1];
  768.                          this._partyAni[i] = [0,0];
  769.                          this._partyWindow[i].opacity -= 25;
  770.                  };
  771.                  nx += this._partyAni[i][0];
  772.                  this._partyWindow[i].x = this.commandMoveTo(this._partyWindow[i].x,nx,20);
  773.                  this._partyWindow[i].y = this.commandMoveTo(this._partyWindow[i].y,ny,20);
  774.          };
  775.          this.updatePartyArrow();
  776.      this.updateAllMembersSprite();
  777. };

  778. //==============================
  779. // * update Slide Party Win
  780. //==============================
  781. Scene_Item.prototype.updateSlidePartyWin = function(i) {
  782.         this._partyAni[i][1]++;
  783.         if (this._partyAni[i][1] < 30) {
  784.                 this._partyAni[i][0] += 0.2;
  785.         } else if (this._partyAni[i][1] < 60) {
  786.             this._partyAni[i][0] -= 0.2;
  787.         } else {
  788.                 this._partyAni[i] = [0,0];
  789.         };
  790. };

  791. //==============================
  792. // * update Party Arrow
  793. //==============================
  794. Scene_Item.prototype.updatePartyArrow = function() {
  795.         for (var i = 0; i < this._partyArrow.length; i++) {
  796.                  if (this._actorWindow.active) {
  797.                          this.updateSlidePartyArrow();
  798.                          var cw = this._partyWindow[0].width / 2;
  799.                          var ch = this._partyWindow[0].height;
  800.                      if (i === 0) {
  801.                                  var nx = this._partyPos[2][0] + cw;
  802.                                  var ny = this._partyPos[2][1] - this._partyArrow[i].height;       
  803.                                   ny += this._partyArrowAni[0];                                 
  804.                          } else {
  805.                                  var nx = this._partyPos[3][0] + cw;
  806.                                  var ny = this._partyPos[3][1] + ch + this._partyArrow[i].height;       
  807.                                   ny += -this._partyArrowAni[0];
  808.                          };
  809.                          this._partyArrow[i].opacity += 15;
  810.              } else {
  811.                      var nx = this._partyPos[1][0];
  812.                          var ny = this._partyPos[1][1];
  813.                          this._partyArrow[i].opacity -= 15;               
  814.              };
  815.                  this._partyArrow[i].x = this.commandMoveTo(this._partyArrow[i].x,nx,20);
  816.                  this._partyArrow[i].y = this.commandMoveTo(this._partyArrow[i].y,ny,20);                         
  817.         };
  818. };

  819. //==============================
  820. // * update Slide Party Arrow
  821. //==============================
  822. Scene_Item.prototype.updateSlidePartyArrow = function() {
  823.         this._partyArrowAni[1]++;
  824.         if (this._partyArrowAni[1] < 50) {
  825.                 this._partyArrowAni[0] += 0.14;
  826.         } else if (this._partyArrowAni[1] < 100) {
  827.             this._partyArrowAni[0] -= 0.14;
  828.         } else {
  829.                 this._partyArrowAni = [0,0];
  830.         };
  831. };

  832. //==============================
  833. // * create Party Arrow
  834. //==============================
  835. Scene_Item.prototype.createPartyArrow = function() {
  836.         this._partyArrow = [];
  837.         this._partyArrowAni = [0,0];
  838.         for (var i = 0; i < 2; i++) {
  839.         this._partyArrow[i] = new Sprite(ImageManager.loadMenusActor("Arrow"));
  840.                 this._partyArrow[i].anchor.x = 0.5;
  841.                 this._partyArrow[i].anchor.y = 0.5;
  842.                 if ($gameParty.members().length < 4) {this._partyArrow[i].visible = false};
  843.                 if (i === 1) {this._partyArrow[i].scale.y = -1.00};
  844.                 this._partyArrow[i].opacity = 0;
  845.                 this.addChild(this._partyArrow[i]);
  846.         };       
  847. };

  848. //==============================
  849. // * create All Members Scope
  850. //==============================
  851. Scene_Item.prototype.createAllMembersScope = function() {
  852.      this._almSprite = new Sprite(ImageManager.loadMenusActor("AllMembers"));
  853.          this._almSprite.anchor.x = 0.5;
  854.          this._almSprite.anchor.y = 0.5;
  855.          this._almSprite.visible = false;
  856.      this.addChild(this._almSprite);
  857. };

  858. //==============================
  859. // * updateAllMembers Sprite
  860. //==============================
  861. Scene_Item.prototype.updateAllMembersSprite = function() {
  862.          this._almSprite.x = this._partyPos[0][0] + (this._partyWindow[0].width / 2);
  863.          this._almSprite.y = this._partyPos[0][1] + (this._partyWindow[0].height / 2);
  864.          this._almSprite.visible = this._actorWindow._cursorAll;
  865. };

  866. //==============================
  867. // * on Actor Cancel
  868. //==============================
  869. var _mog_scItem_onActorCancel = Scene_Item.prototype.onActorCancel;
  870. Scene_Item.prototype.onActorCancel = function() {
  871.     _mog_scItem_onActorCancel.call(this);
  872.         this._actorWindow._cursorAll = false;
  873. };

  874. //==============================
  875. // * refresh Actor WD
  876. //==============================
  877. Scene_Item.prototype.refreshActorWD = function() {
  878.         if (this._partyWindow) {
  879.                 for (var i = 0; i < this._partyWindow.length; i++) {
  880.                         this._partyWindow[i].refresh();
  881.                 };
  882.         };
  883.         if (this._actorDataWindow) {this._actorDataWindow.refresh()};
  884. };       

  885. //==============================
  886. // * process OK
  887. //==============================
  888. var _mog_scItem_wmact_useItem = Scene_Item.prototype.useItem;
  889. Scene_Item.prototype.useItem = function() {
  890.     _mog_scItem_wmact_useItem.call(this);
  891.         this.refreshActorWD();
  892. };

  893. //==============================
  894. // * update
  895. //==============================
  896. var _mog_scnItem_update = Scene_Item.prototype.update;
  897. Scene_Item.prototype.update = function() {
  898.     _mog_scnItem_update.call(this);
  899.         this.updateDefaultWindow();
  900.         if (!this._layout) {
  901.                 if (this._layImg.isReady()) {this.createSprites()};
  902.                 return
  903.         };
  904.         this.updateItemWindow();
  905.         this.updateCommands();
  906.         if (this._layoutItem) {this.updateItemLayout()};
  907.         if (this._buttons) {this.updateButtons()};
  908.         this.updateTouchScreen();
  909.         if (this._actorWindow) {this.updateActorStatus()};
  910. };

  911. //=============================================================================
  912. // * Party Window Data
  913. //=============================================================================
  914. function PartyWindowData() {
  915.     this.initialize.apply(this, arguments);
  916. };

  917. PartyWindowData.prototype = Object.create(Sprite.prototype);
  918. PartyWindowData.prototype.constructor = PartyWindowData;

  919. //==============================
  920. // * Initialize
  921. //==============================
  922. PartyWindowData.prototype.initialize = function(actor) {
  923.     Sprite.prototype.initialize.call(this);       
  924.         this.loadBitmaps();
  925.     this._actor = actor;
  926. };

  927. //==============================
  928. // * Refresh
  929. //==============================
  930. PartyWindowData.prototype.loadBitmaps = function() {
  931.     this._layImg = ImageManager.loadMenusActor("Layout2");
  932.         this._hpMeterImg = ImageManager.loadMenusActor("HPMeter");
  933.         this._mpMeterImg = ImageManager.loadMenusActor("MPMeter");
  934. };

  935. //==============================
  936. // * create Sprites
  937. //==============================
  938. PartyWindowData.prototype.createSprites = function() {
  939.         this.bitmap = this._layImg;
  940.         this.createPar();
  941.         this.createHPMeter();
  942.         this.createMPMeter();
  943.         this.createStates();
  944.         this.refresh()
  945. };

  946. //==============================
  947. // * Refresh
  948. //==============================
  949. PartyWindowData.prototype.refresh = function() {
  950.     this.refreshPar();
  951.         this.refreshHPMeter();
  952.         this.refreshMPMeter();
  953.         this.refresh_states();
  954. };

  955. //==============================
  956. // * createPar
  957. //==============================
  958. PartyWindowData.prototype.createPar = function() {
  959.     this._par = new Sprite(new Bitmap(320,160));
  960.         this._par.bitmap.fontSize = Moghunter.scItem_PartyFontSize;
  961.         this.addChild(this._par);
  962. };

  963. //==============================
  964. // * refresh Par
  965. //==============================
  966. PartyWindowData.prototype.refreshPar = function() {
  967.      this._par.bitmap.clear();
  968.          this._par.bitmap.drawText(this._actor.hp,Moghunter.scItem_PartyHPNumberX,Moghunter.scItem_PartyHPNumberY,80,32,"right");
  969.          this._par.bitmap.drawText(this._actor.mp,Moghunter.scItem_PartyMPNumberX,Moghunter.scItem_PartyMPNumberY,80,32,"right");
  970.          this._par.bitmap.drawText(this._actor.name(),Moghunter.scItem_PartyNameX,Moghunter.scItem_PartyNameY,120,32,"left");
  971. };

  972. //==============================
  973. // * createHP Meter
  974. //==============================
  975. PartyWindowData.prototype.createHPMeter = function() {
  976.     this._hpMeter = new Sprite(this._hpMeterImg);
  977.         this._hpMeter.x = Moghunter.scItem_PartyHPMeterX;
  978.         this._hpMeter.y = Moghunter.scItem_PartyHPMeterY;
  979.         this.addChild(this._hpMeter);
  980. };

  981. //==============================
  982. // * refreshHP Meter
  983. //==============================
  984. PartyWindowData.prototype.refreshHPMeter = function() {
  985.         var cw = this._hpMeterImg.width;
  986.         var ch = this._hpMeterImg.height;
  987.         var wid = cw * this._actor.hp / this._actor.mhp;
  988.         this._hpMeter.setFrame(0,0,wid,cw);
  989. };

  990. //==============================
  991. // * createHP Meter
  992. //==============================
  993. PartyWindowData.prototype.createMPMeter = function() {
  994.     this._mpMeter = new Sprite(this._mpMeterImg);
  995.         this._mpMeter.x = Moghunter.scItem_PartyMPMeterX;
  996.         this._mpMeter.y = Moghunter.scItem_PartyMPMeterY;
  997.         this.addChild(this._mpMeter);
  998. };

  999. //==============================
  1000. // * refreshMP Meter
  1001. //==============================
  1002. PartyWindowData.prototype.refreshMPMeter = function() {
  1003.         var cw = this._mpMeterImg.width;
  1004.         var ch = this._mpMeterImg.height;
  1005.         var wid = cw * this._actor.mp / this._actor.mmp;
  1006.         this._mpMeter.setFrame(0,0,wid,cw);
  1007. };


  1008. //==============================
  1009. // * Create States
  1010. //==============================
  1011. PartyWindowData.prototype.createStates = function() {
  1012.         this._states_data = [0,0,0];
  1013.         this._state_icon = new Sprite(ImageManager.loadSystem("IconSet"));
  1014.         this._state_icon.x = Moghunter.scItem_PartyStatusX;
  1015.         this._state_icon.y = Moghunter.scItem_PartyStatusY;
  1016.         this._state_icon.visible = false;
  1017.         this.addChild(this._state_icon);
  1018.         this.refresh_states();       
  1019. };
  1020.        
  1021. //==============================
  1022. // * Create States
  1023. //==============================
  1024. PartyWindowData.prototype.refresh_states = function() {
  1025.         this._states_data[0] = 0;
  1026.         this._states_data[2] = 0;
  1027.         this._state_icon.visible = false;
  1028.         if (this._actor.allIcons().length == 0) {this._states_data[1] = 0;return};
  1029.        if (this._actor.allIcons()[this._states_data[1]]) {       
  1030.                 this._states_data[0] = this._actor.allIcons()[this._states_data[1]];
  1031.                 this._state_icon.visible = true;
  1032.                 var sx = this._states_data[0] % 16 * 32;
  1033.                 var sy = Math.floor(this._states_data[0] / 16) * 32;
  1034.                 this._state_icon.setFrame(sx, sy, 32, 32);
  1035.            };
  1036.         this._states_data[1] += 1;
  1037.         if (this._states_data[1] >= this._actor.allIcons().length) {
  1038.                 this._states_data[1] = 0
  1039.         };
  1040. };

  1041. //==============================
  1042. // * Update States
  1043. //==============================
  1044. PartyWindowData.prototype.update_states = function() {
  1045.         this._states_data[2] += 1;
  1046.         if (this.need_refresh_states()) {this.refresh_states();};
  1047. };       
  1048.        
  1049. //==============================
  1050. // * Need Refresh States
  1051. //==============================
  1052. PartyWindowData.prototype.need_refresh_states = function() {
  1053.         if (this._states_data[2] > 60) {return true};
  1054.         return false;
  1055. };       


  1056. //==============================
  1057. // * Update
  1058. //==============================
  1059. PartyWindowData.prototype.update = function() {
  1060.     Sprite.prototype.update.call(this);       
  1061.     if (!this._par && this._layImg.isReady()) {this.createSprites()};
  1062.         if (this._state_icon) {this.update_states()};
  1063. };

  1064. //=============================================================================
  1065. // * Actor Data Window
  1066. //=============================================================================
  1067. function ActorDataWindow() {
  1068.     this.initialize.apply(this, arguments);
  1069. };

  1070. ActorDataWindow.prototype = Object.create(Sprite.prototype);
  1071. ActorDataWindow.prototype.constructor = ActorDataWindow;

  1072. //==============================
  1073. // * Initialize
  1074. //==============================
  1075. ActorDataWindow.prototype.initialize = function() {
  1076.     Sprite.prototype.initialize.call(this);       
  1077.     this._actor = null;
  1078. };

  1079. //==============================
  1080. // * setActor
  1081. //==============================
  1082. ActorDataWindow.prototype.setActor = function(actor) {
  1083.      this._actor = actor;
  1084.          if (!this._layout) {this.createSprites()};
  1085.          this.refresh();
  1086. };

  1087. //==============================
  1088. // * create Sprites
  1089. //==============================
  1090. ActorDataWindow.prototype.createSprites = function() {
  1091.      this.createLayout();
  1092.          this.createStates();
  1093.          this.createFaces();
  1094.          this.createParameters();
  1095. };

  1096. //==============================
  1097. // * Refresh
  1098. //==============================
  1099. ActorDataWindow.prototype.refresh = function() {
  1100.      this.refreshParameters();
  1101.          this.refresh_states();       
  1102.          this.refreshFaces();
  1103. };

  1104. //==============================
  1105. // * create Layout
  1106. //==============================
  1107. ActorDataWindow.prototype.createLayout = function() {
  1108.      this._layout = new Sprite(ImageManager.loadMenusActor("Layout"));
  1109.          this.addChild(this._layout);
  1110. };

  1111. //==============================
  1112. // * create Parameters
  1113. //==============================
  1114. ActorDataWindow.prototype.createParameters = function() {
  1115.      this._par = new Sprite(new Bitmap(Graphics.boxWidth,Graphics.boxHeight));
  1116.          this._par.bitmap.fontSize = Moghunter.scItem_ActorParFontSize;
  1117.          this._par.x = Moghunter.scItem_ActorParX;
  1118.          this._par.y = Moghunter.scItem_ActorParY;
  1119.          this.addChild(this._par);
  1120. };

  1121. //==============================
  1122. // * refresh Parameters
  1123. //==============================
  1124. ActorDataWindow.prototype.refreshParameters = function() {
  1125.      this._par.bitmap.clear();
  1126.          this._par.bitmap.drawText(this._actor.hp,-60,66,160,32,"right");
  1127.          this._par.bitmap.drawText(this._actor.mhp,30,66,160,32,"right");
  1128.          this._par.bitmap.drawText(this._actor.mp,-60,99,160,32,"right");
  1129.          this._par.bitmap.drawText(this._actor.mmp,30,99,160,32,"right");         
  1130.          this._par.bitmap.drawText(this._actor.atk,-60,132,160,32,"right");
  1131.          this._par.bitmap.drawText(this._actor.def,30,132,160,32,"right");
  1132.          this._par.bitmap.drawText(this._actor.mat,-60,165,160,32,"right");
  1133.          this._par.bitmap.drawText(this._actor.mdf,30,165,160,32,"right");
  1134.          this._par.bitmap.drawText(this._actor.agi,-60,198,160,32,"right");
  1135.          this._par.bitmap.drawText(this._actor.luk,30,198,160,32,"right");       
  1136.          this._par.bitmap.drawText(this._actor.name(),70,30,160,32,"left");         
  1137. };

  1138. //==============================
  1139. // * Create States
  1140. //==============================
  1141. ActorDataWindow.prototype.createStates = function() {
  1142.         this._states_data = [0,0,0];
  1143.         this._state_icon = new Sprite(ImageManager.loadSystem("IconSet"));
  1144.         this._state_icon.x = Moghunter.scItem_ActorStatesX;
  1145.         this._state_icon.y = Moghunter.scItem_ActorStatesY;
  1146.         this._state_icon.visible = false;
  1147.         this.addChild(this._state_icon);
  1148.         this.refresh_states();       
  1149. };
  1150.        
  1151. //==============================
  1152. // * Create States
  1153. //==============================
  1154. ActorDataWindow.prototype.refresh_states = function() {
  1155.         this._states_data[0] = 0;
  1156.         this._states_data[2] = 0;
  1157.         this._state_icon.visible = false;
  1158.         if (this._actor.allIcons().length == 0) {this._states_data[1] = 0;return};
  1159.        if (this._actor.allIcons()[this._states_data[1]]) {       
  1160.                 this._states_data[0] = this._actor.allIcons()[this._states_data[1]];
  1161.                 this._state_icon.visible = true;
  1162.                 var sx = this._states_data[0] % 16 * 32;
  1163.                 var sy = Math.floor(this._states_data[0] / 16) * 32;
  1164.                 this._state_icon.setFrame(sx, sy, 32, 32);
  1165.            };
  1166.         this._states_data[1] += 1;
  1167.         if (this._states_data[1] >= this._actor.allIcons().length) {
  1168.                 this._states_data[1] = 0
  1169.         };
  1170. };

  1171. //==============================
  1172. // * Update States
  1173. //==============================
  1174. ActorDataWindow.prototype.update_states = function() {
  1175.         this._states_data[2] += 1;
  1176.         if (this.need_refresh_states()) {this.refresh_states();};
  1177. };       
  1178.        
  1179. //==============================
  1180. // * Need Refresh States
  1181. //==============================
  1182. ActorDataWindow.prototype.need_refresh_states = function() {
  1183.         if (this._states_data[2] > 60) {return true};
  1184.         return false;
  1185. };       

  1186. //==============================
  1187. // * create Faces
  1188. //==============================
  1189. ActorDataWindow.prototype.createFaces = function() {
  1190.      this._faces = new Sprite();
  1191.          this._faces.x = Moghunter.scItem_ActorFaceX;
  1192.          this._faces.y = Moghunter.scItem_ActorFaceY;
  1193.          this.addChild(this._faces);
  1194. };

  1195. //==============================
  1196. // * refresh Faces
  1197. //==============================
  1198. ActorDataWindow.prototype.refreshFaces = function() {
  1199.      this._faces.bitmap = ImageManager.loadMenusFaces1("Actor_" + this._actor._actorId)
  1200. };

  1201. //==============================
  1202. // * update
  1203. //==============================
  1204. ActorDataWindow.prototype.update = function() {
  1205.     Sprite.prototype.update.call(this);       
  1206.         if (!this._actor) {return};
  1207.     this.update_states();
  1208. };

  1209. //=============================================================================
  1210. // ** Window ItemListM
  1211. //=============================================================================
  1212. function Window_ItemListM() {
  1213.     this.initialize.apply(this, arguments);
  1214. }
  1215. Window_ItemListM.prototype = Object.create(Window_Selectable.prototype);
  1216. Window_ItemListM.prototype.constructor = Window_ItemListM;

  1217. //==============================
  1218. // * initialize
  1219. //==============================
  1220. Window_ItemListM.prototype.initialize = function(x, y, width, height) {
  1221.     Window_Selectable.prototype.initialize.call(this, x, y, width, height);
  1222.     this._category = 'none';
  1223.     this._data = [];
  1224.         this.contentsOpacity = 0;
  1225.         this.opacity = 0;
  1226. };

  1227. //==============================
  1228. // * setCategory
  1229. //==============================
  1230. Window_ItemListM.prototype.setCategory = function(category) {
  1231.     if (this._category !== category) {
  1232.         this._category = category;
  1233.         this.refresh();
  1234.         this.resetScroll();
  1235.     }
  1236. };

  1237. //==============================
  1238. // * maxCols
  1239. //==============================
  1240. Window_ItemListM.prototype.maxCols = function() {
  1241.     return 1;
  1242. };

  1243. //==============================
  1244. // * spacing
  1245. //==============================
  1246. Window_ItemListM.prototype.spacing = function() {
  1247.     return 48;
  1248. };

  1249. //==============================
  1250. // * maxItems
  1251. //==============================
  1252. Window_ItemListM.prototype.maxItems = function() {
  1253.     return this._data ? this._data.length : 1;
  1254. };

  1255. //==============================
  1256. // * item
  1257. //==============================
  1258. Window_ItemListM.prototype.item = function() {
  1259.     var index = this.index();
  1260.     return this._data && index >= 0 ? this._data[index] : null;
  1261. };

  1262. //==============================
  1263. // * isCurrentItemEnabled
  1264. //==============================
  1265. Window_ItemListM.prototype.isCurrentItemEnabled = function() {
  1266.     return this.isEnabled(this.item());
  1267. };

  1268. //==============================
  1269. // * Includes
  1270. //==============================
  1271. Window_ItemListM.prototype.includes = function(item) {
  1272.     switch (this._category) {
  1273.     case 'item':
  1274.         return DataManager.isItem(item) && item.itypeId === 1;
  1275.     case 'weapon':
  1276.         return DataManager.isWeapon(item);
  1277.     case 'armor':
  1278.         return DataManager.isArmor(item);
  1279.     case 'keyItem':
  1280.         return DataManager.isItem(item) && item.itypeId === 2;
  1281.     case 'AllItems':
  1282.             return DataManager.isItem(item);
  1283.     default:
  1284.         return false;
  1285.     }
  1286. };

  1287. //==============================
  1288. // * needsNumber
  1289. //==============================
  1290. Window_ItemListM.prototype.needsNumber = function() {
  1291.     return true;
  1292. };

  1293. //==============================
  1294. // * is Enabled
  1295. //==============================
  1296. Window_ItemListM.prototype.isEnabled = function(item) {
  1297.     return $gameParty.canUse(item);
  1298. };

  1299. //==============================
  1300. // * makeItemList
  1301. //==============================
  1302. Window_ItemListM.prototype.makeItemList = function() {
  1303.     this._data = $gameParty.allItems().filter(function(item) {
  1304.         return this.includes(item);
  1305.     }, this);
  1306.     if (this.includes(null)) {
  1307.         this._data.push(null);
  1308.     }
  1309. };

  1310. //==============================
  1311. // * selectLast
  1312. //==============================
  1313. Window_ItemListM.prototype.selectLast = function() {
  1314.     var index = this._data.indexOf($gameParty.lastItem());
  1315.     this.select(index >= 0 ? index : 0);
  1316. };

  1317. //==============================
  1318. // * drawItem
  1319. //==============================
  1320. Window_ItemListM.prototype.drawItem = function(index) {
  1321.     var item = this._data[index];
  1322.     if (item) {
  1323.         var numberWidth = this.numberWidth();
  1324.         var rect = this.itemRect(index);
  1325.         rect.width -= this.textPadding();
  1326.         this.changePaintOpacity(this.isEnabled(item));
  1327.         this.drawItemName(item, rect.x, rect.y, rect.width - numberWidth);
  1328.         this.drawItemNumber(item, rect.x, rect.y, rect.width);
  1329.         this.changePaintOpacity(1);
  1330.     }
  1331. };

  1332. //==============================
  1333. // * numberWidth
  1334. //==============================
  1335. Window_ItemListM.prototype.numberWidth = function() {
  1336.     return this.textWidth('000');
  1337. };

  1338. //==============================
  1339. // * drawItemNumber
  1340. //==============================
  1341. Window_ItemListM.prototype.drawItemNumber = function(item, x, y, width) {
  1342.     if (this.needsNumber()) {
  1343.         this.drawText(':', x, y, width - this.textWidth('00'), 'right');
  1344.         this.drawText($gameParty.numItems(item), x, y, width, 'right');
  1345.     }
  1346. };

  1347. //==============================
  1348. // * updateHelp
  1349. //==============================
  1350. Window_ItemListM.prototype.updateHelp = function() {
  1351.     this.setHelpWindowItem(this.item());
  1352. };

  1353. //==============================
  1354. // * refresh
  1355. //==============================
  1356. Window_ItemListM.prototype.refresh = function() {
  1357.     this.makeItemList();
  1358.     this.createContents();
  1359.     this.drawAllItems();
  1360. };

  1361. //==============================
  1362. // * update
  1363. //==============================
  1364. var _mog_WindowItemM_update = Window_ItemListM.prototype.update;
  1365. Window_ItemListM.prototype.update = function() {
  1366.         if (this.contentsOpacity != 255) {return};
  1367.     _mog_WindowItemM_update.call(this);
  1368.         this.opacity = 0;
  1369. };

  1370. //==============================
  1371. // * process Cursor Move
  1372. //==============================
  1373. Window_MenuActor.prototype.processCursorMove = function() {
  1374.     if (this.isCursorMovable()) {
  1375.         var lastIndex = this.index();
  1376.         if (Input.isRepeated('down')) {
  1377.             this.cursorDown(Input.isTriggered('down'));
  1378.         };
  1379.         if (Input.isRepeated('up') ) {
  1380.             this.cursorUp(Input.isTriggered('up'));
  1381.         };
  1382.         if (Input.isRepeated('right')) {
  1383.             this.cursorDown(Input.isTriggered('right'));
  1384.         };
  1385.         if (Input.isRepeated('left')) {
  1386.             this.cursorUp(Input.isTriggered('left'));
  1387.         };               
  1388.         if (this.index() !== lastIndex) {
  1389.             SoundManager.playCursor();
  1390.         };
  1391.     };
  1392. };

  1393. //==============================
  1394. // * Update
  1395. //==============================
  1396. var _mog_scItem_wmact_update = Window_MenuActor.prototype.update;
  1397. Window_MenuActor.prototype.update = function() {
  1398.         _mog_scItem_wmact_update.call(this);
  1399.         if (!this._cursorAll) {this.updateScrollRoll()};
  1400. };

  1401. //==============================
  1402. // * update SCroll Roll
  1403. //==============================
  1404. Window_MenuActor.updateScrollRoll = function() {
  1405.     if (this.isOpenAndActive() && this.maxItems() > 0) {
  1406.                 var srow = this.maxTopRow() === 0 ? 1 : this.maxCols();
  1407.         var threshold = 20;
  1408.                 var idx = this._index;
  1409.         if (TouchInput.wheelY >= threshold) {
  1410.             this._index += srow;
  1411.                         if (this._index > (this.maxItems() - 1)) {this._index = this.maxItems() - 1};
  1412.                         this.select(this._index);
  1413.                         if (idx != this._index) {SoundManager.playCursor()};
  1414.         };
  1415.         if (TouchInput.wheelY <= -threshold) {
  1416.             this._index -= srow;
  1417.                         if (this._index < 0) {this._index = 0};
  1418.                         this.select(this._index);
  1419.                         if (idx != this._index) {SoundManager.playCursor()};
  1420.         };
  1421.     };
  1422. };       
复制代码
Help_1.jpg
Help_2.jpg
梦石
2
星屑
34507
在线时间
614 小时
注册时间
2014-7-18
回帖
647

MZ评测员开拓者

发表于 2019-7-2 11:11:24 | 显示全部楼层
本帖最后由 xjzsq 于 2019-7-2 11:20 编辑

方便把工程整个发出来吗?
如果不方便,请把这个插件所有的依赖插件以及文件等发出来,我这里测试先是缺少文件,补齐以后又显示this.updateScrollRoll is not a function...
update:
我好想知道你是怎么错的了...
1497行以后是不是你自己改了啊...
你的1509行的那个updateScrollRoll函数前面没写prototype,结果导致找不到这个函数...
得把
  1. Window_MenuActor.updateScrollRoll
复制代码

改成
  1. Window_MenuActor.prototype.updateScrollRoll
复制代码
我也这么错了好几次了...
回复

使用道具 举报

梦石
0
星屑
3465
在线时间
359 小时
注册时间
2017-5-3
回帖
45
 楼主| 发表于 2019-7-2 12:19:24 | 显示全部楼层
我這邊updateScrollRoll冇問題。
我上傳插件和圖片上來吧,MOG_SceneItem是原文件,MOG_SceneItem_AddCategory是我改的。
麻煩大神了。

MOG_SceneItem_改.rar

577.43 KB, 下载次数: 59

回复

使用道具 举报

梦石
0
星屑
3465
在线时间
359 小时
注册时间
2017-5-3
回帖
45
 楼主| 发表于 2019-7-2 12:22:33 | 显示全部楼层
補個百度盤
链接:https://pan.baidu.com/s/1jGVz9Uk77Y5BXhgt_rzprA
提取码:3z80
复制这段内容后打开百度网盘手机App,操作更方便哦
回复

使用道具 举报

梦石
2
星屑
34507
在线时间
614 小时
注册时间
2014-7-18
回帖
647

MZ评测员开拓者

发表于 2019-7-2 13:07:15 | 显示全部楼层
oscar1543689 发表于 2019-7-2 12:19
我這邊updateScrollRoll冇問題。
我上傳插件和圖片上來吧,MOG_SceneItem是原文件,MOG_SceneItem_AddCateg ...

你这个脚本按照我二楼那么改就能运行起来了,但是我不太明白你增加的物品栏要显示的物品种类是啥,是第二个keyItem吗?
另外你说的任何物品都显示不出来是所有的物品分类的物品都显示不出来,还是只有你新增的物品栏对应的物品显示不出来,我这里是可以正常显示的。
360截图20190702130529411.jpg 而且当我试图退出的时候又缺文件了...
(文件就不用补了)
回复

使用道具 举报

梦石
0
星屑
3465
在线时间
359 小时
注册时间
2017-5-3
回帖
45
 楼主| 发表于 2019-7-2 13:15:02 | 显示全部楼层
新增的物品栏对应的物品显示不出来,第二個keyitem我只是隨便找張圖應付一下,
回复

使用道具 举报

梦石
2
星屑
18945
在线时间
1454 小时
注册时间
2017-4-16
回帖
216

MZ评测员开拓者

发表于 2019-7-2 20:32:24 | 显示全部楼层
https://rpg.blue/thread-409713-1-1.html
drill up大佬已经写好了这个插件了

点评

啊,没看到drill up大佬自己写的Drill_ItemCategory.js,实在抱歉,确实能满足楼主的要求  发表于 2019-7-2 22:13
看楼主的意思,他的要求是增加一个道具栏,而据我目测drill up大佬只是将mog的插件汉化,没有增加物品槽的功能(我可能看错了),满足不了楼主的需求啊...  发表于 2019-7-2 22:09

评分

参与人数 2赞 +2 收起 理由
xjzsq + 1 认可答案
白嫩白嫩的 + 1 我很赞同

查看全部评分

个人RM交流群:568785370,目前在该群发布Ganfly系列插件
回复 1 0

使用道具 举报

梦石
2
星屑
34507
在线时间
614 小时
注册时间
2014-7-18
回帖
647

MZ评测员开拓者

发表于 2019-7-2 22:02:13 | 显示全部楼层
本帖最后由 xjzsq 于 2019-7-2 22:03 编辑
oscar1543689 发表于 2019-7-2 13:15
新增的物品栏对应的物品显示不出来,第二個keyitem我只是隨便找張圖應付一下, ...

首先,楼主请善用回复功能,不要在最下面那里写回复,这样我这里没有提醒...
请点击我这楼的回复按钮来回复。
经过看你的代码,我发现你在1373行增加了
  1.     case 'AllItems':
  2.             return DataManager.isItem(item);
复制代码

试图在最后一栏显示所有物品,但是在原来的物品菜单选项中AllItems这个选项是不存在的...
mog脚本并不是重写了这个菜单,而只是给这个菜单加了一个壳,case ‘xxx’中的'xxx'对应的是Window_ItemCategory.prototype.makeCommandList这个函数里面命令列表中对应的命令键值(你可以去mv自带脚本那里搜一下)。
如果你想再增加一个物品选项,就必须修改Window_ItemCategory这个类,在其他选项后面再增加一个键值为'AllItem'的选项。这样才能实现你的要求。
如果你想解决这个问题,那么请在脚本的最后加上:
  1. Window_ItemCategory.prototype.maxCols = function() {
  2.     return 5;
  3. };
  4. var _mclist = Window_ItemCategory.prototype.makeCommandList;
  5. Window_ItemCategory.prototype.makeCommandList = function() {
  6.         _mclist.call(this);
  7.         this.addCommand("全部物品",'AllItems');
  8. };
复制代码

这样最后一个选项就可以实现显示全部物品的功能了。

看了一晚上,累死我了,不过解决问题了就好...
回复

使用道具 举报

梦石
0
星屑
3465
在线时间
359 小时
注册时间
2017-5-3
回帖
45
 楼主| 发表于 2019-7-3 20:58:24 | 显示全部楼层
感謝大神
回复

使用道具 举报

梦石
0
星屑
83
在线时间
12 小时
注册时间
2020-3-29
回帖
4
发表于 2020-3-30 11:48:30 | 显示全部楼层
xjzsq 发表于 2019-7-2 22:02
首先,楼主请善用回复功能,不要在最下面那里写回复,这样我这里没有提醒...
请点击我这楼的回复按钮来回 ...

大佬,能请问一下如果只想保留重要物品这一栏的话,mog_sceneitem要怎么改吗?我用了只保留重要物品的插件,但开了mog插件之后界面还是会有四栏。
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部