Skip to content

Instantly share code, notes, and snippets.

@triacontane
Created March 1, 2016 16:52
Show Gist options
  • Save triacontane/c6186a1b509cd33dc7f0 to your computer and use it in GitHub Desktop.
Save triacontane/c6186a1b509cd33dc7f0 to your computer and use it in GitHub Desktop.
オプション任意項目作成プラグイン Boolean項目のアイコン表示
/* アイコンを表示するために変更した箇所 開始 */
var _Window_Options_drawItem = Window_Options.prototype.drawItem;
Window_Options.prototype.drawItem = function(index) {
_Window_Options_drawItem.apply(this, arguments);
var rect = this.itemRectForText(index);
this.drawIcon(this.statusIcon(index), rect.width - Window_Base._iconWidth, rect.y + 2);
};
Window_Options.prototype.statusIcon = function(index) {
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
if (this.isNumberSymbol(symbol)) {
return 0;
} else if (this.isStringSymbol(symbol)) {
return 0;
} else if (this.isVolumeSymbol(symbol)) {
return 0;
} else {
return this.booleanStatusIcon(value);
}
};
Window_Options.prototype.booleanStatusText = function(value) {
return '';
};
Window_Options.prototype.booleanStatusIcon = function(value) {
return value ? 87 : 88;
};
/* アイコンを表示するために変更した箇所 終了 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment