• 0

    posted a message on One event handler for multiple events
    Just assign a custom handler.

    self:RegisterEvent("SOME_EVENT", "MyHandler")
    self:RegisterEvent("ANOTHER_EVENT", "MyHandler")
    self:RegisterEvent("YET_ANOTHER_EVENT", "MyHandler")
    self:RegisterEvent("EVENT_WITH_DEFAULT_HANDLER")


    Then, create a function:

    function MyAddon:MyHandler()
    
    end


    Which will handle the first 3 events.
    Posted in: AddOn HELP!
  • 0

    posted a message on ScrollingMessageFrame, no visible text?
    Thanks for the replies, got it working now.
    Posted in: Lua Code Discussion
  • 0

    posted a message on ScrollingMessageFrame, no visible text?
    Thanks guys, I was missing one line of code:

    f:SetFontObject("ChatFontNormal")
    Posted in: Lua Code Discussion
  • 0

    posted a message on ScrollingMessageFrame, no visible text?
    This is my code:

    local f = CreateFrame("ScrollingMessageFrame")
    
    local font = f:CreateFontString(nil,nil,"ChatFontNormal")
    
    font:SetJustifyH("LEFT")
    font:SetIndentedWordWrap(true)
    font:SetNonSpaceWrap(true)
    
    f:SetSize(300,100)
    f:SetBackdrop(ThisOtherFrameIHave:GetBackdrop())
    f:SetBackdropColor(0,0,0,1)
    f:SetPoint("LEFT",0,100)
    f:SetMaxLines(128)
    
    f:AddMessage("test")
    f:AddMessage("test")
    f:AddMessage("test")
    f:AddMessage("test")
    f:AddMessage("test")
    


    I see the frame, but no text. Am I missing something? I checked the ChatFrameTemplate and don't see anything else.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Size of button textures
    Wow, nevermind, I see the problem now... The Horde Icon itself that I'm using has a bigger transparent background. I thought the image was just the circle...
    Posted in: Lua Code Discussion
  • 0

    posted a message on Size of button textures
    That just obscures my Horde button. What I'm trying to do is have the Horde Icon fill the entire 32x32, while right now it just fills 16x16. The red texture was just a test.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Size of button textures
    If I create a button, size 32x32, and a texture of the exact same size, the button seems to be 1/4 of the size, yet the "hitbox" is the full 32x32.

    Example:

    local b = CreateFrame("Button", "TestButton",UIParent)
    b:SetHeight(32)
    b:SetWidth(32)
    b:SetPoint("LEFT")
    b:SetNormalTexture("Interface\\TargetingFrame\\UI-PVP-Horde")
    
    local b2 = b:CreateTexture()
    b2:SetHeight(32)
    b2:SetWidth(32)
    b2:SetPoint("TOP",b,"BOTTOM")
    b2:SetTexture(1,0,0,1)


    That produces the image attached. Using /framestack I see that the area that I've squared blue, all that is the button. I'm anchoring the red texture's TOP to the button's BOTTOM and you can see the button is bigger than it looks.

    Anyone know what I am doing wrong?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Fishing from pools
    I can track the Guild Achievement 5036 (That's a lot of bait), using the event TRACKED_ACHIEVEMENT_UPDATE. What I want is a reliable way to tell me if it was me who did the fishing. All the event tells me is that someone from the guild did it. Is there another way to check if what you're fishing comes from a pool?
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.