if(select(2, UnitClass"player") ~= "ROGUE") then return end |
|
local showSnDTimer = true |
-- set to false if you want to hide the SnD timer |
|
local function OnLoad() |
-- Merchantframe Poisons Button |
local merchant = CreateFrame("Button", nil, MerchantFrame, "SecureActionButtonTemplate, UIPanelButtonTemplate") |
merchant:SetHeight(18) |
merchant:SetWidth(170) |
merchant:RegisterForClicks("AnyUp") |
merchant:SetAttribute("type*", "spell") |
merchant:SetAttribute("spell", "Poisons") |
merchant:SetPoint("BOTTOMLEFT", MerchantFrame, "BOTTOMLEFT", 14, 66) |
|
local mtext = merchant:CreateFontString(nil, "OVERLAY") |
mtext:SetParent(merchant) |
mtext:SetFontObject(GameFontNormal) |
mtext:SetPoint("CENTER") |
mtext:SetText("Open Poisons") |
|
-- Tradeframe Picklock Button |
local trade = CreateFrame("Button", nil, TradeFrame, "SecureActionButtonTemplate, UIPanelButtonTemplate") |
trade:SetHeight(22) |
trade:SetWidth(170) |
trade:RegisterForClicks("AnyUp") |
trade:SetAttribute("type*", "spell") |
trade:SetAttribute("spell*", "Pick Lock") |
trade:SetPoint("BOTTOMLEFT", TradeFrame, "BOTTOMLEFT", 14, 56) |
|
local ttext = trade:CreateFontString(nil, "OVERLAY") |
ttext:SetParent(trade) |
ttext:SetFontObject(GameFontNormal) |
ttext:SetPoint("CENTER") |
ttext:SetText("Pick Lock") |
|
-- SnD Timer |
if(showSnDTimer) then |
local frame = CreateFrame("Frame", nil, UIParent) |
frame:SetFrameStrata("BACKGROUND") |
frame:SetPoint("CENTER", 0, -200) |
frame:SetHeight(40) |
frame:SetWidth(40) |
frame:SetAlpha(0) |
|
local texture = frame:CreateTexture(nil, "ARTWORK") |
texture:SetTexture(select(3, GetSpellInfo(6774))) |
texture:SetTexCoord(0.1, 0.9, 0.1, 0.9) |
texture:SetAllPoints(frame) |
|
local background = frame:CreateTexture(nil, "BACKGROUND") |
background:SetTexture(1,1,1,.8) |
background:SetHeight(frame:GetHeight() + 2) |
background:SetWidth(frame:GetWidth() + 2) |
background:SetPoint("CENTER") |
|
local number = frame:CreateFontString(nil, "OVERLAY") |
number:SetFont("Fonts\\FRIZQT__.TTF", 24, "OUTLINE") |
number:SetPoint("CENTER") |
number:SetText() |
|
local total = 0 |
frame:SetScript("OnUpdate", function(self, al) |
total = total + al |
if(total > 0.25) then |
for i = 1, 40 do |
local name,_,_,_,_,remain = UnitBuff("player", i) |
if(name == GetSpellInfo(6774)) then |
if(remain ~= nil) then |
frame:SetAlpha(1) |
number:SetText(floor(remain)) |
end |
if(number:GetText() == "0") then |
frame:SetAlpha(0) |
end |
end |
end |
total = 0 |
end |
end) |
end |
end |
|
local addon = CreateFrame("Frame", "pRogue") |
addon:SetScript("OnEvent", OnLoad) |
addon:RegisterEvent("PLAYER_LOGIN") |