Script: Community Plugin Configuration
Game: X3: Terran Conflict V2.5+
Required: Plugin Manager Lite
Make sure the Plugin Manager Lite is installed and setup. Then Download and install using the Manager
NOTE: This script is mainly for use for other scripts and can be included with them
- This script is designed to allow the community of a central location for thier configuration menus.
This creates a menu that lists all the scripts that have configuration, selecting them will open up the scripts own configuration menu.
- This script will only work if other scripts have been added to its list. To use it, simply set the hotkey and press it to open the menu.
if no menu opens, then most likly there is no configurable scripts available.
- To make use of the configuration menu, simply call the script, plugin.config.addscript, from your setup script.
It takes 3 arguments, the script name and script author (ie you) and the config script.
The menu will split the scripts into sections for each author and display the name, which you set as the first argument.
The 3rd argument, config script, is the string name of the script to run. Ie, you create your own script and type in the name of it here.
When your script is selected from the menu, it will run this script so you can have your own menu open up to do what ever config is required
The 4th is a boolen (true/false) if you want the author to be displayed
The 5th is the section you wish it to appear in, leaving this null will put it in the first section in the menu. Anything else will add a new section below to seperate your script from the rest
WARNING: When calling the config scripts, you must call them normalling, and not use START to create a new process, otherwise it could lock up someones game if they dont have this installed
- As well as adding your own package menu, you can also add single options.
There are currently 3 types of options you can add. The options will display the option in the menu, as well as thier current value. Selecting the value allows you to change the option.
All options have the same basic 4 arguments, these are:
Unique ID: This is a string id to identify your option from someone elses, can be anything you like
Option Text: This is the text of your option, and is what will be displayed on the menu
Setting Script: This is an optional script that can be run when your option is selected, althou until the packages, this is not needed. Scripts need 2 arguments, the first is the Unique ID, the second is the value its been set to
Section: Like with the package list, this allows you to add your option to a certain section in the menu
As said, when the user selects your option, the value will change depending on the type of option, you can use the script to do anything else you might need to
This is a simple On/Off switch, selecting it turns the option, on, or off.
To use this, you need to call the script, plugin.config.addboolean, which has the first 4 arguments above, plus the default value.
This is the value that it will start at, ie TRUE, or FALSE.
Selecting this option in the menu simply cycles between on and off.
This is an extension to the Boolean, but it allows you to cycle between more entries that you define.
To use this, you need to call the script, plugin.config.addcycle, The 5th argument is an array of your options. The default will be set to the first entry
When selecting this option, it will cycle between your available options from the array
This is simplar to the Cycle Option, its created in the same way, using the script, plugin.config.addselect. And uses the option array.
The difference with this options, is how the user selects it. Instead of cycling between the available options, it'll open a seperate menu with all the options for the user to pick.
If your scripts need to check the status of your values, there is a script you can call, plugin.config.getvalue, you send it your Unique ID, and it returns the currently set value
- You can also create your own menus, and have the menus open up from other menus. All scripts used to add options also now has a Menu Argument, this specifies the menu you want the option to be added to
Leaving this option blank, or null will add the options to the main menu (ie the same as normal)
Otherwise, you can set this to the unique menu id, and the option will then only display when viewing that specific menu.
To create a new menu to add your options in, you use the plugin.config.addmenu script, setting the unique menu id that you use to add menus too.
The menu will display the same as the scripts, with the name, and other display, but when selecting it, instead of running your script, it opens the menu and displays all items with the same menuid
If you want to open your created menu from your own scripts/menus, etc. Then you can call the 'plugin.config.displaymenu' script, with the menuid of your menu and your menu will then be displayed