FG Spreadshirt Swag
Page 17 of 17 First ... 7151617

Thread: Extend RMC

  1. #161
    Ardem's Avatar
    Join Date
    Nov 2011
    Location
    Sydney, Australia
    Posts
    920
    Thanks Willot for the test.

    Dakadin can you explain the issue just incase I mistaken replicate it.

  2. #162
    Quote Originally Posted by Ardem
    Thanks Willot for the test.

    Dakadin can you explain the issue just incase I mistaken replicate it.
    Normally when making a change for an extension, you take the code you want from the ruleset, modify it and include it in your extension. It then gets loaded after the ruleset so it replaces the functionality.

    In this case I needed to add a couple more desktop buttons so I used that same approach. The problem is the registerStackShortcut and registerDockShortcut functions are adding the buttons to the FG desktop. I copied the ManagementScript_Desktop.lua file to my extension and added my additional desktop buttons. This was causing FG to execute the button additions twice. There is a built in delay to wait until the window is ready to add the button so I think on some machines it would would get the 2 requests for the same button before the button was done waiting so it would only add it once. This is how it happens for the majority of the systems. For some systems, the 2nd instance of the button doesn't happen until after the wait is done and the 1st instance has already been added. So it would cause 2 of each button to show up. I put in code to check if it was already added and skip adding it but that was causing the issue that Willot encountered.

    I had a pretty good idea where it was being caused but I couldn't be sure until I could replicate the issue. Once I figure out the cause I moved the button registration for my new buttons to the extension onInit function and removed the ManagementScript_Desktop.lua file from the extension. Here is the code I added to the onInit function for the extension:

    Code:
    function onInit()
    	--Send extension startup text
    	RMCConstants.CopyrightText[#RMCConstants.CopyrightText+1]="Extend RMC v1.2.16";
    	
        if User.isHost() then
    	    DesktopManager.registerStackShortcut("button_modifiers", "button_modifiers_down", "Modifiers", "modifierlist");
    		DesktopManager.registerDockShortcut("button_battle", "button_battle_down", "Encounters", "battlelist", "battle");
    		DesktopManager.registerDockShortcut("button_notes", "button_notes_down", "Notes", "notelist", "notes");
        else
    		DesktopManager.registerStackShortcut("button_modifiers", "button_modifiers_down", "Modifiers", "modifierlist");
    		DesktopManager.registerDockShortcut("button_maps", "button_maps_down", "Maps & Images", "imagelist", "image");
    	end
    end
    Please let me know if you have any questions.

  3. #163
    Ardem's Avatar
    Join Date
    Nov 2011
    Location
    Sydney, Australia
    Posts
    920
    Makes sense the reason I ask is my Random window relies on an extra button plus an additional window on the desktop.

    Thanks for explaining, I will need to also make changes.

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
  •  
STAR TREK 2d20

Log in

Log in