//============================================================================= // TMPlugin - メニューバトラー // バージョン: 0.1.1b // 最終更新日: 2020/04/06 // 配布元 : https://hikimoki.sakura.ne.jp/ //----------------------------------------------------------------------------- // Copyright (c) 2020 tomoaky // Released under the MIT license. // http://opensource.org/licenses/mit-license.php //============================================================================= /*: @plugindesc Changes the face image on the menu screen to [SV]Buttler. @author tomoaky @url https://github.com/munokura/tomoaky-MV-plugins @license MIT License @help English Help Translator: munokura This is an unofficial English translation of the plugin help, created to support global RPG Maker users. Feedback is welcome to improve translation quality (see: https://github.com/munokura/tomoaky-MV-plugins ). Original plugin by tomoaky. ----- TMPlugin - Menu Butler ver. 0.1.1b How to Use: When you install this plugin with "Use Side-View Battle" checked in the System tab of the database, the face images on the menu screen will change to Side-View Battler. You can set the face image display conditions in the plugin parameters. This plugin has been tested with RPG Maker MV Version 1.6.2. This plugin is distributed under the MIT License and is free to use, including for commercial purposes, modifications, and redistribution. @param faceImageRule @desc Facial image display conditions @default 0 @type select @option Do not display @value 0 @option Displayed only when there is no side view image @value 1 @option Show @value 2 @param shiftBattlerX @desc Amount to shift the side view image horizontally. Default: 0 @default 0 @type number @min -9999 @param shiftBattlerY @desc Amount to shift the side view image vertically. Default: -24 @default -24 @type number @min -9999 */ /*:ja @plugindesc メニュー画面の顔画像をサイドビューバトラーに変更します。 @author tomoaky @url https://github.com/munokura/tomoaky-MV-plugins @license MIT License @help TMPlugin - メニューバトラー ver0.1.1b 使い方: データベースのシステムタブにある『サイドビュー戦闘を使用』に チェックを入れた状態でこのプラグインを導入すると メニュー画面の顔画像がサイドビューバトラーに変わります。 プラグインパラメータで顔画像の表示条件を設定できます。 このプラグインは RPGツクールMV Version 1.6.2 で動作確認をしています。 このプラグインはMITライセンスのもとに配布しています、商用利用、 改造、再配布など、自由にお使いいただけます。 @param faceImageRule @desc 顔画像の表示条件 @default 0 @type select @option 表示しない @value 0 @option サイドビュー画像がない場合のみ表示 @value 1 @option 表示する @value 2 @param shiftBattlerX @desc サイドビュー画像を横方向にずらす量 初期値: 0 @default 0 @type number @min -9999 @param shiftBattlerY @desc サイドビュー画像を縦方向にずらす量 初期値: -24 @default -24 @type number @min -9999 */ var Imported = Imported || {}; Imported.TMMenuBattler = true; (function() { var parameters = PluginManager.parameters('TMMenuBattler'); var faceImageRule = +(parameters['faceImageRule'] || 0); var shiftBattlerX = +(parameters['shiftBattlerX'] || 0); var shiftBattlerY = +(parameters['shiftBattlerY'] || 0); //----------------------------------------------------------------------------- // Window_Base // Window_Base.prototype.drawMenuBattler = function(actor, x, y, width, height) { if (this.needsFaceDraw(actor)) { this.drawFace(actor.faceName(), actor.faceIndex(), x, y, width, height); } width = Math.floor((width || Window_Base._faceWidth) / 2); height = height || Window_Base._faceHeight; this.menuBattlerSprite(x + width, y + height).setBattler(actor); }; Window_Base.prototype.needsFaceDraw = function(actor) { return (faceImageRule === 1 && !actor.battlerName()) || faceImageRule === 2; }; Window_Base.prototype.menuBattlerSprite = function(x, y) { if (!this._menuBattlerSprite) { this._menuBattlerSprite = new Sprite_MenuBattler(); x += this.padding + shiftBattlerX; y += this.padding + shiftBattlerY; this._menuBattlerSprite.setHome(x, y); this.addChild(this._menuBattlerSprite); } return this._menuBattlerSprite; }; //----------------------------------------------------------------------------- // Window_MenuStatus // Window_MenuStatus.prototype.menuBattlerSprite = function(index) { if (!this._menuBattlerSprites) { this._menuBattlerSprites = []; } var i = index - this.topIndex(); if (!this._menuBattlerSprites[i]) { this._menuBattlerSprites[i] = new Sprite_MenuBattler(); var rect = this.itemRect(index); var x = rect.x + 1 + Math.floor(Window_Base._faceWidth / 2) + this.padding + shiftBattlerX; var y = rect.y + 1 + Window_Base._faceHeight + this.padding + shiftBattlerY; this._menuBattlerSprites[i].setHome(x, y); this.addChild(this._menuBattlerSprites[i]); } return this._menuBattlerSprites[i]; }; var _Window_MenuStatus_drawItemImage = Window_MenuStatus.prototype.drawItemImage; Window_MenuStatus.prototype.drawItemImage = function(index) { var actor = $gameParty.members()[index]; if (this.needsFaceDraw(actor)) { _Window_MenuStatus_drawItemImage.call(this, index); } this.menuBattlerSprite(index).setBattler(actor); }; //----------------------------------------------------------------------------- // Window_SkillStatus // Window_SkillStatus.prototype.drawActorFace = function(actor, x, y, width, height) { this.drawMenuBattler(actor, x, y, width, height); }; //----------------------------------------------------------------------------- // Window_Status // Window_Status.prototype.drawActorFace = function(actor, x, y, width, height) { this.drawMenuBattler(actor, x, y, width, height); }; //----------------------------------------------------------------------------- // Sprite_MenuBattler // function Sprite_MenuBattler() { this.initialize.apply(this, arguments); } Sprite_MenuBattler.prototype = Object.create(Sprite_Actor.prototype); Sprite_MenuBattler.prototype.constructor = Sprite_MenuBattler; Sprite_MenuBattler.prototype.setBattler = function(battler) { Sprite_Battler.prototype.setBattler.call(this, battler); var changed = (battler !== this._actor); if (changed) { this._actor = battler; this.refreshMotion(); this._stateSprite.setup(battler); } }; Sprite_MenuBattler.prototype.updateVisibility = function() { var actor = this._actor; this.visible = actor && actor.battlerName(); }; Sprite_MenuBattler.prototype.startMove = function(x, y, duration) { }; Sprite_Actor.prototype.refreshMotion = function() { var actor = this._actor; if (actor) { var stateMotion = actor.stateMotionIndex(); if (stateMotion === 3) { this.startMotion('dead'); } else if (stateMotion === 2) { this.startMotion('sleep'); } else if (stateMotion === 1) { this.startMotion('abnormal'); } else if (actor.isDying()) { this.startMotion('dying'); } else if (actor.isBattleMember()) { this.startMotion('walk'); } else { this.startMotion('wait'); } } }; })();