5E Character Create Playlist
Page 1 of 2 12 Last
  1. #1

    Join Date
    Mar 2020
    Location
    Sydney, Australia
    Posts
    247

    Can You Detect The Theme Being Loaded?

    Greetings,

    I have been working on an extension that is a "hotfix" style item which makes modifications to different things in a ruleset that I need fixed but they do not warrant a complete extension/module/theme.

    For example in the theme I use, one of the frames was overlooked and it does not match the rest of the theme. So my hotfix replaces that frame and all is good.

    However I was just wondering if I could detect the theme being loaded and only activate the frame hotfix as needed.
    Thanks In Advance,
    D

  2. #2
    I think the best you could do is check which extensions are loaded, and look for your theme in that list.
    The problem would be that if 2 themes are loaded (can happen) then you wouldn't know which one is active.

    Cheers, Steve.

  3. #3

    Join Date
    Mar 2020
    Location
    Sydney, Australia
    Posts
    247
    Yes, the check if extension is loaded would work perhaps, however themes are treated as extensions and hence there is no true detection of a Theme versus a straight Extensions.
    Thanks In Advance,
    D

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,408
    Yes, themes are extensions.

    You mention a hotfix for a specific theme. As you'll know the name of that specific theme, then check for an extension with that name being loaded.
    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

    Join Date
    Mar 2020
    Location
    Sydney, Australia
    Posts
    247
    That would work, however if the theme in question is the default theme for the ruleset, I would need to check if another theme is being loaded (let us assume the word Theme is used somewhere), and not load the hotfix.

    If the hotfix uses the <framedef> tag to replace one of the frames in the default theme and then I load a new theme ... my hotfix would replace that frame on the new loaded theme as well ... so how would I make that frame conditional on if a theme is loaded - lets assume I can search for the word Theme in the loaded extension.
    Thanks In Advance,
    D

  6. #6
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,408
    You can't change the underlying framedef XML code programmatically. You change things like this by loading an extension that changes/merges the code.

    What you could do is have a frame with a different name in your hotfix, and change to that frame in code using https://fantasygroundsunity.atlassia...ntrol#setFrame or https://fantasygroundsunity.atlassia...tance#setFrame

    It will all depend exactly where this frame is used.
    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

    Join Date
    Mar 2020
    Location
    Sydney, Australia
    Posts
    247
    Quote Originally Posted by Trenloe View Post
    You can't change the underlying framedef XML code programmatically. You change things like this by loading an extension that changes/merges the code.

    What you could do is have a frame with a different name in your hotfix, and change to that frame in code using https://fantasygroundsunity.atlassia...ntrol#setFrame or https://fantasygroundsunity.atlassia...tance#setFrame

    It will all depend exactly where this frame is used.
    Thank you for that information ... I did not realise I could do that programatically ... I will give it a go and see how it goes.

    On a related but side query ... are there plans to add a new tag to the extension header? A new tag like <type>Theme</type> would go a long way not only in my case but for a lot of other situations.
    Thanks In Advance,
    D

  8. #8
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,408
    Quote Originally Posted by UrsaTeddy View Post
    On a related but side query ... are there plans to add a new tag to the extension header? A new tag like <type>Theme</type> would go a long way not only in my case but for a lot of other situations.
    It's been raised before, but I don't know the dev's exact plans.

    Anything like this relies on the developer to actually use it. And if only 80% of them do, it can still cause issues if other devs rely on it being used 100% of the time.

    There has been a drive among the SmiteWorks product developers to use a naming convention (starting the extension name with "Theme:" in this case) which would kind-of support what you're asking.
    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!

  9. #9
    Trenloe is correct. We have started to have a standardized naming for our official extensions. This is the internal guidelines we are currently implementing. We welcome community developers to mimic this to help keep things organized.

    Categories
    • Decal - For decal extensions
    • Dev - For developer-focused extensions
    • Feature - For extensions that modify the behavior of a ruleset, but not theming
    • Setting - For extensions that apply theme and feature changes to a ruleset to enable a specific setting in a game system
    • Theme - For extensions that only modify graphical elements


    Naming formats
    • Decal: <Publisher (or System if official)> - <Name>
    • Dev: <Name>
    • Feature: <Name>
    • Setting: <Name>
    • Theme: <System (short version)> - <Name>
    Dominic Morta
    Ruleset Developer
    Smiteworks

    How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it

    How to provide an Unity Connection issue?-Connection Issues and What to Provide

    Unity Updater issue?-Updater Issues

    Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained

    Comcast or Cox ISP User?-Comcast XFinity and Cox Users

    Have a suggestion?-Feature Request

  10. #10

    Join Date
    Mar 2020
    Location
    Sydney, Australia
    Posts
    247
    Quote Originally Posted by Trenloe View Post
    It's been raised before, but I don't know the dev's exact plans.

    Anything like this relies on the developer to actually use it. And if only 80% of them do, it can still cause issues if other devs rely on it being used 100% of the time.

    There has been a drive among the SmiteWorks product developers to use a naming convention (starting the extension name with "Theme:" in this case) which would kind-of support what you're asking.
    I would argue that instead of "optional" tagging it be made a "Requirement". It would not be hard to update older extensions as needed - it would only be one or two tags at most and I am guessing that Original FG would ignore the tags whereas FGU would require them.

    Of course I do not know your code base or if you're internally using DTDs in the code or not.
    Thanks In Advance,
    D

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