DICE PACKS BUNDLE
Page 1 of 2 12 Last
  1. #1
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    253

    Deriving windowclasses

    I noticed that I have 2 very similar windowclasses. The second has all the fields of the first with 2 differences: one of the fields (same type: formattedtextcontrol, same name) has a different width, a new field.
    I wonder if there is a way to derive the second windowclass from the first.
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    You could use windowclass merging - see this information in the ruleset developer portion of the FG Wiki: https://fantasygroundsunity.atlassia...-Class-Merging
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #3
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    253
    Uhm, if I understand correctly the Window Class Merging allows you to merge your class with one of a previous layer. The new class will have the same name as the previous one.
    In my case both classes are on the same layer and must have different names, otherwise it would be difficult to use the right one in the right place.

    Is it not possible to put windowclasses in a template?
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    Sorry, I didn't fully understand what you were asking before. Templates are only available for window controls: https://fantasygroundsunity.atlassia...or+code+re-use

    But, you can put the windowclass with the common controls in a subwindow and then use that as essentially a template within a windowclass. This is something the main FG rulesets have been moving to in some recent updates - using subwindow data to define frequently used controls within a windowclass.

    A simple example is the CoreRPG ruleset campaign\record_item.xml file - where the base definition for the item window is configured. This uses the following code within the main "item" windowclass:

    Code:
    			<subwindow_record name="main">
    				<class>item_main</class>
    				<activate />
    			</subwindow_record>
    With other controls defined outside of this subwindow.

    Then the "item_main" windowclass defines the controls that appear within that subwindow.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  5. #5
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    253
    It is not clear to me; I can use subwindows as controls, so I can "break" my windowclasses into multiple parts to be chained, right?
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  6. #6
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    Quote Originally Posted by Xarxus View Post
    It is not clear to me; I can use subwindows as controls, so I can "break" my windowclasses into multiple parts to be chained, right?
    Yes. For an example, please have a look at the CoreRPG files I referenced in post #4.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  7. #7
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    253
    Yes, I'm studing it. I've a lot to study... and to test

    Ty guy!
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  8. #8
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    253
    I don't know if it's a new feature or something I previously missed, but I think the solution to my problem is copy.
    The following code comes from the CoreRPG's record_npc.xml file. It's exactly what I needed. If I'm not
    mistaken it's not documented on the wiki.
    Code:
    <windowclass name="npc_header" copy="record_header_id_token" />
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  9. #9
    It's an undocumented feature right now; because we're still figuring out what the ramifications of the feature will be, the usefulness of the feature, and what problems might occur. We generally try to use features in our own code for several months or more to make sure that they work the way we would like them to work and that they are useful, before announcing and locking in APIs.

    Regards,
    JPG

  10. #10
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    253
    Quote Originally Posted by Moon Wizard View Post
    It's an undocumented feature right now; because we're still figuring out what the ramifications of the feature will be, the usefulness of the feature, and what problems might occur. We generally try to use features in our own code for several months or more to make sure that they work the way we would like them to work and that they are useful, before announcing and locking in APIs.

    Regards,
    JPG
    For what my opinion is worth, I think it's a very useful feature.
    I strongly support it.
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

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
  •  
Starfinder Playlist

Log in

Log in