To disable the configuration of shaders in the mod and remove the button that allows users to access the shader configuration options, you'll need to modify the code that handles the shader settings menu. This functionality is likely tied to the OptionMenuContainer within the ShaderPack class, which manages shader options and displays them in the user interface. Here are the steps you can take to achieve this:
Steps to Disable Shader Configuration
Locate the Shader Options Menu:
In the ShaderPack class, the OptionMenuContainer is created in the constructor. This is typically where the options for shaders are gathered and displayed. You would want to either prevent this container from being created or modify it to exclude the shader configuration options.
In the constructor of ShaderPack, find the following line:
[Redacted
this.menuContainer = new OptionMenuContainer(shaderProperties, this.shaderPackOptions, profiles);
Modify the OptionMenuContainer:
If you still want to keep the OptionMenuContainer but disable specific options, you would need to modify the OptionMenuContainer class or how it is populated to not add any shader configuration options.
Example Modification:
You could create a modified version of OptionMenuContainer that does not display any shader options. To do this, you might have to:
Create a new class that extends OptionMenuContainer.
Override methods to prevent shader options from being added.
Alternatively, if you want to completely remove the option to configure shaders, you can ignore creating or using the menuContainer altogether.
Remove Button from GUI:
If there is a specific button in the GUI that leads to shader configuration, you would want to identify that button in the code. Typically, this will be in a GUI class that handles the shader settings screen, possibly in the ShaderPackScreen or another relevant screen class.
Locate the method where the button is added to the GUI. This might look something like:
[Redacted
addButton(new Button(...));
Comment out or remove the code responsible for adding the shader configuration button.
Modify the Menu Navigation:
Ensure that any navigation that leads to the shader configuration is also removed or altered. This could involve:
Checking for any references to the shader configuration screen in the main menu or settings menu and removing them.
Testing:
Once you have made these changes, run the mod to ensure that the shader configuration options are no longer available and that there are no errors resulting from these modifications.
Example Code Snippet
Here’s an example of how you might modify the constructor of the ShaderPack class to prevent the creation of the OptionMenuContainer:
[Redacted
public ShaderPack(Path root, Map<String, String> changedConfigs, Iterable<StringPair> environmentDefines) throws IOException, IllegalStateException {
// Existing code...
// Comment out or remove this line to disable shader options configuration
// this.menuContainer = new OptionMenuContainer(shaderProperties, this.shaderPackOptions, profiles);
// Existing code...
}
Conclusion
By following these steps, you can effectively disable the shader configuration options in the mod. The key areas of focus are in the ShaderPack class and any associated GUI classes that manage shader settings. Be sure to test the application thoroughly after making these changes to ensure that everything functions as expected without the shader configuration options.
ShaderPackScreen
This class likely handles the shader settings screen interface. You might need to search for it if it exists in the package:
To disable shader configuration options, primarily focus on modifying the ShaderPack.java class. You may also want to inspect the OptionMenuContainer class and potentially the ShaderPackScreen class for any GUI-related elements.