查看: 6121|回复: 8

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

[复制链接]
梦石
0
星屑
698
在线时间
18 小时
注册时间
2020-8-2
回帖
27
发表于 2021-1-19 10:42:05 | 显示全部楼层 |阅读模式

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

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

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

QQ图片20210119103244.png QQ图片20210119103538.png QQ图片20210119103157.png

[pre lang="ruby"]/*:-----------------------------------------------------------------------------------
* NUUN_CommandIcon.js
*
* Copyright (C) 2020 NUUN
* This software is released under the MIT License.
* http://opensource.org/licenses/mit-license.php
* -------------------------------------------------------------------------------------
*/
/*:
* @target MZ
* @plugindesc 自定义命令插件
* @author NUUN  翻译:我想我是兔
*
* @help
* RMmv/mz 素材、插件分享小站  www.rpgtuzi.com
*
* 您可以在命令菜单中显示图标,并更改命令名称的文本颜色。。
* 您可以从左对齐,居中对齐和右对齐中选择命令名称的位置。
*
* 利用規約
* 该插件是根据MIT许可分发的。
*
* 更新履歴
* 2020/11/19 Ver 1.0.0
*  初版
*
* 2020/11/20 Ver 1.0.1
*  プラグインパラメータのCommadIconが空白だった場合、エラーが出る問題を修正。
*
* 2020/11/20 Ver 1.0.2
*  多言語対応ではなかったため修正。
*
* 2020/11/21 Ver 1.1.0
*  コマンド名に色を付ける機能を追加。
*
* 2020/11/22 Ver 1.1.1
*  追加从左对齐、中间对齐、右对齐中选择命令名的功能。
*
* @param CommadIcon
* @text 命令图标设置
* @desc 设置要在命令中显示的图标。
* @default []
* @type struct<CommadIconList>[]
*
* @param CommandPosition
* @text 纵向命令的命令名称显示位置
* @desc 指定纵向命令的命令名称的显示位置。 (菜单屏幕等)
* @type select
* @option 左对齐
* @value 0
* @option 中间对齐
* @value 1
* @option 右对齐
* @value 2
* @default 1
*
* @param HorzCommandPosition
* @text 水平命令的命令名称显示位置
* @desc 指定水平命令的命令名称的显示位置。 (项目栏等)
* @type select
* @option 左对齐
* @value 0
* @option 中间对齐
* @value 1
* @option 右对齐
* @value 2
* @default 1
*
*/
/*~struct~CommadIconList:
*
* @param CommadName
* @text 指令名称
* @desc 命令名称以显示图标(请使用与要显示的命令名称相同的名称)
* @type string
*
* @param CommadNameColor
* @text 命令名称颜色
* @desc 命令名称颜色索引号。
* @type number
* @default 0
* @min 0
*
* @param iconId
* @text 图标索引号
* @desc 对应图标的ID号。
* @type number
* @default 0
* @min 0
*
*/

/*:ja
* @target MZ
* @plugindesc 自定义命令插件
* @author NUUN  翻译:我想我是兔
*
* @help
* RMmv/mz 素材、插件分享小站  www.rpgtuzi.com
*
* 您可以在命令菜单中显示图标,并更改命令名称的文本颜色。。
* 您可以从左对齐,居中对齐和右对齐中选择命令名称的位置。
*
* 利用規約
* 该插件是根据MIT许可分发的。
*
* 更新履歴
* 2020/11/19 Ver 1.0.0
*  初版
*
* 2020/11/20 Ver 1.0.1
*  プラグインパラメータのCommadIconが空白だった場合、エラーが出る問題を修正。
*
* 2020/11/20 Ver 1.0.2
*  多言語対応ではなかったため修正。
*
* 2020/11/21 Ver 1.1.0
*  コマンド名に色を付ける機能を追加。
*
* 2020/11/22 Ver 1.1.1
*  追加从左对齐、中间对齐、右对齐中选择命令名的功能。
*
* @param CommadIcon
* @text 命令图标设置
* @desc 设置要在命令中显示的图标。
* @default []
* @type struct<CommadIconList>[]
*
* @param CommandPosition
* @text 纵向命令的命令名称显示位置
* @desc 指定纵向命令的命令名称的显示位置。 (菜单屏幕等)
* @type select
* @option 左对齐
* @value 0
* @option 中间对齐
* @value 1
* @option 右对齐
* @value 2
* @default 1
*
* @param HorzCommandPosition
* @text 水平命令的命令名称显示位置
* @desc 指定水平命令的命令名称的显示位置。 (项目栏等)
* @type select
* @option 左对齐
* @value 0
* @option 中间对齐
* @value 1
* @option 右对齐
* @value 2
* @default 1
*
*/
/*~struct~CommadIconList:ja
*
* @param CommadName
* @text 指令名称
* @desc 命令名称以显示图标(请使用与要显示的命令名称相同的名称)
* @type string
*
* @param CommadNameColor
* @text 命令名称颜色
* @desc 命令名称颜色索引号。
* @type number
* @default 0
* @min 0
*
* @param iconId
* @text 图标索引号
* @desc 对应图标的ID号。
* @type number
* @default 0
* @min 0
*
*/
var Imported = Imported || {};
Imported.NUUN_CommandIcon = true;

(() => {
const parameters = PluginManager.parameters('NUUN_CommandIcon');
const param = JSON.parse(JSON.stringify(parameters, function(key, value) {
  try {
      return JSON.parse(value);
  } catch (e) {
      try {
          return eval(value);
      } catch (e) {
          return value;
      }
  }
}));
const _Window_Command_itemTextAlign = Window_Command.prototype.itemTextAlign;
Window_Command.prototype.itemTextAlign = function() {
  switch (param.CommandPosition) {
    case 0:
      return "left";
    case 1:
      return _Window_Command_itemTextAlign.call(this);
    case 2:
      return "right";
  }
};

const _Window_HorzCommand_itemTextAlign = Window_HorzCommand.prototype.itemTextAlign;
Window_HorzCommand.prototype.itemTextAlign = function() {
  switch (param.HorzCommandPosition) {
    case 0:
      return "left";
    case 1:
      return _Window_HorzCommand_itemTextAlign.call(this);
    case 2:
      return "right";
  }
};

const _Window_Command_drawItem = Window_Command.prototype.drawItem;
Window_Command.prototype.drawItem = function(index) {
  const commadName = this.commandName(index);
  const foundIndex = param.CommadIcon ? param.CommadIcon.findIndex(Commad => (Commad.CommadName === commadName)) : null;
  if(foundIndex >= 0) {
    const commadData = param.CommadIcon[foundIndex];
    const rect = this.itemLineRect(index);
    const align = this.itemTextAlign();
    const iconY = rect.y + (this.lineHeight() - ImageManager.iconHeight) / 2;
    const textMargin = commadData.iconId > 0 ? ImageManager.iconWidth + 4 : 0;
    const textWidth = this.textWidth(commadName);
    const itemWidth = Math.max(0, rect.width - textMargin);
    const width = Math.min(itemWidth, textWidth);
    const color = commadData.CommadNameColor ? commadData.CommadNameColor : 0;
    this.changeTextColor(ColorManager.textColor(color));
    this.changePaintOpacity(this.isCommandEnabled(index));
    if(commadData.iconId > 0) {
      if(align === 'center') {
        this.drawIcon(commadData.iconId, rect.x + (rect.width / 2 - width / 2) - textMargin / 2, iconY);
      } else if (align === 'left') {
        this.drawIcon(commadData.iconId, rect.x, iconY);
      } else {
        this.drawIcon(commadData.iconId, rect.x + itemWidth - width, iconY);
      }
    }
    this.drawText(commadName, rect.x + textMargin, rect.y, itemWidth, align);
    this.resetTextColor();
  } else {
    _Window_Command_drawItem.call(this, index);
  }
};
})();[/pre]
※MV封禁-暮还松填坑中.....
※RMMZ/MV素材分享搬运
www.rpgtuzi.com 素材搬运
梦石
0
星屑
2429
在线时间
363 小时
注册时间
2021-2-8
回帖
137
发表于 2021-3-8 00:20:07 | 显示全部楼层
不错,挺好用~
回复

使用道具 举报

梦石
0
星屑
163
在线时间
73 小时
注册时间
2014-4-10
回帖
96
发表于 2021-3-22 16:10:18 | 显示全部楼层
不错,感谢分享~
回复

使用道具 举报

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

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

使用道具 举报

梦石
0
星屑
121
在线时间
10 小时
注册时间
2021-11-29
回帖
19
发表于 2021-12-5 09:26:47 | 显示全部楼层
这个要怎么下载。。直接复制到记事本保存?
回复

使用道具 举报

梦石
0
星屑
144
在线时间
43 小时
注册时间
2020-10-31
回帖
73
发表于 2022-6-29 20:43:16 | 显示全部楼层

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

使用道具 举报

梦石
0
星屑
144
在线时间
43 小时
注册时间
2020-10-31
回帖
73
发表于 2022-6-29 20:53:24 | 显示全部楼层
yxd5108 发表于 2022-6-29 20:43
为什么原封不动复制下来竟然是乱码?

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

使用道具 举报

梦石
0
星屑
1217
在线时间
89 小时
注册时间
2022-2-5
回帖
190
发表于 2022-6-30 08:02:29 | 显示全部楼层
佬可以直接搞个下载吗……
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部