DICE PACKS BUNDLE
  1. #1

    category selection control

    Is there any method that can be used to count the number of categories present in a windowlist?

    I would like to be able to resize the window so that all category tabs are always displayed when the containing window is opened - currently it is not always obvious that there are extra tabs that are hidden off the edge of the window.

  2. #2
    Zeus's Avatar
    Join Date
    Mar 2009
    Location
    Olympus
    Posts
    2,658
    Blog Entries
    2
    How about looping through the database nodes using ipairs and count/comparing the category nodes e.g.

    Code:
    local count = 0;
    for k,v in pairs (getDatabaseNode().getChildren()) do
      if v.getName() == "category" then
         count = count + 1;
      end
    end
    FG Project Development
    Next Project(s)*: Starfinder v1.2 Starship Combat

    Current Project:
    Starfinder v1.1 - Character Starships
    Completed Projects: Starfinder Ruleset v1.0, Starfinder Core Rulebook, Alien Archive, Paizo Pathfinder Official Theme, D&D 5E data updates
    * All fluid by nature and therefore subject to change.

  3. #3
    Hi DrZ thanks for the reply.

    I tried something similar before, but it appears category nodes are not counted as children. The above would return 0

    if you do something like print(DB.findNode("encounter").getChildCount())
    the number returned matches the number of encounters the categories appear to be ignored.

  4. #4
    Zeus's Avatar
    Join Date
    Mar 2009
    Location
    Olympus
    Posts
    2,658
    Blog Entries
    2
    Hmm, not sure then. I guess you would have to request an API change. i.e. something like access methods for windowlists like

    - getCategories() returns a table of strings
    - getCategoryCount() returns integer count of categories
    FG Project Development
    Next Project(s)*: Starfinder v1.2 Starship Combat

    Current Project:
    Starfinder v1.1 - Character Starships
    Completed Projects: Starfinder Ruleset v1.0, Starfinder Core Rulebook, Alien Archive, Paizo Pathfinder Official Theme, D&D 5E data updates
    * All fluid by nature and therefore subject to change.

  5. #5
    Yeah thats what I figured, but I think M_W probably has enough on his plate without working on something with such limited use.

    I just wondered if anyone had found a workaround.
    Its not really a big issue.

    anyway thanks for your help.

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
  •  
5E Product Walkthrough Playlist

Log in

Log in