I have a copy of
YEP_OptionsCore that I have been referencing, no worries. It is a paid plugin, so I think you should not share its code like that.
😅
I had a closer look and I think I see why the alignment doesn't work. It's using
drawTextEx, which allows for text codes (e.g.
\i[x]) but has no native alignment or fitting methods. It would need to measure the width of the processed text, then draw the text with an appropriate offset.
Instead...
Spoiler: Click to view plugin code
JavaScript:
/*:[/INDENT][/INDENT]
[INDENT][INDENT]* @plugindesc Some edits for YEP_OptionsCore[/INDENT][/INDENT]
[INDENT][INDENT]* @author Caethyril[/INDENT][/INDENT]
[INDENT][INDENT]* @help Load this plugin after YEP_OptionsCore.[/INDENT][/INDENT]
[INDENT][INDENT]*[/INDENT][/INDENT]
[INDENT][INDENT]* Terms of use: free to use and/or modify, for any project![/INDENT][/INDENT]
[INDENT][INDENT]*/[/INDENT][/INDENT]
[INDENT][INDENT][/INDENT][/INDENT]
[INDENT][INDENT]// Alias! Reduce options list window height by a fixed amount.[/INDENT][/INDENT]
[INDENT][INDENT](function(alias) {[/INDENT][/INDENT]
[INDENT][INDENT] Window_Options.prototype.windowHeight = function() {[/INDENT][/INDENT]
[INDENT][INDENT] return alias.apply(this, arguments) - 24; // 24 px shorter[/INDENT][/INDENT]
[INDENT][INDENT] };[/INDENT][/INDENT]
[INDENT][INDENT]})(Window_Options.prototype.windowHeight);[/INDENT][/INDENT]
[INDENT][INDENT][/INDENT][/INDENT]
[INDENT][INDENT]// New! Set custom category text alignment: "left", "center", or "right".[/INDENT][/INDENT]
[INDENT][INDENT]Window_OptionsCategory.prototype.itemTextAlign = function() { return 'center'; };[/INDENT][/INDENT]
[INDENT][INDENT][/INDENT][/INDENT]
[INDENT][INDENT]// Override! Allow left-, center-, or right-aligned category commands.[/INDENT][/INDENT]
[INDENT][INDENT]Window_OptionsCategory.prototype.drawItem = function() {[/INDENT][/INDENT]
[INDENT][INDENT] var rect = this.itemRectForText(index);[/INDENT][/INDENT]
[INDENT][INDENT] var txt = this.commandName(index);[/INDENT][/INDENT]
[INDENT][INDENT] var dw = rect.width - this.drawTextEx(txt, 0, this.contents.height);[/INDENT][/INDENT]
[INDENT][INDENT] var x = rect.x;[/INDENT][/INDENT]
[INDENT][INDENT] switch (this.itemTextAlign()) {[/INDENT][/INDENT]
[INDENT][INDENT] case 'center':[/INDENT][/INDENT]
[INDENT][INDENT] x += Math.floor(dw / 2);[/INDENT][/INDENT]
[INDENT][INDENT] break;[/INDENT][/INDENT]
[INDENT][INDENT] case 'right':[/INDENT][/INDENT]
[INDENT][INDENT] x += dw;[/INDENT][/INDENT]
[INDENT][INDENT] break;[/INDENT][/INDENT]
[INDENT][INDENT] }[/INDENT][/INDENT]
[INDENT][INDENT] this.resetTextColor();[/INDENT][/INDENT]
[INDENT][INDENT] this.changePaintOpacity(this.isCommandEnabled(index));[/INDENT][/INDENT]
[INDENT][INDENT] this.drawTextEx(txt, x, rect.y);[/INDENT][/INDENT]
[INDENT][INDENT]};
(I haven't actually tested, but I'm fairly confident it'll work.) I've included a
windowHeight alias here, too: as-is it should reduce the height by 24 px, but you might want to adjust that number.
Regarding your attempted edits: by default
itemTextAlign expects 0 inputs (it just gets the text alignment) and
drawTextEx only handles 3 inputs (text, x, y).