From 980d5179fead0be5fdda90564bd1f13dee557ebe Mon Sep 17 00:00:00 2001 From: syeyoung Date: Tue, 7 Feb 2023 18:39:48 +0900 Subject: - Make it impossible to get mechanic browser super tiny Signed-off-by: syeyoung --- .../syeyoung/dungeonsguide/mod/features/AbstractHUDFeature.java | 7 +++++-- .../impl/secret/mechanicbrowser/FeatureMechanicBrowse.java | 8 ++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'mod/src') diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/AbstractHUDFeature.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/AbstractHUDFeature.java index 94bec8fd..51f9a8b4 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/AbstractHUDFeature.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/AbstractHUDFeature.java @@ -56,15 +56,18 @@ public abstract class AbstractHUDFeature extends AbstractGuiFeature { updatePosition(); } + public double minWidth() {return 10;} + + public double minHeight() {return 10;} public void setWidth(double width) { if (!requiresWidthBound()) throw new UnsupportedOperationException("Width unsettable"); - if (width < 10) width = 10; + if (width < minWidth()) width = minWidth(); featureRect.setWidth(width); updatePosition(); } public void setHeight(double height) { if (!requiresHeightBound() && (getKeepRatio() == null)) throw new UnsupportedOperationException("Height unsettable"); - if (height < 10) height = 10; + if (height < minHeight()) height = minHeight(); if (getKeepRatio() != null) featureRect.setWidth(height / getKeepRatio()); else diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java index 7b805234..8c453b78 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java @@ -71,7 +71,15 @@ public class FeatureMechanicBrowse extends RawRenderingGuiFeature { return this.getParameter("scale").getValue(); } + @Override + public double minWidth() { + return 100 * FeatureMechanicBrowse.this.getParameter("scale").getValue(); + } + @Override + public double minHeight() { + return 50 * FeatureMechanicBrowse.this.getParameter("scale").getValue(); + } @Override public void drawDemo(float partialTicks) { -- cgit