Skip to content

Commit

Permalink
Merge branch '1.20.4' into 1.20.6
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Feb 6, 2025
2 parents a42fbcc + e5a3518 commit 763ca77
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

@Mixin(value = GuiWaypointsOptions.class, remap = false)
public abstract class MixinGuiWaypointsOptions extends ScreenBase {
@Unique
private Button showWaypointDistancesButton;
@Unique private Button xaeroPlus$showWaypointDistancesButton;
@Shadow private boolean buttonTest;

protected MixinGuiWaypointsOptions(final IXaeroMinimap modMain, final Screen parent, final Screen escape, final Component titleIn) {
Expand All @@ -41,19 +40,25 @@ public void injectShowWaypointDistancesButton(final CallbackInfo ci) {
.map(AbstractWidget::getY)
.orElse(280);
addRenderableWidget(
showWaypointDistancesButton = new MyBigButton(
xaeroPlus$showWaypointDistancesButton = new MyBigButton(
999,
this.width / 2 + 3,
prevButtonY + 25,
Component.literal(
Settings.REGISTRY.showWaypointDistances.getTranslatedName()
+ ": "
+ I18n.get(Settings.REGISTRY.showWaypointDistances.get() ? "gui.xaero_on" : "gui.xaero_off")),
xaeroPlus$getShowWaypointDistancesButtonComponent(),
(b) -> {
this.buttonTest = true;
Settings.REGISTRY.showWaypointDistances.setValue(!Settings.REGISTRY.showWaypointDistances.get());
xaeroPlus$showWaypointDistancesButton.setMessage(xaeroPlus$getShowWaypointDistancesButtonComponent());
}
)
);
}

@Unique
private Component xaeroPlus$getShowWaypointDistancesButtonComponent() {
return Component.literal(
Settings.REGISTRY.showWaypointDistances.getTranslatedName()
+ ": "
+ I18n.get(Settings.REGISTRY.showWaypointDistances.get() ? "gui.xaero_on" : "gui.xaero_off"));
}
}

0 comments on commit 763ca77

Please sign in to comment.