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

Project1

 找回密码
 注册会员
搜索
查看: 1027|回复: 0

[交流讨论] MV自带插件SimpleMsgSideView.js添加技能名左侧显示图标效果

[复制链接]

Lv2.观梦者

梦石
0
星屑
314
在线时间
44 小时
注册时间
2023-3-19
帖子
5
发表于 2023-3-28 11:54:28 | 显示全部楼层 |阅读模式

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

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

x
拿chatgpt自己手动汉化+调试了一下成功了,看到版里好像没这个就顺带放一下好了,有需要自取。
  1. //=============================================================================
  2. // SimpleMsgSideView.js
  3. //=============================================================================

  4. /*:
  5. * @plugindesc 在侧视战斗中仅显示技能/物品名称,并在技能名称左侧显示技能图标。Modify by The BAI LLC for BAI Chat.
  6. * @author Sasuke KANNAZUKI
  7. *
  8. * @param displayAttack
  9. * @desc 是否显示普通攻击(1:是,0:否)。
  10. * @default 0
  11. *
  12. * @param position
  13. * @desc 技能名称的显示位置(0:左对齐,1:居中)。
  14. * @default 1
  15. *
  16. * @help 该插件没有插件命令
  17. *
  18. * 不显示日志,仅显示技能名称,可以使战斗节奏稍微加快。
  19. */

  20. (function() {

  21.   var parameters = PluginManager.parameters('SimpleMsgSideView');
  22.   var displayAttack = Number(parameters['displayAttack']) != 0;
  23.   var position = Number(parameters['position'] || 1);

  24.   var _Window_BattleLog_addText = Window_BattleLog.prototype.addText;
  25.   Window_BattleLog.prototype.addText = function(text) {
  26.    if($gameSystem.isSideView()){
  27.      this.refresh();
  28.      this.wait();
  29.      return;  // not display battle log
  30.    }
  31.    _Window_BattleLog_addText.call(this, text);
  32.   };

  33.   // for sideview battle only
  34.   Window_BattleLog.prototype.addItemNameText = function(itemName, iconIndex) {
  35.     this._lines.push({text: itemName, iconIndex: iconIndex});
  36.     this.refresh();
  37.     this.wait();
  38.   };

  39.   var _Window_BattleLog_displayAction =
  40.    Window_BattleLog.prototype.displayAction;
  41.   Window_BattleLog.prototype.displayAction = function(subject, item) {
  42.     if($gameSystem.isSideView()){
  43.       if(displayAttack ||
  44.        !(DataManager.isSkill(item) && item.id == subject.attackSkillId())) {
  45.         this.push('addItemNameText', item.name, item.iconIndex);  // display item/skill name and icon
  46.       } else {
  47.         this.push('wait');
  48.       }
  49.       return;
  50.     }
  51.     _Window_BattleLog_displayAction.call(this, subject, item);
  52.   };

  53.   // to put skill/item name at center
  54. var _Window_BattleLog_drawLineText = Window_BattleLog.prototype.drawLineText;
  55. Window_BattleLog.prototype.drawLineText = function(index) {
  56.   if($gameSystem.isSideView() && position == 1){
  57.     var rect = this.itemRectForText(index);
  58.     this.contents.clearRect(rect.x, rect.y, rect.width, rect.height);
  59.     var line = this._lines[index];
  60.     if (line.iconIndex > 0) {
  61.       var iconBoxWidth = Window_Base._iconWidth + 4;
  62.       var textWidth = this.textWidth(line.text);
  63.       var startX = (rect.width - (textWidth + iconBoxWidth)) / 2;
  64.       this.drawIcon(line.iconIndex, rect.x + startX, rect.y + 2);
  65.       this.drawText(line.text, rect.x + startX + iconBoxWidth, rect.y,
  66.        textWidth, 'left');
  67.     } else {
  68.       this.drawText(line.text, rect.x, rect.y,
  69.        rect.width, 'left');
  70.     }
  71.     return;
  72.     }
  73.     _Window_BattleLog_drawLineText.call(this, index);
  74.   };

  75. })();
复制代码
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-3-29 21:21

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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