设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 4240|回复: 8
打印 上一主题 下一主题

[搬运汉化] 【汉化搬运】在命令选项上添加图标并修改选项名称颜色Ve...

[复制链接]

Lv2.观梦者

梦石
0
星屑
691
在线时间
18 小时
注册时间
2020-8-2
帖子
38
跳转到指定楼层
1
发表于 2021-1-19 10:42:05 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
主要功能
可以在
命令上显示图标可以将命令字符设置为左对齐,居中对齐和右对齐,
还可以为命令字符指定颜色。



RUBY 代码复制
  1. /*:-----------------------------------------------------------------------------------
  2. * NUUN_CommandIcon.js
  3. *
  4. * Copyright (C) 2020 NUUN
  5. * This software is released under the MIT License.
  6. * [url]http://opensource.org/licenses/mit-license.php[/url]
  7. * -------------------------------------------------------------------------------------
  8. */
  9. /*:
  10. * @target MZ
  11. * @plugindesc 自定义命令插件
  12. * @author NUUN  翻译:我想我是兔
  13. *
  14. * @help
  15. * RMmv/mz 素材、插件分享小站  [url]www.rpgtuzi.com[/url]
  16. *
  17. * 您可以在命令菜单中显示图标,并更改命令名称的文本颜色。。
  18. * 您可以从左对齐,居中对齐和右对齐中选择命令名称的位置。
  19. *
  20. * 利用規約
  21. * 该插件是根据MIT许可分发的。
  22. *
  23. * 更新履歴
  24. * 2020/11/19 Ver 1.0.0
  25. *  初版
  26. *
  27. * 2020/11/20 Ver 1.0.1
  28. *  プラグインパラメータのCommadIconが空白だった場合、エラーが出る問題を修正。
  29. *
  30. * 2020/11/20 Ver 1.0.2
  31. *  多言語対応ではなかったため修正。
  32. *
  33. * 2020/11/21 Ver 1.1.0
  34. *  コマンド名に色を付ける機能を追加。
  35. *
  36. * 2020/11/22 Ver 1.1.1
  37. *  追加从左对齐、中间对齐、右对齐中选择命令名的功能。
  38. *
  39. * @param CommadIcon
  40. * @text 命令图标设置
  41. * @desc 设置要在命令中显示的图标。
  42. * @default []
  43. * @type struct<CommadIconList>[]
  44. *
  45. * @param CommandPosition
  46. * @text 纵向命令的命令名称显示位置
  47. * @desc 指定纵向命令的命令名称的显示位置。 (菜单屏幕等)
  48. * @type select
  49. * @option 左对齐
  50. * @value 0
  51. * @option 中间对齐
  52. * @value 1
  53. * @option 右对齐
  54. * @value 2
  55. * @default 1
  56. *
  57. * @param HorzCommandPosition
  58. * @text 水平命令的命令名称显示位置
  59. * @desc 指定水平命令的命令名称的显示位置。 (项目栏等)
  60. * @type select
  61. * @option 左对齐
  62. * @value 0
  63. * @option 中间对齐
  64. * @value 1
  65. * @option 右对齐
  66. * @value 2
  67. * @default 1
  68. *
  69. */
  70. /*~struct~CommadIconList:
  71. *
  72. * @param CommadName
  73. * @text 指令名称
  74. * @desc 命令名称以显示图标(请使用与要显示的命令名称相同的名称)
  75. * @type string
  76. *
  77. * @param CommadNameColor
  78. * @text 命令名称颜色
  79. * @desc 命令名称颜色索引号。
  80. * @type number
  81. * @default 0
  82. * @min 0
  83. *
  84. * @param iconId
  85. * @text 图标索引号
  86. * @desc 对应图标的ID号。
  87. * @type number
  88. * @default 0
  89. * @min 0
  90. *
  91. */
  92.  
  93. /*:ja
  94. * @target MZ
  95. * @plugindesc 自定义命令插件
  96. * @author NUUN  翻译:我想我是兔
  97. *
  98. * @help
  99. * RMmv/mz 素材、插件分享小站  [url]www.rpgtuzi.com[/url]
  100. *
  101. * 您可以在命令菜单中显示图标,并更改命令名称的文本颜色。。
  102. * 您可以从左对齐,居中对齐和右对齐中选择命令名称的位置。
  103. *
  104. * 利用規約
  105. * 该插件是根据MIT许可分发的。
  106. *
  107. * 更新履歴
  108. * 2020/11/19 Ver 1.0.0
  109. *  初版
  110. *
  111. * 2020/11/20 Ver 1.0.1
  112. *  プラグインパラメータのCommadIconが空白だった場合、エラーが出る問題を修正。
  113. *
  114. * 2020/11/20 Ver 1.0.2
  115. *  多言語対応ではなかったため修正。
  116. *
  117. * 2020/11/21 Ver 1.1.0
  118. *  コマンド名に色を付ける機能を追加。
  119. *
  120. * 2020/11/22 Ver 1.1.1
  121. *  追加从左对齐、中间对齐、右对齐中选择命令名的功能。
  122. *
  123. * @param CommadIcon
  124. * @text 命令图标设置
  125. * @desc 设置要在命令中显示的图标。
  126. * @default []
  127. * @type struct<CommadIconList>[]
  128. *
  129. * @param CommandPosition
  130. * @text 纵向命令的命令名称显示位置
  131. * @desc 指定纵向命令的命令名称的显示位置。 (菜单屏幕等)
  132. * @type select
  133. * @option 左对齐
  134. * @value 0
  135. * @option 中间对齐
  136. * @value 1
  137. * @option 右对齐
  138. * @value 2
  139. * @default 1
  140. *
  141. * @param HorzCommandPosition
  142. * @text 水平命令的命令名称显示位置
  143. * @desc 指定水平命令的命令名称的显示位置。 (项目栏等)
  144. * @type select
  145. * @option 左对齐
  146. * @value 0
  147. * @option 中间对齐
  148. * @value 1
  149. * @option 右对齐
  150. * @value 2
  151. * @default 1
  152. *
  153. */
  154. /*~struct~CommadIconList:ja
  155. *
  156. * @param CommadName
  157. * @text 指令名称
  158. * @desc 命令名称以显示图标(请使用与要显示的命令名称相同的名称)
  159. * @type string
  160. *
  161. * @param CommadNameColor
  162. * @text 命令名称颜色
  163. * @desc 命令名称颜色索引号。
  164. * @type number
  165. * @default 0
  166. * @min 0
  167. *
  168. * @param iconId
  169. * @text 图标索引号
  170. * @desc 对应图标的ID号。
  171. * @type number
  172. * @default 0
  173. * @min 0
  174. *
  175. */
  176. var Imported = Imported || {};
  177. Imported.NUUN_CommandIcon = true;
  178.  
  179. (() => {
  180. const parameters = PluginManager.parameters('NUUN_CommandIcon');
  181. const param = JSON.parse(JSON.stringify(parameters, function(key, value) {
  182.   try {
  183.       return JSON.parse(value);
  184.   } catch (e) {
  185.       try {
  186.           return eval(value);
  187.       } catch (e) {
  188.           return value;
  189.       }
  190.   }
  191. }));
  192. const _Window_Command_itemTextAlign = Window_Command.prototype.itemTextAlign;
  193. Window_Command.prototype.itemTextAlign = function() {
  194.   switch (param.CommandPosition) {
  195.     case 0:
  196.       return "left";
  197.     case 1:
  198.       return _Window_Command_itemTextAlign.call(this);
  199.     case 2:
  200.       return "right";
  201.   }
  202. };
  203.  
  204. const _Window_HorzCommand_itemTextAlign = Window_HorzCommand.prototype.itemTextAlign;
  205. Window_HorzCommand.prototype.itemTextAlign = function() {
  206.   switch (param.HorzCommandPosition) {
  207.     case 0:
  208.       return "left";
  209.     case 1:
  210.       return _Window_HorzCommand_itemTextAlign.call(this);
  211.     case 2:
  212.       return "right";
  213.   }
  214. };
  215.  
  216. const _Window_Command_drawItem = Window_Command.prototype.drawItem;
  217. Window_Command.prototype.drawItem = function(index) {
  218.   const commadName = this.commandName(index);
  219.   const foundIndex = param.CommadIcon ? param.CommadIcon.findIndex(Commad => (Commad.CommadName === commadName)) : null;
  220.   if(foundIndex >= 0) {
  221.     const commadData = param.CommadIcon[foundIndex];
  222.     const rect = this.itemLineRect(index);
  223.     const align = this.itemTextAlign();
  224.     const iconY = rect.y + (this.lineHeight() - ImageManager.iconHeight) / 2;
  225.     const textMargin = commadData.iconId > 0 ? ImageManager.iconWidth + 4 : 0;
  226.     const textWidth = this.textWidth(commadName);
  227.     const itemWidth = Math.max(0, rect.width - textMargin);
  228.     const width = Math.min(itemWidth, textWidth);
  229.     const color = commadData.CommadNameColor ? commadData.CommadNameColor : 0;
  230.     this.changeTextColor(ColorManager.textColor(color));
  231.     this.changePaintOpacity(this.isCommandEnabled(index));
  232.     if(commadData.iconId > 0) {
  233.       if(align === 'center') {
  234.         this.drawIcon(commadData.iconId, rect.x + (rect.width / 2 - width / 2) - textMargin / 2, iconY);
  235.       } else if (align === 'left') {
  236.         this.drawIcon(commadData.iconId, rect.x, iconY);
  237.       } else {
  238.         this.drawIcon(commadData.iconId, rect.x + itemWidth - width, iconY);
  239.       }
  240.     }
  241.     this.drawText(commadName, rect.x + textMargin, rect.y, itemWidth, align);
  242.     this.resetTextColor();
  243.   } else {
  244.     _Window_Command_drawItem.call(this, index);
  245.   }
  246. };
  247. })();
※MV封禁-暮还松填坑中.....
※RMMZ/MV素材分享搬运
www.rpgtuzi.com 素材搬运

Lv3.寻梦者

梦石
0
星屑
2354
在线时间
363 小时
注册时间
2021-2-8
帖子
149
2
发表于 2021-3-8 00:20:07 | 只看该作者
不错,挺好用~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
163
在线时间
73 小时
注册时间
2014-4-10
帖子
109
3
发表于 2021-3-22 16:10:18 | 只看该作者
不错,感谢分享~
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
7504
在线时间
1227 小时
注册时间
2008-12-14
帖子
555
4
发表于 2021-8-1 01:18:58 | 只看该作者
楼主能帮我搬运dragoncave 的第26个插件吗?message backlog。我这边下不下来。先谢谢
需要购买本人MV插件必须先加wx好友。加不上wx就是本人忙,没时间卖。原则上太久以前的插件也不想卖,因为我也忘了,维护上会不给力。wx名:alskyif    本人插件地址:
   LCK_SRPG梦幻模拟战、火焰纹章类系统
   究极立绘ADV系统

   究极换装统合系统
   究极! 回想与CG系统
   消息文字的距离调整  
   自动返回上一张地图
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
121
在线时间
10 小时
注册时间
2021-11-29
帖子
22
5
发表于 2021-12-5 09:26:47 | 只看该作者
这个要怎么下载。。直接复制到记事本保存?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
144
在线时间
43 小时
注册时间
2020-10-31
帖子
75
6
发表于 2022-6-29 20:43:16 | 只看该作者

为什么原封不动复制下来竟然是乱码?
自作主张蛛后之后
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
144
在线时间
43 小时
注册时间
2020-10-31
帖子
75
7
发表于 2022-6-29 20:53:24 | 只看该作者
yxd5108 发表于 2022-6-29 20:43
为什么原封不动复制下来竟然是乱码?

乱码问题解决了,但是没有你图三的物品、技能、装备、状态,你脚本里也没有啊
自作主张蛛后之后
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1188
在线时间
87 小时
注册时间
2022-2-5
帖子
194
8
发表于 2022-6-30 08:02:29 | 只看该作者
佬可以直接搞个下载吗……
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-20 20:31

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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