From d566771b9fdba45c56b272b28e5fc0dbf2508958 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Tue, 7 Feb 2023 15:11:13 +0900 Subject: - config gui and going back Signed-off-by: syeyoung --- .../dungeonsguide/launcher/DGInterface.java | 3 ++ .../dungeonsguide/launcher/DGModGuiFactory.java | 45 ++++++++++++++++++++++ .../dungeonsguide/launcher/LoaderMeta.java | 2 +- .../kr/syeyoung/dungeonsguide/launcher/Main.java | 2 +- 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/DGModGuiFactory.java (limited to 'loader/src/main') diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/DGInterface.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/DGInterface.java index 8da55e40..f1f44bb1 100755 --- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/DGInterface.java +++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/DGInterface.java @@ -18,6 +18,7 @@ package kr.syeyoung.dungeonsguide.launcher; +import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.resources.IResourceManager; import java.io.File; @@ -26,4 +27,6 @@ public interface DGInterface { void init(File resourceDir); void unload(); void onResourceReload(IResourceManager a); + + Class getModConfigGUI(); } diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/DGModGuiFactory.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/DGModGuiFactory.java new file mode 100644 index 00000000..0adfe96d --- /dev/null +++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/DGModGuiFactory.java @@ -0,0 +1,45 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2023 cyoung06 (syeyoung) + * + * 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 . + */ + +package kr.syeyoung.dungeonsguide.launcher; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.fml.client.IModGuiFactory; + +import java.util.Set; + +public class DGModGuiFactory implements IModGuiFactory { + @Override + public void initialize(Minecraft minecraft) {} + + @Override + public Class mainConfigGuiClass() { + return Main.getMain().getCurrentLoader() == null ? null : Main.getMain().getCurrentLoader().getInstance().getModConfigGUI(); + } + + @Override + public Set runtimeGuiCategories() { + return null; + } + + @Override + public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement runtimeOptionCategoryElement) { + return null; + } +} diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/LoaderMeta.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/LoaderMeta.java index 2ad67688..520282fd 100644 --- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/LoaderMeta.java +++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/LoaderMeta.java @@ -19,5 +19,5 @@ package kr.syeyoung.dungeonsguide.launcher; public class LoaderMeta { - public static final int LOADER_VERSION = 1; + public static final int LOADER_VERSION = 2; } diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/Main.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/Main.java index 36456dbc..56a87d60 100755 --- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/Main.java +++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/Main.java @@ -58,7 +58,7 @@ import java.util.List; import java.util.Objects; import java.util.UUID; -@Mod(modid = Main.MOD_ID, version = Main.VERSION) +@Mod(modid = Main.MOD_ID, version = Main.VERSION, clientSideOnly = true, guiFactory = "kr.syeyoung.dungeonsguide.launcher.DGModGuiFactory") public class Main { public static final String MOD_ID = "dungeons_guide_loader"; -- cgit