查看: 1808|回复: 6

[已经过期] 萌新问下这个插件 显示地图图标按钮为什么无效

[复制链接]
梦石
0
星屑
65
在线时间
90 小时
注册时间
2007-8-14
回帖
23
发表于 2016-8-3 11:58:15 | 显示全部楼层 |阅读模式

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

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

×
萌新的预期:
在地图上显示一些icon,点击打开菜单栏,但是并没有显示出来
修改了插件设置中的icon图标和位置,也不行

QQ图片20160803114801.png



  1. // ============================================================================
  2. // Plug-in: DMV_MapButtons.js
  3. // Version: 1.0.1
  4. // Author: David Bow (Dekita)
  5. // MailTo: [email]dekita@dekyde.com[/email]
  6. // ============================================================================

  7. /*:
  8. * @author Dekita ([url]www.dekyde.com[/url])
  9. *
  10. * @plugindesc This plugin allows for the game map screen to show some
  11. * cool menu buttons that run user defined code upon trigger.
  12. *
  13. * @help
  14. * ============================================================================
  15. * ■ System Information:
  16. * ============================================================================
  17. * This plugin creates upto 25 map buttons that can be used to run almost any
  18. * code you desire. By default, 7 of these buttons trigger the main menu
  19. * scenes, and the rest buttons are left used to allow for expansion with  
  20. * custom plugins that create a new scene.
  21. *
  22. * Each button consists of two states - hot, and cold.
  23. * Cold state means that the button is not being pressed, hot means that it is.
  24. * Each state also has its own image, in this case, an icon. This means that
  25. * each map button is designated two icon id's, one for hot, and one for cold.
  26. *
  27. * Note:
  28. * As of v1.0.1 there is a dedicated page for this system on my website,
  29. * The aforementioned page has some examples of the advanced features this
  30. * system provides. It can be found at the following web address:
  31. * [url]www.dekyde.com/dmv-mapbuttons[/url]
  32. *
  33. * ============================================================================
  34. * ■ Script Calls:
  35. * ============================================================================
  36. * $gameSystem.resetMapButtons();
  37. * \_: Resets all map buttons x, y, icons, function, visible flags to default
  38. *
  39. * $gameSystem.mapButton(id);
  40. * \_: Returns the button sprite for map button 'id'
  41. *
  42. * $gameSystem.mapButtonX(id);
  43. * \_: Returns the button sprite x position for map button 'id'
  44. *
  45. * $gameSystem.setMapButtonX(id, newX);
  46. * | : Sets the x position of map button 'id' to 'newX'
  47. * \_: Returns the new x position, or -1 if invalid id given
  48. *
  49. * $gameSystem.mapButtonY(id);
  50. * \_: Returns the button sprite y position for map button 'id'
  51. *
  52. * $gameSystem.setMapButtonY(id, newY);
  53. * | : Sets the y position of map button 'id' to 'newY'
  54. * \_: Returns the new y position, or -1 if invalid id given
  55. *
  56. * $gameSystem.mapButtonIcon1(id);
  57. * \_: Returns the cold icon for button 'id', or 0 if invalid id given
  58. *
  59. * $gameSystem.mapButtonIcon2(id);
  60. * \_: Returns the hot icon for button 'id', or 0 if invalid id given
  61. *
  62. * $gameSystem.setMapButtonIcons(id, icon1, icon2);
  63. * | : Sets button 'id's cold icon to 'icon1', and hot icon to 'icon2'
  64. * \_: Returns true if icons changed, false otherwise
  65. *
  66. * $gameSystem.mapButtonVisible(id);
  67. * \_: Returns the visibility for button 'id', or false if invalid id given
  68. *
  69. * $gameSystem.setMapButtonVisible(id, visiBool);
  70. * | : Sets the visibility of button 'id' to 'visiBool'
  71. * \_: Returns the new visibility for button 'id', or false if invalid id given
  72. *
  73. * $gameSystem.mapButtonFunk();
  74. * \_: Returns the function string for button 'id', or false if invalid id
  75. *
  76. * $gameSystem.setMapButtonFunk(id, newFunkString);
  77. * | : Sets the function for button 'id' to 'newFunkString'
  78. * \_: Returns the new function string for button 'id', or false if invalid id
  79. *
  80. * ============================================================================
  81. * ■ Terms && Conditions:
  82. * ============================================================================
  83. * This plugin is completely free to use, both commercially and privately -
  84. * Providing the following copy is shown within the project credits;
  85. *
  86. * Copyright (C) 2015 - Dekyde Studios
  87. * Dekyde Studios Developer: Dekita - dekita(at)dekyde.com
  88. *
  89. * Additionally, this header should remain intact at all times.
  90. *
  91. * You are not allowed to redistribute this plugin directly. Instead, provide
  92. * a link to the following website;
  93. * [url]www.dekyde.com[/url]
  94. *
  95. * ============================================================================
  96. * ■ Financial Contributions:
  97. * ============================================================================
  98. * If you like my work and want to see more of it in the future, I ask that you
  99. * consider offering a financial donation.
  100. *
  101. * Most of the plugins I write are free to use commercially, and many hours of
  102. * work go into each and every one - not including the time spent bug hunting
  103. * and performing optimization modifications.
  104. *
  105. * If you do wish to provide your support, you can do so at the following link;
  106. * [url]www.patreon.com/Dekita[/url]
  107. *
  108. * ============================================================================
  109. * ■ Stay Up To Date:
  110. * ============================================================================
  111. * I advise that you check regularly to see if any of the plugins you use
  112. * have been updated. The plugin updates will include things like bugfixes and
  113. * new features, so it is highly recommended.
  114. *
  115. * You can get the latest versions of my Mv plugins from [url]www.dekyde.com/DMV[/url]
  116. *
  117. * ============================================================================
  118. * ■ Change Log:
  119. * ============================================================================
  120. * v.1.0.1 - Changed plugin name from DMV_MapMenuButtons to DMV_MapButtons,
  121. *         - Complete overhaul to button containers structure,
  122. *         - Increased possible buttons from 9 to 25,
  123. *         - Added script call: $gameSystem.resetMapButtons();
  124. *         - Added script call: $gameSystem.mapButton();
  125. *         - Added script call: $gameSystem.mapButtonX();
  126. *         - Added script call: $gameSystem.mapButtonY();
  127. *         - Added script call: $gameSystem.setMapButtonX();
  128. *         - Added script call: $gameSystem.setMapButtonY();
  129. *         - Added script call: $gameSystem.mapButtonIcon1();
  130. *         - Added script call: $gameSystem.mapButtonIcon2();
  131. *         - Added script call: $gameSystem.setMapButtonIcons();
  132. *         - Added script call: $gameSystem.mapButtonVisible();
  133. *         - Added script call: $gameSystem.setMapButtonVisible();
  134. *         - Added script call: $gameSystem.mapButtonFunk();
  135. *         - Added script call: $gameSystem.setMapButtonFunk();
  136. * v.1.0.0 - Initial Release,
  137. *
  138. * ============================================================================
  139. *  [url]www.dekyde.com[/url]
  140. * ============================================================================
  141. * @param Button 1 Data
  142. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  143. * Default: 466, 2, 321, 337, 1
  144. * @default 466, 2, 321, 337, 1
  145. *
  146. * @param Button 1 Func
  147. * @desc Sets the function used for when button 1 is triggered
  148. * @default SceneManager.push(Scene_Item)
  149. *
  150. * @param Button 2 Data
  151. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  152. * Default: 500, 2, 323, 339, 1
  153. * @default 500, 2, 323, 339, 1
  154. *
  155. * @param Button 2 Func
  156. * @desc Sets the function used for when button 2 is triggered
  157. * @default $gameParty.setMenuActor($gameParty.leader());SceneManager.push(Scene_Skill)
  158. *
  159. * @param Button 3 Data
  160. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  161. * Default: 534, 2, 324, 340, 1
  162. * @default 534, 2, 324, 340, 1
  163. *
  164. * @param Button 3 Func
  165. * @desc Sets the function used for when button 3 is triggered
  166. * @default $gameParty.setMenuActor($gameParty.leader());SceneManager.push(Scene_Equip)
  167. *
  168. * @param Button 4 Data
  169. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  170. * Default: 568, 2, 326, 342, 1
  171. * @default 568, 2, 326, 342, 1
  172. *
  173. * @param Button 4 Func
  174. * @desc Sets the function used for when button 4 is triggered
  175. * @default $gameParty.setMenuActor($gameParty.leader());SceneManager.push(Scene_Status)
  176. *
  177. * @param Button 5 Data
  178. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  179. * Default: 602, 2, 329, 345, 1
  180. * @default 602, 2, 329, 345, 1
  181. *
  182. * @param Button 5 Func
  183. * @desc Sets the function used for when button 5 is triggered
  184. * @default SceneManager.push(Scene_Options)
  185. *
  186. * @param Button 6 Data
  187. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  188. * Default: 636, 2, 331, 347, 1
  189. * @default 636, 2, 331, 347, 1
  190. *
  191. * @param Button 6 Func
  192. * @desc Sets the function used for when button 6 is triggered
  193. * @default SceneManager.push(Scene_Save)
  194. *
  195. * @param Button 7 Data
  196. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  197. * Default: 670, 2, 332, 348, 1
  198. * @default 670, 2, 332, 348, 1
  199. *
  200. * @param Button 7 Func
  201. * @desc Sets the function used for when button 7 is triggered
  202. * @default SceneManager.push(Scene_GameEnd)
  203. *
  204. * @param Button 8 Data
  205. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  206. * Default: -1, -1, 0, 0, 0
  207. * @default -1, -1, 0, 0, 0
  208. *
  209. * @param Button 8 Func
  210. * @desc Sets the function used for when button 8 is triggered
  211. * @default null
  212. *
  213. * @param Button 9 Data
  214. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  215. * Default: -1, -1, 0, 0, 0
  216. * @default -1, -1, 0, 0, 0
  217. *
  218. * @param Button 9 Func
  219. * @desc Sets the function used for when button 9 is triggered
  220. * @default null
  221. *
  222. * @param Button 10 Data
  223. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  224. * Default: -1, -1, 0, 0, 0
  225. * @default -1, -1, 0, 0, 0
  226. *
  227. * @param Button 10 Func
  228. * @desc Sets the function used for when button 10 is triggered
  229. * @default null
  230. *
  231. * @param Button 11 Data
  232. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  233. * Default: -1, -1, 0, 0, 0
  234. * @default -1, -1, 0, 0, 0
  235. *
  236. * @param Button 11 Func
  237. * @desc Sets the function used for when button 11 is triggered
  238. * @default null
  239. *
  240. * @param Button 12 Data
  241. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  242. * Default: -1, -1, 0, 0, 0
  243. * @default -1, -1, 0, 0, 0
  244. *
  245. * @param Button 12 Func
  246. * @desc Sets the function used for when button 12 is triggered
  247. * @default null
  248. *
  249. * @param Button 13 Data
  250. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  251. * Default: -1, -1, 0, 0, 0
  252. * @default -1, -1, 0, 0, 0
  253. *
  254. * @param Button 13 Func
  255. * @desc Sets the function used for when button 13 is triggered
  256. * @default null
  257. *
  258. * @param Button 14 Data
  259. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  260. * Default: -1, -1, 0, 0, 0
  261. * @default -1, -1, 0, 0, 0
  262. *
  263. * @param Button 14 Func
  264. * @desc Sets the function used for when button 14 is triggered
  265. * @default null
  266. *
  267. * @param Button 15 Data
  268. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  269. * Default: -1, -1, 0, 0, 0
  270. * @default -1, -1, 0, 0, 0
  271. *
  272. * @param Button 15 Func
  273. * @desc Sets the function used for when button 15 is triggered
  274. * @default null
  275. *
  276. * @param Button 16 Data
  277. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  278. * Default: -1, -1, 0, 0, 0
  279. * @default -1, -1, 0, 0, 0
  280. *
  281. * @param Button 16 Func
  282. * @desc Sets the function used for when button 16 is triggered
  283. * @default null
  284. *
  285. * @param Button 17 Data
  286. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  287. * Default: -1, -1, 0, 0, 0
  288. * @default -1, -1, 0, 0, 0
  289. *
  290. * @param Button 17 Func
  291. * @desc Sets the function used for when button 17 is triggered
  292. * @default null
  293. *
  294. * @param Button 18 Data
  295. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  296. * Default: -1, -1, 0, 0, 0
  297. * @default -1, -1, 0, 0, 0
  298. *
  299. * @param Button 18 Func
  300. * @desc Sets the function used for when button 18 is triggered
  301. * @default null
  302. *
  303. * @param Button 19 Data
  304. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  305. * Default: -1, -1, 0, 0, 0
  306. * @default -1, -1, 0, 0, 0
  307. *
  308. * @param Button 19 Func
  309. * @desc Sets the function used for when button 19 is triggered
  310. * @default null
  311. *
  312. * @param Button 20 Data
  313. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  314. * Default: -1, -1, 0, 0, 0
  315. * @default -1, -1, 0, 0, 0
  316. *
  317. * @param Button 20 Func
  318. * @desc Sets the function used for when button 20 is triggered
  319. * @default null
  320. *
  321. * @param Button 21 Data
  322. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  323. * Default: -1, -1, 0, 0, 0
  324. * @default -1, -1, 0, 0, 0
  325. *
  326. * @param Button 21 Func
  327. * @desc Sets the function used for when button 21 is triggered
  328. * @default null
  329. *
  330. * @param Button 22 Data
  331. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  332. * Default: -1, -1, 0, 0, 0
  333. * @default -1, -1, 0, 0, 0
  334. *
  335. * @param Button 22 Func
  336. * @desc Sets the function used for when button 22 is triggered
  337. * @default null
  338. *
  339. * @param Button 23 Data
  340. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  341. * Default: -1, -1, 0, 0, 0
  342. * @default -1, -1, 0, 0, 0
  343. *
  344. * @param Button 23 Func
  345. * @desc Sets the function used for when button 23 is triggered
  346. * @default null
  347. *
  348. * @param Button 24 Data
  349. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  350. * Default: -1, -1, 0, 0, 0
  351. * @default -1, -1, 0, 0, 0
  352. *
  353. * @param Button 24 Func
  354. * @desc Sets the function used for when button 24 is triggered
  355. * @default null
  356. *
  357. * @param Button 25 Data
  358. * @desc Sets x, y, coldIcon, hotIcon, and visibility flag
  359. * Default: -1, -1, 0, 0, 0
  360. * @default -1, -1, 0, 0, 0
  361. *
  362. * @param Button 25 Func
  363. * @desc Sets the function used for when button 25 is triggered
  364. * @default null
  365. */

  366. /**
  367. * Checks for DMV Core plugin and register if available
  368. */
  369. (function(){
  370.   if (typeof DMV === 'undefined') {
  371.     var strA = "You need to install the DMV_Core plugin ";
  372.     var strB = "in order for other DMV plugins to work!";
  373.     throw new Error(strA + strB);
  374.   }else{
  375.     if (!DMV.require("DMV_Core","1.0.1")){
  376.       throw new Error("Your copy of DMV Core is outdated, please update!!");
  377.     };
  378.     DMV.register("MapButtons", "1.0.1", "16/11/2o15");
  379.   }
  380. })();

  381. /**
  382. * AnonomousFunction(DMV)
  383. */
  384. (function($){
  385.   /**
  386.    * Use strict mode
  387.    */
  388.   "use strict";
  389.   
  390.   /**
  391.    * params
  392.    * Holds all parameters for this plugin
  393.    */
  394.   var params = PluginManager.parameters('DMV_MapButtons');

  395.   /**
  396.    * button_size
  397.    * Holds integer for number of default button params to read
  398.    */
  399.   var button_size = 25;

  400.   /**
  401.    * DMV.createMapButton(icon1, icon2, parent)
  402.    * @param icon1 the icon to show for buttons cold frame
  403.    * @param icon2 the icon to show for buttons hot frame
  404.    * @param parent [optional] if given will call addChild
  405.    *        to add the button into the parents child list
  406.    * [url=home.php?mod=space&uid=352621]@return[/url] new button
  407.    */
  408.   $.createMapButton = function(parent, id) {
  409.     var button = new $.Sprite.MapButton(id);
  410.     button.bitmap = ImageManager.loadSystem('IconSet');
  411.     var icon1 = $gameSystem.mapButtonIcon1(id);
  412.     var icon2 = $gameSystem.mapButtonIcon2(id);
  413.     button.setBothFrames(icon1, icon2);
  414.     if (parent !== undefined && parent.addChild){
  415.       parent.addChild(button);
  416.     };
  417.     return button;
  418.   };

  419.   /**\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  420.    * DMV.Sprite.MapButton.prototype Variables && Functions
  421.    **/////////////////////////////////////////////////////
  422.   $.Sprite.MapButton = $.extend(Sprite_Button);
  423.   (function (mapbutt){
  424.     /**
  425.      * DMV.Sprite.MapButton.prototype.initialize(buttID);
  426.      * @param buttID the id of this button
  427.      * Initializes the map button
  428.      */
  429.     var initialize = mapbutt.initialize;
  430.     mapbutt.initialize = function(buttID) {
  431.       initialize.apply(this, arguments);
  432.       this._map_butt_id = buttID;
  433.     };
  434.     /**
  435.      * DMV.Sprite.MapButton.prototype.isButtonTouched();
  436.      * @return true if button is being touched and  
  437.      * game message is not showing, false otherwise.
  438.      */
  439.     var isButtonTouched = mapbutt.isButtonTouched;
  440.     mapbutt.isButtonTouched = function(){
  441.       return !$gameMessage.isBusy() && isButtonTouched.apply(this, arguments);
  442.     }

  443.     /**
  444.      * DMV.Sprite.MapButton.prototype.setBothFrames(icon1, icon2);
  445.      * @param icon1 the icon to show for buttons cold frame
  446.      * @param icon2 the icon to show for buttons hot frame
  447.      */
  448.     mapbutt.setBothFrames = function(icon1, icon2){
  449.       var bw = Window_Base._iconWidth, bh = Window_Base._iconHeight;
  450.       this.setColdFrame(icon1%16*bw, Math.floor(icon1/16)*bh, bw, bh);
  451.       this.setHotFrame(icon2%16*bw, Math.floor(icon2/16)*bh ,bw, bh);
  452.     }

  453.     /**
  454.      * DMV.Sprite.MapButton.prototype.callClickHandler();
  455.      * Calls the function associated with this button.
  456.      */
  457.     mapbutt.callClickHandler = function() {
  458.       var funk = $gameSystem.mapButtonFunk(this._map_butt_id);
  459.       if (funk) { Function(funk).apply(this, arguments) };
  460.     };

  461.     /**
  462.      * DMV.Sprite.MapButton.prototype.update();
  463.      * Updates this button and ensures the visibility, x, and y
  464.      * values for the sprite are also updated accordingly.
  465.      */
  466.     var update = mapbutt.update;
  467.     mapbutt.update = function() {
  468.       update.apply(this, arguments);
  469.       this.visible = $gameSystem.mapButtonVisible(this._map_butt_id);
  470.       this.x = $gameSystem.mapButtonX(this._map_butt_id);
  471.       this.y = $gameSystem.mapButtonY(this._map_butt_id);
  472.     };
  473.     /**
  474.      * End DMV.Sprite.MapButton.prototype declarations
  475.      */
  476.   })($.Sprite.MapButton.prototype);


  477.   /**\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  478.    * Spriteset_Map.prototype Variables && Functions
  479.    **//////////////////////////////////////////////
  480.   (function (sprmap) {
  481.     /**
  482.      * Spriteset_Map.prototype.createUpperLayer();
  483.      * Calls previous function definition and then creates
  484.      * all the menu buttons that should be shown on the map
  485.      */
  486.     var createUpper = sprmap.createUpperLayer;
  487.     sprmap.createUpperLayer = function() {
  488.       createUpper.apply(this, arguments);
  489.       this.createMapButtons();
  490.     };

  491.     /**
  492.      * Spriteset_Map.prototype.createMapButtons();
  493.      * Adds all menu buttons that should be shown onto the spriteset.
  494.      */
  495.     sprmap.createMapButtons = function() {
  496.       this._mapButtons = [];
  497.       var button, funktn, x, y, i;
  498.       for (i=0; i < button_size; i++){
  499.         x = $gameSystem.mapButtonX(i);
  500.         y = $gameSystem.mapButtonY(i);
  501.         if (x != -1 && y != -1){
  502.           button = DMV.createMapButton(this, i);
  503.         }else{
  504.           button = false;
  505.         };
  506.         this._mapButtons.push(button);
  507.       };
  508.     };
  509.     /**
  510.      * End Spriteset_Map.prototype declarations
  511.      */
  512.   })(Spriteset_Map.prototype);


  513.   /**\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  514.    * Game_Temp.prototype Variables && Functions
  515.    **//////////////////////////////////////////
  516.   (function (temp) {
  517.     /**
  518.      * Game_Temp.prototype.map_buttons
  519.      * @return the maps buttons sprite array, if on the map of course.
  520.      */
  521.     $.reader(temp,'map_buttons', function(){
  522.       var a = SceneManager._scene._spriteset;
  523.       return $.isScene(Scene_Map) && a ? a._mapButtons : [];
  524.     });

  525.     /**
  526.      * Game_Temp.prototype.setDestinationNotaButton()
  527.      * Ensures a button was not pressed at the current TouchInput x && y
  528.      * Called internally from within Game_Temp.setDestination();
  529.      * @return false if input was within the space of a button.
  530.      * @return true otherwise.
  531.      */
  532.     temp.setDestinationNotaButton = function(){
  533.       var bt, ix, iy;
  534.       var x = TouchInput.x;
  535.       var y = TouchInput.y;
  536.       var s = this.map_buttons.length;
  537.       for (var i = 0; i < s; i++){
  538.         bt = this.map_buttons[i];
  539.         ix = (x >= bt.x) && (x <= bt.x + bt.width);
  540.         iy = (y >= bt.y) && (y <= bt.y + bt.height);
  541.         if (ix && iy) {return false};
  542.       };
  543.       return true;
  544.     };

  545.     /**
  546.      * Game_Temp.prototype.setDestination(x,y)
  547.      * Ensures a button is not pressed at the desired
  548.      * point and if not, allows the previous definition
  549.      * to be called which will make the player move.
  550.      */
  551.     var setDest = temp.setDestination;
  552.     temp.setDestination = function(x, y) {
  553.       if (this.setDestinationNotaButton()){
  554.         setDest.apply(this, arguments);
  555.       };
  556.     };
  557.     /**
  558.      * End Game_Temp.prototype declarations
  559.      */
  560.   })(Game_Temp.prototype);


  561.   /**\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  562.    * Game_System.prototype Variables && Functions
  563.    **////////////////////////////////////////////
  564.   (function (syst){
  565.     /**
  566.      * Game_System.prototype.initialize();
  567.      * Initializes the button data for the game
  568.      */
  569.     var initialize = syst.initialize;
  570.     syst.initialize = function() {
  571.       initialize.apply(this, arguments);
  572.       this.resetMapButtons();
  573.     };

  574.     /**
  575.      * Game_System.prototype.resetMapButtons();
  576.      * Resets the button data for the game
  577.      */
  578.     syst.resetMapButtons = function(){
  579.       this._mapButtonDatas = [null];
  580.       this._mapButtonFunks = [null];
  581.       for (var i = 1; i <= button_size; i++) {
  582.         var string = 'Button ' + i + ' ';
  583.         this._mapButtonDatas.push($.mapParams2n(params[string+'Data']));
  584.         this._mapButtonFunks.push(params[string+'Func']);
  585.       };
  586.     };
  587.    
  588.     /**
  589.      * Game_System.prototype.isMapButt(id);
  590.      * @param id the button id to ensure is valid
  591.      * @return true or false, based on if button is valid
  592.      */
  593.     syst.isMapButt = function(id){
  594.       return id > 0 && id <= button_size;
  595.     };

  596.     /**
  597.      * Game_System.prototype.mapButton(id);
  598.      * @param id the id of the button to get
  599.      * @return the button sprite if valid, else null
  600.      */
  601.     syst.mapButton = function(id) {
  602.       return this.isMapButt(id) ? $gameTemp.map_buttons[id] : null;
  603.     }
  604.    
  605.     /**
  606.      * Game_System.prototype.mapButtonX(id);
  607.      * @param id the id of the button to check
  608.      * @return the button's x position if valid, else -1
  609.      */
  610.     syst.mapButtonX = function(id){
  611.       return this.isMapButt(id) ? this._mapButtonDatas[id][0] : -1;
  612.     };
  613.    
  614.     /**
  615.      * Game_System.prototype.setMapButtonX(id, newX);
  616.      * @param id the id of the button to check
  617.      * @param newX the new x position to set for the button id
  618.      * @return buttons new y position if valid
  619.      * @return false if not valid button
  620.      */
  621.     syst.setMapButtonX = function(id, newX){
  622.       return this.isMapButt(id) ? this._mapButtonDatas[id][0] = newX : false;
  623.     };
  624.    
  625.     /**
  626.      * Game_System.prototype.mapButtonY(id);
  627.      * @param id the id of the button to check
  628.      * @return the button's y position if valid, else -1
  629.      */
  630.     syst.mapButtonY = function(id){
  631.       return this.isMapButt(id) ? this._mapButtonDatas[id][1] : -1;
  632.     };
  633.    
  634.     /**
  635.      * Game_System.prototype.setMapButtonY(id, newY);
  636.      * @param id the id of the button to check
  637.      * @param newY the new y position to set for the button id
  638.      * @return buttons new y position if valid
  639.      * @return false if not valid button
  640.      */
  641.     syst.setMapButtonY = function(id, newY){
  642.       return this.isMapButt(id) ? this._mapButtonDatas[id][1] = newY : false;
  643.     };
  644.    
  645.     /**
  646.      * Game_System.prototype.mapButtonIcon1(id);
  647.      * @param id the id of the button to check
  648.      * @return the button's cold icon id if valid, else 0
  649.      */
  650.     syst.mapButtonIcon1 = function(id){
  651.       return this.isMapButt(id) ? this._mapButtonDatas[id][2] : 0;
  652.     };

  653.     /**
  654.      * Game_System.prototype.mapButtonIcon2(id);
  655.      * @param id the id of the button to check
  656.      * @return the button's hot icon id if valid, else 0
  657.      */
  658.     syst.mapButtonIcon2 = function(id){
  659.       return this.isMapButt(id) ? this._mapButtonDatas[id][3] : 0;
  660.     };

  661.     /**
  662.      * Game_System.prototype.setMapButtonIcons(id, icon1, icon2);
  663.      * @param id the id of the button to change icons of
  664.      * @param icon1 the icon to use for the cold icon for this button
  665.      * @param icon2 the icon to use for the hot icon for this button
  666.      * @return true if button icons changed, false otherwise
  667.      */
  668.     syst.setMapButtonIcons = function(buttonID, icon1, icon2){
  669.       var button;
  670.       if (this.isMapButt(buttonID)){
  671.         this._mapButtonDatas[buttonID][2] = icon1;
  672.         this._mapButtonDatas[buttonID][3] = icon2;
  673.         if (button = this.mapButton(buttonID)){
  674.           button.setBothFrames(icon1, icon2);
  675.           return true;
  676.         }
  677.       }
  678.       return false;
  679.     };

  680.     /**
  681.      * Game_System.prototype.mapButtonVisible(id);
  682.      * @param id the id of the button to check
  683.      * @return the button visibility flag if valid button, or false
  684.      */
  685.     syst.mapButtonVisible = function(id){
  686.       return this.isMapButt(id) ? this._mapButtonDatas[id][4] : false;
  687.     };

  688.     /**
  689.      * Game_System.prototype.setMapButtonVisible(id, visiBool);
  690.      * @param id the id of the button to check
  691.      * @param visiBool the boolean to use to set this buttons visibility
  692.      */
  693.     syst.setMapButtonVisible = function(id, visiBool){
  694.       return this.isMapButt(id) ? this._mapButtonDatas[id][4] = visiBool : false;
  695.     };

  696.     /**
  697.      * Game_System.prototype.mapButtonFunk(id);
  698.      * @param id the id of the button to check
  699.      * @return the buttons function string if valid, or false
  700.      */
  701.     syst.mapButtonFunk = function(id){
  702.       return this.isMapButt(id) ? this._mapButtonFunks[id] : false;
  703.     };
  704.    
  705.     /**
  706.      * Game_System.prototype.setMapButtonFunk(id, newFunkString);
  707.      * @param id the id of the button to change functions of
  708.      * @param newFunkString the new function string to use for button id
  709.      */
  710.     syst.setMapButtonFunk = function(id, newFunkString){
  711.       return this.isMapButt(id) ? this._mapButtonFunks[id] = newFunkString : false;
  712.     };
  713.     /**
  714.      * End Game_System.prototype declarations
  715.      */
  716.   })(Game_System.prototype);


  717.   /**\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  718.    * Scene Variables && Functions
  719.    **////////////////////////////

  720.   /**
  721.    * [ private ] aliasSceneStart(sceneProto)
  722.    * Ensures the status window is refreshed upon scene start
  723.    * This fixes a bug where actors faces would not show.
  724.    */
  725.   function aliasSceneStart(sceneProto) {
  726.     var sceneProto_start = sceneProto.prototype.start;
  727.     sceneProto.prototype.start = function() {
  728.       sceneProto_start.apply(this, arguments);
  729.       if (this._statusWindow){
  730.         this._statusWindow.refresh();
  731.       };
  732.     };
  733.   };

  734.   /**
  735.    * Scene_Status.prototype.start()
  736.    */
  737.   aliasSceneStart(Scene_Status);

  738.   /**
  739.    * Scene_Equip.prototype.start()
  740.    * @note this has no effect unless using a custon script
  741.    *  that would show the actor face within equip scene
  742.    */
  743.   aliasSceneStart(Scene_Equip);

  744.   /**
  745.    * Scene_Skill.prototype.start()
  746.    */
  747.   aliasSceneStart(Scene_Skill);
  748.   
  749.   /**
  750.    * End declarations
  751.    */
  752. })(DMV)
  753. /**
  754. * End Plugin
  755. * [url]www.dekyde.com[/url]
  756. */
复制代码
梦石
0
星屑
65
在线时间
90 小时
注册时间
2007-8-14
回帖
23
 楼主| 发表于 2016-8-3 23:54:21 | 显示全部楼层
新人无人权呀
回复 0 1

使用道具 举报

梦石
0
星屑
65
在线时间
90 小时
注册时间
2007-8-14
回帖
23
 楼主| 发表于 2016-8-10 15:32:23 | 显示全部楼层
单机版论坛

点评

我已经等了一周多啦=。=就吐槽下  发表于 2016-8-10 19:59
表示反对,问问题要有耐心  发表于 2016-8-10 18:08
回复 0 1

使用道具 举报

梦石
0
星屑
647
在线时间
165 小时
注册时间
2012-4-18
回帖
237
发表于 2016-12-9 21:48:15 | 显示全部楼层
时隔4个月的回答,说明现在论坛真的很冷,只有当我这种半新不新的人需要插件,自己有没法写出来,只能出来找的时候,才会看到萌新的辛酸,就想看当年的自己= =、
你这个问题,我才,应该是缺少DMV_Core,这个插件应该是需要和DMV_Core一起用,才能生效的吧。我猜的哟……
回复

使用道具 举报

梦石
0
星屑
55
在线时间
407 小时
注册时间
2011-4-10
回帖
352
发表于 2016-12-10 09:00:35 | 显示全部楼层
新人不新人的,不是做伸手党的理由。细心并不是只有老手才能具备的品质。发帖提问之前,你有仔细看过插件的内容吗?
sp161210_085724.jpg
有这几个月的时间去等待、去吐槽,难道不能回头看一下插件找找问题在哪儿吗?
回复 2 0

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部