diff options
author | syeyoung <cyong06@naver.com> | 2021-02-26 01:26:44 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-02-26 01:26:44 +0900 |
commit | 3fbf9d1a6810485279ec3eed0378614a59a2315c (patch) | |
tree | 1f123b070982a4df4d2f0ec90cbde3ac7b741de1 /src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig | |
parent | 1a1e216a3e58f13a6ecec14c726283943497d119 (diff) | |
download | Skyblock-Dungeons-Guide-3fbf9d1a6810485279ec3eed0378614a59a2315c.tar.gz Skyblock-Dungeons-Guide-3fbf9d1a6810485279ec3eed0378614a59a2315c.tar.bz2 Skyblock-Dungeons-Guide-3fbf9d1a6810485279ec3eed0378614a59a2315c.zip |
ok loc config
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig')
4 files changed, 16 insertions, 4 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiConfig.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiConfig.java index 0da479db..27b71e06 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiConfig.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiConfig.java @@ -38,6 +38,12 @@ public class GuiConfig extends GuiScreen { tabbedPane.setPageGenerator(ConfigPanelCreator.INSTANCE); + tabbedPane.addBookmarkRunnable("GUI Relocate", new Runnable() { + @Override + public void run() { + Minecraft.getMinecraft().displayGuiScreen(new GuiGuiLocationConfig(GuiConfig.this, null)); + } + }); for (final Map.Entry<String, List<AbstractFeature>> cate: FeatureRegistry.getFeaturesByCategory().entrySet()) if (!cate.getKey().equals("hidden")) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiGuiLocationConfig.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiGuiLocationConfig.java index cbb60556..646cd0e5 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiGuiLocationConfig.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiGuiLocationConfig.java @@ -20,11 +20,11 @@ public class GuiGuiLocationConfig extends GuiScreen { private MPanel mainPanel = new MPanel(); private GuiScreen before; - public GuiGuiLocationConfig(final GuiScreen before) { + public GuiGuiLocationConfig(final GuiScreen before, AbstractFeature featureWhitelist) { this.before = before; for (AbstractFeature feature : FeatureRegistry.getFeatureList()) { if (feature instanceof GuiFeature && feature.isEnabled()) { - mainPanel.add(new PanelDelegate((GuiFeature) feature)); + mainPanel.add(new PanelDelegate((GuiFeature) feature, featureWhitelist == null || feature == featureWhitelist)); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MFeature.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MFeature.java index c0d8d74b..d10730b7 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MFeature.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/MFeature.java @@ -68,7 +68,7 @@ public class MFeature extends MPanel { button.setOnActionPerformed(new Runnable() { @Override public void run() { - Minecraft.getMinecraft().displayGuiScreen(new GuiGuiLocationConfig(config)); + Minecraft.getMinecraft().displayGuiScreen(new GuiGuiLocationConfig(config, abstractFeature)); } }); addons.add(button); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDelegate.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDelegate.java index 77ad4cc8..6ce54077 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDelegate.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/PanelDelegate.java @@ -9,8 +9,10 @@ import java.awt.*; public class PanelDelegate extends MPanel { private GuiFeature guiFeature; - public PanelDelegate(GuiFeature guiFeature) { + private boolean draggable = false; + public PanelDelegate(GuiFeature guiFeature, boolean draggable) { this.guiFeature = guiFeature; + this.draggable = draggable; } @Override @@ -24,6 +26,7 @@ public class PanelDelegate extends MPanel { guiFeature.drawDemo(partialTicks); GlStateManager.popMatrix(); + if (!draggable) return; Gui.drawRect(0,0, 3, 3, 0xFFBBBBBB); Gui.drawRect(0, getBounds().height - 3, 3, getBounds().height, 0xFFBBBBBB); Gui.drawRect(getBounds().width - 3,0, getBounds().width, 3, 0xFFBBBBBB); @@ -51,6 +54,7 @@ public class PanelDelegate extends MPanel { @Override public void mouseClicked(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int mouseButton) { + if (!draggable) return; if (!lastAbsClip.contains(absMouseX, absMouseY)) return; if (relMouseX < 3 && relMouseY < 3) { selectedPart = 0; @@ -71,6 +75,7 @@ public class PanelDelegate extends MPanel { @Override public void mouseReleased(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int state) { + if (!draggable) return; if (selectedPart >= -1) { int minWidth; int minHeight; @@ -100,6 +105,7 @@ public class PanelDelegate extends MPanel { @Override public void mouseClickMove(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int clickedMouseButton, long timeSinceLastClick) { + if (!draggable) return; int dx = absMouseX - lastX; int dy = absMouseY - lastY; if (selectedPart >= 0) { |