Skip to content

Commit

Permalink
vintage config button
Browse files Browse the repository at this point in the history
Signed-off-by: Nolij <[email protected]>
  • Loading branch information
Nolij committed Dec 25, 2023
1 parent b57bdb2 commit 65179bf
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package dev.nolij.zume.vintage;

import dev.nolij.zume.common.Zume;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.fml.client.IModGuiFactory;
import net.minecraftforge.fml.client.config.GuiConfig;

import java.io.IOException;
import java.util.Collections;
import java.util.Set;

public class VintageConfigProvider implements IModGuiFactory {

public static class VintageZumeConfigGUI extends GuiConfig {

public VintageZumeConfigGUI(GuiScreen parentScreen) throws IOException {
super(parentScreen, Collections.emptyList(), Zume.MOD_ID, false, false, "config");

Zume.openConfigFile();
}

@Override
public void initGui() {
this.onGuiClosed();
Minecraft.getMinecraft().displayGuiScreen(parentScreen);
}

}

@Override
public GuiScreen createConfigGui(GuiScreen parentScreen) {
try {
return new VintageZumeConfigGUI(parentScreen);
} catch (IOException e) {
throw new AssertionError(e);
}
}

@Override
public boolean hasConfigGui() {
return true;
}

@Override
public void initialize(Minecraft minecraftInstance) {

}

@Override
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
name = Tags.MOD_NAME,
version = Tags.MOD_VERSION,
acceptedMinecraftVersions = Tags.VERSION_RANGE,
guiFactory = "dev.nolij.zume.vintage.VintageConfigProvider",
dependencies = "required-after:mixinbooter@*")
public class VintageZume implements IZumeProvider {

Expand Down

0 comments on commit 65179bf

Please sign in to comment.