diff options
author | syeyoung <cyong06@naver.com> | 2021-02-27 02:49:34 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-02-27 02:49:34 +0900 |
commit | 01f5b97bd5e0f9369f883982752852c0fbb09bc1 (patch) | |
tree | 8021ee6bd4c03878dc98b4ecea13dd8365541cbb /src/main/java/kr/syeyoung/dungeonsguide/features | |
parent | b0524098c6e6ae399fff7b94f8423e2f0d1b9567 (diff) | |
download | Skyblock-Dungeons-Guide-01f5b97bd5e0f9369f883982752852c0fbb09bc1.tar.gz Skyblock-Dungeons-Guide-01f5b97bd5e0f9369f883982752852c0fbb09bc1.tar.bz2 Skyblock-Dungeons-Guide-01f5b97bd5e0f9369f883982752852c0fbb09bc1.zip |
gui resize
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/GuiFeature.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/GuiFeature.java b/src/main/java/kr/syeyoung/dungeonsguide/features/GuiFeature.java index 36ae4c78..39dc2759 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/GuiFeature.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/GuiFeature.java @@ -30,14 +30,12 @@ public abstract class GuiFeature extends AbstractFeature implements ScreenRender private double defaultHeight; private double defaultRatio; - protected GuiFeature(String category, String name, String description, String key, boolean keepRatio, double width, double height) { + protected GuiFeature(String category, String name, String description, String key, boolean keepRatio, int width, int height) { super(category, name, description, key); this.keepRatio = keepRatio; this.defaultWidth = width; this.defaultHeight = height; this.defaultRatio = defaultWidth / (double)defaultHeight; - if (width > 1) width = width / 720; - if (height > 1) height = height / 480; this.featureRect = new GUIRectangle(0, 0, width, height); } @@ -80,14 +78,14 @@ public abstract class GuiFeature extends AbstractFeature implements ScreenRender @Override public void loadConfig(JsonObject jsonObject) { super.loadConfig(jsonObject); - GUIRectangle featureRect = TypeConverterRegistry.getTypeConverter("guirect",GUIRectangle.class).deserialize(jsonObject.get("$bounds2")); + GUIRectangle featureRect = TypeConverterRegistry.getTypeConverter("guirect",GUIRectangle.class).deserialize(jsonObject.get("$bounds")); if (featureRect != null && featureRect.getWidth() <= 1 && featureRect.getHeight() <= 1) this.featureRect = featureRect; } @Override public JsonObject saveConfig() { JsonObject object = super.saveConfig(); - object.add("$bounds2", TypeConverterRegistry.getTypeConverter("guirect", GUIRectangle.class).serialize(featureRect)); + object.add("$bounds", TypeConverterRegistry.getTypeConverter("guirect", GUIRectangle.class).serialize(featureRect)); return object; } } |