1. #1
    Deleted

    Is it possible to use a lua script to turn on or off a Quartz Cast Bar?

    Hey,

    I doubt this is possible but felt like I might as well ask. Is it possible to create a lua script (using again a KgPanel but I don't know if that really matters) that turns on a setting in another addon? In this case I want to enable the focus cast bar in the Quartz addon at the same time as disabling the target Cast Bar. I have no idea what to look for in the Quartz lua file as I assume you would need to register it or something. Can anyone help me out?


    Reason why: The reason is that I have a button to switch from DPS to Healer mode and the Unit frames I want to work differently (because of Mouse over macros for the Focus frame as I have the unit frames different. This means I also want the cast bars to switch and would prefer not using more profile switching as its getting hard to update for each profile).

  2. #2
    Deleted
    Does quartz not support dual profiling?

  3. #3
    Deleted
    I can do that but if I could do it the other way I would prefer it as its a lot of hassle as I have buttons to add a new action bar which then means i need to move the cast bar and unit frames higher to make room as well as the fact I have my UI uploaded so I would have to tell people they will need to switch profiles manually or set it up according to which spec is their duel spec and I would get a lot of people most likely saying there is a bug with it when its just they need to set it up. I get very simple questions like that and it can be a pain.

    If its impossible then I understand. Would have been very useful in my situation.

  4. #4
    Deleted
    Right so you wish to make it toggleable with a KGPanels script?

    From what I can dig up, there are a number of functions defined in \modules\ which can do what you need, some you will want to call are:
    Focus
    Code:
    Focus:OnDisable()
    Code:
    Focus:OnEnable()
    Player
    Code:
    Player:OnEnable()
    Code:
    Player:OnDisable()
    Pseudo code:
    Code:
    local x = 0; --Not Healing
    if x == 0 then
    HealingCastbar:OnDisable();
    NotHealingCastbar:OnEnable()
    x = 1
    else
    NotHealingCastbar:OnDisable()
    HealingCastbar:OnEnable();
    x = 0
    end
    I'm just about as clueless as you though, someone else will probably reply with a far better/easier solution.

  5. #5
    Deleted
    Code:
    Quartz3:SetModuleEnabled("Target",false)
    Quartz3:SetModuleEnabled("Focus",true)

  6. #6
    Deleted
    There we have it lol

  7. #7
    Deleted
    Thank you so much guys. This will be so much easier to work with

    ---------- Post added 2012-08-16 at 03:38 PM ----------

    Quote Originally Posted by Treeston View Post
    Code:
    Quartz3:SetModuleEnabled("Target",false)
    Quartz3:SetModuleEnabled("Focus",true)
    I tried using this on its own and it does not work. Do I need something to go with it?

    I also tried:

    if pressed then
    if GetMouseButtonClicked() == "LeftButton" then
    Quartz3:SetModuleEnabled("Target",false)
    Quartz3:SetModuleEnabled("Focus",true)
    end
    end

    but still doesn't work.
    Last edited by mmoc2c0e080e79; 2012-08-16 at 02:40 PM.

  8. #8
    Deleted
    Let me take another look at the file.

    ---------- Post added 2012-08-17 at 08:32 PM ----------

    Ah, yes, "Quartz3" is an upvalue.

    Code:
    if pressed then
        if GetMouseButtonClicked() == "LeftButton" then
            local Quartz3 = LibStub("AceAddon-3.0"):GetAddon("Quartz")
            Quartz3:SetModuleEnabled("Target",false)
            Quartz3:SetModuleEnabled("Focus",true)
        end
    end
    That should do the trick.

    PS: I think you can substitute your GetMouseButtonClicked call with a simple "button" - kgPanels already provides that global. I could be wrong here.

  9. #9
    Deleted
    After using this code on its own I get this lua error:

    Message: [string "test_OnClickDown"]:3: Usage: GetAddon(name): 'name' - Cannot find an AceAddon 'Quartz'.
    Time: 08/18/12 09:47:11
    Count: 1
    Stack: [C]: ?
    [C]: ?
    Interface\AddOns\Ace3\AceAddon-3.0\AceAddon-3.0.lua:176: in function `GetAddon'
    [string "test_OnClickDown"]:3: in function <[string "test_OnClickDown"]:1>

    And does not work
    Quartz is definitely enabled.
    Last edited by mmoc2c0e080e79; 2012-08-18 at 08:49 AM.

  10. #10
    Deleted
    Code:
    if pressed then
        if GetMouseButtonClicked() == "LeftButton" then
            local Quartz3 = LibStub("AceAddon-3.0"):GetAddon("Quartz3")
            Quartz3:SetModuleEnabled("Target",false)
            Quartz3:SetModuleEnabled("Focus",true)
        end
    end
    Typo.

  11. #11
    Deleted
    Thanks Treeston, I should have looked more carefully

Posting Permissions

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