diff options
author | Rime <81419447+Emirlol@users.noreply.github.com> | 2024-01-18 08:39:14 +0300 |
---|---|---|
committer | Rime <81419447+Emirlol@users.noreply.github.com> | 2024-01-21 09:37:49 +0300 |
commit | 9a86e3fa1ff130285a998f089939da24c3b5b7b9 (patch) | |
tree | 49d4094311b9ef6429404f69a9efb230acb73450 /src/main/java/de/hysky/skyblocker | |
parent | 8feae9fc42e894431bc16474c4476ee0f7e58fa4 (diff) | |
download | Skyblocker-9a86e3fa1ff130285a998f089939da24c3b5b7b9.tar.gz Skyblocker-9a86e3fa1ff130285a998f089939da24c3b5b7b9.tar.bz2 Skyblocker-9a86e3fa1ff130285a998f089939da24c3b5b7b9.zip |
Refactored score hud configs from Dungeons to DungeonScore
Diffstat (limited to 'src/main/java/de/hysky/skyblocker')
5 files changed, 30 insertions, 30 deletions
diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java index ffd6aa4d..e47b008d 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java @@ -624,18 +624,6 @@ public class SkyblockerConfig { public int mapY = 2; @SerialEntry - public boolean enableScore = true; - - @SerialEntry - public int scoreX = 29; - - @SerialEntry - public int scoreY = 134; - - @SerialEntry - public float scoreScaling = 1f; - - @SerialEntry public boolean playerSecretsTracker = false; @SerialEntry @@ -772,6 +760,18 @@ public class SkyblockerConfig { @SerialEntry public String dungeonScore300Message = "300 Score Reached!"; + + @SerialEntry + public boolean enableScoreHUD = true; + + @SerialEntry + public int scoreX = 29; + + @SerialEntry + public int scoreY = 134; + + @SerialEntry + public float scoreScaling = 1f; } public static class DungeonChestProfit { 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 8cd697e5..8546382f 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java @@ -317,9 +317,9 @@ public class DungeonsCategory { .build()) .option(Option.<Boolean>createBuilder() .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.enableScore")) - .binding(defaults.locations.dungeons.enableScore, - () -> config.locations.dungeons.enableScore, - newValue -> config.locations.dungeons.enableScore = newValue) + .binding(defaults.locations.dungeons.dungeonScore.enableScoreHUD, + () -> config.locations.dungeons.dungeonScore.enableScoreHUD, + newValue -> config.locations.dungeons.dungeonScore.enableScoreHUD = newValue) .controller(ConfigUtils::createBooleanController) .build()) .option(ButtonOption.createBuilder() @@ -336,12 +336,12 @@ public class DungeonsCategory { .build()) .option(Option.<Float>createBuilder() .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.scoreScaling")) - .binding(defaults.locations.dungeons.scoreScaling, - () -> config.locations.dungeons.scoreScaling, + .binding(defaults.locations.dungeons.dungeonScore.scoreScaling, + () -> config.locations.dungeons.dungeonScore.scoreScaling, newValue -> { - config.locations.dungeons.scoreX = config.locations.dungeons.scoreX + (int) ((config.locations.dungeons.scoreScaling - newValue) * 38.0); - config.locations.dungeons.scoreY = config.locations.dungeons.scoreY + (int) ((config.locations.dungeons.scoreScaling - newValue) * MinecraftClient.getInstance().textRenderer.fontHeight / 2.0); - config.locations.dungeons.scoreScaling = newValue; + config.locations.dungeons.dungeonScore.scoreX = config.locations.dungeons.dungeonScore.scoreX + (int) ((config.locations.dungeons.dungeonScore.scoreScaling - newValue) * 38.0); + config.locations.dungeons.dungeonScore.scoreY = config.locations.dungeons.dungeonScore.scoreY + (int) ((config.locations.dungeons.dungeonScore.scoreScaling - newValue) * MinecraftClient.getInstance().textRenderer.fontHeight / 2.0); + config.locations.dungeons.dungeonScore.scoreScaling = newValue; }) .controller(FloatFieldControllerBuilder::create) .build()) diff --git a/src/main/java/de/hysky/skyblocker/mixin/InGameHudMixin.java b/src/main/java/de/hysky/skyblocker/mixin/InGameHudMixin.java index 396bf893..df7cbdea 100644 --- a/src/main/java/de/hysky/skyblocker/mixin/InGameHudMixin.java +++ b/src/main/java/de/hysky/skyblocker/mixin/InGameHudMixin.java @@ -68,7 +68,7 @@ public abstract class InGameHudMixin { if (Utils.isInDungeons() && DungeonScore.isDungeonStarted()) { if (SkyblockerConfigManager.get().locations.dungeons.enableMap) DungeonMap.render(context.getMatrices()); - if (SkyblockerConfigManager.get().locations.dungeons.enableScore) DungeonScoreHUD.render(context); + if (SkyblockerConfigManager.get().locations.dungeons.dungeonScore.enableScoreHUD) DungeonScoreHUD.render(context); } } 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 00a956e1..b832f12d 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonMapConfigScreen.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonMapConfigScreen.java @@ -13,8 +13,8 @@ public class DungeonMapConfigScreen extends Screen { private int mapX = SkyblockerConfigManager.get().locations.dungeons.mapX; private int mapY = SkyblockerConfigManager.get().locations.dungeons.mapY; - private int scoreX = SkyblockerConfigManager.get().locations.dungeons.scoreX; - private int scoreY = SkyblockerConfigManager.get().locations.dungeons.scoreY; + private int scoreX = SkyblockerConfigManager.get().locations.dungeons.dungeonScore.scoreX; + private int scoreY = SkyblockerConfigManager.get().locations.dungeons.dungeonScore.scoreY; private static final Identifier MAP_BACKGROUND = new Identifier("textures/map/map_background.png"); private final Screen parent; @@ -39,7 +39,7 @@ public class DungeonMapConfigScreen extends Screen { @Override public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) { int mapSize = (int) (128 * SkyblockerConfigManager.get().locations.dungeons.mapScaling); - float scoreScaling = SkyblockerConfigManager.get().locations.dungeons.scoreScaling; + float scoreScaling = SkyblockerConfigManager.get().locations.dungeons.dungeonScore.scoreScaling; int scoreWidth = (int) (textRenderer.getWidth("Score: 300 (S+)") * scoreScaling); int scoreHeight = (int) (textRenderer.fontHeight * scoreScaling); if (RenderHelper.pointIsInArea(mouseX, mouseY, mapX, mapY, mapX + mapSize, mapY + mapSize) && button == 0) { @@ -57,7 +57,7 @@ public class DungeonMapConfigScreen extends Screen { if (button == 1) { mapX = 2; mapY = 2; - scoreX = Math.max((int) ((mapX + (64 * SkyblockerConfigManager.get().locations.dungeons.mapScaling)) - textRenderer.getWidth("Score: 300 (S+)") * SkyblockerConfigManager.get().locations.dungeons.scoreScaling / 2), 0); + scoreX = Math.max((int) ((mapX + (64 * SkyblockerConfigManager.get().locations.dungeons.mapScaling)) - textRenderer.getWidth("Score: 300 (S+)") * SkyblockerConfigManager.get().locations.dungeons.dungeonScore.scoreScaling / 2), 0); scoreY = (int) (mapY + (128 * SkyblockerConfigManager.get().locations.dungeons.mapScaling) + 4); } @@ -68,8 +68,8 @@ public class DungeonMapConfigScreen extends Screen { public void close() { SkyblockerConfigManager.get().locations.dungeons.mapX = mapX; SkyblockerConfigManager.get().locations.dungeons.mapY = mapY; - SkyblockerConfigManager.get().locations.dungeons.scoreX = scoreX; - SkyblockerConfigManager.get().locations.dungeons.scoreY = scoreY; + SkyblockerConfigManager.get().locations.dungeons.dungeonScore.scoreX = scoreX; + SkyblockerConfigManager.get().locations.dungeons.dungeonScore.scoreY = scoreY; SkyblockerConfigManager.save(); this.client.setScreen(parent); diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonScoreHUD.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonScoreHUD.java index 18038ccd..eedbf020 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonScoreHUD.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonScoreHUD.java @@ -12,13 +12,13 @@ public class DungeonScoreHUD { } public static void render(DrawContext context) { - int x = SkyblockerConfigManager.get().locations.dungeons.scoreX; - int y = SkyblockerConfigManager.get().locations.dungeons.scoreY; + int x = SkyblockerConfigManager.get().locations.dungeons.dungeonScore.scoreX; + int y = SkyblockerConfigManager.get().locations.dungeons.dungeonScore.scoreY; render(context, x, y); } public static void render(DrawContext context, int x, int y) { - float scale = SkyblockerConfigManager.get().locations.dungeons.scoreScaling; + float scale = SkyblockerConfigManager.get().locations.dungeons.dungeonScore.scoreScaling; MatrixStack matrixStack = context.getMatrices(); matrixStack.push(); matrixStack.scale(scale, scale, 0); |