From 6ef7dd02899795384801c11ffdae9764c27dc238 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Sun, 5 Feb 2023 23:02:46 +0900 Subject: - better precision - min max in settings (Fixes #301) Signed-off-by: syeyoung --- .../dungeonsguide/mod/config/types/TCDouble.java | 99 ++++++++++++++++++++++ .../dungeonsguide/mod/config/types/TCFloat.java | 86 ------------------- .../mod/dungeon/actions/ActionMove.java | 2 +- .../actions/tree/ActionRouteProperties.java | 2 +- .../dungeon/roomedit/valueedit/ValueEditFloat.java | 2 +- .../roomprocessor/RoomProcessorIcePath.java | 2 +- .../boxpuzzle/RoomProcessorBoxSolver.java | 4 +- .../icefill/RoomProcessorIcePath2.java | 2 +- .../mod/features/FeatureRegistry.java | 7 +- .../features/impl/advanced/FeatureTestPeople.java | 8 +- .../features/impl/dungeon/FeatureDungeonMap.java | 24 +++--- .../impl/etc/FeatureDecreaseExplosionSound.java | 8 +- .../impl/secret/PathfindLineProperties.java | 8 +- .../mechanicbrowser/FeatureMechanicBrowse.java | 16 ++-- .../features/impl/solvers/FeatureSolverBox.java | 10 ++- .../impl/solvers/FeatureSolverIcefill.java | 10 ++- .../impl/solvers/FeatureSolverSilverfish.java | 10 ++- .../mod/features/text/TextHUDFeature.java | 14 +-- .../mod/guiv2/elements/GlobalHUDScale.java | 2 +- 19 files changed, 175 insertions(+), 141 deletions(-) create mode 100644 mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCDouble.java delete mode 100644 mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCFloat.java (limited to 'mod/src/main/java') diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCDouble.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCDouble.java new file mode 100644 index 00000000..78013434 --- /dev/null +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCDouble.java @@ -0,0 +1,99 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package kr.syeyoung.dungeonsguide.mod.config.types; + +import com.google.gson.JsonElement; +import com.google.gson.JsonPrimitive; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.configv3.ParameterItem; +import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.mod.guiv2.BindableAttribute; +import kr.syeyoung.dungeonsguide.mod.guiv2.Widget; +import kr.syeyoung.dungeonsguide.mod.guiv2.xml.AnnotatedImportOnlyWidget; +import kr.syeyoung.dungeonsguide.mod.guiv2.xml.annotations.Bind; +import kr.syeyoung.dungeonsguide.mod.guiv2.xml.annotations.On; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; + +public class TCDouble implements FeatureTypeHandler { + public static final TCDouble INSTANCE = new TCDouble(); + @Override + public Double deserialize(JsonElement element) { + return element.getAsDouble(); + } + + @Override + public JsonElement serialize(Double element) { + return new JsonPrimitive(element); + } + + + @Override + public Widget createDefaultWidgetFor(FeatureParameter parameter) { + ParameterItem parameterItem = new ParameterItem(parameter, new DoubleEditWidget(parameter)); + return parameterItem; + } + + public static class DoubleEditWidget extends AnnotatedImportOnlyWidget { + @Bind(variableName = "value") + public final BindableAttribute value = new BindableAttribute<>(String.class); + private double truth; + + private double min; + private double max; + + public DoubleEditWidget(FeatureParameter featureParameter) { + this(featureParameter, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY); + } + + public DoubleEditWidget(FeatureParameter featureParameter, double min, double max) { + super(new ResourceLocation("dungeonsguide:gui/config/parameter/number.gui")); + this.truth = featureParameter.getValue(); + this.min = min; + this.max = max; + value.setValue(String.format("%f", truth)); + value.addOnUpdate((old, neu) -> { + try { + truth = Float.parseFloat(neu); + if (truth < min) return; + if (truth > max) return; + featureParameter.setValue(truth); + } catch (Exception e) { + } + }); + } + + @On(functionName = "inc") + public void inc() { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); + truth += (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) ? 1 : 0.1); + if (truth > max) truth = max; + value.setValue(String.format("%f", truth)); + } + + @On(functionName = "dec") + public void dec() { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); + truth -= (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) ? 1 : 0.1); + if (truth < min) truth = min; + value.setValue(String.format("%f", truth)); + } + } +} diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCFloat.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCFloat.java deleted file mode 100644 index 5bd47d09..00000000 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/TCFloat.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package kr.syeyoung.dungeonsguide.mod.config.types; - -import com.google.gson.JsonElement; -import com.google.gson.JsonPrimitive; -import kr.syeyoung.dungeonsguide.mod.config.guiconfig.configv3.ParameterItem; -import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; -import kr.syeyoung.dungeonsguide.mod.guiv2.BindableAttribute; -import kr.syeyoung.dungeonsguide.mod.guiv2.Widget; -import kr.syeyoung.dungeonsguide.mod.guiv2.xml.AnnotatedImportOnlyWidget; -import kr.syeyoung.dungeonsguide.mod.guiv2.xml.annotations.Bind; -import kr.syeyoung.dungeonsguide.mod.guiv2.xml.annotations.On; -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.input.Keyboard; - -public class TCFloat implements FeatureTypeHandler { - public static final TCFloat INSTANCE = new TCFloat(); - @Override - public Float deserialize(JsonElement element) { - return element.getAsFloat(); - } - - @Override - public JsonElement serialize(Float element) { - return new JsonPrimitive(element); - } - - - @Override - public Widget createDefaultWidgetFor(FeatureParameter parameter) { - ParameterItem parameterItem = new ParameterItem(parameter, new FloatEditWidget(parameter)); - return parameterItem; - } - - public static class FloatEditWidget extends AnnotatedImportOnlyWidget { - @Bind(variableName = "value") - public final BindableAttribute value = new BindableAttribute<>(String.class); - private float truth; - - public FloatEditWidget(FeatureParameter featureParameter) { - super(new ResourceLocation("dungeonsguide:gui/config/parameter/number.gui")); - this.truth = featureParameter.getValue(); - value.setValue(String.valueOf(truth)); - value.addOnUpdate((old, neu) -> { - try { - truth = Float.parseFloat(neu); - featureParameter.setValue(truth); - } catch (Exception e) { - } - }); - } - - @On(functionName = "inc") - public void inc() { - Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); - truth += (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) ? 1 : 0.1); - value.setValue(String.valueOf(truth)); - } - - @On(functionName = "dec") - public void dec() { - Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); - truth -= (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) ? 1 : 0.1); - value.setValue(String.valueOf(truth)); - } - } -} diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMove.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMove.java index 15a5bbe0..56dd9ada 100755 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMove.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/ActionMove.java @@ -79,7 +79,7 @@ public class ActionMove extends AbstractAction { if (!FeatureRegistry.SECRET_TOGGLE_KEY.isEnabled() || !FeatureRegistry.SECRET_TOGGLE_KEY.togglePathfindStatus) { if (poses != null){ - RenderUtils.drawLinesVec3(poses, actionRouteProperties.getLineColor(), actionRouteProperties.getLineWidth(), partialTicks, true); + RenderUtils.drawLinesVec3(poses, actionRouteProperties.getLineColor(), (float) actionRouteProperties.getLineWidth(), partialTicks, true); } } } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/tree/ActionRouteProperties.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/tree/ActionRouteProperties.java index cc215bf5..a26fc2fc 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/tree/ActionRouteProperties.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/actions/tree/ActionRouteProperties.java @@ -26,7 +26,7 @@ public class ActionRouteProperties { private boolean pathfind; private int lineRefreshRate; private AColor lineColor; - private float lineWidth; + private double lineWidth; private boolean beacon; private AColor beaconColor; diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditFloat.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditFloat.java index 00b9937e..3a668d0f 100755 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditFloat.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomedit/valueedit/ValueEditFloat.java @@ -26,7 +26,7 @@ import kr.syeyoung.dungeonsguide.mod.gui.elements.MLabelAndElement; import java.awt.*; -public class ValueEditFloat extends MPanel implements ValueEdit { +public class ValueEditFloat extends MPanel implements ValueEdit { private Parameter parameter; diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorIcePath.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorIcePath.java index d46264f7..e8088828 100755 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorIcePath.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorIcePath.java @@ -141,7 +141,7 @@ public class RoomProcessorIcePath extends GeneralRoomProcessor { super.drawWorld(partialTicks); if (!FeatureRegistry.SOLVER_SILVERFISH.isEnabled()) return; if (!err) - RenderUtils.drawLines(solution, FeatureRegistry.SOLVER_SILVERFISH.getLineColor(),FeatureRegistry.SOLVER_SILVERFISH.getLineWidth(), partialTicks, true); + RenderUtils.drawLines(solution, FeatureRegistry.SOLVER_SILVERFISH.getLineColor(), (float) FeatureRegistry.SOLVER_SILVERFISH.getLineWidth(), partialTicks, true); } public Point getPointOfSilverFishOnMap(BlockPos blockPos) { diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java index c8de6e5c..97a80656 100755 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java @@ -363,11 +363,11 @@ public class RoomProcessorBoxSolver extends GeneralRoomProcessor { } if (pathFound != null) { - RenderUtils.drawLines(pathFound, FeatureRegistry.SOLVER_BOX.getLineColor(),FeatureRegistry.SOLVER_BOX.getLineWidth(), partialTicks, true); + RenderUtils.drawLines(pathFound, FeatureRegistry.SOLVER_BOX.getLineColor(), (float) FeatureRegistry.SOLVER_BOX.getLineWidth(), partialTicks, true); } } else { if (totalPath != null) { - RenderUtils.drawLines(totalPath, FeatureRegistry.SOLVER_BOX.getLineColor(),FeatureRegistry.SOLVER_BOX.getLineWidth(), partialTicks, false); + RenderUtils.drawLines(totalPath, FeatureRegistry.SOLVER_BOX.getLineColor(), (float) FeatureRegistry.SOLVER_BOX.getLineWidth(), partialTicks, false); } if (totalPushedBlocks != null) { for (int i = 0; i < totalPushedBlocks.size(); i++) { diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/icefill/RoomProcessorIcePath2.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/icefill/RoomProcessorIcePath2.java index b6bba1f0..66140160 100755 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/icefill/RoomProcessorIcePath2.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/icefill/RoomProcessorIcePath2.java @@ -99,7 +99,7 @@ public class RoomProcessorIcePath2 extends GeneralRoomProcessor { public void drawWorld(float partialTicks) { if (!FeatureRegistry.SOLVER_ICEPATH.isEnabled()) return; for (List solution:this.solution) - RenderUtils.drawLines(solution, FeatureRegistry.SOLVER_ICEPATH.getLineColor(),FeatureRegistry.SOLVER_ICEPATH.getLineWidth(), partialTicks, true); + RenderUtils.drawLines(solution, FeatureRegistry.SOLVER_ICEPATH.getLineColor(), (float) FeatureRegistry.SOLVER_ICEPATH.getLineWidth(), partialTicks, true); } public static class Generator implements RoomProcessorGenerator { diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/FeatureRegistry.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/FeatureRegistry.java index 3b009181..f9a558f3 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/FeatureRegistry.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/FeatureRegistry.java @@ -18,8 +18,9 @@ package kr.syeyoung.dungeonsguide.mod.features; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.configv3.ParameterItem; import kr.syeyoung.dungeonsguide.mod.config.types.TCBoolean; -import kr.syeyoung.dungeonsguide.mod.config.types.TCFloat; +import kr.syeyoung.dungeonsguide.mod.config.types.TCDouble; import kr.syeyoung.dungeonsguide.mod.config.types.TCKeybind; import kr.syeyoung.dungeonsguide.mod.events.annotations.EventHandlerRegistry; import kr.syeyoung.dungeonsguide.mod.features.impl.advanced.*; @@ -145,11 +146,11 @@ public class FeatureRegistry { if (init) OverlayManager.getEventHandler().guiResize(null); })); - addParameter("scale", new FeatureParameter("scale", "Scale", "Custom HUD Scale",1.0f, TCFloat.INSTANCE, a -> { + addParameter("scale", new FeatureParameter("scale", "Scale", "Custom HUD Scale",1.0, TCDouble.INSTANCE, a -> { if (init) OverlayManager.getEventHandler().guiResize(null); - })); + }).setWidgetGenerator((param) -> new ParameterItem(param, new TCDouble.DoubleEditWidget(param, 0.1, Double.POSITIVE_INFINITY)))); init = true; } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureTestPeople.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureTestPeople.java index 7e1d6096..771ef5d2 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureTestPeople.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureTestPeople.java @@ -21,7 +21,8 @@ package kr.syeyoung.dungeonsguide.mod.features.impl.advanced; import com.mojang.authlib.GameProfile; import com.mojang.authlib.minecraft.MinecraftProfileTexture; import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; -import kr.syeyoung.dungeonsguide.mod.config.types.TCFloat; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.configv3.ParameterItem; +import kr.syeyoung.dungeonsguide.mod.config.types.TCDouble; import kr.syeyoung.dungeonsguide.mod.events.annotations.DGEventHandler; import kr.syeyoung.dungeonsguide.mod.events.impl.DungeonStartedEvent; import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; @@ -65,7 +66,7 @@ import static kr.syeyoung.dungeonsguide.mod.utils.TabListUtil.getString; public class FeatureTestPeople extends RawRenderingGuiFeature { Logger logger = LogManager.getLogger("FeatureTestPeople"); - private Float scale; + private Double scale; private Set lastMembersRaw; private boolean broadcastLock; @@ -73,7 +74,8 @@ public class FeatureTestPeople extends RawRenderingGuiFeature { super("Dungeon", "Feature test", "NOU", "", false, 200, 100); - addParameter("scale", new FeatureParameter<>("scale", "Scale", "Scale", 2.0f, TCFloat.INSTANCE, nval -> this.scale = nval)); + addParameter("scale", new FeatureParameter<>("scale", "Scale", "Scale", 2.0, TCDouble.INSTANCE, nval -> this.scale = nval) + .setWidgetGenerator((param) -> new ParameterItem(param, new TCDouble.DoubleEditWidget(param, 0.1, Double.POSITIVE_INFINITY)))); // (new Thread(() -> { // while (true){ diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMap.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMap.java index 43763842..3be8695b 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMap.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMap.java @@ -22,6 +22,7 @@ import com.google.common.collect.ComparisonChain; import com.google.common.collect.Ordering; import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.configv3.ParameterItem; import kr.syeyoung.dungeonsguide.mod.config.types.*; import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; import kr.syeyoung.dungeonsguide.mod.dungeon.map.DungeonRoomScaffoldParser; @@ -69,14 +70,14 @@ public class FeatureDungeonMap extends RawRenderingGuiFeature { private AColor backgroudColor; private AColor playerColor; private boolean shouldCacheMap; - private float playerHeadScale; + private double playerHeadScale; private boolean shouldShowOtherPlayers; - private float textScale; + private double textScale; private boolean showSecretCount; private boolean showPlayerHeads; private boolean shouldRotateWithPlayer; private boolean shouldScale; - private float postscaleOfMap; + private double postscaleOfMap; private boolean centerMapOnPlayer; public FeatureDungeonMap() { @@ -86,12 +87,15 @@ public class FeatureDungeonMap extends RawRenderingGuiFeature { addParameter("cacheMap", new FeatureParameter<>("cacheMap", "Should cache map data", "name", true, TCBoolean.INSTANCE, nval -> shouldCacheMap = nval)); addParameter("playerCenter", new FeatureParameter<>("playerCenter", "Center map at player", "Render you in the center", false, TCBoolean.INSTANCE, nval -> centerMapOnPlayer = nval)); addParameter("rotate", new FeatureParameter<>("rotate", "Rotate map centered at player", "Only works with Center map at player enabled", false, TCBoolean.INSTANCE, nval -> shouldRotateWithPlayer = nval)); - addParameter("postScale", new FeatureParameter<>("postScale", "Scale factor of map", "Only works with Center map at player enabled", 1.0f, TCFloat.INSTANCE, nval -> postscaleOfMap = nval)); + addParameter("postScale", new FeatureParameter<>("postScale", "Scale factor of map", "Only works with Center map at player enabled", 1.0, TCDouble.INSTANCE, nval -> postscaleOfMap = nval) + .setWidgetGenerator((param) -> new ParameterItem(param, new TCDouble.DoubleEditWidget(param, 0.1, Double.POSITIVE_INFINITY)))); addParameter("useplayerheads", new FeatureParameter<>("useplayerheads", "Use player heads instead of arrows", "Option to use player heads instead of arrows", true, TCBoolean.INSTANCE, nval -> showPlayerHeads = nval)); addParameter("showotherplayers", new FeatureParameter<>("showotherplayers", "Show other players", "Option to show other players in map", true, TCBoolean.INSTANCE, nval -> shouldShowOtherPlayers = nval)); addParameter("showtotalsecrets", new FeatureParameter<>("showtotalsecrets", "Show Total secrets in the room", "Option to overlay total secrets in the specific room", true, TCBoolean.INSTANCE, nval -> showSecretCount = nval)); - addParameter("playerheadscale", new FeatureParameter<>("playerheadscale", "Player head scale", "Scale factor of player heads, defaults to 1", 1.0f, TCFloat.INSTANCE, nval -> playerHeadScale = nval)); - addParameter("textScale", new FeatureParameter<>("textScale", "Text scale", "Scale factor of texts on map, defaults to 1", 1.0f, TCFloat.INSTANCE, nval -> textScale = nval)); + addParameter("playerheadscale", new FeatureParameter<>("playerheadscale", "Player head scale", "Scale factor of player heads, defaults to 1", 1.0, TCDouble.INSTANCE, nval -> playerHeadScale = nval) + .setWidgetGenerator((param) -> new ParameterItem(param, new TCDouble.DoubleEditWidget(param, 0.1, Double.POSITIVE_INFINITY)))); + addParameter("textScale", new FeatureParameter<>("textScale", "Text scale", "Scale factor of texts on map, defaults to 1", 1.0, TCDouble.INSTANCE, nval -> textScale = nval) + .setWidgetGenerator((param) -> new ParameterItem(param, new TCDouble.DoubleEditWidget(param, 0.1, Double.POSITIVE_INFINITY)))); addParameter("border_color", new FeatureParameter<>("border_color", "Color of the border", "Same as name", new AColor(255, 255, 255, 255), TCAColor.INSTANCE)); addParameter("background_color", new FeatureParameter<>("background_color", "Color of the background", "Same as name", new AColor(0x22000000, true), TCAColor.INSTANCE, nval -> backgroudColor = nval)); @@ -168,7 +172,7 @@ public class FeatureDungeonMap extends RawRenderingGuiFeature { public void renderMap(float partialTicks, DungeonRoomScaffoldParser mapProcessor, MapData mapData, DungeonContext context) { EntityPlayer p = Minecraft.getMinecraft().thePlayer; - float postScale = this.centerMapOnPlayer ? postscaleOfMap : 1; + double postScale = this.centerMapOnPlayer ? postscaleOfMap : 1; GUIPosition featureRect = getFeatureRect(); int width = featureRect.getWidth().intValue(); @@ -353,7 +357,7 @@ public class FeatureDungeonMap extends RawRenderingGuiFeature { } - private void renderHeads(DungeonRoomScaffoldParser mapProcessor, MapData mapData, float scale, float postScale, float partialTicks) { + private void renderHeads(DungeonRoomScaffoldParser mapProcessor, MapData mapData, float scale, double postScale, float partialTicks) { EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; Set playerList = getPlayerListCached(); @@ -413,7 +417,7 @@ public class FeatureDungeonMap extends RawRenderingGuiFeature { * @param pt2 * @param yaw2 */ - private void drawHead(float scale, float postScale, TabListEntry networkPlayerInfo, EntityPlayer entityPlayer, Vector2d pt2, float yaw2) { + private void drawHead(float scale, double postScale, TabListEntry networkPlayerInfo, EntityPlayer entityPlayer, Vector2d pt2, float yaw2) { GlStateManager.pushMatrix(); boolean flag1 = entityPlayer != null && entityPlayer.isWearing(EnumPlayerModelParts.CAPE); GlStateManager.enableTexture2D(); @@ -441,7 +445,7 @@ public class FeatureDungeonMap extends RawRenderingGuiFeature { private static final ResourceLocation mapIcons = new ResourceLocation("textures/map/map_icons.png"); - private void renderArrows(MapData mapData, float scale, float postScale) { + private void renderArrows(MapData mapData, float scale, double postScale) { Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); int k = 0; diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureDecreaseExplosionSound.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureDecreaseExplosionSound.java index 5f7d17dd..054a1e89 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureDecreaseExplosionSound.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureDecreaseExplosionSound.java @@ -20,7 +20,8 @@ package kr.syeyoung.dungeonsguide.mod.features.impl.etc; import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; -import kr.syeyoung.dungeonsguide.mod.config.types.TCFloat; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.configv3.ParameterItem; +import kr.syeyoung.dungeonsguide.mod.config.types.TCDouble; import kr.syeyoung.dungeonsguide.mod.events.annotations.DGEventHandler; import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; @@ -30,7 +31,8 @@ import net.minecraftforge.client.event.sound.PlaySoundEvent; public class FeatureDecreaseExplosionSound extends SimpleFeature { public FeatureDecreaseExplosionSound() { super("Misc", "Decrease Explosion sound effect", "Decreases volume of explosions while on skyblock", "qol.explosionsound"); - addParameter("sound", new FeatureParameter("sound", "Sound Multiplier %", "The volume of explosion effect will be multiplied by this value. 0~100", 10.0f, TCFloat.INSTANCE)); + addParameter("sound", new FeatureParameter("sound", "Sound Multiplier %", "The volume of explosion effect will be multiplied by this value. 0~100", 10.0, TCDouble.INSTANCE) + .setWidgetGenerator((param) -> new ParameterItem(param, new TCDouble.DoubleEditWidget(param, 0, 100)))); } @DGEventHandler @@ -41,7 +43,7 @@ public class FeatureDecreaseExplosionSound extends SimpleFeature { PositionedSoundRecord positionedSoundRecord = (PositionedSoundRecord) soundEvent.result; PositionedSoundRecord neweff = new PositionedSoundRecord( positionedSoundRecord.getSoundLocation(), - positionedSoundRecord.getVolume() * (this.getParameter("sound").getValue() / 100), + (float) (positionedSoundRecord.getVolume() * (this.getParameter("sound").getValue() / 100)), positionedSoundRecord.getPitch(), positionedSoundRecord.getXPosF(), positionedSoundRecord.getYPosF(), diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/PathfindLineProperties.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/PathfindLineProperties.java index fd49c21d..7afe42a3 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/PathfindLineProperties.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/PathfindLineProperties.java @@ -18,6 +18,7 @@ package kr.syeyoung.dungeonsguide.mod.features.impl.secret; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.configv3.ParameterItem; import kr.syeyoung.dungeonsguide.mod.config.types.*; import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionRouteProperties; import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; @@ -35,7 +36,8 @@ public class PathfindLineProperties extends SimpleFeature { addParameter("useGlobal", new FeatureParameter("useGlobal", "Use Global Settings instead of this", "Completely ignore these settings, then use the parent one:: '"+parent.getName()+"'", useParent, TCBoolean.INSTANCE)); addParameter("pathfind", new FeatureParameter("pathfind", "Enable Pathfinding", "Enable pathfind for secrets", useParent, TCBoolean.INSTANCE)); addParameter("lineColor", new FeatureParameter("lineColor", "Line Color", "Color of the pathfind line", new AColor(0xFFFF0000, true), TCAColor.INSTANCE)); - addParameter("lineWidth", new FeatureParameter("lineWidth", "Line Thickness", "Thickness of the pathfind line",1.0f, TCFloat.INSTANCE)); + addParameter("lineWidth", new FeatureParameter("lineWidth", "Line Thickness", "Thickness of the pathfind line",1.0, TCDouble.INSTANCE) + .setWidgetGenerator((param) -> new ParameterItem(param, new TCDouble.DoubleEditWidget(param, 0.1, Double.POSITIVE_INFINITY)))); addParameter("linerefreshrate", new FeatureParameter("linerefreshrate", "Line Refreshrate", "Ticks to wait per line refresh. Specify it to -1 to don't refresh line at all", 10, TCInteger.INSTANCE)); addParameter("beacon", new FeatureParameter("beacon", "Enable Beacons", "Enable beacons for pathfind line targets", true, TCBoolean.INSTANCE)); addParameter("beamColor", new FeatureParameter("beamColor", "Beam Color", "Color of the beacon beam", new AColor(0x77FF0000, true), TCAColor.INSTANCE)); @@ -59,8 +61,8 @@ public class PathfindLineProperties extends SimpleFeature { public AColor getLineColor() { return isGlobal() ? parent.getLineColor() : this.getParameter("lineColor").getValue(); } - public float getLineWidth() { - return isGlobal() ? parent.getLineWidth() : this.getParameter("lineWidth").getValue(); + public double getLineWidth() { + return isGlobal() ? parent.getLineWidth() : this.getParameter("lineWidth").getValue(); } public int getRefreshRate() { return isGlobal() ? parent.getRefreshRate() : this.getParameter("linerefreshrate").getValue(); 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 3795e3b5..7b805234 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 @@ -21,8 +21,9 @@ package kr.syeyoung.dungeonsguide.mod.features.impl.secret.mechanicbrowser; import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.configv3.ParameterItem; import kr.syeyoung.dungeonsguide.mod.config.types.GUIPosition; -import kr.syeyoung.dungeonsguide.mod.config.types.TCFloat; +import kr.syeyoung.dungeonsguide.mod.config.types.TCDouble; import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; import kr.syeyoung.dungeonsguide.mod.dungeon.actions.tree.ActionRoute; import kr.syeyoung.dungeonsguide.mod.dungeon.roomfinder.DungeonRoom; @@ -62,18 +63,19 @@ public class FeatureMechanicBrowse extends RawRenderingGuiFeature { public FeatureMechanicBrowse() { super("Dungeon.Secrets.Secret Browser","Secret Browser", "Browse and Pathfind secrets and mechanics in the current room", "secret.mechanicbrowse", false, 100, 300); - addParameter("scale", new FeatureParameter("scale", "Scale", "Scale", 1.0f, TCFloat.INSTANCE)); + addParameter("scale", new FeatureParameter("scale", "Scale", "Scale", 1.0, TCDouble.INSTANCE) + .setWidgetGenerator((param) -> new ParameterItem(param, new TCDouble.DoubleEditWidget(param, 0.1, Double.POSITIVE_INFINITY)))); } public double getScale() { - return this.getParameter("scale").getValue(); + return this.getParameter("scale").getValue(); } @Override public void drawDemo(float partialTicks) { - double scale = FeatureMechanicBrowse.this.getParameter("scale").getValue(); + double scale = FeatureMechanicBrowse.this.getParameter("scale").getValue(); GlStateManager.scale(scale, scale, 1.0); GUIPosition bigDim = getFeatureRect(); @@ -104,7 +106,7 @@ public class FeatureMechanicBrowse extends RawRenderingGuiFeature { if (!(dungeonRoom.getRoomProcessor() instanceof GeneralRoomProcessor)) return; GeneralRoomProcessor grp = (GeneralRoomProcessor) dungeonRoom.getRoomProcessor(); - double scale = FeatureMechanicBrowse.this.getParameter("scale").getValue(); + double scale = FeatureMechanicBrowse.this.getParameter("scale").getValue(); GlStateManager.scale(scale, scale, 1.0); GUIPosition bigDim = getFeatureRect(); @@ -157,9 +159,9 @@ public class FeatureMechanicBrowse extends RawRenderingGuiFeature { public void getTooltipForEditor(List widgets) { super.getTooltipForEditor(widgets); -// mPanels.add(new MPassiveLabelAndElement("Scale", new MFloatSelectionButton(FeatureMechanicBrowse.this.getParameter("scale").getValue()) {{ +// mPanels.add(new MPassiveLabelAndElement("Scale", new MFloatSelectionButton(FeatureMechanicBrowse.this.getParameter("scale").getValue()) {{ // setOnUpdate(() ->{ -// FeatureMechanicBrowse.this.getParameter("scale").setValue(this.getData()); +// FeatureMechanicBrowse.this.getParameter("scale").setValue(this.getData()); // }); } // })); } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverBox.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverBox.java index f1e5bc98..16cf55b8 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverBox.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverBox.java @@ -18,10 +18,11 @@ package kr.syeyoung.dungeonsguide.mod.features.impl.solvers; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.configv3.ParameterItem; import kr.syeyoung.dungeonsguide.mod.config.types.AColor; import kr.syeyoung.dungeonsguide.mod.config.types.TCAColor; import kr.syeyoung.dungeonsguide.mod.config.types.TCBoolean; -import kr.syeyoung.dungeonsguide.mod.config.types.TCFloat; +import kr.syeyoung.dungeonsguide.mod.config.types.TCDouble; import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; @@ -33,7 +34,8 @@ public class FeatureSolverBox extends SimpleFeature { this.parameters = new LinkedHashMap<>(); addParameter("disableText", new FeatureParameter("disableText", "Box Puzzle Solver Disable text", "Disable 'Type recalc to recalculate solution' showing up on top left.\nYou can still type recalc to recalc solution after disabling this feature", false, TCBoolean.INSTANCE)); addParameter("lineColor", new FeatureParameter("lineColor", "Line Color", "Color of the solution line", new AColor(0xFF00FF00, true), TCAColor.INSTANCE)); - addParameter("lineWidth", new FeatureParameter("lineWidth", "Line Thickness", "Thickness of the solution line",1.0f, TCFloat.INSTANCE)); + addParameter("lineWidth", new FeatureParameter("lineWidth", "Line Thickness", "Thickness of the solution line",1.0, TCDouble.INSTANCE) + .setWidgetGenerator((param) -> new ParameterItem(param, new TCDouble.DoubleEditWidget(param, 0.1, Double.POSITIVE_INFINITY)))); addParameter("targetColor", new FeatureParameter("targetColor", "Target Color", "Color of the target button", new AColor(0x5500FFFF, true), TCAColor.INSTANCE)); addParameter("textColor1", new FeatureParameter("textColor1", "Text Color", "Color of the text (next step)", new AColor(0xFF00FF00, true), TCAColor.INSTANCE)); @@ -42,8 +44,8 @@ public class FeatureSolverBox extends SimpleFeature { public AColor getLineColor() { return this.getParameter("lineColor").getValue(); } - public float getLineWidth() { - return this.getParameter("lineWidth").getValue(); + public double getLineWidth() { + return this.getParameter("lineWidth").getValue(); } public boolean disableText() { return this.getParameter("disableText").getValue(); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverIcefill.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverIcefill.java index f9415f75..2dacf1da 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverIcefill.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverIcefill.java @@ -18,9 +18,10 @@ package kr.syeyoung.dungeonsguide.mod.features.impl.solvers; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.configv3.ParameterItem; import kr.syeyoung.dungeonsguide.mod.config.types.AColor; import kr.syeyoung.dungeonsguide.mod.config.types.TCAColor; -import kr.syeyoung.dungeonsguide.mod.config.types.TCFloat; +import kr.syeyoung.dungeonsguide.mod.config.types.TCDouble; import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; @@ -31,12 +32,13 @@ public class FeatureSolverIcefill extends SimpleFeature { super("Dungeon.Solvers.Floor 3+", "Icepath (Advanced)", "Calculates solution for icepath puzzle and displays it to user", "solver.icepath"); this.parameters = new LinkedHashMap<>(); addParameter("lineColor", new FeatureParameter("lineColor", "Line Color", "Color of the solution line", new AColor(0xFF00FF00, true), TCAColor.INSTANCE)); - addParameter("lineWidth", new FeatureParameter("lineWidth", "Line Thickness", "Thickness of the solution line",1.0f, TCFloat.INSTANCE)); + addParameter("lineWidth", new FeatureParameter("lineWidth", "Line Thickness", "Thickness of the solution line",1.0, TCDouble.INSTANCE) + .setWidgetGenerator((param) -> new ParameterItem(param, new TCDouble.DoubleEditWidget(param, 0.1, Double.POSITIVE_INFINITY)))); } public AColor getLineColor() { return this.getParameter("lineColor").getValue(); } - public float getLineWidth() { - return this.getParameter("lineWidth").getValue(); + public double getLineWidth() { + return this.getParameter("lineWidth").getValue(); } } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverSilverfish.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverSilverfish.java index 053f452b..eb7f543e 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverSilverfish.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/solvers/FeatureSolverSilverfish.java @@ -18,9 +18,10 @@ package kr.syeyoung.dungeonsguide.mod.features.impl.solvers; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.configv3.ParameterItem; import kr.syeyoung.dungeonsguide.mod.config.types.AColor; import kr.syeyoung.dungeonsguide.mod.config.types.TCAColor; -import kr.syeyoung.dungeonsguide.mod.config.types.TCFloat; +import kr.syeyoung.dungeonsguide.mod.config.types.TCDouble; import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; @@ -31,16 +32,17 @@ public class FeatureSolverSilverfish extends SimpleFeature { super("Dungeon.Solvers.Floor 3+", "Silverfish (Advanced)", "Actively calculates solution for silverfish puzzle and displays it to user", "solver.silverfish"); this.parameters = new LinkedHashMap<>(); addParameter("lineColor", new FeatureParameter("lineColor", "Line Color", "Color of the solution line", new AColor(0xFF00FF00, true), TCAColor.INSTANCE, nval -> lineColor = nval)); - addParameter("lineWidth", new FeatureParameter("lineWidth", "Line Thickness", "Thickness of the solution line",1.0f, TCFloat.INSTANCE, nval -> lineWidth = nval)); + addParameter("lineWidth", new FeatureParameter("lineWidth", "Line Thickness", "Thickness of the solution line",1.0, TCDouble.INSTANCE, nval -> lineWidth = nval) + .setWidgetGenerator((param) -> new ParameterItem(param, new TCDouble.DoubleEditWidget(param, 0.1, Double.POSITIVE_INFINITY)))); } AColor lineColor; - Float lineWidth; + Double lineWidth; public AColor getLineColor() { return lineColor; } - public float getLineWidth() { + public double getLineWidth() { return lineWidth; } } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextHUDFeature.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextHUDFeature.java index 90ef0ffe..5c2ff8ff 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextHUDFeature.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextHUDFeature.java @@ -18,6 +18,7 @@ package kr.syeyoung.dungeonsguide.mod.features.text; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.configv3.ParameterItem; import kr.syeyoung.dungeonsguide.mod.config.guiconfig.location2.MarkerProvider; import kr.syeyoung.dungeonsguide.mod.config.types.*; import kr.syeyoung.dungeonsguide.mod.events.annotations.DGEventHandler; @@ -49,7 +50,8 @@ public abstract class TextHUDFeature extends AbstractHUDFeature implements Style addParameter("textStylesNEW", new FeatureParameter>("textStylesNEW", "", "", new ArrayList(), TCTextStyleList.INSTANCE) .setWidgetGenerator((param) -> new CompatLayer(new PanelTextParameterConfig(TextHUDFeature.this)))); addParameter("alignment", new FeatureParameter("alignment", "Alignment", "Alignment", RichText.TextAlign.LEFT, new TCEnum<>(RichText.TextAlign.values()), richText::setAlign)); - addParameter("scale", new FeatureParameter("scale", "Scale", "Scale", 1.0f, TCFloat.INSTANCE)); + addParameter("scale", new FeatureParameter("scale", "Scale", "Scale", 1.0, TCDouble.INSTANCE) + .setWidgetGenerator((param) -> new ParameterItem(param, new TCDouble.DoubleEditWidget(param, 0.1, Double.POSITIVE_INFINITY)))); } @Override @@ -77,7 +79,7 @@ public abstract class TextHUDFeature extends AbstractHUDFeature implements Style List asd = getText(); ParentDelegatingTextStyle defaultStyle = ParentDelegatingTextStyle.ofDefault(); - defaultStyle.setSize((double) (this.getParameter("scale").getValue() * 8)); + defaultStyle.setSize((double) (this.getParameter("scale").getValue() * 8)); TextSpan span = new TextSpan(defaultStyle, ""); @@ -100,7 +102,7 @@ public abstract class TextHUDFeature extends AbstractHUDFeature implements Style @Override public void drawDemo(float partialTicks) { List asd = getDummyText(); - double scale = this.getParameter("scale").getValue(); + double scale = this.getParameter("scale").getValue(); GlStateManager.scale(scale, scale, 0); StyledTextRenderer.drawTextWithStylesAssociated(asd, 0, 0, 100, getStylesMap(), @@ -146,7 +148,7 @@ public abstract class TextHUDFeature extends AbstractHUDFeature implements Style ); ParentDelegatingTextStyle defaultStyle = ParentDelegatingTextStyle.ofDefault(); - defaultStyle.setSize((double) (hudFeature.getParameter("scale").getValue() * 8)); + defaultStyle.setSize((double) (hudFeature.getParameter("scale").getValue() * 8)); TextSpan span = new TextSpan(defaultStyle, ""); @@ -220,9 +222,9 @@ public abstract class TextHUDFeature extends AbstractHUDFeature implements Style // }); // // mPanels.add(new MPassiveLabelAndElement("Alignment", mStringSelectionButton)); -// mPanels.add(new MPassiveLabelAndElement("Scale", new MFloatSelectionButton(TextHUDFeature.this.getParameter("scale").getValue()) {{ +// mPanels.add(new MPassiveLabelAndElement("Scale", new MFloatSelectionButton(TextHUDFeature.this.getParameter("scale").getValue()) {{ // setOnUpdate(() ->{ -// TextHUDFeature.this.getParameter("scale").setValue(this.getData()); +// TextHUDFeature.this.getParameter("scale").setValue(this.getData()); // }); } // })); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/GlobalHUDScale.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/GlobalHUDScale.java index 1feab6e3..13a7286b 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/GlobalHUDScale.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/GlobalHUDScale.java @@ -49,7 +49,7 @@ public class GlobalHUDScale extends Widget implements Layouter, Renderer { private double getScale() { boolean useMc = FeatureRegistry.GLOBAL_HUD_SCALE.getParameter("mc").getValue(); if (useMc) return (double) new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor(); - else return FeatureRegistry.GLOBAL_HUD_SCALE.getParameter("scale").getValue(); + else return FeatureRegistry.GLOBAL_HUD_SCALE.getParameter("scale").getValue(); } private double scale; -- cgit