Refer a Friend
Page 35 of 35 First ... 25 33 34 35
  1. #341
    Hi - I had a request to make one of my extensions compatible with Better Menus. I added the addMenuItem call like this:

    Code:
    function onTabletopInit()
       if Session.IsHost then
          local tButton = { sIcon = "FF_Icon", tooltipres = "FF_title", class = "fishing_tournament_window", path = DB_ROOT };
          DesktopManager.registerSidebarToolButton(tButton, 8);
    
          if MenuManager then
             MenuManager.addMenuItem("fishing_tournament_window", DB_ROOT, "Open the Fishing Fun UI", "Fishing Fun");
          end
       end
    end
    It works, but it ends up adding two menu entries. Did I do something wrong?

    menus-issue.png

    Not sure if it matters, but this is for 5E.
    DISCORD / EXTENSIONS:
    Combat: Crit Dmg Options, Effect FX, Enlarge/Reduce, Flavorful Names, Hidden Death Saves, Lingering Injuries (PL), Major Injuries (DK), Special Dmg FX, Spell FX, Summoner, Weapon Dmg Props
    Skills: Crits & Fumbles, Fail Forward, Toolkit Actions
    DM Tools: DB Search, Dynamic Pricing, Party Info, Redacted Table Fields
    For Fun: Achievement Tracker, Boar Riding, Dragon Cards, Drink & Sink, Fishing Fun, Seven Seas, Tarot, Turtle Race
    Puzzles: Cryptex, Volvelle, Word Key

  2. #342
    Quote Originally Posted by jkeller View Post
    Hi - I had a request to make one of my extensions compatible with Better Menus. I added the addMenuItem call like this:
    It works, but it ends up adding two menu entries. Did I do something wrong?

    menus-issue.png

    Not sure if it matters, but this is for 5E.
    Try not adding it and see what happens. It looks like it detected a menu and added it and then you're adding it again.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset FGU Reference Module, or Web.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  3. #343
    If I don't call it, I get no menus. If I call it, I get both. When selected, both open my window.
    DISCORD / EXTENSIONS:
    Combat: Crit Dmg Options, Effect FX, Enlarge/Reduce, Flavorful Names, Hidden Death Saves, Lingering Injuries (PL), Major Injuries (DK), Special Dmg FX, Spell FX, Summoner, Weapon Dmg Props
    Skills: Crits & Fumbles, Fail Forward, Toolkit Actions
    DM Tools: DB Search, Dynamic Pricing, Party Info, Redacted Table Fields
    For Fun: Achievement Tracker, Boar Riding, Dragon Cards, Drink & Sink, Fishing Fun, Seven Seas, Tarot, Turtle Race
    Puzzles: Cryptex, Volvelle, Word Key

  4. #344
    Even if the code is just...

    Code:
    function onTabletopInit()
       if Session.IsHost then
          local tButton = { sIcon = "FF_Icon", tooltipres = "FF_title", class = "fishing_tournament_window", path = DB_ROOT };
          DesktopManager.registerSidebarToolButton(tButton, 8);
       end
    end
    DesktopManager.registerSidebarToolButton internally adds the button record to Desktop.aCoreDesktopDockV4["live"]. BetterMenus' createMenuSelections() automatically iterates that exact list to populate the dropdown.

    I expect if you use one or the other it'll be there just once.
    Last edited by celestian; February 20th, 2026 at 02:18.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset FGU Reference Module, or Web.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  5. #345
    If I just use registerSidebarToolButton, then I don't see it in the menu. All I did was comment-out the addMenuItem call.

    if I have both, I see the 2 menu items.

    Anything else I could try?
    DISCORD / EXTENSIONS:
    Combat: Crit Dmg Options, Effect FX, Enlarge/Reduce, Flavorful Names, Hidden Death Saves, Lingering Injuries (PL), Major Injuries (DK), Special Dmg FX, Spell FX, Summoner, Weapon Dmg Props
    Skills: Crits & Fumbles, Fail Forward, Toolkit Actions
    DM Tools: DB Search, Dynamic Pricing, Party Info, Redacted Table Fields
    For Fun: Achievement Tracker, Boar Riding, Dragon Cards, Drink & Sink, Fishing Fun, Seven Seas, Tarot, Turtle Race
    Puzzles: Cryptex, Volvelle, Word Key

  6. #346
    Sorry, nothing comes to mind immediately and im not home to dig deeper into the code for a week. I was certain it would be the discovery bit.

    The other option is try...

    Code:
    function onTabletopInit()
       if Session.IsHost then
          if MenuManager then
             MenuManager.addMenuItem("fishing_tournament_window", DB_ROOT, "Open the Fishing Fun UI", "Fishing Fun");
          end
       end
    end
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset FGU Reference Module, or Web.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  7. #347
    Thanks for the responses. That works fine as long as I have Better Menus. But if not, then of course it doesn't show up in the sidebar. That's not really an option.

    I can use if/else; it does what I want as long as Better Menus loads first. Do you specify a load order? I typically don't for mine (which I think means it defaults to 50).

    Code:
    function onTabletopInit()
       if MenuManager then
          MenuManager.addMenuItem(EXT_UI, DB_ROOT, "Open the Boar Riding (festival event) UI", "Boar Riding");
       else
          local tButton = { sIcon = "BR_Icon", tooltipres = "BR_title", class = EXT_UI, path = DB_ROOT };
          DesktopManager.registerSidebarToolButton(tButton, 8);
       end
    end
    DISCORD / EXTENSIONS:
    Combat: Crit Dmg Options, Effect FX, Enlarge/Reduce, Flavorful Names, Hidden Death Saves, Lingering Injuries (PL), Major Injuries (DK), Special Dmg FX, Spell FX, Summoner, Weapon Dmg Props
    Skills: Crits & Fumbles, Fail Forward, Toolkit Actions
    DM Tools: DB Search, Dynamic Pricing, Party Info, Redacted Table Fields
    For Fun: Achievement Tracker, Boar Riding, Dragon Cards, Drink & Sink, Fishing Fun, Seven Seas, Tarot, Turtle Race
    Puzzles: Cryptex, Volvelle, Word Key

  8. #348
    It loads last, 999 I believe.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset FGU Reference Module, or Web.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  9. #349
    I think it might work as long as I do it in onTabletopInit, not onInit.
    DISCORD / EXTENSIONS:
    Combat: Crit Dmg Options, Effect FX, Enlarge/Reduce, Flavorful Names, Hidden Death Saves, Lingering Injuries (PL), Major Injuries (DK), Special Dmg FX, Spell FX, Summoner, Weapon Dmg Props
    Skills: Crits & Fumbles, Fail Forward, Toolkit Actions
    DM Tools: DB Search, Dynamic Pricing, Party Info, Redacted Table Fields
    For Fun: Achievement Tracker, Boar Riding, Dragon Cards, Drink & Sink, Fishing Fun, Seven Seas, Tarot, Turtle Race
    Puzzles: Cryptex, Volvelle, Word Key

Page 35 of 35 First ... 25 33 34 35

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
  •  
Fantasy Grounds Merchandise

Log in

Log in