Skip to content

Commit

Permalink
disabling and moving focus script to !tukui_config
Browse files Browse the repository at this point in the history
  • Loading branch information
tukz committed Dec 17, 2009
1 parent 8b02623 commit 975e47e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 30 deletions.
5 changes: 5 additions & 0 deletions Interface/AddOns/Tukui/!Tukui_config.lua
Expand Up @@ -84,6 +84,11 @@ t_arena = true
ArenaX = 252 -- position X (left/right) on UI
ArenaY = 260 -- position Y (up/down) on UI
-- enable a keybind as a set focus key on arena frame or unit mouseover
focuskey = false
arenamodifier = "shift" -- shift, alt or ctrl
arenamouseButton = "3" -- 1 = left, 2 = right, 3 = middle, 4 and 5 = thumb buttons if there are any
----------------------------------------------------------------------------------------
-- Panels config (you can't have more than 6 active panels)
----------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Interface/AddOns/Tukui/Tukui.toc
@@ -1,6 +1,6 @@
## Interface: 30300
## Author: Tukz
## Version: 8.05
## Version: 8.06
## Title: |cffC495DDTukui|r
## Notes: UI of awesomeness!
## SavedVariables: tCooldownTracker_Saved
Expand Down
58 changes: 29 additions & 29 deletions Interface/AddOns/Tukui/mods/arena_focus.lua
Expand Up @@ -3,36 +3,36 @@

-- default key to set focus on arena frame or mousever unit is "shift + mouse button 2 (right one)"

local modifier = "shift" -- shift, alt or ctrl
local mouseButton = "3" -- 1 = left, 2 = right, 3 = middle, 4 and 5 = thumb buttons if there are any
if focuskey == true then

local function SetFocusHotkey(frame)
frame:SetAttribute(modifier.."-type"..mouseButton,"focus")
end
local function SetFocusHotkey(frame)
frame:SetAttribute(arenamodifier.."-type"..arenamouseButton,"focus")
end

local function CreateFrame_Hook(type, name, parent, template)
if template == "SecureUnitButtonTemplate" then
SetFocusHotkey(_G[name])
end
end

local function CreateFrame_Hook(type, name, parent, template)
if template == "SecureUnitButtonTemplate" then
SetFocusHotkey(_G[name])
hooksecurefunc("CreateFrame", CreateFrame_Hook)

-- Keybinding override so that models can be shift/alt/ctrl+clicked
local f = CreateFrame("CheckButton", "FocuserButton", UIParent, "SecureActionButtonTemplate")
f:SetAttribute("type1","macro")
f:SetAttribute("macrotext","/focus mouseover")
SetOverrideBindingClick(FocuserButton,true,arenamodifier.."-BUTTON"..arenamouseButton,"FocuserButton")

-- Set the keybindings on the default unit frames since we won't get any CreateFrame notification about them
local duf = {
oUF_Arena1,
oUF_Arena2,
oUF_Arena3,
oUF_Arena4,
oUF_Arena5,
}

for i,frame in pairs(duf) do
SetFocusHotkey(frame)
end
end

hooksecurefunc("CreateFrame", CreateFrame_Hook)

-- Keybinding override so that models can be shift/alt/ctrl+clicked
local f = CreateFrame("CheckButton", "FocuserButton", UIParent, "SecureActionButtonTemplate")
f:SetAttribute("type1","macro")
f:SetAttribute("macrotext","/focus mouseover")
SetOverrideBindingClick(FocuserButton,true,modifier.."-BUTTON"..mouseButton,"FocuserButton")

-- Set the keybindings on the default unit frames since we won't get any CreateFrame notification about them
local duf = {
oUF_Arena1,
oUF_Arena2,
oUF_Arena3,
oUF_Arena4,
oUF_Arena5,
}

for i,frame in pairs(duf) do
SetFocusHotkey(frame)
end

0 comments on commit 975e47e

Please sign in to comment.