Project1
标题:
MV自带插件SimpleMsgSideView.js添加技能名左侧显示图标效果
[打印本页]
作者:
竹中虎
时间:
2023-3-28 11:54
标题:
MV自带插件SimpleMsgSideView.js添加技能名左侧显示图标效果
拿chatgpt自己手动汉化+调试了一下成功了,看到版里好像没这个就顺带放一下好了,有需要自取。
//=============================================================================
// SimpleMsgSideView.js
//=============================================================================
/*:
* @plugindesc 在侧视战斗中仅显示技能/物品名称,并在技能名称左侧显示技能图标。Modify by The BAI LLC for BAI Chat.
* @author Sasuke KANNAZUKI
*
* @param displayAttack
* @desc 是否显示普通攻击(1:是,0:否)。
* @default 0
*
* @param position
* @desc 技能名称的显示位置(0:左对齐,1:居中)。
* @default 1
*
* @help 该插件没有插件命令
*
* 不显示日志,仅显示技能名称,可以使战斗节奏稍微加快。
*/
(function() {
var parameters = PluginManager.parameters('SimpleMsgSideView');
var displayAttack = Number(parameters['displayAttack']) != 0;
var position = Number(parameters['position'] || 1);
var _Window_BattleLog_addText = Window_BattleLog.prototype.addText;
Window_BattleLog.prototype.addText = function(text) {
if($gameSystem.isSideView()){
this.refresh();
this.wait();
return; // not display battle log
}
_Window_BattleLog_addText.call(this, text);
};
// for sideview battle only
Window_BattleLog.prototype.addItemNameText = function(itemName, iconIndex) {
this._lines.push({text: itemName, iconIndex: iconIndex});
this.refresh();
this.wait();
};
var _Window_BattleLog_displayAction =
Window_BattleLog.prototype.displayAction;
Window_BattleLog.prototype.displayAction = function(subject, item) {
if($gameSystem.isSideView()){
if(displayAttack ||
!(DataManager.isSkill(item) && item.id == subject.attackSkillId())) {
this.push('addItemNameText', item.name, item.iconIndex); // display item/skill name and icon
} else {
this.push('wait');
}
return;
}
_Window_BattleLog_displayAction.call(this, subject, item);
};
// to put skill/item name at center
var _Window_BattleLog_drawLineText = Window_BattleLog.prototype.drawLineText;
Window_BattleLog.prototype.drawLineText = function(index) {
if($gameSystem.isSideView() && position == 1){
var rect = this.itemRectForText(index);
this.contents.clearRect(rect.x, rect.y, rect.width, rect.height);
var line = this._lines[index];
if (line.iconIndex > 0) {
var iconBoxWidth = Window_Base._iconWidth + 4;
var textWidth = this.textWidth(line.text);
var startX = (rect.width - (textWidth + iconBoxWidth)) / 2;
this.drawIcon(line.iconIndex, rect.x + startX, rect.y + 2);
this.drawText(line.text, rect.x + startX + iconBoxWidth, rect.y,
textWidth, 'left');
} else {
this.drawText(line.text, rect.x, rect.y,
rect.width, 'left');
}
return;
}
_Window_BattleLog_drawLineText.call(this, index);
};
})();
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1