-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4f08900
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
local modifier = "shift" -- shift, alt or ctrl | ||
local mouseButton = "1" -- 1 = left, 2 = right, 3 = middle, 4 and 5 = thumb buttons if there are any | ||
|
||
local function SetFocusHotkey(frame) | ||
frame:SetAttribute(modifier.."-type"..mouseButton,"focus") | ||
end | ||
|
||
local function CreateFrame_Hook(type, name, parent, template) | ||
if template == "SecureUnitButtonTemplate" then | ||
SetFocusHotkey(_G[name]) | ||
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 = { | ||
PlayerFrame, | ||
PetFrame, | ||
PartyMemberFrame1, | ||
PartyMemberFrame2, | ||
PartyMemberFrame3, | ||
PartyMemberFrame4, | ||
PartyMemberFrame1PetFrame, | ||
PartyMemberFrame2PetFrame, | ||
PartyMemberFrame3PetFrame, | ||
PartyMemberFrame4PetFrame, | ||
TargetFrame, | ||
TargetofTargetFrame, | ||
} | ||
|
||
for i,frame in pairs(duf) do | ||
SetFocusHotkey(frame) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## Interface: 30300 | ||
## Title: Focuser | ||
## Notes: Sets your focus by shift clicking | ||
## Author: Slizen, Areasis(Backporter) | ||
## Version 0.51 | ||
|
||
Focuser.lua |