The getHandlerFor() method returns an instance of a RuntimeOptionGuiHandler that handles painting the right hand side option screen for the specified RuntimeOptionCategoryElement. The remaining parents will sort alphabetically. There is one special parent 'Help' that will always list first, and is generally meant to provide Help type content for mods. The parent represents the parent node in the tree. Runtime categories are created on demand and organized in a 'lite' tree format. The Javadoc says the method returns a Set of the "runtime" categories this mod wishes to populate with GUI elements. It seems to be intended to create a hierarchy of config options so you could have multiple sub-options. The runtimeGuiCategories() doesn't seem to be in any call hierarchy so I am not sure this is implemented yet - I plan to try this soon. A null from this method indicates that the mod does not provide a "config" button GUI screen, and the config button will be hidden/disabled. The expected behavior is that this screen will replace the "mod list" screen completely, and will return to the mod list screen through the parent link, once the appropriate action is taken from the config screen. It will have a single argument constructor - the "parent" screen, the same as all Minecraft GUIs. This class will be instantiated when the "config" button is pressed in the mod list. The mainConfigGuiClass() method returns the name of a class extending GuiScreen, which should be your custom GuiConfig class (which I explain how to make below). ![]() This is interesting because it means that if you want to run any code right after all mods are finished loading you can put that code in this initialize() method (even if that code is not related to the configuration GUI). Tip: The initialize() method is called by a method called FMLClientHandler.finishMinecraftLoading(). Leaving the method blank seems to work fine. The Javadoc simply says: Called when instantiated to initialize with the active Minecraft instance. I'm not really sure the possibilities for using the initialize() method. If not, please follow a tutorial such as: How To Make An Advanced Configuration File.Ĭreate And Associate The "GUI Factory" (Implement IModGuiFactory) I explain how to do that below.įirst I assume that you already have set up a Configuration for your mod. It is possible to replace this GUI with your own. This functionality was never quite implemented (I expect the issue is that if there are several mods loaded, it is supposed to list multiple mods then go into their options). If you try Mod Options button from the in-game pause menu, you'll normally just see a couple of dummy strings displayed and no real options settings. Additionally, if you press ESC during the game to pause the game you'll notice that there is a Mod Options button. ![]() In the main menu if you select Mods then select a mod there is an Configure button. There are actually two places where the menu system indicates you can access mod options. Create a GuiConfig extension class that associates the config file and process the update of the config when the Done button is pressed.Create and associate a "GUI factory" with your mod.The steps to creating the config GUI is fairly simple. But overall it is still functional enough for some simple configuration purposes - I find it useful anyway. For example, if you try to configure while in world the default GUI only shows dummy options (you can replace the GUI entirely though as I explain below), also the ability to show parent/child categories of configuration options doesn't seem to be called. ![]() Warning: The GuiConfig functionality is not fully implemented yet. (To access this you select the Mods button on the main game menu, then select a mod, then select the Config button.) Therefore, there is now some classes such as GuiConfig in Minecraft Forge that allow you to create a gui to allow the user to edit the configuration within the game. However it is annoying that a person has to edit the config file separately (using a text editor) to make configuration changes. This works fine and there are other tutorials on configurations (see How To Make An Advanced Configuration File). For example, maybe you want the health of a custom mob to be configurable. The values in the config file can be mapped to fields in your code to configure how your mod behaves. So here is my own tutorial.)Ī config is a text file that is user-editable, and usually within the user directory (not the installation directory or JAR) of the computer. (I learned how to make a configuration GUI originally from a minalien tutorial, but it seems that his is no longer posted.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |