Skip to content

Commit

Permalink
Add target of target binding option
Browse files Browse the repository at this point in the history
  • Loading branch information
Snakybo committed Sep 25, 2020
1 parent 00d5565 commit 14b7df7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Config/Bindings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@ local function GetCommonTargetUnits()
PLAYER = L["CFG_UI_ACTION_TARGET_UNIT_PLAYER"],
GLOBAL = L["CFG_UI_ACTION_TARGET_UNIT_GLOBAL"],
TARGET = L["CFG_UI_ACTION_TARGET_UNIT_TARGET"],
TARGET_OF_TARGET = L["CFG_UI_ACTION_TARGET_UNIT_TARGETTARGET"],
MOUSEOVER = L["CFG_UI_ACTION_TARGET_UNIT_MOUSEOVER"],
FOCUS = L["CFG_UI_ACTION_TARGET_UNIT_FOCUS"],
CURSOR = L["CFG_UI_ACTION_TARGET_UNIT_CURSOR"],
Expand All @@ -790,6 +791,7 @@ local function GetCommonTargetUnits()
"PLAYER",
"GLOBAL",
"TARGET",
"TARGET_OF_TARGET",
"MOUSEOVER",
"FOCUS",
"CURSOR",
Expand Down Expand Up @@ -1542,6 +1544,7 @@ local function DrawTreeView(container)
PLAYER = L["CFG_UI_ACTION_TARGET_UNIT_PLAYER"],
GLOBAL = L["CFG_UI_ACTION_TARGET_UNIT_GLOBAL"],
TARGET = L["CFG_UI_ACTION_TARGET_UNIT_TARGET"],
TARGET_OF_TARGET = L["CFG_UI_ACTION_TARGET_UNIT_TARGETTARGET"],
MOUSEOVER = L["CFG_UI_ACTION_TARGET_UNIT_MOUSEOVER"],
HOVERCAST = L["CFG_UI_ACTION_TARGET_UNIT_HOVERCAST"],
FOCUS = L["CFG_UI_ACTION_TARGET_UNIT_FOCUS"],
Expand Down
3 changes: 3 additions & 0 deletions Core/BindingProcessor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Clicked.TargetUnits = {
PLAYER = "PLAYER",
GLOBAL = "GLOBAL",
TARGET = "TARGET",
TARGET_OF_TARGET = "TARGET_OF_TARGET",
PARTY_1 = "PARTY_1",
PARTY_2 = "PARTY_2",
PARTY_3 = "PARTY_3",
Expand Down Expand Up @@ -64,6 +65,8 @@ local function GetMacroSegmentFromAction(action)
table.insert(flags, "@player")
elseif action.unit == Clicked.TargetUnits.TARGET then
table.insert(flags, "@target")
elseif action.unit == Clicked.TargetUnits.TARGET_OF_TARGET then
table.insert(flags, "@targettarget")
elseif action.unit == Clicked.TargetUnits.MOUSEOVER or action.unit == Clicked.TargetUnits.HOVERCAST then
table.insert(flags, "@mouseover")
elseif action.unit == Clicked.TargetUnits.PARTY_1 then
Expand Down
5 changes: 4 additions & 1 deletion Core/Utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ function Clicked:CanUnitBeHostile(unit)
return true
end

if unit == Clicked.TargetUnits.TARGET_OF_TARGET then
return true
end

if unit == Clicked.TargetUnits.FOCUS then
return true
end
Expand Down Expand Up @@ -85,4 +89,3 @@ function Clicked:CanUnitHaveFollowUp(unit)

return true
end

1 change: 1 addition & 0 deletions Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ L["CFG_UI_ACTION_TARGET_UNIT_EXTRA"] = "Or"
L["CFG_UI_ACTION_TARGET_UNIT_PLAYER"] = "Player (you)"
L["CFG_UI_ACTION_TARGET_UNIT_GLOBAL"] = "Global (no target)"
L["CFG_UI_ACTION_TARGET_UNIT_TARGET"] = "Target"
L["CFG_UI_ACTION_TARGET_UNIT_TARGETTARGET"] = "Target of target"
L["CFG_UI_ACTION_TARGET_UNIT_MOUSEOVER"] = "Mouseover target"
L["CFG_UI_ACTION_TARGET_UNIT_HOVERCAST"] = "Mouseover unit frame"
L["CFG_UI_ACTION_TARGET_UNIT_FOCUS"] = "Focus target"
Expand Down

0 comments on commit 14b7df7

Please sign in to comment.