找回密码
 注册用户
查看: 299|回复: 0

[RMMV] 【汉化】幻想传说风格主菜单

[复制链接]

88

主题

7

回帖

1277

积分

资深会员

积分
1277
发表于 2024-6-4 16:09:02 | 显示全部楼层 |阅读模式
本帖最后由 烁灵 于 2024-6-20 17:47 编辑

原地址:Alt Menu Screen: Phantasia – MV Plugin – RPG Maker MZ Plugins (sumrndm.site)


效果:
QQ截图20240604160040.png


脚本:命名为 SRD_AltMenuScreen_Phantasia.js

  1. /*:
  2. * @plugindesc 幻想传说风格主菜单
  3. * 汉化 by 烁灵 更多脚本请访问 www.hknmtt.com
  4. * @author SumRndmDde
  5. *
  6. * @param "Play Time" Text
  7. * @text 游戏时间 标签文本
  8. * @desc 在菜单中显示游戏时间的标签文本
  9. * @default 游戏时间
  10. *
  11. * @param Sprite Size Ratio
  12. * @text 精灵缩放比例
  13. * @desc 行走图的缩放比例
  14. * 例如: 1 = 通常, 2 = 2倍大小, 0.5 = 一半大小
  15. * @default 1
  16. *
  17. * @param Show White Borders?
  18. * @text 显示白色边框?
  19. * @desc 需要显示白色边框时填 true
  20. * @default false
  21. *
  22. * @param Character Size
  23. * @text 角色尺寸
  24. * @desc RMMV 默认角色尺寸为 48*48,如果使用了别的图片,在这里填写尺寸
  25. * @default 48
  26. *
  27. * @param Command Columns
  28. * @text 指令列数
  29. * @desc 菜单指令列数
  30. * @default 4
  31. *
  32. * @param Command Rows
  33. * @text 指令行数
  34. * @desc 菜单指令行数
  35. * @default 2
  36. *
  37. * @param Y Offset
  38. * @text Y 偏移
  39. * @desc 角色项目标签的 y 坐标偏移
  40. * @default 32
  41. *
  42. * @help
  43. *
  44. *
  45. * Alternative Menu Screen: Phantasia
  46. * Version 1.02
  47. * SumRndmDde
  48. *
  49. *
  50. * Changelog (v1.02): Fixed Shop Choices
  51. *
  52. *
  53. * Gives your game an alternative menu screen.
  54. *
  55. * This one is based off of the menu from
  56. * Tales of Phantasia.
  57. *
  58. *
  59. * Until next time,
  60. *   ~ SumRndmDde
  61. */

  62. (function() {
  63.         var playTimeText = String(PluginManager.parameters('SRD_AltMenuScreen_Phantasia')['"Play Time" Text']);
  64.         var spriteSizeRatio = Number(PluginManager.parameters('SRD_AltMenuScreen_Phantasia')['Sprite Size Ratio']);
  65.         var borders = String(PluginManager.parameters('SRD_AltMenuScreen_Phantasia')['Show White Borders?']).trim().toLowerCase() === 'true';
  66.         var sumColumns = Number(PluginManager.parameters('SRD_AltMenuScreen_Phantasia')['Command Columns']);
  67.         var sumRows = Number(PluginManager.parameters('SRD_AltMenuScreen_Phantasia')['Command Rows']);
  68.         var sumYOffset = Number(PluginManager.parameters('SRD_AltMenuScreen_Phantasia')['Y Offset']);
  69.         var charSize = Number(PluginManager.parameters('SRD_AltMenuScreen_Phantasia')['Character Size'])

  70.         Window_Base.prototype.drawCharacterAnimated = function(characterName, characterIndex, x, y, frame) {
  71.             var bitmap = ImageManager.loadCharacter(characterName);
  72.             var big = ImageManager.isBigCharacter(characterName);
  73.             var pw = bitmap.width / (big ? 3 : 12);
  74.             var ph = bitmap.height / (big ? 4 : 8);
  75.             var n = characterIndex;
  76.             var sx = ((n % 4 * 3 + 1) * pw) + (frame * charSize/*48*/);
  77.             var sy = ((Math.floor(n / 4) * 4) * ph);
  78.             this.contents.blt(bitmap, sx, sy, pw, ph, x - pw / 2, y - ph, pw * spriteSizeRatio, ph * spriteSizeRatio);
  79.         };

  80.         var _Scene_Menu_create = Scene_Menu.prototype.create;
  81.         Scene_Menu.prototype.create = function() {
  82.             _Scene_Menu_create.call(this);
  83.                 this._goldWindow.y = this._commandWindow.height;
  84.                 this._statusWindow.x = 0;
  85.                 this._statusWindow.y = this._goldWindow.y + this._goldWindow.height;
  86.                 this._timeWindow = new Window_MenuTimeAndBattles(0, this._statusWindow.y + this._statusWindow.height);
  87.                 this.addWindow(this._timeWindow);
  88.         };
  89.         Scene_Menu.prototype.createGoldWindow = function() {
  90.             this._goldWindow = new Window_Gold2(0, 0);
  91.             this._goldWindow.y = Graphics.boxHeight - this._goldWindow.height;
  92.             this.addWindow(this._goldWindow);
  93.         };
  94.         Window_MenuCommand.prototype.windowWidth = function() {
  95.             return Graphics.width;
  96.         };
  97.         Window_MenuCommand.prototype.maxCols = function() {
  98.             return sumColumns;
  99.         };
  100.         Window_MenuCommand.prototype.numVisibleRows = function() {
  101.             return sumRows;
  102.         };
  103.         var _Window_MenuStatus_initialize = Window_MenuStatus.prototype.initialize;
  104.         Window_MenuStatus.prototype.initialize = function(x, y) {
  105.             _Window_MenuStatus_initialize.call(this, x, y);
  106.             this._tick = 0;
  107.             this._frame = 0;
  108.         };
  109.         Window_MenuStatus.prototype.windowWidth = function() {
  110.             return Graphics.width;
  111.         };
  112.         Window_MenuStatus.prototype.windowHeight = function() {
  113.             return Graphics.height - 180 - this.fittingHeight(1);
  114.         };
  115.         Window_MenuStatus.prototype.numVisibleRows = function() {
  116.             return 2;
  117.         };
  118.         Window_MenuStatus.prototype.maxCols = function() {
  119.             return 2;
  120.         };
  121.         var _Window_MenuStatus_update = Window_MenuStatus.prototype.update;
  122.         Window_MenuStatus.prototype.update = function() {
  123.                 _Window_MenuStatus_update.call(this);
  124.             this._tick += 1;
  125.             if(this._tick >= 20) {
  126.                     this._frame += 1;
  127.                     if(this._frame > 2) this._frame = -1;
  128.                     this.refresh();
  129.                     this._tick = 0;
  130.             }
  131.         };
  132.         Window_MenuStatus.prototype.drawItemImage = function(index) {
  133.             var actor = $gameParty.members()[index];
  134.             var rect = this.itemRect(index);
  135.             this.changePaintOpacity(actor.isBattleMember());
  136.             var frame = (this._frame === 2) ? 0 : this._frame;
  137.             this.drawCharacterAnimated(actor.characterName(), actor.characterIndex(),
  138.                     rect.x + rect.width - (48 * spriteSizeRatio), rect.y + 24 + (48 / spriteSizeRatio), frame);
  139.             this.changePaintOpacity(true);
  140.         };
  141.         Window_MenuStatus.prototype.drawItemStatus = function(index) {
  142.             var actor = $gameParty.members()[index];
  143.             var rect = this.itemRect(index);
  144.             var x = rect.x + 4;// + 162;
  145.             var y = rect.y;
  146.             var yOffset = sumYOffset;
  147.             var width = rect.width - (48 * 2 * spriteSizeRatio) - 8;
  148.             this.drawActorName(actor, x, y, width);
  149.             this.drawActorLevel(actor, x, y + yOffset, width);
  150.             this.drawActorClass(actor, x, y, width, 'right');
  151.             this.drawActorHp(actor, x, y + (yOffset * 2), width);

  152.             var lineHeight = this.lineHeight();
  153.             var expTotal = TextManager.expTotal.format(TextManager.exp);
  154.             var expNext = TextManager.expNext.format(TextManager.level);
  155.             var value1 = actor.currentExp();
  156.             var value2 = actor.nextRequiredExp();
  157.             if (actor.isMaxLevel()) {
  158.                 value1 = '-------';
  159.                 value2 = '-------';
  160.             }
  161.             this.changeTextColor(this.systemColor());
  162.             this.drawText(expTotal, x, y + (yOffset * 3), rect.width - 8);
  163.             this.drawText(expNext, x, y + (yOffset * 4), rect.width - 8);
  164.             this.resetTextColor();
  165.             this.drawText(value1, x, y + (yOffset * 3), rect.width - 8, 'right');
  166.             this.drawText(value2, x, y + (yOffset * 4), rect.width - 8, 'right');

  167.             this.resetFontSettings();
  168.         };
  169.         var _Window_MenuStatus_refresh = Window_MenuStatus.prototype.refresh;
  170.         Window_MenuStatus.prototype.refresh = function() {
  171.             _Window_MenuStatus_refresh.call(this);
  172.             if(this.contents && borders) {
  173.                     this.contents.fillRect(0, (this.windowHeight() / 2) - 20, this.windowWidth(), 3, "#ffffff");
  174.                     this.contents.fillRect((this.windowWidth() / 2) - 20, 0, 3, this.windowHeight(), "#ffffff");
  175.             }
  176.         };
  177.         Window_MenuStatus.prototype.drawActorClass = function(actor, x, y, width, align) {
  178.             width = width || 168;
  179.             this.resetTextColor();
  180.             this.drawText(actor.currentClass().name, x, y, width, align);
  181.         };
  182.         function Window_MenuTimeAndBattles() {
  183.             this.initialize.apply(this, arguments);
  184.         }
  185.         Window_MenuTimeAndBattles.prototype = Object.create(Window_Base.prototype);
  186.         Window_MenuTimeAndBattles.prototype.constructor = Window_Gold2;
  187.         Window_MenuTimeAndBattles.prototype.initialize = function(x, y) {
  188.             var width = this.windowWidth();
  189.             var height = this.windowHeight();
  190.             Window_Base.prototype.initialize.call(this, x, y, width, height);
  191.             this.refresh();
  192.         };
  193.         Window_MenuTimeAndBattles.prototype.windowWidth = function() {
  194.             return Graphics.width;
  195.         };
  196.         Window_MenuTimeAndBattles.prototype.windowHeight = function() {
  197.             return this.fittingHeight(1);
  198.         };
  199.         Window_MenuTimeAndBattles.prototype.refresh = function() {
  200.             var x = this.textPadding();
  201.             var width = this.contents.width - this.textPadding() * 2;
  202.             this.contents.clear();
  203.             this.resetTextColor();
  204.             this.drawText(playTimeText + " " + $gameSystem.playtimeText(), x, 0, width - 6, 'center');
  205.         };
  206.         Window_MenuTimeAndBattles.prototype.open = function() {
  207.             this.refresh();
  208.             Window_Base.prototype.open.call(this);
  209.         };
  210.         Window_MenuTimeAndBattles.prototype.update = function() {
  211.             this.refresh();
  212.             Window_Base.prototype.update.call(this);
  213.         };

  214.         function Window_Gold2() {
  215.             this.initialize.apply(this, arguments);
  216.         }
  217.         Window_Gold2.prototype = Object.create(Window_Base.prototype);
  218.         Window_Gold2.prototype.constructor = Window_Gold2;
  219.         Window_Gold2.prototype.initialize = function(x, y) {
  220.             var width = this.windowWidth();
  221.             var height = this.windowHeight();
  222.             Window_Base.prototype.initialize.call(this, x, y, width, height);
  223.             this.refresh();
  224.         };
  225.         Window_Gold2.prototype.windowWidth = function() {
  226.             return Graphics.width;
  227.         };
  228.         Window_Gold2.prototype.windowHeight = function() {
  229.             return this.fittingHeight(1);
  230.         };
  231.         Window_Gold2.prototype.refresh = function() {
  232.             var x = this.textPadding();
  233.             var width = this.contents.width - this.textPadding() * 2;
  234.             this.contents.clear();
  235.             this.drawCurrencyValue(this.value(), this.currencyUnit(), x, 0, width);
  236.         };

  237.         Window_Gold2.prototype.value = function() {
  238.             return $gameParty.gold();
  239.         };
  240.         Window_Gold2.prototype.currencyUnit = function() {
  241.             return TextManager.currencyUnit;
  242.         };
  243.         Window_Gold2.prototype.open = function() {
  244.             this.refresh();
  245.             Window_Base.prototype.open.call(this);
  246.         };
  247. })();
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册用户

本版积分规则

Archiver|QQ群: 48625831|爱上RPG|哈库纳玛塔塔 |网站地图 Clicky

GMT+8, 2024-10-23 13:36 , Processed in 0.065562 second(s), 22 queries .

Powered by Discuz! X3.5

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表