aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java13
-rw-r--r--src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java7
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java30
-rw-r--r--src/main/resources/assets/skyblocker/lang/en_us.json3
4 files changed, 40 insertions, 13 deletions
diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java
index 6622fa83..d7279bc8 100644
--- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java
+++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java
@@ -575,6 +575,9 @@ public class SkyblockerConfig {
@SerialEntry
public WaypointType waypointType = WaypointType.WAYPOINT;
+
+ @SerialEntry
+ public boolean showSecretText = true;
@SerialEntry
public boolean enableEntranceWaypoints = true;
@@ -609,15 +612,19 @@ public class SkyblockerConfig {
public enum WaypointType {
WAYPOINT,
- OUTLINE,
- OUTLINED_WAYPOINT;
+ OUTLINED_WAYPOINT,
+ HIGHLIGHT,
+ OUTLINED_HIGHLIGHT,
+ OUTLINE;
@Override
public String toString() {
return switch (this) {
case WAYPOINT -> "Waypoint";
- case OUTLINE -> "Outline";
case OUTLINED_WAYPOINT -> "Outlined Waypoint";
+ case HIGHLIGHT -> "Highlight";
+ case OUTLINED_HIGHLIGHT -> "Outlined Highlight";
+ case OUTLINE -> "Outline";
};
}
}
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 89ac6f8e..7b32cb78 100644
--- a/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java
+++ b/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java
@@ -53,6 +53,13 @@ public class DungeonsCategory {
.controller(ConfigUtils::createEnumCyclingListController)
.build())
.option(Option.<Boolean>createBuilder()
+ .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.showSecretText"))
+ .binding(defaults.locations.dungeons.secretWaypoints.showSecretText,
+ () -> config.locations.dungeons.secretWaypoints.showSecretText,
+ newValue -> config.locations.dungeons.secretWaypoints.showSecretText = newValue)
+ .controller(ConfigUtils::createBooleanController)
+ .build())
+ .option(Option.<Boolean>createBuilder()
.name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableEntranceWaypoints"))
.binding(defaults.locations.dungeons.secretWaypoints.enableEntranceWaypoints,
() -> config.locations.dungeons.secretWaypoints.enableEntranceWaypoints,
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java
index 9fc2e778..0d9bdff1 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java
@@ -18,6 +18,8 @@ import java.util.function.Predicate;
import java.util.function.ToDoubleFunction;
public class SecretWaypoint {
+ private static final float HIGHLIGHT_ALPHA = 0.5f;
+ private static final float LINE_WIDTH = 5f;
static final List<String> SECRET_ITEMS = List.of("Decoy", "Defuse Kit", "Dungeon Chest Key", "Healing VIII", "Inflatable Jerry", "Spirit Leap", "Training Weights", "Trap", "Treasure Talisman");
final int secretIndex;
final Category category;
@@ -75,19 +77,29 @@ public class SecretWaypoint {
* Renders the secret waypoint, including a filled cube, a beacon beam, the name, and the distance from the player.
*/
void render(WorldRenderContext context) {
- switch (SkyblockerConfigManager.get().locations.dungeons.secretWaypoints.waypointType) {
- case WAYPOINT -> RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, pos, category.colorComponents, 0.5F);
- case OUTLINE -> RenderHelper.renderOutline(context, new Box(pos), category.colorComponents, 5F, true);
+ SkyblockerConfig.SecretWaypoints config = SkyblockerConfigManager.get().locations.dungeons.secretWaypoints;
+
+ switch (config.waypointType) {
+ case WAYPOINT -> RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, pos, category.colorComponents, HIGHLIGHT_ALPHA);
case OUTLINED_WAYPOINT -> {
- RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, pos, category.colorComponents, 0.5F);
- RenderHelper.renderOutline(context, new Box(pos), category.colorComponents, 5F, true);
+ RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, pos, category.colorComponents, HIGHLIGHT_ALPHA);
+ RenderHelper.renderOutline(context, new Box(pos), category.colorComponents, LINE_WIDTH, true);
+ }
+ case HIGHLIGHT -> RenderHelper.renderFilledThroughWalls(context, pos, category.colorComponents, HIGHLIGHT_ALPHA);
+ case OUTLINED_HIGHLIGHT -> {
+ RenderHelper.renderFilledThroughWalls(context, pos, category.colorComponents, HIGHLIGHT_ALPHA);
+ RenderHelper.renderOutline(context, new Box(pos), category.colorComponents, LINE_WIDTH, true);
}
+ //TODO In the future, shrink the box for wither essence and items so its more realistic
+ case OUTLINE -> RenderHelper.renderOutline(context, new Box(pos), category.colorComponents, LINE_WIDTH, true);
}
- Vec3d posUp = centerPos.add(0, 1, 0);
- RenderHelper.renderText(context, name, posUp, true);
- double distance = context.camera().getPos().distanceTo(centerPos);
- RenderHelper.renderText(context, Text.literal(Math.round(distance) + "m").formatted(Formatting.YELLOW), posUp, 1, MinecraftClient.getInstance().textRenderer.fontHeight + 1, true);
+ if (config.showSecretText) {
+ Vec3d posUp = centerPos.add(0, 1, 0);
+ RenderHelper.renderText(context, name, posUp, true);
+ double distance = context.camera().getPos().distanceTo(centerPos);
+ RenderHelper.renderText(context, Text.literal(Math.round(distance) + "m").formatted(Formatting.YELLOW), posUp, 1, MinecraftClient.getInstance().textRenderer.fontHeight + 1, true);
+ }
}
enum Category {
diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json
index f39aa669..552caf7c 100644
--- a/src/main/resources/assets/skyblocker/lang/en_us.json
+++ b/src/main/resources/assets/skyblocker/lang/en_us.json
@@ -239,7 +239,8 @@
"text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.noInitSecretWaypoints": "Do Not Initialize Secret Waypoints",
"text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.noInitSecretWaypoints.@Tooltip": "This option can save around 20 MB of ram if enabled, but Secret Waypoint will require a restart after turning off this option to work.",
"text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.waypointType": "Waypoint Type",
- "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.waypointType.@Tooltip": "Waypoint: The standard waypoint.\n\nOutline: Outlines the secret in a box.\n\nOutlined Waypoint: Displays both a waypoint and an outline.",
+ "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.waypointType.@Tooltip": "Waypoint: Displays a highlight and beam.\n\nOutlined Waypoint: Displays both a waypoint and an outline.\n\nHighlight: Only displays a highlight.\n\nOutlined Highlight: Displays both a highlight and an outline.\n\nOutline: Outlines the secret in a box.",
+ "text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.showSecretText": "Show Secret Text",
"text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableEntranceWaypoints" : "Enable Entrance Waypoints",
"text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableSuperboomWaypoints" : "Enable Superboom Waypoints",
"text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.enableChestWaypoints" : "Enable Chest Waypoints",