aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java10
-rw-r--r--src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/ScreenOpenCommands.kt6
2 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
index cbc14b79..6130bc9f 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
@@ -106,6 +106,16 @@ public class NEUConfig extends Config {
}, () -> NotEnoughUpdates.INSTANCE.openGui = savedGui));
}
+ public static GuiScreen editOverlayForCommand() {
+ final LinkedHashMap<TextOverlay, Position> overlayPositions = new LinkedHashMap<TextOverlay, Position>();
+ for (TextOverlay overlay : OverlayManager.textOverlays) {
+ overlayPositions.put(overlay, overlay.getPosition());
+ }
+ return new GuiPositionEditor(overlayPositions, () -> {
+ }, () -> {
+ });
+ }
+
@Override
public void saveNow() {
NotEnoughUpdates.INSTANCE.saveConfig();
diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/ScreenOpenCommands.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/ScreenOpenCommands.kt
index 7a9b8d0e..4b0e31f1 100644
--- a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/ScreenOpenCommands.kt
+++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/ScreenOpenCommands.kt
@@ -25,6 +25,7 @@ import io.github.moulberry.notenoughupdates.events.RegisterBrigadierCommandEvent
import io.github.moulberry.notenoughupdates.miscgui.GuiEnchantColour
import io.github.moulberry.notenoughupdates.miscgui.GuiInvButtonEditor
import io.github.moulberry.notenoughupdates.miscgui.NEUOverlayPlacements
+import io.github.moulberry.notenoughupdates.options.NEUConfig
import io.github.moulberry.notenoughupdates.util.brigadier.thenExecute
import io.github.moulberry.notenoughupdates.util.brigadier.withHelp
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -48,5 +49,10 @@ class ScreenOpenCommands {
NotEnoughUpdates.INSTANCE.openGui = NEUOverlayPlacements()
}
}.withHelp("Open the NEU gui overlay editor")
+ event.command("neugui") {
+ thenExecute {
+ NotEnoughUpdates.INSTANCE.openGui = NEUConfig.editOverlayForCommand()
+ }
+ }.withHelp("Open the NEU gui editor")
}
}