Difference between revisions of "GNN Doc"
m (Added new functionality _addExtImages) |
m (Added code tags) |
||
Line 1: | Line 1: | ||
__TOC__ | __TOC__ | ||
− | The recommended way in [[GNN]] is passing news through _insertNews(). | + | The recommended way in [[GNN]] is passing news through <code>_insertNews()</code>. |
== Console usage == | == Console usage == | ||
Line 9: | Line 9: | ||
== Functions == | == Functions == | ||
=== _insertNews(obj) === | === _insertNews(obj) === | ||
− | Puts the passed object in the display pools. The object must contain at least .ID and .Message. Use at startUpComplete or later. | + | Puts the passed object in the display pools. The object must contain at least .ID and .Message. Use at <code>startUpComplete</code> or later. |
:;ID: String. worldScript name. | :;ID: String. worldScript name. | ||
− | :;Message: String. Text to be displayed. GNN will try to expand it via expandMissionText. | + | :;Message: String. Text to be displayed. GNN will try to expand it via <code>expandMissionText</code>. |
− | :;DKey: Bool. If set expandDescription will be used on Message. | + | :;DKey: Bool. If set <code>expandDescription</code> will be used on Message. |
:;Priority: Number (1..5), Default: 3. Used to sort messages. | :;Priority: Number (1..5), Default: 3. Used to sort messages. | ||
:;Agency: Number. 1=GNN, 2=Rooters, 3=Snoopers, 4=Chronicle. | :;Agency: Number. 1=GNN, 2=Rooters, 3=Snoopers, 4=Chronicle. | ||
− | :;Pic: String. Overlay, Default:{name:'GNN_clean.png',height:512}. Needs alpha channel for Model. | + | :;Pic: String. Overlay, Default:<code>{name:'GNN_clean.png',height:512}</code>. Needs alpha channel for Model. |
:;PicExt: String. worldScript name which expanded the picture pool. | :;PicExt: String. worldScript name which expanded the picture pool. | ||
:;Music: Music for Newsflash. Default:'GNN.ogg'. | :;Music: Music for Newsflash. Default:'GNN.ogg'. | ||
Line 39: | Line 39: | ||
=== _showScreen(obj) === | === _showScreen(obj) === | ||
− | Displays the passed GNN object immediately. Requires to be docked and !system.isInterstellarSpace. Callbacks are disabled. Use at startUpComplete or later. | + | Displays the passed GNN object immediately. Requires to be docked and !system.isInterstellarSpace. Callbacks are disabled. Use at <code>startUpComplete</code> or later. |
=== _addExtImages(arr,ws) === | === _addExtImages(arr,ws) === | ||
− | Expands the pool of overlay images. Use at startUpComplete or later. {{AV|1.1}} | + | Expands the pool of overlay images. Use at <code>startUpComplete</code> or later. {{AV|1.1}} |
:;arr: Array. Must hold Arrays for all 4 Agencies, e.g [[],[],[],[]] (order GNN, Rooters, Snoopers and Chronicle) containing filenames. The arrays can be empty. The images should be 1024px * 512px with the cutout in the upper right corner for displaying models. | :;arr: Array. Must hold Arrays for all 4 Agencies, e.g [[],[],[],[]] (order GNN, Rooters, Snoopers and Chronicle) containing filenames. The arrays can be empty. The images should be 1024px * 512px with the cutout in the upper right corner for displaying models. | ||
− | :;ws: String. worldScript name to relate news to expansion images (see | + | :;ws: String. worldScript name to relate news to expansion images (see PicExt). |
Revision as of 21:42, 24 February 2018
Contents
The recommended way in GNN is passing news through _insertNews()
.
Console usage
worldScripts.GNN._Help(); |
Functions
_insertNews(obj)
Puts the passed object in the display pools. The object must contain at least .ID and .Message. Use at startUpComplete
or later.
- ID
- String. worldScript name.
- Message
- String. Text to be displayed. GNN will try to expand it via
expandMissionText
. - DKey
- Bool. If set
expandDescription
will be used on Message. - Priority
- Number (1..5), Default: 3. Used to sort messages.
- Agency
- Number. 1=GNN, 2=Rooters, 3=Snoopers, 4=Chronicle.
- Pic
- String. Overlay, Default:
{name:'GNN_clean.png',height:512}
. Needs alpha channel for Model. - PicExt
- String. worldScript name which expanded the picture pool.
- Music
- Music for Newsflash. Default:'GNN.ogg'.
- Model
- String. Role of the model. Default:'lib_ms_helper'.
- Pos
- Array. Position for Model.
- Ori
- Array. Orientation for Model.
- Spin
- Bool. Sets spinModel. Default:false.
- AutoPos
- Bool. Automagically sets the position and orientation.
- Tex
- String. Sets the texture.
- Mat
- Object. Sets the material.
- Delay
- Number. Number of days until the newsflash will be available.
- CB
- String. Path of callback function.
A simple example:
worldScripts.GNN._insertNews({ID:'BGS',Message:'Hello'});
GNN applies some rules in the following order:
- Agency disables Pic
- Model disables Tex
- !Model disables Ori and Pos.
- !Pos enables AutoPos.
_showScreen(obj)
Displays the passed GNN object immediately. Requires to be docked and !system.isInterstellarSpace. Callbacks are disabled. Use at startUpComplete
or later.
_addExtImages(arr,ws)
Expands the pool of overlay images. Use at startUpComplete
or later. Added in v1.1
- arr
- Array. Must hold Arrays for all 4 Agencies, e.g [[],[],[],[]] (order GNN, Rooters, Snoopers and Chronicle) containing filenames. The arrays can be empty. The images should be 1024px * 512px with the cutout in the upper right corner for displaying models.
- ws
- String. worldScript name to relate news to expansion images (see PicExt).
shipdata.plist
GNN uses a script_info key in shipdata.plist to decide if the interface should be shown. Set 'GNN' to true for stations. By default only main stations and stations with hasNPCTraffic set will get an interface. Stations in interstellar space are excluded.
script_info = {GNN = true;};