diff options
author | syeyoung <cyong06@naver.com> | 2021-02-22 14:12:05 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-02-22 14:12:05 +0900 |
commit | 32317d3372448fd9c719cb96ba60c0b9dde1303c (patch) | |
tree | 9c93cd14e4dc211a2d296eea108d302018334e0b | |
parent | 4d0beb048ef798656cf4db5b340daae4a3ddd8de (diff) | |
download | Skyblock-Dungeons-Guide-32317d3372448fd9c719cb96ba60c0b9dde1303c.tar.gz Skyblock-Dungeons-Guide-32317d3372448fd9c719cb96ba60c0b9dde1303c.tar.bz2 Skyblock-Dungeons-Guide-32317d3372448fd9c719cb96ba60c0b9dde1303c.zip |
AY
4 files changed, 96 insertions, 2 deletions
diff --git a/options.txt b/options.txt index e988f91f..6bf51f5b 100755 --- a/options.txt +++ b/options.txt @@ -24,7 +24,7 @@ chatLinks:true chatLinksPrompt:true chatOpacity:1.0 snooperEnabled:true -fullscreen:false +fullscreen:true enableVsync:true useVbo:true hideServerAddress:false @@ -93,6 +93,7 @@ key_key.hotbar.9:10 key_start editing session:19 key_send and save bombdefuse solution:33 key_navigate to next secret. (Req option enabled at /dg):34 +key_toggle Pathfind. (Req option enabled at /dg):47 soundCategory_master:0.07284768 soundCategory_music:0.0 soundCategory_record:1.0 diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java index b3c22c2b..9e630601 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java @@ -84,6 +84,7 @@ public class FeatureRegistry { public static final FeatureDungeonRealTime DUNGEON_REALTIME = register(new FeatureDungeonRealTime()); public static final FeatureDungeonSBTime DUNGEON_SBTIME = register(new FeatureDungeonSBTime()); public static final FeatureDungeonSecrets DUNGEON_SECRETS = register(new FeatureDungeonSecrets()); + public static final FeatureDungeonCurrentRoomSecrets DUNGEON_SECRETS_ROOM = register(new FeatureDungeonCurrentRoomSecrets()); public static final FeatureDungeonTombs DUNGEON_TOMBS = register(new FeatureDungeonTombs()); public static final FeatureDungeonScore DUNGEON_SCORE = register(new FeatureDungeonScore()); public static final FeatureWarnLowHealth DUNGEON_LOWHEALTH_WARN = register(new FeatureWarnLowHealth()); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java new file mode 100644 index 00000000..6b65246f --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java @@ -0,0 +1,92 @@ +package kr.syeyoung.dungeonsguide.features.impl.dungeon; + +import kr.syeyoung.dungeonsguide.SkyblockStatus; +import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.e; +import kr.syeyoung.dungeonsguide.features.listener.ChatListener; +import kr.syeyoung.dungeonsguide.features.text.StyledText; +import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.utils.TextUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.util.BlockPos; +import net.minecraftforge.client.event.ClientChatReceivedEvent; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class FeatureDungeonCurrentRoomSecrets extends TextHUDFeature implements ChatListener { + public FeatureDungeonCurrentRoomSecrets() { + super("Dungeon", "Display #Secrets in current room", "Display what your actionbar says", "dungeon.stats.secretsroom", true, getFontRenderer().getStringWidth("Secrets: 8/8"), getFontRenderer().FONT_HEIGHT); + this.setEnabled(false); + } + + SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus(); + + + private static final List<StyledText> dummyText= new ArrayList<StyledText>(); + static { + dummyText.add(new StyledText("Secrets","title")); + dummyText.add(new StyledText(": ","separator")); + dummyText.add(new StyledText("5","currentSecrets")); + dummyText.add(new StyledText("/","separator2")); + dummyText.add(new StyledText("8","totalSecrets")); + } + + @Override + public boolean isHUDViewable() { + return skyblockStatus.isOnDungeon(); + } + + @Override + public List<String> getUsedTextStyle() { + return Arrays.asList(new String[] { + "title", "separator", "currentSecrets", "separator2", "totalSecrets" + }); + } + + @Override + public List<StyledText> getDummyText() { + return dummyText; + } + + private int latestCurrSecrets = 0; + private int latestTotalSecrets = 0; + + + @Override + public List<StyledText> getText() { + List<StyledText> actualBit = new ArrayList<StyledText>(); + actualBit.add(new StyledText("Secrets","title")); + actualBit.add(new StyledText(": ","separator")); + actualBit.add(new StyledText(latestCurrSecrets +"","currentSecrets")); + actualBit.add(new StyledText("/","separator2")); + actualBit.add(new StyledText(latestTotalSecrets +"","totalSecrets")); + return actualBit; + } + + @Override + public void onChat(ClientChatReceivedEvent chat) { + if (chat.type != 2) return; + String text = chat.message.getFormattedText(); + if (!text.contains("/")) return; + + int secretsIndex = text.indexOf("Secrets"); + if (secretsIndex != -1) { + int theindex = 0; + for (int i = secretsIndex; i >= 0; i--) { + if (text.startsWith("ยง7", i)) { + theindex = i; + } + } + String it = text.substring(theindex + 2, secretsIndex - 1); + + latestCurrSecrets = Integer.parseInt(it.split("/")[0]); + latestTotalSecrets = Integer.parseInt(it.split("/")[1]); + } + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java index 443e5d79..68e68053 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java @@ -29,7 +29,7 @@ import java.util.regex.Pattern; public class FeatureDungeonSecrets extends TextHUDFeature { public FeatureDungeonSecrets() { - super("Dungeon", "Display #Secrets", "Display how much total secrets have been found in a dungeon run.\n+ sign means DG does not know the correct number, but it's somewhere above that number.", "dungeon.stats.secrets", true, getFontRenderer().getStringWidth("Secrets: 999/999+"), getFontRenderer().FONT_HEIGHT); + super("Dungeon", "Display #Secrets in total", "Display how much total secrets have been found in a dungeon run.\n+ sign means DG does not know the correct number, but it's somewhere above that number.", "dungeon.stats.secrets", true, getFontRenderer().getStringWidth("Secrets: 999/999+"), getFontRenderer().FONT_HEIGHT); this.setEnabled(false); } |