本帖最后由 越青 于 2020-8-27 21:37 编辑
自己尝试找了一会儿终于找到Window_Message了,
然后试着在Window_Message.prototype.startMessage里面强行插入了上面那段代码……改了改大概是这样的。
Window_Message.prototype.startMessage = function() { this._textState = {}; this._textState.index = 0; var textcopy = this.convertEscapeCharacters($gameMessage.allText()); var sizeoftextcopy = textcopy.indexOf('\n'); var resulttext = textcopy.substring(0,sizeoftextcopy); var resulttext2 = textcopy.substring(0,sizeoftextcopy+1); if (resulttext == "哈罗德"){ resulttext = "\\c[2]【哈罗德】\\c[0]"; textcopy = textcopy.replace(resulttext2,resulttext+"\n"); } this._textState.text = textcopy; this.newPage(this._textState); this.updatePlacement(); this.updateBackground(); this.open(); };
Window_Message.prototype.startMessage = function() {
this._textState = {};
this._textState.index = 0;
var textcopy = this.convertEscapeCharacters($gameMessage.allText());
var sizeoftextcopy = textcopy.indexOf('\n');
var resulttext = textcopy.substring(0,sizeoftextcopy);
var resulttext2 = textcopy.substring(0,sizeoftextcopy+1);
if (resulttext == "哈罗德"){
resulttext = "\\c[2]【哈罗德】\\c[0]";
textcopy = textcopy.replace(resulttext2,resulttext+"\n");
}
this._textState.text = textcopy;
this.newPage(this._textState);
this.updatePlacement();
this.updateBackground();
this.open();
};
但是还是存在着颜色不能显示的问题,实际显示的还是\C[]而非颜色的修改。
到底是出了什么问题呢?
==============================================
自己改了一下,发现13行改成这句就可以了
this._textState.text = this.convertEscapeCharacters(textcopy);
虽然从头到尾不知道自己写的代码是什么意思,但是能用就好 |