Skip to content

Commit

Permalink
Revert to default size when freeform is disabled and turning off auto…
Browse files Browse the repository at this point in the history
…detect and fix server constrictions message not showing when freeform is disabled
  • Loading branch information
Sollace committed Dec 19, 2024
1 parent 1289083 commit 9f6d77d
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -191,15 +195,15 @@ 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();
return v;
})
.getStyle().setText("minebp.camera.auto");

if (!allowCamera || !allowHitbox) {
if (!allowCamera || !allowHitbox || !hasScalingConsent()) {
content.addButton(new Label(left, top += 20)).getStyle().setText(OPTION_DISABLED);
}

Expand All @@ -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());
Expand Down

0 comments on commit 9f6d77d

Please sign in to comment.