use of me.ivan1f.tweakerplus.config.options.TweakerPlusIConfigBase in project tweakerplus by Ivan-1F.
the class WidgetListConfigOptionMixin method useMyBetterOptionLabelForTweakerPlus.
@ModifyArgs(method = "addConfigOption", at = @At(value = "INVOKE", target = "Lfi/dy/masa/malilib/gui/widgets/WidgetConfigOption;addLabel(IIIII[Ljava/lang/String;)V", remap = false), remap = false)
private void useMyBetterOptionLabelForTweakerPlus(Args args, int x_, int y_, float zLevel, int labelWidth, int configWidth, IConfigBase config) {
if (isTweakerPlusConfigGui()) {
int x = args.get(0);
int y = args.get(1);
int width = args.get(2);
int height = args.get(3);
int textColor = args.get(4);
String[] lines = args.get(5);
if (lines.length != 1) {
return;
}
// cancel original call
args.set(5, null);
Function<String, String> modifier = s -> s;
if (config instanceof TweakerPlusIConfigBase) {
modifier = ((TweakerPlusIConfigBase) config).getGuiDisplayLineModifier();
}
TweakerPlusOptionLabel label = new TweakerPlusOptionLabel(x, y, width, height, textColor, lines, new String[] { config.getName() }, modifier);
this.addWidget(label);
this.showOriginalTextsThisTime = label.shouldShowOriginalLines();
} else {
this.showOriginalTextsThisTime = false;
}
}
Aggregations