api: merge api calls into environment

This commit is contained in:
shagu
2017-02-26 20:55:22 +01:00
parent 1766dd4ba0
commit 6f7a665ffe
30 changed files with 284 additions and 285 deletions
+24 -25
View File
@@ -1,7 +1,6 @@
local _G = getfenv(0)
pfUI.api = { } pfUI.api = { }
pfUI.api._G = getfenv(0)
local _G = getfenv(0)
-- [ strsplit ] -- [ strsplit ]
-- Splits a string using a delimiter. -- Splits a string using a delimiter.
-- 'delimiter' [string] characters that will be interpreted as delimiter -- 'delimiter' [string] characters that will be interpreted as delimiter
@@ -115,7 +114,7 @@ end
-- Loads and update the configured position of the specified frame. -- Loads and update the configured position of the specified frame.
-- It also creates an entry in the movables table. -- It also creates an entry in the movables table.
-- 'frame' [frame] the frame that should be updated. -- 'frame' [frame] the frame that should be updated.
function pfUI.api:UpdateMovable(frame) function pfUI.api.UpdateMovable(frame)
local name = frame:GetName() local name = frame:GetName()
if pfUI_config.global.offscreen == "0" then if pfUI_config.global.offscreen == "0" then
@@ -146,7 +145,7 @@ end
-- 'parent' [frame] the frame's anchor point -- 'parent' [frame] the frame's anchor point
-- 'spacing' [number] the padding that should be used between the -- 'spacing' [number] the padding that should be used between the
-- frame and its parent frame -- frame and its parent frame
function pfUI.api:SetAutoPoint(frame, parent, spacing) function pfUI.api.SetAutoPoint(frame, parent, spacing)
--[[ --[[
a b max a b max
@@ -215,7 +214,7 @@ end
-- 'inset' [int] backdrop inset, defaults to border size. -- 'inset' [int] backdrop inset, defaults to border size.
-- 'legacy' [bool] use legacy backdrop instead of creating frames. -- 'legacy' [bool] use legacy backdrop instead of creating frames.
-- 'transp' [bool] force default transparency of 0.8. -- 'transp' [bool] force default transparency of 0.8.
function pfUI.api:CreateBackdrop(f, inset, legacy, transp) function pfUI.api.CreateBackdrop(f, inset, legacy, transp)
-- use default inset if nothing is given -- use default inset if nothing is given
local border = inset local border = inset
if not border then if not border then
@@ -281,7 +280,7 @@ end
-- 'cr' [int] mouseover color (red), defaults to classcolor. -- 'cr' [int] mouseover color (red), defaults to classcolor.
-- 'cg' [int] mouseover color (green), defaults to classcolor. -- 'cg' [int] mouseover color (green), defaults to classcolor.
-- 'cb' [int] mouseover color (blue), defaults to classcolor. -- 'cb' [int] mouseover color (blue), defaults to classcolor.
function pfUI.api:SkinButton(button, cr, cg, cb) function pfUI.api.SkinButton(button, cr, cg, cb)
local b = getglobal(button) local b = getglobal(button)
if not b then b = button end if not b then b = button end
if not cr or not cg or not cb then if not cr or not cg or not cb then
@@ -289,7 +288,7 @@ function pfUI.api:SkinButton(button, cr, cg, cb)
local color = RAID_CLASS_COLORS[class] local color = RAID_CLASS_COLORS[class]
cr, cg, cb = color.r , color.g, color.b cr, cg, cb = color.r , color.g, color.b
end end
pfUI.api:CreateBackdrop(b, nil, true) pfUI.api.CreateBackdrop(b, nil, true)
b:SetNormalTexture(nil) b:SetNormalTexture(nil)
b:SetHighlightTexture(nil) b:SetHighlightTexture(nil)
b:SetPushedTexture(nil) b:SetPushedTexture(nil)
@@ -298,12 +297,12 @@ function pfUI.api:SkinButton(button, cr, cg, cb)
local funcl = b:GetScript("OnLeave") local funcl = b:GetScript("OnLeave")
b:SetScript("OnEnter", function() b:SetScript("OnEnter", function()
if funce then funce() end if funce then funce() end
pfUI.api:CreateBackdrop(b, nil, true) pfUI.api.CreateBackdrop(b, nil, true)
b:SetBackdropBorderColor(cr,cg,cb,1) b:SetBackdropBorderColor(cr,cg,cb,1)
end) end)
b:SetScript("OnLeave", function() b:SetScript("OnLeave", function()
if funcl then funcl() end if funcl then funcl() end
pfUI.api:CreateBackdrop(b, nil, true) pfUI.api.CreateBackdrop(b, nil, true)
end) end)
b:SetFont(pfUI.font_default, pfUI_config.global.font_size, "OUTLINE") b:SetFont(pfUI.font_default, pfUI_config.global.font_size, "OUTLINE")
end end
@@ -315,7 +314,7 @@ end
-- 'no' [function] function that is triggered on 'Cancel' button. -- 'no' [function] function that is triggered on 'Cancel' button.
-- 'editbox' [bool] if set, a inputfield will be shown. it can be. -- 'editbox' [bool] if set, a inputfield will be shown. it can be.
-- accessed with "GetParent().input". -- accessed with "GetParent().input".
function pfUI.api:CreateQuestionDialog(text, yes, no, editbox) function pfUI.api.CreateQuestionDialog(text, yes, no, editbox)
-- do not allow multiple instances of question dialogs -- do not allow multiple instances of question dialogs
if pfQuestionDialog and pfQuestionDialog:IsShown() then if pfQuestionDialog and pfQuestionDialog:IsShown() then
pfQuestionDialog:Hide() pfQuestionDialog:Hide()
@@ -342,7 +341,7 @@ function pfUI.api:CreateQuestionDialog(text, yes, no, editbox)
question:SetScript("OnMouseUp",function() question:SetScript("OnMouseUp",function()
this:StopMovingOrSizing() this:StopMovingOrSizing()
end) end)
pfUI.api:CreateBackdrop(question) pfUI.api.CreateBackdrop(question)
-- text -- text
question.text = question:CreateFontString("Status", "LOW", "GameFontNormal") question.text = question:CreateFontString("Status", "LOW", "GameFontNormal")
@@ -354,7 +353,7 @@ function pfUI.api:CreateQuestionDialog(text, yes, no, editbox)
-- editbox -- editbox
if editbox then if editbox then
question.input = CreateFrame("EditBox", "pfQuestionDialogEdit", question) question.input = CreateFrame("EditBox", "pfQuestionDialogEdit", question)
pfUI.api:CreateBackdrop(question.input) pfUI.api.CreateBackdrop(question.input)
question.input:SetTextColor(.2,1,.8,1) question.input:SetTextColor(.2,1,.8,1)
question.input:SetJustifyH("CENTER") question.input:SetJustifyH("CENTER")
question.input:SetAutoFocus(false) question.input:SetAutoFocus(false)
@@ -368,7 +367,7 @@ function pfUI.api:CreateQuestionDialog(text, yes, no, editbox)
-- buttons -- buttons
question.yes = CreateFrame("Button", "pfQuestionDialogYes", question, "UIPanelButtonTemplate") question.yes = CreateFrame("Button", "pfQuestionDialogYes", question, "UIPanelButtonTemplate")
pfUI.api:SkinButton(question.yes) pfUI.api.SkinButton(question.yes)
question.yes:SetWidth(100) question.yes:SetWidth(100)
question.yes:SetHeight(20) question.yes:SetHeight(20)
question.yes:SetText("Yes") question.yes:SetText("Yes")
@@ -384,7 +383,7 @@ function pfUI.api:CreateQuestionDialog(text, yes, no, editbox)
end end
question.no = CreateFrame("Button", "pfQuestionDialogNo", question, "UIPanelButtonTemplate") question.no = CreateFrame("Button", "pfQuestionDialogNo", question, "UIPanelButtonTemplate")
pfUI.api:SkinButton(question.no) pfUI.api.SkinButton(question.no)
question.no:SetWidth(85) question.no:SetWidth(85)
question.no:SetHeight(20) question.no:SetHeight(20)
question.no:SetText("No") question.no:SetText("No")
@@ -401,7 +400,7 @@ function pfUI.api:CreateQuestionDialog(text, yes, no, editbox)
question.close = CreateFrame("Button", "pfQuestionDialogClose", question) question.close = CreateFrame("Button", "pfQuestionDialogClose", question)
question.close:SetPoint("TOPRIGHT", -border, -border) question.close:SetPoint("TOPRIGHT", -border, -border)
pfUI.api:CreateBackdrop(question.close) pfUI.api.CreateBackdrop(question.close)
question.close:SetHeight(10) question.close:SetHeight(10)
question.close:SetWidth(10) question.close:SetWidth(10)
question.close.texture = question.close:CreateTexture("pfQuestionDialogCloseTex") question.close.texture = question.close:CreateTexture("pfQuestionDialogCloseTex")
@@ -414,7 +413,7 @@ function pfUI.api:CreateQuestionDialog(text, yes, no, editbox)
end) end)
question.close:SetScript("OnLeave", function () question.close:SetScript("OnLeave", function ()
pfUI.api:CreateBackdrop(this) pfUI.api.CreateBackdrop(this)
end) end)
question.close:SetScript("OnClick", function() question.close:SetScript("OnClick", function()
@@ -436,7 +435,7 @@ end
-- [ Bar Layout Options ] -- -- [ Bar Layout Options ] --
-- 'barsize' size of bar in number of buttons -- 'barsize' size of bar in number of buttons
-- returns: array of options as strings for pfUI.gui.bar -- returns: array of options as strings for pfUI.gui.bar
function pfUI.api:BarLayoutOptions(barsize) function pfUI.api.BarLayoutOptions(barsize)
assert(barsize > 0 and barsize <= NUM_ACTIONBAR_BUTTONS,"BarLayoutOptions: barsize "..tostring(barsize).." is invalid") assert(barsize > 0 and barsize <= NUM_ACTIONBAR_BUTTONS,"BarLayoutOptions: barsize "..tostring(barsize).." is invalid")
local options = {} local options = {}
for i,layout in ipairs(pfGridmath[barsize]) do for i,layout in ipairs(pfGridmath[barsize]) do
@@ -450,12 +449,12 @@ end
-- returns: integer formfactor -- returns: integer formfactor
local formfactors = {} -- we'll use memoization so we only compute once, then lookup. local formfactors = {} -- we'll use memoization so we only compute once, then lookup.
setmetatable(formfactors, {__mode = "v"}) -- weak table so values not referenced are collected on next gc setmetatable(formfactors, {__mode = "v"}) -- weak table so values not referenced are collected on next gc
function pfUI.api:BarLayoutFormfactor(option) function pfUI.api.BarLayoutFormfactor(option)
if formfactors[option] then if formfactors[option] then
return formfactors[option] return formfactors[option]
else else
for barsize,_ in ipairs(pfGridmath) do for barsize,_ in ipairs(pfGridmath) do
local options = pfUI.api:BarLayoutOptions(barsize) local options = pfUI.api.BarLayoutOptions(barsize)
for i,opt in ipairs(options) do for i,opt in ipairs(options) do
if opt == option then if opt == option then
formfactors[option] = i formfactors[option] = i
@@ -470,9 +469,9 @@ end
-- 'bar' frame reference, -- 'bar' frame reference,
-- 'barsize' integer number of buttons, -- 'barsize' integer number of buttons,
-- 'formfactor' string formfactor in cols x rows -- 'formfactor' string formfactor in cols x rows
function pfUI.api:BarLayoutSize(bar,barsize,formfactor,iconsize,bordersize) function pfUI.api.BarLayoutSize(bar,barsize,formfactor,iconsize,bordersize)
assert(barsize > 0 and barsize <= NUM_ACTIONBAR_BUTTONS,"BarLayoutSize: barsize "..tostring(barsize).." is invalid") assert(barsize > 0 and barsize <= NUM_ACTIONBAR_BUTTONS,"BarLayoutSize: barsize "..tostring(barsize).." is invalid")
local formfactor = pfUI.api:BarLayoutFormfactor(formfactor) local formfactor = pfUI.api.BarLayoutFormfactor(formfactor)
local cols, rows = unpack(pfGridmath[barsize][formfactor]) local cols, rows = unpack(pfGridmath[barsize][formfactor])
local width = (iconsize + bordersize*3) * cols - bordersize local width = (iconsize + bordersize*3) * cols - bordersize
local height = (iconsize + bordersize*3) * rows - bordersize local height = (iconsize + bordersize*3) * rows - bordersize
@@ -485,9 +484,9 @@ end
-- 'basename' name of button frame without index -- 'basename' name of button frame without index
-- 'buttonindex' index number of button on bar -- 'buttonindex' index number of button on bar
-- 'formfactor' string formfactor in cols x rows -- 'formfactor' string formfactor in cols x rows
function pfUI.api:BarButtonAnchor(button,basename,buttonindex,barsize,formfactor,iconsize,bordersize) function pfUI.api.BarButtonAnchor(button,basename,buttonindex,barsize,formfactor,iconsize,bordersize)
assert(barsize > 0 and barsize <= NUM_ACTIONBAR_BUTTONS,"BarButtonAnchor: barsize "..tostring(barsize).." is invalid") assert(barsize > 0 and barsize <= NUM_ACTIONBAR_BUTTONS,"BarButtonAnchor: barsize "..tostring(barsize).." is invalid")
local formfactor = pfUI.api:BarLayoutFormfactor(formfactor) local formfactor = pfUI.api.BarLayoutFormfactor(formfactor)
local parent = button:GetParent() local parent = button:GetParent()
local cols, rows = unpack(pfGridmath[barsize][formfactor]) local cols, rows = unpack(pfGridmath[barsize][formfactor])
if buttonindex == 1 then if buttonindex == 1 then
@@ -501,7 +500,7 @@ end
-- [ Create Autohide ] -- -- [ Create Autohide ] --
-- 'frame' the frame that should be hidden -- 'frame' the frame that should be hidden
function pfUI.api:CreateAutohide(frame) function pfUI.api.CreateAutohide(frame)
if not frame then return end if not frame then return end
frame.hover = CreateFrame("Frame", frame:GetName() .. "Autohide", frame) frame.hover = CreateFrame("Frame", frame:GetName() .. "Autohide", frame)
frame.hover:SetParent(frame) frame.hover:SetParent(frame)
+52 -52
View File
@@ -34,25 +34,25 @@ pfUI:RegisterModule("actionbar", function ()
end end
end end
pfUI.api.Hook("ShowBonusActionBar", function() Hook("ShowBonusActionBar", function()
if pfActionBar then pfActionBar:Hide() end if pfActionBar then pfActionBar:Hide() end
if pfBonusBar then pfBonusBar:Show() end if pfBonusBar then pfBonusBar:Show() end
end) end)
pfUI.api.Hook("HideBonusActionBar", function() Hook("HideBonusActionBar", function()
if pfActionBar then pfActionBar:Show() end if pfActionBar then pfActionBar:Show() end
if pfBonusBar then pfBonusBar:Hide() end if pfBonusBar then pfBonusBar:Hide() end
end) end)
if C.bars.glowrange == "1" then if C.bars.glowrange == "1" then
pfUI.api.Hook("ActionButton_OnUpdate", function(elapsed) Hook("ActionButton_OnUpdate", function(elapsed)
-- Handle range indicator -- Handle range indicator
if ( this.rangeTimer ) then if ( this.rangeTimer ) then
this.rangeTimer = this.rangeTimer - elapsed this.rangeTimer = this.rangeTimer - elapsed
if ( this.rangeTimer <= 0.1 ) then if ( this.rangeTimer <= 0.1 ) then
if ( IsActionInRange( ActionButton_GetPagedID(this)) == 0 ) then if ( IsActionInRange( ActionButton_GetPagedID(this)) == 0 ) then
if not this.a then if not this.a then
this.r,this.g,this.b,this.a = pfUI.api.strsplit(",", C.bars.rangecolor) this.r,this.g,this.b,this.a = strsplit(",", C.bars.rangecolor)
end end
_G[this:GetName() .. 'Icon']:SetVertexColor(this.r, this.g, this.b, this.a) _G[this:GetName() .. 'Icon']:SetVertexColor(this.r, this.g, this.b, this.a)
elseif IsUsableAction(ActionButton_GetPagedID(this)) then elseif IsUsableAction(ActionButton_GetPagedID(this)) then
@@ -115,25 +115,25 @@ pfUI:RegisterModule("actionbar", function ()
pfUI.bars.autohide:RegisterEvent("PLAYER_ENTERING_WORLD") pfUI.bars.autohide:RegisterEvent("PLAYER_ENTERING_WORLD")
pfUI.bars.autohide:SetScript("OnEvent", function() pfUI.bars.autohide:SetScript("OnEvent", function()
if C.bars.hide_actionmain == "1" then if C.bars.hide_actionmain == "1" then
pfUI.api:CreateAutohide(pfUI.bars.actionmain) CreateAutohide(pfUI.bars.actionmain)
end end
if C.bars.hide_bottomleft == "1" then if C.bars.hide_bottomleft == "1" then
pfUI.api:CreateAutohide(pfUI.bars.bottomleft) CreateAutohide(pfUI.bars.bottomleft)
end end
if C.bars.hide_bottomright == "1" then if C.bars.hide_bottomright == "1" then
pfUI.api:CreateAutohide(pfUI.bars.bottomright) CreateAutohide(pfUI.bars.bottomright)
end end
if C.bars.hide_right == "1" then if C.bars.hide_right == "1" then
pfUI.api:CreateAutohide(pfUI.bars.right) CreateAutohide(pfUI.bars.right)
end end
if C.bars.hide_tworight == "1" then if C.bars.hide_tworight == "1" then
pfUI.api:CreateAutohide(pfUI.bars.tworight) CreateAutohide(pfUI.bars.tworight)
end end
if C.bars.hide_shapeshift == "1" then if C.bars.hide_shapeshift == "1" then
pfUI.api:CreateAutohide(pfUI.bars.shapeshift) CreateAutohide(pfUI.bars.shapeshift)
end end
if C.bars.hide_pet == "1" then if C.bars.hide_pet == "1" then
pfUI.api:CreateAutohide(pfUI.bars.pet) CreateAutohide(pfUI.bars.pet)
end end
end) end)
@@ -148,7 +148,7 @@ pfUI:RegisterModule("actionbar", function ()
PetActionBarFrame:SetParent(pfUI.bars.pet) PetActionBarFrame:SetParent(pfUI.bars.pet)
pfUI.bars:SetScript("OnEvent", function() pfUI.bars:SetScript("OnEvent", function()
pfUI.api:BarLayoutSize(pfUI.bars.actionmain, NUM_ACTIONBAR_BUTTONS, C.bars.actionmain.formfactor, C.bars.icon_size, default_border) BarLayoutSize(pfUI.bars.actionmain, NUM_ACTIONBAR_BUTTONS, C.bars.actionmain.formfactor, C.bars.icon_size, default_border)
pfUI.bars.actionmain:SetWidth(pfUI.bars.actionmain._size[1]) pfUI.bars.actionmain:SetWidth(pfUI.bars.actionmain._size[1])
pfUI.bars.actionmain:SetHeight(pfUI.bars.actionmain._size[2]) pfUI.bars.actionmain:SetHeight(pfUI.bars.actionmain._size[2])
@@ -160,11 +160,11 @@ pfUI:RegisterModule("actionbar", function ()
anchor = pfUI.bars.bottomleft anchor = pfUI.bars.bottomleft
end end
pfUI.bars.pet:SetPoint("BOTTOM", anchor, "TOP", 0, default_border * 3) pfUI.bars.pet:SetPoint("BOTTOM", anchor, "TOP", 0, default_border * 3)
pfUI.api:UpdateMovable(pfUI.bars.pet) UpdateMovable(pfUI.bars.pet)
pfUI.api:BarLayoutSize(pfUI.bars.pet, NUM_PET_ACTION_SLOTS, C.bars.pet.formfactor, C.bars.icon_size, default_border) BarLayoutSize(pfUI.bars.pet, NUM_PET_ACTION_SLOTS, C.bars.pet.formfactor, C.bars.icon_size, default_border)
pfUI.bars.pet:SetWidth(pfUI.bars.pet._size[1]) pfUI.bars.pet:SetWidth(pfUI.bars.pet._size[1])
pfUI.bars.pet:SetHeight(pfUI.bars.pet._size[2]) pfUI.bars.pet:SetHeight(pfUI.bars.pet._size[2])
if C.bars.background == "1" then pfUI.api:CreateBackdrop(pfUI.bars.pet, default_border) end if C.bars.background == "1" then CreateBackdrop(pfUI.bars.pet, default_border) end
PetActionBarFrame:ClearAllPoints() PetActionBarFrame:ClearAllPoints()
PetActionBarFrame:Hide() PetActionBarFrame:Hide()
@@ -174,8 +174,8 @@ pfUI:RegisterModule("actionbar", function ()
b:ClearAllPoints() b:ClearAllPoints()
b:SetFrameLevel(pfUI.bars.pet:GetFrameLevel() + 1) b:SetFrameLevel(pfUI.bars.pet:GetFrameLevel() + 1)
b:SetParent(pfUI.bars.pet) b:SetParent(pfUI.bars.pet)
pfUI.api:CreateBackdrop(b, default_border) CreateBackdrop(b, default_border)
pfUI.api:BarButtonAnchor(b, "PetActionButton", i, NUM_PET_ACTION_SLOTS, C.bars.pet.formfactor, C.bars.icon_size, default_border) BarButtonAnchor(b, "PetActionButton", i, NUM_PET_ACTION_SLOTS, C.bars.pet.formfactor, C.bars.icon_size, default_border)
b:SetPoint(unpack(b._anchor)) b:SetPoint(unpack(b._anchor))
end end
else else
@@ -192,8 +192,8 @@ pfUI:RegisterModule("actionbar", function ()
local b = _G["ShapeshiftButton"..i] local b = _G["ShapeshiftButton"..i]
b:ClearAllPoints() b:ClearAllPoints()
b:SetParent(pfUI.bars.shapeshift) b:SetParent(pfUI.bars.shapeshift)
pfUI.api:CreateBackdrop(b, default_border) CreateBackdrop(b, default_border)
pfUI.api:BarButtonAnchor(b, "ShapeshiftButton", i, NUM_SHAPESHIFT_SLOTS, C.bars.shapeshift.formfactor, C.bars.icon_size, default_border) BarButtonAnchor(b, "ShapeshiftButton", i, NUM_SHAPESHIFT_SLOTS, C.bars.shapeshift.formfactor, C.bars.icon_size, default_border)
b:SetPoint(unpack(b._anchor)) b:SetPoint(unpack(b._anchor))
if b:IsShown() then shapeshiftbuttons = shapeshiftbuttons + 1 end if b:IsShown() then shapeshiftbuttons = shapeshiftbuttons + 1 end
end end
@@ -203,9 +203,9 @@ pfUI:RegisterModule("actionbar", function ()
anchor = pfUI.bars.bottomleft anchor = pfUI.bars.bottomleft
end end
pfUI.bars.shapeshift:SetPoint("BOTTOM", anchor, "TOP", 0, default_border * 3) pfUI.bars.shapeshift:SetPoint("BOTTOM", anchor, "TOP", 0, default_border * 3)
pfUI.api:UpdateMovable(pfUI.bars.shapeshift) UpdateMovable(pfUI.bars.shapeshift)
if C.bars.background == "1" then pfUI.api:CreateBackdrop(pfUI.bars.shapeshift, default_border) end if C.bars.background == "1" then CreateBackdrop(pfUI.bars.shapeshift, default_border) end
pfUI.api:BarLayoutSize(pfUI.bars.shapeshift, shapeshiftbuttons, C.bars.shapeshift.formfactor, C.bars.icon_size, default_border) BarLayoutSize(pfUI.bars.shapeshift, shapeshiftbuttons, C.bars.shapeshift.formfactor, C.bars.icon_size, default_border)
pfUI.bars.shapeshift:SetWidth(pfUI.bars.shapeshift._size[1]) pfUI.bars.shapeshift:SetWidth(pfUI.bars.shapeshift._size[1])
pfUI.bars.shapeshift:SetHeight(pfUI.bars.shapeshift._size[2]) pfUI.bars.shapeshift:SetHeight(pfUI.bars.shapeshift._size[2])
else else
@@ -217,9 +217,9 @@ pfUI:RegisterModule("actionbar", function ()
pfUI.bars.bottomleft:SetFrameStrata("LOW") pfUI.bars.bottomleft:SetFrameStrata("LOW")
pfUI.bars.bottomleft:ClearAllPoints() pfUI.bars.bottomleft:ClearAllPoints()
pfUI.bars.bottomleft:SetPoint("BOTTOM", pfUI.bars.actionmain, "TOP", 0, default_border) pfUI.bars.bottomleft:SetPoint("BOTTOM", pfUI.bars.actionmain, "TOP", 0, default_border)
pfUI.api:UpdateMovable(pfUI.bars.bottomleft) UpdateMovable(pfUI.bars.bottomleft)
pfUI.api:BarLayoutSize(pfUI.bars.bottomleft, NUM_ACTIONBAR_BUTTONS, C.bars.bottomleft.formfactor, C.bars.icon_size, default_border) BarLayoutSize(pfUI.bars.bottomleft, NUM_ACTIONBAR_BUTTONS, C.bars.bottomleft.formfactor, C.bars.icon_size, default_border)
pfUI.bars.bottomleft:SetWidth(pfUI.bars.bottomleft._size[1]) pfUI.bars.bottomleft:SetWidth(pfUI.bars.bottomleft._size[1])
pfUI.bars.bottomleft:SetHeight(pfUI.bars.bottomleft._size[2]) pfUI.bars.bottomleft:SetHeight(pfUI.bars.bottomleft._size[2])
@@ -238,8 +238,8 @@ pfUI:RegisterModule("actionbar", function ()
local b = _G["MultiBarBottomLeftButton"..i] local b = _G["MultiBarBottomLeftButton"..i]
b:ClearAllPoints() b:ClearAllPoints()
b:SetParent(tf) b:SetParent(tf)
pfUI.api:CreateBackdrop(b, default_border) CreateBackdrop(b, default_border)
pfUI.api:BarButtonAnchor(b, "MultiBarBottomLeftButton", i, NUM_ACTIONBAR_BUTTONS, C.bars.bottomleft.formfactor, C.bars.icon_size, default_border) BarButtonAnchor(b, "MultiBarBottomLeftButton", i, NUM_ACTIONBAR_BUTTONS, C.bars.bottomleft.formfactor, C.bars.icon_size, default_border)
b:SetPoint(unpack(b._anchor)) b:SetPoint(unpack(b._anchor))
end end
end end
@@ -254,10 +254,10 @@ pfUI:RegisterModule("actionbar", function ()
pfUI.bars.bottomright:Show() pfUI.bars.bottomright:Show()
pfUI.bars.bottomright:SetFrameStrata("LOW") pfUI.bars.bottomright:SetFrameStrata("LOW")
pfUI.bars.bottomright:SetPoint("BOTTOMRIGHT", pfUI.bars.actionmain, "BOTTOMLEFT", -default_border*3, 0) pfUI.bars.bottomright:SetPoint("BOTTOMRIGHT", pfUI.bars.actionmain, "BOTTOMLEFT", -default_border*3, 0)
pfUI.api:UpdateMovable(pfUI.bars.bottomright) UpdateMovable(pfUI.bars.bottomright)
if C.bars.background == "1" then pfUI.api:CreateBackdrop(pfUI.bars.bottomright, default_border) end if C.bars.background == "1" then CreateBackdrop(pfUI.bars.bottomright, default_border) end
pfUI.api:BarLayoutSize(pfUI.bars.bottomright, NUM_ACTIONBAR_BUTTONS, C.bars.bottomright.formfactor, C.bars.icon_size, default_border) BarLayoutSize(pfUI.bars.bottomright, NUM_ACTIONBAR_BUTTONS, C.bars.bottomright.formfactor, C.bars.icon_size, default_border)
pfUI.bars.bottomright:SetWidth(pfUI.bars.bottomright._size[1]) pfUI.bars.bottomright:SetWidth(pfUI.bars.bottomright._size[1])
pfUI.bars.bottomright:SetHeight(pfUI.bars.bottomright._size[2]) pfUI.bars.bottomright:SetHeight(pfUI.bars.bottomright._size[2])
@@ -276,8 +276,8 @@ pfUI:RegisterModule("actionbar", function ()
local b = _G["MultiBarBottomRightButton"..i] local b = _G["MultiBarBottomRightButton"..i]
b:ClearAllPoints() b:ClearAllPoints()
b:SetParent(tf) b:SetParent(tf)
pfUI.api:CreateBackdrop(b, default_border) CreateBackdrop(b, default_border)
pfUI.api:BarButtonAnchor(b, "MultiBarBottomRightButton", i, NUM_ACTIONBAR_BUTTONS, C.bars.bottomright.formfactor, C.bars.icon_size, default_border) BarButtonAnchor(b, "MultiBarBottomRightButton", i, NUM_ACTIONBAR_BUTTONS, C.bars.bottomright.formfactor, C.bars.icon_size, default_border)
b:SetPoint(unpack(b._anchor)) b:SetPoint(unpack(b._anchor))
end end
end end
@@ -289,10 +289,10 @@ pfUI:RegisterModule("actionbar", function ()
pfUI.bars.right:Show() pfUI.bars.right:Show()
pfUI.bars.right:SetFrameStrata("LOW") pfUI.bars.right:SetFrameStrata("LOW")
pfUI.bars.right:SetPoint("BOTTOMLEFT", pfUI.bars.actionmain, "BOTTOMRIGHT", default_border*3, 0) pfUI.bars.right:SetPoint("BOTTOMLEFT", pfUI.bars.actionmain, "BOTTOMRIGHT", default_border*3, 0)
pfUI.api:UpdateMovable(pfUI.bars.right) UpdateMovable(pfUI.bars.right)
if C.bars.background == "1" then pfUI.api:CreateBackdrop(pfUI.bars.right, default_border) end if C.bars.background == "1" then CreateBackdrop(pfUI.bars.right, default_border) end
pfUI.api:BarLayoutSize(pfUI.bars.right, NUM_ACTIONBAR_BUTTONS, C.bars.right.formfactor, C.bars.icon_size, default_border) BarLayoutSize(pfUI.bars.right, NUM_ACTIONBAR_BUTTONS, C.bars.right.formfactor, C.bars.icon_size, default_border)
pfUI.bars.right:SetWidth(pfUI.bars.right._size[1]) pfUI.bars.right:SetWidth(pfUI.bars.right._size[1])
pfUI.bars.right:SetHeight(pfUI.bars.right._size[2]) pfUI.bars.right:SetHeight(pfUI.bars.right._size[2])
@@ -311,8 +311,8 @@ pfUI:RegisterModule("actionbar", function ()
local b = _G["MultiBarRightButton"..i] local b = _G["MultiBarRightButton"..i]
b:ClearAllPoints() b:ClearAllPoints()
b:SetParent(tf) b:SetParent(tf)
pfUI.api:CreateBackdrop(b, default_border) CreateBackdrop(b, default_border)
pfUI.api:BarButtonAnchor(b, "MultiBarRightButton", i, NUM_ACTIONBAR_BUTTONS, C.bars.right.formfactor, C.bars.icon_size, default_border) BarButtonAnchor(b, "MultiBarRightButton", i, NUM_ACTIONBAR_BUTTONS, C.bars.right.formfactor, C.bars.icon_size, default_border)
b:SetPoint(unpack(b._anchor)) b:SetPoint(unpack(b._anchor))
end end
end end
@@ -325,9 +325,9 @@ pfUI:RegisterModule("actionbar", function ()
pfUI.bars.tworight:SetFrameStrata("LOW") pfUI.bars.tworight:SetFrameStrata("LOW")
pfUI.bars.tworight:ClearAllPoints() pfUI.bars.tworight:ClearAllPoints()
pfUI.bars.tworight:SetPoint("RIGHT", UIParent, "RIGHT", -5, 0) pfUI.bars.tworight:SetPoint("RIGHT", UIParent, "RIGHT", -5, 0)
pfUI.api:UpdateMovable(pfUI.bars.tworight) UpdateMovable(pfUI.bars.tworight)
if C.bars.background == "1" then pfUI.api:CreateBackdrop(pfUI.bars.tworight, default_border) end if C.bars.background == "1" then CreateBackdrop(pfUI.bars.tworight, default_border) end
pfUI.api:BarLayoutSize(pfUI.bars.tworight, NUM_ACTIONBAR_BUTTONS, C.bars.tworight.formfactor, C.bars.icon_size, default_border) BarLayoutSize(pfUI.bars.tworight, NUM_ACTIONBAR_BUTTONS, C.bars.tworight.formfactor, C.bars.icon_size, default_border)
pfUI.bars.tworight:SetWidth(pfUI.bars.tworight._size[1]) pfUI.bars.tworight:SetWidth(pfUI.bars.tworight._size[1])
pfUI.bars.tworight:SetHeight(pfUI.bars.tworight._size[2]) pfUI.bars.tworight:SetHeight(pfUI.bars.tworight._size[2])
@@ -346,15 +346,15 @@ pfUI:RegisterModule("actionbar", function ()
local b = _G["MultiBarLeftButton"..i] local b = _G["MultiBarLeftButton"..i]
b:ClearAllPoints() b:ClearAllPoints()
b:SetParent(tf) b:SetParent(tf)
pfUI.api:CreateBackdrop(b, default_border) CreateBackdrop(b, default_border)
pfUI.api:BarButtonAnchor(b, "MultiBarLeftButton", i, NUM_ACTIONBAR_BUTTONS, C.bars.tworight.formfactor, C.bars.icon_size, default_border) BarButtonAnchor(b, "MultiBarLeftButton", i, NUM_ACTIONBAR_BUTTONS, C.bars.tworight.formfactor, C.bars.icon_size, default_border)
b:SetPoint(unpack(b._anchor)) b:SetPoint(unpack(b._anchor))
end end
end end
else else
pfUI.bars.tworight:Hide() pfUI.bars.tworight:Hide()
end end
pfUI.api:UpdateMovable(pfUI.bars.actionmain) UpdateMovable(pfUI.bars.actionmain)
local _, a, _ = pfUI.bars.bottomleft:GetPoint() local _, a, _ = pfUI.bars.bottomleft:GetPoint()
if a and a == pfUI.bars.actionmain and pfUI.bars.bottomleft:IsShown() and pfUI.bars.bottomleft:GetWidth() == a:GetWidth() and pfUI.bars.bottomleft:GetScale() == a:GetScale() then if a and a == pfUI.bars.actionmain and pfUI.bars.bottomleft:IsShown() and pfUI.bars.bottomleft:GetWidth() == a:GetWidth() and pfUI.bars.bottomleft:GetScale() == a:GetScale() then
@@ -366,25 +366,25 @@ pfUI:RegisterModule("actionbar", function ()
pfUI.bars.actionmain.share:SetPoint("BOTTOMLEFT", pfUI.bars.actionmain, "BOTTOMLEFT", 0, 0) pfUI.bars.actionmain.share:SetPoint("BOTTOMLEFT", pfUI.bars.actionmain, "BOTTOMLEFT", 0, 0)
pfUI.bars.actionmain.share:SetPoint("TOPRIGHT", pfUI.bars.bottomleft, "TOPRIGHT", 0, 0) pfUI.bars.actionmain.share:SetPoint("TOPRIGHT", pfUI.bars.bottomleft, "TOPRIGHT", 0, 0)
pfUI.bars.actionmain.share:SetPoint("BOTTOMRIGHT", pfUI.bars.actionmain, "BOTTOMRIGHT", 0, 0) pfUI.bars.actionmain.share:SetPoint("BOTTOMRIGHT", pfUI.bars.actionmain, "BOTTOMRIGHT", 0, 0)
if C.bars.background == "1" then pfUI.api:CreateBackdrop(pfUI.bars.actionmain.share, default_border) end if C.bars.background == "1" then CreateBackdrop(pfUI.bars.actionmain.share, default_border) end
end end
else else
-- give both their own backdrop -- give both their own backdrop
if pfUI.bars.actionmain.share then pfUI.bars.actionmain.share:Hide() end if pfUI.bars.actionmain.share then pfUI.bars.actionmain.share:Hide() end
if C.bars.background == "1" then pfUI.api:CreateBackdrop(pfUI.bars.actionmain, default_border) end if C.bars.background == "1" then CreateBackdrop(pfUI.bars.actionmain, default_border) end
if C.bars.background == "1" then pfUI.api:CreateBackdrop(pfUI.bars.bottomleft, default_border) end if C.bars.background == "1" then CreateBackdrop(pfUI.bars.bottomleft, default_border) end
end end
end) end)
-- create main action bar frame -- create main action bar frame
pfUI.bars.actionmain:SetFrameStrata("LOW") pfUI.bars.actionmain:SetFrameStrata("LOW")
pfUI.api:UpdateMovable(pfUI.bars.actionmain) UpdateMovable(pfUI.bars.actionmain)
function pfUI.bars.bottomleft:OnMove() function pfUI.bars.bottomleft:OnMove()
local _, a, _ = pfUI.bars.bottomleft:GetPoint() local _, a, _ = pfUI.bars.bottomleft:GetPoint()
if a ~= pfUI.bars.actionmain or not pfUI.bars.bottomleft:IsShown() or pfUI.bars.bottomleft:GetWidth() ~= a:GetWidth() or pfUI.bars.bottomleft:GetScale() ~= a:GetScale() then if a ~= pfUI.bars.actionmain or not pfUI.bars.bottomleft:IsShown() or pfUI.bars.bottomleft:GetWidth() ~= a:GetWidth() or pfUI.bars.bottomleft:GetScale() ~= a:GetScale() then
if C.bars.background == "1" then pfUI.api:CreateBackdrop(pfUI.bars.actionmain, default_border) end if C.bars.background == "1" then CreateBackdrop(pfUI.bars.actionmain, default_border) end
if C.bars.background == "1" then pfUI.api:CreateBackdrop(pfUI.bars.bottomleft, default_border) end if C.bars.background == "1" then CreateBackdrop(pfUI.bars.bottomleft, default_border) end
if pfUI.bars.actionmain.share then pfUI.bars.actionmain.share:Hide() end if pfUI.bars.actionmain.share then pfUI.bars.actionmain.share:Hide() end
end end
end end
@@ -400,8 +400,8 @@ pfUI:RegisterModule("actionbar", function ()
local b = _G["ActionButton"..i] local b = _G["ActionButton"..i]
b:ClearAllPoints() b:ClearAllPoints()
b:SetParent(tf) b:SetParent(tf)
pfUI.api:CreateBackdrop(b, default_border) CreateBackdrop(b, default_border)
pfUI.api:BarButtonAnchor(b, "ActionButton", i, NUM_ACTIONBAR_BUTTONS, C.bars.actionmain.formfactor, C.bars.icon_size, default_border) BarButtonAnchor(b, "ActionButton", i, NUM_ACTIONBAR_BUTTONS, C.bars.actionmain.formfactor, C.bars.icon_size, default_border)
b:SetPoint(unpack(b._anchor)) b:SetPoint(unpack(b._anchor))
end end
end end
@@ -419,8 +419,8 @@ pfUI:RegisterModule("actionbar", function ()
local b = _G["BonusActionButton"..i] local b = _G["BonusActionButton"..i]
b:ClearAllPoints() b:ClearAllPoints()
b:SetParent(tf) b:SetParent(tf)
pfUI.api:CreateBackdrop(b, default_border) CreateBackdrop(b, default_border)
pfUI.api:BarButtonAnchor(b, "BonusActionButton", i, NUM_BONUS_ACTION_SLOTS, C.bars.actionmain.formfactor, C.bars.icon_size, default_border) BarButtonAnchor(b, "BonusActionButton", i, NUM_BONUS_ACTION_SLOTS, C.bars.actionmain.formfactor, C.bars.icon_size, default_border)
b:SetPoint(unpack(b._anchor)) b:SetPoint(unpack(b._anchor))
end end
+6 -6
View File
@@ -5,7 +5,7 @@ pfUI:RegisterModule("addons", function ()
pfUI.addons:SetWidth(400) pfUI.addons:SetWidth(400)
pfUI.addons:SetPoint("CENTER", 0,0) pfUI.addons:SetPoint("CENTER", 0,0)
pfUI.addons:EnableMouseWheel(1) pfUI.addons:EnableMouseWheel(1)
pfUI.api:CreateBackdrop(pfUI.addons, nil, nil, .8) CreateBackdrop(pfUI.addons, nil, nil, .8)
pfUI.addons:SetMovable(true) pfUI.addons:SetMovable(true)
pfUI.addons:EnableMouse(true) pfUI.addons:EnableMouse(true)
pfUI.addons:SetScript("OnMouseDown",function() pfUI.addons:SetScript("OnMouseDown",function()
@@ -34,7 +34,7 @@ pfUI:RegisterModule("addons", function ()
pfUI.addons.close = CreateFrame("Button", "pfBagClose", pfUI.addons) pfUI.addons.close = CreateFrame("Button", "pfBagClose", pfUI.addons)
pfUI.addons.close:SetPoint("TOPRIGHT", -C.appearance.border.default*2,-C.appearance.border.default*2 ) pfUI.addons.close:SetPoint("TOPRIGHT", -C.appearance.border.default*2,-C.appearance.border.default*2 )
pfUI.api:CreateBackdrop(pfUI.addons.close) CreateBackdrop(pfUI.addons.close)
pfUI.addons.close:SetHeight(15) pfUI.addons.close:SetHeight(15)
pfUI.addons.close:SetWidth(15) pfUI.addons.close:SetWidth(15)
pfUI.addons.close.texture = pfUI.addons.close:CreateTexture("pfBagClose") pfUI.addons.close.texture = pfUI.addons.close:CreateTexture("pfBagClose")
@@ -44,12 +44,12 @@ pfUI:RegisterModule("addons", function ()
pfUI.addons.close.texture:SetPoint("BOTTOMRIGHT", pfUI.addons.close, "BOTTOMRIGHT", -4, 4) pfUI.addons.close.texture:SetPoint("BOTTOMRIGHT", pfUI.addons.close, "BOTTOMRIGHT", -4, 4)
pfUI.addons.close.texture:SetVertexColor(1,.25,.25,1) pfUI.addons.close.texture:SetVertexColor(1,.25,.25,1)
pfUI.addons.close:SetScript("OnEnter", function () pfUI.addons.close:SetScript("OnEnter", function ()
pfUI.api:CreateBackdrop(pfUI.addons.close) CreateBackdrop(pfUI.addons.close)
pfUI.addons.close.backdrop:SetBackdropBorderColor(1,.25,.25,1) pfUI.addons.close.backdrop:SetBackdropBorderColor(1,.25,.25,1)
end) end)
pfUI.addons.close:SetScript("OnLeave", function () pfUI.addons.close:SetScript("OnLeave", function ()
pfUI.api:CreateBackdrop(pfUI.addons.close) CreateBackdrop(pfUI.addons.close)
end) end)
pfUI.addons.close:SetScript("OnClick", function() pfUI.addons.close:SetScript("OnClick", function()
@@ -92,7 +92,7 @@ pfUI:RegisterModule("addons", function ()
frame.input:SetNormalTexture("") frame.input:SetNormalTexture("")
frame.input:SetPushedTexture("") frame.input:SetPushedTexture("")
frame.input:SetHighlightTexture("") frame.input:SetHighlightTexture("")
pfUI.api:CreateBackdrop(frame.input, nil, true) CreateBackdrop(frame.input, nil, true)
--frame.input:SetBackdrop(pfUI.backdrop) --frame.input:SetBackdrop(pfUI.backdrop)
frame.input:SetBackdropBorderColor(.3,.3,.3,1) frame.input:SetBackdropBorderColor(.3,.3,.3,1)
frame.input:SetWidth(14) frame.input:SetWidth(14)
@@ -173,7 +173,7 @@ pfUI:RegisterModule("addons", function ()
pfUI.addons.deco:ClearAllPoints() pfUI.addons.deco:ClearAllPoints()
pfUI.addons.deco:SetPoint("TOPLEFT", pfUI.addons.scroll, "TOPLEFT", -5, 5) pfUI.addons.deco:SetPoint("TOPLEFT", pfUI.addons.scroll, "TOPLEFT", -5, 5)
pfUI.addons.deco:SetPoint("BOTTOMRIGHT", pfUI.addons.scroll, "BOTTOMRIGHT", 5, -5) pfUI.addons.deco:SetPoint("BOTTOMRIGHT", pfUI.addons.scroll, "BOTTOMRIGHT", 5, -5)
pfUI.api:CreateBackdrop(pfUI.addons.deco, nil, nil, .8) CreateBackdrop(pfUI.addons.deco, nil, nil, .8)
pfUI.addons.deco.up = CreateFrame("Frame", nil, pfUI.addons.deco) pfUI.addons.deco.up = CreateFrame("Frame", nil, pfUI.addons.deco)
pfUI.addons.deco.up:SetPoint("TOPRIGHT", 0,0) pfUI.addons.deco.up:SetPoint("TOPRIGHT", 0,0)
+3 -3
View File
@@ -5,7 +5,7 @@ pfUI:RegisterModule("autoshift", function ()
pfUI.autoshift.lastError = "" pfUI.autoshift.lastError = ""
pfUI.autoshift.CastSpellByName = _G["CastSpellByName"] pfUI.autoshift.CastSpellByName = _G["CastSpellByName"]
pfUI.api.Hook("CastSpell", function(spellId, spellbookTabNum) Hook("CastSpell", function(spellId, spellbookTabNum)
if pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleStance'] then if pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleStance'] then
pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BattleStance']) pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BattleStance'])
elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleDefStance'] then elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleDefStance'] then
@@ -20,7 +20,7 @@ pfUI:RegisterModule("autoshift", function ()
pfUI.autoshift.lastError = "" pfUI.autoshift.lastError = ""
end) end)
pfUI.api.Hook("CastSpellByName", function(spellName, onSelf) Hook("CastSpellByName", function(spellName, onSelf)
if pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleStance'] then if pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleStance'] then
pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BattleStance']) pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BattleStance'])
elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleDefStance'] then elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleDefStance'] then
@@ -35,7 +35,7 @@ pfUI:RegisterModule("autoshift", function ()
pfUI.autoshift.lastError = "" pfUI.autoshift.lastError = ""
end) end)
pfUI.api.Hook("UseAction", function(slot, checkCursor, onSelf) Hook("UseAction", function(slot, checkCursor, onSelf)
if pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleStance'] then if pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleStance'] then
pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BattleStance']) pfUI.autoshift.CastSpellByName(pfLocaleShift[pfUI.cache["locale"]]['BattleStance'])
elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleDefStance'] then elseif pfUI.autoshift.lastError == pfLocaleShift[pfUI.cache["locale"]]['wantBattleDefStance'] then
+17 -17
View File
@@ -196,7 +196,7 @@ pfUI:RegisterModule("bags", function ()
pfUI.bag:CreateAdditions(frame) pfUI.bag:CreateAdditions(frame)
frame:SetFrameStrata("HIGH") frame:SetFrameStrata("HIGH")
pfUI.api:CreateBackdrop(frame, default_border) CreateBackdrop(frame, default_border)
pfUI.bag.button_size = (frame:GetWidth() - 2*default_border - 9*default_border*3)/ 10 pfUI.bag.button_size = (frame:GetWidth() - 2*default_border - 9*default_border*3)/ 10
local topspace = pfUI.bag.right.close:GetHeight() + default_border * 2 local topspace = pfUI.bag.right.close:GetHeight() + default_border * 2
@@ -253,7 +253,7 @@ pfUI:RegisterModule("bags", function ()
if bag == -1 then tpl = "BankItemButtonGenericTemplate" end if bag == -1 then tpl = "BankItemButtonGenericTemplate" end
pfUI.bags[bag].slots[slot] = {} pfUI.bags[bag].slots[slot] = {}
pfUI.bags[bag].slots[slot].frame = CreateFrame("Button", "pfBag" .. bag .. "item" .. slot, pfUI.bags[bag], tpl) pfUI.bags[bag].slots[slot].frame = CreateFrame("Button", "pfBag" .. bag .. "item" .. slot, pfUI.bags[bag], tpl)
pfUI.api:CreateBackdrop(pfUI.bags[bag].slots[slot].frame, default_border) CreateBackdrop(pfUI.bags[bag].slots[slot].frame, default_border)
pfUI.bags[bag].slots[slot].frame:SetNormalTexture("") pfUI.bags[bag].slots[slot].frame:SetNormalTexture("")
pfUI.bags[bag].slots[slot].bag = bag pfUI.bags[bag].slots[slot].bag = bag
@@ -359,7 +359,7 @@ pfUI:RegisterModule("bags", function ()
end end
frame.bagslots:SetPoint("BOTTOM"..position, frame, "TOP"..position, 0, default_border*3) frame.bagslots:SetPoint("BOTTOM"..position, frame, "TOP"..position, 0, default_border*3)
pfUI.api:CreateBackdrop(frame.bagslots, default_border) CreateBackdrop(frame.bagslots, default_border)
local extra = 0 local extra = 0
if frame == pfUI.bag.left and GetNumBankSlots() < 6 then extra = 1 end if frame == pfUI.bag.left and GetNumBankSlots() < 6 then extra = 1 end
@@ -393,7 +393,7 @@ pfUI:RegisterModule("bags", function ()
local SlotEnter = frame.bagslots.slots[slot].frame:GetScript("OnEnter") local SlotEnter = frame.bagslots.slots[slot].frame:GetScript("OnEnter")
frame.bagslots.slots[slot].frame:SetScript("OnEnter", function() frame.bagslots.slots[slot].frame:SetScript("OnEnter", function()
for slot, f in ipairs(pfUI.bags[this.slot + 1].slots) do for slot, f in ipairs(pfUI.bags[this.slot + 1].slots) do
pfUI.api:CreateBackdrop(f.frame, default_border) CreateBackdrop(f.frame, default_border)
f.frame.backdrop:SetBackdropBorderColor(.2,1,.8,1) f.frame.backdrop:SetBackdropBorderColor(.2,1,.8,1)
end end
SlotEnter() SlotEnter()
@@ -415,7 +415,7 @@ pfUI:RegisterModule("bags", function ()
frame.bagslots.slots[slot].frame:SetWidth(pfUI.bag.button_size/5*4) frame.bagslots.slots[slot].frame:SetWidth(pfUI.bag.button_size/5*4)
local id, texture = GetInventorySlotInfo("Bag" .. slot .. append) local id, texture = GetInventorySlotInfo("Bag" .. slot .. append)
pfUI.api:CreateBackdrop(frame.bagslots.slots[slot].frame, default_border) CreateBackdrop(frame.bagslots.slots[slot].frame, default_border)
frame.bagslots.slots[slot].frame:Show() frame.bagslots.slots[slot].frame:Show()
local numSlots, full = GetNumBankSlots() local numSlots, full = GetNumBankSlots()
@@ -432,7 +432,7 @@ pfUI:RegisterModule("bags", function ()
frame.bagslots.buy = CreateFrame("Button", "pfBagSlotBuy", frame.bagslots) frame.bagslots.buy = CreateFrame("Button", "pfBagSlotBuy", frame.bagslots)
end end
frame.bagslots.buy:SetPoint("RIGHT", frame.bagslots, "RIGHT", -default_border, 0) frame.bagslots.buy:SetPoint("RIGHT", frame.bagslots, "RIGHT", -default_border, 0)
pfUI.api:CreateBackdrop(frame.bagslots.buy, default_border) CreateBackdrop(frame.bagslots.buy, default_border)
frame.bagslots.buy:SetHeight(pfUI.bag.button_size/5*4) frame.bagslots.buy:SetHeight(pfUI.bag.button_size/5*4)
frame.bagslots.buy:SetWidth(pfUI.bag.button_size/5*4) frame.bagslots.buy:SetWidth(pfUI.bag.button_size/5*4)
frame.bagslots.buy:SetText("+") frame.bagslots.buy:SetText("+")
@@ -460,7 +460,7 @@ pfUI:RegisterModule("bags", function ()
if not frame.close then if not frame.close then
frame.close = CreateFrame("Button", "pfBagClose", frame) frame.close = CreateFrame("Button", "pfBagClose", frame)
frame.close:SetPoint("TOPRIGHT", -default_border*1,-default_border ) frame.close:SetPoint("TOPRIGHT", -default_border*1,-default_border )
pfUI.api:CreateBackdrop(frame.close, default_border) CreateBackdrop(frame.close, default_border)
frame.close:SetHeight(12) frame.close:SetHeight(12)
frame.close:SetWidth(12) frame.close:SetWidth(12)
frame.close.texture = frame.close:CreateTexture("pfBagClose") frame.close.texture = frame.close:CreateTexture("pfBagClose")
@@ -474,7 +474,7 @@ pfUI:RegisterModule("bags", function ()
end) end)
frame.close:SetScript("OnLeave", function () frame.close:SetScript("OnLeave", function ()
pfUI.api:CreateBackdrop(frame.close, default_border) CreateBackdrop(frame.close, default_border)
end) end)
frame.close:SetScript("OnClick", function() frame.close:SetScript("OnClick", function()
@@ -486,7 +486,7 @@ pfUI:RegisterModule("bags", function ()
if not frame.bags then if not frame.bags then
frame.bags = CreateFrame("Button", "pfBagSlotShow", frame) frame.bags = CreateFrame("Button", "pfBagSlotShow", frame)
frame.bags:SetPoint("TOPRIGHT", frame.close, "TOPLEFT", -default_border*3, 0) frame.bags:SetPoint("TOPRIGHT", frame.close, "TOPLEFT", -default_border*3, 0)
pfUI.api:CreateBackdrop(frame.bags, default_border) CreateBackdrop(frame.bags, default_border)
frame.bags:SetHeight(12) frame.bags:SetHeight(12)
frame.bags:SetWidth(12) frame.bags:SetWidth(12)
frame.bags:SetTextColor(1,1,.25,1) frame.bags:SetTextColor(1,1,.25,1)
@@ -504,7 +504,7 @@ pfUI:RegisterModule("bags", function ()
end) end)
frame.bags:SetScript("OnLeave", function () frame.bags:SetScript("OnLeave", function ()
pfUI.api:CreateBackdrop(frame.bags, default_border) CreateBackdrop(frame.bags, default_border)
frame.bags.texture:SetVertexColor(.25,.25,.25,1) frame.bags.texture:SetVertexColor(.25,.25,.25,1)
end) end)
@@ -521,7 +521,7 @@ pfUI:RegisterModule("bags", function ()
if not frame.keys then if not frame.keys then
frame.keys = CreateFrame("Button", "pfBagSlotShow", frame) frame.keys = CreateFrame("Button", "pfBagSlotShow", frame)
frame.keys:SetPoint("TOPRIGHT", frame.bags, "TOPLEFT", -default_border*3, 0) frame.keys:SetPoint("TOPRIGHT", frame.bags, "TOPLEFT", -default_border*3, 0)
pfUI.api:CreateBackdrop(frame.keys, default_border) CreateBackdrop(frame.keys, default_border)
frame.keys:SetHeight(12) frame.keys:SetHeight(12)
frame.keys:SetWidth(12) frame.keys:SetWidth(12)
frame.keys:SetTextColor(1,1,.25,1) frame.keys:SetTextColor(1,1,.25,1)
@@ -539,7 +539,7 @@ pfUI:RegisterModule("bags", function ()
end) end)
frame.keys:SetScript("OnLeave", function () frame.keys:SetScript("OnLeave", function ()
pfUI.api:CreateBackdrop(frame.keys, default_border) CreateBackdrop(frame.keys, default_border)
frame.keys.texture:SetVertexColor(.25,.25,.25,1) frame.keys.texture:SetVertexColor(.25,.25,.25,1)
end) end)
@@ -559,7 +559,7 @@ pfUI:RegisterModule("bags", function ()
frame.search:SetHeight(12) frame.search:SetHeight(12)
frame.search:SetPoint("TOPLEFT", frame, "TOPLEFT", default_border, -default_border) frame.search:SetPoint("TOPLEFT", frame, "TOPLEFT", default_border, -default_border)
frame.search:SetPoint("TOPRIGHT", frame.keys, "TOPLEFT", -default_border*3, -default_border) frame.search:SetPoint("TOPRIGHT", frame.keys, "TOPLEFT", -default_border*3, -default_border)
pfUI.api:CreateBackdrop(frame.search, default_border) CreateBackdrop(frame.search, default_border)
frame.search.edit = CreateFrame("EditBox", "pfUIBagSearch", frame.search, "InputBoxTemplate") frame.search.edit = CreateFrame("EditBox", "pfUIBagSearch", frame.search, "InputBoxTemplate")
pfUIBagSearchLeft:SetTexture(nil) pfUIBagSearchLeft:SetTexture(nil)
@@ -619,7 +619,7 @@ pfUI:RegisterModule("bags", function ()
if not frame.close then if not frame.close then
frame.close = CreateFrame("Button", "pfBagClose", frame) frame.close = CreateFrame("Button", "pfBagClose", frame)
frame.close:SetPoint("TOPRIGHT", -default_border*1,-default_border ) frame.close:SetPoint("TOPRIGHT", -default_border*1,-default_border )
pfUI.api:CreateBackdrop(frame.close, default_border) CreateBackdrop(frame.close, default_border)
frame.close:SetHeight(12) frame.close:SetHeight(12)
frame.close:SetWidth(12) frame.close:SetWidth(12)
frame.close.texture = frame.close:CreateTexture("pfBagClose") frame.close.texture = frame.close:CreateTexture("pfBagClose")
@@ -633,7 +633,7 @@ pfUI:RegisterModule("bags", function ()
end) end)
frame.close:SetScript("OnLeave", function () frame.close:SetScript("OnLeave", function ()
pfUI.api:CreateBackdrop(frame.close, default_border) CreateBackdrop(frame.close, default_border)
end) end)
frame.close:SetScript("OnClick", function() frame.close:SetScript("OnClick", function()
@@ -645,7 +645,7 @@ pfUI:RegisterModule("bags", function ()
if not frame.bags then if not frame.bags then
frame.bags = CreateFrame("Button", "pfBagSlotShow", frame) frame.bags = CreateFrame("Button", "pfBagSlotShow", frame)
frame.bags:SetPoint("TOPRIGHT", frame.close, "TOPLEFT", -default_border*3, 0) frame.bags:SetPoint("TOPRIGHT", frame.close, "TOPLEFT", -default_border*3, 0)
pfUI.api:CreateBackdrop(frame.bags, default_border) CreateBackdrop(frame.bags, default_border)
frame.bags:SetHeight(12) frame.bags:SetHeight(12)
frame.bags:SetWidth(12) frame.bags:SetWidth(12)
frame.bags:SetTextColor(1,1,.25,1) frame.bags:SetTextColor(1,1,.25,1)
@@ -663,7 +663,7 @@ pfUI:RegisterModule("bags", function ()
end) end)
frame.bags:SetScript("OnLeave", function () frame.bags:SetScript("OnLeave", function ()
pfUI.api:CreateBackdrop(frame.bags, default_border) CreateBackdrop(frame.bags, default_border)
frame.bags.texture:SetVertexColor(.25,.25,.25,1) frame.bags.texture:SetVertexColor(.25,.25,.25,1)
end) end)
+2 -2
View File
@@ -59,7 +59,7 @@ pfUI:RegisterModule("buff", function ()
local _, _, mainhand, _, _, offhand = GetWeaponEnchantInfo() local _, _, mainhand, _, _, offhand = GetWeaponEnchantInfo()
if buff then if buff then
pfUI.api:CreateBackdrop(buff) CreateBackdrop(buff)
icon:SetTexCoord(.08, .92, .08, .92) icon:SetTexCoord(.08, .92, .08, .92)
border:Hide() border:Hide()
end end
@@ -111,7 +111,7 @@ pfUI:RegisterModule("buff", function ()
elseif i > 16 then elseif i > 16 then
buff:SetPoint("TOPRIGHT", _G["BuffButton" .. i-1], "TOPLEFT", -7, 0) buff:SetPoint("TOPRIGHT", _G["BuffButton" .. i-1], "TOPLEFT", -7, 0)
end end
pfUI.api:CreateBackdrop(buff) CreateBackdrop(buff)
text:SetPoint("TOP", buff, "BOTTOM", 0 , -C.appearance.border.default*2) text:SetPoint("TOP", buff, "BOTTOM", 0 , -C.appearance.border.default*2)
icon:SetTexCoord(.08, .92, .08, .92) icon:SetTexCoord(.08, .92, .08, .92)
if border then if border then
+18 -18
View File
@@ -16,7 +16,7 @@ pfUI:RegisterModule("castbar", function ()
-- [[ pfPlayerCastbar ]] -- -- [[ pfPlayerCastbar ]] --
pfUI.castbar.player = CreateFrame("Frame", "pfPlayerCastbar", UIParent) pfUI.castbar.player = CreateFrame("Frame", "pfPlayerCastbar", UIParent)
pfUI.castbar.player:SetFrameStrata("HIGH") pfUI.castbar.player:SetFrameStrata("HIGH")
pfUI.api:CreateBackdrop(pfUI.castbar.player, default_border) CreateBackdrop(pfUI.castbar.player, default_border)
pfUI.castbar.player:SetHeight(C.global.font_size + default_border) pfUI.castbar.player:SetHeight(C.global.font_size + default_border)
if pfUI.uf.player then if pfUI.uf.player then
@@ -27,7 +27,7 @@ pfUI:RegisterModule("castbar", function ()
pfUI.castbar.player:SetWidth(200) pfUI.castbar.player:SetWidth(200)
end end
pfUI.api:UpdateMovable(pfUI.castbar.player) UpdateMovable(pfUI.castbar.player)
pfUI.castbar.player:Hide() pfUI.castbar.player:Hide()
pfUI.castbar.player.delay = 0 pfUI.castbar.player.delay = 0
@@ -38,7 +38,7 @@ pfUI:RegisterModule("castbar", function ()
pfUI.castbar.player.bar:SetAllPoints(pfUI.castbar.player) pfUI.castbar.player.bar:SetAllPoints(pfUI.castbar.player)
pfUI.castbar.player.bar:SetMinMaxValues(0, 100) pfUI.castbar.player.bar:SetMinMaxValues(0, 100)
pfUI.castbar.player.bar:SetValue(20) pfUI.castbar.player.bar:SetValue(20)
local r,g,b,a = pfUI.api.strsplit(",", C.appearance.castbar.castbarcolor) local r,g,b,a = strsplit(",", C.appearance.castbar.castbarcolor)
pfUI.castbar.player.bar:SetStatusBarColor(r,g,b,a) pfUI.castbar.player.bar:SetStatusBarColor(r,g,b,a)
-- text left -- text left
@@ -118,20 +118,20 @@ pfUI:RegisterModule("castbar", function ()
end end
end end
pfUI.api.Hook("CastSpell", function(id, bookType) Hook("CastSpell", function(id, bookType)
local spellName = GetSpellName(id, bookType) local spellName = GetSpellName(id, bookType)
if pfUI.castbar.player[spellName] then if pfUI.castbar.player[spellName] then
pfUI.castbar.player[spellName](true) pfUI.castbar.player[spellName](true)
end end
end, true) end, true)
pfUI.api.Hook("CastSpellByName", function(spellName, target) Hook("CastSpellByName", function(spellName, target)
if pfUI.castbar.player[spellName] then if pfUI.castbar.player[spellName] then
pfUI.castbar.player[spellName](true) pfUI.castbar.player[spellName](true)
end end
end, true) end, true)
pfUI.api.Hook("UseAction", function(slot, target, button) Hook("UseAction", function(slot, target, button)
if GetActionText(slot) or not IsCurrentAction(slot) then return end if GetActionText(slot) or not IsCurrentAction(slot) then return end
scanner:ClearLines() scanner:ClearLines()
scanner:SetAction(slot) scanner:SetAction(slot)
@@ -145,7 +145,7 @@ pfUI:RegisterModule("castbar", function ()
pfUI.castbar.player.delay = 0 pfUI.castbar.player.delay = 0
pfUI.castbar.player.spell = spell pfUI.castbar.player.spell = spell
pfUI.castbar.player.bar.left:SetText(spell) pfUI.castbar.player.bar.left:SetText(spell)
local r,g,b,a = pfUI.api.strsplit(",", C.appearance.castbar.castbarcolor) local r,g,b,a = strsplit(",", C.appearance.castbar.castbarcolor)
pfUI.castbar.player.bar:SetStatusBarColor(r,g,b,a) pfUI.castbar.player.bar:SetStatusBarColor(r,g,b,a)
pfUI.castbar.player.startTime = GetTime() pfUI.castbar.player.startTime = GetTime()
pfUI.castbar.player.maxValue = duration / 1000 pfUI.castbar.player.maxValue = duration / 1000
@@ -173,7 +173,7 @@ pfUI:RegisterModule("castbar", function ()
pfUI.castbar.player.delay = 0 pfUI.castbar.player.delay = 0
pfUI.castbar.player.spell = spell pfUI.castbar.player.spell = spell
pfUI.castbar.player.bar.left:SetText(spell) pfUI.castbar.player.bar.left:SetText(spell)
local r,g,b,a = pfUI.api.strsplit(",", C.appearance.castbar.channelcolor) local r,g,b,a = strsplit(",", C.appearance.castbar.channelcolor)
pfUI.castbar.player.bar:SetStatusBarColor(r,g,b,a) pfUI.castbar.player.bar:SetStatusBarColor(r,g,b,a)
pfUI.castbar.player.maxValue = nil pfUI.castbar.player.maxValue = nil
pfUI.castbar.player.startTime = GetTime() pfUI.castbar.player.startTime = GetTime()
@@ -255,10 +255,10 @@ pfUI:RegisterModule("castbar", function ()
if cur > max then cur = max end if cur > max then cur = max end
if delay > 0 then if delay > 0 then
delay = "|cffffaaaa+" .. pfUI.api.round(delay,1) .. " |r " delay = "|cffffaaaa+" .. round(delay,1) .. " |r "
pfUI.castbar.player.bar.right:SetText(delay .. pfUI.api.round(cur,1) .. " / " .. pfUI.api.round(max,1)) pfUI.castbar.player.bar.right:SetText(delay .. round(cur,1) .. " / " .. round(max,1))
else else
pfUI.castbar.player.bar.right:SetText(pfUI.api.round(cur,1) .. " / " .. pfUI.api.round(max,1)) pfUI.castbar.player.bar.right:SetText(round(cur,1) .. " / " .. round(max,1))
end end
return return
@@ -283,10 +283,10 @@ pfUI:RegisterModule("castbar", function ()
return return
end end
if delay > 0 then if delay > 0 then
delay = "|cffffaaaa-" .. pfUI.api.round(delay,1) .. " |r " delay = "|cffffaaaa-" .. round(delay,1) .. " |r "
pfUI.castbar.player.bar.right:SetText(delay .. pfUI.api.round(cur,1)) pfUI.castbar.player.bar.right:SetText(delay .. round(cur,1))
else else
pfUI.castbar.player.bar.right:SetText(pfUI.api.round(cur,1)) pfUI.castbar.player.bar.right:SetText(round(cur,1))
end end
return return
@@ -304,7 +304,7 @@ pfUI:RegisterModule("castbar", function ()
-- [[ pfTargetCastbar ]] -- -- [[ pfTargetCastbar ]] --
pfUI.castbar.target = CreateFrame("Frame", "pfTargetCastbar", UIParent) pfUI.castbar.target = CreateFrame("Frame", "pfTargetCastbar", UIParent)
pfUI.castbar.target:SetFrameStrata("HIGH") pfUI.castbar.target:SetFrameStrata("HIGH")
pfUI.api:CreateBackdrop(pfUI.castbar.target, default_border) CreateBackdrop(pfUI.castbar.target, default_border)
pfUI.castbar.target:SetHeight(C.global.font_size + default_border) pfUI.castbar.target:SetHeight(C.global.font_size + default_border)
if pfUI.uf.target then if pfUI.uf.target then
@@ -315,7 +315,7 @@ pfUI:RegisterModule("castbar", function ()
pfUI.castbar.target:SetWidth(200) pfUI.castbar.target:SetWidth(200)
end end
pfUI.api:UpdateMovable(pfUI.castbar.target) UpdateMovable(pfUI.castbar.target)
pfUI.castbar.target:Hide() pfUI.castbar.target:Hide()
@@ -326,7 +326,7 @@ pfUI:RegisterModule("castbar", function ()
pfUI.castbar.target.bar:SetAllPoints(pfUI.castbar.target) pfUI.castbar.target.bar:SetAllPoints(pfUI.castbar.target)
pfUI.castbar.target.bar:SetMinMaxValues(0, 100) pfUI.castbar.target.bar:SetMinMaxValues(0, 100)
pfUI.castbar.target.bar:SetValue(20) pfUI.castbar.target.bar:SetValue(20)
local r,g,b,a = pfUI.api.strsplit(",", C.appearance.castbar.castbarcolor) local r,g,b,a = strsplit(",", C.appearance.castbar.castbarcolor)
pfUI.castbar.target.bar:SetStatusBarColor(r,g,b,a) pfUI.castbar.target.bar:SetStatusBarColor(r,g,b,a)
-- text left -- text left
@@ -365,7 +365,7 @@ pfUI:RegisterModule("castbar", function ()
pfUI.castbar.target.bar:SetMinMaxValues(0, casttime) pfUI.castbar.target.bar:SetMinMaxValues(0, casttime)
pfUI.castbar.target.bar:SetValue(GetTime() - starttime) pfUI.castbar.target.bar:SetValue(GetTime() - starttime)
pfUI.castbar.target.bar.left:SetText(spellname) pfUI.castbar.target.bar.left:SetText(spellname)
pfUI.castbar.target.bar.right:SetText(pfUI.api.round(GetTime() - starttime,1) .. " / " .. casttime) pfUI.castbar.target.bar.right:SetText(round(GetTime() - starttime,1) .. " / " .. casttime)
end end
else else
pfUI.castbar.target.casterDB[UnitName("target")] = nil pfUI.castbar.target.casterDB[UnitName("target")] = nil
+18 -18
View File
@@ -26,13 +26,13 @@ pfUI:RegisterModule("chat", function ()
pfUI.chat.left:SetHeight(C.chat.left.height) pfUI.chat.left:SetHeight(C.chat.left.height)
pfUI.chat.left:SetPoint("BOTTOMLEFT", 5,5) pfUI.chat.left:SetPoint("BOTTOMLEFT", 5,5)
pfUI.chat.left:SetScript("OnShow", function() pfUI.chat:RefreshChat() end) pfUI.chat.left:SetScript("OnShow", function() pfUI.chat:RefreshChat() end)
pfUI.api:UpdateMovable(pfUI.chat.left) UpdateMovable(pfUI.chat.left)
pfUI.api:CreateBackdrop(pfUI.chat.left, default_border, nil, .8) CreateBackdrop(pfUI.chat.left, default_border, nil, .8)
if C.chat.global.custombg == "1" then if C.chat.global.custombg == "1" then
local r, g, b, a = pfUI.api.strsplit(",", C.chat.global.background) local r, g, b, a = strsplit(",", C.chat.global.background)
pfUI.chat.left.backdrop:SetBackdropColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a)) pfUI.chat.left.backdrop:SetBackdropColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a))
local r, g, b, a = pfUI.api.strsplit(",", C.chat.global.border) local r, g, b, a = strsplit(",", C.chat.global.border)
pfUI.chat.left.backdrop:SetBackdropBorderColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a)) pfUI.chat.left.backdrop:SetBackdropBorderColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a))
end end
@@ -42,7 +42,7 @@ pfUI:RegisterModule("chat", function ()
pfUI.chat.left.panelTop:SetPoint("TOPLEFT", pfUI.chat.left, "TOPLEFT", default_border, -default_border) pfUI.chat.left.panelTop:SetPoint("TOPLEFT", pfUI.chat.left, "TOPLEFT", default_border, -default_border)
pfUI.chat.left.panelTop:SetPoint("TOPRIGHT", pfUI.chat.left, "TOPRIGHT", -default_border, -default_border) pfUI.chat.left.panelTop:SetPoint("TOPRIGHT", pfUI.chat.left, "TOPRIGHT", -default_border, -default_border)
if C.chat.global.tabdock == "1" then if C.chat.global.tabdock == "1" then
pfUI.api:CreateBackdrop(pfUI.chat.left.panelTop, default_border, nil, .8) CreateBackdrop(pfUI.chat.left.panelTop, default_border, nil, .8)
end end
-- whisper forwarding -- whisper forwarding
@@ -114,7 +114,7 @@ pfUI:RegisterModule("chat", function ()
pfUI.chat.left.panelTop.proxyName:SetPoint("CENTER", 0, 0) pfUI.chat.left.panelTop.proxyName:SetPoint("CENTER", 0, 0)
pfUI.chat.left.panelTop.proxyName:SetHeight(100) pfUI.chat.left.panelTop.proxyName:SetHeight(100)
pfUI.chat.left.panelTop.proxyName:SetWidth(200) pfUI.chat.left.panelTop.proxyName:SetWidth(200)
pfUI.api:CreateBackdrop(pfUI.chat.left.panelTop.proxyName, default_border) CreateBackdrop(pfUI.chat.left.panelTop.proxyName, default_border)
pfUI.chat.left.panelTop.proxyName:SetScript("OnShow", function() pfUI.chat.left.panelTop.proxyName:SetScript("OnShow", function()
pfUI.chat.left.panelTop.proxyName.input:SetText(pfUI.chat.left.panelTop.proxy.forwardto) pfUI.chat.left.panelTop.proxyName.input:SetText(pfUI.chat.left.panelTop.proxy.forwardto)
end) end)
@@ -129,7 +129,7 @@ pfUI:RegisterModule("chat", function ()
pfUI.chat.left.panelTop.proxyName.input = CreateFrame("EditBox", nil, pfUI.chat.left.panelTop.proxyName) pfUI.chat.left.panelTop.proxyName.input = CreateFrame("EditBox", nil, pfUI.chat.left.panelTop.proxyName)
pfUI.chat.left.panelTop.proxyName.input:SetTextColor(.2,1.1,1) pfUI.chat.left.panelTop.proxyName.input:SetTextColor(.2,1.1,1)
pfUI.chat.left.panelTop.proxyName.input:SetJustifyH("CENTER") pfUI.chat.left.panelTop.proxyName.input:SetJustifyH("CENTER")
pfUI.api:CreateBackdrop(pfUI.chat.left.panelTop.proxyName.input, default_border) CreateBackdrop(pfUI.chat.left.panelTop.proxyName.input, default_border)
pfUI.chat.left.panelTop.proxyName.input:SetPoint("TOPLEFT" , pfUI.chat.left.panelTop.proxyName, "TOPLEFT", 20, -40) pfUI.chat.left.panelTop.proxyName.input:SetPoint("TOPLEFT" , pfUI.chat.left.panelTop.proxyName, "TOPLEFT", 20, -40)
pfUI.chat.left.panelTop.proxyName.input:SetPoint("BOTTOMRIGHT" , pfUI.chat.left.panelTop.proxyName, "BOTTOMRIGHT", -20, 40) pfUI.chat.left.panelTop.proxyName.input:SetPoint("BOTTOMRIGHT" , pfUI.chat.left.panelTop.proxyName, "BOTTOMRIGHT", -20, 40)
pfUI.chat.left.panelTop.proxyName.input:SetFontObject(GameFontWhite) pfUI.chat.left.panelTop.proxyName.input:SetFontObject(GameFontWhite)
@@ -143,7 +143,7 @@ pfUI:RegisterModule("chat", function ()
pfUI.chat.left.panelTop.proxyName.okay:SetWidth(80) pfUI.chat.left.panelTop.proxyName.okay:SetWidth(80)
pfUI.chat.left.panelTop.proxyName.okay:SetHeight(20) pfUI.chat.left.panelTop.proxyName.okay:SetHeight(20)
pfUI.chat.left.panelTop.proxyName.okay:SetPoint("BOTTOMRIGHT", -10, 10) pfUI.chat.left.panelTop.proxyName.okay:SetPoint("BOTTOMRIGHT", -10, 10)
pfUI.api:CreateBackdrop(pfUI.chat.left.panelTop.proxyName.okay, default_border) CreateBackdrop(pfUI.chat.left.panelTop.proxyName.okay, default_border)
pfUI.chat.left.panelTop.proxyName.okay.text = pfUI.chat.left.panelTop.proxyName.okay:CreateFontString("Status", "LOW", "GameFontNormal") pfUI.chat.left.panelTop.proxyName.okay.text = pfUI.chat.left.panelTop.proxyName.okay:CreateFontString("Status", "LOW", "GameFontNormal")
pfUI.chat.left.panelTop.proxyName.okay.text:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE") pfUI.chat.left.panelTop.proxyName.okay.text:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE")
pfUI.chat.left.panelTop.proxyName.okay.text:ClearAllPoints() pfUI.chat.left.panelTop.proxyName.okay.text:ClearAllPoints()
@@ -163,7 +163,7 @@ pfUI:RegisterModule("chat", function ()
pfUI.chat.left.panelTop.proxyName.abort:SetWidth(80) pfUI.chat.left.panelTop.proxyName.abort:SetWidth(80)
pfUI.chat.left.panelTop.proxyName.abort:SetHeight(20) pfUI.chat.left.panelTop.proxyName.abort:SetHeight(20)
pfUI.chat.left.panelTop.proxyName.abort:SetPoint("BOTTOMLEFT", 10, 10) pfUI.chat.left.panelTop.proxyName.abort:SetPoint("BOTTOMLEFT", 10, 10)
pfUI.api:CreateBackdrop(pfUI.chat.left.panelTop.proxyName.abort, default_border) CreateBackdrop(pfUI.chat.left.panelTop.proxyName.abort, default_border)
pfUI.chat.left.panelTop.proxyName.abort.text = pfUI.chat.left.panelTop.proxyName.abort:CreateFontString("Status", "LOW", "GameFontNormal") pfUI.chat.left.panelTop.proxyName.abort.text = pfUI.chat.left.panelTop.proxyName.abort:CreateFontString("Status", "LOW", "GameFontNormal")
pfUI.chat.left.panelTop.proxyName.abort.text:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE") pfUI.chat.left.panelTop.proxyName.abort.text:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE")
pfUI.chat.left.panelTop.proxyName.abort.text:ClearAllPoints() pfUI.chat.left.panelTop.proxyName.abort.text:ClearAllPoints()
@@ -184,13 +184,13 @@ pfUI:RegisterModule("chat", function ()
pfUI.chat.right:SetHeight(C.chat.right.height) pfUI.chat.right:SetHeight(C.chat.right.height)
pfUI.chat.right:SetPoint("BOTTOMRIGHT", -5,5) pfUI.chat.right:SetPoint("BOTTOMRIGHT", -5,5)
pfUI.chat.right:SetScript("OnShow", function() pfUI.chat:RefreshChat() end) pfUI.chat.right:SetScript("OnShow", function() pfUI.chat:RefreshChat() end)
pfUI.api:UpdateMovable(pfUI.chat.right) UpdateMovable(pfUI.chat.right)
pfUI.api:CreateBackdrop(pfUI.chat.right, default_border, nil, .8) CreateBackdrop(pfUI.chat.right, default_border, nil, .8)
if C.chat.global.custombg == "1" then if C.chat.global.custombg == "1" then
local r, g, b, a = pfUI.api.strsplit(",", C.chat.global.background) local r, g, b, a = strsplit(",", C.chat.global.background)
pfUI.chat.right.backdrop:SetBackdropColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a)) pfUI.chat.right.backdrop:SetBackdropColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a))
local r, g, b, a = pfUI.api.strsplit(",", C.chat.global.border) local r, g, b, a = strsplit(",", C.chat.global.border)
pfUI.chat.right.backdrop:SetBackdropBorderColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a)) pfUI.chat.right.backdrop:SetBackdropBorderColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a))
end end
@@ -200,7 +200,7 @@ pfUI:RegisterModule("chat", function ()
pfUI.chat.right.panelTop:SetPoint("TOPLEFT", pfUI.chat.right, "TOPLEFT", default_border, -default_border) pfUI.chat.right.panelTop:SetPoint("TOPLEFT", pfUI.chat.right, "TOPLEFT", default_border, -default_border)
pfUI.chat.right.panelTop:SetPoint("TOPRIGHT", pfUI.chat.right, "TOPRIGHT", -default_border, -default_border) pfUI.chat.right.panelTop:SetPoint("TOPRIGHT", pfUI.chat.right, "TOPRIGHT", -default_border, -default_border)
if C.chat.global.tabdock == "1" then if C.chat.global.tabdock == "1" then
pfUI.api:CreateBackdrop(pfUI.chat.right.panelTop, default_border, nil, .8) CreateBackdrop(pfUI.chat.right.panelTop, default_border, nil, .8)
end end
pfUI.chat:RegisterEvent("PLAYER_ENTERING_WORLD") pfUI.chat:RegisterEvent("PLAYER_ENTERING_WORLD")
@@ -544,7 +544,7 @@ pfUI:RegisterModule("chat", function ()
pfUI.chat.editbox:SetPoint("BOTTOMLEFT", anchor, "TOPLEFT", 0, default_border*3) pfUI.chat.editbox:SetPoint("BOTTOMLEFT", anchor, "TOPLEFT", 0, default_border*3)
pfUI.chat.editbox:SetPoint("BOTTOMRIGHT", anchor, "TOPRIGHT", 0, default_border*3) pfUI.chat.editbox:SetPoint("BOTTOMRIGHT", anchor, "TOPRIGHT", 0, default_border*3)
pfUI.api:UpdateMovable(pfUI.chat.editbox) UpdateMovable(pfUI.chat.editbox)
end) end)
if C.chat.text.input_width == "0" then if C.chat.text.input_width == "0" then
@@ -555,7 +555,7 @@ pfUI:RegisterModule("chat", function ()
ChatFrameEditBox:SetParent(pfUI.chat.editbox) ChatFrameEditBox:SetParent(pfUI.chat.editbox)
ChatFrameEditBox:SetAllPoints(pfUI.chat.editbox) ChatFrameEditBox:SetAllPoints(pfUI.chat.editbox)
pfUI.api:CreateBackdrop(ChatFrameEditBox, default_border) CreateBackdrop(ChatFrameEditBox, default_border)
for i,v in ipairs({ChatFrameEditBox:GetRegions()}) do for i,v in ipairs({ChatFrameEditBox:GetRegions()}) do
if i==6 or i==7 or i==8 then v:Hide() end if i==6 or i==7 or i==8 then v:Hide() end
@@ -577,7 +577,7 @@ pfUI:RegisterModule("chat", function ()
CHAT_BATTLEGROUND_LEADER_GET = '[BL]' .. default CHAT_BATTLEGROUND_LEADER_GET = '[BL]' .. default
CHAT_SAY_GET = '[S]' .. default CHAT_SAY_GET = '[S]' .. default
local cr, cg, cb, ca = pfUI.api.strsplit(",", C.chat.global.whisper) local cr, cg, cb, ca = strsplit(",", C.chat.global.whisper)
cr, cg, cb = tonumber(cr), tonumber(cg), tonumber(cb) cr, cg, cb = tonumber(cr), tonumber(cg), tonumber(cb)
local wcol = string.format("%02x%02x%02x",cr * 255,cg * 255, cb * 255) local wcol = string.format("%02x%02x%02x",cr * 255,cg * 255, cb * 255)
@@ -631,7 +631,7 @@ pfUI:RegisterModule("chat", function ()
local left = string.sub(C.chat.text.timebracket, 1, 1) local left = string.sub(C.chat.text.timebracket, 1, 1)
local right = string.sub(C.chat.text.timebracket, 2, 2) local right = string.sub(C.chat.text.timebracket, 2, 2)
local r,g,b,a = pfUI.api.strsplit(",", C.chat.text.timecolor) local r,g,b,a = strsplit(",", C.chat.text.timecolor)
local chex = string.format("%02x%02x%02x%02x", a*255, r*255, g*255, b*255) local chex = string.format("%02x%02x%02x%02x", a*255, r*255, g*255, b*255)
text = "|c" .. chex .. left .. date(C.chat.text.timeformat) .. right .. "|r " .. text text = "|c" .. chex .. left .. date(C.chat.text.timeformat) .. right .. "|r " .. text
end end
+5 -5
View File
@@ -34,19 +34,19 @@ pfUI:RegisterModule("cooldown", function ()
if remaining > 99 then if remaining > 99 then
remaining = remaining / 60 remaining = remaining / 60
unit = "m" unit = "m"
r,g,b,a = pfUI.api.strsplit(",", C.appearance.cd.mincolor) r,g,b,a = strsplit(",", C.appearance.cd.mincolor)
end end
if remaining > 99 then if remaining > 99 then
remaining = remaining / 60 remaining = remaining / 60
unit = "h" unit = "h"
r,g,b,a = pfUI.api.strsplit(",", C.appearance.cd.hourcolor) r,g,b,a = strsplit(",", C.appearance.cd.hourcolor)
end end
if remaining > 99 then if remaining > 99 then
remaining = remaining / 24 remaining = remaining / 24
unit = "d" unit = "d"
r,g,b,a = pfUI.api.strsplit(",", C.appearance.cd.daycolor) r,g,b,a = strsplit(",", C.appearance.cd.daycolor)
end end
this.text:SetText(pfUI.api.round(remaining) .. unit) this.text:SetText(round(remaining) .. unit)
this.text:SetTextColor(r,g,b,a) this.text:SetTextColor(r,g,b,a)
else else
this:Hide() this:Hide()
@@ -55,7 +55,7 @@ pfUI:RegisterModule("cooldown", function ()
end end
-- hook -- hook
pfUI.api.Hook("CooldownFrame_SetTimer", function(this, start, duration, enable) Hook("CooldownFrame_SetTimer", function(this, start, duration, enable)
-- break here if no this-reference is set -- break here if no this-reference is set
if not this then return end if not this then return end
+3 -3
View File
@@ -36,7 +36,7 @@ pfUI:RegisterModule("firstrun", function ()
this:GetParent():Hide() this:GetParent():Hide()
end end
pfUI.api:CreateQuestionDialog("Welcome to |cff33ffccpf|cffffffffUI|r!\n\n".. CreateQuestionDialog("Welcome to |cff33ffccpf|cffffffffUI|r!\n\n"..
"I'm the first run wizzard that will guide you through some basic configuration.\n".. "I'm the first run wizzard that will guide you through some basic configuration.\n"..
"You'll now be prompted for several questions. To get a default installation,\n".. "You'll now be prompted for several questions. To get a default installation,\n"..
"you might want to click \"Yes\" everywhere. A few settings are client settings\n".. "you might want to click \"Yes\" everywhere. A few settings are client settings\n"..
@@ -65,9 +65,9 @@ pfUI:RegisterModule("firstrun", function ()
end end
if step.cmpnt and step.cmpnt == "edit" then if step.cmpnt and step.cmpnt == "edit" then
pfUI.api:CreateQuestionDialog(step.descr, yes, no, true) CreateQuestionDialog(step.descr, yes, no, true)
else else
pfUI.api:CreateQuestionDialog(step.descr, yes, no, false) CreateQuestionDialog(step.descr, yes, no, false)
end end
return return
+3 -3
View File
@@ -87,7 +87,7 @@ pfUI:RegisterModule("group", function ()
pfUI.uf.group[i]:SetWidth(175) pfUI.uf.group[i]:SetWidth(175)
pfUI.uf.group[i]:SetHeight(40 + 2*default_border + spacing) pfUI.uf.group[i]:SetHeight(40 + 2*default_border + spacing)
pfUI.uf.group[i]:SetPoint("TOPLEFT", 5, -5 - ((i-1)*55)) pfUI.uf.group[i]:SetPoint("TOPLEFT", 5, -5 - ((i-1)*55))
pfUI.api:UpdateMovable(pfUI.uf.group[i]) UpdateMovable(pfUI.uf.group[i])
pfUI.uf.group[i]:Hide() pfUI.uf.group[i]:Hide()
pfUI.uf.group[i].id = i pfUI.uf.group[i].id = i
pfUI.uf.group[i].label = "party" pfUI.uf.group[i].label = "party"
@@ -97,7 +97,7 @@ pfUI:RegisterModule("group", function ()
pfUI.uf.group[i].hp:SetWidth(175) pfUI.uf.group[i].hp:SetWidth(175)
pfUI.uf.group[i].hp:SetHeight(30) pfUI.uf.group[i].hp:SetHeight(30)
pfUI.uf.group[i].hp:SetPoint("TOP", 0, 0) pfUI.uf.group[i].hp:SetPoint("TOP", 0, 0)
pfUI.api:CreateBackdrop(pfUI.uf.group[i].hp, default_border) CreateBackdrop(pfUI.uf.group[i].hp, default_border)
pfUI.uf.group[i].hp.bar = CreateFrame("StatusBar", nil, pfUI.uf.group[i].hp) pfUI.uf.group[i].hp.bar = CreateFrame("StatusBar", nil, pfUI.uf.group[i].hp)
pfUI.uf.group[i].hp.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar") pfUI.uf.group[i].hp.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
@@ -108,7 +108,7 @@ pfUI:RegisterModule("group", function ()
pfUI.uf.group[i].power:SetWidth(175) pfUI.uf.group[i].power:SetWidth(175)
pfUI.uf.group[i].power:SetHeight(10) pfUI.uf.group[i].power:SetHeight(10)
pfUI.uf.group[i].power:SetPoint("BOTTOM", 0, 0) pfUI.uf.group[i].power:SetPoint("BOTTOM", 0, 0)
pfUI.api:CreateBackdrop(pfUI.uf.group[i].power, default_border) CreateBackdrop(pfUI.uf.group[i].power, default_border)
pfUI.uf.group[i].power.bar = CreateFrame("StatusBar", nil, pfUI.uf.group[i].power) pfUI.uf.group[i].power.bar = CreateFrame("StatusBar", nil, pfUI.uf.group[i].power)
pfUI.uf.group[i].power.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar") pfUI.uf.group[i].power.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
+36 -36
View File
@@ -10,7 +10,7 @@ pfUI:RegisterModule("gui", function ()
pfUI.gui:SetHeight(500) pfUI.gui:SetHeight(500)
pfUI.gui:Hide() pfUI.gui:Hide()
pfUI.api:CreateBackdrop(pfUI.gui, nil, nil, .8) CreateBackdrop(pfUI.gui, nil, nil, .8)
pfUI.gui:SetPoint("CENTER",0,0) pfUI.gui:SetPoint("CENTER",0,0)
pfUI.gui:SetMovable(true) pfUI.gui:SetMovable(true)
pfUI.gui:EnableMouse(true) pfUI.gui:EnableMouse(true)
@@ -29,7 +29,7 @@ pfUI:RegisterModule("gui", function ()
end) end)
function pfUI.gui:Reload() function pfUI.gui:Reload()
pfUI.api:CreateQuestionDialog("Some settings need to reload the UI to take effect.\nDo you want to reloadUI now?", CreateQuestionDialog("Some settings need to reload the UI to take effect.\nDo you want to reloadUI now?",
function() function()
pfUI.gui.settingChanged = nil pfUI.gui.settingChanged = nil
ReloadUI() ReloadUI()
@@ -143,7 +143,7 @@ pfUI:RegisterModule("gui", function ()
frame.drag = CreateFrame("Frame", nil, frame) frame.drag = CreateFrame("Frame", nil, frame)
frame.drag:SetAllPoints(frame) frame.drag:SetAllPoints(frame)
frame.drag:SetFrameStrata("DIALOG") frame.drag:SetFrameStrata("DIALOG")
pfUI.api:CreateBackdrop(frame.drag, nil, nil, .8) CreateBackdrop(frame.drag, nil, nil, .8)
frame.drag.backdrop:SetBackdropBorderColor(.2, 1, .8) frame.drag.backdrop:SetBackdropBorderColor(.2, 1, .8)
frame.drag:EnableMouseWheel(1) frame.drag:EnableMouseWheel(1)
frame.drag.text = frame.drag:CreateFontString("Status", "LOW", "GameFontNormal") frame.drag.text = frame.drag:CreateFontString("Status", "LOW", "GameFontNormal")
@@ -154,13 +154,13 @@ pfUI:RegisterModule("gui", function ()
frame.drag.text:SetFontObject(GameFontWhite) frame.drag.text:SetFontObject(GameFontWhite)
local label = (strsub(frame:GetName(),3)) local label = (strsub(frame:GetName(),3))
if frame.drag:GetHeight() > (2 * frame.drag:GetWidth()) then if frame.drag:GetHeight() > (2 * frame.drag:GetWidth()) then
label = pfUI.api.strvertical(label) label = strvertical(label)
end end
frame.drag.text:SetText(label) frame.drag.text:SetText(label)
frame.drag:SetAlpha(1) frame.drag:SetAlpha(1)
frame.drag:SetScript("OnMouseWheel", function() frame.drag:SetScript("OnMouseWheel", function()
local scale = pfUI.api.round(frame:GetScale() + arg1/10, 1) local scale = round(frame:GetScale() + arg1/10, 1)
if IsShiftKeyDown() and strsub(frame:GetName(),0,6) == "pfRaid" then if IsShiftKeyDown() and strsub(frame:GetName(),0,6) == "pfRaid" then
for i=1,40 do for i=1,40 do
@@ -328,12 +328,12 @@ pfUI:RegisterModule("gui", function ()
for _, hide in pairs(elements) do for _, hide in pairs(elements) do
hide:Hide() hide:Hide()
pfUI.api:CreateBackdrop(hide.switch, nil, true) CreateBackdrop(hide.switch, nil, true)
end end
pfUI.gui.scroll:SetScrollChild(frame) pfUI.gui.scroll:SetScrollChild(frame)
pfUI.gui.scroll:UpdateScrollState() pfUI.gui.scroll:UpdateScrollState()
pfUI.gui.scroll:SetVerticalScroll(0) pfUI.gui.scroll:SetVerticalScroll(0)
pfUI.api:CreateBackdrop(frame.switch, nil, true) CreateBackdrop(frame.switch, nil, true)
frame.switch:SetBackdropBorderColor(.2,1,.8) frame.switch:SetBackdropBorderColor(.2,1,.8)
frame:Show() frame:Show()
end end
@@ -368,7 +368,7 @@ pfUI:RegisterModule("gui", function ()
else else
frame.switch:SetPoint("TOPLEFT", default_border, -pfUI.gui.tabTop* (22 + default_border) -default_border) frame.switch:SetPoint("TOPLEFT", default_border, -pfUI.gui.tabTop* (22 + default_border) -default_border)
end end
pfUI.api:CreateBackdrop(frame.switch, nil, true) CreateBackdrop(frame.switch, nil, true)
frame.switch.text = frame.switch:CreateFontString("Status", "LOW", "GameFontNormal") frame.switch.text = frame.switch:CreateFontString("Status", "LOW", "GameFontNormal")
frame.switch.text:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE") frame.switch.text:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE")
frame.switch.text:SetAllPoints(frame.switch) frame.switch.text:SetAllPoints(frame.switch)
@@ -445,19 +445,19 @@ pfUI:RegisterModule("gui", function ()
frame.color = CreateFrame("Button", nil, frame) frame.color = CreateFrame("Button", nil, frame)
frame.color:SetWidth(12) frame.color:SetWidth(12)
frame.color:SetHeight(12) frame.color:SetHeight(12)
pfUI.api:CreateBackdrop(frame.color) CreateBackdrop(frame.color)
frame.color:SetPoint("TOPRIGHT" , 0, -4) frame.color:SetPoint("TOPRIGHT" , 0, -4)
frame.color.prev = frame.color.backdrop:CreateTexture("OVERLAY") frame.color.prev = frame.color.backdrop:CreateTexture("OVERLAY")
frame.color.prev:SetAllPoints(frame.color) frame.color.prev:SetAllPoints(frame.color)
local cr, cg, cb, ca = pfUI.api.strsplit(",", category[config]) local cr, cg, cb, ca = strsplit(",", category[config])
if not cr or not cg or not cb or not ca then if not cr or not cg or not cb or not ca then
cr, cg, cb, ca = 1, 1, 1, 1 cr, cg, cb, ca = 1, 1, 1, 1
end end
frame.color.prev:SetTexture(cr,cg,cb,ca) frame.color.prev:SetTexture(cr,cg,cb,ca)
frame.color:SetScript("OnClick", function() frame.color:SetScript("OnClick", function()
local cr, cg, cb, ca = pfUI.api.strsplit(",", category[config]) local cr, cg, cb, ca = strsplit(",", category[config])
if not cr or not cg or not cb or not ca then if not cr or not cg or not cb or not ca then
cr, cg, cb, ca = 1, 1, 1, 1 cr, cg, cb, ca = 1, 1, 1, 1
end end
@@ -467,10 +467,10 @@ pfUI:RegisterModule("gui", function ()
local r,g,b = ColorPickerFrame:GetColorRGB() local r,g,b = ColorPickerFrame:GetColorRGB()
local a = 1 - OpacitySliderFrame:GetValue() local a = 1 - OpacitySliderFrame:GetValue()
r = pfUI.api.round(r, 1) r = round(r, 1)
g = pfUI.api.round(g, 1) g = round(g, 1)
b = pfUI.api.round(b, 1) b = round(b, 1)
a = pfUI.api.round(a, 1) a = round(a, 1)
preview:SetTexture(r,g,b,a) preview:SetTexture(r,g,b,a)
@@ -495,7 +495,7 @@ pfUI:RegisterModule("gui", function ()
end end
if widget == "warning" then if widget == "warning" then
pfUI.api:CreateBackdrop(frame, nil, true) CreateBackdrop(frame, nil, true)
frame:SetBackdropBorderColor(1,.5,.5) frame:SetBackdropBorderColor(1,.5,.5)
frame:SetHeight(50) frame:SetHeight(50)
frame:SetPoint("TOPLEFT", 25, parent.objectCount * -35) frame:SetPoint("TOPLEFT", 25, parent.objectCount * -35)
@@ -543,8 +543,8 @@ pfUI:RegisterModule("gui", function ()
-- use button widget -- use button widget
if widget == "button" then if widget == "button" then
frame.button = CreateFrame("Button", "pfButton", frame, "UIPanelButtonTemplate") frame.button = CreateFrame("Button", "pfButton", frame, "UIPanelButtonTemplate")
pfUI.api:CreateBackdrop(frame.button, nil, true) CreateBackdrop(frame.button, nil, true)
pfUI.api:SkinButton(frame.button) SkinButton(frame.button)
frame.button:SetWidth(85) frame.button:SetWidth(85)
frame.button:SetHeight(20) frame.button:SetHeight(20)
frame.button:SetPoint("TOPRIGHT", -(parent.lineCount-1) * 90, -5) frame.button:SetPoint("TOPRIGHT", -(parent.lineCount-1) * 90, -5)
@@ -560,7 +560,7 @@ pfUI:RegisterModule("gui", function ()
frame.input:SetNormalTexture("") frame.input:SetNormalTexture("")
frame.input:SetPushedTexture("") frame.input:SetPushedTexture("")
frame.input:SetHighlightTexture("") frame.input:SetHighlightTexture("")
pfUI.api:CreateBackdrop(frame.input, nil, true) CreateBackdrop(frame.input, nil, true)
frame.input:SetWidth(14) frame.input:SetWidth(14)
frame.input:SetHeight(14) frame.input:SetHeight(14)
frame.input:SetPoint("TOPRIGHT" , 0, -4) frame.input:SetPoint("TOPRIGHT" , 0, -4)
@@ -623,7 +623,7 @@ pfUI:RegisterModule("gui", function ()
for i,v in ipairs({frame.input:GetRegions()}) do for i,v in ipairs({frame.input:GetRegions()}) do
if v.SetTexture then v:Hide() end if v.SetTexture then v:Hide() end
if v.SetTextColor then v:SetTextColor(.2,1,.8) end if v.SetTextColor then v:SetTextColor(.2,1,.8) end
if v.SetBackdrop then pfUI.api:CreateBackdrop(v) end if v.SetBackdrop then CreateBackdrop(v) end
end end
end end
@@ -635,7 +635,7 @@ pfUI:RegisterModule("gui", function ()
pfUI.gui.deco:ClearAllPoints() pfUI.gui.deco:ClearAllPoints()
pfUI.gui.deco:SetPoint("TOPLEFT", pfUI.gui, "TOPLEFT", 4*default_border + 100,-2*default_border) pfUI.gui.deco:SetPoint("TOPLEFT", pfUI.gui, "TOPLEFT", 4*default_border + 100,-2*default_border)
pfUI.gui.deco:SetPoint("BOTTOMRIGHT", pfUI.gui, "BOTTOMRIGHT", -2*default_border,2*default_border) pfUI.gui.deco:SetPoint("BOTTOMRIGHT", pfUI.gui, "BOTTOMRIGHT", -2*default_border,2*default_border)
pfUI.api:CreateBackdrop(pfUI.gui.deco, nil, nil, .8) CreateBackdrop(pfUI.gui.deco, nil, nil, .8)
pfUI.gui.deco.up = CreateFrame("Frame", nil, pfUI.gui.deco) pfUI.gui.deco.up = CreateFrame("Frame", nil, pfUI.gui.deco)
pfUI.gui.deco.up:SetPoint("TOPLEFT", pfUI.gui.deco, "TOPLEFT", 0,0) pfUI.gui.deco.up:SetPoint("TOPLEFT", pfUI.gui.deco, "TOPLEFT", 0,0)
@@ -758,9 +758,9 @@ pfUI:RegisterModule("gui", function ()
-- load profile -- load profile
pfUI.gui:CreateConfig(pfUI.gui.global, "Load profile", C.global, "profile", "button", function() pfUI.gui:CreateConfig(pfUI.gui.global, "Load profile", C.global, "profile", "button", function()
if C.global.profile and pfUI_profiles[C.global.profile] then if C.global.profile and pfUI_profiles[C.global.profile] then
pfUI.api:CreateQuestionDialog("Load profile '|cff33ffcc" .. C.global.profile .. "|r'?", function() CreateQuestionDialog("Load profile '|cff33ffcc" .. C.global.profile .. "|r'?", function()
local selp = C.global.profile local selp = C.global.profile
C = pfUI.api.CopyTable(pfUI_profiles[C.global.profile]) C = CopyTable(pfUI_profiles[C.global.profile])
C.global.profile = selp C.global.profile = selp
ReloadUI() ReloadUI()
end) end)
@@ -770,7 +770,7 @@ pfUI:RegisterModule("gui", function ()
-- delete profile -- delete profile
pfUI.gui:CreateConfig(pfUI.gui.global, "Delete profile", C.global, "profile", "button", function() pfUI.gui:CreateConfig(pfUI.gui.global, "Delete profile", C.global, "profile", "button", function()
if C.global.profile and pfUI_profiles[C.global.profile] then if C.global.profile and pfUI_profiles[C.global.profile] then
pfUI.api:CreateQuestionDialog("Delete profile '|cff33ffcc" .. C.global.profile .. "|r'?", function() CreateQuestionDialog("Delete profile '|cff33ffcc" .. C.global.profile .. "|r'?", function()
pfUI_profiles[C.global.profile] = nil pfUI_profiles[C.global.profile] = nil
pfUpdateProfiles() pfUpdateProfiles()
this:GetParent():Hide() this:GetParent():Hide()
@@ -781,9 +781,9 @@ pfUI:RegisterModule("gui", function ()
-- save profile -- save profile
pfUI.gui:CreateConfig(pfUI.gui.global, "Save profile", C.global, "profile", "button", function() pfUI.gui:CreateConfig(pfUI.gui.global, "Save profile", C.global, "profile", "button", function()
if C.global.profile and pfUI_profiles[C.global.profile] then if C.global.profile and pfUI_profiles[C.global.profile] then
pfUI.api:CreateQuestionDialog("Save current settings to profile '|cff33ffcc" .. C.global.profile .. "|r'?", function() CreateQuestionDialog("Save current settings to profile '|cff33ffcc" .. C.global.profile .. "|r'?", function()
if pfUI_profiles[C.global.profile] then if pfUI_profiles[C.global.profile] then
pfUI_profiles[C.global.profile] = pfUI.api.CopyTable(C) pfUI_profiles[C.global.profile] = CopyTable(C)
end end
this:GetParent():Hide() this:GetParent():Hide()
end) end)
@@ -792,7 +792,7 @@ pfUI:RegisterModule("gui", function ()
-- create profile -- create profile
pfUI.gui:CreateConfig(pfUI.gui.global, "Create Profile", C.global, "profile", "button", function() pfUI.gui:CreateConfig(pfUI.gui.global, "Create Profile", C.global, "profile", "button", function()
pfUI.api:CreateQuestionDialog("Please enter a name for the new profile.\nExisting profiles sharing the same name will be overwritten.", CreateQuestionDialog("Please enter a name for the new profile.\nExisting profiles sharing the same name will be overwritten.",
function() function()
local profile = this:GetParent().input:GetText() local profile = this:GetParent().input:GetText()
local bad = string.gsub(profile,"([%w%s]+)","") local bad = string.gsub(profile,"([%w%s]+)","")
@@ -801,7 +801,7 @@ pfUI:RegisterModule("gui", function ()
else else
profile = (string.gsub(profile,"^%s*(.-)%s*$", "%1")) profile = (string.gsub(profile,"^%s*(.-)%s*$", "%1"))
if profile and profile ~= "" then if profile and profile ~= "" then
pfUI_profiles[profile] = pfUI.api.CopyTable(C) pfUI_profiles[profile] = CopyTable(C)
pfUpdateProfiles() pfUpdateProfiles()
this:GetParent():Hide() this:GetParent():Hide()
end end
@@ -928,15 +928,15 @@ pfUI:RegisterModule("gui", function ()
pfUI.gui:CreateConfig(pfUI.gui.bar, "Enable Autohide For BarPet", C.bars, "hide_pet", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.bar, "Enable Autohide For BarPet", C.bars, "hide_pet", "checkbox")
pfUI.gui:CreateConfig(pfUI.gui.bar, "Action Bar Layouts", nil, nil, "header") pfUI.gui:CreateConfig(pfUI.gui.bar, "Action Bar Layouts", nil, nil, "header")
local values = pfUI.api:BarLayoutOptions(NUM_ACTIONBAR_BUTTONS) local values = BarLayoutOptions(NUM_ACTIONBAR_BUTTONS)
pfUI.gui:CreateConfig(pfUI.gui.bar, "Main Actionbar (ActionMain)", C.bars.actionmain, "formfactor", "dropdown", values) pfUI.gui:CreateConfig(pfUI.gui.bar, "Main Actionbar (ActionMain)", C.bars.actionmain, "formfactor", "dropdown", values)
pfUI.gui:CreateConfig(pfUI.gui.bar, "Second Actionbar (BottomLeft)", C.bars.bottomleft, "formfactor", "dropdown", values) pfUI.gui:CreateConfig(pfUI.gui.bar, "Second Actionbar (BottomLeft)", C.bars.bottomleft, "formfactor", "dropdown", values)
pfUI.gui:CreateConfig(pfUI.gui.bar, "Left Actionbar (BottomRight)", C.bars.bottomright, "formfactor", "dropdown", values) pfUI.gui:CreateConfig(pfUI.gui.bar, "Left Actionbar (BottomRight)", C.bars.bottomright, "formfactor", "dropdown", values)
pfUI.gui:CreateConfig(pfUI.gui.bar, "Right Actionbar (Right)", C.bars.right, "formfactor", "dropdown", values) pfUI.gui:CreateConfig(pfUI.gui.bar, "Right Actionbar (Right)", C.bars.right, "formfactor", "dropdown", values)
pfUI.gui:CreateConfig(pfUI.gui.bar, "Vertical Actionbar (TwoRight)", C.bars.tworight, "formfactor", "dropdown", values) pfUI.gui:CreateConfig(pfUI.gui.bar, "Vertical Actionbar (TwoRight)", C.bars.tworight, "formfactor", "dropdown", values)
local values = pfUI.api:BarLayoutOptions(NUM_SHAPESHIFT_SLOTS) local values = BarLayoutOptions(NUM_SHAPESHIFT_SLOTS)
pfUI.gui:CreateConfig(pfUI.gui.bar, "Shapeshift Bar (BarShapeShift)", C.bars.shapeshift, "formfactor", "dropdown", values) pfUI.gui:CreateConfig(pfUI.gui.bar, "Shapeshift Bar (BarShapeShift)", C.bars.shapeshift, "formfactor", "dropdown", values)
local values = pfUI.api:BarLayoutOptions(NUM_PET_ACTION_SLOTS) local values = BarLayoutOptions(NUM_PET_ACTION_SLOTS)
pfUI.gui:CreateConfig(pfUI.gui.bar, "Pet Bar (BarPet)", C.bars.pet, "formfactor", "dropdown", values) pfUI.gui:CreateConfig(pfUI.gui.bar, "Pet Bar (BarPet)", C.bars.pet, "formfactor", "dropdown", values)
-- panels -- panels
@@ -1049,7 +1049,7 @@ pfUI:RegisterModule("gui", function ()
-- Reset Cache -- Reset Cache
pfUI.gui.resetCache = pfUI.gui:CreateConfigTab("Reset Cache", "bottom", function() pfUI.gui.resetCache = pfUI.gui:CreateConfigTab("Reset Cache", "bottom", function()
pfUI.api:CreateQuestionDialog("Do you really want to reset the Cache?", CreateQuestionDialog("Do you really want to reset the Cache?",
function() function()
_G["pfUI_playerDB"] = {} _G["pfUI_playerDB"] = {}
this:GetParent():Hide() this:GetParent():Hide()
@@ -1059,7 +1059,7 @@ pfUI:RegisterModule("gui", function ()
-- Reset Frames -- Reset Frames
pfUI.gui.resetFrames = pfUI.gui:CreateConfigTab("Reset Positions", "bottom", function() pfUI.gui.resetFrames = pfUI.gui:CreateConfigTab("Reset Positions", "bottom", function()
pfUI.api:CreateQuestionDialog("Do you really want to reset the Frame Positions?", CreateQuestionDialog("Do you really want to reset the Frame Positions?",
function() function()
_G["C"]["position"] = {} _G["C"]["position"] = {}
this:GetParent():Hide() this:GetParent():Hide()
@@ -1069,7 +1069,7 @@ pfUI:RegisterModule("gui", function ()
-- Reset Chat -- Reset Chat
pfUI.gui.resetChat = pfUI.gui:CreateConfigTab("Reset Firstrun", "bottom", function() pfUI.gui.resetChat = pfUI.gui:CreateConfigTab("Reset Firstrun", "bottom", function()
pfUI.api:CreateQuestionDialog("Do you really want to reset the Firstrun Wizard Settings?", CreateQuestionDialog("Do you really want to reset the Firstrun Wizard Settings?",
function() function()
_G["pfUI_init"] = {} _G["pfUI_init"] = {}
this:GetParent():Hide() this:GetParent():Hide()
@@ -1079,7 +1079,7 @@ pfUI:RegisterModule("gui", function ()
-- Reset Config -- Reset Config
pfUI.gui.resetConfig = pfUI.gui:CreateConfigTab("Reset Config", "bottom", function() pfUI.gui.resetConfig = pfUI.gui:CreateConfigTab("Reset Config", "bottom", function()
pfUI.api:CreateQuestionDialog("Do you really want to reset your configuration?\nThis also includes frame positions", CreateQuestionDialog("Do you really want to reset your configuration?\nThis also includes frame positions",
function() function()
_G["C"] = {} _G["C"] = {}
pfUI:LoadConfig() pfUI:LoadConfig()
@@ -1090,7 +1090,7 @@ pfUI:RegisterModule("gui", function ()
-- Reset All -- Reset All
pfUI.gui.resetAll = pfUI.gui:CreateConfigTab("Reset All", "bottom", function() pfUI.gui.resetAll = pfUI.gui:CreateConfigTab("Reset All", "bottom", function()
pfUI.api:CreateQuestionDialog("Do you really want to reset |cffffaaaaEVERYTHING|r?\nThis includes configuration, frame positions, firstrun settings,\n player cache, profiles and just EVERYTHING!", CreateQuestionDialog("Do you really want to reset |cffffaaaaEVERYTHING|r?\nThis includes configuration, frame positions, firstrun settings,\n player cache, profiles and just EVERYTHING!",
function() function()
_G["pfUI_init"] = {} _G["pfUI_init"] = {}
_G["C"] = {} _G["C"] = {}
+3 -3
View File
@@ -73,9 +73,9 @@ pfUI:RegisterModule("loot", function ()
local color = ITEM_QUALITY_COLORS[maxrarity] local color = ITEM_QUALITY_COLORS[maxrarity]
if maxrarity <= 1 then if maxrarity <= 1 then
pfUI.api:CreateBackdrop(pfUI.loot) CreateBackdrop(pfUI.loot)
else else
pfUI.api:CreateBackdrop(pfUI.loot) CreateBackdrop(pfUI.loot)
pfUI.loot.backdrop:SetBackdropBorderColor(color.r, color.g, color.b, 1) pfUI.loot.backdrop:SetBackdropBorderColor(color.r, color.g, color.b, 1)
end end
pfUI.loot:SetHeight(math.max((real*22)+4*C.appearance.border.default), 20) pfUI.loot:SetHeight(math.max((real*22)+4*C.appearance.border.default), 20)
@@ -137,7 +137,7 @@ pfUI:RegisterModule("loot", function ()
frame.ficon:SetWidth(frame:GetHeight() - 2*C.appearance.border.default) frame.ficon:SetWidth(frame:GetHeight() - 2*C.appearance.border.default)
frame.ficon:ClearAllPoints() frame.ficon:ClearAllPoints()
frame.ficon:SetPoint("RIGHT", frame) frame.ficon:SetPoint("RIGHT", frame)
pfUI.api:CreateBackdrop(frame.ficon) CreateBackdrop(frame.ficon)
frame.icon = frame.ficon:CreateTexture(nil, "ARTWORK") frame.icon = frame.ficon:CreateTexture(nil, "ARTWORK")
frame.icon:SetTexCoord(.07, .93, .07, .93) frame.icon:SetTexCoord(.07, .93, .07, .93)
+1 -1
View File
@@ -45,7 +45,7 @@ pfUI:RegisterModule("map", function ()
WorldMapFrame:SetHeight(WorldMapButton:GetHeight() + 55) WorldMapFrame:SetHeight(WorldMapButton:GetHeight() + 55)
WorldMapFrameCloseButton:SetPoint("TOPRIGHT", WorldMapFrame, "TOPRIGHT", 0, 0) WorldMapFrameCloseButton:SetPoint("TOPRIGHT", WorldMapFrame, "TOPRIGHT", 0, 0)
pfUI.api:CreateBackdrop(WorldMapFrame) CreateBackdrop(WorldMapFrame)
WorldMapFrame:SetScale(.7) WorldMapFrame:SetScale(.7)
BlackoutWorld:Hide() BlackoutWorld:Hide()
+2 -2
View File
@@ -15,9 +15,9 @@ pfUI:RegisterModule("minimap", function ()
end) end)
pfUI.minimap = CreateFrame("Frame","pfMinimap",UIParent) pfUI.minimap = CreateFrame("Frame","pfMinimap",UIParent)
pfUI.api:CreateBackdrop(pfUI.minimap) CreateBackdrop(pfUI.minimap)
pfUI.minimap:SetPoint("TOPRIGHT", UIParent, -5, -5) pfUI.minimap:SetPoint("TOPRIGHT", UIParent, -5, -5)
pfUI.api:UpdateMovable(pfUI.minimap) UpdateMovable(pfUI.minimap)
pfUI.minimap:SetWidth(140) pfUI.minimap:SetWidth(140)
pfUI.minimap:SetHeight(140) pfUI.minimap:SetHeight(140)
pfUI.minimap:SetFrameStrata("BACKGROUND") pfUI.minimap:SetFrameStrata("BACKGROUND")
+1 -1
View File
@@ -313,7 +313,7 @@ pfUI:RegisterModule("nameplates", function ()
else else
healthbar.castbar:SetMinMaxValues(0, pfUI.castbar.target.casterDB[name:GetText()]["casttime"]) healthbar.castbar:SetMinMaxValues(0, pfUI.castbar.target.casterDB[name:GetText()]["casttime"])
healthbar.castbar:SetValue(GetTime() - pfUI.castbar.target.casterDB[name:GetText()]["starttime"]) healthbar.castbar:SetValue(GetTime() - pfUI.castbar.target.casterDB[name:GetText()]["starttime"])
healthbar.castbar.text:SetText(pfUI.api.round( pfUI.castbar.target.casterDB[name:GetText()]["starttime"] + pfUI.castbar.target.casterDB[name:GetText()]["casttime"] - GetTime(),1)) healthbar.castbar.text:SetText(round( pfUI.castbar.target.casterDB[name:GetText()]["starttime"] + pfUI.castbar.target.casterDB[name:GetText()]["casttime"] - GetTime(),1))
if C.nameplates.spellname == "1" and healthbar.castbar.spell then if C.nameplates.spellname == "1" and healthbar.castbar.spell then
healthbar.castbar.spell:SetText(pfUI.castbar.target.casterDB[name:GetText()]["cast"]) healthbar.castbar.spell:SetText(pfUI.castbar.target.casterDB[name:GetText()]["cast"])
else else
+16 -16
View File
@@ -54,7 +54,7 @@ pfUI:RegisterModule("panel", function ()
pfUI.panel.clock.timerFrame:SetWidth(120) pfUI.panel.clock.timerFrame:SetWidth(120)
pfUI.panel.clock.timerFrame:SetHeight(35) pfUI.panel.clock.timerFrame:SetHeight(35)
pfUI.panel.clock.timerFrame:SetPoint("TOP", 0, -100) pfUI.panel.clock.timerFrame:SetPoint("TOP", 0, -100)
pfUI.api:UpdateMovable(pfUI.panel.clock.timerFrame) UpdateMovable(pfUI.panel.clock.timerFrame)
pfUI.panel.clock.timerFrame.text = pfUI.panel.clock.timerFrame:CreateFontString("Status", "LOW", "GameFontNormal") pfUI.panel.clock.timerFrame.text = pfUI.panel.clock.timerFrame:CreateFontString("Status", "LOW", "GameFontNormal")
pfUI.panel.clock.timerFrame.text:SetFontObject(GameFontWhite) pfUI.panel.clock.timerFrame.text:SetFontObject(GameFontWhite)
@@ -136,13 +136,13 @@ pfUI:RegisterModule("panel", function ()
GameTooltip:AddDoubleLine("Active Addons", "|cffffffff" .. active .. "|cff555555 / |cffffffff" .. GetNumAddOns()) GameTooltip:AddDoubleLine("Active Addons", "|cffffffff" .. active .. "|cff555555 / |cffffffff" .. GetNumAddOns())
GameTooltip:AddLine(" ") GameTooltip:AddLine(" ")
local nin, nout, nping = GetNetStats() local nin, nout, nping = GetNetStats()
GameTooltip:AddDoubleLine("Network Down", "|cffffffff" .. pfUI.api.round(nin,1) .. "KB/s") GameTooltip:AddDoubleLine("Network Down", "|cffffffff" .. round(nin,1) .. "KB/s")
GameTooltip:AddDoubleLine("Network Up", "|cffffffff" .. pfUI.api.round(nout,1) .. "KB/s") GameTooltip:AddDoubleLine("Network Up", "|cffffffff" .. round(nout,1) .. "KB/s")
GameTooltip:AddDoubleLine("Network Latency", "|cffffffff" .. nping .. "ms") GameTooltip:AddDoubleLine("Network Latency", "|cffffffff" .. nping .. "ms")
GameTooltip:AddLine(" ") GameTooltip:AddLine(" ")
GameTooltip:AddDoubleLine("Graphic Renderer", "|cffffffff" .. GetCVar("gxApi")) GameTooltip:AddDoubleLine("Graphic Renderer", "|cffffffff" .. GetCVar("gxApi"))
GameTooltip:AddDoubleLine("Screen Resolution", "|cffffffff" .. GetCVar("gxResolution")) GameTooltip:AddDoubleLine("Screen Resolution", "|cffffffff" .. GetCVar("gxResolution"))
GameTooltip:AddDoubleLine("UI-Scale", "|cffffffff" .. pfUI.api.round(UIParent:GetEffectiveScale(),2)) GameTooltip:AddDoubleLine("UI-Scale", "|cffffffff" .. round(UIParent:GetEffectiveScale(),2))
GameTooltip:Show() GameTooltip:Show()
end end
@@ -238,10 +238,10 @@ pfUI:RegisterModule("panel", function ()
GameTooltip:ClearLines() GameTooltip:ClearLines()
GameTooltip:AddLine("|cff555555Money") GameTooltip:AddLine("|cff555555Money")
GameTooltip:AddDoubleLine("Login:", pfUI.api.CreateGoldString(pfUI.panel.initMoney)) GameTooltip:AddDoubleLine("Login:", CreateGoldString(pfUI.panel.initMoney))
GameTooltip:AddDoubleLine("Now:", pfUI.api.CreateGoldString(GetMoney())) GameTooltip:AddDoubleLine("Now:", CreateGoldString(GetMoney()))
GameTooltip:AddDoubleLine("|cffffffff","") GameTooltip:AddDoubleLine("|cffffffff","")
GameTooltip:AddDoubleLine("This Session:", dmod .. pfUI.api.CreateGoldString(math.abs(pfUI.panel.diffMoney))) GameTooltip:AddDoubleLine("This Session:", dmod .. CreateGoldString(math.abs(pfUI.panel.diffMoney)))
GameTooltip:Show() GameTooltip:Show()
end end
@@ -351,7 +351,7 @@ pfUI:RegisterModule("panel", function ()
GameTooltip_SetDefaultAnchor(GameTooltip, this) GameTooltip_SetDefaultAnchor(GameTooltip, this)
GameTooltip:AddLine("|cffffffff" .. real) GameTooltip:AddLine("|cffffffff" .. real)
GameTooltip:AddLine(sub) GameTooltip:AddLine(sub)
GameTooltip:AddLine("|cffaaaaaa" .. pfUI.api.round(posX*100,1) .. " / " .. pfUI.api.round(posY*100,1)) GameTooltip:AddLine("|cffaaaaaa" .. round(posX*100,1) .. " / " .. round(posY*100,1))
GameTooltip:Show() GameTooltip:Show()
end end
@@ -416,14 +416,14 @@ pfUI:RegisterModule("panel", function ()
end end
pfUI.panel.left:SetHeight(C.global.font_size+default_border*2) pfUI.panel.left:SetHeight(C.global.font_size+default_border*2)
pfUI.api:CreateBackdrop(pfUI.panel.left, default_border, nil) CreateBackdrop(pfUI.panel.left, default_border, nil)
pfUI.panel.left.hide = CreateFrame("Button", nil, pfUI.panel.left) pfUI.panel.left.hide = CreateFrame("Button", nil, pfUI.panel.left)
pfUI.panel.left.hide:ClearAllPoints() pfUI.panel.left.hide:ClearAllPoints()
pfUI.panel.left.hide:SetWidth(12) pfUI.panel.left.hide:SetWidth(12)
pfUI.panel.left.hide:SetHeight(pfUI.panel.left:GetHeight()) pfUI.panel.left.hide:SetHeight(pfUI.panel.left:GetHeight())
pfUI.panel.left.hide:SetPoint("LEFT", 0, 0) pfUI.panel.left.hide:SetPoint("LEFT", 0, 0)
pfUI.api:CreateBackdrop(pfUI.panel.left.hide, default_border) CreateBackdrop(pfUI.panel.left.hide, default_border)
pfUI.panel.left.hide.texture = pfUI.panel.left.hide:CreateTexture("pfPanelLeftHide") pfUI.panel.left.hide.texture = pfUI.panel.left.hide:CreateTexture("pfPanelLeftHide")
pfUI.panel.left.hide.texture:SetTexture("Interface\\AddOns\\pfUI\\img\\left") pfUI.panel.left.hide.texture:SetTexture("Interface\\AddOns\\pfUI\\img\\left")
pfUI.panel.left.hide.texture:ClearAllPoints() pfUI.panel.left.hide.texture:ClearAllPoints()
@@ -482,14 +482,14 @@ pfUI:RegisterModule("panel", function ()
pfUI.panel.right:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -5, 5) pfUI.panel.right:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -5, 5)
end end
pfUI.panel.right:SetHeight(C.global.font_size+default_border*2) pfUI.panel.right:SetHeight(C.global.font_size+default_border*2)
pfUI.api:CreateBackdrop(pfUI.panel.right, default_border, nil) CreateBackdrop(pfUI.panel.right, default_border, nil)
pfUI.panel.right.hide = CreateFrame("Button", nil, pfUI.panel.right) pfUI.panel.right.hide = CreateFrame("Button", nil, pfUI.panel.right)
pfUI.panel.right.hide:ClearAllPoints() pfUI.panel.right.hide:ClearAllPoints()
pfUI.panel.right.hide:SetWidth(12) pfUI.panel.right.hide:SetWidth(12)
pfUI.panel.right.hide:SetHeight(pfUI.panel.right:GetHeight()) pfUI.panel.right.hide:SetHeight(pfUI.panel.right:GetHeight())
pfUI.panel.right.hide:SetPoint("RIGHT", 0, 0) pfUI.panel.right.hide:SetPoint("RIGHT", 0, 0)
pfUI.api:CreateBackdrop(pfUI.panel.right.hide, default_border) CreateBackdrop(pfUI.panel.right.hide, default_border)
pfUI.panel.right.hide.texture = pfUI.panel.right.hide:CreateTexture("pfPanelRightHide") pfUI.panel.right.hide.texture = pfUI.panel.right.hide:CreateTexture("pfPanelRightHide")
pfUI.panel.right.hide.texture:SetTexture("Interface\\AddOns\\pfUI\\img\\right") pfUI.panel.right.hide.texture:SetTexture("Interface\\AddOns\\pfUI\\img\\right")
pfUI.panel.right.hide.texture:ClearAllPoints() pfUI.panel.right.hide.texture:ClearAllPoints()
@@ -537,8 +537,8 @@ pfUI:RegisterModule("panel", function ()
pfUI.panel.right.right.text:SetFontObject(GameFontWhite) pfUI.panel.right.right.text:SetFontObject(GameFontWhite)
pfUI.panel.minimap = CreateFrame("Button", "pfPanelMinimap", UIParent) pfUI.panel.minimap = CreateFrame("Button", "pfPanelMinimap", UIParent)
pfUI.api:CreateBackdrop(pfUI.panel.minimap, default_border) CreateBackdrop(pfUI.panel.minimap, default_border)
pfUI.api:UpdateMovable(pfUI.panel.minimap) UpdateMovable(pfUI.panel.minimap)
pfUI.panel.minimap:SetHeight(C.global.font_size+default_border*2) pfUI.panel.minimap:SetHeight(C.global.font_size+default_border*2)
if pfUI.minimap then if pfUI.minimap then
pfUI.panel.minimap:SetPoint("TOP", pfUI.minimap, "BOTTOM", 0 , -default_border*3) pfUI.panel.minimap:SetPoint("TOP", pfUI.minimap, "BOTTOM", 0 , -default_border*3)
@@ -557,7 +557,7 @@ pfUI:RegisterModule("panel", function ()
if C.panel.micro.enable == "1" then if C.panel.micro.enable == "1" then
pfUI.panel.microbutton = CreateFrame("Frame", "pfPanelMicroButton", UIParent) pfUI.panel.microbutton = CreateFrame("Frame", "pfPanelMicroButton", UIParent)
pfUI.panel.microbutton:SetPoint("TOP", pfUI.panel.minimap, "BOTTOM", 0, -2*default_border) pfUI.panel.microbutton:SetPoint("TOP", pfUI.panel.minimap, "BOTTOM", 0, -2*default_border)
pfUI.api:UpdateMovable(pfUI.panel.microbutton) UpdateMovable(pfUI.panel.microbutton)
pfUI.panel.microbutton:SetHeight(23) pfUI.panel.microbutton:SetHeight(23)
pfUI.panel.microbutton:SetWidth(145) pfUI.panel.microbutton:SetWidth(145)
pfUI.panel.microbutton:SetFrameStrata("BACKGROUND") pfUI.panel.microbutton:SetFrameStrata("BACKGROUND")
@@ -584,7 +584,7 @@ pfUI:RegisterModule("panel", function ()
button.frame:SetScale(1.4) button.frame:SetScale(1.4)
button.frame:SetPoint("TOPLEFT", button, "TOPLEFT", 1, -16) button.frame:SetPoint("TOPLEFT", button, "TOPLEFT", 1, -16)
button.frame:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -1, 1) button.frame:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -1, 1)
pfUI.api:CreateBackdrop(button.frame, default_border) CreateBackdrop(button.frame, default_border)
button:Show() button:Show()
end end
end end
+6 -6
View File
@@ -17,7 +17,7 @@ pfUI:RegisterModule("pet", function ()
pfUI.uf.pet:SetHeight(20 + 2*default_border + spacing) pfUI.uf.pet:SetHeight(20 + 2*default_border + spacing)
pfUI.uf.pet:ClearAllPoints() pfUI.uf.pet:ClearAllPoints()
pfUI.uf.pet:SetPoint("BOTTOM", UIParent , "BOTTOM", 0, 163) pfUI.uf.pet:SetPoint("BOTTOM", UIParent , "BOTTOM", 0, 163)
pfUI.api:UpdateMovable(pfUI.uf.pet) UpdateMovable(pfUI.uf.pet)
pfUI.uf.pet:RegisterForClicks('LeftButtonUp', 'RightButtonUp', 'MiddleButtonUp', 'Button4Up', 'Button5Up') pfUI.uf.pet:RegisterForClicks('LeftButtonUp', 'RightButtonUp', 'MiddleButtonUp', 'Button4Up', 'Button5Up')
pfUI.uf.pet:SetScript("OnEnter", function() pfUI.uf.pet:SetScript("OnEnter", function()
@@ -93,7 +93,7 @@ pfUI:RegisterModule("pet", function ()
end end
if C.unitframes.custom == "1" then if C.unitframes.custom == "1" then
local cr, cg, cb, ca = pfUI.api.strsplit(",", C.unitframes.customcolor) local cr, cg, cb, ca = strsplit(",", C.unitframes.customcolor)
pfUI.uf.pet.hp.bar:SetStatusBarColor(tonumber(cr), tonumber(cg), tonumber(cb), hp / hpmax / 4 + .75) pfUI.uf.pet.hp.bar:SetStatusBarColor(tonumber(cr), tonumber(cg), tonumber(cb), hp / hpmax / 4 + .75)
else else
pfUI.uf.pet.hp.bar:SetStatusBarColor(r, g, b, hp / hpmax / 4 + .75) pfUI.uf.pet.hp.bar:SetStatusBarColor(r, g, b, hp / hpmax / 4 + .75)
@@ -143,7 +143,7 @@ pfUI:RegisterModule("pet", function ()
pfUI.uf.pet.hp:SetWidth(100) pfUI.uf.pet.hp:SetWidth(100)
pfUI.uf.pet.hp:SetHeight(16) pfUI.uf.pet.hp:SetHeight(16)
pfUI.uf.pet.hp:SetPoint("TOP", 0, 0) pfUI.uf.pet.hp:SetPoint("TOP", 0, 0)
pfUI.api:CreateBackdrop(pfUI.uf.pet.hp, default_border) CreateBackdrop(pfUI.uf.pet.hp, default_border)
pfUI.uf.pet.hp.bar = CreateFrame("StatusBar", nil, pfUI.uf.pet.hp) pfUI.uf.pet.hp.bar = CreateFrame("StatusBar", nil, pfUI.uf.pet.hp)
pfUI.uf.pet.hp.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar") pfUI.uf.pet.hp.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
@@ -165,7 +165,7 @@ pfUI:RegisterModule("pet", function ()
pfUI.uf.pet.power:SetPoint("BOTTOM", 0, 0) pfUI.uf.pet.power:SetPoint("BOTTOM", 0, 0)
pfUI.uf.pet.power:SetWidth(100) pfUI.uf.pet.power:SetWidth(100)
pfUI.uf.pet.power:SetHeight(4) pfUI.uf.pet.power:SetHeight(4)
pfUI.api:CreateBackdrop(pfUI.uf.pet.power, default_border) CreateBackdrop(pfUI.uf.pet.power, default_border)
pfUI.uf.pet.power.bar = CreateFrame("StatusBar", nil, pfUI.uf.pet.power) pfUI.uf.pet.power.bar = CreateFrame("StatusBar", nil, pfUI.uf.pet.power)
pfUI.uf.pet.power.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar") pfUI.uf.pet.power.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
@@ -230,7 +230,7 @@ pfUI:RegisterModule("pet", function ()
local buffsize = pfUI.uf.pet.hp:GetWidth()/8 - 1 local buffsize = pfUI.uf.pet.hp:GetWidth()/8 - 1
for i=1, 16 do for i=1, 16 do
local texture, stacks = UnitBuff("pet",i) local texture, stacks = UnitBuff("pet",i)
pfUI.api:CreateBackdrop(pfUI.uf.pet.buff.buffs[i], default_border) CreateBackdrop(pfUI.uf.pet.buff.buffs[i], default_border)
pfUI.uf.pet.buff.buffs[i]:SetNormalTexture(texture) pfUI.uf.pet.buff.buffs[i]:SetNormalTexture(texture)
for i,v in ipairs({pfUI.uf.pet.buff.buffs[i]:GetRegions()}) do for i,v in ipairs({pfUI.uf.pet.buff.buffs[i]:GetRegions()}) do
if v.SetTexCoord then v:SetTexCoord(.08, .92, .08, .92) end if v.SetTexCoord then v:SetTexCoord(.08, .92, .08, .92) end
@@ -304,7 +304,7 @@ pfUI:RegisterModule("pet", function ()
(row)*((2*default_border) + buffsize + 1) + (2*default_border + 1)) (row)*((2*default_border) + buffsize + 1) + (2*default_border + 1))
local texture, stacks = UnitDebuff("pet",i) local texture, stacks = UnitDebuff("pet",i)
pfUI.api:CreateBackdrop(pfUI.uf.pet.debuff.debuffs[i], default_border) CreateBackdrop(pfUI.uf.pet.debuff.debuffs[i], default_border)
pfUI.uf.pet.debuff.debuffs[i]:SetNormalTexture(texture) pfUI.uf.pet.debuff.debuffs[i]:SetNormalTexture(texture)
for i,v in ipairs({pfUI.uf.pet.debuff.debuffs[i]:GetRegions()}) do for i,v in ipairs({pfUI.uf.pet.debuff.debuffs[i]:GetRegions()}) do
if v.SetTexCoord then v:SetTexCoord(.08, .92, .08, .92) end if v.SetTexCoord then v:SetTexCoord(.08, .92, .08, .92) end
+7 -7
View File
@@ -19,7 +19,7 @@ pfUI:RegisterModule("player", function ()
pfUI.uf.player:SetWidth(C.unitframes.player.width) pfUI.uf.player:SetWidth(C.unitframes.player.width)
pfUI.uf.player:SetHeight(C.unitframes.player.height + C.unitframes.player.pheight + 2*default_border + spacing) pfUI.uf.player:SetHeight(C.unitframes.player.height + C.unitframes.player.pheight + 2*default_border + spacing)
pfUI.uf.player:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOM", -75, 125) pfUI.uf.player:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOM", -75, 125)
pfUI.api:UpdateMovable(pfUI.uf.player) UpdateMovable(pfUI.uf.player)
pfUI.uf.player:RegisterForClicks('LeftButtonUp', 'RightButtonUp', 'MiddleButtonUp', 'Button4Up', 'Button5Up') pfUI.uf.player:RegisterForClicks('LeftButtonUp', 'RightButtonUp', 'MiddleButtonUp', 'Button4Up', 'Button5Up')
pfUI.uf.player:SetScript("OnEnter", function() pfUI.uf.player:SetScript("OnEnter", function()
GameTooltip_SetDefaultAnchor(GameTooltip, this) GameTooltip_SetDefaultAnchor(GameTooltip, this)
@@ -135,7 +135,7 @@ pfUI:RegisterModule("player", function ()
local cr, cg, cb local cr, cg, cb
if C.unitframes.custom == "1" then if C.unitframes.custom == "1" then
local r, g, b, a = pfUI.api.strsplit(",", C.unitframes.customcolor) local r, g, b, a = strsplit(",", C.unitframes.customcolor)
cr, cg, cb = tonumber(r), tonumber(g), tonumber(b) cr, cg, cb = tonumber(r), tonumber(g), tonumber(b)
elseif C.unitframes.pastel == "1" then elseif C.unitframes.pastel == "1" then
cr, cg, cb = (color.r + .5) * .5, (color.g + .5) * .5, (color.b + .5) * .5 cr, cg, cb = (color.r + .5) * .5, (color.g + .5) * .5, (color.b + .5) * .5
@@ -206,7 +206,7 @@ pfUI:RegisterModule("player", function ()
pfUI.uf.player.hp:SetPoint("TOP", 0, 0) pfUI.uf.player.hp:SetPoint("TOP", 0, 0)
pfUI.uf.player.hp:SetWidth(C.unitframes.player.width) pfUI.uf.player.hp:SetWidth(C.unitframes.player.width)
pfUI.uf.player.hp:SetHeight(C.unitframes.player.height) pfUI.uf.player.hp:SetHeight(C.unitframes.player.height)
pfUI.api:CreateBackdrop(pfUI.uf.player.hp, default_border) CreateBackdrop(pfUI.uf.player.hp, default_border)
pfUI.uf.player.hp.bar = CreateFrame("StatusBar", nil, pfUI.uf.player.hp) pfUI.uf.player.hp.bar = CreateFrame("StatusBar", nil, pfUI.uf.player.hp)
pfUI.uf.player.hp.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar") pfUI.uf.player.hp.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
@@ -244,7 +244,7 @@ pfUI:RegisterModule("player", function ()
pfUI.uf.player.power:SetPoint("BOTTOM", 0, 0) pfUI.uf.player.power:SetPoint("BOTTOM", 0, 0)
pfUI.uf.player.power:SetWidth(C.unitframes.player.width) pfUI.uf.player.power:SetWidth(C.unitframes.player.width)
pfUI.uf.player.power:SetHeight(C.unitframes.player.pheight) pfUI.uf.player.power:SetHeight(C.unitframes.player.pheight)
pfUI.api:CreateBackdrop(pfUI.uf.player.power, default_border) CreateBackdrop(pfUI.uf.player.power, default_border)
pfUI.uf.player.power.bar = CreateFrame("StatusBar", nil, pfUI.uf.player.power) pfUI.uf.player.power.bar = CreateFrame("StatusBar", nil, pfUI.uf.player.power)
pfUI.uf.player.power.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar") pfUI.uf.player.power.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
@@ -284,7 +284,7 @@ pfUI:RegisterModule("player", function ()
this.energy = UnitMana("player") this.energy = UnitMana("player")
local value = pfUI.api.round((GetTime() - this.lastTick) * 100) local value = round((GetTime() - this.lastTick) * 100)
local pos = C.unitframes.player.width / 200 * value local pos = C.unitframes.player.width / 200 * value
if not C.unitframes.player.pheight then return end if not C.unitframes.player.pheight then return end
this.spark:SetPoint("LEFT", pos-((C.unitframes.player.pheight+5)/2), 0) this.spark:SetPoint("LEFT", pos-((C.unitframes.player.pheight+5)/2), 0)
@@ -405,7 +405,7 @@ pfUI:RegisterModule("player", function ()
function pfUI.uf.player.buff.RefreshBuffs() function pfUI.uf.player.buff.RefreshBuffs()
for i=1, 16 do for i=1, 16 do
local stacks = GetPlayerBuffApplications(GetPlayerBuff(i-1,"HELPFUL")) local stacks = GetPlayerBuffApplications(GetPlayerBuff(i-1,"HELPFUL"))
pfUI.api:CreateBackdrop(pfUI.uf.player.buff.buffs[i], default_border) CreateBackdrop(pfUI.uf.player.buff.buffs[i], default_border)
pfUI.uf.player.buff.buffs[i]:SetNormalTexture(GetPlayerBuffTexture(GetPlayerBuff(i-1,"HELPFUL"))) pfUI.uf.player.buff.buffs[i]:SetNormalTexture(GetPlayerBuffTexture(GetPlayerBuff(i-1,"HELPFUL")))
for i,v in ipairs({pfUI.uf.player.buff.buffs[i]:GetRegions()}) do for i,v in ipairs({pfUI.uf.player.buff.buffs[i]:GetRegions()}) do
if v.SetTexCoord then v:SetTexCoord(.08, .92, .08, .92) end if v.SetTexCoord then v:SetTexCoord(.08, .92, .08, .92) end
@@ -529,7 +529,7 @@ pfUI:RegisterModule("player", function ()
local bid = GetPlayerBuff(i-1, "HARMFUL"); local bid = GetPlayerBuff(i-1, "HARMFUL");
local stacks = GetPlayerBuffApplications(bid) local stacks = GetPlayerBuffApplications(bid)
pfUI.api:CreateBackdrop(pfUI.uf.player.debuff.debuffs[i], default_border) CreateBackdrop(pfUI.uf.player.debuff.debuffs[i], default_border)
pfUI.uf.player.debuff.debuffs[i]:SetNormalTexture(GetPlayerBuffTexture(bid)) pfUI.uf.player.debuff.debuffs[i]:SetNormalTexture(GetPlayerBuffTexture(bid))
for i,v in ipairs({pfUI.uf.player.debuff.debuffs[i]:GetRegions()}) do for i,v in ipairs({pfUI.uf.player.debuff.debuffs[i]:GetRegions()}) do
if v.SetTexCoord then v:SetTexCoord(.08, .92, .08, .92) end if v.SetTexCoord then v:SetTexCoord(.08, .92, .08, .92) end
+3 -3
View File
@@ -44,7 +44,7 @@ pfUI:RegisterModule("raid", function ()
pfUI.uf.raid[i]:SetWidth(50) pfUI.uf.raid[i]:SetWidth(50)
pfUI.uf.raid[i]:SetHeight(30 + 2*default_border + C.unitframes.raid.pspace) pfUI.uf.raid[i]:SetHeight(30 + 2*default_border + C.unitframes.raid.pspace)
pfUI.uf.raid[i]:SetPoint("BOTTOMLEFT", (r-1) * (54+default_border) + 5, C.chat.left.height + 10 + ((g-1)*(37+default_border))+default_border) pfUI.uf.raid[i]:SetPoint("BOTTOMLEFT", (r-1) * (54+default_border) + 5, C.chat.left.height + 10 + ((g-1)*(37+default_border))+default_border)
pfUI.api:UpdateMovable(pfUI.uf.raid[i]) UpdateMovable(pfUI.uf.raid[i])
pfUI.uf.raid[i]:Hide() pfUI.uf.raid[i]:Hide()
pfUI.uf.raid[i].id = 0 pfUI.uf.raid[i].id = 0
@@ -52,7 +52,7 @@ pfUI:RegisterModule("raid", function ()
pfUI.uf.raid[i].hp:SetPoint("TOP", 0, 0) pfUI.uf.raid[i].hp:SetPoint("TOP", 0, 0)
pfUI.uf.raid[i].hp:SetWidth(50) pfUI.uf.raid[i].hp:SetWidth(50)
pfUI.uf.raid[i].hp:SetHeight(27) pfUI.uf.raid[i].hp:SetHeight(27)
pfUI.api:CreateBackdrop(pfUI.uf.raid[i].hp, default_border) CreateBackdrop(pfUI.uf.raid[i].hp, default_border)
pfUI.uf.raid[i].hp.bar = CreateFrame("StatusBar", nil, pfUI.uf.raid[i].hp) pfUI.uf.raid[i].hp.bar = CreateFrame("StatusBar", nil, pfUI.uf.raid[i].hp)
pfUI.uf.raid[i].hp.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar") pfUI.uf.raid[i].hp.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
@@ -63,7 +63,7 @@ pfUI:RegisterModule("raid", function ()
pfUI.uf.raid[i].power:SetPoint("BOTTOM", 0, 0) pfUI.uf.raid[i].power:SetPoint("BOTTOM", 0, 0)
pfUI.uf.raid[i].power:SetWidth(50) pfUI.uf.raid[i].power:SetWidth(50)
pfUI.uf.raid[i].power:SetHeight(3) pfUI.uf.raid[i].power:SetHeight(3)
pfUI.api:CreateBackdrop(pfUI.uf.raid[i].power, default_border) CreateBackdrop(pfUI.uf.raid[i].power, default_border)
pfUI.uf.raid[i].power.bar = CreateFrame("StatusBar", nil, pfUI.uf.raid[i].power) pfUI.uf.raid[i].power.bar = CreateFrame("StatusBar", nil, pfUI.uf.raid[i].power)
pfUI.uf.raid[i].power.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar") pfUI.uf.raid[i].power.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
+4 -4
View File
@@ -7,7 +7,7 @@ pfUI:RegisterModule("roll", function ()
local border = tonumber(C.appearance.border.default) local border = tonumber(C.appearance.border.default)
local esize = size - border*2 local esize = size - border*2
local f = CreateFrame("Frame", "pfLootRollFrame" .. id, UIParent) local f = CreateFrame("Frame", "pfLootRollFrame" .. id, UIParent)
pfUI.api:CreateBackdrop(f, nil, nil, .8) CreateBackdrop(f, nil, nil, .8)
f.backdrop:SetFrameStrata("BACKGROUND") f.backdrop:SetFrameStrata("BACKGROUND")
f.hasItem = 1 f.hasItem = 1
@@ -15,7 +15,7 @@ pfUI:RegisterModule("roll", function ()
f:SetHeight(size) f:SetHeight(size)
f.icon = CreateFrame("Button", "pfLootRollFrame" .. id .. "Icon", f) f.icon = CreateFrame("Button", "pfLootRollFrame" .. id .. "Icon", f)
pfUI.api:CreateBackdrop(f.icon, nil, true) CreateBackdrop(f.icon, nil, true)
f.icon:SetPoint("LEFT", border, 0) f.icon:SetPoint("LEFT", border, 0)
f.icon:SetWidth(esize) f.icon:SetWidth(esize)
f.icon:SetHeight(esize) f.icon:SetHeight(esize)
@@ -120,7 +120,7 @@ pfUI:RegisterModule("roll", function ()
f.time.bar:SetAllPoints(f.time) f.time.bar:SetAllPoints(f.time)
f.time.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar") f.time.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
f.time.bar:SetMinMaxValues(0, 100) f.time.bar:SetMinMaxValues(0, 100)
local r, g, b, a = pfUI.api.strsplit(",", C.appearance.border.color) local r, g, b, a = strsplit(",", C.appearance.border.color)
f.time.bar:SetStatusBarColor(r, g, b) f.time.bar:SetStatusBarColor(r, g, b)
f.time.bar:SetValue(20) f.time.bar:SetValue(20)
f.time.bar:SetScript("OnUpdate", function() f.time.bar:SetScript("OnUpdate", function()
@@ -179,7 +179,7 @@ pfUI:RegisterModule("roll", function ()
if not pfUI.roll.frames[i] then if not pfUI.roll.frames[i] then
pfUI.roll.frames[i] = pfUI.roll:CreateLootRoll(i) pfUI.roll.frames[i] = pfUI.roll:CreateLootRoll(i)
pfUI.roll.frames[i]:SetPoint("CENTER", 0, -i*35) pfUI.roll.frames[i]:SetPoint("CENTER", 0, -i*35)
pfUI.api:UpdateMovable(pfUI.roll.frames[i]) UpdateMovable(pfUI.roll.frames[i])
pfUI.roll.frames[i]:Hide() pfUI.roll.frames[i]:Hide()
end end
end end
+4 -4
View File
@@ -26,15 +26,15 @@ pfUI:RegisterModule("sellvalue", function ()
GameTooltip:AddLine(" ") GameTooltip:AddLine(" ")
if count > 1 then if count > 1 then
GameTooltip:AddDoubleLine("Sell:", pfUI.api.CreateGoldString(sell) .. "|cff555555 // " .. pfUI.api.CreateGoldString(sell*count), 1, 1, 1); GameTooltip:AddDoubleLine("Sell:", CreateGoldString(sell) .. "|cff555555 // " .. CreateGoldString(sell*count), 1, 1, 1);
else else
GameTooltip:AddDoubleLine("Sell:", pfUI.api.CreateGoldString(sell * count), 1, 1, 1); GameTooltip:AddDoubleLine("Sell:", CreateGoldString(sell * count), 1, 1, 1);
end end
if count > 1 then if count > 1 then
GameTooltip:AddDoubleLine("Buy:", pfUI.api.CreateGoldString(buy) .. "|cff555555 // " .. pfUI.api.CreateGoldString(buy*count), 1, 1, 1); GameTooltip:AddDoubleLine("Buy:", CreateGoldString(buy) .. "|cff555555 // " .. CreateGoldString(buy*count), 1, 1, 1);
else else
GameTooltip:AddDoubleLine("Buy:", pfUI.api.CreateGoldString(buy), 1, 1, 1); GameTooltip:AddDoubleLine("Buy:", CreateGoldString(buy), 1, 1, 1);
end end
end end
GameTooltip:Show() GameTooltip:Show()
+6 -6
View File
@@ -44,12 +44,12 @@ pfUI:RegisterModule("skin", function ()
GameMenuButtonContinue:SetPoint("BOTTOM", 0, 10) GameMenuButtonContinue:SetPoint("BOTTOM", 0, 10)
for _, button in pairs(buttons) do for _, button in pairs(buttons) do
pfUI.api:SkinButton(button, cr, cg, cb) SkinButton(button, cr, cg, cb)
end end
for _, box in pairs(boxes) do for _, box in pairs(boxes) do
local b = getglobal(box) local b = getglobal(box)
pfUI.api:CreateBackdrop(b, nil, true, .8) CreateBackdrop(b, nil, true, .8)
end end
for i,v in ipairs({GameMenuFrame:GetRegions()}) do for i,v in ipairs({GameMenuFrame:GetRegions()}) do
@@ -61,9 +61,9 @@ pfUI:RegisterModule("skin", function ()
end end
local alpha = tonumber(C.tooltip.alpha) local alpha = tonumber(C.tooltip.alpha)
pfUI.api:CreateBackdrop(ShoppingTooltip1, nil, nil, alpha) CreateBackdrop(ShoppingTooltip1, nil, nil, alpha)
pfUI.api:CreateBackdrop(ShoppingTooltip2, nil, nil, alpha) CreateBackdrop(ShoppingTooltip2, nil, nil, alpha)
pfUI.api:CreateBackdrop(ItemRefTooltip, nil, nil, alpha) CreateBackdrop(ItemRefTooltip, nil, nil, alpha)
ShoppingTooltip1:SetScript("OnShow", function() ShoppingTooltip1:SetScript("OnShow", function()
local a, b, c, d, e = this:GetPoint() local a, b, c, d, e = this:GetPoint()
@@ -79,7 +79,7 @@ pfUI:RegisterModule("skin", function ()
this:SetPoint(a, b, c, d, e) this:SetPoint(a, b, c, d, e)
end) end)
pfUI.api:CreateBackdrop(TicketStatusFrame) CreateBackdrop(TicketStatusFrame)
TicketStatusFrame:ClearAllPoints() TicketStatusFrame:ClearAllPoints()
TicketStatusFrame:SetPoint("TOP", 0, -5) TicketStatusFrame:SetPoint("TOP", 0, -5)
function TicketStatusFrame_OnEvent() function TicketStatusFrame_OnEvent()
+7 -7
View File
@@ -25,7 +25,7 @@ pfUI:RegisterModule("target", function ()
pfUI.uf.target:SetWidth(C.unitframes.target.width) pfUI.uf.target:SetWidth(C.unitframes.target.width)
pfUI.uf.target:SetHeight(C.unitframes.target.height + C.unitframes.target.pheight + 2*default_border + spacing) pfUI.uf.target:SetHeight(C.unitframes.target.height + C.unitframes.target.pheight + 2*default_border + spacing)
pfUI.uf.target:SetPoint("BOTTOMLEFT", UIParent, "BOTTOM", 75, 125) pfUI.uf.target:SetPoint("BOTTOMLEFT", UIParent, "BOTTOM", 75, 125)
pfUI.api:UpdateMovable(pfUI.uf.target) UpdateMovable(pfUI.uf.target)
pfUI.uf.target:RegisterForClicks('LeftButtonUp', 'RightButtonUp', 'MiddleButtonUp', 'Button4Up', 'Button5Up') pfUI.uf.target:RegisterForClicks('LeftButtonUp', 'RightButtonUp', 'MiddleButtonUp', 'Button4Up', 'Button5Up')
pfUI.uf.target:SetScript("OnEnter", function() pfUI.uf.target:SetScript("OnEnter", function()
GameTooltip_SetDefaultAnchor(GameTooltip, this) GameTooltip_SetDefaultAnchor(GameTooltip, this)
@@ -132,7 +132,7 @@ pfUI:RegisterModule("target", function ()
local r, g, b = .2, .2, .2 local r, g, b = .2, .2, .2
if C.unitframes.custom == "1" then if C.unitframes.custom == "1" then
local cr, cg, cb, ca = pfUI.api.strsplit(",", C.unitframes.customcolor) local cr, cg, cb, ca = strsplit(",", C.unitframes.customcolor)
cr, cg, cb = tonumber(cr), tonumber(cg), tonumber(cb) cr, cg, cb = tonumber(cr), tonumber(cg), tonumber(cb)
pfUI.uf.target.hp.bar:SetStatusBarColor(cr, cg, cb, hp / hpmax / 4 + .75) pfUI.uf.target.hp.bar:SetStatusBarColor(cr, cg, cb, hp / hpmax / 4 + .75)
if C.unitframes.pastel == "1" then if C.unitframes.pastel == "1" then
@@ -246,7 +246,7 @@ pfUI:RegisterModule("target", function ()
pfUI.uf.target.hp:SetWidth(C.unitframes.target.width) pfUI.uf.target.hp:SetWidth(C.unitframes.target.width)
pfUI.uf.target.hp:SetHeight(C.unitframes.target.height) pfUI.uf.target.hp:SetHeight(C.unitframes.target.height)
pfUI.uf.target.hp:SetPoint("TOP", 0, 0) pfUI.uf.target.hp:SetPoint("TOP", 0, 0)
pfUI.api:CreateBackdrop(pfUI.uf.target.hp, default_border) CreateBackdrop(pfUI.uf.target.hp, default_border)
pfUI.uf.target.hp.bar = CreateFrame("StatusBar", nil, pfUI.uf.target.hp) pfUI.uf.target.hp.bar = CreateFrame("StatusBar", nil, pfUI.uf.target.hp)
pfUI.uf.target.hp.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar") pfUI.uf.target.hp.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
@@ -284,7 +284,7 @@ pfUI:RegisterModule("target", function ()
pfUI.uf.target.power:SetPoint("BOTTOM", 0, 0) pfUI.uf.target.power:SetPoint("BOTTOM", 0, 0)
pfUI.uf.target.power:SetWidth(C.unitframes.target.width) pfUI.uf.target.power:SetWidth(C.unitframes.target.width)
pfUI.uf.target.power:SetHeight(C.unitframes.target.pheight) pfUI.uf.target.power:SetHeight(C.unitframes.target.pheight)
pfUI.api:CreateBackdrop(pfUI.uf.target.power, default_border) CreateBackdrop(pfUI.uf.target.power, default_border)
pfUI.uf.target.power.bar = CreateFrame("StatusBar", nil, pfUI.uf.target.power) pfUI.uf.target.power.bar = CreateFrame("StatusBar", nil, pfUI.uf.target.power)
pfUI.uf.target.power.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar") pfUI.uf.target.power.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
@@ -334,7 +334,7 @@ pfUI:RegisterModule("target", function ()
pfUI.uf.target["combopoint" .. point]:SetFrameStrata("HIGH") pfUI.uf.target["combopoint" .. point]:SetFrameStrata("HIGH")
pfUI.uf.target["combopoint" .. point]:SetWidth(5) pfUI.uf.target["combopoint" .. point]:SetWidth(5)
pfUI.uf.target["combopoint" .. point]:SetHeight(5) pfUI.uf.target["combopoint" .. point]:SetHeight(5)
pfUI.api:CreateBackdrop(pfUI.uf.target["combopoint" .. point]) CreateBackdrop(pfUI.uf.target["combopoint" .. point])
pfUI.uf.target["combopoint" .. point]:SetPoint("TOPLEFT", pfUI.uf.target, "TOPRIGHT", C.appearance.border.default*3, -(point - 1) * (5 + C.appearance.border.default*3)) pfUI.uf.target["combopoint" .. point]:SetPoint("TOPLEFT", pfUI.uf.target, "TOPRIGHT", C.appearance.border.default*3, -(point - 1) * (5 + C.appearance.border.default*3))
if point < 3 then if point < 3 then
local tex = pfUI.uf.target["combopoint" .. point]:CreateTexture("OVERLAY") local tex = pfUI.uf.target["combopoint" .. point]:CreateTexture("OVERLAY")
@@ -428,7 +428,7 @@ pfUI:RegisterModule("target", function ()
function pfUI.uf.target.buff.RefreshBuffs() function pfUI.uf.target.buff.RefreshBuffs()
for i=1, 16 do for i=1, 16 do
local texture, stacks = UnitBuff("target",i) local texture, stacks = UnitBuff("target",i)
pfUI.api:CreateBackdrop(pfUI.uf.target.buff.buffs[i], default_border) CreateBackdrop(pfUI.uf.target.buff.buffs[i], default_border)
pfUI.uf.target.buff.buffs[i]:SetNormalTexture(texture) pfUI.uf.target.buff.buffs[i]:SetNormalTexture(texture)
for i,v in ipairs({pfUI.uf.target.buff.buffs[i]:GetRegions()}) do for i,v in ipairs({pfUI.uf.target.buff.buffs[i]:GetRegions()}) do
if v.SetTexCoord then v:SetTexCoord(.08, .92, .08, .92) end if v.SetTexCoord then v:SetTexCoord(.08, .92, .08, .92) end
@@ -518,7 +518,7 @@ pfUI:RegisterModule("target", function ()
invert * (row)*((2*default_border) + C.unitframes.debuff_size + 1) + invert * (2*default_border + 1)) invert * (row)*((2*default_border) + C.unitframes.debuff_size + 1) + invert * (2*default_border + 1))
local texture, stacks = UnitDebuff("target",i) local texture, stacks = UnitDebuff("target",i)
pfUI.api:CreateBackdrop(pfUI.uf.target.debuff.debuffs[i], default_border) CreateBackdrop(pfUI.uf.target.debuff.debuffs[i], default_border)
pfUI.uf.target.debuff.debuffs[i]:SetNormalTexture(texture) pfUI.uf.target.debuff.debuffs[i]:SetNormalTexture(texture)
for i,v in ipairs({pfUI.uf.target.debuff.debuffs[i]:GetRegions()}) do for i,v in ipairs({pfUI.uf.target.debuff.debuffs[i]:GetRegions()}) do
if v.SetTexCoord then v:SetTexCoord(.08, .92, .08, .92) end if v.SetTexCoord then v:SetTexCoord(.08, .92, .08, .92) end
+4 -4
View File
@@ -25,7 +25,7 @@ pfUI:RegisterModule("targettarget", function ()
pfUI.uf.targettarget:SetWidth(100) pfUI.uf.targettarget:SetWidth(100)
pfUI.uf.targettarget:SetHeight(20 + 2*default_border + spacing) pfUI.uf.targettarget:SetHeight(20 + 2*default_border + spacing)
pfUI.uf.targettarget:SetPoint("BOTTOM", UIParent , "BOTTOM", 0, 125) pfUI.uf.targettarget:SetPoint("BOTTOM", UIParent , "BOTTOM", 0, 125)
pfUI.api:UpdateMovable(pfUI.uf.targettarget) UpdateMovable(pfUI.uf.targettarget)
pfUI.uf.targettarget:RegisterForClicks('LeftButtonUp', 'RightButtonUp', 'MiddleButtonUp', 'Button4Up', 'Button5Up') pfUI.uf.targettarget:RegisterForClicks('LeftButtonUp', 'RightButtonUp', 'MiddleButtonUp', 'Button4Up', 'Button5Up')
pfUI.uf.targettarget:SetScript("OnEnter", function() pfUI.uf.targettarget:SetScript("OnEnter", function()
@@ -73,7 +73,7 @@ pfUI:RegisterModule("targettarget", function ()
local r, g, b = .2, .2, .2 local r, g, b = .2, .2, .2
if color then if color then
if C.unitframes.custom == "1" then if C.unitframes.custom == "1" then
local cr, cg, cb, ca = pfUI.api.strsplit(",", C.unitframes.customcolor) local cr, cg, cb, ca = strsplit(",", C.unitframes.customcolor)
cr, cg, cb = tonumber(cr), tonumber(cg), tonumber(cb) cr, cg, cb = tonumber(cr), tonumber(cg), tonumber(cb)
pfUI.uf.targettarget.hp.bar:SetStatusBarColor(cr, cg, cb, UnitHealth("targettarget") / UnitHealthMax("targettarget") / 4 + .75) pfUI.uf.targettarget.hp.bar:SetStatusBarColor(cr, cg, cb, UnitHealth("targettarget") / UnitHealthMax("targettarget") / 4 + .75)
if C.unitframes.pastel == "1" then if C.unitframes.pastel == "1" then
@@ -127,7 +127,7 @@ pfUI:RegisterModule("targettarget", function ()
pfUI.uf.targettarget.hp:SetPoint("TOP", 0, 0) pfUI.uf.targettarget.hp:SetPoint("TOP", 0, 0)
pfUI.uf.targettarget.hp:SetWidth(100) pfUI.uf.targettarget.hp:SetWidth(100)
pfUI.uf.targettarget.hp:SetHeight(16) pfUI.uf.targettarget.hp:SetHeight(16)
pfUI.api:CreateBackdrop(pfUI.uf.targettarget.hp, default_border) CreateBackdrop(pfUI.uf.targettarget.hp, default_border)
pfUI.uf.targettarget.hp.bar = CreateFrame("StatusBar", nil, pfUI.uf.targettarget.hp) pfUI.uf.targettarget.hp.bar = CreateFrame("StatusBar", nil, pfUI.uf.targettarget.hp)
pfUI.uf.targettarget.hp.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar") pfUI.uf.targettarget.hp.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
@@ -146,7 +146,7 @@ pfUI:RegisterModule("targettarget", function ()
pfUI.uf.targettarget.hp.raidIcon:Hide() pfUI.uf.targettarget.hp.raidIcon:Hide()
pfUI.uf.targettarget.power = CreateFrame("Frame",nil, pfUI.uf.targettarget) pfUI.uf.targettarget.power = CreateFrame("Frame",nil, pfUI.uf.targettarget)
pfUI.api:CreateBackdrop(pfUI.uf.targettarget.power, default_border) CreateBackdrop(pfUI.uf.targettarget.power, default_border)
pfUI.uf.targettarget.power:SetPoint("BOTTOM", 0, 0) pfUI.uf.targettarget.power:SetPoint("BOTTOM", 0, 0)
pfUI.uf.targettarget.power:SetWidth(100) pfUI.uf.targettarget.power:SetWidth(100)
pfUI.uf.targettarget.power:SetHeight(4) pfUI.uf.targettarget.power:SetHeight(4)
+13 -13
View File
@@ -97,7 +97,7 @@ pfUI:RegisterModule("thirdparty", function ()
pfUIhookWIM_PostMessage = _G.WIM_PostMessage pfUIhookWIM_PostMessage = _G.WIM_PostMessage
_G.WIM_PostMessage = function(user, msg, ttype, from, raw_msg) _G.WIM_PostMessage = function(user, msg, ttype, from, raw_msg)
pfUIhookWIM_PostMessage(user, msg, ttype, from, raw_msg) pfUIhookWIM_PostMessage(user, msg, ttype, from, raw_msg)
pfUI.api:CreateBackdrop(_G["WIM_msgFrame" .. user], nil, nil, .8) CreateBackdrop(_G["WIM_msgFrame" .. user], nil, nil, .8)
_G["WIM_msgFrame" .. user .. "From"]:ClearAllPoints() _G["WIM_msgFrame" .. user .. "From"]:ClearAllPoints()
_G["WIM_msgFrame" .. user .. "From"]:SetPoint("TOP", 0, -10) _G["WIM_msgFrame" .. user .. "From"]:SetPoint("TOP", 0, -10)
@@ -115,7 +115,7 @@ pfUI:RegisterModule("thirdparty", function ()
_G["WIM_msgFrame" .. user .. "ScrollingMessageFrame"]:SetPoint("BOTTOMRIGHT", _G["WIM_msgFrame" .. user], "BOTTOMRIGHT", -32, 32) _G["WIM_msgFrame" .. user .. "ScrollingMessageFrame"]:SetPoint("BOTTOMRIGHT", _G["WIM_msgFrame" .. user], "BOTTOMRIGHT", -32, 32)
_G["WIM_msgFrame" .. user .. "ScrollingMessageFrame"]:SetFont(STANDARD_TEXT_FONT, 12) _G["WIM_msgFrame" .. user .. "ScrollingMessageFrame"]:SetFont(STANDARD_TEXT_FONT, 12)
pfUI.api:CreateBackdrop(_G["WIM_msgFrame" .. user .. "MsgBox"]) CreateBackdrop(_G["WIM_msgFrame" .. user .. "MsgBox"])
_G["WIM_msgFrame" .. user .. "MsgBox"]:ClearAllPoints() _G["WIM_msgFrame" .. user .. "MsgBox"]:ClearAllPoints()
_G["WIM_msgFrame" .. user .. "MsgBox"]:SetPoint("TOPLEFT", _G["WIM_msgFrame" .. user .. "ScrollingMessageFrame"], "BOTTOMLEFT", 0, -5) _G["WIM_msgFrame" .. user .. "MsgBox"]:SetPoint("TOPLEFT", _G["WIM_msgFrame" .. user .. "ScrollingMessageFrame"], "BOTTOMLEFT", 0, -5)
_G["WIM_msgFrame" .. user .. "MsgBox"]:SetPoint("TOPRIGHT", _G["WIM_msgFrame" .. user .. "ScrollingMessageFrame"], "BOTTOMRIGHT", 0, -5) _G["WIM_msgFrame" .. user .. "MsgBox"]:SetPoint("TOPRIGHT", _G["WIM_msgFrame" .. user .. "ScrollingMessageFrame"], "BOTTOMRIGHT", 0, -5)
@@ -125,27 +125,27 @@ pfUI:RegisterModule("thirdparty", function ()
if i==6 then v:SetTexture(.1,.1,.1,.5) end if i==6 then v:SetTexture(.1,.1,.1,.5) end
end end
pfUI.api:CreateBackdrop(_G["WIM_msgFrame" .. user .. "ShortcutFrameButton1"]) CreateBackdrop(_G["WIM_msgFrame" .. user .. "ShortcutFrameButton1"])
for i,v in ipairs({_G["WIM_msgFrame" .. user .. "ShortcutFrameButton1"]:GetRegions()}) do for i,v in ipairs({_G["WIM_msgFrame" .. user .. "ShortcutFrameButton1"]:GetRegions()}) do
if i >= 2 and i < 7 then v:SetTexture(.1,.1,.1,0) end if i >= 2 and i < 7 then v:SetTexture(.1,.1,.1,0) end
end end
pfUI.api:CreateBackdrop(_G["WIM_msgFrame" .. user .. "ShortcutFrameButton2"]) CreateBackdrop(_G["WIM_msgFrame" .. user .. "ShortcutFrameButton2"])
for i,v in ipairs({_G["WIM_msgFrame" .. user .. "ShortcutFrameButton2"]:GetRegions()}) do for i,v in ipairs({_G["WIM_msgFrame" .. user .. "ShortcutFrameButton2"]:GetRegions()}) do
if i >= 2 and i < 7 then v:SetTexture(.1,.1,.1,0) end if i >= 2 and i < 7 then v:SetTexture(.1,.1,.1,0) end
end end
pfUI.api:CreateBackdrop(_G["WIM_msgFrame" .. user .. "ShortcutFrameButton3"]) CreateBackdrop(_G["WIM_msgFrame" .. user .. "ShortcutFrameButton3"])
for i,v in ipairs({_G["WIM_msgFrame" .. user .. "ShortcutFrameButton3"]:GetRegions()}) do for i,v in ipairs({_G["WIM_msgFrame" .. user .. "ShortcutFrameButton3"]:GetRegions()}) do
if i >= 2 and i < 7 then v:SetTexture(.1,.1,.1,0) end if i >= 2 and i < 7 then v:SetTexture(.1,.1,.1,0) end
end end
pfUI.api:CreateBackdrop(_G["WIM_msgFrame" .. user .. "ShortcutFrameButton4"]) CreateBackdrop(_G["WIM_msgFrame" .. user .. "ShortcutFrameButton4"])
for i,v in ipairs({_G["WIM_msgFrame" .. user .. "ShortcutFrameButton4"]:GetRegions()}) do for i,v in ipairs({_G["WIM_msgFrame" .. user .. "ShortcutFrameButton4"]:GetRegions()}) do
if i >= 2 and i < 7 then v:SetTexture(.1,.1,.1,0) end if i >= 2 and i < 7 then v:SetTexture(.1,.1,.1,0) end
end end
pfUI.api:CreateBackdrop(_G["WIM_msgFrame" .. user .. "ShortcutFrameButton5"]) CreateBackdrop(_G["WIM_msgFrame" .. user .. "ShortcutFrameButton5"])
for i,v in ipairs({_G["WIM_msgFrame" .. user .. "ShortcutFrameButton5"]:GetRegions()}) do for i,v in ipairs({_G["WIM_msgFrame" .. user .. "ShortcutFrameButton5"]:GetRegions()}) do
if i >= 2 and i < 7 then v:SetTexture(.1,.1,.1,0) end if i >= 2 and i < 7 then v:SetTexture(.1,.1,.1,0) end
end end
@@ -329,7 +329,7 @@ pfUI:RegisterModule("thirdparty", function ()
pfUI.bag.right.sort:SetPoint("TOPRIGHT", -C.appearance.border.default*14 - 45, -C.appearance.border.default) pfUI.bag.right.sort:SetPoint("TOPRIGHT", -C.appearance.border.default*14 - 45, -C.appearance.border.default)
pfUI.bag.right.sort:SetPoint("TOPRIGHT", pfUI.bag.right.keys, "TOPLEFT", -C.appearance.border.default*3, 0) pfUI.bag.right.sort:SetPoint("TOPRIGHT", pfUI.bag.right.keys, "TOPLEFT", -C.appearance.border.default*3, 0)
pfUI.api:CreateBackdrop(pfUI.bag.right.sort) CreateBackdrop(pfUI.bag.right.sort)
pfUI.bag.right.sort:SetHeight(12) pfUI.bag.right.sort:SetHeight(12)
pfUI.bag.right.sort:SetWidth(12) pfUI.bag.right.sort:SetWidth(12)
pfUI.bag.right.sort:SetTextColor(1,1,.25,1) pfUI.bag.right.sort:SetTextColor(1,1,.25,1)
@@ -347,7 +347,7 @@ pfUI:RegisterModule("thirdparty", function ()
end) end)
pfUI.bag.right.sort:SetScript("OnLeave", function () pfUI.bag.right.sort:SetScript("OnLeave", function ()
pfUI.api:CreateBackdrop(pfUI.bag.right.sort) CreateBackdrop(pfUI.bag.right.sort)
pfUI.bag.right.sort.texture:SetVertexColor(.25,.25,.25,1) pfUI.bag.right.sort.texture:SetVertexColor(.25,.25,.25,1)
end) end)
@@ -367,7 +367,7 @@ pfUI:RegisterModule("thirdparty", function ()
pfUI.bag.left.sort:SetPoint("TOPRIGHT", -C.appearance.border.default*14 - 45, -C.appearance.border.default) pfUI.bag.left.sort:SetPoint("TOPRIGHT", -C.appearance.border.default*14 - 45, -C.appearance.border.default)
pfUI.bag.left.sort:SetPoint("TOPRIGHT", pfUI.bag.left.bags, "TOPLEFT", -C.appearance.border.default*3, 0) pfUI.bag.left.sort:SetPoint("TOPRIGHT", pfUI.bag.left.bags, "TOPLEFT", -C.appearance.border.default*3, 0)
pfUI.api:CreateBackdrop(pfUI.bag.left.sort) CreateBackdrop(pfUI.bag.left.sort)
pfUI.bag.left.sort:SetHeight(12) pfUI.bag.left.sort:SetHeight(12)
pfUI.bag.left.sort:SetWidth(12) pfUI.bag.left.sort:SetWidth(12)
pfUI.bag.left.sort:SetTextColor(1,1,.25,1) pfUI.bag.left.sort:SetTextColor(1,1,.25,1)
@@ -385,7 +385,7 @@ pfUI:RegisterModule("thirdparty", function ()
end) end)
pfUI.bag.left.sort:SetScript("OnLeave", function () pfUI.bag.left.sort:SetScript("OnLeave", function ()
pfUI.api:CreateBackdrop(pfUI.bag.left.sort) CreateBackdrop(pfUI.bag.left.sort)
pfUI.bag.left.sort.texture:SetVertexColor(.25,.25,.25,1) pfUI.bag.left.sort.texture:SetVertexColor(.25,.25,.25,1)
end) end)
@@ -413,7 +413,7 @@ pfUI:RegisterModule("thirdparty", function ()
local function pfSetupKTM() local function pfSetupKTM()
-- use pfUI border for main window -- use pfUI border for main window
pfUI.api:CreateBackdrop(KLHTM_Frame) CreateBackdrop(KLHTM_Frame)
-- remove titlebar -- remove titlebar
KLHTM_Gui.title.back:Hide() KLHTM_Gui.title.back:Hide()
@@ -427,7 +427,7 @@ pfUI:RegisterModule("thirdparty", function ()
for i, button in pairs(buttons) do for i, button in pairs(buttons) do
local b = _G[button] local b = _G[button]
if not b then return end if not b then return end
pfUI.api:SkinButton(b) SkinButton(b)
b:SetScale(.8) b:SetScale(.8)
-- remove red background on some buttons -- remove red background on some buttons
+6 -6
View File
@@ -1,6 +1,6 @@
pfUI:RegisterModule("tooltip", function () pfUI:RegisterModule("tooltip", function ()
local alpha = tonumber(C.tooltip.alpha) local alpha = tonumber(C.tooltip.alpha)
pfUI.api:CreateBackdrop(GameTooltip, nil, nil, alpha) CreateBackdrop(GameTooltip, nil, nil, alpha)
if C.tooltip.position == "cursor" then if C.tooltip.position == "cursor" then
function _G.GameTooltip_SetDefaultAnchor(tooltip, parent) function _G.GameTooltip_SetDefaultAnchor(tooltip, parent)
@@ -62,8 +62,8 @@ pfUI.api:CreateBackdrop(GameTooltip, nil, nil, alpha)
_, hpm = GameTooltipStatusBar:GetMinMaxValues() _, hpm = GameTooltipStatusBar:GetMinMaxValues()
if hp and hpm then if hp and hpm then
if hp >= 1000 then hp = pfUI.api.round(hp / 1000, 1) .. "k" end if hp >= 1000 then hp = round(hp / 1000, 1) .. "k" end
if hpm >= 1000 then hpm = pfUI.api.round(hpm / 1000, 1) .. "k" end if hpm >= 1000 then hpm = round(hpm / 1000, 1) .. "k" end
pfUI.tooltipStatusBar.HP:SetText(hp .. " / " .. hpm) pfUI.tooltipStatusBar.HP:SetText(hp .. " / " .. hpm)
end end
end) end)
@@ -73,7 +73,7 @@ pfUI.api:CreateBackdrop(GameTooltip, nil, nil, alpha)
GameTooltipStatusBar:SetPoint("BOTTOMLEFT", GameTooltip, "TOPLEFT", 0, 0) GameTooltipStatusBar:SetPoint("BOTTOMLEFT", GameTooltip, "TOPLEFT", 0, 0)
GameTooltipStatusBar:SetPoint("BOTTOMRIGHT", GameTooltip, "TOPRIGHT", 0, 0) GameTooltipStatusBar:SetPoint("BOTTOMRIGHT", GameTooltip, "TOPRIGHT", 0, 0)
GameTooltipStatusBar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar") GameTooltipStatusBar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
pfUI.api:CreateBackdrop(GameTooltipStatusBar) CreateBackdrop(GameTooltipStatusBar)
GameTooltipStatusBar.SetStatusBarColor_orig = GameTooltipStatusBar.SetStatusBarColor GameTooltipStatusBar.SetStatusBarColor_orig = GameTooltipStatusBar.SetStatusBarColor
GameTooltipStatusBar.SetStatusBarColor = function() return end GameTooltipStatusBar.SetStatusBarColor = function() return end
@@ -140,8 +140,8 @@ pfUI.api:CreateBackdrop(GameTooltip, nil, nil, alpha)
end end
if hp and hpm then if hp and hpm then
if hp >= 1000 then hp = pfUI.api.round(hp / 1000, 1) .. "k" end if hp >= 1000 then hp = round(hp / 1000, 1) .. "k" end
if hpm >= 1000 then hpm = pfUI.api.round(hpm / 1000, 1) .. "k" end if hpm >= 1000 then hpm = round(hpm / 1000, 1) .. "k" end
pfUI.tooltipStatusBar.HP:SetText(hp .. " / " .. hpm) pfUI.tooltipStatusBar.HP:SetText(hp .. " / " .. hpm)
end end
GameTooltip:Show() GameTooltip:Show()
+2 -2
View File
@@ -26,7 +26,7 @@ pfUI:RegisterModule("uf_tukui", function ()
pfUI.uf.player.powerText:SetParent(pfUI.uf.player.caption) pfUI.uf.player.powerText:SetParent(pfUI.uf.player.caption)
pfUI.uf.player.powerText:SetAllPoints(pfUI.uf.player.caption) pfUI.uf.player.powerText:SetAllPoints(pfUI.uf.player.caption)
pfUI.uf.player.powerText:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE") pfUI.uf.player.powerText:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE")
pfUI.api:CreateBackdrop(pfUI.uf.player.caption) CreateBackdrop(pfUI.uf.player.caption)
-- Target -- Target
pfUI.uf.target.caption = CreateFrame("Frame", "pfTargetCaption", pfUI.uf.target) pfUI.uf.target.caption = CreateFrame("Frame", "pfTargetCaption", pfUI.uf.target)
@@ -43,6 +43,6 @@ pfUI:RegisterModule("uf_tukui", function ()
pfUI.uf.target.powerText:SetParent(pfUI.uf.target.caption) pfUI.uf.target.powerText:SetParent(pfUI.uf.target.caption)
pfUI.uf.target.powerText:SetAllPoints(pfUI.uf.target.caption) pfUI.uf.target.powerText:SetAllPoints(pfUI.uf.target.caption)
pfUI.uf.target.powerText:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE") pfUI.uf.target.powerText:SetFont(pfUI.font_default, C.global.font_size, "OUTLINE")
pfUI.api:CreateBackdrop(pfUI.uf.target.caption) CreateBackdrop(pfUI.uf.target.caption)
end end
end) end)
+6 -6
View File
@@ -9,7 +9,7 @@ pfUI:RegisterModule("xpbar", function ()
pfUI.xp:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 0, 0) pfUI.xp:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 0, 0)
end end
pfUI.xp:SetFrameStrata("BACKGROUND") pfUI.xp:SetFrameStrata("BACKGROUND")
pfUI.api:CreateBackdrop(pfUI.xp) CreateBackdrop(pfUI.xp)
pfUI.xp:RegisterEvent("PLAYER_LEVEL_UP") pfUI.xp:RegisterEvent("PLAYER_LEVEL_UP")
pfUI.xp:RegisterEvent("PLAYER_XP_UPDATE") pfUI.xp:RegisterEvent("PLAYER_XP_UPDATE")
pfUI.xp:RegisterEvent("PLAYER_ENTERING_WORLD") pfUI.xp:RegisterEvent("PLAYER_ENTERING_WORLD")
@@ -51,12 +51,12 @@ pfUI:RegisterModule("xpbar", function ()
pfUI.xp.mouseover = true pfUI.xp.mouseover = true
pfUI.xp:SetAlpha(1) pfUI.xp:SetAlpha(1)
local xp, xpmax, exh = UnitXP("player"), UnitXPMax("player"), GetXPExhaustion() local xp, xpmax, exh = UnitXP("player"), UnitXPMax("player"), GetXPExhaustion()
local xp_perc = pfUI.api.round(xp / xpmax * 100) local xp_perc = round(xp / xpmax * 100)
local remaining = xpmax - xp local remaining = xpmax - xp
local remaining_perc = pfUI.api.round(remaining / xpmax * 100) local remaining_perc = round(remaining / xpmax * 100)
local exh_perc = 0 local exh_perc = 0
if GetXPExhaustion() then if GetXPExhaustion() then
exh_perc = pfUI.api.round(GetXPExhaustion() / xpmax * 100) exh_perc = round(GetXPExhaustion() / xpmax * 100)
end end
GameTooltip:ClearLines() GameTooltip:ClearLines()
@@ -109,7 +109,7 @@ pfUI:RegisterModule("xpbar", function ()
pfUI.rep:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", 0, 0) pfUI.rep:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", 0, 0)
end end
pfUI.rep:SetFrameStrata("BACKGROUND") pfUI.rep:SetFrameStrata("BACKGROUND")
pfUI.api:CreateBackdrop(pfUI.rep) CreateBackdrop(pfUI.rep)
pfUI.rep.bar = CreateFrame("StatusBar", nil, pfUI.rep) pfUI.rep.bar = CreateFrame("StatusBar", nil, pfUI.rep)
pfUI.rep.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar") pfUI.rep.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
@@ -171,7 +171,7 @@ pfUI:RegisterModule("xpbar", function ()
GameTooltip:SetOwner(this, "ANCHOR_CURSOR") GameTooltip:SetOwner(this, "ANCHOR_CURSOR")
GameTooltip:AddLine("|cff555555Reputation") GameTooltip:AddLine("|cff555555Reputation")
GameTooltip:AddLine(name .. " (" .. GetText("FACTION_STANDING_LABEL"..standingID, gender) .. ")", color.r + .3, color.g + .3, color.b + .3) GameTooltip:AddLine(name .. " (" .. GetText("FACTION_STANDING_LABEL"..standingID, gender) .. ")", color.r + .3, color.g + .3, color.b + .3)
GameTooltip:AddLine(barValue .. " / " .. barMax .. " (" .. pfUI.api.round(barValue / barMax * 100) .. "%)",1,1,1) GameTooltip:AddLine(barValue .. " / " .. barMax .. " (" .. round(barValue / barMax * 100) .. "%)",1,1,1)
GameTooltip:Show() GameTooltip:Show()
pfUI.rep.mouseover = true pfUI.rep.mouseover = true
+6 -6
View File
@@ -75,13 +75,13 @@ pfUI:SetScript("OnEvent", function()
local env_pfui = {} local env_pfui = {}
setmetatable(env_pfui, {__index = getfenv(0)}) setmetatable(env_pfui, {__index = getfenv(0)})
-- environment -- load api into environment
env_pfui.A = pfUI.api for m, func in pairs(pfUI.api) do
env_pfui.C = pfUI_config if not env_pfui[m] then env_pfui[m] = func end
-- env_pfui.L = pfUI_locale end
-- classic only -- use C for configs
env_pfui._G = getfenv(0) env_pfui.C = pfUI_config
-- fill the cache -- fill the cache
pfUI.cache["locale"] = GetLocale() pfUI.cache["locale"] = GetLocale()