diff options
author | syeyoung <cyoung06@naver.com> | 2023-02-07 15:11:13 +0900 |
---|---|---|
committer | syeyoung <cyoung06@naver.com> | 2023-02-07 15:11:13 +0900 |
commit | d566771b9fdba45c56b272b28e5fc0dbf2508958 (patch) | |
tree | ba27d674039b80124eea32b597f9935115f12849 /loader/src/main | |
parent | 9edc3503704ec77209d14fff2a1437a0d0369190 (diff) | |
download | Skyblock-Dungeons-Guide-d566771b9fdba45c56b272b28e5fc0dbf2508958.tar.gz Skyblock-Dungeons-Guide-d566771b9fdba45c56b272b28e5fc0dbf2508958.tar.bz2 Skyblock-Dungeons-Guide-d566771b9fdba45c56b272b28e5fc0dbf2508958.zip |
- config gui and going back
Signed-off-by: syeyoung <cyoung06@naver.com>
Diffstat (limited to 'loader/src/main')
4 files changed, 50 insertions, 2 deletions
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<? extends GuiScreen> 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 <https://www.gnu.org/licenses/>. + */ + +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<? extends GuiScreen> mainConfigGuiClass() { + return Main.getMain().getCurrentLoader() == null ? null : Main.getMain().getCurrentLoader().getInstance().getModConfigGUI(); + } + + @Override + public Set<RuntimeOptionCategoryElement> 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"; |