diff options
| author | syeyoung <cyoung06@naver.com> | 2023-01-27 15:23:37 +0900 |
|---|---|---|
| committer | syeyoung <cyoung06@naver.com> | 2023-01-27 15:23:37 +0900 |
| commit | d1621e334a9df13294e5694582769251e8e3294f (patch) | |
| tree | 39b65ead9b94332e2e066795e19bb03782aaa9eb | |
| parent | 6c1cca66a9e81b24e1a77cd739606abd481e00cd (diff) | |
| download | Skyblock-Dungeons-Guide-d1621e334a9df13294e5694582769251e8e3294f.tar.gz Skyblock-Dungeons-Guide-d1621e334a9df13294e5694582769251e8e3294f.tar.bz2 Skyblock-Dungeons-Guide-d1621e334a9df13294e5694582769251e8e3294f.zip | |
- Snapping, and new gui config
Signed-off-by: syeyoung <cyoung06@naver.com>
55 files changed, 2012 insertions, 850 deletions
diff --git a/mod/build.gradle b/mod/build.gradle index 53ed0be3..ad799d39 100644 --- a/mod/build.gradle +++ b/mod/build.gradle @@ -71,7 +71,8 @@ dependencies { if (testWithNeu) { runtimeOnly 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.22' - add("devenvMod", 'com.github.notenoughupdates:notenoughupdates:1f4d692:all') +// add("devenvMod", 'com.github.notenoughupdates:notenoughupdates:1f4d692:all') +// add("devenvMod", 'com.github.notenoughupdates:notenoughupdates:museumthing-SNAPSHOT:all') } def files= fileTree("../runtime/mods2").filter { it.isFile() } add("devenvMod", files) diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/RootConfigPanel.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/RootConfigPanel.java index 0bc16fbb..ebe09875 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/RootConfigPanel.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/RootConfigPanel.java @@ -21,10 +21,13 @@ package kr.syeyoung.dungeonsguide.mod.config.guiconfig; import com.google.common.base.Function; import kr.syeyoung.dungeonsguide.launcher.auth.AuthManager; import kr.syeyoung.dungeonsguide.mod.config.guiconfig.location.GuiGuiLocationConfig; +import kr.syeyoung.dungeonsguide.mod.config.guiconfig.location2.HUDLocationConfig; import kr.syeyoung.dungeonsguide.mod.features.AbstractFeature; import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry; import kr.syeyoung.dungeonsguide.mod.gui.MPanel; import kr.syeyoung.dungeonsguide.mod.gui.elements.*; +import kr.syeyoung.dungeonsguide.mod.guiv2.GuiScreenAdapter; +import kr.syeyoung.dungeonsguide.mod.guiv2.elements.GlobalHUDScale; import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils; import lombok.Getter; import lombok.Setter; @@ -99,7 +102,7 @@ public class RootConfigPanel extends MPanelScaledGUI { guiRelocate = new MButton(); guiRelocate.setText("Edit Gui Locations"); guiRelocate.setOnActionPerformed(() -> { - Minecraft.getMinecraft().displayGuiScreen(new GuiGuiLocationConfig(gui, null)); + Minecraft.getMinecraft().displayGuiScreen(new GuiScreenAdapter(new GlobalHUDScale(new HUDLocationConfig()))); guiRelocate.setBeingClicked(false); }); guiRelocate.setBorder(RenderUtils.blendTwoColors(0xFF141414,0x7702EE67)); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/GuiGuiLocationConfig.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/GuiGuiLocationConfig.java index 365a1182..d88991be 100755 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/GuiGuiLocationConfig.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/GuiGuiLocationConfig.java @@ -42,24 +42,24 @@ public class GuiGuiLocationConfig extends MGui { @Getter private final GuiScreen before; - @Getter - private TreeMap<Integer, List<Marker>> markerTreeMapByX = new TreeMap<>(); - @Getter - private TreeMap<Integer, List<Marker>> markerTreeMapByY = new TreeMap<>(); - @Getter - private Set<Marker> markerSet = new HashSet<>(); - - - Marker[] markers = new Marker[4]; +// @Getter +// private TreeMap<Integer, List<Marker>> markerTreeMapByX = new TreeMap<>(); +// @Getter +// private TreeMap<Integer, List<Marker>> markerTreeMapByY = new TreeMap<>(); +// @Getter +// private Set<Marker> markerSet = new HashSet<>(); +// +// +// Marker[] markers = new Marker[4]; public GuiGuiLocationConfig(final GuiScreen before, AbstractFeature featureWhitelist) { this.before = before; - for (AbstractFeature feature : FeatureRegistry.getFeatureList()) { - if (feature instanceof AbstractHUDFeature && feature.isEnabled()) { - getMainPanel().add(new PanelDelegate((AbstractHUDFeature) feature, featureWhitelist == null || feature == featureWhitelist, this)); - } - } +// for (AbstractFeature feature : FeatureRegistry.getFeatureList()) { +// if (feature instanceof AbstractHUDFeature && feature.isEnabled()) { +// getMainPanel().add(new PanelDelegate((AbstractHUDFeature) feature, featureWhitelist == null || feature == featureWhitelist, this)); +// } +// } getMainPanel().setBackgroundColor(new Color(0,0,0, 100)); } @@ -71,49 +71,49 @@ public class GuiGuiLocationConfig extends MGui { new Vec3(1, 0.5, 4), }; - public void removeAndAddMarker(Marker prev, Marker newM) { - if (prev != null) { - markerTreeMapByX.computeIfPresent(prev.getX(),(k,v) -> { - v.remove(prev); - if (v.isEmpty()) return null; - else return v; - }); - markerTreeMapByY.computeIfPresent(prev.getY(),(k,v) -> { - v.remove(prev); - if (v.isEmpty()) return null; - else return v; - }); - markerSet.remove(prev); - } - if (newM != null) { - markerTreeMapByX.compute(newM.getX(), (k,v) -> { - if (v == null) { - return new ArrayList<>(Arrays.asList(newM)); - } else { - v.add(newM); - return v; - } - }); - markerTreeMapByY.compute(newM.getY(), (k,v) -> { - if (v == null) { - return new ArrayList<>(Arrays.asList(newM)); - } else { - v.add(newM); - return v; - } - }); - markerSet.add(newM); - } - } +// public void removeAndAddMarker(Marker prev, Marker newM) { +// if (prev != null) { +// markerTreeMapByX.computeIfPresent(prev.getX(),(k,v) -> { +// v.remove(prev); +// if (v.isEmpty()) return null; +// else return v; +// }); +// markerTreeMapByY.computeIfPresent(prev.getY(),(k,v) -> { +// v.remove(prev); +// if (v.isEmpty()) return null; +// else return v; +// }); +// markerSet.remove(prev); +// } +// if (newM != null) { +// markerTreeMapByX.compute(newM.getX(), (k,v) -> { +// if (v == null) { +// return new ArrayList<>(Arrays.asList(newM)); +// } else { +// v.add(newM); +// return v; +// } +// }); +// markerTreeMapByY.compute(newM.getY(), (k,v) -> { +// if (v == null) { +// return new ArrayList<>(Arrays.asList(newM)); +// } else { +// v.add(newM); +// return v; +// } +// }); +// markerSet.add(newM); +// } +// } public void setupMarkers() { - for (int i1 = 0; i1 < markers.length; i1++) { - Marker orig = markers[i1]; - Vec3 pt = facing[i1]; - markers[i1] = new Marker((int) (pt.xCoord * getMainPanel().getBounds().width), (int) (pt.yCoord * getMainPanel().getBounds().height), (int) pt.zCoord, this); - - removeAndAddMarker(orig, markers[i1]); - } +// for (int i1 = 0; i1 < markers.length; i1++) { +// Marker orig = markers[i1]; +// Vec3 pt = facing[i1]; +// markers[i1] = new Marker((int) (pt.xCoord * getMainPanel().getBounds().width), (int) (pt.yCoord * getMainPanel().getBounds().height), (int) pt.zCoord, this); +// +// removeAndAddMarker(orig, markers[i1]); +// } } @Override @@ -151,15 +151,15 @@ public class GuiGuiLocationConfig extends MGui { public void initGui() { super.initGui(); getMainPanel().setBounds(new Rectangle(0,0,Minecraft.getMinecraft().displayWidth,Minecraft.getMinecraft().displayHeight)); - markerTreeMapByX.clear(); - markerTreeMapByY.clear(); - markerSet.clear(); - setupMarkers(); - for (MPanel childComponent : getMainPanel().getChildComponents()) { - if (childComponent instanceof PanelDelegate) { - ((PanelDelegate) childComponent).rebuildMarker(); - } - } +// markerTreeMapByX.clear(); +// markerTreeMapByY.clear(); +// markerSet.clear(); +// setupMarkers(); +// for (MPanel childComponent : getMainPanel().getChildComponents()) { +// if (childComponent instanceof PanelDelegate) { +// ((PanelDelegate) childComponent).rebuildMarker(); +// } +// } } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/Marker.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/Marker.java index 10683425..b622e3b6 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/Marker.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/Marker.java @@ -1,45 +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.mod.config.guiconfig.location; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.ToString; - -@Getter -@ToString -@AllArgsConstructor -public class Marker { - private final int x; - private final int y; - /** - * 0xABCDEFGH - * A: ? - * B: ? - * C: ? - * D: ? - * EF: 0~3 (TC 0x00 CL 0x01 BC 0x10 CR 0x11) - */ - private final int type; - private final Object parent; - - public int distanceSQ(Marker m2) { - return (m2.x - x)*(m2.x - x) + (m2.y - y)*(m2.y - y); - } -} +///* +// * 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.mod.config.guiconfig.location; +// +//import lombok.AllArgsConstructor; +//import lombok.Getter; +//import lombok.ToString; +// +//@Getter +//@ToString +//@AllArgsConstructor +//public class Marker { +// private final int x; +// private final int y; +// /** +// * 0xABCDEFGH +// * A: ? +// * B: ? +// * C: ? +// * D: ? +// * EF: 0~3 (TC 0x00 CL 0x01 BC 0x10 CR 0x11) +// */ +// private final int type; +// private final Object parent; +// +// public int distanceSQ(Marker m2) { +// return (m2.x - x)*(m2.x - x) + (m2.y - y)*(m2.y - y); +// } +//} diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/PanelDelegate.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/PanelDelegate.java index 3bcae70b..b12e59c6 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/PanelDelegate.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/location/PanelDelegate.java @@ -1,404 +1,404 @@ -/* - * 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.mod.config.guiconfig.location; - - -import kr.syeyoung.dungeonsguide.mod.config.types.GUIRectangle; -import kr.syeyoung.dungeonsguide.mod.features.AbstractHUDFeature; -import kr.syeyoung.dungeonsguide.mod.gui.MPanel; -import kr.syeyoung.dungeonsguide.mod.gui.elements.MPopupMenu; -import kr.syeyoung.dungeonsguide.mod.gui.elements.MTooltip; -import kr.syeyoung.dungeonsguide.mod.utils.cursor.EnumCursor; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; -import net.minecraft.client.renderer.vertex.DefaultVertexFormats; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.Tuple; -import net.minecraft.util.Vec3; -import org.lwjgl.opengl.GL11; - -import java.awt.*; -import java.util.List; -import java.util.*; - -public class PanelDelegate extends MPanel { - private final AbstractHUDFeature guiFeature; - private boolean draggable = false; - private GuiGuiLocationConfig guiGuiLocationConfig; - - private Set<Marker> markerSet = new HashSet<>(); - public PanelDelegate(AbstractHUDFeature guiFeature, boolean draggable, GuiGuiLocationConfig guiGuiLocationConfig) { - this.guiFeature = guiFeature; - this.draggable = draggable; - this.guiGuiLocationConfig = guiGuiLocationConfig; - } - - public void rebuildMarker() { - internallyThinking = guiFeature.getFeatureRect().getRectangleNoScale(); - applyConstraint(); - } - - @Override - public Rectangle getBounds() { - Rectangle rectangle = guiFeature.getFeatureRect().getRectangle(); - return new Rectangle(rectangle.x, rectangle.y, rectangle.width, rectangle.height); - } - - @Override - public void render(int absMousex, int absMousey, int relMouseX, int relMouseY, float partialTicks, Rectangle scissor) { - if (!guiFeature.isEnabled()) return; - - GlStateManager.pushMatrix(); - guiFeature.drawDemo(partialTicks); - GlStateManager.popMatrix(); - if (!draggable) return; - Gui.drawRect(0,0, 4, 4, 0xFFBBBBBB); - Gui.drawRect(0, getBounds().height - 4, 4, getBounds().height, 0xFFBBBBBB); - Gui.drawRect(getBounds().width - 4,0, getBounds().width, 4, 0xFFBBBBBB); - Gui.drawRect(getBounds().width - 4,getBounds().height - 4, getBounds().width, getBounds().height, 0xFFBBBBBB); - if (lastAbsClip.contains(absMousex, absMousey)) { - if (relMouseX < 4 && relMouseY < 4) { - Gui.drawRect(0,0, 4, 4, 0x55FFFFFF); - } else if (relMouseX < 4 && relMouseY > getBounds().height - 4) { - Gui.drawRect(0, getBounds().height - 4, 4, getBounds().height, 0x55FFFFFF); - } else if (relMouseX > getBounds().width - 4 && relMouseY > getBounds().height - 4) { - Gui.drawRect(getBounds().width - 4,getBounds().height - 4, getBounds().width, getBounds().height, 0x55FFFFFF); - } else if (relMouseX > getBounds().width - 4 && relMouseY < 4) { - Gui.drawRect(getBounds().width - 4,0, getBounds().width, 4, 0x55FFFFFF); - } else if (selectedPart == -2){ - Gui.drawRect(0,0, getBounds().width, getBounds().height, 0x55FFFFFF); - } - } - GlStateManager.enableBlend(); - } - - @Override - public void render0(double scale, Point parentPoint, Rectangle parentClip, int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks) { - GlStateManager.pushMatrix(); - super.render0(scale, parentPoint, parentClip, absMousex, absMousey, relMousex0, relMousey0, partialTicks); - GlStateManager.popMatrix(); - - if (snapped != null && selectedPart != -2) { - Tessellator tessellator = Tessellator.getInstance(); - |
