Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pluginManagement {
}

plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.38'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.43'
}


Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package lumien.custommainmenu.lib.actions;

import java.lang.reflect.Array;
import java.lang.reflect.Constructor;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiControls;
import net.minecraft.client.gui.GuiCreateWorld;
Expand All @@ -19,6 +22,7 @@
import net.minecraft.client.stream.IStream;

import cpw.mods.fml.client.GuiModList;
import cpw.mods.fml.common.Loader;
import lumien.custommainmenu.CustomMainMenu;
import lumien.custommainmenu.gui.GuiCustom;

Expand Down Expand Up @@ -50,6 +54,30 @@ public void perform(Object source, GuiCustom menu) {
gui = new GuiLanguage(menu, menu.mc.gameSettings, menu.mc.getLanguageManager());
} else if (this.guiName.equalsIgnoreCase("options.ressourcepacks")) {
gui = new GuiScreenResourcePacks(menu);
} else if (this.guiName.equalsIgnoreCase("options.resourcepacks")) {
gui = new GuiScreenResourcePacks(menu);
} else if (this.guiName.equalsIgnoreCase("options.shaderpacks")) {
if (Loader.isModLoaded("angelica")) {
try {
Class<?> guiShadersClass = Class.forName("net.coderbot.iris.gui.screen.ShaderPackScreen");
Constructor<?> constructor = guiShadersClass.getConstructor(GuiScreen.class);
Object guiInstance = constructor.newInstance(menu.mc.currentScreen);
gui = (GuiScreen) guiInstance;
} catch (Exception e) {
throw new RuntimeException(e);
}
} else if (Loader.isModLoaded("swansong")) {
try {
Class<?> guiShadersClass = Class.forName("com.ventooth.swansong.gui.GuiShaders");
Constructor<?> constructor = guiShadersClass.getConstructor(GuiScreen.class);
Object guiInstance = constructor.newInstance(menu.mc.currentScreen);
gui = (GuiScreen) guiInstance;
} catch (Exception e) {
throw new RuntimeException(e);
}
} else {
gui = new GuiScreenResourcePacks(menu);
}
} else if (this.guiName.equalsIgnoreCase("options.snooper")) {
gui = new GuiSnooper(menu, menu.mc.gameSettings);
} else if (this.guiName.equalsIgnoreCase("options.sounds")) {
Expand All @@ -63,7 +91,41 @@ public void perform(Object source, GuiCustom menu) {
GuiStreamUnavailable.func_152321_a(menu);
}
} else if (this.guiName.equalsIgnoreCase("options.video")) {
gui = new GuiVideoSettings(menu, menu.mc.gameSettings);
if (Loader.isModLoaded("angelica")) {
try {
Class<?> guiShadersClass = Class.forName("me.jellysquid.mods.sodium.client.gui.SodiumOptionsGUI");
Constructor<?> constructor = guiShadersClass.getConstructor(GuiScreen.class);
Object guiInstance = constructor.newInstance(menu.mc.currentScreen);
gui = (GuiScreen) guiInstance;
} catch (Exception e) {
throw new RuntimeException(e);
}
} else if (Loader.isModLoaded("notfine")) {
try {
final String OPTION_PAGE_FQN = "me.jellysquid.mods.sodium.client.gui.options.OptionPage";
Class<?> optionPageClass = Class.forName(OPTION_PAGE_FQN);
Class<?> notFineOptionsClass = Class.forName("jss.notfine.gui.NotFineGameOptionPages");
Object generalPage = notFineOptionsClass.getMethod("general").invoke(null);
Object detailPage = notFineOptionsClass.getMethod("detail").invoke(null);
Object atmospherePage = notFineOptionsClass.getMethod("atmosphere").invoke(null);
Object particlesPage = notFineOptionsClass.getMethod("particles").invoke(null);
Object otherPage = notFineOptionsClass.getMethod("other").invoke(null);
Object[] subPages = (Object[]) Array.newInstance(optionPageClass, 4);
subPages[0] = detailPage;
subPages[1] = atmospherePage;
subPages[2] = particlesPage;
subPages[3] = otherPage;
Class<?> optionPageArrayClass = Class.forName("[L" + OPTION_PAGE_FQN + ";");
Constructor<?> constructor = Class.forName("jss.notfine.gui.GuiCustomMenu")
.getConstructor(GuiScreen.class, optionPageClass, optionPageArrayClass);
Object guiInstance = constructor.newInstance(menu.mc.currentScreen, generalPage, subPages);
gui = (GuiScreen) guiInstance;
} catch (Exception e) {
throw new RuntimeException(e);
}
} else {
gui = new GuiVideoSettings(menu, menu.mc.gameSettings);
}
} else if (this.guiName.equalsIgnoreCase("options.controls")) {
gui = new GuiControls(menu, menu.mc.gameSettings);
} else if (this.guiName.equalsIgnoreCase("options.multiplayer")) {
Expand Down