/trunk
end |
end |
local function onEnter(self) |
GameTooltip:SetOwner(self, "ANCHOR_RIGHT", self:GetWidth()/-2, 5) |
GameTooltip:SetSpellByID(self.id) |
GameTooltip:AddLine("\nClick to add or remove.", 0, 1, 0) |
GameTooltip:AddLine("Shift-click to summon (won't add pet to set).", 0, 1, 0, true) |
GameTooltip:Show() |
end |
local function onLeave(self) |
GameTooltip:Hide() |
end |
local function onClick(self) |
if IsShiftKeyDown() then CallCompanion("CRITTER", self.index) return end |
if findKey(self.index) then |
removeKey(self.index) |
self.icon:SetDesaturated(true) |
self.icon:SetVertexColor(.6, .6, .6) |
else |
table.insert(SoundwaveDB, self.index) |
self.icon:SetDesaturated(false) |
self.icon:SetVertexColor(1, 1, 1) |
end |
end |
local function onShow(self) |
if not findKey(self.index) then |
self.icon:SetDesaturated(true) |
self.icon:SetVertexColor(.6, .6, .6) |
else |
self.icon:SetDesaturated(false) |
self.icon:SetVertexColor(1, 1, 1) |
end |
end |
local row = 7 |
local size = 36 |
local function CreateButton(parent) |
icon:SetTexCoord(0.03, 0.97, 0.03, 0.97) |
cb.icon = icon |
cb:SetScript("OnEnter", function(self) |
GameTooltip:SetOwner(self, "ANCHOR_RIGHT", self:GetWidth()/-2, 5) |
GameTooltip:SetSpellByID(self.id) |
GameTooltip:AddLine("\nClick to add or remove.", 0, 1, 0) |
GameTooltip:AddLine("Shift-click to summon (won't add pet to set).", 0, 1, 0, true) |
GameTooltip:Show() |
end) |
cb:SetScript("OnEnter", onEnter) |
cb:SetScript("OnLeave", onLeave) |
cb:SetScript("OnClick", onClick) |
cb:SetScript("OnShow", onShow) |
cb:SetScript("OnLeave", function(self) GameTooltip:Hide() end) |
cb:SetScript("OnClick", function(self) |
if IsShiftKeyDown() then CallCompanion("CRITTER", self.index) return end |
if findKey(self.index) then |
removeKey(self.index) |
self.icon:SetDesaturated(true) |
else |
table.insert(SoundwaveDB, self.index) |
self.icon:SetDesaturated(false) |
end |
end) |
cb:SetScript("OnShow", function(self) |
self.icon:SetDesaturated(not findKey(self.index)) |
end) |
return cb |
end |
## Title: Soundwave |
## Notes: Summon a random companion from a pre-configured list |
## Author: Ailae |
## Version: 40000.wowi:revision |
## Version: 40000.3 |
## SavedVariablesPerCharacter: SoundwaveDB |
Soundwave.lua |