Fantasy Grounds Merchandise
  1. #1

    How to change datasource

    I'm adding a new tab to the character sheet, and the db node is automatically set to the character sheet, which is fine - I'm going to need that context.
    But then I want to change the datasource of the subwindow to a reference node that is not part of the character to populate the contents of the subwindow.

    Is this possible? I can't find a setDatabaseNode function to use.
    I.e. in oninit changing the datasource.

    Sorry if this is an uneducated question. I am just starting with extensions.

  2. #2
    While you could do it, it seems like it would be highly likely to be confusing to users and prone to errors. In scenarios where you want to drill into another data source, I recommend having a like open the detail window for the new source (similar to gear symbols in 5E ruleset).

    JPG

  3. #3
    Thank you for the reply.

    The use case is that I would like to have an alchemy crafting window like bg3.

    So I would like a tab that fetches a node tree in the database containing all the crafting recipes. Then when you click craft it will remove the ingredients from the inventory of the character and add for example a potion or something.

    So I need both access to the character and a node tree containing crafting recipes.

    I feel it makes sense to have that as a tab rather than popping out a new window if possible.

    You mentioned that there was a way to change the datasource. Any chance you could share how, or is it so in conflict with the design of the architecture that it's a complete nono?

  4. #4
    Up to you how you want to approach; just mentioning what's going to be easier. The window you're making sounds a lot like the 5E Item Forge, which is a separate window.

    Again, even if you need the character for the window, you are better off opening as a separate window rather than trying to replace the tabs.

    * If you replace the tabs from the highest level (name plus content), you will have to keep track of the state to make sure that the tab shows the correct state. I think you definitely want to avoid this, because it's confusing for the user and would easily be broken if anything in the CoreRPG layer changes.
    * If you want to replace the tabs from one level lower (no name change only content), you can create a high-level content subwindow for that tab, which you can includes one or more subwindows which you can swap out the value on, using subwindow.setValue.
    * I highly recommend not messing with existing tabs ("main", "skills", "inventory", "notes") in existing rulesets; as several extensions assume things are in those UI paths. This is only relevant if you're writing extension, and not relevant if you're writing ruleset.

    Regards,
    JPG

  5. #5
    Thank you for all the help Moon Wizard.

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 Character Create Playlist

Log in

Log in