1. #1

    Technical question on an addon loading profiles with reflux easier

    I have 2 questions in 1 post.

    I'm not sure this is possible however it would be amazing if it is. Is it possible to create a kgpanel which when you press it, it acts as a macro? For example if you press it, it does a slash command. My idea in mind is to make a dialog box (because I'm terrible at coding and can't make my own addon) which asks for me to load up a UI by pressing a button which does a /reflux switch "profile name" command with the reflux addon.

    If not then I'm open to other ideas. I've tried nibProfileLoader addon which lets you load a profile on login if it detects a new character which is perfect however I want to do this but with multipel profiles. I have 4 UI layouts; one for a Healer and another for DPS as well as 1 more for each but on a lower resolution.

    I want to create something which loads on login when its your first time on a character which you want to apply the UI to and come up with a box either asking which of the 4 profiles would you like to load for "someones UI". or asting which resolution are you using? then asking which profile do you want to load, healer or dps. If theres an addon out there great. If I can cheat around this using kgpanels then thats also great. I know alot of people in the past have wanted an addon like this for years.

    Sorry if this post seems very long winded

  2. #2
    Deleted
    Hm, pretty easy. Make this addon. It will load the first time the UI is loaded, make the pop-up boxes, then disable itself and switch profiles.
    Code:
    local sname = (...)
    StaticPopupDialogs["UITYPE_SELECT"] = {
        timeout = 0,
        text="What type of resolution are you using?",
        button1="High resolution",
        button2="Low resolution",
        OnAccept=function()
            StaticPopup_Show("UITYPE_SELECT_2").data = false
        end,
        OnCancel=function()
            StaticPopup_Show("UITYPE_SELECT_2").data = true
        end,
        whileDead=true,
        hideOnEscape=false,
    }
    StaticPopupDialogs["UITYPE_SELECT_2"] = {
        timeout=0,
        text="Are you a Healer or a DPS class?",
        button1="DPS",
        button2="Healer",
        OnAccept=function(_,data)
            DisableAddOn(sname)
            SlashCmdList["REFLUX"]("switch dps_"..(data and "l" or "h").."res")
        end,
        OnCancel=function(_,data)
            DisableAddOn(sname)
            SlashCmdList["REFLUX"]("switch heal_"..(data and "l" or "h").."res")
        end,
    }
    StaticPopup_Show("UITYPE_SELECT")
    How to use. Untested. Report back with issues.
    Oh, and the profiles it tries to switch to are called "dps_hres", "dps_lres", "heal_hres" and "heal_lres", respectively.
    Pretty sure you can figure out how to edit the text displayed yourself.
    Last edited by mmocba105e19de; 2011-07-24 at 10:41 PM.

  3. #3
    Thanks so much for this. I will try it out now and report with any issues.

    ---------- Post added 2011-07-24 at 09:37 PM ----------

    I'm sure I've done it write and the code looks fine but nothing pops up when I create a new character and load it with the addon as well as reflux. Not sure why.
    Last edited by MayronWoW; 2011-07-24 at 08:50 PM.

  4. #4
    Deleted
    Lua errors enabled? Addon shows on the character screen?

  5. #5
    Yeah I fixed the problem. I turned on lua errors and on line 16 you put

    StaticPopupDialogs["UITYPE_SELECT_2")

    should of been:
    StaticPopupDialogs["UITYPE_SELECT_2"]

    Works great now thanks alot Treeston once again!

  6. #6
    Deleted
    Hehe, okay. Them brackets.

Posting Permissions

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