![]() * menu - A text/value pair, pops up a list dialog when selected. * slider - A text/number pair, pops up a slider dialog when selected. * empty - An empty entry, used to add spacing between options without having to re-position the cursor. We already used `AddToggleOption` in our last example, but there are more option types. Let's have a look at the functions to add the actual options. You are free to change cursor position and fill mode at any time when adding options. To insert an option at a certain position, you can move the option cursor with SetCursorPosition, then call the function that adds the option. First row holds options 0 and 1, second row 2 and 3, and so on. That makes a grid with 2 columns and 64 rows. The list that holds these options shows two entries per row. Each entry is indexed by its position from 0 to 127. You may add up to 128 option entries per page. The initial page when selecting a mod in the config panel is the default page "". You don't have to use multiple pages though - in this first example, we won't do it either. The event is called OnPageReset because each config menu supports up to 128 pages you can use to structure your options. The config panel then calls OnPageReset on the active config menu, and in this event you are supposed to add content to the option list - or in other words: to fill the current page. Instead, whenever the active config menu changes, or even when the page changes, the current content is completely cleared and forgotten. It doesn't remember all the options for all the menus it manages. The config panel keeps very little internal state. An event that's generated when the user clicked a check box option, for example, expects you to react to that input. You customize your config menu by implementing these events, pretty much like you would implement OnUpdate or OnInit for other scripts.įor each of those events, you're expected to do certain things. ![]() SKI_ConfigBase provides several events that are executed when the user interacts with the config menu. Customizing your Config MenuĪs you may recall, the config menu script you created extends SKI_ConfigBase. It doesn't have any content and just shows an empty panel, but we are going to change that in the following sections. ![]() That's all it takes to make your menu show up in the control panel. This screenshot shows what the reload alias setup it looks like in the end.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |