//=============================================================================
// MULI_ChangeFaceEmote.js
//=============================================================================
/*:
* @plugindesc 用代碼切換訊息視窗的臉圖,可以只換臉圖不換表情
* @author moonyoulove
*
* @help
* 名字的變量使用控制變量裡的腳本模式,用引號包括起來。Ex. "Actor1"
* 名字留空表示使用預設事件設置的臉圖名字
* 索引<0代表使用預設事件設置的臉圖索引
* @param nameVarId
* @text 存放臉圖名字的變量ID
* @desc
* @default 0
* @type number
*
* @param indexVarId
* @text 存放臉圖索引的變量ID
* @desc
* @default 0
* @type number
*/
function ChangeFaceE() {
throw new Error('This is a static class');
}
ChangeFaceE.parameters = PluginManager.parameters("MULI_ChangeFaceEmote");
ChangeFaceE.nameVarId = Number(ChangeFaceE.parameters.nameVarId);
ChangeFaceE.indexVarId = Number(ChangeFaceE.parameters.indexVarId);
(function() {
let _Game_Message_setFaceImage = Game_Message.prototype.setFaceImage;
Game_Message.prototype.setFaceImage = function(faceName, faceIndex) {
_Game_Message_setFaceImage.call(this, faceName, faceIndex);
this._faceName = $gameVariables.value(ChangeFaceE.nameVarId) || this._faceName;
let index = $gameVariables.value(ChangeFaceE.indexVarId);
this._faceIndex = index >= 0 ? index : this._faceIndex;
};
})();