diff options
author | syeyoung <cyong06@naver.com> | 2021-02-12 15:14:12 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-02-12 15:14:12 +0900 |
commit | b808e27a2cc2c6c8fdf93e5de6ddf05053c3addb (patch) | |
tree | 1336677c7e35bf63ba1b6ebeb1eafa8b7aadda37 /src/main/java/kr/syeyoung/dungeonsguide/features/impl | |
parent | 92c8d9cec9fcc3a53ad95ff0212d77bf87becab7 (diff) | |
download | Skyblock-Dungeons-Guide-b808e27a2cc2c6c8fdf93e5de6ddf05053c3addb.tar.gz Skyblock-Dungeons-Guide-b808e27a2cc2c6c8fdf93e5de6ddf05053c3addb.tar.bz2 Skyblock-Dungeons-Guide-b808e27a2cc2c6c8fdf93e5de6ddf05053c3addb.zip |
works pretty great
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/impl')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureCurrentPhase.java | 55 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureActions.java | 14 |
2 files changed, 64 insertions, 5 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureCurrentPhase.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureCurrentPhase.java new file mode 100644 index 00000000..f38e02ed --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureCurrentPhase.java @@ -0,0 +1,55 @@ +package kr.syeyoung.dungeonsguide.features.impl.boss; + +import kr.syeyoung.dungeonsguide.SkyblockStatus; +import kr.syeyoung.dungeonsguide.e; +import kr.syeyoung.dungeonsguide.features.text.StyledText; +import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.BossfightProcessor; +import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.BossfightProcessorThorn; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class FeatureCurrentPhase extends TextHUDFeature { + public FeatureCurrentPhase() { + super("Bossfight", "Display Current Phase", "Displays the current phase of bossfight", "bossfight.phasedisplay", false, getFontRenderer().getStringWidth("Current Phase: fight-2-idk-howlng"), getFontRenderer().FONT_HEIGHT); + this.setEnabled(true); + } + + SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus(); + + private static final List<StyledText> dummyText= new ArrayList<StyledText>(); + static { + dummyText.add(new StyledText("Current Phase","title")); + dummyText.add(new StyledText(": ","separator")); + dummyText.add(new StyledText("fight-2","phase")); + } + @Override + public boolean isHUDViewable() { + return skyblockStatus.isOnDungeon() && skyblockStatus.getContext() != null && skyblockStatus.getContext().getBossfightProcessor() != null; + } + + @Override + public List<String> getUsedTextStyle() { + return Arrays.asList(new String[] { + "title", "separator", "phase" + }); + } + + @Override + public List<StyledText> getDummyText() { + return dummyText; + } + + @Override + public List<StyledText> getText() { + String currentPhsae =skyblockStatus.getContext().getBossfightProcessor().getCurrentPhase(); + List<StyledText> actualBit = new ArrayList<StyledText>(); + actualBit.add(new StyledText("Current Phase","title")); + actualBit.add(new StyledText(": ","separator")); + actualBit.add(new StyledText(currentPhsae,"phase")); + return actualBit; + } + +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureActions.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureActions.java index 888f4d8c..297ec27d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureActions.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureActions.java @@ -39,7 +39,6 @@ public class FeatureActions extends TextHUDFeature { @Override public boolean isHUDViewable() { - if (Minecraft.getMinecraft().currentScreen != null) return false; if (!skyblockStatus.isOnDungeon()) return false; if (skyblockStatus.getContext() == null || !skyblockStatus.getContext().getMapProcessor().isInitialized()) return false; DungeonContext context = skyblockStatus.getContext(); @@ -105,17 +104,22 @@ public class FeatureActions extends TextHUDFeature { actualBit.add(new StyledText("-> ","separator")); actualBit.add(new StyledText(path.getState()+"\n","state")); - for (int i = 0; i < path.getActions().size(); i++) { + for (int i = Math.max(0,path.getCurrent()-2); i < path.getActions().size(); i++) { actualBit.add(new StyledText((i == path.getCurrent() ? ">" : " ") +" ","current")); actualBit.add(new StyledText(i+"","number")); actualBit.add(new StyledText(". ","dot")); Action action = path.getActions().get(i); - String[] str = action.toString().split(" "); + String[] str = action.toString().split("\n"); actualBit.add(new StyledText(str[0] + " ","action")); + actualBit.add(new StyledText("(","afterline")); for (int i1 = 1; i1 < str.length; i1++) { - actualBit.add(new StyledText(str[i1]+" ","afterline")); + String base = str[i1].trim(); + if (base.startsWith("-")) + base = base.substring(1); + base = base.trim(); + actualBit.add(new StyledText(base+" ","afterline")); } - actualBit.add(new StyledText("\n","afterline")); + actualBit.add(new StyledText(")\n","afterline")); } } return actualBit; |