diff options
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/config')
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) { |