Page 2 of 2 First 12
  1. #11
    @Moon Wizard: What is your opinion of making the default parameters optional?

    Right now if the <defaulticon> and <defaulttooltip> (or <defaulttooltipres>) are not present, then the lua script throws errors.
    But if I handled those issues....

    (preliminary thinking is) In onInit() if the default parameters aren't in the XML set a flag. Then whenever the modular scoped variable cycleindex cycles to zero, bump it to one based on the no defaults flag==true.

    The index would run from 1 to #icons, instead of 0 to #icons, which is fine.
    All defined icons would have string values associated with the icons and numeric indexes.
    The database I/O and data would be fine. The field and its value (""), for <defaulticon> is not written to the DB. If the field is missing in db.xml, then during DB read the missing data defaults to <defaulticon> for that data item (value="", cyclerindex=0).
    Nothing in existence in any ruleset would have to change since (I assume) all current controls using <button_iconcycler> have <defaulticon>defined.
    Going forward it would be okay not to use <defaulticon> and <defaulttooltip> (or <defaulttooltipres>)


    [EDIT] Oops. It doesn't throw errors. The control appears to not initialize or be invisible. But that's not true, it's there just doesn't have an icon, so it looks invisible.
    Last edited by Minty23185Fresh; February 14th, 2018 at 15:46.
    Currently Playing
    as an Avariel Mystic in a Storm King campaign.
    Current Projects:
    Field Filters for All Libraries (Extension)
    Development of a for sale, DMG, 5e adventure.
    Community Contributions:
    Mystic Class Implementation (Extension and Module),
    "Mitigating Extension Conflicts Methodology" proposal & "A Neophyte Tackles the FG Extension" - A tutorial blog series.

  2. #12
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    GMT -7
    Posts
    4,565
    Blog Entries
    9
    Quote Originally Posted by Minty23185Fresh View Post
    There is currently no Wiki page for this esoteric little control. At least not one that I could easily find. It is simply a little undocumented template. Many templates like this are based on other controls which are documented, so addition documentation is not needed. This guy is a little different than most. Maybe its sister control, stringcycler or textcycler (can't remember the name) has documentation.

    But if I do a proper job on this Moon Wizard might bring it in to the ruleset anyway, so this discussion might be moot.

    I guess the pressure is on.
    Just let me know if you end up wanting to document it.

    Current Projects: Undermountain 5E, Messengers (BDC-2), Altar of Destiny
    Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets
    DMsGuild Content: Balance Disturbed (Adventure), Dungeon Room Descriptions
    FG Product Reviews: Virtual Scribe Reviews

  3. #13
    Quote Originally Posted by Minty23185Fresh View Post
    @Moon Wizard: What is your opinion of making the default parameters optional?
    This methodology looks great. It provided the functionality I desire. Works with old db.xml. Works with templates/controls that do have <defaulticon> defined. Yada, yada, yada.

    One small function, and about six other code changes (e.g. XXX = 0; becomes XXX = myNewFunction(); )

    I'll publish here for your perusal (and consumption, if desired), after a bit more testing.
    Currently Playing
    as an Avariel Mystic in a Storm King campaign.
    Current Projects:
    Field Filters for All Libraries (Extension)
    Development of a for sale, DMG, 5e adventure.
    Community Contributions:
    Mystic Class Implementation (Extension and Module),
    "Mitigating Extension Conflicts Methodology" proposal & "A Neophyte Tackles the FG Extension" - A tutorial blog series.

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Log in

Log in