System Data Config (for Oolite v1.85ff)
Posted: Sat May 27, 2017 12:36 am
As part of a new feature in Oolite to allow OXP's to change the layout of the F7 screen, and even add their own information, I've created a small OXP that is designed to be a sort of traffic cop for OXP's, to help them determine what lines in the top section are free, and what lines are in use and by what OXP.
The OXP can be downloaded from here: SystemDataConfig.oxz (copy directly into your AddOns location) or SystemDataConfig.zip (extract the OXP folder to your AddOns location). Or you can download via the expansion pack manager.
There are a couple of functions OXP's can use:
Updating of information takes place as part of the
When the callbacks are executed, they will be passed
For those who are interested, here is the code I used to create the screenshot in the Progress thread: CompressedF7Layout.oxz
The OXP can be downloaded from here: SystemDataConfig.oxz (copy directly into your AddOns location) or SystemDataConfig.zip (extract the OXP folder to your AddOns location). Or you can download via the expansion pack manager.
There are a couple of functions OXP's can use:
worldScripts["oolite-system-data-config"].systemDataLineOwner(line_number)
returns a string containing the current owner of a specific data line.worldScripts["oolite-system-data-config"].systemDataLineText(line_number)
returns the current content of a particular line.worldScripts["oolite-system-data-config"].setSystemDataLine(line_number, text, owner)
sets the owner and text of a particular data line.worldScripts["oolite-system-data-config"].setSystemDataLine(line_number, text)
just sets the text of a particular data line.worldScripts["oolite-system-data-config"].resetSystemDataLine(line_number)
resets the owner and text of a particular data line be blank.Updating of information takes place as part of the
guiScreenWillChange
and infoSystemWillChange
events. But it can be difficult to determine the order in which OXP's will fire. To streamline this, some callback functions have been added to allow OXP's to register their callbacks, so the SystemDataConfig can call each of them before it does an update.worldScripts["oolite-system-data-config"].addChangeCallback(worldScriptName, callBackFunctionName)
allows an OXP to register their callback function.worldScripts["oolite-system-data-config"].removeChangeCallback(worldScriptName, callBackFunctionName)
will remove a callback function from the list of callbacks.When the callbacks are executed, they will be passed
- The type of callback, either "guiSystemWillChange", or "infoSystemWillChange"
- The "to" parameter from those events
- The "from" parameter from those events
For those who are interested, here is the code I used to create the screenshot in the Progress thread: CompressedF7Layout.oxz