Thread: Extend RMC
-
July 27th, 2012, 04:13 #161
Thanks Willot for the test.
Dakadin can you explain the issue just incase I mistaken replicate it.
-
July 27th, 2012, 07:53 #162
- Join Date
- Apr 2011
- Posts
- 2,254
Originally Posted by Ardem
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
-
July 28th, 2012, 07:49 #163
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