Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

This document contains a temporary changelog to keep track of changes made in version 2.0

## [2.0]

### Removed

* Remove the ability tooltips module, as Midnight has severely handicapped the feature
1 change: 0 additions & 1 deletion Clicked/Clicked2.toc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ Core\Utils.lua
Core\LocaleUtils.lua
Core\StringUtils.lua
Core\Serializer.lua
Core\Tooltips.lua
Core\Upgrader.lua

Conditions\ConditionRegistry.lua
Expand Down
13 changes: 0 additions & 13 deletions Clicked/Config/Addon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,6 @@ function AddonOptions:CreateOptionsTable()
return Addon.db.profile.options.onKeyDown
end
},
tooltips = {
name = Addon.L["Show abilities in unit tooltips"],
desc = Addon.L["If enabled unit tooltips will be augmented to show abilities and keybinds that can be used on the target."],
type = "toggle",
order = 300,
width = "full",
set = function(_, val)
Addon.db.profile.options.tooltips = val
end,
get = function()
return Addon.db.profile.options.tooltips
end
},
bindUnassignedModifiers = {
name = Addon.L["Bind unassigned modifier keys automatically"],
desc = Addon.L["If enabled, modifier key combinations that aren't bound will be bound to the main key, for example, binding 'Q' will also bind 'SHIFT-Q', 'AlT-Q', and 'CTRL-Q'."],
Expand Down
104 changes: 0 additions & 104 deletions Clicked/Core/BindingProcessor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -732,110 +732,6 @@ function Clicked2:IterateActiveBindings()
return ipairs(activeBindings)
end

--- Get all bindings that, when activated at this moment, will affect the specified unit. This builds a full profile and the resulting table contains all
--- bindings that meet the criteria.
---
--- This function additionally checks for _similar_ units, for example, if the input unit is `focus` but the `focus` unit is also the `target` unit, it will
--- also include any bindings aimed at the `target` unit.
---
--- For each binding it also validates that the specified load and target conditions have been met. A binding that is only active in certain shapeshift forms
--- will not be included if the player is not currently in that shapeshift form.
---
--- For target `friend`/`harm` and `dead`/`nodead` modifiers, a similar check is performed.
---
--- @param unit string
--- @return Binding[]
function Clicked2:GetBindingsForUnit(unit)
assert(type(unit) == "string", "bad argument #1, expected table but got " .. type(unit))

--- @type Binding[]
local result = {}

--- @type table<string,boolean>
local units = {
[unit] = true
}

-- find other unit types that is valid for this target
for k in pairs(Addon.TargetUnit) do
local u = Addon:GetWoWUnitFromUnit(k)

if u ~= nil and u ~= unit then
local unitIsUnit = UnitIsUnit(u, unit)
units[u] = not issecretvalue(unitIsUnit) and unitIsUnit
end
end

--- @param target Binding.Target
--- @return boolean
local function IsTargetValid(target)
if target.hostility == Addon.TargetHostility.HELP and not UnitIsFriend("player", unit) or
target.hostility == Addon.TargetHostility.HARM and UnitIsFriend("player", unit) then
return false
end

if target.vitals == Addon.TargetVitals.DEAD and not UnitIsDeadOrGhost(unit) or
target.vitals == Addon.TargetVitals.ALIVE and UnitIsDeadOrGhost(unit) then
return false
end

return true
end

--- @param binding Binding
--- @return boolean
local function IsBindingValidForUnit(binding)
if binding.actionType ~= Clicked2.ActionType.SPELL and binding.actionType ~= Clicked2.ActionType.ITEM then
return false
end

if not Addon:IsBindingValidForCurrentState(binding) then
return false
end

-- hovercast
do
local hovercast = binding.targets.hovercast
local enabled = Addon:IsHovercastEnabled(binding)

if enabled and IsTargetValid(hovercast) then
local focus = GetMouseFoci()

for i = 1, #focus do
if focus[i] == WorldFrame then
return false
end
end

return true
end
end

-- regular
do
local enabled = Addon:IsMacroCastEnabled(binding)

if enabled then
local _, target = Clicked2:EvaluateBindingMacro(binding)

if target ~= nil and units[target] then
return true
end
end
end

return false
end

for _, binding in Clicked2:IterateActiveBindings() do
if IsBindingValidForUnit(binding) then
table.insert(result, binding)
end
end

return result
end

--- @param binding Binding
--- @return boolean
function Clicked2:IsBindingLoaded(binding)
Expand Down
27 changes: 0 additions & 27 deletions Clicked/Core/Clicked.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ local function PLAYER_REGEN_DISABLED()
openConfigOnCombatExit = Addon.BindingConfig.Window:IsOpen()

Addon.BindingConfig.Window:Close()
Addon:AbilityTooltips_Refresh()

if Addon:IsCombatProcessRequired() then
Clicked2:ProcessActiveBindings()
Expand All @@ -115,7 +114,6 @@ local function PLAYER_REGEN_ENABLED()
isPlayerInCombat = false

Addon:ProcessFrameQueue()
Addon:AbilityTooltips_Refresh()

if Addon:IsCombatProcessRequired() then
Clicked2:ProcessActiveBindings()
Expand Down Expand Up @@ -228,12 +226,6 @@ local function TRAIT_CONFIG_UPDATED()
end)
end

local function PLAYER_FOCUS_CHANGED()
Clicked2:LogVerbose("Received event {eventName}", "PLAYER_FOCUS_CHANGED")

Addon:AbilityTooltips_Refresh()
end

local function PLAYER_LEVEL_CHANGED()
Clicked2:LogVerbose("Received event {eventName}", "PLAYER_LEVEL_CHANGED")

Expand Down Expand Up @@ -272,18 +264,6 @@ local function GROUP_ROSTER_UPDATE()
Addon:ReloadBindings("GROUP_ROSTER_UPDATE")
end

local function MODIFIER_STATE_CHANGED()
Clicked2:LogVerbose("Received event {eventName}", "MODIFIER_STATE_CHANGED")

Addon:AbilityTooltips_Refresh()
end

local function UNIT_TARGET()
Clicked2:LogVerbose("Received event {eventName}", "UNIT_TARGET")

Addon:AbilityTooltips_Refresh()
end

local function RUNE_UPDATED()
Clicked2:LogVerbose("Received event {eventName}", "RUNE_UPDATED")

Expand Down Expand Up @@ -326,10 +306,6 @@ local function UpdateEventHooks(self, method)
method(self, "RUNE_UPDATED", RUNE_UPDATED)
end

if Addon.EXPANSION >= Addon.Expansion.TBC then
method(self, "PLAYER_FOCUS_CHANGED", PLAYER_FOCUS_CHANGED)
end

if Addon.EXPANSION <= Addon.Expansion.CATA then
method(self, "CHARACTER_POINTS_CHANGED", CHARACTER_POINTS_CHANGED)
end
Expand Down Expand Up @@ -366,8 +342,6 @@ local function UpdateEventHooks(self, method)
method(self, "ZONE_CHANGED", ZONE_CHANGED)
method(self, "ZONE_CHANGED_INDOORS", ZONE_CHANGED_INDOORS)
method(self, "ZONE_CHANGED_NEW_AREA", ZONE_CHANGED_NEW_AREA)
method(self, "MODIFIER_STATE_CHANGED", MODIFIER_STATE_CHANGED)
method(self, "UNIT_TARGET", UNIT_TARGET)
method(self, "ITEM_DATA_LOAD_RESULT", ITEM_DATA_LOAD_RESULT)
method(self, "ACTIONBAR_SLOT_CHANGED", ACTIONBAR_SLOT_CHANGED)
end
Expand Down Expand Up @@ -395,7 +369,6 @@ function Clicked2:OnInitialize()
Addon.ProfileOptions:Initialize()
Addon.BlacklistOptions:Initialize()
Addon:StatusOutput_Initialize()
Addon:AbilityTooltips_Initialize()

AceConsole:RegisterChatCommand("clicked2", HandleChatCommand)
AceConsole:RegisterChatCommand("cc2", HandleChatCommand)
Expand Down
1 change: 0 additions & 1 deletion Clicked/Core/Database.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ function Clicked2:GetDatabaseDefaults()
version = nil,
options = {
onKeyDown = true,
tooltips = false,
bindUnassignedModifiers = false,
autoBindActionBar = false,
minimap = {
Expand Down
Loading