1. #1

    Installer script

    Hi Guys,

    I'm trying to make a quick way to set all profiles for a UI in one go, so I made a mini-addon with a slash command. So far it all works fine with this script:

    Code:
    SLASH_KaitInstaller1 = "/kaitinstall";
    function SlashCmdList.KaitInstaller(msg)
     Grid.db:SetProfile("DPS 5/10man")
     SLDataText.db:SetProfile("Default")
     print("Success! All profiles installed. You now need to type /reload")
    end
    But as you can see, because some of the addons don't really set themselves up right until you reload the UI, I'll have to get people to type /kaitinstall and then /reload. What I'd like is for it to load the profiles then reload all in one move. BUT, when I add a Reload() at the end of the function like this...

    Code:
    SLASH_KaitInstaller1 = "/kaitinstall";
    function SlashCmdList.KaitInstaller(msg)
     Grid.db:SetProfile("DPS 5/10man")
     SLDataText.db:SetProfile("Default")
     ReloadUI()
    end
    ... it does reload the UI, but no longer sets the profiles. What am I doing wrong here? I suspect it's something fundamental/basic but I have no clue...

  2. #2
    I'm no lua guru but, I'm half decent with it so my two assumtions are (1) The reload is processing before the profile settings or (2) You're trying to set profiles before those addons are loaded and then it's reloading the ui thus never setting the profiles.

    If #2 is happening you should turn this slash command into an actual addon and set a list of your addons that you are setting up profiles for in the optional dependencies in the toc file. Then throw your slash command code into Main.lua.

    Dependencies and OptionalDependencies lists make the addons in those lists mandatory or optional as well as makes those addons load before yours.

    Code:
    ## Interface: 60000
    ## Title: AddOn_Name
    ## Version: 1.0
    ## Author: Kaitain
    ## OptionalDependencies: SLDataText, Grid
    
    Main.lua

    Off topic here... I do love your creations, I'm actually in the process of using your mage one but eliminating as much weakauras as possible and hard coding it using lua. :P

  3. #3
    Cool, thanks for the reply. The dependencies thing is a really good point. I'll add the list of addons in there (it will be a lot longer than 2 addons by the end, I'm just testing it with these 2).

    I think the problem might be issue number (1) though. The addons are definitely all loaded as I'm in-game looking at them before I type /kaitinstall. I tried to write some code to check that the profiles were set before the reload could happen but I messed it up and it didn't work...
    Last edited by Kaitain; 2014-12-16 at 09:18 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •