DICE PACKS BUNDLE
  1. #1

    Undocumented Tags?

    Hi all,

    I'm busy looking at Templates - more specifically, templates created from genericcontrol.

    In the 'common_templates.xml' file I see this:
    Code:
    <template name="checkbox">
       <genericcontrol>
          <stateicons>
             <on>indicator_checkon</on>
             <off>indicator_checkoff</off>
          </stateicons>
          <script file="scripts/template_checkbox.lua" />
       </genericcontrol>
    </template>
    Its pretty self-explanatory when looked at in context, but when you compare it to the Reference Documentation, you start noticing the problem. In the documentation, genericcontrol only has two tags - icon, and iconcolor. Ahh, but it inherits from windowcontrol so it has a lot more, but neither genericcontrol nor windowcontrol contain the stateicons or script tags.

    So, is it safe to assume that any tag not defined in the reference documentation is a custom property? If so, how does FG know what to do with it internally ???

    Any help would be appreciated.

  2. #2
    Yes it is safe to assume that although with the case of the script tag its just not defined as such as its more of a global thing that applies in a variety of places.

    But in the case above of StateIcons is just a custom property that the scriptfile makes use of. Essentially custom properties are only really useful with the LUA scripting and you can get access to them very easily.

  3. #3
    Thanks joshuha.

    So, to clarify:
    1. Any 'control' can have a script.
    2. Any 'control' can have custom tags, which are essentially ignored by FG, and only used in an accompanying script.

    Am I right?

  4. #4
    Correct although ignored is probably not the right word. They are still processed and are sitting in memory but FG obviously doesn't do anything with them. They are only used for scripting purposes who can access the XML tags and their values.

  5. #5
    Foen's Avatar
    Join Date
    Jan 2007
    Location
    Suffolk, England
    Posts
    2,007
    It is also worth noting that the tags use the same namespace as the object they declare: to be more specific, you can get unintentional collision between a tag name and, say, an event handler.

    For example:

    <mycontrol><onInit>somevalue</onInit></mycontrol>

    Will cause a collision between the custom tag <onInit/> and the event handler onInit(). It will usually end in tears.

    Stuart
    (Foen)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Dungeons & Dragons 2024 Core Rulebooks Pre-Order

Log in

Log in