Blades of Exile Documentation {#mainpage} ============================= This is the documentation for parts of the Blades of Exile source code. Currently it covers only the dialog engine. Defining a Dialog ================= Creating a new dialog consists of two basic steps: first, you have to create the XML dialog definition, and then you need to write the code to set it up and implement all the required callbacks. The format of the XML dialog files is defined by the schema in _rsrc/schemas/dialog.xsd_, but this document will cover what you need to know in a more readable manner. A dialog definition consists of a `` tag containing any number of tags representing various dialog controls. Each tag will be documented in some detail below. Common Attributes ----------------- The following attributes are allowed on all or most elements: * `top`, `left`, `width`, `height` - Specifies the location and bounding rect of the control within the dialog. All non-container controls support these attributes, and in fact the `top` and `left` attributes are required. Some controls may ignore the `width` and `height` attributes. * `def-key`, `key-mod` - Specifies the default keyboard shortcut for the control. See **Keyboard Shortcuts** below for more information on the format of these attributes. * `font`, `size`, `color`, `colour` - Specifies text attributes of the control. See **Text Formatting** below for details on accepted values. * `name` - Give the control a unique identifier which you can use to refer to it from the code. If omitted, the code will generate a random identifier. All controls support this attribute. * `fromlist` - Currently unused, but the intended use is to look up the control's text value in a string list (in _rsrc/strings_) The `` tag ------------------ The `` tag accepts the following attributes: * `skin` - Specify the dialog's background pattern. Currently only accepts `dark` or `light`. If omitted, a default is used which depends on whether the dialog is used in the game or the scenario editor. As such, this attribute should be omitted for most dialogs. * `debug` - This attribute is completely ignored by the game, but if set to `true`, the XSL stylesheet will draw the bounding rects of LEDs and other debug information. * `fore` - The default text colour. Generally this shouldn't be needed. * `defbtn` - The ID (`name` attribute) of the default button. This is an IDREF, so it must exist in the dialog. The `` tag ---------------- The `` tag can be used either for a non-editable text message or for a frame to group elements. Within a `` tag, you can use a `
` tag to insert a line break. See **Whitespace** for an explanation of the intended whitespace collapsing behaviour. The `` tag accepts the following attributes: * `framed` - Specifies whether a frame is drawn around the text. Can be either `true` or `false`; defaults to `false`. * `clickable` - Specifies that the text is clickable. This attribute is useless, as clickability is determined solely by having a click handler set in the code. * `fromlist`, `font`, `size`, `color`, `colour`, `def-key`, `key-mod` - See **Common Attributes** above. The `