• 0

    posted a message on World Marker Drop-Down Blocking
    Yea I have it working out of combat but once I enter combat interface error because of an addon and nothing shows.

    Gonna have to rewrite it all heh.

    Frustrating but will be that much sweeter if i get it working.
    Posted in: Need Help?
  • 0

    posted a message on World Marker Drop-Down Blocking
    Ok so a workaround is to use macros and use /wm 1 - /wm 6 /cwm and /clearworldmarker do not seem to work in lua tho. I will triple check i didnt do something like /cmw.

    Example of what works:

    [HTML]--Square Marks Raid Marker 6 World Marker 1
    local WMSquare = CreateFrame("Button","WorldMarker1Square",f, "SecureActionButtonTemplate")
    WMSquare:SetWidth(50) -- Set these to whatever height/width is needed
    WMSquare:SetHeight(50) -- for your Texture

    local t = WMSquare:CreateTexture(nil,"BACKGROUND")
    t:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcon_6.png")
    t:SetAllPoints(WMSquare)

    WMSquare.texture = t
    WMSquare:SetPoint("RIGHT",0,0)
    WMSquare:Show()

    WMSquare:RegisterForClicks("AnyUp", "AnyDown")
    WMSquare:HookScript("OnClick", function(self, button)
    if(button=="LeftButton") then
    PlaySound("UChatScrollButton")
    WMSquare:SetAttribute("type", "macro")
    WMSquare:SetAttribute("macrotext1", "/wm 1")
    else
    PlaySound("UChatScrollButton")
    SetRaidTargetIcon("target", 6)
    end
    end)[/HTML]
    Posted in: Need Help?
  • 0

    posted a message on World Marker Drop-Down Blocking
    So, I am trying to make an addon that on left click marks your target with the raid target marker and on right click will let you place a world marker.

    Problem is I do not think, or have read actually, that there is an actual API for this and you have to use the drop down, so far I have gotten around this by the code below, except if I try to use the square world marker or after I have used the Clear world marker I get a message:

    "has been blocked from an action only available to the Blizzard UI"

    After doing some reading I recalled having this issue with my set focus on a different addon and that fix was to use HookScript but it doesnt work here.

    Any ideas?

    [HTML]local f = CreateFrame("Frame","WorldMarkerFrame",UIParent)
    f:SetWidth(150) -- Set these to whatever height/width is needed
    f:SetHeight(100) -- for your Texture

    local t = f:CreateTexture(nil,"BACKGROUND")
    t:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Background")
    t:SetAllPoints(f)
    f.texture = t

    f:SetPoint("CENTER",0,0)
    f:Show()



    --Clear Marks
    local WMClear = CreateFrame("Button","WorldMarker6Clear",f)
    WMClear:SetWidth(50)
    WMClear:SetHeight(50)

    local tclear = WMClear:CreateTexture(nil,"BACKGROUND")
    tclear:SetTexture("Interface\\BUTTONS\\UI-GroupLoot-Pass-Up")
    tclear:SetAllPoints(WMClear)

    WMClear.texture = tclear
    WMClear:SetPoint("BOTTOMRIGHT",0,0)
    WMClear:Show()

    WMClear:RegisterForClicks("AnyUp", "AnyDown")
    WMClear:HookScript("OnClick", function(self, button)
    if(button=="LeftButton") then
    PlaySound("UChatScrollButton")
    SetRaidTargetIcon("target", 0)
    else CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton:Click("LeftButton")
    DropDownList1Button6:Click("LeftButton")
    end
    end)



    --Square Marks
    local WMSquare = CreateFrame("Button","WorldMarker1Square",f)
    WMSquare:SetWidth(50) -- Set these to whatever height/width is needed
    WMSquare:SetHeight(50) -- for your Texture

    local t = WMSquare:CreateTexture(nil,"BACKGROUND")
    t:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcon_6.png")
    t:SetAllPoints(WMSquare)

    WMSquare.texture = t
    WMSquare:SetPoint("TOPLEFT",0,0)
    WMSquare:Show()

    WMSquare:RegisterForClicks("AnyUp", "AnyDown")
    WMSquare:HookScript("OnClick", function(self, button)
    if(button=="LeftButton") then
    PlaySound("UChatScrollButton")
    SetRaidTargetIcon("target", 6)
    else CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton:Click("LeftButton")
    DropDownList1Button1:Click("LeftButton")
    end
    end)[/HTML]
    Posted in: Need Help?
  • 0

    posted a message on Hiding Micro Buttons Via Mouseover Problems
    I am having three issues with making the micro menu buttons appear on mouseover and hide on mouseout.

    1.) First I used the code Phanx helped me with for hiding and showing the CompactRaidFrameManager in this thread:http://forums.curseforge.com/showthread.php?t=20170

    It works fine except I cannot get it to register on login or UI reload that the mouse is not over the frame and to automatically hide to begin with. Currently I ahve to go mouseover the frame and then mouseout to get it to hide, then everything works, fine.

    2.) I set the frame strat to BACKGROUND and then it does not register when the mouse is over the region. Combined with the first issue then buttons sit there like normal and do not hide. If I set the strata to HIGH then it shows and hides the buttons fine but the frame is in the way and you cant actually click any buttons. I remedied this by changing the strata from HIGH to BACKGROUND on mouseout and mouseover respectively.

    With the current code I have the strata changes and I can click buttons and they show while my mouse is over the buttons and it works ok. I am concerned that this strata thing will somehow interfere with something in the future. i would rather SetAlpha or Show/Hide.

    3.) With the current code when I am in combat the top three buttons do not show on mouseover, these are the anchor buttons so I think it has something to do with that, they are Character, Spellbook and Talents. Character is parented to the frame I created, Spellbook to Character and Talents to Spellbook.

    It also is not changing the strata of the frame as I cannot click buttons while in combat as the frame is still set to "HIGH" and is in the way.

    I thought maybe it has to do with the frame overall since these are all ostensibly parented to the same frame via other buttons. Using HookScript doesn't work, nothing happens, no lua errors either.

    Thanks in advance for any help.

    The code in question is in the "--Micro Menu Buttons" section except for the table at the top defining "MicroButtons"

    http://www.wowace.com/paste/6198/
    Posted in: Need Help?
  • 0

    posted a message on Whisper Tabs, Chat Frames 11+ Revert To Default
    I like the first one best, as in I can see the ends of the if then and functions easily without actually reading the code like you mentioned. Am I on the right track?
    Posted in: Need Help?
  • 0

    posted a message on Whisper Tabs, Chat Frames 11+ Revert To Default
    So is this more correct(easier to read) than

    [HTML]function FloatingChatFrame_OnMouseScroll(self, delta)
    if delta > 0 then
    if IsShiftKeyDown() then
    self:ScrollToTop()
    else
    self:ScrollUp()
    end
    elseif delta < 0 then
    if IsShiftKeyDown() then
    self:ScrollToBottom()
    else
    self:ScrollDown()
    end
    end
    end[/HTML]


    This

    [HTML]function FloatingChatFrame_OnMouseScroll(self, delta)
    if delta > 0 then
    if IsShiftKeyDown() then
    self:ScrollToTop()
    else
    self:ScrollUp()
    end
    elseif delta < 0 then
    if IsShiftKeyDown() then
    self:ScrollToBottom()
    else
    self:ScrollDown()
    end
    end
    end[/HTML]

    I have gone back to some things and already stuff is difficult to read. At this point I am just trying to keep track of my "end"s, lol. So is the logic to keep "end"s aligned ?

    I am new to programming as well as lua so I am pretty ignorant but want to go back and clean up some stuff now that I have learned so much and want others to be able to edit my stuff easily.

    Also I have gone crazy keeping track of "then"s and "or"s and have done this:

    [HTML]function FloatingChatFrame_OnMouseScroll(self, delta)
    if delta > 0 then
    if IsShiftKeyDown()
    then
    self:ScrollToTop()
    else
    self:ScrollUp()
    end
    elseif delta < 0
    then
    if IsShiftKeyDown()
    then
    self:ScrollToBottom()
    else
    self:ScrollDown()
    end
    end
    end[/HTML]

    too much? LOL ?
    Posted in: Need Help?
  • 0

    posted a message on Whisper Tabs, Chat Frames 11+ Revert To Default
    Thanks for spelling it out for me man. I was just too tired last night to figure it out. I kept looking at it and going back and forth between
    [HTML]
    function PhanxChat:ProcessFrame(frame)
    --modifications[/HTML]


    and
    [HTML]
    hooks.FCF_OpenTemporaryWindow = FCF_OpenTemporaryWindow
    FCF_OpenTemporaryWindow = function(...)
    local frame = hooks.FCF_OpenTemporaryWindow(...)
    self:ProcessFrame(frame)
    return frame[/HTML]

    Couldn't figure out what hooks was. I garnered that I would have to go generic and process both and that was just the ticket, should have done it sooner I probably would have saved time. So much for avoiding work, heh.

    Here is my code now for those following:

    http://www.wowace.com/paste/6183/
    Posted in: Need Help?
  • 0

    posted a message on Whisper Tabs, Chat Frames 11+ Revert To Default
    So I should use:

    [HTML]for i = 1, 10 do[/HTML]

    Also over the past 6 hours all I can find is:

    FCF_OpenTemporaryWindow
    Posted in: Need Help?
  • 0

    posted a message on Whisper Tabs, Chat Frames 11+ Revert To Default
    Ok, here we go again. If I am taking up too much of anyone's time or diverting attention away from other addon's issues I understand. However, since PhanxChat is the only chat addon I have found that does not have the issue I am having with my little chat addon and since Phanx has been kind enough to answer a plethora of my questions and teach me a lot about a lot I thought I would ask here.

    My chat addon hides the buttons and lets you move the frame all the way down to the bottom of the screen.

    When I have the WoW settings to place new whispers in a new tab the new tab defaults to tab #11. When I click on this new whisper tab, tabs 11+, they revert to the default settings with buttons visible and the chat frame clamped about 40 pixels above the bottom of the screen.

    If I click back onto tabs 1 - 10 then they work fine as the addon intends, buttons hidden and frame clamped all the way to the bottom.

    I looked through the battlenet API and didnt find anything relevant, I am really just shooting in the dark at this point because I do not even know what it is I am looking for.

    Any help would be appreciated.

    Here is the code:

    [HTML]CHAT_FRAME_FADE_OUT_TIME = 0
    CHAT_TAB_HIDE_DELAY = 0
    CHAT_FRAME_TAB_SELECTED_MOUSEOVER_ALPHA = 1
    CHAT_FRAME_TAB_SELECTED_NOMOUSE_ALPHA = 0
    CHAT_FRAME_TAB_ALERTING_MOUSEOVER_ALPHA = 1
    CHAT_FRAME_TAB_ALERTING_NOMOUSE_ALPHA = 0
    CHAT_FRAME_TAB_NORMAL_MOUSEOVER_ALPHA = 1
    CHAT_FRAME_TAB_NORMAL_NOMOUSE_ALPHA = 0

    BNToastFrame:SetClampedToScreen(true)
    FriendsMicroButton:Hide(0)
    ChatFrameMenuButton:Hide(0)

    for i = 1, NUM_CHAT_WINDOWS do
    _G['ChatFrame'..i..'ButtonFrame']:Hide()
    _G['ChatFrame'..i..'EditBoxLeft']:Hide()
    _G['ChatFrame'..i..'EditBoxMid']:Hide()
    _G['ChatFrame'..i..'EditBoxRight']:Hide()

    local editbox = _G['ChatFrame'..i..'EditBox']

    editbox:ClearAllPoints()
    editbox:SetPoint('BOTTOMLEFT', ChatFrame1, 'TOPLEFT', -7, 25)
    editbox:SetPoint('BOTTOMRIGHT', ChatFrame1, 'TOPRIGHT', 10, 25)
    editbox:SetAltArrowKeyMode(false)

    local chat = _G['ChatFrame'..i]

    chat:SetClampRectInsets(0, 0, 0, 0)
    chat:SetMaxResize(UIParent:GetWidth(), UIParent:GetHeight())
    chat:SetMinResize(250, 100)
    end

    function FloatingChatFrame_OnMouseScroll(self, delta)
    if delta > 0 then
    if IsShiftKeyDown() then
    self:ScrollToTop()
    end
    elseif delta < 0 then
    if IsShiftKeyDown() then
    self:ScrollToBottom()
    end
    end
    end[/HTML]
    Posted in: Need Help?
  • 0

    posted a message on Show CompactRaidFrameManager on mouseover
    Yea looking through events and when they fire they fire an awful lot and without creating a bunch of different frames for different events it seems you get events firing and checking things irrelevant to whatever you are doing most of the time. I was thinking for some reason that I had to hit some of those events to make things work but it doesn't need to be as you explained.

    Thanks again.
    Posted in: Need Help?
  • 0

    posted a message on Show CompactRaidFrameManager on mouseover
    Is this correct now? It works and the manager is hidden on load :) :

    [HTML]local function WaitForMouseToGoAway(self)
    if not self:IsMouseOver() then
    self:SetScript("OnUpdate", nil)
    self:SetAlpha(0)
    end
    end

    CompactRaidFrameManager:HookScript("OnEnter", function(self)
    self:SetScript("OnUpdate", nil)
    self:SetAlpha(1)
    end)

    CompactRaidFrameManager:HookScript("OnLeave", function(self)
    if self.collapsed then
    self:SetScript("OnUpdate", WaitForMouseToGoAway)
    end
    end)

    local function CheckMouseOver(self)
    if self:IsMouseOver() and not self.collapsed then
    self:GetScript("OnEnter")(self)
    else
    self:GetScript("OnLeave")(self)
    end
    end

    hooksecurefunc("CompactRaidFrameManager_Collapse", CheckMouseOver)
    hooksecurefunc("CompactRaidFrameManager_Expand", CheckMouseOver)

    CompactRaidFrameManager:HookScript("OnShow", CheckMouseOver)

    CompactRaidFrameContainer:SetParent(UIParent)[/HTML]
    Posted in: Need Help?
  • 0

    posted a message on Show CompactRaidFrameManager on mouseover
    So, because I am using the default frames I do not have to create a frame, just use the hook then they will act as default only with whatever I changed with the hook, like in your color example.

    Ok so creating a frame and registering events etc etc all that rigamarole is only if you are actually needing to make your own frame and cant use the default UI frames in some way.

    This will save me a lot of work in the future heh.
    Posted in: Need Help?
  • 0

    posted a message on Show CompactRaidFrameManager on mouseover
    I had an issue with the code I posted where the raid roster was not updating. Someone would leave and their unit frame remained and stacked on top of other unit frames.

    With the code you posted when a party or raid is formed or joined the raid manager still shows with it's alpha at 1 until you mouseover it and mouseout, then it hides and works fine, the popout is working fine, just when the addon is loaded or initialized it is showing. I would like to remedy this and that is why I created a frame and registered events because the current code is only registering mouseovers.

    I apologize for not being as clear about my goal as I could have been.

    The code you posted works perfect otherwise and it does not try to reparent the raid container back to the manager.

    So, should I remedy this by making a frame for the container to have other events registered to or should I do something like:

    [HTML]CompactRaidFrameManager:SetScript("OnEvent", function(self, event, ...)
    self:RegisterEvent("PLAYER_LOGIN")
    self:RegisterEvent("PLAYER_ENTERING_WORLD")
    self:RegisterEvent("ADDON_LOADED")
    self:SetScript("OnUpdate", nil)
    self:SetAlpha(0)
    end)[/HTML]
    Posted in: Need Help?
  • 0

    posted a message on Show CompactRaidFrameManager on mouseover
    OK, here is what I have now:

    http://www.wowace.com/paste/6170/
    Posted in: Need Help?
  • 0

    posted a message on Show CompactRaidFrameManager on mouseover
    I think you meant for that to replace:

    [HTML]CompactRaidFrameManagerToggleButton:HookScript("OnClick", function(self)
    if CompactRaidFrameManager.collapsed then
    CompactRaidFrameManager:SetScript("OnUpdate", nil)
    CompactRaidFrameManager:SetAlpha(0)
    end
    end)[/HTML]


    Using the code provided made the raid manager visible when collapsed until I moused over and left, then it works fine.

    I still need to have a frame and registered events for the raid container dont I? I still need to add raid roster update to the list, was ghost frames after people left raid tonight.

    [HTML]CompactRaidFrameContainer:SetParent(UIParent)[/HTML]

    Am I jsut being dense, lol.
    Posted in: Need Help?
  • To post a comment, please or register a new account.