Code:
CGMV_Window_EncyclopediaList.prototype.drawItem = function(index) {
var item = this._data[index];
var rect = this.itemRect(index);
rect.width -= this.textPadding();
this.changePaintOpacity(this.isEnabled(item));
var number = CGMV.Encyclopedia.NumberEntries ? item._index + ". " : "";
var name = item._discovered ? this.getItemName(this._symbol, item._id) : CGMV.Encyclopedia.UnknownEntry;
this.drawText(number + name, rect.x+3, rect.y, rect.width, 'left');
this.changePaintOpacity(true);
};
What I want to do is delete the color code "\C[n]" from the text when it is writing it, I can delete the first 5 characters with a 'name.substring(5)' but sometimes the color code would be "\C[12]" and that substring will leave a character, what can I do to deleter everything between the '\' and the ']'? I tried replaceAll but it doesn't recognize it as a function.