Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

disabling and moving focus script to !tukui_config

  • Loading branch information...
commit 975e47eb5157d86bf1bd4c8251350b66ff16ae87 1 parent 8b02623
@tukz tukz authored
View
5 Interface/AddOns/Tukui/!Tukui_config.lua
@@ -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)
----------------------------------------------------------------------------------------
View
2  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
View
58 Interface/AddOns/Tukui/mods/arena_focus.lua
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.