You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ycrpg/js/plugins/SimpleMsgSideView.js

92 lines
2.8 KiB
JavaScript

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

//=============================================================================
// SimpleMsgSideView.js
//=============================================================================
/*:
* @plugindesc at sideview battle, only display item/skill names.
* @author Sasuke KANNAZUKI
*
* @param displayAttack
* @desc Whether to display normal attack. 1:yes 0:no
* @default 0
*
* @param position
* @desc Skill name display position. 0:left, 1:center
* @default 1
*
* @help This plugin does not provide plugin commands.
*
* By not displaying the log and only displaying the skill name,
* the speed of battle will increase slightly.
*/
/*:ja
* @plugindesc サイドビューバトルで技/アイテムの名前のみ表示します。
* @author 神無月サスケ
*
* @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) {
this._lines.push(itemName);
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); // display item/skill name
} 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);
this.drawText(this._lines[index], rect.x, rect.y,
rect.width, 'center');
return;
}
_Window_BattleLog_drawLineText.call(this, index);
};
})();