WoWInterface SVN pRogue

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 3 to Rev 4
    Reverse comparison

Rev 3 → Rev 4

pRogue/pRogue.lua
1,9 → 1,56
if(select(2, UnitClass"player") ~= "ROGUE") then return end
 
local showSnDTimer = true
-- set to false if you want to hide the SnD timer
local showSnD = true
local showRupture = true
 
local function OnLoad()
local function CreateUpdatedTexture(size, id, y)
local spellName, spellRank, spellTexture = GetSpellInfo(id)
local frame = CreateFrame('Frame', nil, UIParent)
frame:SetFrameStrata('BACKGROUND')
frame:SetPoint('CENTER', 0, - y)
frame:SetHeight(size)
frame:SetWidth(size)
frame:SetAlpha(0)
 
local texture = frame:CreateTexture(nil, 'ARTWORK')
texture:SetTexture(spellTexture)
texture:SetTexCoord(0.1, 0.9, 0.1, 0.9)
texture:SetAllPoints(frame)
 
local background = frame:CreateTexture(nil, 'BACKGROUND')
background:SetTexture(1.0, 1.0, 1.0, 0.8)
background:SetHeight(size + 2)
background:SetWidth(size + 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 buffName, _, _, _, _, buffTime = UnitBuff('player', i)
if(buffName == spellName) then
if(buffTime ~= nil) then
frame:SetAlpha(1)
number:SetText(floor(buffTime))
end
if(number:GetText() == '0') then
frame:SetAlpha(0)
end
end
end
total = 0
end
end)
end
 
 
local function OnEvent()
-- Merchantframe Poisons Button
local merchant = CreateFrame("Button", nil, MerchantFrame, "SecureActionButtonTemplate, UIPanelButtonTemplate")
merchant:SetHeight(18)
33,54 → 80,16
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)
-- Timers
if(showSnD) then
CreateUpdatedTexture(40, 6774, 180)
end
if(showRupture) then
CreateUpdatedTexture(40, 26867, 260)
end
end
 
local addon = CreateFrame("Frame", "pRogue")
addon:SetScript("OnEvent", OnLoad)
addon:SetScript("OnEvent", OnEvent)
addon:RegisterEvent("PLAYER_LOGIN")
\ No newline at end of file