diff options
Diffstat (limited to 'src/main/java/de/hysky')
6 files changed, 3 insertions, 106 deletions
diff --git a/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java b/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java index a9c0c26b..1fb30afe 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java @@ -210,20 +210,6 @@ public class DungeonsCategory { newValue -> config.locations.dungeons.mapScaling = newValue) .controller(FloatFieldControllerBuilder::create) .build()) - .option(Option.<Integer>createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.mapX")) - .binding(defaults.locations.dungeons.mapX, - () -> config.locations.dungeons.mapX, - newValue -> config.locations.dungeons.mapX = newValue) - .controller(IntegerFieldControllerBuilder::create) - .build()) - .option(Option.<Integer>createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.mapY")) - .binding(defaults.locations.dungeons.mapY, - () -> config.locations.dungeons.mapY, - newValue -> config.locations.dungeons.mapY = newValue) - .controller(IntegerFieldControllerBuilder::create) - .build()) .option(Option.<Boolean>createBuilder() .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.starredMobGlow")) .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.starredMobGlow.@Tooltip"))) diff --git a/src/main/java/de/hysky/skyblocker/config/categories/DwarvenMinesCategory.java b/src/main/java/de/hysky/skyblocker/config/categories/DwarvenMinesCategory.java index 35c91d64..719cbd79 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/DwarvenMinesCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/DwarvenMinesCategory.java @@ -7,7 +7,6 @@ import dev.isxander.yacl3.api.ConfigCategory; import dev.isxander.yacl3.api.Option; import dev.isxander.yacl3.api.OptionDescription; import dev.isxander.yacl3.api.OptionGroup; -import dev.isxander.yacl3.api.controller.IntegerFieldControllerBuilder; import de.hysky.skyblocker.skyblock.dwarven.DwarvenHudConfigScreen; import net.minecraft.client.MinecraftClient; import net.minecraft.text.Text; @@ -74,20 +73,6 @@ public class DwarvenMinesCategory { newValue -> config.locations.dwarvenMines.dwarvenHud.enableBackground = newValue) .controller(ConfigUtils::createBooleanController) .build()) - .option(Option.<Integer>createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.x")) - .binding(defaults.locations.dwarvenMines.dwarvenHud.x, - () -> config.locations.dwarvenMines.dwarvenHud.x, - newValue -> config.locations.dwarvenMines.dwarvenHud.x = newValue) - .controller(IntegerFieldControllerBuilder::create) - .build()) - .option(Option.<Integer>createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud.y")) - .binding(defaults.locations.dwarvenMines.dwarvenHud.y, - () -> config.locations.dwarvenMines.dwarvenHud.y, - newValue -> config.locations.dwarvenMines.dwarvenHud.y = newValue) - .controller(IntegerFieldControllerBuilder::create) - .build()) .build()) .build(); } diff --git a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java index 6a393868..b4f61c36 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java @@ -5,7 +5,6 @@ import de.hysky.skyblocker.config.SkyblockerConfig; import dev.isxander.yacl3.api.*; import dev.isxander.yacl3.api.controller.FloatFieldControllerBuilder; import dev.isxander.yacl3.api.controller.FloatSliderControllerBuilder; -import dev.isxander.yacl3.api.controller.IntegerFieldControllerBuilder; import dev.isxander.yacl3.api.controller.IntegerSliderControllerBuilder; import de.hysky.skyblocker.skyblock.shortcut.ShortcutsConfigScreen; import de.hysky.skyblocker.utils.render.title.TitleContainerConfigScreen; @@ -421,34 +420,6 @@ public class GeneralCategory { newValue -> config.general.titleContainer.titleContainerScale = newValue) .controller(opt -> FloatFieldControllerBuilder.create(opt).range(30f, 140f)) .build()) - .option(Option.<Integer>createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.titleContainer.x")) - .binding(defaults.general.titleContainer.x, - () -> config.general.titleContainer.x, - newValue -> config.general.titleContainer.x = newValue) - .controller(IntegerFieldControllerBuilder::create) - .build()) - .option(Option.<Integer>createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.titleContainer.y")) - .binding(defaults.general.titleContainer.y, - () -> config.general.titleContainer.y, - newValue -> config.general.titleContainer.y = newValue) - .controller(IntegerFieldControllerBuilder::create) - .build()) - .option(Option.<SkyblockerConfig.Direction>createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.titleContainer.direction")) - .binding(defaults.general.titleContainer.direction, - () -> config.general.titleContainer.direction, - newValue -> config.general.titleContainer.direction = newValue) - .controller(ConfigUtils::createEnumCyclingListController) - .build()) - .option(Option.<SkyblockerConfig.Alignment>createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.general.titleContainer.alignment")) - .binding(defaults.general.titleContainer.alignment, - () -> config.general.titleContainer.alignment, - newValue -> config.general.titleContainer.alignment = newValue) - .controller(ConfigUtils::createEnumCyclingListController) - .build()) .option(ButtonOption.createBuilder() .name(Text.translatable("text.autoconfig.skyblocker.option.general.titleContainer.config")) .text(Text.translatable("text.skyblocker.open")) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonMapConfigScreen.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonMapConfigScreen.java index d662e99a..df5f36ce 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonMapConfigScreen.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonMapConfigScreen.java @@ -2,13 +2,8 @@ package de.hysky.skyblocker.skyblock.dungeon; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.utils.render.RenderHelper; -import dev.isxander.yacl3.api.ConfigCategory; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.OptionGroup; -import dev.isxander.yacl3.gui.YACLScreen; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.resource.language.I18n; import net.minecraft.text.Text; import java.awt.*; @@ -61,20 +56,8 @@ public class DungeonMapConfigScreen extends Screen { public void close() { SkyblockerConfigManager.get().locations.dungeons.mapX = hudX; SkyblockerConfigManager.get().locations.dungeons.mapY = hudY; - - if (parent instanceof YACLScreen yaclScreen) { - ConfigCategory category = yaclScreen.config.categories().stream().filter(cat -> cat.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.locations.dungeons"))).findFirst().orElseThrow(); - OptionGroup group = category.groups().get(0); // Internally index 0 is the group created for all ungrouped options - - Option<?> xOpt = group.options().stream().filter(opt -> opt.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.locations.dungeons.mapX"))).findFirst().orElseThrow(); - Option<?> yOpt = group.options().stream().filter(opt -> opt.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.locations.dungeons.mapY"))).findFirst().orElseThrow(); - - // Refresh the value in the config with the bound value - xOpt.forgetPendingValue(); - yOpt.forgetPendingValue(); - } - SkyblockerConfigManager.save(); + this.client.setScreen(parent); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/DwarvenHudConfigScreen.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/DwarvenHudConfigScreen.java index 10a73236..9bd6bef1 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/DwarvenHudConfigScreen.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/DwarvenHudConfigScreen.java @@ -4,14 +4,9 @@ import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.skyblock.dwarven.DwarvenHud.Commission; import de.hysky.skyblocker.skyblock.tabhud.widget.hud.HudCommsWidget; import de.hysky.skyblocker.utils.render.RenderHelper; -import dev.isxander.yacl3.api.ConfigCategory; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.OptionGroup; -import dev.isxander.yacl3.gui.YACLScreen; import it.unimi.dsi.fastutil.ints.IntIntPair; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.resource.language.I18n; import net.minecraft.text.Text; import java.awt.*; @@ -66,20 +61,8 @@ public class DwarvenHudConfigScreen extends Screen { public void close() { SkyblockerConfigManager.get().locations.dwarvenMines.dwarvenHud.x = hudX; SkyblockerConfigManager.get().locations.dwarvenMines.dwarvenHud.y = hudY; - - if (parent instanceof YACLScreen yaclScreen) { - ConfigCategory category = yaclScreen.config.categories().stream().filter(cat -> cat.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.locations.dwarvenMines"))).findFirst().orElseThrow(); - OptionGroup group = category.groups().stream().filter(grp -> grp.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.locations.dwarvenMines.dwarvenHud"))).findFirst().orElseThrow(); - - Option<?> xOpt = group.options().get(4); - Option<?> yOpt = group.options().get(5); - - // Refresh the value in the config with the bound value - xOpt.forgetPendingValue(); - yOpt.forgetPendingValue(); - } - SkyblockerConfigManager.save(); + client.setScreen(parent); } } diff --git a/src/main/java/de/hysky/skyblocker/utils/render/title/TitleContainerConfigScreen.java b/src/main/java/de/hysky/skyblocker/utils/render/title/TitleContainerConfigScreen.java index 599aa9f1..7eca7444 100644 --- a/src/main/java/de/hysky/skyblocker/utils/render/title/TitleContainerConfigScreen.java +++ b/src/main/java/de/hysky/skyblocker/utils/render/title/TitleContainerConfigScreen.java @@ -26,7 +26,7 @@ public class TitleContainerConfigScreen extends Screen { private float hudX = SkyblockerConfigManager.get().general.titleContainer.x; private float hudY = SkyblockerConfigManager.get().general.titleContainer.y; private final Screen parent; - private boolean changedScale, changedOrientation, changedAlignment; + private boolean changedScale; protected TitleContainerConfigScreen() { this(null); @@ -141,7 +141,6 @@ public class TitleContainerConfigScreen extends Screen { case MIDDLE -> SkyblockerConfig.Alignment.RIGHT; case RIGHT -> SkyblockerConfig.Alignment.LEFT; }; - changedAlignment = true; } if (keyCode == GLFW.GLFW_KEY_E) { SkyblockerConfig.Alignment current = SkyblockerConfigManager.get().general.titleContainer.alignment; @@ -150,7 +149,6 @@ public class TitleContainerConfigScreen extends Screen { case MIDDLE -> SkyblockerConfig.Alignment.LEFT; case RIGHT -> SkyblockerConfig.Alignment.MIDDLE; }; - changedAlignment = true; } if (keyCode == GLFW.GLFW_KEY_R) { SkyblockerConfig.Direction current = SkyblockerConfigManager.get().general.titleContainer.direction; @@ -158,7 +156,6 @@ public class TitleContainerConfigScreen extends Screen { case HORIZONTAL -> SkyblockerConfig.Direction.VERTICAL; case VERTICAL -> SkyblockerConfig.Direction.HORIZONTAL; }; - changedOrientation = true; } if (keyCode == GLFW.GLFW_KEY_EQUAL) { SkyblockerConfigManager.get().general.titleContainer.titleContainerScale += 10; @@ -182,17 +179,9 @@ public class TitleContainerConfigScreen extends Screen { OptionGroup group = category.groups().stream().filter(grp -> grp.name().getString().equals(I18n.translate("text.autoconfig.skyblocker.option.general.titleContainer"))).findFirst().orElseThrow(); Option<?> scaleOpt = group.options().get(0); - Option<?> xOpt = group.options().get(1); - Option<?> yOpt = group.options().get(2); - Option<?> orientationOpt = group.options().get(3); - Option<?> horizontalAlignmentOpt = group.options().get(4); // Refresh the value in the config with the bound value if (changedScale) scaleOpt.forgetPendingValue(); - xOpt.forgetPendingValue(); - yOpt.forgetPendingValue(); - if (changedOrientation) orientationOpt.forgetPendingValue(); - if (changedAlignment) horizontalAlignmentOpt.forgetPendingValue(); } SkyblockerConfigManager.save(); |