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:
returns a string containing the current owner of a specific data line.
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.
just sets the text of a particular data line.
resets the owner and text of a particular data line be blank.
Updating of information takes place as part of the
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.
allows an OXP to register their callback function.
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
Let me know what you think, particularly if you think a different schema would be more appropriate.
For those who are interested, here is the code I used to create the screenshot in the Progress thread: CompressedF7Layout.oxz