diff options
author | Linnea Gräf <nea@nea.moe> | 2024-04-27 10:15:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-27 10:15:43 +0200 |
commit | cde33a4c83a2f2d781ff8bb740b7166691c04600 (patch) | |
tree | 936882c427187a469d63b4f5142549054314f432 /src/main/java | |
parent | 18ea34b92d6106afda3b662256a2dc36dd4d8ec0 (diff) | |
download | NotEnoughUpdates-cde33a4c83a2f2d781ff8bb740b7166691c04600.tar.gz NotEnoughUpdates-cde33a4c83a2f2d781ff8bb740b7166691c04600.tar.bz2 NotEnoughUpdates-cde33a4c83a2f2d781ff8bb740b7166691c04600.zip |
Add hotm upgrade TODOs/warning (#1090)
Diffstat (limited to 'src/main/java')
5 files changed, 46 insertions, 8 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java index 3fa0908b..cbc14b79 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java @@ -31,6 +31,7 @@ import io.github.moulberry.notenoughupdates.core.config.GuiPositionEditor; import io.github.moulberry.notenoughupdates.core.config.Position; import io.github.moulberry.notenoughupdates.dungeons.GuiDungeonMapEditor; import io.github.moulberry.notenoughupdates.miscfeatures.FairySouls; +import io.github.moulberry.notenoughupdates.miscfeatures.HotmDesires; import io.github.moulberry.notenoughupdates.miscfeatures.IQTest; import io.github.moulberry.notenoughupdates.miscgui.GuiEnchantColour; import io.github.moulberry.notenoughupdates.miscgui.GuiInvButtonEditor; @@ -82,6 +83,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.ClientCommandHandler; +import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.Arrays; @@ -596,7 +598,7 @@ public class NEUConfig extends Config { }}; } - public HiddenProfileSpecific getProfileSpecific() { + public @Nullable HiddenProfileSpecific getProfileSpecific() { if (SBInfo.getInstance().currentProfile == null) { return null; } @@ -628,6 +630,9 @@ public class NEUConfig extends Config { public List<MiningOverlay.ForgeItem> forgeItems = new ArrayList<>(); @Expose + public Map<String, HotmDesires.Desire> hotmDesires = new HashMap<>(); + + @Expose public int commissionMilestone = 0; @Expose diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Mining.java b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Mining.java index 2228aa64..4b44d195 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Mining.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Mining.java @@ -947,4 +947,13 @@ public class Mining { ) @ConfigEditorBoolean public boolean mineshaftExitWaypoint = true; + + @Expose + @ConfigOption( + name = "Powder TODOs", + desc = "Click on a perk in your /hotm tree when you can't afford it to get a notification when you can." + ) + @ConfigEditorBoolean + public boolean powderTodo = true; + } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java index ad5100e3..f015a129 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java @@ -26,6 +26,7 @@ import io.github.moulberry.notenoughupdates.core.util.StringUtils; import io.github.moulberry.notenoughupdates.core.util.lerp.LerpUtils; import io.github.moulberry.notenoughupdates.guifeatures.SkyMallDisplay; import io.github.moulberry.notenoughupdates.miscfeatures.GlaciteTunnelWaypoints; +import io.github.moulberry.notenoughupdates.miscfeatures.HotmDesires; import io.github.moulberry.notenoughupdates.miscfeatures.ItemCooldowns; import io.github.moulberry.notenoughupdates.miscfeatures.tablisttutorial.TablistAPI; import io.github.moulberry.notenoughupdates.options.NEUConfig; @@ -267,7 +268,8 @@ public class MiningOverlay extends TextTabOverlay { NotEnoughUpdates.INSTANCE.config.mining.emissaryWaypoints == 0 && !NotEnoughUpdates.INSTANCE.config.mining.titaniumAlert && NotEnoughUpdates.INSTANCE.config.mining.locWaypoints == 0 - && NotEnoughUpdates.INSTANCE.config.mining.tunnelWaypoints != Mining.GlaciteTunnelWaypointBehaviour.NONE) { + && NotEnoughUpdates.INSTANCE.config.mining.tunnelWaypoints != Mining.GlaciteTunnelWaypointBehaviour.NONE + && HotmDesires.wantsPowderInfo()) { return; } @@ -290,13 +292,16 @@ public class MiningOverlay extends TextTabOverlay { for (String line : powderLines) { if (line.contains("Mithril:")) { - mithrilPowder = DARK_AQUA + Utils.trimWhitespaceAndFormatCodes(line).replaceAll("\u00a7[f|F|r]", ""); + mithrilPowder = DARK_AQUA + Utils.trimWhitespaceAndFormatCodes(line).replaceAll("\u00a7[f|F|r]", "") + + HotmDesires.appendDesireForType("Mithril"); } if (line.contains("Gemstone:")) { - gemstonePowder = DARK_AQUA + Utils.trimWhitespaceAndFormatCodes(line).replaceAll("\u00a7[f|F|r]", ""); + gemstonePowder = DARK_AQUA + Utils.trimWhitespaceAndFormatCodes(line).replaceAll("\u00a7[f|F|r]", "") + + HotmDesires.appendDesireForType("Gemstone"); } if (line.contains("Glacite: ")) { - glacitePowder = DARK_AQUA + Utils.trimWhitespaceAndFormatCodes(line).replaceAll("\u00a7[f|F|r]", ""); + glacitePowder = DARK_AQUA + Utils.trimWhitespaceAndFormatCodes(line).replaceAll("\u00a7[f|F|r]", "") + + HotmDesires.appendDesireForType("Glacite"); } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/TabListUtils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/TabListUtils.java index f36db034..f7357343 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/TabListUtils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/TabListUtils.java @@ -72,6 +72,7 @@ public class TabListUtils { new TabListChangeEvent(tabList, tabListLastTick).post(); } + @Deprecated public static List<String> getTabList() { return tabList; } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java index fee8c594..f13462bc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java @@ -67,6 +67,7 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraftforge.fml.common.Loader; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.lwjgl.BufferUtils; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; @@ -1241,7 +1242,7 @@ public class Utils { var width = fr.getStringWidth(str); float scale = ((float) availableSpace) / width; GlStateManager.scale(scale, scale, 1f); - fr.drawString(str, -width / 2F, 0, colour, shadow); + fr.drawString(str, -width / 2F, 0, colour, shadow); GlStateManager.popMatrix(); } @@ -2342,10 +2343,27 @@ public class Utils { return username; } - public static void addChatMessage(String message) { + public static void addChatMessage(@NotNull String message) { + addChatMessage(new ChatComponentText(message)); + } + + public static void addClickableChatMessage( + @NotNull String message, + @NotNull String command, + @Nullable String hoverText + ) { + if (hoverText == null) + hoverText = "§eClick to run §a" + command; + addChatMessage(new ChatComponentText(message) + .setChatStyle(new ChatStyle() + .setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, command)) + .setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(hoverText))))); + } + + public static void addChatMessage(@NotNull IChatComponent message) { EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; if (thePlayer != null) { - thePlayer.addChatMessage(new ChatComponentText(message)); + thePlayer.addChatMessage(message); } else { System.out.println(message); } |