diff options
19 files changed, 439 insertions, 43 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/types/AColor.java b/src/main/java/kr/syeyoung/dungeonsguide/config/types/AColor.java index ebde1ce3..c9f464df 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/types/AColor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/types/AColor.java @@ -37,6 +37,19 @@ public class AColor extends Color { super(rgba, hasalpha); } + public AColor(AColor clone) { + super(clone.getRGB(), true); + chroma = clone.isChroma(); + chromaSpeed = clone.getChromaSpeed(); + } + + public AColor multiplyAlpha(double multiplier) { + AColor aColor = new AColor(getRed(), getGreen(), getBlue(), (int) (getAlpha() * multiplier)); + aColor.chroma = this.chroma; + aColor.chromaSpeed = this.chromaSpeed; + return aColor; + } + @Override public String toString() { return "AColor{" + diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java index 64254a0a..f447c1eb 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java @@ -18,13 +18,6 @@ package kr.syeyoung.dungeonsguide.features; -import com.google.common.base.Supplier; -import kr.syeyoung.dungeonsguide.Keybinds; -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.features.impl.advanced.FeatureDebug; import kr.syeyoung.dungeonsguide.features.impl.advanced.FeatureDebuggableMap; import kr.syeyoung.dungeonsguide.features.impl.advanced.FeatureRoomCoordDisplay; @@ -44,9 +37,7 @@ import kr.syeyoung.dungeonsguide.features.impl.party.customgui.FeatureCustomPart import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.FeatureViewPlayerOnJoin; import kr.syeyoung.dungeonsguide.features.impl.secret.*; import kr.syeyoung.dungeonsguide.features.impl.secret.mechanicbrowser.FeatureMechanicBrowse; -import kr.syeyoung.dungeonsguide.features.impl.solvers.FeatureSolverBlaze; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MKeyEditButton; +import kr.syeyoung.dungeonsguide.features.impl.solvers.*; import lombok.Getter; import org.lwjgl.input.Keyboard; @@ -136,22 +127,17 @@ public class FeatureRegistry { public static final SimpleFeature DISCORD_DONOTUSE = register(new SimpleFeature("Discord", "Disable Native Library", "Disables usage of jna for discord rpc support.\nBreaks any discord related feature in the mod.\nRequires mod restart to get affected.\n\nThis feature is only for those whose minecraft crashes due to discord gamesdk crash.", "discord.rpc", false)); - public static final SimpleFeature SOLVER_RIDDLE = register(new SimpleFeature("Solver.Any Floor", "Riddle", "Highlights the correct box after clicking on all 3 weirdos", "solver.riddle")); - public static final SimpleFeature SOLVER_TICTACTOE = register(new SimpleFeature("Solver.Any Floor", "Tictactoe", "Shows the best move that could be taken by player in the tictactoe room", "solver.tictactoe")); + public static final FeatureSolverRiddle SOLVER_RIDDLE = register(new FeatureSolverRiddle()); + public static final FeatureSolverTictactoe SOLVER_TICTACTOE = register(new FeatureSolverTictactoe()); public static final SimpleFeature SOLVER_WATERPUZZLE = register(new SimpleFeature("Solver.Any Floor", "Waterboard (Advanced)", "Calculates solution for waterboard puzzle and displays it to user", "solver.waterboard")); public static final SimpleFeature SOLVER_CREEPER = register(new SimpleFeature("Solver.Any Floor", "Creeper", "Draws line between prismarine lamps in creeper room", "solver.creeper")); - public static final SimpleFeature SOLVER_TELEPORT = register(new SimpleFeature("Solver.Any Floor", "Teleport", "Shows teleport pads you've visited in a teleport maze room", "solver.teleport")); + public static final FeatureSolverTeleport SOLVER_TELEPORT = register(new FeatureSolverTeleport()); public static final FeatureSolverBlaze SOLVER_BLAZE = register(new FeatureSolverBlaze()); - public static final SimpleFeature SOLVER_ICEPATH = register(new SimpleFeature("Solver.Floor 3+", "Icepath (Advanced)", "Calculates solution for icepath puzzle and displays it to user", "solver.icepath")); - public static final SimpleFeature SOLVER_SILVERFISH = register(new SimpleFeature("Solver.Floor 3+", "Silverfish (Advanced)", "Actively calculates solution for silverfish puzzle and displays it to user", "solver.silverfish")); - public static final SimpleFeature SOLVER_BOX = register(new SimpleFeature("Solver.Floor 3+", "Box (Advanced)", "Calculates solution for box puzzle room, and displays it to user", "solver.box")); - public static final SimpleFeature SOLVER_BOX_DISABLE_TEXT = register(new SimpleFeature("Solver.Floor 3+", "Box Puzzle Solver Disable text", "Disable 'Type recalc to recalculate solution' showing up on top left.\nYou can still type recalc to recalc solution after disabling this feature", "solver.boxrecalc", false)); - public static final SimpleFeature SOLVER_KAHOOT = register(new SimpleFeature("Solver.Floor 4+", "Quiz", "Highlights the correct solution for trivia puzzle", "solver.trivia")); - public static final SimpleFeature SOLVER_BOMBDEFUSE = register(new SimpleFeature("Solver.Floor 7+", "Bomb Defuse", "Communicates with others dg using key 'F' for solutions and displays it", "solver.bombdefuse") { - { - parameters.put("key", new FeatureParameter<Integer>("key", "Key","Press to send solution in chat", Keyboard.KEY_NONE, "keybind")); - } - }); + public static final FeatureSolverIcefill SOLVER_ICEPATH = register(new FeatureSolverIcefill()); + public static final FeatureSolverSilverfish SOLVER_SILVERFISH = register(new FeatureSolverSilverfish()); + public static final FeatureSolverBox SOLVER_BOX = register(new FeatureSolverBox()); + public static final FeatureSolverKahoot SOLVER_KAHOOT = register(new FeatureSolverKahoot()); + public static final FeatureSolverBombdefuse SOLVER_BOMBDEFUSE = register(new FeatureSolverBombdefuse()); public static final FeatureTooltipDungeonStat ETC_DUNGEONSTAT = register(new FeatureTooltipDungeonStat()); public static final FeatureTooltipPrice ETC_PRICE = register(new FeatureTooltipPrice()); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverBombdefuse.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverBombdefuse.java new file mode 100644 index 00000000..e9bf623b --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverBombdefuse.java @@ -0,0 +1,30 @@ +/* + * 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.solvers; + +import kr.syeyoung.dungeonsguide.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.features.SimpleFeature; +import org.lwjgl.input.Keyboard; + +public class FeatureSolverBombdefuse extends SimpleFeature { + public FeatureSolverBombdefuse() { + super("Solver.Floor 7+", "Bomb Defuse", "Communicates with others dg using key 'F' for solutions and displays it", "solver.bombdefuse"); + parameters.put("key", new FeatureParameter<Integer>("key", "Key","Press to send solution in chat", Keyboard.KEY_NONE, "keybind")); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverBox.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverBox.java new file mode 100644 index 00000000..c4dcebf6 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverBox.java @@ -0,0 +1,57 @@ +/* + * 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.solvers; + +import kr.syeyoung.dungeonsguide.config.types.AColor; +import kr.syeyoung.dungeonsguide.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.features.SimpleFeature; + +import java.util.LinkedHashMap; + +public class FeatureSolverBox extends SimpleFeature { + public FeatureSolverBox() { + super("Solver.Floor 3+", "Box (Advanced)", "Calculates solution for box puzzle room, and displays it to user", "solver.box"); + this.parameters = new LinkedHashMap<>(); + this.parameters.put("disableText", new FeatureParameter<Boolean>("disableText", "Box Puzzle Solver Disable text", "Disable 'Type recalc to recalculate solution' showing up on top left.\nYou can still type recalc to recalc solution after disabling this feature", false, "boolean")); + this.parameters.put("lineColor", new FeatureParameter<AColor>("lineColor", "Line Color", "Color of the solution line", new AColor(0xFF00FF00, true), "acolor")); + this.parameters.put("lineWidth", new FeatureParameter<Float>("lineWidth", "Line Thickness", "Thickness of the solution line",1.0f, "float")); + + this.parameters.put("targetColor", new FeatureParameter<AColor>("targetColor", "Target Color", "Color of the target button", new AColor(0x5500FFFF, true), "acolor")); + this.parameters.put("textColor1", new FeatureParameter<AColor>("textColor1", "Text Color", "Color of the text (next step)", new AColor(0xFF00FF00, true), "acolor")); + this.parameters.put("textColor2", new FeatureParameter<AColor>("textColor2", "Text Color", "Color of the text (others)", new AColor(0xFF000000, true), "acolor")); + } + public AColor getLineColor() { + return this.<AColor>getParameter("lineColor").getValue(); + } + public float getLineWidth() { + return this.<Float>getParameter("lineWidth").getValue(); + } + public boolean disableText() { + return this.<Boolean>getParameter("disableText").getValue(); + } + public AColor getTargetColor() { + return this.<AColor>getParameter("targetColor").getValue(); + } + public AColor getTextColor() { + return this.<AColor>getParameter("textColor1").getValue(); + } + public AColor getTextColor2() { + return this.<AColor>getParameter("textColor2").getValue(); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverIcefill.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverIcefill.java new file mode 100644 index 00000000..681e6b12 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverIcefill.java @@ -0,0 +1,40 @@ +/* + * 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.solvers; + +import kr.syeyoung.dungeonsguide.config.types.AColor; +import kr.syeyoung.dungeonsguide.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.features.SimpleFeature; + +import java.util.LinkedHashMap; + +public class FeatureSolverIcefill extends SimpleFeature { + public FeatureSolverIcefill() { + super("Solver.Floor 3+", "Icepath (Advanced)", "Calculates solution for icepath puzzle and displays it to user", "solver.icepath"); + this.parameters = new LinkedHashMap<>(); + this.parameters.put("lineColor", new FeatureParameter<AColor>("lineColor", "Line Color", "Color of the solution line", new AColor(0xFF00FF00, true), "acolor")); + this.parameters.put("lineWidth", new FeatureParameter<Float>("lineWidth", "Line Thickness", "Thickness of the solution line",1.0f, "float")); + } + public AColor getLineColor() { + return this.<AColor>getParameter("lineColor").getValue(); + } + public float getLineWidth() { + return this.<Float>getParameter("lineWidth").getValue(); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverKahoot.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverKahoot.java new file mode 100644 index 00000000..6055c12b --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverKahoot.java @@ -0,0 +1,35 @@ +/* + * 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.solvers; + +import kr.syeyoung.dungeonsguide.config.types.AColor; +import kr.syeyoung.dungeonsguide.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.features.SimpleFeature; + +public class FeatureSolverKahoot extends SimpleFeature { + public FeatureSolverKahoot() { + super("Solver.Floor 4+", "Quiz", "Highlights the correct solution for trivia puzzle", "solver.trivia"); + + this.parameters.put("targetColor", new FeatureParameter<AColor>("targetColor", "Target Color", "Color of the solution box", new AColor(0,255,0,50), "acolor")); + } + + public AColor getTargetColor() { + return this.<AColor>getParameter("targetColor").getValue(); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverRiddle.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverRiddle.java new file mode 100644 index 00000000..23bc5a0c --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverRiddle.java @@ -0,0 +1,35 @@ +/* + * 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.solvers; + +import kr.syeyoung.dungeonsguide.config.types.AColor; +import kr.syeyoung.dungeonsguide.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.features.SimpleFeature; + +public class FeatureSolverRiddle extends SimpleFeature { + public FeatureSolverRiddle() { + super("Solver.Any Floor", "Riddle", "Highlights the correct box after clicking on all 3 weirdos", "solver.riddle"); + + this.parameters.put("targetColor", new FeatureParameter<AColor>("targetColor", "Target Color", "Color of the solution box", new AColor(0,255,0,50), "acolor")); + } + + public AColor getTargetColor() { + return this.<AColor>getParameter("targetColor").getValue(); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverSilverfish.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverSilverfish.java new file mode 100644 index 00000000..31a4d0e6 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverSilverfish.java @@ -0,0 +1,40 @@ +/* + * 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.solvers; + +import kr.syeyoung.dungeonsguide.config.types.AColor; +import kr.syeyoung.dungeonsguide.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.features.SimpleFeature; + +import java.util.LinkedHashMap; + +public class FeatureSolverSilverfish extends SimpleFeature { + public FeatureSolverSilverfish() { + super("Solver.Floor 3+", "Silverfish (Advanced)", "Actively calculates solution for silverfish puzzle and displays it to user", "solver.silverfish"); + this.parameters = new LinkedHashMap<>(); + this.parameters.put("lineColor", new FeatureParameter<AColor>("lineColor", "Line Color", "Color of the solution line", new AColor(0xFF00FF00, true), "acolor")); + this.parameters.put("lineWidth", new FeatureParameter<Float>("lineWidth", "Line Thickness", "Thickness of the solution line",1.0f, "float")); + } + public AColor getLineColor() { + return this.<AColor>getParameter("lineColor").getValue(); + } + public float getLineWidth() { + return this.<Float>getParameter("lineWidth").getValue(); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverTeleport.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverTeleport.java new file mode 100644 index 00000000..c7e42516 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverTeleport.java @@ -0,0 +1,39 @@ +/* + * 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.solvers; + +import kr.syeyoung.dungeonsguide.config.types.AColor; +import kr.syeyoung.dungeonsguide.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.features.SimpleFeature; + +public class FeatureSolverTeleport extends SimpleFeature { + public FeatureSolverTeleport() { + super("Solver.Any Floor", "Teleport", "Shows teleport pads you've visited in a teleport maze room", "solver.teleport"); + + this.parameters.put("targetColor", new FeatureParameter<AColor>("targetColor", "Solution Color", "Color of the solution teleport pad", new AColor(0,255,0,100), "acolor")); + this.parameters.put("targetColor2", new FeatureParameter<AColor>("targetColor2", "Not-Solution Color", "Color of the solution teleport pads you've been to", new AColor(255,0,0,100), "acolor")); + } + + public AColor getTargetColor() { + return this.<AColor>getParameter("targetColor").getValue(); + } + public AColor getTargetColor2() { + return this.<AColor>getParameter("targetColor2").getValue(); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverTictactoe.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverTictactoe.java new file mode 100644 index 00000000..68ca4cb5 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/solvers/FeatureSolverTictactoe.java @@ -0,0 +1,39 @@ +/* + * 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.solvers; + +import kr.syeyoung.dungeonsguide.config.types.AColor; +import kr.syeyoung.dungeonsguide.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.features.SimpleFeature; + +public class FeatureSolverTictactoe extends SimpleFeature { + public FeatureSolverTictactoe() { + super("Solver.Any Floor", "Tictactoe", "Shows the best move that could be taken by player in the tictactoe room", "solver.tictactoe"); + + this.parameters.put("targetColor", new FeatureParameter<AColor>("targetColor", "Target Color", "Color of the solution box during your turn", new AColor(0,255,255,50), "acolor")); + this.parameters.put("targetColor2", new FeatureParameter<AColor>("targetColor", "Target Color", "Color of the solution box during enemy turn", new AColor(255,201,0,50), "acolor")); + } + + public AColor getTargetColor() { + return this.<AColor>getParameter("targetColor").getValue(); + } + public AColor getTargetColor2() { + return this.<AColor>getParameter("targetColor2").getValue(); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBlazeSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBlazeSolver.java index 4c3fff71..32f46b15 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBlazeSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBlazeSolver.java @@ -164,12 +164,12 @@ public class RoomProcessorBlazeSolver extends GeneralRoomProcessor { boolean border = true; + RenderUtils.highlightBox(entity, AxisAlignedBB.fromBounds(-0.8,0, -0.8, 0.8, 2, 0.8), FeatureRegistry.SOLVER_BLAZE.getBlazeColor(), partialTicks, false); if (entity == theoneafterit) { RenderUtils.highlightBox(entity, AxisAlignedBB.fromBounds(-0.8,0, -0.8, 0.8, 2, 0.8), FeatureRegistry.SOLVER_BLAZE.getNextUpBlazeColor(), partialTicks, false); } else if (entity == nextBlaze) RenderUtils.highlightBox(entity, AxisAlignedBB.fromBounds(-0.8,0, -0.8, 0.8, 2, 0.8), FeatureRegistry.SOLVER_BLAZE.getNextBlazeColor(), partialTicks, false); - else - RenderUtils.highlightBox(entity, AxisAlignedBB.fromBounds(-0.8,0, -0.8, 0.8, 2, 0.8), FeatureRegistry.SOLVER_BLAZE.getBlazeColor(), partialTicks, false); + GlStateManager.color(1,1,1,1); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorIcePath.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorIcePath.java index 2236d876..03654a88 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorIcePath.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorIcePath.java @@ -143,7 +143,7 @@ public class RoomProcessorIcePath extends GeneralRoomProcessor { super.drawWorld(partialTicks); if (!FeatureRegistry.SOLVER_SILVERFISH.isEnabled()) return; if (!err) - RenderUtils.drawLines(solution, new AColor(0,255,0, 255),1, partialTicks, false); + RenderUtils.drawLines(solution, FeatureRegistry.SOLVER_SILVERFISH.getLineColor(),FeatureRegistry.SOLVER_SILVERFISH.getLineWidth(), partialTicks, true); } public Point getPointOfSilverFishOnMap(BlockPos blockPos) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRiddle.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRiddle.java index e242c3c3..7994e86b 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRiddle.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRiddle.java @@ -28,6 +28,7 @@ import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IChatComponent; @@ -108,7 +109,7 @@ public class RoomProcessorRiddle extends GeneralRoomProcessor { super.drawWorld(partialTicks); if (!FeatureRegistry.SOLVER_RIDDLE.isEnabled()) return; if (chest != null) { - RenderUtils.highlightBlock(chest, new Color(0,255,0, 50),partialTicks, true); + RenderUtils.highlightBoxAColor(AxisAlignedBB.fromBounds(chest.getX(), chest.getY(), chest.getZ(), chest.getX()+1, chest.getY() + 1, chest.getZ() + 1), FeatureRegistry.SOLVER_RIDDLE.getTargetColor(), partialTicks, true); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTeleportMazeSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTeleportMazeSolver.java index 9afb50c5..a16fc11e 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTeleportMazeSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTeleportMazeSolver.java @@ -26,6 +26,7 @@ import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.Vec3; import net.minecraft.world.World; @@ -127,11 +128,11 @@ public class RoomProcessorTeleportMazeSolver extends GeneralRoomProcessor { super.drawWorld(partialTicks); if (!FeatureRegistry.SOLVER_TELEPORT.isEnabled()) return; for (BlockPos bpos:visitedPortals) { - RenderUtils.highlightBlock(bpos, new Color(255,0,0,100), partialTicks, true); + RenderUtils.highlightBoxAColor( AxisAlignedBB.fromBounds(bpos.getX(), bpos.getY(), bpos.getZ(), bpos.getX()+1, bpos.getY() + 1, bpos.getZ() + 1), FeatureRegistry.SOLVER_TELEPORT.getTargetColor2(), partialTicks, true); } if (intersection != null) { - RenderUtils.highlightBlock(intersection, new Color(0, 255, 0, 100), partialTicks, false); + RenderUtils.highlightBoxAColor( AxisAlignedBB.fromBounds(intersection.getX(), intersection.getY(), intersection.getZ(), intersection.getX()+1, intersection.getY() + 1, intersection.getZ() + 1), FeatureRegistry.SOLVER_TELEPORT.getTargetColor(), partialTicks, false); } } public static class Generator implements RoomProcessorGenerator<RoomProcessorTeleportMazeSolver> { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTicTacToeSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTicTacToeSolver.java index 418c615d..42c178cd 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTicTacToeSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTicTacToeSolver.java @@ -200,8 +200,9 @@ public class RoomProcessorTicTacToeSolver extends GeneralRoomProcessor { } whoseturn = ones < negativeones; } - RenderUtils.highlightBlock(block, whoseturn ? new Color(0,255,255,50) - : new Color(255, 201, 0,50), partialTicks, true); + RenderUtils.highlightBoxAColor(AxisAlignedBB.fromBounds(block.getX(), block.getY(), block.getZ(), block.getX()+1, block.getY() + 1, block.getZ() + 1), + whoseturn ? FeatureRegistry.SOLVER_TICTACTOE.getTargetColor() + : FeatureRegistry.SOLVER_TICTACTOE.getTargetColor2(), partialTicks, true); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTrivia.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTrivia.java index dcf4434a..9312414b 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTrivia.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorTrivia.java @@ -27,6 +27,8 @@ import kr.syeyoung.dungeonsguide.utils.SkyblockUtils; import kr.syeyoung.dungeonsguide.utils.TextUtils; import kr.syeyoung.dungeonsguide.wsresource.StaticResourceCache; import net.minecraft.client.Minecraft; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IChatComponent; import org.apache.commons.lang3.math.NumberUtils; @@ -145,7 +147,8 @@ public class RoomProcessorTrivia extends GeneralRoomProcessor { OffsetPoint op = (OffsetPoint) getDungeonRoom().getDungeonRoomInfo().getProperties().get(correctAnswer); if (op != null) { - RenderUtils.highlightBlock(op.getBlockPos(getDungeonRoom()), new Color(0,255,0,50), partialTicks, false); + BlockPos solution = op.getBlockPos(getDungeonRoom()); + RenderUtils.highlightBoxAColor(AxisAlignedBB.fromBounds(solution.getX(), solution.getY(), solution.getZ(), solution.getX()+1, solution.getY() + 1, solution.getZ() + 1), FeatureRegistry.SOLVER_KAHOOT.getTargetColor(), partialTicks, true); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java index a34861c9..bf81bf72 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java @@ -31,10 +31,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.IChatComponent; -import net.minecraft.util.MathHelper; +import net.minecraft.util.*; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL14; @@ -332,7 +329,7 @@ public class RoomProcessorBoxSolver extends GeneralRoomProcessor { public void drawScreen(float partialTicks) { super.drawScreen(partialTicks); if (!FeatureRegistry.SOLVER_BOX.isEnabled()) return; - if (FeatureRegistry.SOLVER_BOX_DISABLE_TEXT.isEnabled()) return; + if (FeatureRegistry.SOLVER_BOX.disableText()) return; FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; GlStateManager.enableBlend(); GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); @@ -359,21 +356,23 @@ public class RoomProcessorBoxSolver extends GeneralRoomProcessor { dir = new BlockPos(MathHelper.clamp_int(dir.getX(), -1, 1), 0, MathHelper.clamp_double(dir.getZ(), -1, 1)); BlockPos highlight = pos2.add(dir); - RenderUtils.highlightBlock(highlight, new Color(0, 255, 0, MathHelper.clamp_int((int) (Minecraft.getMinecraft().thePlayer.getPosition().distanceSq(highlight)), 50, 150)), partialTicks, false); + AColor color = FeatureRegistry.SOLVER_BOX.getTargetColor().multiplyAlpha(MathHelper.clamp_double(Minecraft.getMinecraft().thePlayer.getPosition().distanceSq(highlight), 100, 255) / 255); + RenderUtils.highlightBoxAColor(AxisAlignedBB.fromBounds(highlight.getX(), highlight.getY(), highlight.getZ(), highlight.getX()+1, highlight.getY() + 1, highlight.getZ() + 1), color, partialTicks, false); } if (pathFound != null) { - RenderUtils.drawLines(pathFound, new AColor(0, 255, 0, 255),1, partialTicks, true); + RenderUtils.drawLines(pathFound, FeatureRegistry.SOLVER_BOX.getLineColor(),FeatureRegistry.SOLVER_BOX.getLineWidth(), partialTicks, true); } } else { if (totalPath != null) { - RenderUtils.drawLines(totalPath, new AColor(0, 255, 0, 255),1, partialTicks, false); + RenderUtils.drawLines(totalPath, FeatureRegistry.SOLVER_BOX.getLineColor(),FeatureRegistry.SOLVER_BOX.getLineWidth(), partialTicks, false); } if (totalPushedBlocks != null) { for (int i = 0; i < totalPushedBlocks.size(); i++) { BlockPos pos = totalPushedBlocks.get(i); - RenderUtils.highlightBlock(pos, new Color(0, 255, 255, 50), partialTicks, false); - RenderUtils.drawTextAtWorld("#"+i, pos.getX()+0.5f, pos.getY() +0.5f, pos.getZ() + 0.5f, i != step ?0xFF000000 : 0xFF00FF00, 0.1f, false, false, partialTicks); + RenderUtils.highlightBoxAColor(AxisAlignedBB.fromBounds(pos.getX(), pos.getY(), pos.getZ(), pos.getX()+1, pos.getY() + 1, pos.getZ() + 1), FeatureRegistry.SOLVER_BOX.getTargetColor(), partialTicks, false); + RenderUtils.drawTextAtWorld("#"+i, pos.getX()+0.5f, pos.getY() +0.5f, pos.getZ() + 0.5f, i != step ? + RenderUtils.getColorAt(pos.getX(), pos.getY(), pos.getZ(), FeatureRegistry.SOLVER_BOX.getTextColor2()) : RenderUtils.getColorAt(pos.getX(), pos.getY(), pos.getZ(), FeatureRegistry.SOLVER_BOX.getTextColor()), 0.1f, false, false, partialTicks); } } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/icefill/RoomProcessorIcePath2.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/icefill/RoomProcessorIcePath2.java index c0209fc6..c31ba753 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/icefill/RoomProcessorIcePath2.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/icefill/RoomProcessorIcePath2.java @@ -108,7 +108,7 @@ public class RoomProcessorIcePath2 extends GeneralRoomProcessor { public void drawWorld(float partialTicks) { if (!FeatureRegistry.SOLVER_ICEPATH.isEnabled()) return; for (List<BlockPos> solution:this.solution) - RenderUtils.drawLines(solution, new AColor(0,255,0, 255), 1, partialTicks, true); + RenderUtils.drawLines(solution, FeatureRegistry.SOLVER_ICEPATH.getLineColor(),FeatureRegistry.SOLVER_ICEPATH.getLineWidth(), partialTicks, true); } public static class Generator implements RoomProcessorGenerator<RoomProcessorIcePath2> { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java index 21c30b78..046a22c2 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java @@ -614,6 +614,7 @@ public class RenderUtils { GlStateManager.pushMatrix(); GlStateManager.translate(-realX, -realY, -realZ); GlStateManager.disableTexture2D(); + GlStateManager.disableLighting(); GL11.glDisable(GL11.GL_TEXTURE_2D); GlStateManager.enableBlend(); GlStateManager.disableAlpha(); @@ -662,6 +663,7 @@ public class RenderUtils { GlStateManager.pushMatrix(); GlStateManager.translate(-realX, -realY, -realZ); GlStateManager.disableTexture2D(); + GlStateManager.disableLighting(); GlStateManager.enableBlend(); GlStateManager.disableAlpha(); GL11.glLineWidth(thickness); @@ -711,6 +713,7 @@ public class RenderUtils { GlStateManager.pushMatrix(); GlStateManager.translate(-realX, -realY, -realZ); GlStateManager.disableTexture2D(); + GlStateManager.disableLighting(); GlStateManager.enableBlend(); GlStateManager.disableAlpha(); GL11.glLineWidth(thickness); @@ -890,6 +893,80 @@ public class RenderUtils { GlStateManager.popMatrix(); } + public static void highlightBoxAColor(AxisAlignedBB axisAlignedBB, AColor c, float partialTicks, boolean depth) { + Entity viewing_from = Minecraft.getMinecraft().getRenderViewEntity(); + + double x_fix = viewing_from.lastTickPosX + ((viewing_from.posX - viewing_from.lastTickPosX) * partialTicks); + double y_fix = viewing_from.lastTickPosY + ((viewing_from.posY - viewing_from.lastTickPosY) * partialTicks); + double z_fix = viewing_from.lastTickPosZ + ((viewing_from.posZ - viewing_from.lastTickPosZ) * partialTicks); + + GlStateManager.pushMatrix(); + + GlStateManager.translate(-x_fix, -y_fix, -z_fix); + + GlStateManager.disableLighting(); + GlStateManager.enableBlend(); + GlStateManager.disableCull(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.disableTexture2D(); + + if (!depth) { + GlStateManager.disableDepth(); + GlStateManager.depthMask(false); + } + int rgb = RenderUtils.getColorAt(axisAlignedBB.minX, axisAlignedBB.minY, axisAlignedBB.minZ, c); + GlStateManager.color(((rgb >> 16) &0XFF)/ 255.0f, ((rgb>>8) &0XFF)/ 255.0f, (rgb & 0xff)/ 255.0f, ((rgb >> 24) & 0xFF) / 255.0f); + + GlStateManager.translate(axisAlignedBB.minX, axisAlignedBB.minY, axisAlignedBB.minZ); + + double x = axisAlignedBB.maxX - axisAlignedBB.minX; + double y = axisAlignedBB.maxY - axisAlignedBB.minY; + double z = axisAlignedBB.maxZ - axisAlignedBB.minZ; + GL11.glBegin(GL11.GL_QUADS); + GL11.glVertex3d(0, 0, 0); + GL11.glVertex3d(0, 0, z); + GL11.glVertex3d(0, y, z); + GL11.glVertex3d(0, y, 0); // TOP LEFT / BOTTOM LEFT / TOP RIGHT/ BOTTOM RIGHT + + GL11.glVertex3d(x, 0, z); + GL11.glVertex3d(x, 0, 0); + GL11.glVertex3d(x, y, 0); + GL11.glVertex3d(x, y, z); + + GL11.glVertex3d(0, y, z); + GL11.glVertex3d(0, 0, z); + GL11.glVertex3d(x, 0, z); + GL11.glVertex3d(x, y, z); // TOP LEFT / BOTTOM LEFT / TOP RIGHT/ BOTTOM RIGHT + + GL11.glVertex3d(0, 0, 0); + GL11.glVertex3d(0, y, 0); + GL11.glVertex3d(x, y, 0); + GL11.glVertex3d(x, 0, 0); + + GL11.glVertex3d(0,y,0); + GL11.glVertex3d(0,y,z); + GL11.glVertex3d(x,y,z); + GL11.glVertex3d(x,y,0); + + GL11.glVertex3d(0,0,z); + GL11.glVertex3d(0,0,0); + GL11.glVertex3d(x,0,0); + GL11.glVertex3d(x,0,z); + + + + GL11.glEnd(); + + + if (!depth) { + GlStateManager.disableDepth(); + GlStateManager.depthMask(true); + } + GlStateManager.enableTexture2D(); + GlStateManager.enableLighting(); + GlStateManager.popMatrix(); + + } public static void highlightBox(Entity entity, AxisAlignedBB axisAlignedBB, AColor c, float partialTicks, boolean depth) { Entity viewing_from = Minecraft.getMinecraft().getRenderViewEntity(); |