当前位置 : 主页 > 网络编程 > JavaScript >

shitake.js

来源:互联网 收集:自由互联 发布时间:2021-07-03
(function() { Window_Base.prototype.processEscapeCharacter = function(code, textState) { switch (code) { case 'C': this.changeTextColor(this.textColor(this.obtainEscapeParam(textState))); break; case 'I': this.processDrawIcon(this.obtainEsc
 
(function() {
    Window_Base.prototype.processEscapeCharacter = function(code, textState) {
        switch (code) {
        case 'C':
            this.changeTextColor(this.textColor(this.obtainEscapeParam(textState)));
            break;
        case 'I':
            this.processDrawIcon(this.obtainEscapeParam(textState), textState);
            break;
        case '{':
            this.makeFontBigger();
            break;
        case '}':
            this.makeFontSmaller();
            break;
        case '*':
            this.makeFontItalic();
            break;
        }
    };

    Window_Base.prototype.obtainEscapeCode = function(textState) {
        textState.index++;
        var regExp = /^[\\*\\$\\.\\|\\^!><\\{\\}\\\\]|^[A-Z]+/i;
        var arr = regExp.exec(textState.text.slice(textState.index));
        if (arr) {
            textState.index += arr[0].length;
            return arr[0].toUpperCase();
        } else {
            return '';
        }
    };

    Window_Base.prototype.makeFontItalic = function() {
        this.contents.fontItalic  = (this.contents.fontItalic ? false : true);
    };
})()

网友评论