Skip to content

Commit

Permalink
Rewrite config screen (15)
Browse files Browse the repository at this point in the history
  • Loading branch information
EnnuiL committed May 14, 2024
1 parent 05697af commit cb1ed56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ public Text getEnumOptionText(TrackedValue<?> trackedValue, ConfigEnums.ConfigEn
}

public Text getEnumOptionTextTooltip(TrackedValue<?> trackedValue, ConfigEnums.ConfigEnum configEnum) {
return Text.translatable(String.format("config.%s.%s.%s", this.config.family(), this.scheme.coerce(trackedValue.key().toString()), configEnum.toString().toLowerCase()));
return Text.translatable(String.format("config.%s.%s.%s.tooltip", this.config.family(), this.scheme.coerce(trackedValue.key().toString()), configEnum.toString().toLowerCase()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ protected void init() {
button.setTooltip(Tooltip.create(this.configTextUtils.getOptionTextTooltip(trackedValue)));
this.addOptionToList(button, size);
} else if (trackedValue.value() instanceof ConfigEnums.ConfigEnum configEnum) {
var button = CyclingButtonWidget.<ConfigEnums.ConfigEnum>builder(value -> this.configTextUtils.getEnumOptionText(trackedValue, configEnum))
var button = CyclingButtonWidget.<ConfigEnums.ConfigEnum>builder(value -> this.configTextUtils.getEnumOptionText(trackedValue, value))
.values((ConfigEnums.ConfigEnum[]) ((Enum<?>) configEnum).getDeclaringClass().getEnumConstants())
.tooltip(value -> Tooltip.create(this.configTextUtils.getEnumOptionTextTooltip(trackedValue, configEnum)))
.tooltip(value -> Tooltip.create(this.configTextUtils.getEnumOptionTextTooltip(trackedValue, value)))
.initially((ConfigEnums.ConfigEnum) this.newValues.get(trackie))
.build(
0, 0, 150, 20,
Expand Down

0 comments on commit cb1ed56

Please sign in to comment.