From 14b7df729071782637aeee8a1b199a5f724c2f4f Mon Sep 17 00:00:00 2001 From: Snakybo Date: Fri, 25 Sep 2020 23:53:30 +0200 Subject: [PATCH] Add target of target binding option --- Config/Bindings.lua | 3 +++ Core/BindingProcessor.lua | 3 +++ Core/Utils.lua | 5 ++++- Locales/enUS.lua | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Config/Bindings.lua b/Config/Bindings.lua index a9c7039b..533610b7 100644 --- a/Config/Bindings.lua +++ b/Config/Bindings.lua @@ -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"], @@ -790,6 +791,7 @@ local function GetCommonTargetUnits() "PLAYER", "GLOBAL", "TARGET", + "TARGET_OF_TARGET", "MOUSEOVER", "FOCUS", "CURSOR", @@ -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"], diff --git a/Core/BindingProcessor.lua b/Core/BindingProcessor.lua index e63e4c59..541fe483 100644 --- a/Core/BindingProcessor.lua +++ b/Core/BindingProcessor.lua @@ -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", @@ -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 diff --git a/Core/Utils.lua b/Core/Utils.lua index ca37a332..650a1d08 100644 --- a/Core/Utils.lua +++ b/Core/Utils.lua @@ -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 @@ -85,4 +89,3 @@ function Clicked:CanUnitHaveFollowUp(unit) return true end - diff --git a/Locales/enUS.lua b/Locales/enUS.lua index 79c81dd6..57d8afbe 100644 --- a/Locales/enUS.lua +++ b/Locales/enUS.lua @@ -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"