• 0

    posted a message on Blizzard interface options
    Yes sorry, I meant clicking on the title instead of the + button :)

    Basically what I want is for the "MyAddon" menu to expand when I click MyAddon in the list, just as if I had clicked the + button. Does that make any sense? :P
    Posted in: Lua Code Discussion
  • 0

    posted a message on Blizzard interface options
    Hi I made an addon complete with options in the blizzard interface options panel, now I'm wondering if it's possible to auto expand the menu (since I have sub options) whenever you click the addon name in the list?

    something like this
    -MyAddon
      +submenu1
      +submen2
    
    Posted in: Lua Code Discussion
  • 0

    posted a message on Hide frames in combat?
    Damn.. that kinda sucks :(
    Posted in: Lua Code Discussion
  • 0

    posted a message on Hide frames in combat?
    I ran into another problem when I tried to make my frames open up a menu when right clicked on. Everything works except the option "Set Focus", I get a popup error saying something about an action was blocked..? I'm using this code:
    SecureUnitButton_OnLoad(self, self.unit, function()
    	ToggleDropDownMenu(1, nil, _G["PartyMemberFrame"..i.."DropDown"], "cursor")
    end)
    
    Posted in: Lua Code Discussion
  • 0

    posted a message on Hide frames in combat?
    Ugh xml,.. that looks really complicated, why can't I just create the party frames beforehand and then fill in the unit info when it's available (like joining a party)?
    Actually, I just found this on wowwikki http://www.wowwiki.com/SecureStateDriver
    Could I perhaps use the example there and just RegisterUnitWatch() my partyframes so they will show/hide by themselves?
    something like this
    local MyPartyFrame1 = CreateFrame("BUTTON", "MyParty1", UIParent, "SecureUnitButtonTemplate")
    -- do frame layout here
    local MyPartyFrame2 = CreateFrame etc, etc
    
    MyPartyFrame1:SetAttribute("unit", "party1")
    RegisterUnitWatch(MyPartyFrame1)
    
    MyPartyFrame2:SetAttribute("unit", "party2")
    RegisterUnitWatch(MyPartyFrame2)
    
    -- etc etc
    
    Posted in: Lua Code Discussion
  • 0

    posted a message on Hide frames in combat?
    Ok I'm definitely doing something wrong then since I have never even heard of SecurePartyHeaderTemplate, google didn't give much information either. I guess this is a template I should use instead of SecureActionButtonTemplate that I'm using currently?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Hide frames in combat?
    Quote from Phanx

    Unit frames automatically show or hide themselves based on whether the unit they're set to watch exists, so even if you hide them, they'll reappear. If you hide their parent, however, it doesn't matter if they're shown or hidden, because they don't do anything with the visibility of their parent.


    Wait, what? How do you know how my unitframes work? :p I didn't even post the code on how I show/hide them. Also, why would I wanna parent them all to 1 frame? hiding it would result in every child frame getting hidden as well, what if I want to hide/show them individually? As in people leaving/joining your group.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Hide frames in combat?
    Hi, I was wondering how I should hide (and show) my custom made unit frames, specifically the party frames, while being in combat? At the moment I just do a frame:Hide() when party members change. This works while out of combat but in combat its causing taint and generating an Interface action failed-error message. How am I supposed to hide my frames? :confused:
    Posted in: Lua Code Discussion
  • 0

    posted a message on detect ilvl
    Is it possible to detect the average ilvl on somebody without inspecting them? like just scan them by mouseover or some api function?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Help with ColorPicker
    Ok cool, I got another problem now. If I change the background color on my chat window with the colorpicker from the settings menu and then start changing color with my addon the background color on my chat window is auto set to the colors from my addon colorpicker. Basically if I use any colorpicker from blizzard and later use my own the blizzard one will take the colors from my addons colorpicker?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Help with ColorPicker
    I'm trying to make a colorpicker button which will show the current selected color and open up the color picker frame when clicked.
    I've copied the basic functions from wowwiki and added my button but I can't get the currently selected color to show on the button I've created..

    function ShowColorPicker(r, g, b, changedCallback)
       ColorPickerFrame:SetColorRGB(r,g,b);
       ColorPickerFrame.hasOpacity = false
       ColorPickerFrame.previousValues = {r,g,b};
       ColorPickerFrame.func, ColorPickerFrame.opacityFunc, ColorPickerFrame.cancelFunc = 
       changedCallback, changedCallback, changedCallback;
       ColorPickerFrame:Hide(); -- Need to run the OnShow handler.
       ColorPickerFrame:Show();
    end
    
    local r,g,b = 1, 0, 0
    
    local function myColorCallback(restore)
       local newR, newG, newB
       if restore then
          -- The user bailed, we extract the old color from the table created by ShowColorPicker.
          newR, newG, newB = unpack(restore);
       else
          -- Something changed
          newR, newG, newB = ColorPickerFrame:GetColorRGB();
       end
       
       -- Update our internal storage.
       r, g, b = newR, newG, newB
       PlayerFrame.name:SetTextColor(r, g, b)
       -- And update any UI elements that use this color...
    end
    
    local f = CreateFrame("Frame", nil, UIParent)
    local text = f:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
    text:SetPoint("CENTER", UIParent, "CENTER")
    text:SetText("Select Color")
    local texture = f:CreateTexture()
    texture:SetTexture(r, g, b)
    local colorButton = CreateFrame("Button", nil, f, "OptionsCheckButtonTemplate")
    colorButton:SetPoint("LEFT", text, "RIGHT")
    colorButton:SetNormalTexture(texture)
    colorButton:SetHighlightTexture("Interface\\Buttons\\CheckButtonHilight")
    colorButton:SetScript("OnClick", function(self)
          ShowColorPicker(r, g, b, myColorCallback);
          
    end)
    


    halp
    Posted in: Lua Code Discussion
  • 0

    posted a message on detecting spells cast with CLEU
    Ugh, checking for SPELL_CAST_COMPLETE would kinda defeat the purpose of the addon. So is there no other way to detect if an enemy is casting a spell on you or your party? without targeting the unit that is.
    Posted in: Lua Code Discussion
  • 0

    posted a message on detecting spells cast with CLEU
    I'm trying to detect when a spell is cast on people with COMBAT_LOG_EVENT_UNFILTERED but so far the 6th and 7th parameters (destGUID and destName) are always empty or nil? how are you supposed to get the destName from that?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Best way to detect your spec?
    Ah good stuff thanks nomnomnom
    Posted in: Lua Code Discussion
  • 0

    posted a message on Best way to detect your spec?
    I'm looking for a good way to detect the players current spec, I tried to check for the main spec spell (ie Mortal Strike for Warriors) with IsUsableSpell but it doesn't work very good, it returns nil most of the times when I run it on "PLAYER_LOGIN"..
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.