committed by
GitHub
parent
3b440fb15f
commit
960eafdab0
+144
-138
@@ -1,13 +1,15 @@
|
||||
--[[---------------------------------------------------------------------------------
|
||||
Clique by Cladhaire <cladhaire@gmail.com>
|
||||
----------------------------------------------------------------------------------]]
|
||||
|
||||
Clique = {Locals = {}}
|
||||
----------------------------------------------------------------------------------]] Clique = {
|
||||
Locals = {}
|
||||
}
|
||||
|
||||
assert(DongleStub, string.format("Clique requires DongleStub."))
|
||||
DongleStub("Dongle-1.2"):New("Clique", Clique)
|
||||
Clique.version = GetAddOnMetadata("Clique", "Version")
|
||||
if Clique.version == "wowi:revision" then Clique.version = "SVN" end
|
||||
if Clique.version == "wowi:revision" then
|
||||
Clique.version = "SVN"
|
||||
end
|
||||
|
||||
local L = Clique.Locals
|
||||
|
||||
@@ -22,16 +24,15 @@ function Clique:Enable()
|
||||
[L.CLICKSET_DEFAULT] = {},
|
||||
[L.CLICKSET_HARMFUL] = {},
|
||||
[L.CLICKSET_HELPFUL] = {},
|
||||
[L.CLICKSET_OOC] = {},
|
||||
[L.CLICKSET_OOC] = {}
|
||||
},
|
||||
blacklist = {
|
||||
},
|
||||
tooltips = false,
|
||||
blacklist = {},
|
||||
tooltips = false
|
||||
},
|
||||
char = {
|
||||
switchSpec = false,
|
||||
downClick = false,
|
||||
},
|
||||
downClick = false
|
||||
}
|
||||
}
|
||||
|
||||
self.db = self:InitializeDB("CliqueDB", self.defaults)
|
||||
@@ -43,7 +44,7 @@ function Clique:Enable()
|
||||
ClickCastFrames = ClickCastFrames or {}
|
||||
self.ccframes = ClickCastFrames
|
||||
|
||||
local newindex = function(t,k,v)
|
||||
local newindex = function(t, k, v)
|
||||
if v == nil then
|
||||
Clique:UnregisterFrame(k)
|
||||
rawset(self.ccframes, k, nil)
|
||||
@@ -53,7 +54,9 @@ function Clique:Enable()
|
||||
end
|
||||
end
|
||||
|
||||
ClickCastFrames = setmetatable({}, {__newindex=newindex})
|
||||
ClickCastFrames = setmetatable({}, {
|
||||
__newindex = newindex
|
||||
})
|
||||
|
||||
Clique:OptionsOnLoad()
|
||||
Clique:EnableFrames()
|
||||
@@ -67,15 +70,15 @@ function Clique:Enable()
|
||||
self:RegisterEvent("PLAYER_REGEN_DISABLED")
|
||||
|
||||
self:RegisterEvent("LEARNED_SPELL_IN_TAB")
|
||||
self:RegisterEvent("COMMENTATOR_SKIRMISH_QUEUE_REQUEST")
|
||||
self:RegisterEvent("ASCENSION_CA_SPECIALIZATION_ACTIVE_ID_CHANGED")
|
||||
self:RegisterEvent("ADDON_LOADED")
|
||||
|
||||
-- Change to correct profile based on talent spec
|
||||
if self.db.char.switchSpec then
|
||||
self.silentProfile = true
|
||||
self.talentGroup = CA_GetActiveSpecId() + 1
|
||||
if self.db.char["spec"..self.talentGroup.."Profile"] then
|
||||
self.db:SetProfile(self.db.char["spec"..self.talentGroup.."Profile"])
|
||||
if self.db.char["spec" .. self.talentGroup .. "Profile"] then
|
||||
self.db:SetProfile(self.db.char["spec" .. self.talentGroup .. "Profile"])
|
||||
end
|
||||
self.silentProfile = false
|
||||
end
|
||||
@@ -90,7 +93,7 @@ function Clique:Enable()
|
||||
-- Securehook CreateFrame to catch any new raid frames
|
||||
local raidFunc = function(type, name, parent, template)
|
||||
if template == "RaidPulloutButtonTemplate" then
|
||||
ClickCastFrames[getglobal(name.."ClearButton")] = true
|
||||
ClickCastFrames[getglobal(name .. "ClearButton")] = true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -113,7 +116,8 @@ function Clique:Enable()
|
||||
self.cmd:RegisterSlashHandler("debug - Enables extra messages for debugging purposes", "debug", "ShowAttributes")
|
||||
self.cmd:InjectDBCommands(self.db, "copy", "delete", "list", "reset", "set")
|
||||
self.cmd:RegisterSlashHandler("tooltip - Enables binding lists in tooltips.", "tooltip", "ToggleTooltip")
|
||||
self.cmd:RegisterSlashHandler("showbindings - Shows a window that contains the current bindings", "showbindings", "ShowBindings")
|
||||
self.cmd:RegisterSlashHandler("showbindings - Shows a window that contains the current bindings", "showbindings",
|
||||
"ShowBindings")
|
||||
|
||||
-- Place the Clique tab
|
||||
self:LEARNED_SPELL_IN_TAB()
|
||||
@@ -125,36 +129,20 @@ function Clique:Enable()
|
||||
end
|
||||
|
||||
function Clique:EnableFrames()
|
||||
local tbl = {
|
||||
PlayerFrame,
|
||||
PetFrame,
|
||||
PartyMemberFrame1,
|
||||
PartyMemberFrame2,
|
||||
PartyMemberFrame3,
|
||||
PartyMemberFrame4,
|
||||
PartyMemberFrame1PetFrame,
|
||||
PartyMemberFrame2PetFrame,
|
||||
PartyMemberFrame3PetFrame,
|
||||
PartyMemberFrame4PetFrame,
|
||||
TargetFrame,
|
||||
TargetFrameToT,
|
||||
FocusFrame,
|
||||
FocusFrameToT,
|
||||
Boss1TargetFrame,
|
||||
Boss2TargetFrame,
|
||||
Boss3TargetFrame,
|
||||
Boss4TargetFrame,
|
||||
}
|
||||
local tbl = {PlayerFrame, PetFrame, PartyMemberFrame1, PartyMemberFrame2, PartyMemberFrame3, PartyMemberFrame4,
|
||||
PartyMemberFrame1PetFrame, PartyMemberFrame2PetFrame, PartyMemberFrame3PetFrame,
|
||||
PartyMemberFrame4PetFrame, TargetFrame, TargetFrameToT, FocusFrame, FocusFrameToT, Boss1TargetFrame,
|
||||
Boss2TargetFrame, Boss3TargetFrame, Boss4TargetFrame}
|
||||
|
||||
for i,frame in pairs(tbl) do
|
||||
for i, frame in pairs(tbl) do
|
||||
rawset(self.ccframes, frame, true)
|
||||
end
|
||||
end
|
||||
|
||||
function Clique:SpellBookButtonPressed(frame, button)
|
||||
local texture = getglobal(frame:GetParent():GetName().."IconTexture"):GetTexture()
|
||||
local name = getglobal(frame:GetParent():GetName().."SpellName"):GetText()
|
||||
local rank = getglobal(frame:GetParent():GetName().."SubSpellName"):GetText()
|
||||
local texture = getglobal(frame:GetParent():GetName() .. "IconTexture"):GetTexture()
|
||||
local name = getglobal(frame:GetParent():GetName() .. "SpellName"):GetText()
|
||||
local rank = getglobal(frame:GetParent():GetName() .. "SubSpellName"):GetText()
|
||||
|
||||
if rank == L.RACIAL_PASSIVE or rank == L.PASSIVE then
|
||||
StaticPopup_Show("CLIQUE_PASSIVE_SKILL")
|
||||
@@ -183,7 +171,7 @@ function Clique:SpellBookButtonPressed(frame, button)
|
||||
["texture"] = texture,
|
||||
["type"] = type,
|
||||
["arg1"] = name,
|
||||
["arg2"] = rank,
|
||||
["arg2"] = rank
|
||||
}
|
||||
|
||||
local key = t.modifier .. t.button
|
||||
@@ -291,11 +279,11 @@ function Clique:ApplyClickSet(name, frame)
|
||||
local set = self.clicksets[name] or name
|
||||
|
||||
if frame then
|
||||
for modifier,entry in pairs(set) do
|
||||
for modifier, entry in pairs(set) do
|
||||
self:SetAttribute(entry, frame)
|
||||
end
|
||||
else
|
||||
for modifier,entry in pairs(set) do
|
||||
for modifier, entry in pairs(set) do
|
||||
self:SetAction(entry)
|
||||
end
|
||||
end
|
||||
@@ -305,11 +293,11 @@ function Clique:RemoveClickSet(name, frame)
|
||||
local set = self.clicksets[name] or name
|
||||
|
||||
if frame then
|
||||
for modifier,entry in pairs(set) do
|
||||
for modifier, entry in pairs(set) do
|
||||
self:DeleteAttribute(entry, frame)
|
||||
end
|
||||
else
|
||||
for modifier,entry in pairs(set) do
|
||||
for modifier, entry in pairs(set) do
|
||||
self:DeleteAction(entry)
|
||||
end
|
||||
end
|
||||
@@ -317,8 +305,8 @@ end
|
||||
|
||||
function Clique:UnregisterFrame(frame)
|
||||
assert(not InCombatLockdown(), "An addon attempted to unregister a frame from Clique while in combat.")
|
||||
for name,set in pairs(self.clicksets) do
|
||||
for modifier,entry in pairs(set) do
|
||||
for name, set in pairs(self.clicksets) do
|
||||
for modifier, entry in pairs(set) do
|
||||
self:DeleteAttribute(entry, frame)
|
||||
end
|
||||
end
|
||||
@@ -330,7 +318,7 @@ function Clique:DONGLE_PROFILE_CHANGED(event, db, parent, svname, profileKey)
|
||||
self:PrintF(L.PROFILE_CHANGED, profileKey)
|
||||
end
|
||||
|
||||
for name,set in pairs(self.clicksets) do
|
||||
for name, set in pairs(self.clicksets) do
|
||||
self:RemoveClickSet(set)
|
||||
end
|
||||
self:RemoveClickSet(self.ooc)
|
||||
@@ -352,7 +340,7 @@ end
|
||||
|
||||
function Clique:DONGLE_PROFILE_RESET(event, db, parent, svname, profileKey)
|
||||
if db == self.db then
|
||||
for name,set in pairs(self.clicksets) do
|
||||
for name, set in pairs(self.clicksets) do
|
||||
self:RemoveClickSet(set)
|
||||
end
|
||||
self:RemoveClickSet(self.ooc)
|
||||
@@ -373,7 +361,6 @@ function Clique:DONGLE_PROFILE_RESET(event, db, parent, svname, profileKey)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function Clique:DONGLE_PROFILE_DELETED(event, db, parent, svname, profileKey)
|
||||
if db == self.db then
|
||||
self:PrintF(L.PROFILE_DELETED, profileKey)
|
||||
@@ -392,31 +379,31 @@ function Clique:SetAttribute(entry, frame)
|
||||
end
|
||||
|
||||
-- Set up any special attributes
|
||||
local type,button,value
|
||||
local type, button, value
|
||||
|
||||
if not tonumber(entry.button) then
|
||||
type,button = select(3, string.find(entry.button, "(%a+)button(%d+)"))
|
||||
frame:SetAttribute(entry.modifier..entry.button, type..button)
|
||||
assert(frame:GetAttribute(entry.modifier..entry.button, type..button))
|
||||
type, button = select(3, string.find(entry.button, "(%a+)button(%d+)"))
|
||||
frame:SetAttribute(entry.modifier .. entry.button, type .. button)
|
||||
assert(frame:GetAttribute(entry.modifier .. entry.button, type .. button))
|
||||
button = string.format("-%s%s", type, button)
|
||||
end
|
||||
|
||||
button = button or entry.button
|
||||
|
||||
if entry.type == "actionbar" then
|
||||
frame:SetAttribute(entry.modifier.."type"..button, entry.type)
|
||||
frame:SetAttribute(entry.modifier.."action"..button, entry.arg1)
|
||||
frame:SetAttribute(entry.modifier .. "type" .. button, entry.type)
|
||||
frame:SetAttribute(entry.modifier .. "action" .. button, entry.arg1)
|
||||
elseif entry.type == "action" then
|
||||
frame:SetAttribute(entry.modifier.."type"..button, entry.type)
|
||||
frame:SetAttribute(entry.modifier.."action"..button, entry.arg1)
|
||||
frame:SetAttribute(entry.modifier .. "type" .. button, entry.type)
|
||||
frame:SetAttribute(entry.modifier .. "action" .. button, entry.arg1)
|
||||
if entry.arg2 then
|
||||
frame:SetAttribute(entry.modifier.."unit"..button, entry.arg2)
|
||||
frame:SetAttribute(entry.modifier .. "unit" .. button, entry.arg2)
|
||||
end
|
||||
elseif entry.type == "pet" then
|
||||
frame:SetAttribute(entry.modifier.."type"..button, entry.type)
|
||||
frame:SetAttribute(entry.modifier.."action"..button, entry.arg1)
|
||||
frame:SetAttribute(entry.modifier .. "type" .. button, entry.type)
|
||||
frame:SetAttribute(entry.modifier .. "action" .. button, entry.arg1)
|
||||
if entry.arg2 then
|
||||
frame:SetAttribute(entry.modifier.."unit"..button, entry.arg2)
|
||||
frame:SetAttribute(entry.modifier .. "unit" .. button, entry.arg2)
|
||||
end
|
||||
elseif entry.type == "spell" then
|
||||
local rank = entry.arg2
|
||||
@@ -433,59 +420,59 @@ function Clique:SetAttribute(entry, frame)
|
||||
cast = entry.arg1
|
||||
end
|
||||
|
||||
frame:SetAttribute(entry.modifier.."type"..button, entry.type)
|
||||
frame:SetAttribute(entry.modifier.."spell"..button, cast)
|
||||
frame:SetAttribute(entry.modifier .. "type" .. button, entry.type)
|
||||
frame:SetAttribute(entry.modifier .. "spell" .. button, cast)
|
||||
|
||||
frame:SetAttribute(entry.modifier.."bag"..button, entry.arg2)
|
||||
frame:SetAttribute(entry.modifier.."slot"..button, entry.arg3)
|
||||
frame:SetAttribute(entry.modifier.."item"..button, entry.arg4)
|
||||
frame:SetAttribute(entry.modifier .. "bag" .. button, entry.arg2)
|
||||
frame:SetAttribute(entry.modifier .. "slot" .. button, entry.arg3)
|
||||
frame:SetAttribute(entry.modifier .. "item" .. button, entry.arg4)
|
||||
if entry.arg5 then
|
||||
frame:SetAttribute(entry.modifier.."unit"..button, entry.arg5)
|
||||
frame:SetAttribute(entry.modifier .. "unit" .. button, entry.arg5)
|
||||
end
|
||||
elseif entry.type == "item" then
|
||||
frame:SetAttribute(entry.modifier.."type"..button, entry.type)
|
||||
frame:SetAttribute(entry.modifier.."bag"..button, entry.arg1)
|
||||
frame:SetAttribute(entry.modifier.."slot"..button, entry.arg2)
|
||||
frame:SetAttribute(entry.modifier.."item"..button, entry.arg3)
|
||||
frame:SetAttribute(entry.modifier .. "type" .. button, entry.type)
|
||||
frame:SetAttribute(entry.modifier .. "bag" .. button, entry.arg1)
|
||||
frame:SetAttribute(entry.modifier .. "slot" .. button, entry.arg2)
|
||||
frame:SetAttribute(entry.modifier .. "item" .. button, entry.arg3)
|
||||
if entry.arg4 then
|
||||
frame:SetAttribute(entry.modifier.."unit"..button, entry.arg4)
|
||||
frame:SetAttribute(entry.modifier .. "unit" .. button, entry.arg4)
|
||||
end
|
||||
elseif entry.type == "macro" then
|
||||
frame:SetAttribute(entry.modifier.."type"..button, entry.type)
|
||||
frame:SetAttribute(entry.modifier .. "type" .. button, entry.type)
|
||||
if entry.arg1 then
|
||||
frame:SetAttribute(entry.modifier.."macro"..button, entry.arg1)
|
||||
frame:SetAttribute(entry.modifier .. "macro" .. button, entry.arg1)
|
||||
else
|
||||
local unit = SecureButton_GetModifiedUnit(frame, entry.modifier.."unit"..button)
|
||||
local unit = SecureButton_GetModifiedUnit(frame, entry.modifier .. "unit" .. button)
|
||||
local macro = tostring(entry.arg2)
|
||||
if unit and macro then
|
||||
macro = macro:gsub("target%s*=%s*clique", "target="..unit)
|
||||
macro = macro:gsub("target%s*=%s*clique", "target=" .. unit)
|
||||
end
|
||||
|
||||
frame:SetAttribute(entry.modifier.."macro"..button, nil)
|
||||
frame:SetAttribute(entry.modifier.."macrotext"..button, macro)
|
||||
frame:SetAttribute(entry.modifier .. "macro" .. button, nil)
|
||||
frame:SetAttribute(entry.modifier .. "macrotext" .. button, macro)
|
||||
end
|
||||
elseif entry.type == "stop" then
|
||||
frame:SetAttribute(entry.modifier.."type"..button, entry.type)
|
||||
frame:SetAttribute(entry.modifier .. "type" .. button, entry.type)
|
||||
elseif entry.type == "target" then
|
||||
frame:SetAttribute(entry.modifier.."type"..button, entry.type)
|
||||
frame:SetAttribute(entry.modifier .. "type" .. button, entry.type)
|
||||
if entry.arg1 then
|
||||
frame:SetAttribute(entry.modifier.."unit"..button, entry.arg1)
|
||||
frame:SetAttribute(entry.modifier .. "unit" .. button, entry.arg1)
|
||||
end
|
||||
elseif entry.type == "focus" then
|
||||
frame:SetAttribute(entry.modifier.."type"..button, entry.type)
|
||||
frame:SetAttribute(entry.modifier .. "type" .. button, entry.type)
|
||||
if entry.arg1 then
|
||||
frame:SetAttribute(entry.modifier.."unit"..button, entry.arg1)
|
||||
frame:SetAttribute(entry.modifier .. "unit" .. button, entry.arg1)
|
||||
end
|
||||
elseif entry.type == "assist" then
|
||||
frame:SetAttribute(entry.modifier.."type"..button, entry.type)
|
||||
frame:SetAttribute(entry.modifier .. "type" .. button, entry.type)
|
||||
if entry.arg1 then
|
||||
frame:SetAttribute(entry.modifier.."unit"..button, entry.arg1)
|
||||
frame:SetAttribute(entry.modifier .. "unit" .. button, entry.arg1)
|
||||
end
|
||||
elseif entry.type == "click" then
|
||||
frame:SetAttribute(entry.modifier.."type"..button, entry.type)
|
||||
frame:SetAttribute(entry.modifier.."clickbutton"..button, getglobal(entry.arg1))
|
||||
frame:SetAttribute(entry.modifier .. "type" .. button, entry.type)
|
||||
frame:SetAttribute(entry.modifier .. "clickbutton" .. button, getglobal(entry.arg1))
|
||||
elseif entry.type == "menu" then
|
||||
frame:SetAttribute(entry.modifier.."type"..button, entry.type)
|
||||
frame:SetAttribute(entry.modifier .. "type" .. button, entry.type)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -495,11 +482,11 @@ function Clique:DeleteAttribute(entry, frame)
|
||||
return
|
||||
end
|
||||
|
||||
local type,button,value
|
||||
local type, button, value
|
||||
|
||||
if not tonumber(entry.button) then
|
||||
type,button = select(3, string.find(entry.button, "(%a+)button(%d+)"))
|
||||
frame:SetAttribute(entry.modifier..entry.button, nil)
|
||||
type, button = select(3, string.find(entry.button, "(%a+)button(%d+)"))
|
||||
frame:SetAttribute(entry.modifier .. entry.button, nil)
|
||||
button = string.format("-%s%s", type, button)
|
||||
end
|
||||
|
||||
@@ -507,12 +494,12 @@ function Clique:DeleteAttribute(entry, frame)
|
||||
|
||||
entry.delete = true
|
||||
|
||||
frame:SetAttribute(entry.modifier.."type"..button, nil)
|
||||
frame:SetAttribute(entry.modifier..entry.type..button, nil)
|
||||
frame:SetAttribute(entry.modifier .. "type" .. button, nil)
|
||||
frame:SetAttribute(entry.modifier .. entry.type .. button, nil)
|
||||
end
|
||||
|
||||
function Clique:SetAction(entry)
|
||||
for frame,enabled in pairs(self.ccframes) do
|
||||
for frame, enabled in pairs(self.ccframes) do
|
||||
if enabled then
|
||||
self:SetAttribute(entry, frame)
|
||||
end
|
||||
@@ -527,7 +514,9 @@ end
|
||||
|
||||
function Clique:ShowAttributes()
|
||||
self:Print("Enabled enhanced debugging.")
|
||||
PlayerFrame:SetScript("OnAttributeChanged", function(...) self:Print(...) end)
|
||||
PlayerFrame:SetScript("OnAttributeChanged", function(...)
|
||||
self:Print(...)
|
||||
end)
|
||||
self:UnregisterFrame(PlayerFrame)
|
||||
self:RegisterFrame(PlayerFrame)
|
||||
end
|
||||
@@ -543,44 +532,64 @@ function Clique:UpdateTooltip()
|
||||
local harm = self.clicksets[L.CLICKSET_HARMFUL]
|
||||
local help = self.clicksets[L.CLICKSET_HELPFUL]
|
||||
|
||||
for k,v in pairs(tt_ooc) do tt_ooc[k] = nil end
|
||||
for k,v in pairs(tt_help) do tt_help[k] = nil end
|
||||
for k,v in pairs(tt_harm) do tt_harm[k] = nil end
|
||||
for k,v in pairs(tt_default) do tt_default[k] = nil end
|
||||
for k, v in pairs(tt_ooc) do
|
||||
tt_ooc[k] = nil
|
||||
end
|
||||
for k, v in pairs(tt_help) do
|
||||
tt_help[k] = nil
|
||||
end
|
||||
for k, v in pairs(tt_harm) do
|
||||
tt_harm[k] = nil
|
||||
end
|
||||
for k, v in pairs(tt_default) do
|
||||
tt_default[k] = nil
|
||||
end
|
||||
|
||||
-- Build the ooc lines, which includes both helpful and harmful
|
||||
for k,v in pairs(ooc) do
|
||||
for k, v in pairs(ooc) do
|
||||
local button = self:GetButtonText(v.button)
|
||||
local mod = string.format("%s%s", v.modifier or "", button)
|
||||
local action = string.format("%s (%s)", v.arg1 or "", v.type)
|
||||
table.insert(tt_ooc, {mod = mod, action = action})
|
||||
table.insert(tt_ooc, {
|
||||
mod = mod,
|
||||
action = action
|
||||
})
|
||||
end
|
||||
|
||||
-- Build the default lines
|
||||
for k,v in pairs(default) do
|
||||
for k, v in pairs(default) do
|
||||
local button = self:GetButtonText(v.button)
|
||||
local mod = string.format("%s%s", v.modifier or "", button)
|
||||
local action = string.format("%s (%s)", v.arg1 or "", v.type)
|
||||
table.insert(tt_default, {mod = mod, action = action})
|
||||
table.insert(tt_default, {
|
||||
mod = mod,
|
||||
action = action
|
||||
})
|
||||
end
|
||||
|
||||
-- Build the harm lines
|
||||
for k,v in pairs(harm) do
|
||||
for k, v in pairs(harm) do
|
||||
local button = self:GetButtonText(v.button)
|
||||
local mod = string.format("%s%s", v.modifier or "", button)
|
||||
local action = string.format("%s (%s)", v.arg1 or "", v.type)
|
||||
table.insert(tt_harm, {mod = mod, action = action})
|
||||
table.insert(tt_harm, {
|
||||
mod = mod,
|
||||
action = action
|
||||
})
|
||||
end
|
||||
|
||||
-- Build the help lines
|
||||
for k,v in pairs(help) do
|
||||
for k, v in pairs(help) do
|
||||
local button = self:GetButtonText(v.button)
|
||||
local mod = string.format("%s%s", v.modifier or "", button)
|
||||
local action = string.format("%s (%s)", v.arg1 or "", v.type)
|
||||
table.insert(tt_help, {mod = mod, action = action})
|
||||
table.insert(tt_help, {
|
||||
mod = mod,
|
||||
action = action
|
||||
})
|
||||
end
|
||||
|
||||
local function sort(a,b)
|
||||
local function sort(a, b)
|
||||
return a.mod < b.mod
|
||||
end
|
||||
|
||||
@@ -591,39 +600,45 @@ function Clique:UpdateTooltip()
|
||||
end
|
||||
|
||||
function Clique:AddTooltipLines()
|
||||
if not self.profile.tooltips then return end
|
||||
if not self.profile.tooltips then
|
||||
return
|
||||
end
|
||||
|
||||
local frame = GetMouseFocus()
|
||||
if not frame then return end
|
||||
if not self.ccframes[frame] then return end
|
||||
if not frame then
|
||||
return
|
||||
end
|
||||
if not self.ccframes[frame] then
|
||||
return
|
||||
end
|
||||
|
||||
-- Add a buffer line
|
||||
GameTooltip:AddLine(" ")
|
||||
if UnitAffectingCombat("player") then
|
||||
if #tt_default ~= 0 then
|
||||
GameTooltip:AddLine("Default bindings:")
|
||||
for k,v in ipairs(tt_default) do
|
||||
for k, v in ipairs(tt_default) do
|
||||
GameTooltip:AddDoubleLine(v.mod, v.action, 1, 1, 1, 1, 1, 1)
|
||||
end
|
||||
end
|
||||
|
||||
if #tt_help ~= 0 and not UnitCanAttack("player", "mouseover") then
|
||||
GameTooltip:AddLine("Helpful bindings:")
|
||||
for k,v in ipairs(tt_help) do
|
||||
for k, v in ipairs(tt_help) do
|
||||
GameTooltip:AddDoubleLine(v.mod, v.action, 1, 1, 1, 1, 1, 1)
|
||||
end
|
||||
end
|
||||
|
||||
if #tt_harm ~= 0 and UnitCanAttack("player", "mouseover") then
|
||||
GameTooltip:AddLine("Hostile bindings:")
|
||||
for k,v in ipairs(tt_harm) do
|
||||
for k, v in ipairs(tt_harm) do
|
||||
GameTooltip:AddDoubleLine(v.mod, v.action, 1, 1, 1, 1, 1, 1)
|
||||
end
|
||||
end
|
||||
else
|
||||
if #tt_ooc ~= 0 then
|
||||
GameTooltip:AddLine("Out of combat bindings:")
|
||||
for k,v in ipairs(tt_ooc) do
|
||||
for k, v in ipairs(tt_ooc) do
|
||||
GameTooltip:AddDoubleLine(v.mod, v.action, 1, 1, 1, 1, 1, 1)
|
||||
end
|
||||
end
|
||||
@@ -632,8 +647,7 @@ end
|
||||
|
||||
function Clique:ToggleTooltip()
|
||||
self.profile.tooltips = not self.profile.tooltips
|
||||
self:PrintF("Listing of bindings in tooltips has been %s",
|
||||
self.profile.tooltips and "Enabled" or "Disabled")
|
||||
self:PrintF("Listing of bindings in tooltips has been %s", self.profile.tooltips and "Enabled" or "Disabled")
|
||||
end
|
||||
|
||||
function Clique:ShowBindings()
|
||||
@@ -655,7 +669,8 @@ function Clique:ShowBindings()
|
||||
CliqueTooltip:SetMovable()
|
||||
CliqueTooltip:SetPadding(16)
|
||||
CliqueTooltip:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b);
|
||||
CliqueTooltip:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b);
|
||||
CliqueTooltip:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g,
|
||||
TOOLTIP_DEFAULT_BACKGROUND_COLOR.b);
|
||||
|
||||
CliqueTooltip:RegisterForDrag("LeftButton")
|
||||
CliqueTooltip:SetScript("OnDragStart", function(self)
|
||||
@@ -678,7 +693,7 @@ function Clique:ShowBindings()
|
||||
if #tt_default > 0 then
|
||||
CliqueTooltip:AddLine(" ")
|
||||
CliqueTooltip:AddLine("Default bindings:")
|
||||
for k,v in ipairs(tt_default) do
|
||||
for k, v in ipairs(tt_default) do
|
||||
CliqueTooltip:AddDoubleLine(v.mod, v.action, 1, 1, 1, 1, 1, 1)
|
||||
end
|
||||
end
|
||||
@@ -686,7 +701,7 @@ function Clique:ShowBindings()
|
||||
if #tt_help > 0 then
|
||||
CliqueTooltip:AddLine(" ")
|
||||
CliqueTooltip:AddLine("Helpful bindings:")
|
||||
for k,v in ipairs(tt_help) do
|
||||
for k, v in ipairs(tt_help) do
|
||||
CliqueTooltip:AddDoubleLine(v.mod, v.action, 1, 1, 1, 1, 1, 1)
|
||||
end
|
||||
end
|
||||
@@ -694,7 +709,7 @@ function Clique:ShowBindings()
|
||||
if #tt_harm > 0 then
|
||||
CliqueTooltip:AddLine(" ")
|
||||
CliqueTooltip:AddLine("Hostile bindings:")
|
||||
for k,v in ipairs(tt_harm) do
|
||||
for k, v in ipairs(tt_harm) do
|
||||
CliqueTooltip:AddDoubleLine(v.mod, v.action, 1, 1, 1, 1, 1, 1)
|
||||
end
|
||||
end
|
||||
@@ -702,7 +717,7 @@ function Clique:ShowBindings()
|
||||
if #tt_ooc > 0 then
|
||||
CliqueTooltip:AddLine(" ")
|
||||
CliqueTooltip:AddLine("Out of combat bindings:")
|
||||
for k,v in ipairs(tt_ooc) do
|
||||
for k, v in ipairs(tt_ooc) do
|
||||
CliqueTooltip:AddDoubleLine(v.mod, v.action, 1, 1, 1, 1, 1, 1)
|
||||
end
|
||||
end
|
||||
@@ -710,16 +725,13 @@ function Clique:ShowBindings()
|
||||
CliqueTooltip:Show()
|
||||
end
|
||||
|
||||
function Clique:COMMENTATOR_SKIRMISH_QUEUE_REQUEST(event, typeName, newGroup)
|
||||
if typeName ~= "ASCENSION_CA_SPECIALIZATION_ACTIVE_ID_CHANGED" then return end
|
||||
|
||||
function Clique:ASCENSION_CA_SPECIALIZATION_ACTIVE_ID_CHANGED(event, newGroup)
|
||||
if self.db.char.switchSpec then
|
||||
self:Print("Detected a talent spec change, changing profile")
|
||||
-- self:Print("Detected "..typeName..", changing profile to "..newGroup)
|
||||
|
||||
newGroup = newGroup + 1
|
||||
if self.db.char["spec"..newGroup.."Profile"] then
|
||||
self.db:SetProfile(self.db.char["spec"..newGroup.."Profile"])
|
||||
if self.db.char["spec" .. newGroup .. "Profile"] then
|
||||
self.db:SetProfile(self.db.char["spec" .. newGroup .. "Profile"])
|
||||
end
|
||||
|
||||
if CliqueFrame then
|
||||
@@ -742,15 +754,9 @@ function Clique:SetClickType(frame)
|
||||
end
|
||||
|
||||
function Clique:EnableArenaFrames()
|
||||
local arenaFrames = {
|
||||
ArenaEnemyFrame1,
|
||||
ArenaEnemyFrame2,
|
||||
ArenaEnemyFrame3,
|
||||
ArenaEnemyFrame4,
|
||||
ArenaEnemyFrame5,
|
||||
}
|
||||
local arenaFrames = {ArenaEnemyFrame1, ArenaEnemyFrame2, ArenaEnemyFrame3, ArenaEnemyFrame4, ArenaEnemyFrame5}
|
||||
|
||||
for idx,frame in ipairs(arenaFrames) do
|
||||
for idx, frame in ipairs(arenaFrames) do
|
||||
rawset(self.ccframes, frame, true)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user