Transcendence Wiki

Documenting the Universe.

User Tools

Site Tools


modding:xml:dockscreen

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

modding:xml:dockscreen [2012/03/17 01:18]
127.0.0.1 external edit
modding:xml:dockscreen [2012/06/30 17:46] (current)
rpc
Line 1: Line 1:
 +Discuss this page on this page's [[DockScreen Talk Page|Talk Page]].
  
 +FIXME Please correct any inaccuracies.
 +
 +===<DockScreen>===
 +
 +Dockscreens are powerful tools which can be used to display information to the player. When you dock with a station or wreck, what you are seeing is a dockscreen. Dockscreens can be used to play out a story, show data, and allow the player to trigger scripted events.
 +
 +From the [[http://xelerus.de/index.php?s=mod&id=324|XML'd elementDocument]]
 +<code XML>
 +<DockScreen Attributes="UNID,name,type,backgroundID,desc" >
 + <InitialPane></InitialPane>
 + <ListOptions Attributes="dataFrom,list,initialItem"></ListOption>
 + <OnInit></OnInit>
 + <Panes>
 + <* Attributes="desc,noListNavigation,showCounter,showTextInput" >
 + <Actions>
 + <Action Attributes="name,key,default,cancel,nextKey,prevKey" >
 + <Exit/>
 + <Navigate Attributes="screen" />
 + <ShowPane Attributes="pane" />
 + </Action>
 + </Actions>
 + <*/>
 + </Panes>
 +</DockScreen>
 +</code>
 +A dockscreen's code looks something like this: 
 +<code XML>
 +<DockScreen UNID="&dsPlanetRefuseDock;" name= "=(objGetName gSource)">
 +
 + <Panes>
 + <InitialPane desc= "If you attempted to land on a planet without re-entry equipment, you would burn up and/or crash. Both result in death.">
 + <Actions>
 + <Action name="Continue" imageID="&rsItemListScreen;" imageIndex="0" cancel="1" key="C">
 + <Exit/>
 + </Action>
 + </Actions>
 + </InitialPane>
 + </Panes>
 +</DockScreen>
 +</code>
 +
 +That code is from [[..:users:Schilcote|Schilcote's]] [[http://xelerus.de/index.php?s=mod&id=124|Dockable Planets]] mod.
 +
 +[[modding:xml:dockscreen]] desc="">, the name of the pane is InitialPane. The desc="" is the text you see when you view the pane. Then, inside the pane's tags, you have the Action tag. Actions are the little pieces of text which run script when clicked on, or their key is pressed. The name="" of an action is the text displayed. The cancel="" is a boolean value which decides whether the action is triggered when the user presses ESC, and the key="" decides what keyboard key should choose this action.
 +
 +The <[[Initialize]]> element is evaluated: \\
 +1. Whenever the pane is displayed (e.g., ([[..:functions:scrShowPane]]) or something). \\
 +2. Whenever the player moves the cursor in the list.
 +
 +===Sub elements, attributes and globals===
 +
 +The following are temporary [[..:functions:globals]] available within the DockScreen element.
 +
 +  * gBuyCriteria
 +  * gCost
 +  * gItem
 +  * gMargin
 +
 +Example
 +
 +Here we see gMargin used within the ListOptions element in the dockscreen dsExchangeBuy from Transcendence.xml
 +
 +<code xml>      <ListOptions
 +            dataFrom=   "station"
 +            list=      "*"
 +            >
 +         (switch
 +            (not gMargin)
 +               (scrSetListFilter gScreen intComputeSellPrice)
 +
 +            (isfunction gMargin)
 +               (scrSetListFilter gScreen gMargin)
 +
 +            (scrSetListFilter gScreen "*")
 +            )
 +      </ListOptions></code>
 +
 +  * gPrevScreen
 +  * gPrevPane
 +  * gBonus
 +=== List Options ===
 +[[modding/xml/listoptions|List Options]] This is how you build custom dockscreens and what they have on the left side of the screen.
 +Go back to list of [[..:XML|tags]]
modding/xml/dockscreen.txt · Last modified: 2012/06/30 17:46 by rpc