WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   set focus bugged?? (https://www.wowinterface.com/forums/showthread.php?t=38274)

barbol12 01-09-11 02:23 PM

set focus bugged??
 
hey guys.. i just got done making my oUF frames.... and seem to be having a trouble with 1 thing... i cant set focus on anything... my focus frame will not work, at all. it comes up with that window, saying this action has been blocked due to the blizzard UI, blah blah, or something like that :). is it just me or other ppl having this same problem.

haste 01-09-11 03:36 PM

This is an issue with so to say all unit frame add-ons. We can't reliably recreate the menus with the secure environment, rendering us unable to do things such as SetFocus().

The "solution" is to use /focus.

barbol12 01-09-11 03:56 PM

ok, thanks a whole heap man. forgot about the chat command focus setting :)

Dawn 01-09-11 07:18 PM

To make life a little easier, I'm using this

Code:

-- set/clear focus with shift + left click
    local ModKey = 'Shift'
    local MouseButton = 1
    local key = ModKey .. '-type' .. (MouseButton or '')
        if(self.unit == 'focus') then
                self:SetAttribute(key, 'macro')
                self:SetAttribute('macrotext', '/clearfocus')
        else
                self:SetAttribute(key, 'focus')
        end

and this
Code:

-- remove SET_FOCUS & CLEAR_FOCUS from menu, to prevent errors
do
    for k,v in pairs(UnitPopupMenus) do
        for x,y in pairs(UnitPopupMenus[k]) do
            if y == "SET_FOCUS" then
                table.remove(UnitPopupMenus[k],x)
            elseif y == "CLEAR_FOCUS" then
                table.remove(UnitPopupMenus[k],x)
            end
        end
    end
end



All times are GMT -6. The time now is 11:55 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI