FG Spreadshirt Swag
  1. #1

    Adding modifier button to an existing category

    Hi

    I have a problem adding new modifier buttons to an already existing category. 3.5E/PF1 has a damage category for modifiers in the modifier window (crit and half buttons). I tried using ModifierManager.addModWindowPresets, but I do not know how to add to an existing category (creating a new category is no problem). If I simply add the category damage to my preset, then I get the button but it will have an additional category with the label damage rather than having an additional button at the already existing category

    Is my idea even possible without overwriting existing code?

    Thanks

    Best wishes

    Kelrugem

  2. #2
    There's not a clean way right now. In the next ruleset release, I'll add this function:
    ModifierManager.addModWindowPresetButton(sCategory , sButtonID, [nPosition])
    where nPosition is optional and sCategory is created if it doesn't exist already.

    You'll still need to register the string resources either way.

    Regards,
    JPG

  3. #3
    Quote Originally Posted by Moon Wizard View Post
    There's not a clean way right now. In the next ruleset release, I'll add this function:
    ModifierManager.addModWindowPresetButton(sCategory , sButtonID, [nPosition])
    where nPosition is optional and sCategory is created if it doesn't exist already.

    You'll still need to register the string resources either way.

    Regards,
    JPG
    Nice, thank you very much for adding this in the next ruleset release

  4. #4
    I did something like that in the Nat20 extension, but it doesn't add it to the existing Damage category. It works though:


    This went in the XML:

    Code:
    	<!-- MODIFIERS -->
    	<string name="modifier_category_custom">Special Critical Damage</string>
    	<string name="modifier_label_DMG_NAT20">Nat20</string>
    and this went in the init function:

    Code:
        _specialDamageModifierWindow =
        {
            { 
                sCategory = "custom",
                tPresets = { 
                    "DMG_NAT20",
                }
            },
        }
    
        ModifierManager.addModWindowPresets(_specialDamageModifierWindow)
    That put the modifier in it's own category called "Special Critical Damage"

    You could do that for now.

    Sorry, after all that, I saw that you were already doing this...doh!

  5. #5
    Quote Originally Posted by TheoGeek View Post
    Sorry, after all that, I saw that you were already doing this...doh!
    Hehe, no worries, I appreciate your help

  6. #6
    To report back: The new API works very well I really like it Immediately added more buttons

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