aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2024-05-03 03:09:49 +1000
committerGitHub <noreply@github.com>2024-05-02 19:09:49 +0200
commit156de663b37184bc2dc67f4004947c7de1d3413e (patch)
tree94b5e7e2ff110888b1bfcc354ea7692f0ce3ddec
parente4e0d2a0eb7b625ef5e9d32e46adc3040fd7f986 (diff)
downloadNotEnoughUpdates-156de663b37184bc2dc67f4004947c7de1d3413e.tar.gz
NotEnoughUpdates-156de663b37184bc2dc67f4004947c7de1d3413e.tar.bz2
NotEnoughUpdates-156de663b37184bc2dc67f4004947c7de1d3413e.zip
Add /neugui command (#1140)
-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")
}
}