Panel Element (Data)

From HLKitWiki
Revision as of 02:39, 4 December 2008 by Rob (Talk | contribs) (The "live" Element{{anchor|live}})

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Context: HL KitKit Reference … Data File Reference 

The "panel" Element

Panels contain one or more layouts and orchestrate the presentation of material for a specific region within HL. Panels are used to define the contents of the various tabs shown across the top for editing character data, as well as for summary panels shown on the right. Each panel is specified through the use of a "panel" element. The complete list of attributes for this element is below.

id Id – Specifies the unique id of the panel. This id is used in all references to the panel.
name Text – Public name associated with the panel. Maximum length of 50 characters.
order (Optional) Integer – Specifies the sequence in which this panel is displayed to the user. For a tab-based panel, this value controls the order in which the tabs are shown across the top. For a summary panel, this value controls the default order in which the summary panels are shown. Default: "0".
issummary (Optional) Boolean – Indicates whether this panel is intended for use as a summary panel or a tab-based panel. Default: "no".
marginhorz (Optional) Integer – Specifies the margin gap included at both ends along the horizontal axis. The usable width of the panel is the actual width minus double the horizontal margin. Default: "0".
marginvert (Optional) Integer – Specifies the margin gap included at both ends along the vertical axis. The usable height of the panel is the actual height minus double the vertical margin. Default: "0".
underlay (Optional) Text – Specifies the filename of a bitmap image that is blitted on top of the background and beneath all other visual elements within the panel. This bitmap file is assumed to reside within the data file folder for the game system. If empty, no underlay bitmap is utilized. Default: Empty.

The "panel" element also possesses child elements that define various facets of the panel. The list of these child elements is below and must appear in the order shown. Click on the link to access the details for each element.

live An optional "live" element may appear as defined by the given link. This element defines a Live Tag Expression that determines whether the panel is shown to the user.
layoutref Zero or more "layoutref" elements may appear as defined by the given link. This element specifies the individual layouts which are utilized within the panel.
position An optional "position" element may appear as defined by the given link. This element defines a Position Script through which the contained layouts are sized and positioned within the panel.

The "live" Element

The "live" element defines a Live Tag Expression for the panel, which determines whether the panel is shown. The tag expression is compared against the tags assigned to the container associated with the panel (e.g. the actor). If the tag expression is satisfied, the panel is visible, else it is hidden. For tab panels, hidden implies that the tab itself does not appear. The complete list of attributes for this element is below.

PCDATA TagExpr – Specifies the code comprising the Live tag expression.

The "layoutref" Element

The "layoutref" element identifies a layout used within the panel and assigns it a logical name for use within the Position script. The complete list of attributes for this element is below.

layout Id – Unique id of the layout to be utilized within the panel.
reference (Optional) Id – Specifies the alternate unique id to be used when referencing this layout within the Position script. This makes it possible to re-use the same layout more than once within the same panel, giving each instance a different logical id. If empty, the reference id is simply the layout id. Default: Empty.

The "position" Element

The "position" element defines a Position Script for the panel, which performs all the appropriate sizing and positioning of the contained layouts within the panel. The complete list of attributes for this element is below.

PCDATA Script – Specifies the code comprising the Position script.

Example

The following example demonstrates what a "panel" element might look like. All default values are assumed for optional attributes.

<panel id="basics" name="Basics" order="110"
    marginhorz="5" marginvert="5">
  <live>!HideTab.basics</live>
  <layoutref layout="basics"/>
  <position>
    ~script code goes here
    </position>
  </panel>