aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/features/impl
diff options
context:
space:
mode:
authorsyeyoung <cyoung06@naver.com>2021-10-02 15:30:51 +0900
committersyeyoung <cyoung06@naver.com>2021-10-02 15:33:33 +0900
commitf818e42c6c21ed6b2d7993dca87e6cd52f3d5251 (patch)
tree250f7979a82e146b61bcbcc2f4d9fd6b57bee911 /src/main/java/kr/syeyoung/dungeonsguide/features/impl
parent07f74480447495e6cd42237e4740fb082cb4b821 (diff)
downloadSkyblock-Dungeons-Guide-f818e42c6c21ed6b2d7993dca87e6cd52f3d5251.tar.gz
Skyblock-Dungeons-Guide-f818e42c6c21ed6b2d7993dca87e6cd52f3d5251.tar.bz2
Skyblock-Dungeons-Guide-f818e42c6c21ed6b2d7993dca87e6cd52f3d5251.zip
Line Properties for each pathfind context
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/impl')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureActions.java2
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureFreezePathfind.java2
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeaturePathfindToAll.java45
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/PathfindLineProperties.java108
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java14
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/PanelMechanicBrowser.java3
6 files changed, 158 insertions, 16 deletions
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 0ae1e668..0b9744ea 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,7 @@ import java.util.List;
public class FeatureActions extends TextHUDFeature {
public FeatureActions() {
- super("Dungeon Secret.Pathfind Display", "Action Viewer", "View List of actions that needs to be taken", "secret.actionview", false, 200, getFontRenderer().FONT_HEIGHT * 10);
+ super("Dungeon Secrets", "Action Viewer", "View List of actions that needs to be taken", "secret.actionview", false, 200, getFontRenderer().FONT_HEIGHT * 10);
getStyles().add(new TextStyle("pathfinding", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false));
getStyles().add(new TextStyle("mechanic", new AColor(0x55, 0xFF,0x55,255), new AColor(0, 0,0,0), false));
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureFreezePathfind.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureFreezePathfind.java
index 67f0be5f..a8102ad2 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureFreezePathfind.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureFreezePathfind.java
@@ -24,7 +24,7 @@ import kr.syeyoung.dungeonsguide.features.SimpleFeature;
public class FeatureFreezePathfind extends SimpleFeature {
public FeatureFreezePathfind() {
- super("Dungeon Secret.Pathfind Display", "Freeze Pathfind", "Freeze Pathfind, meaning the pathfind lines won't change when you move", "secret.freezepathfind", false);
+ super("Dungeon Secrets.Keybinds", "Global Freeze Pathfind", "Freeze Pathfind, meaning the pathfind lines won't change when you move. Can be toggled with key set in Minecraft Key Settings", "secret.freezepathfind", false);
}
SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus();
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeaturePathfindToAll.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeaturePathfindToAll.java
new file mode 100644
index 00000000..886eefef
--- /dev/null
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeaturePathfindToAll.java
@@ -0,0 +1,45 @@
+/*
+ * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod
+ * Copyright (C) 2021 cyoung06
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+package kr.syeyoung.dungeonsguide.features.impl.secret;
+
+import kr.syeyoung.dungeonsguide.features.FeatureParameter;
+import kr.syeyoung.dungeonsguide.features.SimpleFeature;
+
+public class FeaturePathfindToAll extends SimpleFeature {
+ public FeaturePathfindToAll(){
+ super("Dungeon Secrets.Pathfind To All", "Start pathfind to all secrets upon entering a room", "Auto browse to all secrets in the room", "secret.secretpathfind.allbrowse", false);
+ this.parameters.put("bat", new FeatureParameter<Boolean>("bat", "Trigger pathfind to Bat", "This feature will trigger pathfind to all bats in this room when entering a room", true, "boolean"));
+ this.parameters.put("chest", new FeatureParameter<Boolean>("chest", "Trigger pathfind to Chest", "This feature will trigger pathfind to all chests in this room when entering a room", true, "boolean"));
+ this.parameters.put("essence", new FeatureParameter<Boolean>("essence", "Trigger pathfind to Essence", "This feature will trigger pathfind to all essences in this room when entering a room", true, "boolean"));
+ this.parameters.put("itemdrop", new FeatureParameter<Boolean>("itemdrop", "Trigger pathfind to Itemdrop", "This feature will trigger pathfind to all itemdrops in this room when entering a room", true, "boolean"));
+ }
+
+ public boolean isBat() {
+ return this.<Boolean>getParameter("bat").getValue();
+ }
+ public boolean isChest() {
+ return this.<Boolean>getParameter("chest").getValue();
+ }
+ public boolean isEssence() {
+ return this.<Boolean>getParameter("essence").getValue();
+ }
+ public boolean isItemdrop() {
+ return this.<Boolean>getParameter("itemdrop").getValue();
+ }
+}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/PathfindLineProperties.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/PathfindLineProperties.java
new file mode 100644
index 00000000..e389cbd7
--- /dev/null
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/PathfindLineProperties.java
@@ -0,0 +1,108 @@
+/*
+ * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod
+ * Copyright (C) 2021 cyoung06
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+package kr.syeyoung.dungeonsguide.features.impl.secret;
+
+import com.google.common.base.Supplier;
+import kr.syeyoung.dungeonsguide.config.guiconfig.ConfigPanelCreator;
+import kr.syeyoung.dungeonsguide.config.guiconfig.MFeatureEdit;
+import kr.syeyoung.dungeonsguide.config.guiconfig.MParameterEdit;
+import kr.syeyoung.dungeonsguide.config.guiconfig.RootConfigPanel;
+import kr.syeyoung.dungeonsguide.config.types.AColor;
+import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute;
+import kr.syeyoung.dungeonsguide.features.AbstractFeature;
+import kr.syeyoung.dungeonsguide.features.FeatureParameter;
+import kr.syeyoung.dungeonsguide.features.FeatureRegistry;
+import kr.syeyoung.dungeonsguide.features.SimpleFeature;
+import kr.syeyoung.dungeonsguide.gui.MPanel;
+
+import java.util.LinkedHashMap;
+
+public class PathfindLineProperties extends SimpleFeature {
+ public PathfindLineProperties(String category, String name, String description, String key, boolean useGlobal) {
+ super(category, name, description, key);
+ this.parameters = new LinkedHashMap<>();
+ if (!key.equals("secret.lineproperties.global"))
+ this.parameters.put("useGlobal", new FeatureParameter<Boolean>("useGlobal", "Use Global Settings instead of this", "Completely ignore these settings, then use the global one", useGlobal, "boolean"));
+ this.parameters.put("pathfind", new FeatureParameter<Boolean>("pathfind", "Enable Pathfinding", "Enable pathfind for secrets", useGlobal, "boolean"));
+ this.parameters.put("lineColor", new FeatureParameter<AColor>("lineColor", "Line Color", "Color of the pathfind line", new AColor(0xFFFF0000, true), "acolor"));
+ this.parameters.put("lineWidth", new FeatureParameter<Float>("lineWidth", "Line Thickness", "Thickness of the pathfind line",1.0f, "float"));
+ this.parameters.put("refreshrate", new FeatureParameter<Integer>("refreshrate", "Line Refreshrate", "Ticks to wait per line refresh. Specify it to -1 to don't refresh line at all", 10, "integer"));
+ this.parameters.put("beacon", new FeatureParameter<Boolean>("beacon", "Enable Beacons", "Enable beacons for pathfind line targets", true, "boolean"));
+ this.parameters.put("beamColor", new FeatureParameter<AColor>("beamColor", "Beam Color", "Color of the beacon beam", new AColor(0x77FF0000, true), "acolor"));
+ this.parameters.put("targetColor", new FeatureParameter<AColor>("targetColor", "Target Color", "Color of the target", new AColor(0x33FF0000, true), "acolor"));
+ }
+
+
+ public String getEditRoute(RootConfigPanel rootConfigPanel) {
+ ConfigPanelCreator.map.put("base." + getKey() , new Supplier<MPanel>() {
+ @Override
+ public MPanel get() {
+ MFeatureEdit featureEdit = new MFeatureEdit(PathfindLineProperties.this, rootConfigPanel);
+ for (FeatureParameter parameter: getParameters()) {
+ featureEdit.addParameterEdit(parameter.getKey(), new MParameterEdit(PathfindLineProperties.this, parameter, rootConfigPanel, a -> !a.getKey().equals("useGlobal") && isGlobal()));
+ }
+ return featureEdit;
+ }
+ });
+ return "base." + getKey() ;
+ }
+
+ @Override
+ public boolean isDisyllable() {
+ return false;
+ }
+
+ public boolean isGlobal() {
+ if (getKey().equals("secret.lineproperties.global")) return false;
+ return this.<Boolean>getParameter("useGlobal").getValue();
+ }
+
+ public boolean isPathfind() {
+ return isGlobal() ? FeatureRegistry.SECRET_LINE_PROPERTIES_GLOBAL.isPathfind() : this.<Boolean>getParameter("pathfind").getValue();
+ }
+ public AColor getLineColor() {
+ return isGlobal() ? FeatureRegistry.SECRET_LINE_PROPERTIES_GLOBAL.getLineColor() : this.<AColor>getParameter("lineColor").getValue();
+ }
+ public float getLineWidth() {
+ return isGlobal() ? FeatureRegistry.SECRET_LINE_PROPERTIES_GLOBAL.getLineWidth() : this.<Float>getParameter("lineWidth").getValue();
+ }
+ public int getRefreshRate() {
+ return isGlobal() ? FeatureRegistry.SECRET_LINE_PROPERTIES_GLOBAL.getRefreshRate() : this.<Integer>getParameter("refreshrate").getValue();
+ }
+ public boolean isBeacon() {
+ return isGlobal() ? FeatureRegistry.SECRET_LINE_PROPERTIES_GLOBAL.isBeacon() : this.<Boolean>getParameter("beacon").getValue();
+ }
+ public AColor getBeamColor() {
+ return isGlobal() ? FeatureRegistry.SECRET_LINE_PROPERTIES_GLOBAL.getBeamColor() : this.<AColor>getParameter("beamColor").getValue();
+ }
+ public AColor getTargetColor() {
+ return isGlobal() ? FeatureRegistry.SECRET_LINE_PROPERTIES_GLOBAL.getTargetColor() : this.<AColor>getParameter("targetColor").getValue();
+ }
+ public ActionRoute.ActionRouteProperties getRouteProperties() {
+ ActionRoute.ActionRouteProperties actionRouteProperties = new ActionRoute.ActionRouteProperties();
+ actionRouteProperties.setPathfind(isPathfind());
+ actionRouteProperties.setLineColor(getLineColor());
+ actionRouteProperties.setLineWidth(getLineWidth());
+ actionRouteProperties.setLineRefreshRate(getRefreshRate());
+ actionRouteProperties.setBeacon(isBeacon());
+ actionRouteProperties.setBeaconBeamColor(getBeamColor());
+ actionRouteProperties.setBeaconColor(getTargetColor());
+ return actionRouteProperties;
+ }
+}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java
index 21898427..6a00b72b 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java
@@ -65,25 +65,13 @@ import java.util.List;
public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderListener, GuiClickListener, WorldRenderListener {
public FeatureMechanicBrowse() {
- super("Dungeon Secret.Secret Pathfind","Secret Browser", "Browse and Pathfind secrets and mechanics in the current room", "secret.mechanicbrowse", false, 100, 300);
- parameters.put("linecolor2", new FeatureParameter<AColor>("linecolor2", "Color", "Color of Pathfind line", new AColor(0xFF00FF00, true), "acolor"));
- parameters.put("linethickness", new FeatureParameter<Float>("linethickness", "Thickness", "Thickness of Pathfind line", 1.0f, "float"));
- parameters.put("refreshrate", new FeatureParameter<Integer>("refreshrate", "Line Refreshrate", "How many ticks per line refresh?", 10, "integer"));
+ super("Dungeon Secrets.Secret Browser","Secret Browser", "Browse and Pathfind secrets and mechanics in the current room", "secret.mechanicbrowse", false, 100, 300);
parameters.put("scale", new FeatureParameter<Float>("scale", "Scale", "Scale", 1.0f, "float"));
mGuiMechanicBrowser = new MGuiMechanicBrowser(this);
mGuiMechanicBrowser.setWorldAndResolution(Minecraft.getMinecraft(), Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);
lastWidth = Minecraft.getMinecraft().displayWidth; lastHeight = Minecraft.getMinecraft().displayHeight;
}
- public AColor getColor() {
- return this.<AColor>getParameter("linecolor2").getValue();
- }
- public float getThickness() {
- return this.<Float>getParameter("linethickness").getValue();
- }
- public int getRefreshRate() {
- return this.<Integer>getParameter("refreshrate").getValue();
- }
public double getScale() {
return this.<Float>getParameter("scale").getValue();
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/PanelMechanicBrowser.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/PanelMechanicBrowser.java
index 5a558a1e..caf7bf8e 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/PanelMechanicBrowser.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/mechanicbrowser/PanelMechanicBrowser.java
@@ -23,6 +23,7 @@ import kr.syeyoung.dungeonsguide.dungeon.DungeonContext;
import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute;
import kr.syeyoung.dungeonsguide.dungeon.mechanics.*;
import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
+import kr.syeyoung.dungeonsguide.features.FeatureRegistry;
import kr.syeyoung.dungeonsguide.gui.MPanel;
import kr.syeyoung.dungeonsguide.gui.elements.MList;
import kr.syeyoung.dungeonsguide.gui.elements.MPanelScaledGUI;
@@ -256,7 +257,7 @@ public class PanelMechanicBrowser extends MPanelScaledGUI {
for (String state : states) {
mechanicBrowserTooltip.getMList().add(new MechanicBrowserElement(() -> state, false, (m2, pt2) -> {
if (dungeonRoom.getRoomProcessor() instanceof GeneralRoomProcessor)
- ((GeneralRoomProcessor)dungeonRoom.getRoomProcessor()).pathfind("MECH-BROWSER", id, state);
+ ((GeneralRoomProcessor)dungeonRoom.getRoomProcessor()).pathfind("MECH-BROWSER", id, state, FeatureRegistry.SECRET_LINE_PROPERTIES_SECRET_BROWSER.getRouteProperties());
mechanicBrowserTooltip.close();
mechanicBrowserTooltip = null;
}));