diff --git a/src/main/java/wtf/cheeze/sbt/SkyblockTweaks.java b/src/main/java/wtf/cheeze/sbt/SkyblockTweaks.java index f765da8..c60145d 100644 --- a/src/main/java/wtf/cheeze/sbt/SkyblockTweaks.java +++ b/src/main/java/wtf/cheeze/sbt/SkyblockTweaks.java @@ -47,12 +47,12 @@ public class SkyblockTweaks implements ModInitializer { public static final Gson GSON = new Gson(); - public static final Logger LOGGER = LoggerFactory.getLogger("SkyBlockTweaks"); + public static final Logger LOGGER = LoggerFactory.getLogger("SkyblockTweaks"); public static final SkyblockData DATA = new SkyblockData(); public static final PersistentData PD = PersistentData.load(); public static final SkyblockTweaksConfig CONFIG = new SkyblockTweaksConfig(); public static final ArrayList HUDS = new ArrayList(); - public static final Version VERSION = new Version(Version.VersionType.ALPHA, 0, 1, 0, 5); + public static final Version VERSION = new Version(Version.VersionType.ALPHA, 0, 1, 0, 6); public static final MinecraftClient mc = MinecraftClient.getInstance(); diff --git a/src/main/java/wtf/cheeze/sbt/config/categories/General.java b/src/main/java/wtf/cheeze/sbt/config/categories/General.java index 6404dc4..0a2c0a2 100644 --- a/src/main/java/wtf/cheeze/sbt/config/categories/General.java +++ b/src/main/java/wtf/cheeze/sbt/config/categories/General.java @@ -23,8 +23,6 @@ public static ConfigCategory getCategory(ConfigImpl defaults, ConfigImpl config) .group(InventoryTweaks.getGroup(defaults, config)) .group(MenuHighlights.Config.getGroup(defaults, config)) .group(BrewingStandOverlay.Config.getGroup(defaults, config)) - .group(PartyFeatures.Config.getGroup(defaults, config)) - .option(PartyFeatures.Config.getBlackList(defaults, config)) .group(HudTweaks.getGroup(defaults, config)) .group(ActionBarTransformer.Config.getGroup(defaults, config)) .build(); diff --git a/src/main/java/wtf/cheeze/sbt/features/MenuHighlights.java b/src/main/java/wtf/cheeze/sbt/features/MenuHighlights.java index d3df2a7..4f0d62f 100644 --- a/src/main/java/wtf/cheeze/sbt/features/MenuHighlights.java +++ b/src/main/java/wtf/cheeze/sbt/features/MenuHighlights.java @@ -109,6 +109,16 @@ public static void tryDrawHighlightWidget(DrawContext context, Slot slot) { else highlight(context, slot, HIGHLIGHT_RED2); } + public static void tryDrawHighlightTasks(DrawContext context, Slot slot) { + if (!SkyblockTweaks.CONFIG.config.hubSelectorHighlight.sblevelHighlight) return; + var lines = slot.getStack().getOrDefault(DataComponentTypes.LORE, LoreComponent.DEFAULT).lines(); + for (var line: lines) { + var s = line.getString(); + if (s.equals("Total Progress: 100%")) highlight(context, slot, HIGHLIGHT_GREEN2); + else if (s.contains("Total Progress: ")) highlight(context, slot, HIGHLIGHT_RED2); + } + } + private static void highlight(DrawContext context, Slot slot, int color) { context.fill(slot.x, slot.y, slot.x + 16, slot.y + 16, color); } @@ -126,6 +136,9 @@ public static class Config { @SerialEntry public boolean widgetHighlight = true; + @SerialEntry + public boolean sblevelHighlight = true; + public static OptionGroup getGroup(ConfigImpl defaults, ConfigImpl config) { var enabled = Option.createBuilder() .name(Text.literal("Hub Selector Highlights")) @@ -168,6 +181,16 @@ public static OptionGroup getGroup(ConfigImpl defaults, ConfigImpl config) { value -> config.hubSelectorHighlight.widgetHighlight = (Boolean) value ) .build(); + var sblevelHighlight = Option.createBuilder() + .name(Text.literal("Task Highlights")) + .description(OptionDescription.of(Text.literal("Whether or not to highlight items in the /sblevel menu based on their completion status"))) + .controller(SkyblockTweaksConfig::generateBooleanController) + .binding( + defaults.hubSelectorHighlight.sblevelHighlight, + () -> config.hubSelectorHighlight.sblevelHighlight, + value -> config.hubSelectorHighlight.sblevelHighlight = (Boolean) value + ) + .build(); return OptionGroup.createBuilder() .name(Text.literal("Menu Highlights")) @@ -176,6 +199,7 @@ public static OptionGroup getGroup(ConfigImpl defaults, ConfigImpl config) { .option(enabledDungeon) .option(hotmHighlight) .option(widgetHighlight) + .option(sblevelHighlight) .build(); } } diff --git a/src/main/java/wtf/cheeze/sbt/mixin/HandledScreenMixin.java b/src/main/java/wtf/cheeze/sbt/mixin/HandledScreenMixin.java index a2010de..3e9346b 100644 --- a/src/main/java/wtf/cheeze/sbt/mixin/HandledScreenMixin.java +++ b/src/main/java/wtf/cheeze/sbt/mixin/HandledScreenMixin.java @@ -56,11 +56,12 @@ public abstract class HandledScreenMixin extends Screen // We do this so it only attempts to handle Skyblock brewing stands, not vanilla ones if (this.handler instanceof BrewingStandScreenHandler) return; if (slot.id == 13) BrewingStandOverlay.render(handler.slots, context); - } } if (title.contains("Widget") || title.contains("Setting")) { MenuHighlights.tryDrawHighlightWidget(context, slot); + } else if (title.startsWith("Tasks")) { + MenuHighlights.tryDrawHighlightTasks(context, slot); } }