From 1556952ba10e8a79c10cbe7d5324482169fcdaf5 Mon Sep 17 00:00:00 2001 From: Sollace Date: Wed, 18 Dec 2024 14:53:37 +0100 Subject: [PATCH 1/3] Fix the revert button --- .../bigpony/client/gui/GuiBigSettings.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/minelittlepony/bigpony/client/gui/GuiBigSettings.java b/src/main/java/com/minelittlepony/bigpony/client/gui/GuiBigSettings.java index 5cce103..4b1ef92 100644 --- a/src/main/java/com/minelittlepony/bigpony/client/gui/GuiBigSettings.java +++ b/src/main/java/com/minelittlepony/bigpony/client/gui/GuiBigSettings.java @@ -29,6 +29,7 @@ public class GuiBigSettings extends GameGui { private EntityScale dimensions; private EntityScale initialDimensions; + private boolean initialDetectorState; final ScrollContainer content = new ScrollContainer(); @@ -62,8 +63,6 @@ public boolean hasHitboxConsent() { @Override protected void init() { - loadDimensions(); - addButton(new Label(width / 2, 6)).setCentered().getStyle().setText(getTitle().getString()); content.init(this::rebuildContent); @@ -75,11 +74,18 @@ protected void init() { addButton(revert = new Button(width / 2 + 10, super.height - 25, 100, 20)) .onClick(sender -> { dimensions = initialDimensions; + BigPony.getInstance().getConfig().useDetectedPonyScaling.set(initialDetectorState); + if (initialDetectorState) { + PresetDetector.getInstance().detectPreset(client.getGameProfile()); + } else { + PresetDetector.getInstance().revertFillyCam(); + } + BigPony.getInstance().getConfig().save(); updateDimensions(); clearAndInit(); }) .getStyle() - .setText("gui.revert"); + .setText("controls.reset"); tick(); } @@ -91,6 +97,7 @@ private void loadDimensions() { dimensions = ((Scaling.Holder)client.player).getScaling().getDimensions(); } initialDimensions = dimensions; + initialDetectorState = BigPony.getInstance().getConfig().useDetectedPonyScaling.get(); } private void rebuildContent() { @@ -167,7 +174,8 @@ private void rebuildContent() { Toggle visual; content.addButton(visual = new Toggle(left, top += 30, BigPony.getInstance().getConfig().useDetectedPonyScaling.get())).onChange(v -> { - BigPony.getInstance().getConfig().useDetectedPonyScaling.set(v); + BigPony.getInstance().getConfig().useDetectedPonyScaling.set(v); + BigPony.getInstance().getConfig().save(); if (v) { visual.setEnabled(false); PresetDetector.getInstance().detectPreset(client.getGameProfile()).thenAccept(dimensions -> { @@ -226,7 +234,7 @@ public void tick() { height.setEnabled(allowCamera && allowScaling); distance.setEnabled(allowCamera && allowScaling); - revert.setEnabled(!Objects.equals(dimensions, initialDimensions)); + revert.setEnabled(!Objects.equals(dimensions, initialDimensions) || (initialDetectorState != BigPony.getInstance().getConfig().useDetectedPonyScaling.get())); } @Override From 1289083c3d5c89ac79e1960bc226d987dff90695 Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 19 Dec 2024 22:56:39 +0100 Subject: [PATCH 2/3] Update dependencies --- gradle.properties | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gradle.properties b/gradle.properties index f5b3d23..7081bb1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,10 +3,10 @@ org.gradle.daemon=false # Fabric Properties # check these on https://fabricmc.net/develop - minecraft_version=1.21 - yarn_mappings=1.21+build.9 - loader_version=0.15.11 - fabric_version=0.100.7+1.21 + minecraft_version=1.21.1 + yarn_mappings=1.21.1+build.3 + loader_version=0.16.4 + fabric_version=0.102.0+1.21.1 # Mod Properties group=com.minelittlepony @@ -20,7 +20,7 @@ org.gradle.daemon=false # Dependencies modmenu_version=11.0.0-beta.1 - kirin_version=1.19.1+1.21 - hd_skins_version=6.13.0+1.21 + kirin_version=1.20.1+1.21 + hd_skins_version=6.14.2+1.21 minelp_version=4.12.1-beta.2+1.21 - fabwork_version=1.3.0+1.21 + fabwork_version=1.3.1+1.21 From 9f6d77d65a22fe99a793d65b27502ce3cf4347e2 Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 19 Dec 2024 22:57:34 +0100 Subject: [PATCH 3/3] Revert to default size when freeform is disabled and turning off autodetect and fix server constrictions message not showing when freeform is disabled --- .../bigpony/client/gui/GuiBigSettings.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/minelittlepony/bigpony/client/gui/GuiBigSettings.java b/src/main/java/com/minelittlepony/bigpony/client/gui/GuiBigSettings.java index 4b1ef92..f7e154f 100644 --- a/src/main/java/com/minelittlepony/bigpony/client/gui/GuiBigSettings.java +++ b/src/main/java/com/minelittlepony/bigpony/client/gui/GuiBigSettings.java @@ -54,6 +54,10 @@ public boolean hasCameraConsent() { } public boolean hasScalingConsent() { + return (client.player == null || Permissions.freeform(InteractionManager.getInstance().getPermissions())); + } + + public boolean isScalingButtonsEnabled() { return (client.player == null || Permissions.freeform(InteractionManager.getInstance().getPermissions())) && !BigPony.getInstance().getConfig().useDetectedPonyScaling.get(); } @@ -109,7 +113,7 @@ private void rebuildContent() { boolean allowCamera = hasCameraConsent(); boolean allowHitbox = hasHitboxConsent(); - boolean allowScaling = hasScalingConsent(); + boolean allowScaling = isScalingButtonsEnabled(); content.addButton(new Label(left, top)).getStyle().setText("minebp.options.body"); content.addButton(new Label(left, top + 100)).getStyle().setText("minebp.options.camera"); @@ -191,7 +195,7 @@ private void rebuildContent() { }); } else { PresetDetector.getInstance().revertFillyCam(); - dimensions = new EntityScale(dimensions.body(), dimensions.camera(), true); + dimensions = hasScalingConsent() ? new EntityScale(dimensions.body(), dimensions.camera(), true) : EntityScale.DEFAULT; updateDimensions(); } tick(); @@ -199,7 +203,7 @@ private void rebuildContent() { }) .getStyle().setText("minebp.camera.auto"); - if (!allowCamera || !allowHitbox) { + if (!allowCamera || !allowHitbox || !hasScalingConsent()) { content.addButton(new Label(left, top += 20)).getStyle().setText(OPTION_DISABLED); } @@ -221,7 +225,7 @@ public void render(DrawContext context, int mouseX, int mouseY, float partialTic @Override public void tick() { boolean allowCamera = hasCameraConsent(); - boolean allowScaling = hasScalingConsent(); + boolean allowScaling = isScalingButtonsEnabled(); for (int i = 0; i < presets.length; i++) { presets[i].updateEnabled(height.getValue(), distance.getValue(), xSize.getValue(), ySize.getValue(), zSize.getValue());