Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. //=============================================================================
  2. // AltMenuScreen3.js
  3. //=============================================================================
  4.  
  5. /*:
  6. * @plugindesc Yet Another menu screen layout.
  7. * @author Sasuke KANNAZUKI, Yoji Ojima
  8. *
  9. * @default
  10. * @param bgBitmapMenu
  11. * @desc background bitmap file at menu scene. put at img/pictures.
  12. * @default
  13. *
  14. * @param bgBitmapItem
  15. * @desc background bitmap file at item scene. put at img/pictures.
  16. * @default
  17. *
  18. * @param bgBitmapSkill
  19. * @desc background bitmap file at skill scene. put at img/pictures.
  20. * @default
  21. *
  22. * @param bgBitmapEquip
  23. * @desc background bitmap file at equip scene. put at img/pictures.
  24. * @default
  25. *
  26. * @param bgBitmapStatus
  27. * @desc background bitmap file at status scene. put at img/pictures.
  28. * @default
  29. *
  30. * @param bgBitmapOptions
  31. * @desc background bitmap file at option scene. put at img/pictures.
  32. * @default
  33. *
  34. * @param bgBitmapFile
  35. * @desc background bitmap file at save/load scene. put at img/pictures.
  36. * @default
  37. *
  38. * @param bgBitmapGameEnd
  39. * @desc background bitmap file at gameEnd scene. put at img/pictures.
  40. * @default
  41. *
  42. * @param maxColsMenu
  43. * @desc max column at menu window
  44. * @default 4
  45. *
  46. * @param commandRows
  47. * @desc number of visible rows at command window
  48. * @default 2
  49. *
  50. * @param isDisplayStatus
  51. * @desc whether display status or not. (1 = yes, 0 = no)
  52. * @default 1
  53. *
  54. * @help This plugin does not provide plugin commands.
  55. * The differences with AltMenuscreen are follows:
  56. * - windows are transparent at all menu scene.
  57. * - it can set the background bitmap for each scenes at menu.
  58. * - picture is actors' original
  59. *
  60. * Actor' note:
  61. * <stand_picture:filename> set actor's standing picture at menu.
  62. * put file at img/pictures.
  63. *
  64. * preferred size of actor's picture:
  65. * width: 174px(maxColsMenu=4), 240px(maxColsMenu=3)
  66. * height: 408px(commandRows=2), 444px(commandRows=1)
  67. */
  68.  
  69. /*:ja
  70. * @plugindesc レイアウトの異なるメニュー画面
  71. * @author 神無月サスケ, Yoji Ojima
  72. *
  73. * @param bgBitmapMenu
  74. * @desc メニュー背景にするビットマップファイルです。
  75. * img/pictures に置いてください。
  76. * @default
  77. *
  78. * @param bgBitmapItem
  79. * @desc アイテム画面背景にするビットマップファイルです。
  80. * img/pictures に置いてください。
  81. * @default
  82. *
  83. * @param bgBitmapSkill
  84. * @desc スキル画面背景にするビットマップファイルです。
  85. * img/pictures に置いてください。
  86. * @default
  87. *
  88. * @param bgBitmapEquip
  89. * @desc 装備画面背景にするビットマップファイルです。
  90. * img/pictures に置いてください。
  91. * @default
  92. *
  93. * @param bgBitmapStatus
  94. * @desc ステータス画面背景にするビットマップファイルです。
  95. * img/pictures に置いてください。
  96. * @default
  97. *
  98. * @param bgBitmapOptions
  99. * @desc オプション画面背景にするビットマップファイルです。
  100. * img/pictures に置いてください。
  101. * @default
  102. *
  103. * @param bgBitmapFile
  104. * @desc セーブ/ロード画面背景にするビットマップファイルです。
  105. * img/pictures に置いてください。
  106. * @default
  107. *
  108. * @param bgBitmapGameEnd
  109. * @desc ゲーム終了画面背景にするビットマップファイルです。
  110. * img/pictures に置いてください。
  111. * @default
  112. *
  113. * @param maxColsMenu
  114. * @desc アクターを表示するウィンドウの1画面の登録最大数です。
  115. * @default 4
  116. *
  117. * @param commandRows
  118. * @desc コマンドウィンドウの行数です。
  119. * @default 2
  120. *
  121. * @param isDisplayStatus
  122. * @desc ステータスを表示するかしないかを選びます。(1 = yes, 0 = no)
  123. * @default 1
  124. *
  125. * @help このプラグインには、プラグインコマンドはありません。
  126. *
  127. * AltMenuscreen との違いは以下です:
  128. * - メニュー画面すべてのウィンドウが透明です
  129. * - メニューそれぞれのシーンに背景ビットマップを付けることが出来ます。
  130. * - アクターに立ち絵を利用します。
  131. *
  132. * アクターのメモに以下のように書いてください:
  133. * <stand_picture:ファイル名> ファイル名が、そのアクターの立ち絵になります。
  134. * ファイルは img/pictures に置いてください。
  135. *
  136. * 望ましいアクター立ち絵のサイズ:
  137. * 幅:3列:240px, 4列:174px
  138. * 高さ: コマンドウィンドウ 1行:444px 2行:408px
  139. *
  140. */
  141.  
  142. (function() {
  143.  
  144. // set parameters
  145. var parameters = PluginManager.parameters('AltMenuScreen3');
  146. var bgBitmapMenu = parameters['bgBitmapMenu'] || '';
  147. var bgBitmapItem = parameters['bgBitmapItem'] || '';
  148. var bgBitmapSkill = parameters['bgBitmapSkill'] || '';
  149. var bgBitmapEquip = parameters['bgBitmapEquip'] || '';
  150. var bgBitmapStatus = parameters['bgBitmapStatus'] || '';
  151. var bgBitmapOptions = parameters['bgBitmapOptions'] || '';
  152. var bgBitmapFile = parameters['bgBitmapFile'] || '';
  153. var bgBitmapGameEnd = parameters['bgBitmapGameEnd'] || '';
  154. var maxColsMenuWnd = Number(parameters['maxColsMenu'] || 4);
  155. var rowsCommandWnd = Number(parameters['commandRows'] || 2);
  156. var isDisplayStatus = !!Number(parameters['isDisplayStatus']);
  157.  
  158. //
  159. // make transparent windows for each scenes in menu.
  160. //
  161. var _Scene_Menu_create = Scene_Menu.prototype.create;
  162. Scene_Menu.prototype.create = function() {
  163. _Scene_Menu_create.call(this);
  164. this._statusWindow.x = 0;
  165. this._statusWindow.y = this._commandWindow.height;
  166. this._goldWindow.x = Graphics.boxWidth - this._goldWindow.width;
  167. // make transparent for all windows at menu scene.
  168. this._statusWindow.opacity = 0;
  169. this._goldWindow.opacity = 0;
  170. this._commandWindow.opacity = 0;
  171. };
  172.  
  173. var _Scene_Item_create = Scene_Item.prototype.create;
  174. Scene_Item.prototype.create = function() {
  175. _Scene_Item_create.call(this);
  176. this._helpWindow.opacity = 0;
  177. this._categoryWindow.opacity = 0;
  178. this._itemWindow.opacity = 0;
  179. this._actorWindow.opacity = 0;
  180. };
  181.  
  182. var _Scene_Skill_create = Scene_Skill.prototype.create;
  183. Scene_Skill.prototype.create = function() {
  184. _Scene_Skill_create.call(this);
  185. this._helpWindow.opacity = 0;
  186. this._skillTypeWindow.opacity = 0;
  187. this._statusWindow.opacity = 0;
  188. this._itemWindow.opacity = 0;
  189. this._actorWindow.opacity = 0;
  190. };
  191.  
  192. var _Scene_Equip_create = Scene_Equip.prototype.create;
  193. Scene_Equip.prototype.create = function() {
  194. _Scene_Equip_create.call(this);
  195. this._helpWindow.opacity = 0;
  196. this._statusWindow.opacity = 0;
  197. this._commandWindow.opacity = 0;
  198. this._slotWindow.opacity = 0;
  199. this._itemWindow.opacity = 0;
  200. };
  201.  
  202. var _Scene_Status_create = Scene_Status.prototype.create;
  203. Scene_Status.prototype.create = function() {
  204. _Scene_Status_create.call(this);
  205. this._statusWindow.opacity = 0;
  206. };
  207.  
  208. var _Scene_Options_create = Scene_Options.prototype.create;
  209. Scene_Options.prototype.create = function() {
  210. _Scene_Options_create.call(this);
  211. this._optionsWindow.opacity = 0;
  212. };
  213.  
  214. var _Scene_File_create = Scene_File.prototype.create;
  215. Scene_File.prototype.create = function() {
  216. _Scene_File_create.call(this);
  217. this._helpWindow.opacity = 0;
  218. this._listWindow.opacity = 0;
  219. };
  220.  
  221. var _Scene_GameEnd_create = Scene_GameEnd.prototype.create;
  222. Scene_GameEnd.prototype.create = function() {
  223. _Scene_GameEnd_create.call(this);
  224. this._commandWindow.opacity = 0;
  225. };
  226.  
  227. //
  228. // load bitmap that set in plugin parameter
  229. //
  230. var _Scene_Menu_createBackground = Scene_Menu.prototype.createBackground;
  231. Scene_Menu.prototype.createBackground = function(){
  232. if(bgBitmapMenu){
  233. this._backgroundSprite = new Sprite();
  234. this._backgroundSprite.bitmap =
  235. ImageManager.loadPicture(bgBitmapMenu);
  236. this.addChild(this._backgroundSprite);
  237. return;
  238. }
  239. // if background file is invalid, it does original process.
  240. _Scene_Menu_createBackground.call(this);
  241. };
  242.  
  243. var _Scene_Item_createBackground = Scene_Item.prototype.createBackground;
  244. Scene_Item.prototype.createBackground = function(){
  245. if(bgBitmapItem){
  246. this._backgroundSprite = new Sprite();
  247. this._backgroundSprite.bitmap =
  248. ImageManager.loadPicture(bgBitmapItem);
  249. this.addChild(this._backgroundSprite);
  250. return;
  251. }
  252. // if background file is invalid, it does original process.
  253. _Scene_Item_createBackground.call(this);
  254. };
  255.  
  256. var _Scene_Skill_createBackground = Scene_Skill.prototype.createBackground;
  257. Scene_Skill.prototype.createBackground = function(){
  258. if(bgBitmapSkill){
  259. this._backgroundSprite = new Sprite();
  260. this._backgroundSprite.bitmap =
  261. ImageManager.loadPicture(bgBitmapSkill);
  262. this.addChild(this._backgroundSprite);
  263. return;
  264. }
  265. // if background file is invalid, it does original process.
  266. _Scene_Skill_createBackground.call(this);
  267. };
  268.  
  269. var _Scene_Equip_createBackground = Scene_Equip.prototype.createBackground;
  270. Scene_Equip.prototype.createBackground = function(){
  271. if(bgBitmapEquip){
  272. this._backgroundSprite = new Sprite();
  273. this._backgroundSprite.bitmap =
  274. ImageManager.loadPicture(bgBitmapEquip);
  275. this.addChild(this._backgroundSprite);
  276. return;
  277. }
  278. // if background file is invalid, it does original process.
  279. _Scene_Equip_createBackground.call(this);
  280. };
  281.  
  282. var _Scene_Status_createBackground =
  283. Scene_Status.prototype.createBackground;
  284. Scene_Status.prototype.createBackground = function(){
  285. if(bgBitmapStatus){
  286. this._backgroundSprite = new Sprite();
  287. this._backgroundSprite.bitmap =
  288. ImageManager.loadPicture(bgBitmapStatus);
  289. this.addChild(this._backgroundSprite);
  290. return;
  291. }
  292. // if background file is invalid, it does original process.
  293. _Scene_Status_createBackground.call(this);
  294. };
  295.  
  296. var _Scene_Options_createBackground =
  297. Scene_Options.prototype.createBackground;
  298. Scene_Options.prototype.createBackground = function(){
  299. if(bgBitmapOptions){
  300. this._backgroundSprite = new Sprite();
  301. this._backgroundSprite.bitmap =
  302. ImageManager.loadPicture(bgBitmapOptions);
  303. this.addChild(this._backgroundSprite);
  304. return;
  305. }
  306. // if background file is invalid, it does original process.
  307. _Scene_Options_createBackground.call(this);
  308. };
  309.  
  310. var _Scene_File_createBackground = Scene_File.prototype.createBackground;
  311. Scene_File.prototype.createBackground = function(){
  312. if(bgBitmapFile){
  313. this._backgroundSprite = new Sprite();
  314. this._backgroundSprite.bitmap =
  315. ImageManager.loadPicture(bgBitmapFile);
  316. this.addChild(this._backgroundSprite);
  317. return;
  318. }
  319. // if background file is invalid, it does original process.
  320. _Scene_File_createBackground.call(this);
  321. };
  322.  
  323. var _Scene_GameEnd_createBackground =
  324. Scene_GameEnd.prototype.createBackground;
  325. Scene_GameEnd.prototype.createBackground = function(){
  326. if(bgBitmapGameEnd){
  327. this._backgroundSprite = new Sprite();
  328. this._backgroundSprite.bitmap =
  329. ImageManager.loadPicture(bgBitmapGameEnd);
  330. this.addChild(this._backgroundSprite);
  331. return;
  332. }
  333. // if background file is invalid, it does original process.
  334. _Scene_GameEnd_createBackground.call(this);
  335. };
  336.  
  337. //
  338. // alt menu screen processes
  339. //
  340. Window_MenuCommand.prototype.windowWidth = function() {
  341. return Graphics.boxWidth;
  342. };
  343.  
  344. Window_MenuCommand.prototype.maxCols = function() {
  345. return 4;
  346. };
  347.  
  348. Window_MenuCommand.prototype.numVisibleRows = function() {
  349. return rowsCommandWnd;
  350. };
  351.  
  352. Window_MenuStatus.prototype.windowWidth = function() {
  353. return Graphics.boxWidth;
  354. };
  355.  
  356. Window_MenuStatus.prototype.windowHeight = function() {
  357. var h1 = this.fittingHeight(1);
  358. var h2 = this.fittingHeight(rowsCommandWnd);
  359. return Graphics.boxHeight - h1 - h2;
  360. };
  361.  
  362. Window_MenuStatus.prototype.maxCols = function() {
  363. return maxColsMenuWnd;
  364. };
  365.  
  366. Window_MenuStatus.prototype.numVisibleRows = function() {
  367. return 1;
  368. };
  369.  
  370. Window_MenuStatus.prototype.drawItemImage = function(index) {
  371. var actor = $gameParty.members()[index];
  372. var rect = this.itemRectForText(index);
  373. // load stand_picture
  374. var bitmapName = $dataActors[actor.actorId()].meta.stand_picture;
  375. var bitmap = bitmapName ? ImageManager.loadPicture(bitmapName) : null;
  376. var w = Math.min(rect.width, (bitmapName ? bitmap.width : 144));
  377. var h = Math.min(rect.height, (bitmapName ? bitmap.height : 144));
  378. var lineHeight = this.lineHeight();
  379. this.changePaintOpacity(actor.isBattleMember());
  380. if(bitmap){
  381. var sx = (bitmap.width > w) ? (bitmap.width - w) / 2 : 0;
  382. var sy = (bitmap.height > h) ? (bitmap.height - h) / 2 : 0;
  383. var dx = (bitmap.width > rect.width) ? rect.x :
  384. rect.x + (rect.width - bitmap.width) / 2;
  385. var dy = (bitmap.height > rect.height) ? rect.y :
  386. rect.y + (rect.height - bitmap.height) / 2;
  387. this.contents.blt(bitmap, sx, sy, w, h, dx, dy);
  388. } else { // when bitmap is not set, do the original process.
  389. this.drawActorFace(actor, rect.x, rect.y + lineHeight * 2.5, w, h);
  390. }
  391. this.changePaintOpacity(true);
  392. };
  393.  
  394. Window_MenuStatus.prototype.drawItemStatus = function(index) {
  395. if(!isDisplayStatus){
  396. return;
  397. }
  398. var actor = $gameParty.members()[index];
  399. var rect = this.itemRectForText(index);
  400. var x = rect.x;
  401. var y = rect.y;
  402. var width = rect.width;
  403. var bottom = y + rect.height;
  404. var lineHeight = this.lineHeight();
  405. this.drawActorName(actor, x, y + lineHeight * 0, width);
  406. this.drawActorLevel(actor, x, y + lineHeight * 1, width);
  407. this.drawActorClass(actor, x, bottom - lineHeight * 4, width);
  408. this.drawActorHp(actor, x, bottom - lineHeight * 3, width);
  409. this.drawActorMp(actor, x, bottom - lineHeight * 2, width);
  410. this.drawActorIcons(actor, x, bottom - lineHeight * 1, width);
  411. };
  412.  
  413. var _Window_MenuActor_initialize = Window_MenuActor.prototype.initialize;
  414. Window_MenuActor.prototype.initialize = function() {
  415. _Window_MenuActor_initialize.call(this);
  416. this.y = this.fittingHeight(2);
  417. };
  418.  
  419. })();