forked from Trivel/RMMV
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMrTS_ItemColors.js
42 lines (36 loc) · 1.31 KB
/
MrTS_ItemColors.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//==============================================================================
// MrTS_ItemColors.js
//==============================================================================
/*:
* @plugindesc Adds color coding to items.
* @author Mr. Trivel
*
* @param Item Colors
* @desc HEX codes for item colors.
* @default #9d9d9d #FFFFFF #1eff00 #0070dd #a335ee #ff8000 #e6cc80
*
* @help This plugin does not provide plugin commands.
* Version 1.0
*
* Use the following tag in Item note fields:
* <color: X> - X being index of color in the plugin Item Colors parameter.
*
* E.g.
* <color: 1> - If using default settings, it'd be #9d9d9d color.
*/
(function() {
var parameters = PluginManager.parameters('MrTS_StaticExp');
var itemColorsDefault = String(parameters['Item Colors'] || "#9d9d9d #FFFFFF #1eff00 #0070dd #a335ee #ff8000 #e6cc80")
var itemColors = itemColorsDefault.split(" ");
Window_Base.prototype.drawItemName = function(item, x, y, width) {
width = width || 312;
if (item) {
var iconBoxWidth = Window_Base._iconWidth + 4;
this.resetTextColor();
if (item.meta.color)
this.changeTextColor(itemColors[item.meta.color-1]);
this.drawIcon(item.iconIndex, x + 2, y + 2);
this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
}
};
})();