mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-27 01:46:03 +00:00
moved to github, reset trashy history
This commit is contained in:
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
ManaBarColor = {}
|
||||
ManaBarColor[0] = { r = 0.00, g = 0.00, b = 1.00, prefix = TEXT(MANA) };
|
||||
ManaBarColor[1] = { r = 1.00, g = 0.00, b = 0.00, prefix = TEXT(RAGE_POINTS) };
|
||||
ManaBarColor[2] = { r = 1.00, g = 0.50, b = 0.25, prefix = TEXT(FOCUS_POINTS) };
|
||||
ManaBarColor[3] = { r = 1.00, g = 1.00, b = 0.00, prefix = TEXT(ENERGY_POINTS) };
|
||||
ManaBarColor[4] = { r = 0.00, g = 1.00, b = 1.00, prefix = TEXT(HAPPINESS_POINTS) };
|
||||
|
||||
RAID_CLASS_COLORS = {
|
||||
["WARRIOR"] = { r = 0.78, g = 0.61, b = 0.43, colorStr = "ffc79c6e" },
|
||||
["MAGE"] = { r = 0.41, g = 0.8, b = 0.94, colorStr = "ff69ccf0" },
|
||||
["ROGUE"] = { r = 1, g = 0.96, b = 0.41, colorStr = "fffff569" },
|
||||
["DRUID"] = { r = 1, g = 0.49, b = 0.04, colorStr = "ffff7d0a" },
|
||||
["HUNTER"] = { r = 0.67, g = 0.83, b = 0.45, colorStr = "ffabd473" },
|
||||
["SHAMAN"] = { r = 0.14, g = 0.35, b = 1.0, colorStr = "ff0070de" },
|
||||
["PRIEST"] = { r = 1, g = 1, b = 1, colorStr = "ffffffff" },
|
||||
["WARLOCK"] = { r = 0.58, g = 0.51, b = 0.79, colorStr = "ff9482c9" },
|
||||
["PALADIN"] = { r = 0.96, g = 0.55, b = 0.73, colorStr = "fff58cba" }
|
||||
}
|
||||
Vendored
+73
@@ -0,0 +1,73 @@
|
||||
pfLocaleClass = {
|
||||
["enGB"] = {
|
||||
["Warlock"] = "WARLOCK",
|
||||
["Warrior"] = "WARRIOR",
|
||||
["Hunter"] = "HUNTER",
|
||||
["Mage"] = "MAGE",
|
||||
["Priest"] = "PRIEST",
|
||||
["Druid"] = "DRUID",
|
||||
["Paladin"] = "PALADIN",
|
||||
["Shaman"] = "SHAMAN",
|
||||
["Rogue"] = "ROGUE",
|
||||
},
|
||||
|
||||
["deDE"] = {
|
||||
["Hexenmeister"] = "WARLOCK",
|
||||
["Krieger"] = "WARRIOR",
|
||||
["Jäger"] = "HUNTER",
|
||||
["Magier"] = "MAGE",
|
||||
["Priester"] = "PRIEST",
|
||||
["Druide"] = "DRUID",
|
||||
["Paladin"] = "PALADIN",
|
||||
["Schamane"] = "SHAMAN",
|
||||
["Schurke"] = "ROGUE",
|
||||
},
|
||||
|
||||
["frFR"] = {
|
||||
["D\195\169moniste"] = "WARLOCK",
|
||||
["Guerrier"] = "WARRIOR",
|
||||
["Chasseur"] = "HUNTER",
|
||||
["Mage"] = "MAGE",
|
||||
["Pr\195\170tre"] = "PRIEST",
|
||||
["Druide"] = "DRUID",
|
||||
["Paladin"] = "PALADIN",
|
||||
["Chaman"] = "SHAMAN",
|
||||
["Voleur"] = "ROGUE",
|
||||
},
|
||||
|
||||
["zhCN"] = {
|
||||
["术士"] = "WARLOCK",
|
||||
["战士"] = "WARRIOR",
|
||||
["猎人"] = "HUNTER",
|
||||
["法师"] = "MAGE",
|
||||
["牧师"] = "PRIEST",
|
||||
["德鲁伊"] = "DRUID",
|
||||
["圣骑士"] = "PALADIN",
|
||||
["萨满祭司"] = "SHAMAN",
|
||||
["盗贼"] = "ROGUE",
|
||||
},
|
||||
|
||||
["zhTW"] = {
|
||||
["術士"] = "WARLOCK",
|
||||
["戰士"] = "WARRIOR",
|
||||
["獵人"] = "HUNTER",
|
||||
["法師"] = "MAGE",
|
||||
["牧師"] = "PRIEST",
|
||||
["德魯伊"] = "DRUID",
|
||||
["聖騎士"] = "PALADIN",
|
||||
["薩滿"] = "SHAMAN",
|
||||
["盜賊"] = "ROGUE",
|
||||
},
|
||||
|
||||
["koKR"] = {
|
||||
["흑마법사"] = "WARLOCK",
|
||||
["전사"] = "WARRIOR",
|
||||
["사냥꾼"] = "HUNTER",
|
||||
["마법사"] = "MAGE",
|
||||
["사제"] = "PRIEST",
|
||||
["드루이드"] = "DRUID",
|
||||
["성기사"] = "PALADIN",
|
||||
["주술사"] = "SHAMAN",
|
||||
["도적"] = "ROGUE",
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Executable
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
|
After Width: | Height: | Size: 236 B |
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 236 B |
@@ -0,0 +1,330 @@
|
||||
-- override defaultUI functions to always show grid
|
||||
function ActionButton_ShowGrid(button) return end
|
||||
function ActionButton_HideGrid(button) return end
|
||||
|
||||
Hook_ShowBonusActionBar = ShowBonusActionBar
|
||||
function ShowBonusActionBar()
|
||||
for i=1, 12 do getglobal("ActionButton" .. i):SetAlpha(0) end
|
||||
Hook_ShowBonusActionBar()
|
||||
end
|
||||
|
||||
Hook_HideBonusActionBar = HideBonusActionBar
|
||||
function HideBonusActionBar()
|
||||
for i=1, 12 do getglobal("ActionButton" .. i):SetAlpha(1) end
|
||||
Hook_HideBonusActionBar()
|
||||
end
|
||||
|
||||
-- hide default blizz
|
||||
MainMenuBar:Hide()
|
||||
BonusActionBarTexture0:Hide()
|
||||
BonusActionBarTexture1:Hide()
|
||||
|
||||
-- create action bar frame
|
||||
pfUI.bars = CreateFrame("Frame",nil,UIParent)
|
||||
pfUI.bars:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
pfUI.bars:RegisterEvent("CVAR_UPDATE")
|
||||
pfUI.bars:RegisterEvent("UNIT_FLAGS")
|
||||
pfUI.bars:RegisterEvent("UNIT_PET")
|
||||
pfUI.bars:RegisterEvent("PET_BAR_UPDATE")
|
||||
pfUI.bars:RegisterEvent("PET_BAR_UPDATE_COOLDOWN")
|
||||
pfUI.bars:RegisterEvent("PLAYER_CONTROL_GAINED")
|
||||
pfUI.bars:RegisterEvent("PLAYER_CONTROL_LOST")
|
||||
pfUI.bars:RegisterEvent("PLAYER_FARSIGHT_FOCUS_CHANGED")
|
||||
pfUI.bars:RegisterEvent("UNIT_AURA")
|
||||
pfUI.bars:RegisterEvent("PET_BAR_SHOWGRID")
|
||||
pfUI.bars:RegisterEvent("PET_BAR_HIDEGRID")
|
||||
|
||||
pfUI.bars.shapeshift = CreateFrame("Frame", "pfBarBottom", UIParent)
|
||||
pfUI.bars.bottomleft = CreateFrame("Frame", "pfBarBottom", UIParent)
|
||||
pfUI.bars.bottomright = CreateFrame("Frame", "pfBarBottom", UIParent)
|
||||
pfUI.bars.vertical = CreateFrame("Frame", "pfBarBottom", UIParent)
|
||||
pfUI.bars.pet = CreateFrame("Frame", "pfBarBottom", UIParent)
|
||||
|
||||
PetActionBarFrame:SetParent(pfUI.bars.pet)
|
||||
|
||||
pfUI.bars:SetScript("OnEvent", function()
|
||||
local bpc = 1; if MultiBarBottomLeft:IsShown() then bpc = bpc + 1 end -- bottom panel count
|
||||
pfUI.bars.bottom:SetWidth(pfUI.config.bars.border*3 + pfUI.config.bars.icon_size * 12 + pfUI.config.bars.border * 12)
|
||||
pfUI.bars.bottom:SetHeight(pfUI.config.bars.border*3 + pfUI.config.bars.icon_size * bpc + pfUI.config.bars.border * bpc)
|
||||
|
||||
PetActionBar_Update()
|
||||
if (PetHasActionBar()) then
|
||||
--ShowPetActionBar()
|
||||
--LockPetActionBar()
|
||||
pfUI.bars.pet:Show()
|
||||
pfUI.bars.pet:SetFrameStrata("LOW")
|
||||
pfUI.bars.pet:SetPoint("BOTTOM", pfUI.bars.bottom, "TOP", 0, 5)
|
||||
pfUI.bars.pet:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.bars.pet:SetWidth(pfUI.config.bars.border*3 + pfUI.config.bars.icon_size * 10 + pfUI.config.bars.border * 10)
|
||||
pfUI.bars.pet:SetHeight(pfUI.config.bars.border*3 + pfUI.config.bars.icon_size * 1 + pfUI.config.bars.border)
|
||||
|
||||
PetActionBarFrame:ClearAllPoints()
|
||||
PetActionBarFrame:SetAllPoints(pfUI.bars.pet)
|
||||
|
||||
PetActionButton1:ClearAllPoints()
|
||||
PetActionButton1:SetParent(pfUI.bars.pet)
|
||||
PetActionButton1:SetPoint("BOTTOMLEFT", pfUI.config.bars.border*2, pfUI.config.bars.border*2)
|
||||
for i=2, 10 do
|
||||
local b = getglobal("PetActionButton"..i)
|
||||
local b2 = getglobal("PetActionButton"..i-1)
|
||||
b:SetAllPoints(pfUI.bars.pet)
|
||||
b:ClearAllPoints()
|
||||
b:SetPoint("LEFT", b2, "RIGHT", pfUI.config.bars.border, 0)
|
||||
end
|
||||
else
|
||||
pfUI.bars.pet:Hide()
|
||||
end
|
||||
|
||||
ShapeshiftBarFrame:ClearAllPoints()
|
||||
ShapeshiftBarFrame:SetAllPoints(pfUI.bars.shapeshift)
|
||||
|
||||
ShapeshiftButton1:ClearAllPoints()
|
||||
ShapeshiftButton1:SetParent(pfUI.bars.shapeshift)
|
||||
ShapeshiftButton1:SetPoint("BOTTOMLEFT", pfUI.config.bars.border*2, pfUI.config.bars.border*2)
|
||||
local shapeshiftbuttons = 0
|
||||
if ShapeshiftButton1:IsShown() then
|
||||
shapeshiftbuttons = 1
|
||||
pfUI.bars.shapeshift:Show()
|
||||
else
|
||||
pfUI.bars.shapeshift:Hide()
|
||||
end
|
||||
for i=2, 10 do
|
||||
local b = getglobal("ShapeshiftButton"..i)
|
||||
local b2 = getglobal("ShapeshiftButton"..i-1)
|
||||
b:SetAllPoints(pfUI.bars.shapeshift)
|
||||
b:SetParent(pfUI.bars.shapeshift)
|
||||
b:ClearAllPoints()
|
||||
b:SetPoint("LEFT", b2, "RIGHT", pfUI.config.bars.border, 0)
|
||||
if b:IsShown() then shapeshiftbuttons = shapeshiftbuttons + 1 end
|
||||
end
|
||||
|
||||
pfUI.bars.shapeshift:SetFrameStrata("LOW")
|
||||
pfUI.bars.shapeshift:SetPoint("BOTTOM", pfUI.bars.bottom, "TOP", 0, 5)
|
||||
pfUI.bars.shapeshift:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.bars.shapeshift:SetWidth(pfUI.config.bars.border*3 + pfUI.config.bars.icon_size * shapeshiftbuttons + pfUI.config.bars.border * shapeshiftbuttons)
|
||||
pfUI.bars.shapeshift:SetHeight(pfUI.config.bars.border*3 + pfUI.config.bars.icon_size * 1 + pfUI.config.bars.border)
|
||||
|
||||
if SHOW_MULTI_ACTIONBAR_1 then
|
||||
MultiBarBottomLeft:SetParent(pfUI.bars.bottom)
|
||||
MultiBarBottomLeft:ClearAllPoints()
|
||||
MultiBarBottomLeft:SetAllPoints(pfUI.bars.bottom)
|
||||
|
||||
MultiBarBottomLeftButton1:ClearAllPoints()
|
||||
MultiBarBottomLeftButton1:SetPoint("BOTTOM", ActionButton1, "TOP", 0, pfUI.config.bars.border)
|
||||
for i=2, 12 do
|
||||
local b = getglobal("MultiBarBottomLeftButton"..i)
|
||||
local b2 = getglobal("MultiBarBottomLeftButton"..i-1)
|
||||
b:ClearAllPoints()
|
||||
b:SetPoint("LEFT", b2, "RIGHT", pfUI.config.bars.border, 0)
|
||||
end
|
||||
end
|
||||
|
||||
if SHOW_MULTI_ACTIONBAR_2 then
|
||||
pfUI.bars.bottomleft:Show()
|
||||
pfUI.bars.bottomleft:SetFrameStrata("LOW")
|
||||
pfUI.bars.bottomleft:SetPoint("BOTTOMRIGHT", pfUI.bars.bottom, "BOTTOMLEFT", -5, 0)
|
||||
pfUI.bars.bottomleft:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.bars.bottomleft:SetWidth(pfUI.config.bars.border*3 + pfUI.config.bars.icon_size * 6 + pfUI.config.bars.border * 6)
|
||||
pfUI.bars.bottomleft:SetHeight(pfUI.config.bars.border*3 + pfUI.config.bars.icon_size * 2 + pfUI.config.bars.border * 2)
|
||||
|
||||
MultiBarBottomRight:SetParent(pfUI.bars.bottomleft)
|
||||
MultiBarBottomRight:ClearAllPoints()
|
||||
MultiBarBottomRight:SetAllPoints(pfUI.bars.bottomleft)
|
||||
|
||||
MultiBarBottomRightButton1:ClearAllPoints()
|
||||
MultiBarBottomRightButton1:SetPoint("BOTTOMLEFT", pfUI.config.bars.border*2, pfUI.config.bars.border*2)
|
||||
for i=2, 6 do
|
||||
local b = getglobal("MultiBarBottomRightButton"..i)
|
||||
local b2 = getglobal("MultiBarBottomRightButton"..i-1)
|
||||
b:ClearAllPoints()
|
||||
b:SetPoint("LEFT", b2, "RIGHT", pfUI.config.bars.border, 0)
|
||||
end
|
||||
for i=7, 12 do
|
||||
local b = getglobal("MultiBarBottomRightButton"..i)
|
||||
local b2 = getglobal("MultiBarBottomRightButton"..i-6)
|
||||
b:ClearAllPoints()
|
||||
b:SetPoint("LEFT", b2, "RIGHT", -pfUI.config.bars.icon_size, pfUI.config.bars.icon_size + pfUI.config.bars.border)
|
||||
end
|
||||
else
|
||||
pfUI.bars.bottomleft:Hide()
|
||||
end
|
||||
|
||||
if SHOW_MULTI_ACTIONBAR_3 then
|
||||
pfUI.bars.bottomright:Show()
|
||||
pfUI.bars.bottomright:SetFrameStrata("LOW")
|
||||
pfUI.bars.bottomright:SetPoint("BOTTOMLEFT", pfUI.bars.bottom, "BOTTOMRIGHT", 5, 0)
|
||||
pfUI.bars.bottomright:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.bars.bottomright:SetWidth(pfUI.config.bars.border*3 + pfUI.config.bars.icon_size * 6 + pfUI.config.bars.border * 6)
|
||||
pfUI.bars.bottomright:SetHeight(pfUI.config.bars.border*3 + pfUI.config.bars.icon_size * 2 + pfUI.config.bars.border * 2)
|
||||
|
||||
MultiBarRight:SetParent(pfUI.bars.bottomright)
|
||||
MultiBarRight:ClearAllPoints()
|
||||
MultiBarRight:SetAllPoints(pfUI.bars.bottomright)
|
||||
|
||||
MultiBarRightButton1:ClearAllPoints()
|
||||
MultiBarRightButton1:SetPoint("BOTTOMLEFT", pfUI.config.bars.border*2, pfUI.config.bars.border*2)
|
||||
for i=2, 6 do
|
||||
local b = getglobal("MultiBarRightButton"..i)
|
||||
local b2 = getglobal("MultiBarRightButton"..i-1)
|
||||
b:ClearAllPoints()
|
||||
b:SetPoint("LEFT", b2, "RIGHT", pfUI.config.bars.border, 0)
|
||||
end
|
||||
for i=7, 12 do
|
||||
local b = getglobal("MultiBarRightButton"..i)
|
||||
local b2 = getglobal("MultiBarRightButton"..i-6)
|
||||
b:ClearAllPoints()
|
||||
b:SetPoint("LEFT", b2, "RIGHT", -pfUI.config.bars.icon_size, pfUI.config.bars.icon_size + pfUI.config.bars.border)
|
||||
end
|
||||
else
|
||||
pfUI.bars.bottomright:Hide()
|
||||
end
|
||||
|
||||
if SHOW_MULTI_ACTIONBAR_4 and SHOW_MULTI_ACTIONBAR_3 then
|
||||
pfUI.bars.vertical:Show()
|
||||
pfUI.bars.vertical:SetFrameStrata("LOW")
|
||||
pfUI.bars.vertical:SetPoint("RIGHT", -5, 0)
|
||||
pfUI.bars.vertical:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.bars.vertical:SetWidth(pfUI.config.bars.border*4 + pfUI.config.bars.icon_size)
|
||||
pfUI.bars.vertical:SetHeight(pfUI.config.bars.border*3 + pfUI.config.bars.icon_size * 12 + pfUI.config.bars.border * 12)
|
||||
|
||||
MultiBarLeft:SetParent(pfUI.bars.vertical)
|
||||
MultiBarLeft:ClearAllPoints()
|
||||
MultiBarLeft:SetAllPoints(pfUI.bars.vertical)
|
||||
|
||||
MultiBarLeftButton1:ClearAllPoints()
|
||||
MultiBarLeftButton1:SetPoint("TOPLEFT", pfUI.config.bars.border*2, -pfUI.config.bars.border*2)
|
||||
for i=2, 12 do
|
||||
local b = getglobal("MultiBarLeftButton"..i)
|
||||
local b2 = getglobal("MultiBarLeftButton"..i-1)
|
||||
b:ClearAllPoints()
|
||||
b:SetPoint("TOP", b2, "BOTTOM", 0, -pfUI.config.bars.border)
|
||||
end
|
||||
else
|
||||
pfUI.bars.vertical:Hide()
|
||||
end
|
||||
end)
|
||||
|
||||
-- create bottom bar frame
|
||||
pfUI.bars.bottom = CreateFrame("Frame", "pfBarBottom", UIParent)
|
||||
pfUI.bars.bottom:SetFrameStrata("LOW")
|
||||
pfUI.bars.bottom:SetPoint("BOTTOM", 0, 5)
|
||||
pfUI.bars.bottom:SetBackdrop(pfUI.backdrop)
|
||||
|
||||
ActionButton1:SetParent(pfUI.bars.bottom)
|
||||
ActionButton1:ClearAllPoints()
|
||||
ActionButton1:SetPoint("BOTTOMLEFT", pfUI.config.bars.border*2, pfUI.config.bars.border*2)
|
||||
for i=2, 12 do
|
||||
local b = getglobal("ActionButton"..i)
|
||||
local b2 = getglobal("ActionButton"..i-1)
|
||||
b:SetParent(pfUI.bars.bottom)
|
||||
b:ClearAllPoints()
|
||||
b:SetPoint("LEFT", b2, "RIGHT", pfUI.config.bars.border, 0)
|
||||
end
|
||||
|
||||
BonusActionBarFrame:SetParent(pfUI.bars.bottom)
|
||||
BonusActionBarFrame:ClearAllPoints()
|
||||
BonusActionBarFrame:SetAllPoints(pfUI.bars.bottom)
|
||||
|
||||
BonusActionButton1:ClearAllPoints()
|
||||
BonusActionButton1:SetPoint("BOTTOMLEFT", pfUI.config.bars.border*2 -4, pfUI.config.bars.border*2)
|
||||
for i=2, 12 do
|
||||
local b = getglobal("BonusActionButton"..i)
|
||||
local b2 = getglobal("BonusActionButton"..i-1)
|
||||
b:ClearAllPoints()
|
||||
b:SetPoint("LEFT", b2, "RIGHT", pfUI.config.bars.border, 0)
|
||||
end
|
||||
|
||||
for i = 1, 10 do
|
||||
getglobal("ShapeshiftButton"..i):SetBackdrop(pfUI.backdrop)
|
||||
getglobal("ShapeshiftButton"..i):SetBackdropColor(0,0,0,0)
|
||||
|
||||
getglobal("ShapeshiftButton"..i):SetWidth(pfUI.config.bars.icon_size)
|
||||
getglobal("ShapeshiftButton"..i):SetHeight(pfUI.config.bars.icon_size)
|
||||
getglobal("ShapeshiftButton"..i):Show()
|
||||
getglobal("ShapeshiftButton"..i).showgrid = 1
|
||||
getglobal("ShapeshiftButton"..i..'Icon'):SetAllPoints(getglobal("ShapeshiftButton"..i))
|
||||
getglobal("ShapeshiftButton"..i..'Border'):SetTexture(1,1,0,1)
|
||||
getglobal("ShapeshiftButton"..i..'NormalTexture'):SetAlpha(0)
|
||||
getglobal("ShapeshiftButton"..i..'NormalTexture'):SetPoint("TOPLEFT", getglobal("ShapeshiftButton"..i) ,"TOPLEFT", -5, 5)
|
||||
getglobal("ShapeshiftButton"..i..'NormalTexture'):SetPoint("BOTTOMRIGHT", getglobal("ShapeshiftButton"..i) ,"BOTTOMRIGHT", 5, -5)
|
||||
getglobal("ShapeshiftButton"..i..'Border'):SetPoint("TOPLEFT", getglobal("ShapeshiftButton"..i) ,"TOPLEFT", 1, -1)
|
||||
getglobal("ShapeshiftButton"..i..'Border'):SetPoint("BOTTOMRIGHT", getglobal("ShapeshiftButton"..i) ,"BOTTOMRIGHT", -1, 1)
|
||||
getglobal("ShapeshiftButton"..i..'HotKey'):SetPoint("TOPLEFT", getglobal("ShapeshiftButton"..i) ,"TOPLEFT", 1, -1)
|
||||
getglobal("ShapeshiftButton"..i..'HotKey'):SetPoint("BOTTOMRIGHT", getglobal("ShapeshiftButton"..i) ,"BOTTOMRIGHT", -1, 1)
|
||||
getglobal("ShapeshiftButton"..i..'HotKey'):SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 7, "OUTLINE")
|
||||
getglobal("ShapeshiftButton"..i..'HotKey'):SetJustifyH("RIGHT")
|
||||
getglobal("ShapeshiftButton"..i..'HotKey'):SetJustifyV("TOP")
|
||||
getglobal("ShapeshiftButton"..i..'Name'):SetPoint("TOPLEFT", getglobal("ShapeshiftButton"..i) ,"TOPLEFT", 1, -1)
|
||||
getglobal("ShapeshiftButton"..i..'Name'):SetPoint("BOTTOMRIGHT", getglobal("ShapeshiftButton"..i) ,"BOTTOMRIGHT", -1, 1)
|
||||
getglobal("ShapeshiftButton"..i..'Name'):SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 7, "OUTLINE")
|
||||
getglobal("ShapeshiftButton"..i..'Name'):SetJustifyH("CENTER")
|
||||
getglobal("ShapeshiftButton"..i..'Name'):SetJustifyV("BOTTOM")
|
||||
end
|
||||
|
||||
for i = 1, 10 do
|
||||
getglobal("PetActionButton"..i):SetBackdrop(pfUI.backdrop)
|
||||
getglobal("PetActionButton"..i):SetBackdropColor(0,0,0,0)
|
||||
getglobal("PetActionButton"..i):SetWidth(pfUI.config.bars.icon_size)
|
||||
getglobal("PetActionButton"..i):SetHeight(pfUI.config.bars.icon_size)
|
||||
getglobal("PetActionButton"..i):Show()
|
||||
getglobal("PetActionButton"..i).showgrid = 1
|
||||
getglobal("PetActionButton"..i..'AutoCast'):SetScale(.75)
|
||||
getglobal("PetActionButton"..i..'AutoCast'):SetAlpha(.50)
|
||||
|
||||
getglobal("PetActionButton"..i..'AutoCastable'):SetAlpha(0)
|
||||
--getglobal("PetActionButton"..i..'Cooldown'):SetScale(.75)
|
||||
|
||||
getglobal("PetActionButton"..i..'Icon'):SetAllPoints(getglobal("PetActionButton"..i))
|
||||
getglobal("PetActionButton"..i..'Border'):SetTexture(1,1,0,1)
|
||||
getglobal("PetActionButton"..i..'NormalTexture2'):SetAlpha(0)
|
||||
getglobal("PetActionButton"..i..'NormalTexture2'):SetPoint("TOPLEFT", getglobal("PetActionButton"..i) ,"TOPLEFT", -5, 5)
|
||||
getglobal("PetActionButton"..i..'NormalTexture2'):SetPoint("BOTTOMRIGHT", getglobal("PetActionButton"..i) ,"BOTTOMRIGHT", 5, -5)
|
||||
getglobal("PetActionButton"..i..'Border'):SetPoint("TOPLEFT", getglobal("PetActionButton"..i) ,"TOPLEFT", 1, -1)
|
||||
getglobal("PetActionButton"..i..'Border'):SetPoint("BOTTOMRIGHT", getglobal("PetActionButton"..i) ,"BOTTOMRIGHT", -1, 1)
|
||||
getglobal("PetActionButton"..i..'HotKey'):SetPoint("TOPLEFT", getglobal("PetActionButton"..i) ,"TOPLEFT", 1, -1)
|
||||
getglobal("PetActionButton"..i..'HotKey'):SetPoint("BOTTOMRIGHT", getglobal("PetActionButton"..i) ,"BOTTOMRIGHT", -1, 1)
|
||||
getglobal("PetActionButton"..i..'HotKey'):SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 7, "OUTLINE")
|
||||
getglobal("PetActionButton"..i..'HotKey'):SetJustifyH("RIGHT")
|
||||
getglobal("PetActionButton"..i..'HotKey'):SetJustifyV("TOP")
|
||||
getglobal("PetActionButton"..i..'Name'):SetPoint("TOPLEFT", getglobal("PetActionButton"..i) ,"TOPLEFT", 1, -1)
|
||||
getglobal("PetActionButton"..i..'Name'):SetPoint("BOTTOMRIGHT", getglobal("PetActionButton"..i) ,"BOTTOMRIGHT", -1, 1)
|
||||
getglobal("PetActionButton"..i..'Name'):SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 7, "OUTLINE")
|
||||
getglobal("PetActionButton"..i..'Name'):SetJustifyH("CENTER")
|
||||
getglobal("PetActionButton"..i..'Name'):SetJustifyV("BOTTOM")
|
||||
end
|
||||
|
||||
-- theme all actionbars (spacing, size, border, text position and style)
|
||||
local actionbars = { "ActionButton", "MultiBarLeftButton", "MultiBarRightButton",
|
||||
"MultiBarBottomLeftButton", "MultiBarBottomRightButton", "BonusActionButton", }
|
||||
|
||||
for i = 1, 12 do
|
||||
for _, button in pairs(actionbars) do
|
||||
getglobal(button..i..'NormalTexture'):SetAlpha(0)
|
||||
getglobal(button..i):SetBackdrop(pfUI.backdrop)
|
||||
getglobal(button..i):SetBackdropColor(0,0,0,0)
|
||||
|
||||
getglobal(button..i):SetWidth(pfUI.config.bars.icon_size)
|
||||
getglobal(button..i):SetHeight(pfUI.config.bars.icon_size)
|
||||
getglobal(button..i):Show()
|
||||
getglobal(button..i).showgrid = 1
|
||||
|
||||
--getglobal(button..i..'Icon'):SetTexCoord(.3,.7,.3,.7)
|
||||
--getglobal(button..i..'Cooldown'):SetScale(.75)
|
||||
getglobal(button..i..'Icon'):SetAllPoints(getglobal(button..i))
|
||||
getglobal(button..i..'Border'):SetTexture(1,1,0,1)
|
||||
getglobal(button..i..'NormalTexture'):SetPoint("TOPLEFT", getglobal(button..i) ,"TOPLEFT", -5, 5)
|
||||
getglobal(button..i..'NormalTexture'):SetPoint("BOTTOMRIGHT", getglobal(button..i) ,"BOTTOMRIGHT", 5, -5)
|
||||
getglobal(button..i..'Border'):SetPoint("TOPLEFT", getglobal(button..i) ,"TOPLEFT", 1, -1)
|
||||
getglobal(button..i..'Border'):SetPoint("BOTTOMRIGHT", getglobal(button..i) ,"BOTTOMRIGHT", -1, 1)
|
||||
getglobal(button..i..'HotKey'):SetPoint("TOPLEFT", getglobal(button..i) ,"TOPLEFT", 1, -1)
|
||||
getglobal(button..i..'HotKey'):SetPoint("BOTTOMRIGHT", getglobal(button..i) ,"BOTTOMRIGHT", -1, 1)
|
||||
getglobal(button..i..'HotKey'):SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 7, "OUTLINE")
|
||||
getglobal(button..i..'HotKey'):SetJustifyH("RIGHT")
|
||||
getglobal(button..i..'HotKey'):SetJustifyV("TOP")
|
||||
getglobal(button..i..'Name'):SetPoint("TOPLEFT", getglobal(button..i) ,"TOPLEFT", 1, -1)
|
||||
getglobal(button..i..'Name'):SetPoint("BOTTOMRIGHT", getglobal(button..i) ,"BOTTOMRIGHT", -1, 1)
|
||||
getglobal(button..i..'Name'):SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 7, "OUTLINE")
|
||||
getglobal(button..i..'Name'):SetJustifyH("CENTER")
|
||||
getglobal(button..i..'Name'):SetJustifyV("BOTTOM")
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,92 @@
|
||||
pfUI.autoshift = CreateFrame("Frame")
|
||||
pfUI.autoshift:RegisterEvent("UI_ERROR_MESSAGE")
|
||||
|
||||
pfUI.autoshift.LastErr = ""
|
||||
Hook_CastSpell = CastSpell
|
||||
Hook_CastSpellByName = CastSpellByName
|
||||
Hook_UseAction = UseAction
|
||||
|
||||
-- deDE
|
||||
pfUI.autoshift.wantBattleStance = "Muss in Kampfhaltung sein."
|
||||
pfUI.autoshift.wantBattleDefStance = "Muss in Kampfhaltung, Verteidigungshaltung sein."
|
||||
pfUI.autoshift.BattleStance = "Kampfhaltung"
|
||||
pfUI.autoshift.BattleStance = "Kampfhaltung"
|
||||
pfUI.autoshift.wantBerserkerStance = "Muss in Berserkerhaltung sein."
|
||||
pfUI.autoshift.BerserkerStance = "Berserkerhaltung"
|
||||
pfUI.autoshift.wantDefensiveStance = "Muss in Verteidigungshaltung sein."
|
||||
pfUI.autoshift.DefensiveStance = "Verteidigungshaltung"
|
||||
|
||||
function CastSpell(spellId, spellbookTabNum)
|
||||
if pfUI.autoshift.LastErr == pfUI.autoshift.wantBattleStance then
|
||||
Hook_CastSpellByName(pfUI.autoshift.BattleStance)
|
||||
elseif pfUI.autoshift.LastErr == pfUI.autoshift.wantBattleDefStance then
|
||||
Hook_CastSpellByName(pfUI.autoshift.BattleStance)
|
||||
elseif pfUI.autoshift.LastErr == pfUI.autoshift.wantBerserkerStance then
|
||||
Hook_CastSpellByName(pfUI.autoshift.BerserkerStance)
|
||||
elseif pfUI.autoshift.LastErr == pfUI.autoshift.wantDefensiveStance then
|
||||
Hook_CastSpellByName(pfUI.autoshift.DefensiveStance)
|
||||
end
|
||||
pfUI.autoshift.LastErr = ""
|
||||
|
||||
Hook_CastSpell(spellId, spellbookTabNum)
|
||||
end
|
||||
|
||||
function CastSpellByName(spellName, onSelf)
|
||||
if pfUI.autoshift.LastErr == pfUI.autoshift.wantBattleStance then
|
||||
Hook_CastSpellByName(pfUI.autoshift.BattleStance)
|
||||
elseif pfUI.autoshift.LastErr == pfUI.autoshift.wantBattleDefStance then
|
||||
Hook_CastSpellByName(pfUI.autoshift.BattleStance)
|
||||
elseif pfUI.autoshift.LastErr == pfUI.autoshift.wantBerserkerStance then
|
||||
Hook_CastSpellByName(pfUI.autoshift.BerserkerStance)
|
||||
elseif pfUI.autoshift.LastErr == pfUI.autoshift.wantDefensiveStance then
|
||||
Hook_CastSpellByName(pfUI.autoshift.DefensiveStance)
|
||||
end
|
||||
pfUI.autoshift.LastErr = ""
|
||||
|
||||
Hook_CastSpellByName(spellName, onSelf)
|
||||
end
|
||||
|
||||
function UseAction(slot, checkCursor, onSelf)
|
||||
if pfUI.autoshift.LastErr == pfUI.autoshift.wantBattleStance then
|
||||
Hook_CastSpellByName(pfUI.autoshift.BattleStance)
|
||||
elseif pfUI.autoshift.LastErr == pfUI.autoshift.wantBattleDefStance then
|
||||
Hook_CastSpellByName(pfUI.autoshift.BattleStance)
|
||||
elseif pfUI.autoshift.LastErr == pfUI.autoshift.wantBerserkerStance then
|
||||
Hook_CastSpellByName(pfUI.autoshift.BerserkerStance)
|
||||
elseif pfUI.autoshift.LastErr == pfUI.autoshift.wantDefensiveStance then
|
||||
Hook_CastSpellByName(pfUI.autoshift.DefensiveStance)
|
||||
end
|
||||
pfUI.autoshift.LastErr = ""
|
||||
|
||||
Hook_UseAction(slot, checkCursor, onSelf)
|
||||
end
|
||||
|
||||
pfUI.autoshift.Buffs = { "spell_nature_swiftness", "_mount_", "_qirajicrystal_",
|
||||
"ability_racial_bearform", "ability_druid_catform", "ability_druid_travelform",
|
||||
"spell_nature_forceofnature", "ability_druid_aquaticform", "spell_shadow_shadowform",
|
||||
"spell_nature_spiritwolf" }
|
||||
|
||||
pfUI.autoshift.Errors = { SPELL_FAILED_NOT_MOUNTED, ERR_ATTACK_MOUNTED, ERR_TAXIPLAYERALREADYMOUNTED,
|
||||
SPELL_FAILED_NOT_SHAPESHIFT, SPELL_FAILED_NO_ITEMS_WHILE_SHAPESHIFTED, SPELL_NOT_SHAPESHIFTED,
|
||||
SPELL_NOT_SHAPESHIFTED_NOSPACE, ERR_CANT_INTERACT_SHAPESHIFTED, ERR_NOT_WHILE_SHAPESHIFTED,
|
||||
ERR_NO_ITEMS_WHILE_SHAPESHIFTED, ERR_TAXIPLAYERSHAPESHIFTED,ERR_MOUNT_SHAPESHIFTED,
|
||||
ERR_EMBLEMERROR_NOTABARDGEOSET }
|
||||
|
||||
pfUI.autoshift:SetScript("OnEvent", function()
|
||||
pfUI.autoshift.LastErr = arg1
|
||||
|
||||
for id, errorstring in pairs(pfUI.autoshift.Errors) do
|
||||
if arg1 == errorstring then
|
||||
for i=0,15,1 do
|
||||
currBuffTex = GetPlayerBuffTexture(i);
|
||||
if (currBuffTex) then
|
||||
for id, bufftype in pairs(pfUI.autoshift.Buffs) do
|
||||
if string.find(string.lower(currBuffTex), bufftype) then
|
||||
CancelPlayerBuff(i);
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -0,0 +1,318 @@
|
||||
pfUI.bag = CreateFrame("Frame", "pfBagFrame")
|
||||
pfUI.bag:SetFrameStrata("MEDIUM")
|
||||
pfUI.bag:SetPoint("BOTTOMLEFT", pfUI.chat.right, "BOTTOMLEFT", 0, 0)
|
||||
pfUI.bag:SetPoint("BOTTOMRIGHT", pfUI.chat.right, "BOTTOMRIGHT", 0, 0)
|
||||
pfUI.bag:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.bag:Hide()
|
||||
|
||||
pfUI.bank = CreateFrame("Frame", "pfBankFrame")
|
||||
pfUI.bank:SetFrameStrata("MEDIUM")
|
||||
pfUI.bank:SetPoint("BOTTOMLEFT", pfUI.chat.left, "BOTTOMLEFT", 0, 0)
|
||||
pfUI.bank:SetPoint("BOTTOMRIGHT", pfUI.chat.left, "BOTTOMRIGHT", 0, 0)
|
||||
pfUI.bank:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.bank:Hide()
|
||||
|
||||
tinsert(UISpecialFrames,"pfBagFrame");
|
||||
|
||||
function OpenAllBags()
|
||||
if pfUI.bag:IsShown() then
|
||||
pfUI.bag:Hide()
|
||||
else
|
||||
pfUI.bag:Show()
|
||||
end
|
||||
end
|
||||
|
||||
function CloseAllBags()
|
||||
pfUI.bag:Hide()
|
||||
end
|
||||
|
||||
function ToggleBackpack()
|
||||
if pfUI.bag:IsShown() then
|
||||
pfUI.bag:Hide()
|
||||
else
|
||||
pfUI.bag:Show()
|
||||
end
|
||||
end
|
||||
|
||||
function ToggleBag() end
|
||||
|
||||
for i=1, 5 do
|
||||
pfUI.bag[i] = CreateFrame("Frame")
|
||||
pfUI.bag[i]:SetID(i-1)
|
||||
pfUI.bag[i]:SetParent(pfUI.bag)
|
||||
pfUI.bag[i]:SetAllPoints(pfUI.bag)
|
||||
end
|
||||
|
||||
for i=6, 12 do
|
||||
pfUI.bank[i] = CreateFrame("Frame")
|
||||
pfUI.bank[i]:SetID(i-1)
|
||||
pfUI.bank[i]:SetParent(pfUI.bank)
|
||||
pfUI.bank[i]:SetAllPoints(pfUI.bank)
|
||||
end
|
||||
|
||||
pfUI.bag.close = CreateFrame("Button")
|
||||
pfUI.bag.close:SetParent(pfUI.bag)
|
||||
pfUI.bag.close:SetPoint("TOPRIGHT", -pfUI.config.bars.border*2,-pfUI.config.bars.border*2 )
|
||||
pfUI.bag.close:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.bag.close:SetHeight(15)
|
||||
pfUI.bag.close:SetWidth(15)
|
||||
pfUI.bag.close:SetText("x")
|
||||
pfUI.bag.close:SetTextColor(1,.25,.25,1)
|
||||
pfUI.bag.close:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 10, "OUTLINE")
|
||||
pfUI.bag.close:SetScript("OnEnter", function ()
|
||||
pfUI.bag.close:SetBackdrop(pfUI.backdrop_col)
|
||||
pfUI.bag.close:SetBackdropBorderColor(1,.25,.25,1)
|
||||
end)
|
||||
|
||||
pfUI.bag.close:SetScript("OnLeave", function ()
|
||||
pfUI.bag.close:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.bag.close:SetBackdropBorderColor(1,1,1,1)
|
||||
end)
|
||||
|
||||
pfUI.bag.close:SetScript("OnClick", CloseAllBags)
|
||||
|
||||
pfUI.bag.search = CreateFrame("Frame", pfUI.bag)
|
||||
pfUI.bag.search:SetParent(pfUI.bag)
|
||||
pfUI.bag.search:SetHeight(15)
|
||||
pfUI.bag.search:SetWidth(100)
|
||||
pfUI.bag.search:SetPoint("TOPLEFT", pfUI.bag, "TOPLEFT", pfUI.config.bars.border*2, -pfUI.config.bars.border*2)
|
||||
pfUI.bag.search:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.bag.search:SetBackdropBorderColor(0,0,0,1)
|
||||
|
||||
pfUI.bag.search.edit = CreateFrame("EditBox", "pfUIBagSearch", pfUI.bag.search, "InputBoxTemplate")
|
||||
pfUIBagSearchLeft:SetTexture(nil);
|
||||
pfUIBagSearchMiddle:SetTexture(nil);
|
||||
pfUIBagSearchRight:SetTexture(nil);
|
||||
pfUI.bag.search.edit:ClearAllPoints()
|
||||
pfUI.bag.search.edit:SetScript("OnEditFocusGained", function()
|
||||
pfUI.bag.search.edit:SetTextColor(1,1,1,1)
|
||||
pfUI.bag.search:SetBackdropBorderColor(1,1,1,1)
|
||||
this:SetText("")
|
||||
|
||||
pfUI.bag.search:SetPoint("TOPLEFT", pfUI.bag, "TOPLEFT", pfUI.config.bars.border*2, -pfUI.config.bars.border*2)
|
||||
pfUI.bag.search:SetPoint("TOPRIGHT", pfUI.bag, "TOPRIGHT", -pfUI.config.bars.border*2 - 16, -pfUI.config.bars.border*2)
|
||||
|
||||
pfUI.bag.money:Hide()
|
||||
end)
|
||||
pfUI.bag.search.edit:SetScript("OnEditFocusLost", function()
|
||||
pfUI.bag.search.edit:SetTextColor(.5,.5,.5,1)
|
||||
pfUI.bag.search:SetBackdropBorderColor(0,0,0,1)
|
||||
this:SetText("Search")
|
||||
|
||||
pfUI.bag.search:ClearAllPoints()
|
||||
pfUI.bag.search:SetWidth(100)
|
||||
pfUI.bag.search:SetPoint("TOPLEFT", pfUI.bag, "TOPLEFT", pfUI.config.bars.border*2, -pfUI.config.bars.border*2)
|
||||
|
||||
for j=1, 12 do
|
||||
local frame, container = nil
|
||||
if j > 11 then
|
||||
frame = "BankFrame"
|
||||
container = -1
|
||||
else
|
||||
frame = "ContainerFrame" .. j
|
||||
container = j - 1
|
||||
end
|
||||
for i=1, GetContainerNumSlots(container) do
|
||||
getglobal(frame .. "Item" .. i):SetAlpha(1)
|
||||
end
|
||||
end
|
||||
|
||||
pfUI.bag.money:Show()
|
||||
end)
|
||||
|
||||
pfUI.bag.search.edit:SetPoint("TOPLEFT", pfUI.bag.search, "TOPLEFT", pfUI.config.bars.border*2, 0)
|
||||
pfUI.bag.search.edit:SetPoint("BOTTOMRIGHT", pfUI.bag.search, "BOTTOMRIGHT", -pfUI.config.bars.border*2, 0)
|
||||
|
||||
pfUI.bag.search.edit:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 10, "OUTLINE")
|
||||
pfUI.bag.search.edit:SetAutoFocus(false)
|
||||
pfUI.bag.search.edit:SetText("Search")
|
||||
pfUI.bag.search.edit:SetTextColor(.5,.5,.5,1)
|
||||
pfUI.bag.search.edit:SetScript("OnTextChanged", function(self)
|
||||
if pfUI.bag.search.edit:GetText() == "Search" then return end
|
||||
for j=1, 12 do
|
||||
|
||||
local frame, container = nil
|
||||
if j > 11 then
|
||||
frame = "BankFrame"
|
||||
container = -1
|
||||
else
|
||||
frame = "ContainerFrame" .. j
|
||||
container = j - 1
|
||||
end
|
||||
|
||||
for i=1, GetContainerNumSlots(container) do
|
||||
local texture, itemCount, locked, quality, readable = GetContainerItemInfo(container, i);
|
||||
if itemCount then
|
||||
local itemLink = GetContainerItemLink(container, i);
|
||||
local itemstring = string.sub(itemLink, string.find(itemLink, "%[")+1, string.find(itemLink, "%]")-1);
|
||||
if strfind(strlower(itemstring), strlower(pfUI.bag.search.edit:GetText())) then
|
||||
getglobal(frame .. "Item" .. i):SetAlpha(1)
|
||||
else
|
||||
getglobal(frame .. "Item" .. i):SetAlpha(.25)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
pfUI.bag.money = CreateFrame("Frame", "pfUIBagsMoney", pfUI.bag, "SmallMoneyFrameTemplate")
|
||||
pfUI.bag.money:ClearAllPoints()
|
||||
pfUI.bag.money:SetPoint("TOPRIGHT", pfUI.bag, "TOPRIGHT", -13, -6)
|
||||
pfUIBagsMoneyGoldButton:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 10, "OUTLINE")
|
||||
for i,v in ipairs({pfUIBagsMoneyGoldButton:GetRegions()}) do if i == 1 then v:SetHeight(10); v:SetWidth(10) end end
|
||||
pfUIBagsMoneySilverButton:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 10, "OUTLINE")
|
||||
for i,v in ipairs({pfUIBagsMoneySilverButton:GetRegions()}) do if i == 1 then v:SetHeight(10); v:SetWidth(10) end end
|
||||
pfUIBagsMoneyCopperButton:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 10, "OUTLINE")
|
||||
for i,v in ipairs({pfUIBagsMoneyCopperButton:GetRegions()}) do if i == 1 then v:SetHeight(10); v:SetWidth(10) end end
|
||||
|
||||
pfUI.bag:RegisterEvent("BAG_UPDATE");
|
||||
pfUI.bag:RegisterEvent("BAG_CLOSED");
|
||||
pfUI.bag:RegisterEvent("BAG_OPEN");
|
||||
pfUI.bag:RegisterEvent("BAG_UPDATE_COOLDOWN");
|
||||
pfUI.bag:RegisterEvent("ITEM_LOCK_CHANGED");
|
||||
pfUI.bag:RegisterEvent("UPDATE_INVENTORY_ALERTS")
|
||||
pfUI.bag:SetScript("OnEvent", function()
|
||||
local x = -1
|
||||
local y = 0
|
||||
local x_max = 10
|
||||
|
||||
local button_size = (this:GetWidth() - pfUI.config.bars.border*3) / x_max - pfUI.config.bars.border
|
||||
|
||||
for j=1, 5 do
|
||||
for i=1, GetContainerNumSlots(j-1) do
|
||||
x = x + 1
|
||||
if x >= x_max then y = y + 1; x = 0 end
|
||||
|
||||
getglobal("ContainerFrame" .. j).size = GetContainerNumSlots(j-1)
|
||||
f = getglobal("ContainerFrame" .. j .. "Item" .. i)
|
||||
f:SetParent(pfUI.bag[j])
|
||||
f:SetID(i)
|
||||
f:SetPoint("TOPLEFT", pfUI.bag, "TOPLEFT", pfUI.config.bars.border*2 + x*button_size + x*pfUI.config.bars.border, -pfUI.config.bars.border*2 - y*button_size - y * pfUI.config.bars.border - 17)
|
||||
f:Show()
|
||||
f:SetHeight(button_size)
|
||||
f:SetWidth(button_size)
|
||||
local texture, itemCount, locked, quality, readable = GetContainerItemInfo(j-1, i);
|
||||
f:SetNormalTexture(nil)
|
||||
|
||||
f:SetBackdrop(
|
||||
{ bgFile = texture, tile = false, tileSize = pfUI.config.unitframes.buff_size,
|
||||
edgeFile = "Interface\\AddOns\\pfUI\\img\\border_col", edgeSize = 8,
|
||||
insets = { left = 0, right = 0, top = 0, bottom = 0}
|
||||
})
|
||||
if quality and quality > 1 then
|
||||
f:SetBackdropBorderColor(GetItemQualityColor(quality))
|
||||
else
|
||||
f:SetBackdropBorderColor(.3,.3,.3,1)
|
||||
end
|
||||
|
||||
SetItemButtonCount(getglobal("ContainerFrame" .. j .. "Item" .. i), itemCount);
|
||||
if ( texture ) then
|
||||
local cooldown = getglobal(getglobal("ContainerFrame" .. j .. "Item" .. i):GetName().."Cooldown");
|
||||
local start, duration, enable = GetContainerItemCooldown(j-1, getglobal("ContainerFrame" .. j .. "Item" .. i):GetID());
|
||||
CooldownFrame_SetTimer(cooldown, start, duration, enable);
|
||||
if ( duration > 0 and enable == 0 ) then
|
||||
SetItemButtonTextureVertexColor(button, 0.4, 0.4, 0.4);
|
||||
end
|
||||
getglobal("ContainerFrame" .. j .. "Item" .. i .. "Cooldown"):Show();
|
||||
else
|
||||
getglobal("ContainerFrame" .. j .. "Item" .. i .. "Cooldown"):Hide();
|
||||
end
|
||||
|
||||
getglobal("ContainerFrame" .. j .. "Item" .. i .. "Count"):SetPoint("BOTTOMLEFT", 0,0)
|
||||
getglobal("ContainerFrame" .. j .. "Item" .. i .. "Count"):SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 9, "OUTLINE")
|
||||
|
||||
for i,v in ipairs({f:GetRegions()}) do
|
||||
-- 2 is stack count
|
||||
if i == 4 then v:SetAlpha(0) end
|
||||
end
|
||||
end
|
||||
end
|
||||
y = y + 1
|
||||
pfUI.bag:SetHeight( y * button_size + y * pfUI.config.bars.border + pfUI.config.bars.border*3 + 17 + 17)
|
||||
end)
|
||||
|
||||
pfUI.bank:RegisterEvent("BAG_UPDATE");
|
||||
pfUI.bank:RegisterEvent("BANKFRAME_OPENED");
|
||||
pfUI.bank:RegisterEvent("BANKFRAME_CLOSED");
|
||||
pfUI.bank:RegisterEvent("BAG_UPDATE_COOLDOWN");
|
||||
pfUI.bank:RegisterEvent("ITEM_LOCK_CHANGED");
|
||||
pfUI.bank:RegisterEvent("UPDATE_INVENTORY_ALERTS")
|
||||
pfUI.bank:RegisterEvent("BANKFRAME_OPENED");
|
||||
pfUI.bank:RegisterEvent("PLAYERBANKSLOTS_CHANGED");
|
||||
pfUI.bank:RegisterEvent("PLAYERBANKBAGSLOTS_CHANGED");
|
||||
pfUI.bank:SetScript("OnEvent", function()
|
||||
BankFrame:SetWidth(.1)
|
||||
BankFrame:SetHeight(.1)
|
||||
BankFrame:SetAlpha(0)
|
||||
|
||||
if event == "BANKFRAME_OPENED" then pfUI.bank:Show(); pfUI.bag:Show() end
|
||||
if event == "BANKFRAME_CLOSED" then pfUI.bank:Hide(); HideUIPanel(this) end
|
||||
|
||||
local x = -1
|
||||
local y = 0
|
||||
local x_max = 10
|
||||
|
||||
local button_size = (this:GetWidth() - pfUI.config.bars.border*3) / x_max - pfUI.config.bars.border
|
||||
|
||||
for j=5, 11 do
|
||||
local frame, container = nil
|
||||
if j == 5 then
|
||||
frame = "BankFrame"
|
||||
container = -1
|
||||
else
|
||||
frame = "ContainerFrame" .. j
|
||||
container = j - 1
|
||||
end
|
||||
|
||||
for i=1, GetContainerNumSlots(container) do
|
||||
x = x + 1
|
||||
if x >= x_max then y = y + 1; x = 0 end
|
||||
getglobal(frame).size = GetContainerNumSlots(j-1)
|
||||
f = getglobal(frame .. "Item" .. i)
|
||||
if j == 5 then f:SetParent(pfUI.bank[12]) else f:SetParent(pfUI.bank[j]) end
|
||||
f:Show()
|
||||
f:SetID(i)
|
||||
f:SetPoint("TOPLEFT", pfUI.bank, "TOPLEFT", pfUI.config.bars.border*2 + x*button_size + x*pfUI.config.bars.border, -pfUI.config.bars.border*2 - y*button_size - y * pfUI.config.bars.border)
|
||||
f:SetAlpha(1)
|
||||
f:SetHeight(button_size)
|
||||
f:SetWidth(button_size)
|
||||
local texture, itemCount, locked, quality, readable = GetContainerItemInfo(container, i);
|
||||
f:SetNormalTexture(nil)
|
||||
|
||||
f:SetBackdrop(
|
||||
{ bgFile = texture, tile = false, tileSize = pfUI.config.unitframes.buff_size,
|
||||
edgeFile = "Interface\\AddOns\\pfUI\\img\\border_col", edgeSize = 8,
|
||||
insets = { left = 0, right = 0, top = 0, bottom = 0}
|
||||
})
|
||||
if quality and quality > 1 then
|
||||
f:SetBackdropBorderColor(GetItemQualityColor(quality))
|
||||
else
|
||||
f:SetBackdropBorderColor(.3,.3,.3,1)
|
||||
end
|
||||
|
||||
SetItemButtonCount(getglobal(frame .. "Item" .. i), itemCount);
|
||||
if ( texture ) then
|
||||
local cooldown = getglobal(getglobal(frame .. "Item" .. i):GetName().."Cooldown");
|
||||
if cooldown then
|
||||
local start, duration, enable = GetContainerItemCooldown(container, getglobal(frame .. "Item" .. i):GetID());
|
||||
CooldownFrame_SetTimer(cooldown, start, duration, enable);
|
||||
if ( duration > 0 and enable == 0 ) then
|
||||
SetItemButtonTextureVertexColor(button, 0.4, 0.4, 0.4);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
getglobal(frame .. "Item" .. i .. "Count"):SetPoint("BOTTOMLEFT", 0,0)
|
||||
getglobal(frame .. "Item" .. i .. "Count"):SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 9, "OUTLINE")
|
||||
|
||||
for i,v in ipairs({f:GetRegions()}) do
|
||||
-- 2 is stack count
|
||||
if i == 4 then v:SetAlpha(0) end
|
||||
if j == 5 and i == 1 then v:SetAlpha(0) end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
y = y + 1
|
||||
pfUI.bank:SetHeight( y * button_size + y * pfUI.config.bars.border + pfUI.config.bars.border*3 + 17)
|
||||
end)
|
||||
@@ -0,0 +1,354 @@
|
||||
pfUI.chat = CreateFrame("Frame",nil,UIParent)
|
||||
|
||||
pfUI.chat.left = CreateFrame("Frame", "leftChat", UIParent)
|
||||
pfUI.chat.left:SetFrameStrata("BACKGROUND")
|
||||
pfUI.chat.left:SetWidth(350)
|
||||
pfUI.chat.left:SetHeight(150)
|
||||
pfUI.chat.left:SetPoint("BOTTOMLEFT", 5,5)
|
||||
pfUI.chat.left:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.chat.left:SetBackdropColor(0,0,0,.75)
|
||||
|
||||
pfUI.chat.left.panelTop = CreateFrame("Frame", "leftChatPanelTop", pfUI.chat.left)
|
||||
pfUI.chat.left.panelTop:ClearAllPoints()
|
||||
pfUI.chat.left.panelTop:SetHeight(19)
|
||||
pfUI.chat.left.panelTop:SetPoint("TOPLEFT", pfUI.chat.left, "TOPLEFT", 2, -2)
|
||||
pfUI.chat.left.panelTop:SetPoint("TOPRIGHT", pfUI.chat.left, "TOPRIGHT", -2, -2)
|
||||
pfUI.chat.left.panelTop:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.chat.left.panelTop:SetBackdropColor(0,0,0,.75)
|
||||
|
||||
pfUI.chat.right = CreateFrame("Frame", "leftChat", UIParent)
|
||||
pfUI.chat.right:SetFrameStrata("BACKGROUND")
|
||||
pfUI.chat.right:SetWidth(350)
|
||||
pfUI.chat.right:SetHeight(150)
|
||||
pfUI.chat.right:SetPoint("BOTTOMRIGHT", -5,5)
|
||||
pfUI.chat.right:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.chat.right:SetBackdropColor(0,0,0,.75)
|
||||
|
||||
pfUI.chat.right.panelTop = CreateFrame("Frame", "rightChatPanelTop", pfUI.chat.right)
|
||||
pfUI.chat.right.panelTop:ClearAllPoints()
|
||||
pfUI.chat.right.panelTop:SetHeight(19)
|
||||
pfUI.chat.right.panelTop:SetPoint("TOPLEFT", pfUI.chat.right, "TOPLEFT", 2, -2)
|
||||
pfUI.chat.right.panelTop:SetPoint("TOPRIGHT", pfUI.chat.right, "TOPRIGHT", -2, -2)
|
||||
pfUI.chat.right.panelTop:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.chat.right.panelTop:SetBackdropColor(0,0,0,.75)
|
||||
|
||||
pfUI.chat:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
pfUI.chat:RegisterEvent("UI_SCALE_CHANGED")
|
||||
pfUI.chat:RegisterEvent("FRIENDLIST_UPDATE")
|
||||
pfUI.chat:RegisterEvent("GUILD_ROSTER_UPDATE")
|
||||
pfUI.chat:RegisterEvent("RAID_ROSTER_UPDATE")
|
||||
pfUI.chat:RegisterEvent("PARTY_MEMBERS_CHANGED")
|
||||
pfUI.chat:RegisterEvent("PLAYER_TARGET_CHANGED")
|
||||
pfUI.chat:RegisterEvent("WHO_LIST_UPDATE")
|
||||
pfUI.chat:RegisterEvent("CHAT_MSG_SYSTEM")
|
||||
|
||||
pfUI.chat:SetScript("OnEvent", function()
|
||||
if event == "PLAYER_ENTERING_WORLD" or event == "UI_SCALE_CHANGED" then
|
||||
for i,v in ipairs({ChatFrameMenuButton:GetRegions()}) do
|
||||
v:SetAllPoints(ChatFrameMenuButton)
|
||||
local _, class = UnitClass("player")
|
||||
v:SetTexture(.5,.5,.5, 1)
|
||||
v:SetVertexColor(RAID_CLASS_COLORS[class].r + .3 * .5, RAID_CLASS_COLORS[class].g +.3 * .5, RAID_CLASS_COLORS[class].b +.3 * .5,1)
|
||||
end
|
||||
|
||||
pfUI.chat.setupPositions()
|
||||
pfUI.chat.setupChannels()
|
||||
|
||||
for i=1, NUM_CHAT_WINDOWS do
|
||||
for j,v in ipairs({getglobal("ChatFrame" .. i .. "Tab"):GetRegions()}) do
|
||||
if j==5 then v:SetTexture(0,0,0,0) end
|
||||
end
|
||||
|
||||
local _, relativeTo = getglobal("ChatFrame" .. i):GetPoint(1)
|
||||
getglobal("ChatFrame" .. i .. "Tab"):SetParent(pfUI.chat.left.panelTop)
|
||||
getglobal("ChatFrame" .. i .. "ResizeBottom"):Hide()
|
||||
|
||||
if relativeTo == pfUI.chat.left then
|
||||
getglobal("ChatFrame" .. i .. "Tab"):SetParent(pfUI.chat.left.panelTop)
|
||||
getglobal("ChatFrame" .. i):SetParent(pfUI.chat.left.panelTop)
|
||||
elseif relativeTo == pfUI.chat.right then
|
||||
getglobal("ChatFrame" .. i .. "Tab"):SetParent(pfUI.chat.right.panelTop)
|
||||
getglobal("ChatFrame" .. i):SetParent(pfUI.chat.right.panelTop)
|
||||
end
|
||||
|
||||
getglobal("ChatFrame" .. i .. "TabText"):SetJustifyV("TOP")
|
||||
getglobal("ChatFrame" .. i .. "TabLeft"):SetAlpha(0)
|
||||
getglobal("ChatFrame" .. i .. "TabMiddle"):SetAlpha(0)
|
||||
getglobal("ChatFrame" .. i .. "TabRight"):SetAlpha(0)
|
||||
getglobal("ChatFrame" .. i .. "TabFlash"):SetAlpha(0)
|
||||
local _, class = UnitClass("player")
|
||||
getglobal("ChatFrame" .. i .. "TabText"):SetTextColor(RAID_CLASS_COLORS[class].r + .3 * .5, RAID_CLASS_COLORS[class].g + .3 * .5, RAID_CLASS_COLORS[class].b + .3 * .5, 1)
|
||||
getglobal("ChatFrame" .. i .. "TabText"):SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 9, "OUTLINE")
|
||||
|
||||
if getglobal("ChatFrame" .. i).isDocked or getglobal("ChatFrame" .. i):IsVisible() then
|
||||
getglobal("ChatFrame" .. i .. "Tab"):Show()
|
||||
end
|
||||
|
||||
local cf = getglobal("ChatFrame" .. i)
|
||||
cf:EnableMouseWheel(true)
|
||||
cf:SetScript("OnMouseWheel", function()
|
||||
if (arg1 > 0) then
|
||||
if IsShiftKeyDown() then
|
||||
cf:ScrollToTop()
|
||||
else
|
||||
cf:ScrollUp()
|
||||
end
|
||||
elseif (arg1 < 0) then
|
||||
if IsShiftKeyDown() then
|
||||
cf:ScrollToBottom()
|
||||
else
|
||||
cf:ScrollDown()
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
elseif event == "FRIENDLIST_UPDATE" or event == "PLAYER_ENTERING_WORLD" then
|
||||
local Name, Class, Level
|
||||
for i = 1, GetNumFriends() do
|
||||
Name, Level, Class = GetFriendInfo(i)
|
||||
if pfLocaleClass[GetLocale()] and pfLocaleClass[GetLocale()][Class] then
|
||||
Class = pfLocaleClass[GetLocale()][Class]
|
||||
end
|
||||
pfUI.playerDB[Name] = { class = Class, level = Level }
|
||||
end
|
||||
elseif event == "GUILD_ROSTER_UPDATE" or event == "PLAYER_ENTERING_WORLD" then
|
||||
local Name, Class, Level
|
||||
for i = 1, GetNumGuildMembers() do
|
||||
Name, _, _, Level, Class = GetGuildRosterInfo(i)
|
||||
if pfLocaleClass[GetLocale()] and pfLocaleClass[GetLocale()][Class] then
|
||||
Class = pfLocaleClass[GetLocale()][Class]
|
||||
end
|
||||
pfUI.playerDB[Name] = { class = Class, level = Level }
|
||||
end
|
||||
|
||||
elseif event == "RAID_ROSTER_UPDATE" or event == "PLAYER_ENTERING_WORLD" then
|
||||
local Name, Class, SubGroup, Level
|
||||
for i = 1, GetNumRaidMembers() do
|
||||
Name, _, SubGroup, Level, Class = GetRaidRosterInfo(i)
|
||||
if pfLocaleClass[GetLocale()] and pfLocaleClass[GetLocale()].Class then
|
||||
Class = pfLocaleClass[GetLocale()][Class]
|
||||
end
|
||||
pfUI.playerDB[Name] = { class = Class, level = Level }
|
||||
end
|
||||
|
||||
elseif event == "PARTY_MEMBERS_CHANGED" or event == "PLAYER_ENTERING_WORLD" then
|
||||
local Class, Unit
|
||||
for i = 1, GetNumPartyMembers() do
|
||||
Unit = "party" .. i
|
||||
_, Class = UnitClass(Unit)
|
||||
pfUI.playerDB[UnitName(Unit)] = { class = Class, level = UnitLevel(Unit) }
|
||||
end
|
||||
|
||||
elseif event == "PLAYER_TARGET_CHANGED" then
|
||||
local Class
|
||||
if not UnitIsPlayer("target") or not UnitIsFriend("player", "target") then
|
||||
return
|
||||
end
|
||||
_, Class = UnitClass("target")
|
||||
pfUI.playerDB[UnitName("target")] = { class = Class, level = UnitLevel("target") }
|
||||
|
||||
elseif event == "WHO_LIST_UPDATE" or event == "CHAT_MSG_SYSTEM" then
|
||||
local Name, Class, Level
|
||||
for i = 1, GetNumWhoResults() do
|
||||
Name, _, Level, _, Class, _ = GetWhoInfo(i)
|
||||
if pfLocaleClass[GetLocale()] and pfLocaleClass[GetLocale()][Class] then
|
||||
Class = pfLocaleClass[GetLocale()][Class]
|
||||
end
|
||||
pfUI.playerDB[Name] = { class = Class, level = Level }
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
Hook_ChatFrame_OnUpdate = ChatFrame_OnUpdate
|
||||
function ChatFrame_OnUpdate (arg1)
|
||||
for i=1, NUM_CHAT_WINDOWS do
|
||||
getglobal("ChatFrame" .. i .. "UpButton"):Hide()
|
||||
getglobal("ChatFrame" .. i .. "DownButton"):Hide()
|
||||
getglobal("ChatFrame" .. i .. "BottomButton"):Hide()
|
||||
end
|
||||
Hook_ChatFrame_OnUpdate(arg1)
|
||||
end
|
||||
|
||||
pfUI.chat.setupPositions = function ()
|
||||
-- set position of Main Window
|
||||
ChatFrame1:ClearAllPoints()
|
||||
ChatFrame1:SetPoint("TOPLEFT", pfUI.chat.left ,"TOPLEFT", 5, -25)
|
||||
ChatFrame1:SetPoint("BOTTOMRIGHT", pfUI.chat.left ,"BOTTOMRIGHT", -5, 25)
|
||||
|
||||
FCF_SetLocked(ChatFrame1, 1)
|
||||
FCF_SetWindowColor(ChatFrame1, 0, 0, 0);
|
||||
FCF_SetWindowAlpha(ChatFrame1, 0);
|
||||
FCF_SetChatWindowFontSize(ChatFrame1, 12)
|
||||
-- set position of Loot & Spam
|
||||
if not ChatFrame3.isDocked == 1 or not ChatFrame3:IsShown() then
|
||||
FCF_OpenNewWindow("Loot & Spam")
|
||||
end
|
||||
|
||||
FCF_SetWindowColor(ChatFrame3, 0, 0, 0);
|
||||
FCF_SetWindowAlpha(ChatFrame3, 0);
|
||||
FCF_SetChatWindowFontSize(ChatFrame3, 12)
|
||||
FCF_SetWindowName(ChatFrame3, "Loot & Spam", 1 )
|
||||
FCF_UnDockFrame(ChatFrame3)
|
||||
ChatFrame3:ClearAllPoints()
|
||||
ChatFrame3:SetPoint("TOPLEFT", pfUI.chat.right ,"TOPLEFT", 5, -25)
|
||||
ChatFrame3:SetPoint("BOTTOMRIGHT", pfUI.chat.right ,"BOTTOMRIGHT", -5, 25)
|
||||
FCF_SetLocked(ChatFrame3, 1)
|
||||
-- save positions on logout
|
||||
ChatFrame1:SetUserPlaced(1);
|
||||
ChatFrame3:SetUserPlaced(1);
|
||||
end
|
||||
|
||||
pfUI.chat.setupChannels = function ()
|
||||
ChatFrame_RemoveAllMessageGroups(ChatFrame1)
|
||||
ChatFrame_RemoveAllMessageGroups(ChatFrame3)
|
||||
|
||||
local normalg = {"SAY", "EMOTE", "YELL", "GUILD", "OFFICER", "GUILD_ACHIEVEMENT", "WHISPER",
|
||||
"MONSTER_SAY", "MONSTER_EMOTE", "MONSTER_YELL", "MONSTER_WHISPER", "MONSTER_BOSS_EMOTE", "MONSTER_BOSS_WHISPER",
|
||||
"PARTY", "PARTY_LEADER", "RAID", "RAID_LEADER", "RAID_WARNING", "BATTLEGROUND", "BATTLEGROUND_LEADER",
|
||||
"BG_HORDE", "BG_ALLIANCE", "BG_NEUTRAL", "SYSTEM", "ERRORS", "AFK", "DND", "IGNORED", "BN_WHISPER", "BN_CONVERSATION"}
|
||||
for _,group in pairs(normalg) do
|
||||
ChatFrame_AddMessageGroup(ChatFrame1, group)
|
||||
end
|
||||
|
||||
local spamg = { "COMBAT_XP_GAIN", "COMBAT_HONOR_GAIN", "COMBAT_FACTION_CHANGE", "LOOT", "MONEY" }
|
||||
for _,group in pairs(spamg) do
|
||||
ChatFrame_AddMessageGroup(ChatFrame3, group)
|
||||
end
|
||||
|
||||
local spamc = { "Trade", "General", "LocalDefense", "GuildRecruitment", "LookingForGroup",
|
||||
"Handel", "Allgemein", "LokaleVerteidigung", "Gildenrekrutierung", "SucheNachGruppe", "World" }
|
||||
for _,channel in pairs(spamc) do
|
||||
ChatFrame_RemoveChannel(ChatFrame1, channel)
|
||||
ChatFrame_AddChannel(ChatFrame3, channel)
|
||||
end
|
||||
|
||||
JoinChannelByName("World")
|
||||
ChatFrame_AddChannel(ChatFrame3, "World")
|
||||
end
|
||||
|
||||
-- orig. function but removed flashing
|
||||
function FCF_OnUpdate(elapsed)
|
||||
-- Need to draw the dock regions for a frame to define their rects
|
||||
if ( not ChatFrame1.init ) then
|
||||
for i=1, NUM_CHAT_WINDOWS do
|
||||
getglobal("ChatFrame"..i.."TabDockRegion"):Show();
|
||||
FCF_UpdateButtonSide(getglobal("ChatFrame"..i));
|
||||
end
|
||||
ChatFrame1.init = 1;
|
||||
return;
|
||||
elseif ( ChatFrame1.init == 1 ) then
|
||||
for i=1, NUM_CHAT_WINDOWS do
|
||||
getglobal("ChatFrame"..i.."TabDockRegion"):Hide();
|
||||
end
|
||||
ChatFrame1.init = 2;
|
||||
end
|
||||
|
||||
-- Detect if mouse is over any chat frames and if so show their tabs, if not hide them
|
||||
local chatFrame, chatTab;
|
||||
|
||||
if ( MOVING_CHATFRAME ) then
|
||||
-- Set buttons to the left or right side of the frame
|
||||
-- If the the side of the buttons changes and the frame is the default frame, then set every docked frames buttons to the same side
|
||||
local updateAllButtons = nil;
|
||||
if (FCF_UpdateButtonSide(MOVING_CHATFRAME) and MOVING_CHATFRAME == DEFAULT_CHAT_FRAME ) then
|
||||
updateAllButtons = 1;
|
||||
end
|
||||
local dockRegion;
|
||||
for index, value in DOCKED_CHAT_FRAMES do
|
||||
if ( updateAllButtons ) then
|
||||
FCF_UpdateButtonSide(value);
|
||||
end
|
||||
|
||||
dockRegion = getglobal(value:GetName().."TabDockRegion");
|
||||
if ( MouseIsOver(dockRegion) and MOVING_CHATFRAME ~= DEFAULT_CHAT_FRAME ) then
|
||||
dockRegion:Show();
|
||||
else
|
||||
dockRegion:Hide();
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- If the default chat frame is resizing, then resize the dock
|
||||
if ( DEFAULT_CHAT_FRAME.resizing ) then
|
||||
FCF_DockUpdate();
|
||||
end
|
||||
end
|
||||
|
||||
ChatFrameMenuButton:SetNormalTexture("foo")
|
||||
ChatFrameMenuButton:ClearAllPoints()
|
||||
ChatFrameMenuButton:SetParent(pfUI.chat.left.panelTop)
|
||||
ChatFrameMenuButton:SetPoint("TOPRIGHT",-6,-6)
|
||||
ChatFrameMenuButton:SetHeight(6)
|
||||
ChatFrameMenuButton:SetWidth(6)
|
||||
|
||||
ChatFrameEditBox:ClearAllPoints()
|
||||
ChatFrameEditBox:SetHeight(22)
|
||||
ChatFrameEditBox:SetPoint("BOTTOMLEFT", pfUI.bars.bottom, "TOPLEFT", 0, 5)
|
||||
ChatFrameEditBox:SetPoint("BOTTOMRIGHT", pfUI.bars.bottom, "TOPRIGHT", 0, 5)
|
||||
|
||||
ChatFrameEditBox:SetBackdrop(pfUI.backdrop)
|
||||
|
||||
for i,v in ipairs({ChatFrameEditBox:GetRegions()}) do
|
||||
if i==6 or i==7 or i==8 then
|
||||
v:SetTexture(0,0,0,1)
|
||||
v:SetHeight(ChatFrameEditBox:GetHeight())
|
||||
end
|
||||
end
|
||||
ChatFrameEditBox:SetAltArrowKeyMode(false)
|
||||
|
||||
local shortnames = { channel1 = "[1]", channel2 = "[2]",
|
||||
channel3 = "[3]", channel4 = "[4]", channel5 = "[5]",
|
||||
channel6 = "[6]", channel7 = "[7]", channel8 = "[8]",
|
||||
channel9 = "[9]", channel10 = "[10]", }
|
||||
|
||||
local default = " " .. "%s" .. "|r:" .. "\32"
|
||||
CHAT_CHANNEL_GET = "%s" .. "|r:" .. "\32";
|
||||
CHAT_GUILD_GET = '[G]' .. default
|
||||
CHAT_OFFICER_GET = '[O]'.. default
|
||||
CHAT_PARTY_GET = '[P]' .. default
|
||||
CHAT_RAID_GET = '[R]' .. default
|
||||
CHAT_RAID_LEADER_GET = '[RL]' .. default
|
||||
CHAT_RAID_WARNING_GET = '[RW]' .. default
|
||||
CHAT_BATTLEGROUND_GET = '[BG]' .. default
|
||||
CHAT_BATTLEGROUND_LEADER_GET = '[BL]' .. default
|
||||
CHAT_SAY_GET = '[S]' .. default
|
||||
CHAT_WHISPER_GET = '|cffffaaff[W]' .. default
|
||||
CHAT_WHISPER_INFORM_GET = '[W]' .. default
|
||||
CHAT_YELL_GET = '[Y]' .. default
|
||||
|
||||
for i=1,NUM_CHAT_WINDOWS do
|
||||
local HookAddMessage = getglobal("ChatFrame"..i).AddMessage
|
||||
getglobal("ChatFrame"..i).AddMessage = function (frame, text, ...)
|
||||
if text then
|
||||
local Name = string.gsub(text, ".*|Hplayer:(.-)|h.*", "%1")
|
||||
if pfUI.playerDB[Name] and pfUI.playerDB[Name].class ~= nil then
|
||||
local Class = pfUI.playerDB[Name].class
|
||||
if RAID_CLASS_COLORS[Class] ~= nil then
|
||||
local Color = string.format("%02x%02x%02x",
|
||||
RAID_CLASS_COLORS[Class].r * 255,
|
||||
RAID_CLASS_COLORS[Class].g * 255,
|
||||
RAID_CLASS_COLORS[Class].b * 255)
|
||||
Name = "|cff" .. Color .. Name .. "|r"
|
||||
end
|
||||
end
|
||||
text = string.gsub(text, "|Hplayer:(.-)|h%[.-%]|h(.-:-)", "[|Hplayer:%1|h" .. Name .. "|h]" .. "%2")
|
||||
|
||||
-- make incoming whispers lighter than outgoing
|
||||
if string.find(text, '|cffffaaff') == 1 then
|
||||
text = string.gsub(text, "|r", "|cffffaaff")
|
||||
end
|
||||
|
||||
local pattern = "%]%s+(.*|Hplayer)"
|
||||
local channel = string.gsub(text, ".*%[(.-)" .. pattern ..".+", "%1")
|
||||
if string.find(channel, "%d+%. ") then
|
||||
channel = string.gsub(channel, "(%d+)%..*", "channel%1")
|
||||
channel = string.gsub(channel, "channel", "")
|
||||
pattern = "%[%d+%..-" .. pattern
|
||||
text = string.gsub(text, pattern, "["..channel.."]".."%1")
|
||||
end
|
||||
|
||||
HookAddMessage(frame, text, unpack(arg))
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,70 @@
|
||||
function CooldownFrame_SetTimer(this, start, duration, enable)
|
||||
if ( start > 0 and duration > 0 and enable > 0) then
|
||||
|
||||
this.start = start;
|
||||
this.duration = duration;
|
||||
this.stopping = 0;
|
||||
this:SetSequence(0);
|
||||
|
||||
if not this.cd then
|
||||
this.cd = CreateFrame("Frame")
|
||||
this.cd:SetAllPoints(this)
|
||||
this.cd:SetParent(this:GetParent())
|
||||
|
||||
this.cd.back = this.cd:CreateTexture(nil,"BACKGROUND")
|
||||
this.cd.back:SetTexture(0,0,0,1)
|
||||
this.cd.back:SetAlpha(.5)
|
||||
this.cd.back:SetAllPoints(this.cd)
|
||||
|
||||
this.cd.text = this.cd:CreateFontString("Status", "HIGH", "GameFontNormal")
|
||||
this.cd.text:SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 10, "OUTLINE")
|
||||
this.cd.text:ClearAllPoints()
|
||||
this.cd.text:SetParent(this.cd)
|
||||
this.cd.text:SetAllPoints(this.cd)
|
||||
this.cd.text:SetJustifyH("CENTER")
|
||||
this.cd.text:SetFontObject(GameFontWhite)
|
||||
end
|
||||
this:Show();
|
||||
else
|
||||
this:Hide()
|
||||
end
|
||||
|
||||
this:SetAlpha(0)
|
||||
end
|
||||
|
||||
function CooldownFrame_OnUpdateModel()
|
||||
if this.start and this.duration then
|
||||
local remaining = this.duration - (GetTime() - this.start)
|
||||
|
||||
-- disable GCD notify
|
||||
if ( remaining >= 1.5 ) then
|
||||
this.cd:Show()
|
||||
local unit = ""
|
||||
if remaining > 99 then
|
||||
remaining = remaining / 60
|
||||
unit = "m"
|
||||
end
|
||||
|
||||
if remaining > 99 then
|
||||
remaining = remaining / 60
|
||||
unit = "h"
|
||||
end
|
||||
|
||||
this.cd.text:SetText(floor(remaining)..unit)
|
||||
--elseif ( remaining >= .5 ) then
|
||||
-- this.cd:Show()
|
||||
-- this.cd.text:SetText("")
|
||||
else
|
||||
this:Hide();
|
||||
this.cd:Hide()
|
||||
this.stopping = 1;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function CooldownFrame_OnAnimFinished()
|
||||
if ( this.stopping == 1 ) then
|
||||
this:Hide();
|
||||
this.cd:Hide()
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,47 @@
|
||||
pfUI.font = CreateFrame("Frame",nil,UIParent)
|
||||
pfUI.font:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
pfUI.font:RegisterEvent("VARIABLES_LOADED")
|
||||
pfUI.font:RegisterEvent("ADDON_LOADED")
|
||||
|
||||
pfUI.font:SetScript("OnEvent", function()
|
||||
pfUI.font:loadFonts()
|
||||
end)
|
||||
|
||||
pfUI.font.loadFonts = function ()
|
||||
local font = "Interface\\AddOns\\pfUI\\fonts\\arial.ttf"
|
||||
local combat_font = "Interface\\AddOns\\pfUI\\fonts\\combat_font.ttf"
|
||||
|
||||
STANDARD_TEXT_FONT = font;
|
||||
UNIT_NAME_FONT = font;
|
||||
DAMAGE_TEXT_FONT = combat_font;
|
||||
NAMEPLATE_FONT = font;
|
||||
|
||||
SystemFont:SetFont(font, 15)
|
||||
GameFontNormal:SetFont(font, 12)
|
||||
GameFontBlack:SetFont(font, 12)
|
||||
GameFontNormalSmall:SetFont(font, 10)
|
||||
GameFontNormalLarge:SetFont(font, 16)
|
||||
GameFontNormalHuge:SetFont(font, 20)
|
||||
NumberFontNormal:SetFont(font, 14, "OUTLINE")
|
||||
NumberFontNormalSmall:SetFont(font, 14, "OUTLINE")
|
||||
NumberFontNormalLarge:SetFont(font, 16, "OUTLINE")
|
||||
NumberFontNormalHuge:SetFont(font, 30, "OUTLINE")
|
||||
QuestTitleFont:SetFont(font, 18)
|
||||
QuestFont:SetFont(font, 13)
|
||||
QuestFontHighlight:SetFont(font, 14)
|
||||
ItemTextFontNormal:SetFont(font, 15)
|
||||
MailTextFontNormal:SetFont(font, 15)
|
||||
SubSpellFont:SetFont(font, 10)
|
||||
DialogButtonNormalText:SetFont(font, 16)
|
||||
ZoneTextFont:SetFont(font, 48, "OUTLINE")
|
||||
SubZoneTextFont:SetFont(font, 24, "OUTLINE")
|
||||
TextStatusBarTextSmall:SetFont(font, 12, "NORMAL")
|
||||
GameTooltipText:SetFont(font, 12)
|
||||
GameTooltipTextSmall:SetFont(font, 10)
|
||||
GameTooltipHeaderText:SetFont(font, 14)
|
||||
WorldMapTextFont:SetFont(font, 102, "THICK")
|
||||
InvoiceTextFontNormal:SetFont(font, 12)
|
||||
InvoiceTextFontSmall:SetFont(font, 10)
|
||||
CombatTextFont:SetFont(font, 25)
|
||||
ChatFontNormal:SetFont(font, 12, "NORMAL")
|
||||
end
|
||||
@@ -0,0 +1,32 @@
|
||||
MinimapToggleButton:Hide()
|
||||
MinimapBorderTop:Hide()
|
||||
MinimapZoneTextButton:Hide()
|
||||
MinimapZoomIn:Hide()
|
||||
MinimapZoomOut:Hide()
|
||||
GameTimeFrame:Hide()
|
||||
|
||||
MinimapBorder:SetTexture(nil)
|
||||
Minimap:SetMaskTexture("Interface\\AddOns\\pfUI\\img\\minimap")
|
||||
|
||||
Minimap:EnableMouseWheel(true)
|
||||
Minimap:SetScript("OnMouseWheel", function()
|
||||
if(arg1 > 0) then Minimap_ZoomIn() else Minimap_ZoomOut() end
|
||||
end)
|
||||
|
||||
pfUI.minimap = CreateFrame("Frame",nil,UIParent)
|
||||
pfUI.minimap:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.minimap:SetBackdropColor(0,0,0,0)
|
||||
pfUI.minimap:SetPoint("TOPRIGHT", UIParent, -5, -5)
|
||||
pfUI.minimap:SetWidth(Minimap:GetWidth())
|
||||
pfUI.minimap:SetHeight(Minimap:GetHeight())
|
||||
pfUI.minimap:SetFrameStrata("BACKGROUND")
|
||||
pfUI.minimap.background = pfUI.minimap:CreateTexture(nil,"BACKGROUND")
|
||||
pfUI.minimap.background:SetTexture(0,0,0,1)
|
||||
pfUI.minimap.background:SetAllPoints(pfUI.minimap)
|
||||
|
||||
Minimap:SetParent(pfUI.minimap)
|
||||
Minimap:ClearAllPoints()
|
||||
Minimap:SetPoint("TOPLEFT", pfUI.minimap, "TOPLEFT", 3, -3)
|
||||
Minimap:SetPoint("BOTTOMRIGHT", pfUI.minimap, "BOTTOMRIGHT", -3, 3)
|
||||
|
||||
MiniMapTrackingFrame:SetFrameStrata("LOW")
|
||||
@@ -0,0 +1,129 @@
|
||||
pfUI.panel = CreateFrame("Frame",nil,UIParent)
|
||||
|
||||
pfUI.panel.left = CreateFrame("Frame", "leftChatPanelBottom", pfUI.panel)
|
||||
pfUI.panel.left:ClearAllPoints()
|
||||
pfUI.panel.left:SetHeight(19)
|
||||
pfUI.panel.left:SetPoint("BOTTOMLEFT", pfUI.chat.left, "BOTTOMLEFT", 2, 2)
|
||||
pfUI.panel.left:SetPoint("BOTTOMRIGHT", pfUI.chat.left, "BOTTOMRIGHT", -2, 2)
|
||||
pfUI.panel.left:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.panel.left:SetBackdropColor(0,0,0,.75)
|
||||
|
||||
pfUI.panel.left.hide = CreateFrame("Button", nil, pfUI.panel.left)
|
||||
pfUI.panel.left.hide:ClearAllPoints()
|
||||
pfUI.panel.left.hide:SetWidth(15)
|
||||
pfUI.panel.left.hide:SetHeight(pfUI.panel.left:GetHeight())
|
||||
pfUI.panel.left.hide:SetPoint("LEFT", 0, 0)
|
||||
pfUI.panel.left.hide:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.panel.left.hide.text = pfUI.panel.left.hide:CreateFontString("Status", "LOW", "GameFontNormal")
|
||||
pfUI.panel.left.hide.text:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 9, "OUTLINE")
|
||||
pfUI.panel.left.hide.text:ClearAllPoints()
|
||||
pfUI.panel.left.hide.text:SetAllPoints(pfUI.panel.left.hide)
|
||||
pfUI.panel.left.hide.text:SetPoint("LEFT", 0, 0)
|
||||
pfUI.panel.left.hide.text:SetFontObject(GameFontWhite)
|
||||
pfUI.panel.left.hide.text:SetText("< ")
|
||||
pfUI.panel.left.hide:SetScript("OnClick", function()
|
||||
if pfUI.chat.left:IsShown() then pfUI.chat.left:Hide() else pfUI.chat.left:Show() end
|
||||
end)
|
||||
|
||||
pfUI.panel.left.left = CreateFrame("Frame", nil, pfUI.panel.left)
|
||||
pfUI.panel.left.left:ClearAllPoints()
|
||||
pfUI.panel.left.left:SetWidth(115)
|
||||
pfUI.panel.left.left:SetHeight(pfUI.panel.left:GetHeight())
|
||||
pfUI.panel.left.left:SetPoint("LEFT", 0, 0)
|
||||
pfUI.panel.left.left.text = pfUI.panel.left.left:CreateFontString("Status", "LOW", "GameFontNormal")
|
||||
pfUI.panel.left.left.text:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 9, "OUTLINE")
|
||||
pfUI.panel.left.left.text:ClearAllPoints()
|
||||
pfUI.panel.left.left.text:SetAllPoints(pfUI.panel.left.left)
|
||||
pfUI.panel.left.left.text:SetPoint("CENTER", 0, 0)
|
||||
pfUI.panel.left.left.text:SetFontObject(GameFontWhite)
|
||||
pfUI.panel.left.left.text:SetText("[DUMMY]")
|
||||
|
||||
pfUI.panel.left.center = CreateFrame("Frame", nil, pfUI.panel.left)
|
||||
pfUI.panel.left.center:ClearAllPoints()
|
||||
pfUI.panel.left.center:SetWidth(115)
|
||||
pfUI.panel.left.center:SetHeight(pfUI.panel.left:GetHeight())
|
||||
pfUI.panel.left.center:SetPoint("CENTER", 0, 0)
|
||||
pfUI.panel.left.center.text = pfUI.panel.left.center:CreateFontString("Status", "LOW", "GameFontNormal")
|
||||
pfUI.panel.left.center.text:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 9, "OUTLINE")
|
||||
pfUI.panel.left.center.text:ClearAllPoints()
|
||||
pfUI.panel.left.center.text:SetAllPoints(pfUI.panel.left.center)
|
||||
pfUI.panel.left.center.text:SetPoint("CENTER", 0, 0)
|
||||
pfUI.panel.left.center.text:SetFontObject(GameFontWhite)
|
||||
pfUI.panel.left.center.text:SetText("[DUMMY]")
|
||||
|
||||
pfUI.panel.left.right = CreateFrame("Frame", nil, pfUI.panel.left)
|
||||
pfUI.panel.left.right:ClearAllPoints()
|
||||
pfUI.panel.left.right:SetWidth(115)
|
||||
pfUI.panel.left.right:SetHeight(pfUI.panel.left:GetHeight())
|
||||
pfUI.panel.left.right:SetPoint("RIGHT", 0, 0)
|
||||
pfUI.panel.left.right.text = pfUI.panel.left.right:CreateFontString("Status", "LOW", "GameFontNormal")
|
||||
pfUI.panel.left.right.text:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 9, "OUTLINE")
|
||||
pfUI.panel.left.right.text:ClearAllPoints()
|
||||
pfUI.panel.left.right.text:SetAllPoints(pfUI.panel.left.right)
|
||||
pfUI.panel.left.right.text:SetPoint("CENTER", 0, 0)
|
||||
pfUI.panel.left.right.text:SetFontObject(GameFontWhite)
|
||||
pfUI.panel.left.right.text:SetText("[DUMMY]")
|
||||
|
||||
pfUI.panel.right = CreateFrame("Frame", "rightChatPanelBottom", pfUI.panel)
|
||||
pfUI.panel.right:ClearAllPoints()
|
||||
pfUI.panel.right:SetHeight(19)
|
||||
pfUI.panel.right:SetPoint("BOTTOMLEFT", pfUI.chat.right, "BOTTOMLEFT", 2, 2)
|
||||
pfUI.panel.right:SetPoint("BOTTOMRIGHT", pfUI.chat.right, "BOTTOMRIGHT", -2, 2)
|
||||
pfUI.panel.right:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.panel.right:SetBackdropColor(0,0,0,.75)
|
||||
|
||||
pfUI.panel.right.hide = CreateFrame("Button", nil, pfUI.panel.right)
|
||||
pfUI.panel.right.hide:ClearAllPoints()
|
||||
pfUI.panel.right.hide:SetWidth(15)
|
||||
pfUI.panel.right.hide:SetHeight(pfUI.panel.right:GetHeight())
|
||||
pfUI.panel.right.hide:SetPoint("RIGHT", 0, 0)
|
||||
pfUI.panel.right.hide:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.panel.right.hide.text = pfUI.panel.right.hide:CreateFontString("Status", "LOW", "GameFontNormal")
|
||||
pfUI.panel.right.hide.text:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 9, "OUTLINE")
|
||||
pfUI.panel.right.hide.text:ClearAllPoints()
|
||||
pfUI.panel.right.hide.text:SetAllPoints(pfUI.panel.right.hide)
|
||||
pfUI.panel.right.hide.text:SetPoint("LEFT", 0, 0)
|
||||
pfUI.panel.right.hide.text:SetFontObject(GameFontWhite)
|
||||
pfUI.panel.right.hide.text:SetText(" >")
|
||||
pfUI.panel.right.hide:SetScript("OnClick", function()
|
||||
if pfUI.chat.right:IsShown() then pfUI.chat.right:Hide() else pfUI.chat.right:Show() end
|
||||
end)
|
||||
|
||||
pfUI.panel.right.left = CreateFrame("Frame", nil, pfUI.panel.right)
|
||||
pfUI.panel.right.left:ClearAllPoints()
|
||||
pfUI.panel.right.left:SetWidth(115)
|
||||
pfUI.panel.right.left:SetHeight(pfUI.panel.right:GetHeight())
|
||||
pfUI.panel.right.left:SetPoint("LEFT", 0, 0)
|
||||
pfUI.panel.right.left.text = pfUI.panel.right.left:CreateFontString("Status", "LOW", "GameFontNormal")
|
||||
pfUI.panel.right.left.text:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 9, "OUTLINE")
|
||||
pfUI.panel.right.left.text:ClearAllPoints()
|
||||
pfUI.panel.right.left.text:SetAllPoints(pfUI.panel.right.left)
|
||||
pfUI.panel.right.left.text:SetPoint("CENTER", 0, 0)
|
||||
pfUI.panel.right.left.text:SetFontObject(GameFontWhite)
|
||||
pfUI.panel.right.left.text:SetText("[DUMMY]")
|
||||
|
||||
pfUI.panel.right.center = CreateFrame("Frame", nil, pfUI.panel.right)
|
||||
pfUI.panel.right.center:ClearAllPoints()
|
||||
pfUI.panel.right.center:SetWidth(115)
|
||||
pfUI.panel.right.center:SetHeight(pfUI.panel.right:GetHeight())
|
||||
pfUI.panel.right.center:SetPoint("CENTER", 0, 0)
|
||||
pfUI.panel.right.center.text = pfUI.panel.right.center:CreateFontString("Status", "LOW", "GameFontNormal")
|
||||
pfUI.panel.right.center.text:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 9, "OUTLINE")
|
||||
pfUI.panel.right.center.text:ClearAllPoints()
|
||||
pfUI.panel.right.center.text:SetAllPoints(pfUI.panel.right.center)
|
||||
pfUI.panel.right.center.text:SetPoint("CENTER", 0, 0)
|
||||
pfUI.panel.right.center.text:SetFontObject(GameFontWhite)
|
||||
pfUI.panel.right.center.text:SetText("[DUMMY]")
|
||||
|
||||
pfUI.panel.right.right = CreateFrame("Frame", nil, pfUI.panel.right)
|
||||
pfUI.panel.right.right:ClearAllPoints()
|
||||
pfUI.panel.right.right:SetWidth(115)
|
||||
pfUI.panel.right.right:SetHeight(pfUI.panel.right:GetHeight())
|
||||
pfUI.panel.right.right:SetPoint("RIGHT", 0, 0)
|
||||
pfUI.panel.right.right.text = pfUI.panel.right.right:CreateFontString("Status", "LOW", "GameFontNormal")
|
||||
pfUI.panel.right.right.text:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 9, "OUTLINE")
|
||||
pfUI.panel.right.right.text:ClearAllPoints()
|
||||
pfUI.panel.right.right.text:SetAllPoints(pfUI.panel.right.right)
|
||||
pfUI.panel.right.right.text:SetPoint("CENTER", 0, 0)
|
||||
pfUI.panel.right.right.text:SetFontObject(GameFontWhite)
|
||||
pfUI.panel.right.right.text:SetText("[DUMMY]")
|
||||
+278
@@ -0,0 +1,278 @@
|
||||
pfUI.uf.pet = CreateFrame("Button",nil,UIParent)
|
||||
|
||||
pfUI.uf.pet:SetWidth(100)
|
||||
pfUI.uf.pet:SetHeight(23)
|
||||
pfUI.uf.pet:ClearAllPoints()
|
||||
pfUI.uf.pet:SetPoint("TOPLEFT", pfUI.uf.player.hp , "TOPRIGHT", 0, 0)
|
||||
pfUI.uf.pet:SetPoint("BOTTOMRIGHT", pfUI.uf.target.hp, "BOTTOMLEFT", 0, 0)
|
||||
|
||||
pfUI.uf.pet:RegisterForClicks('LeftButtonUp', 'RightButtonUp')
|
||||
pfUI.uf.pet:SetScript("OnClick", function ()
|
||||
TargetUnit("pet")
|
||||
end)
|
||||
|
||||
pfUI.uf.pet:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
pfUI.uf.pet:RegisterEvent("UNIT_PET")
|
||||
pfUI.uf.pet:RegisterEvent("UNIT_COMBAT");
|
||||
pfUI.uf.pet:RegisterEvent("UNIT_AURA");
|
||||
pfUI.uf.pet:RegisterEvent("PET_ATTACK_START");
|
||||
pfUI.uf.pet:RegisterEvent("PET_ATTACK_STOP");
|
||||
pfUI.uf.pet:RegisterEvent("UNIT_HAPPINESS");
|
||||
|
||||
pfUI.uf.pet:RegisterEvent("UNIT_HEALTH")
|
||||
pfUI.uf.pet:RegisterEvent("UNIT_MAXHEALTH")
|
||||
pfUI.uf.pet:RegisterEvent("UNIT_MANA")
|
||||
pfUI.uf.pet:RegisterEvent("UNIT_MAXMANA")
|
||||
pfUI.uf.pet:RegisterEvent("UNIT_RAGE")
|
||||
pfUI.uf.pet:RegisterEvent("UNIT_MAXRAGE")
|
||||
pfUI.uf.pet:RegisterEvent("UNIT_ENERGY")
|
||||
pfUI.uf.pet:RegisterEvent("UNIT_MAXENERGY")
|
||||
pfUI.uf.pet:RegisterEvent("UNIT_FOCUS")
|
||||
pfUI.uf.pet:RegisterEvent("UNIT_MAXFOCUS")
|
||||
|
||||
pfUI.uf.pet:SetScript("OnEvent", function(arg1)
|
||||
if UnitExists("pet") then pfUI.uf.pet:Show() else pfUI.uf.pet:Hide() end
|
||||
local hp, hpmax = UnitHealth("pet"), UnitHealthMax("pet")
|
||||
local power, powermax = UnitMana("pet"), UnitManaMax("pet")
|
||||
|
||||
local happiness = GetPetHappiness()
|
||||
if happiness == 1 then
|
||||
color = { r = 1, g = 0, b = 0 }
|
||||
elseif happiness == 2 then
|
||||
color = { r = 1, g = 1, b = 0 }
|
||||
else
|
||||
color = { r = 0, g = 1, b = 0 }
|
||||
end
|
||||
local r, g, b = (color.r + .5) * .5, (color.g + .5) * .5, (color.b + .5) * .5
|
||||
|
||||
pfUI.uf.pet.hp.bar:SetMinMaxValues(0, hpmax)
|
||||
pfUI.uf.pet.hp.bar:SetStatusBarColor(r, g, b, hp / hpmax / 4 + .75)
|
||||
pfUI.uf.pet.hp.text:SetTextColor(r+.3,g+.3,b+.3, 1)
|
||||
pfUI.uf.pet.hp.text:SetText(UnitName("pet"))
|
||||
|
||||
pfUI.uf.pet.hpReal = hp
|
||||
pfUI.uf.pet.powerReal = power
|
||||
|
||||
PowerColor = ManaBarColor[UnitPowerType("pet")];
|
||||
pfUI.uf.pet.power.bar:SetStatusBarColor(PowerColor.r + .5, PowerColor.g +.5, PowerColor.b +.5, 1)
|
||||
pfUI.uf.pet.power.bar:SetMinMaxValues(0, UnitManaMax("pet"))
|
||||
end)
|
||||
|
||||
pfUI.uf.pet:SetScript("OnUpdate", function()
|
||||
-- animation hp
|
||||
local hpDisplay = pfUI.uf.pet.hp.bar:GetValue()
|
||||
local hpReal = pfUI.uf.pet.hpReal
|
||||
local hpDiff = abs(hpReal - hpDisplay)
|
||||
|
||||
if hpDisplay < hpReal then
|
||||
pfUI.uf.pet.hp.bar:SetValue(hpDisplay + ceil(hpDiff / pfUI.config.unitframes.animation_speed))
|
||||
elseif hpDisplay > hpReal then
|
||||
pfUI.uf.pet.hp.bar:SetValue(hpDisplay - ceil(hpDiff / pfUI.config.unitframes.animation_speed))
|
||||
end
|
||||
|
||||
-- animation power
|
||||
local powerDisplay = pfUI.uf.pet.power.bar:GetValue()
|
||||
local powerReal = pfUI.uf.pet.powerReal
|
||||
local powerDiff = abs(powerReal - powerDisplay)
|
||||
|
||||
if powerDisplay < powerReal then
|
||||
pfUI.uf.pet.power.bar:SetValue(powerDisplay + ceil(powerDiff / pfUI.config.unitframes.animation_speed))
|
||||
elseif hpDisplay > hpReal then
|
||||
pfUI.uf.pet.power.bar:SetValue(powerDisplay - ceil(powerDiff / pfUI.config.unitframes.animation_speed))
|
||||
end
|
||||
end)
|
||||
|
||||
pfUI.uf.pet.hp = CreateFrame("Frame",nil, pfUI.uf.pet)
|
||||
pfUI.uf.pet.hp:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.uf.pet.hp:SetWidth(100)
|
||||
pfUI.uf.pet.hp:SetHeight(20)
|
||||
pfUI.uf.pet.hp:SetPoint("TOP",pfUI.uf.pet,"TOP")
|
||||
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:ClearAllPoints()
|
||||
pfUI.uf.pet.hp.bar:SetPoint("TOPLEFT", pfUI.uf.pet.hp, "TOPLEFT", 3, -3)
|
||||
pfUI.uf.pet.hp.bar:SetPoint("BOTTOMRIGHT", pfUI.uf.pet.hp, "BOTTOMRIGHT", -3, 3)
|
||||
pfUI.uf.pet.hp.bar:SetMinMaxValues(0, 100)
|
||||
pfUI.uf.pet.hp.bar:SetValue(100)
|
||||
|
||||
pfUI.uf.pet.power = CreateFrame("Frame",nil, pfUI.uf.pet)
|
||||
pfUI.uf.pet.power:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.uf.pet.power:SetWidth(100)
|
||||
pfUI.uf.pet.power:SetHeight(8)
|
||||
pfUI.uf.pet.power:SetPoint("TOPLEFT",pfUI.uf.pet.hp,"BOTTOMLEFT",0,3)
|
||||
pfUI.uf.pet.power.bar = CreateFrame("StatusBar", nil, pfUI.uf.pet.power)
|
||||
pfUI.uf.pet.power.bar:ClearAllPoints()
|
||||
pfUI.uf.pet.power.bar:SetPoint("TOPLEFT", pfUI.uf.pet.power, "TOPLEFT", 3, -3)
|
||||
pfUI.uf.pet.power.bar:SetPoint("BOTTOMRIGHT", pfUI.uf.pet.power, "BOTTOMRIGHT", -3, 3)
|
||||
pfUI.uf.pet.power.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
|
||||
pfUI.uf.pet.power.bar:SetBackdropColor(0,0,0,1)
|
||||
pfUI.uf.pet.power.bar:SetStatusBarColor(0,0,0)
|
||||
pfUI.uf.pet.power.bar:SetMinMaxValues(0, 100)
|
||||
pfUI.uf.pet.power.bar:SetValue(100)
|
||||
|
||||
pfUI.uf.pet.hp.text = pfUI.uf.pet.hp.bar:CreateFontString("Status", "LOW", "GameFontNormal")
|
||||
pfUI.uf.pet.hp.text:SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 8, "OUTLINE")
|
||||
pfUI.uf.pet.hp.text:ClearAllPoints()
|
||||
pfUI.uf.pet.hp.text:SetAllPoints(pfUI.uf.pet.hp.bar)
|
||||
pfUI.uf.pet.hp.text:SetPoint("CENTER", 0, 0)
|
||||
pfUI.uf.pet.hp.text:SetJustifyH("CENTER")
|
||||
pfUI.uf.pet.hp.text:SetFontObject(GameFontWhite)
|
||||
pfUI.uf.pet.hp.text:SetText("n/a")
|
||||
|
||||
pfUI.uf.pet.buff = CreateFrame("Frame", nil)
|
||||
pfUI.uf.pet.buff:RegisterEvent("PLAYER_AURAS_CHANGED")
|
||||
pfUI.uf.pet.buff:RegisterEvent("PLAYER_AURAS_CHANGED")
|
||||
pfUI.uf.pet.buff:RegisterEvent("PLAYER_TARGET_CHANGED")
|
||||
pfUI.uf.pet.buff:RegisterEvent("UNIT_AURA")
|
||||
pfUI.uf.pet.buff:SetScript("OnEvent", function()
|
||||
pfUI.uf.pet.buff.refreshBuffs()
|
||||
end)
|
||||
|
||||
pfUI.uf.pet.buff.buffs = {}
|
||||
for i=1, 16 do
|
||||
local id = i
|
||||
local row = 0
|
||||
if i <= 8 then row = 0 else row = 1 end
|
||||
local buffsize = pfUI.uf.pet.hp:GetWidth()/8 - 1
|
||||
|
||||
pfUI.uf.pet.buff.buffs[i] = CreateFrame("Button", "pfUITargetBuff" .. i, pfUI.uf.pet)
|
||||
pfUI.uf.pet.buff.buffs[i].stacks = pfUI.uf.pet.buff.buffs[i]:CreateFontString(nil, "OVERLAY", pfUI.uf.pet.buff.buffs[i])
|
||||
pfUI.uf.pet.buff.buffs[i].stacks:SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 10, "OUTLINE")
|
||||
pfUI.uf.pet.buff.buffs[i].stacks:SetPoint("BOTTOMRIGHT", pfUI.uf.pet.buff.buffs[i], 2, -2)
|
||||
pfUI.uf.pet.buff.buffs[i].stacks:SetJustifyH("LEFT")
|
||||
pfUI.uf.pet.buff.buffs[i].stacks:SetShadowColor(0, 0, 0)
|
||||
pfUI.uf.pet.buff.buffs[i].stacks:SetShadowOffset(0.8, -0.8)
|
||||
pfUI.uf.pet.buff.buffs[i].stacks:SetTextColor(1,1,.5)
|
||||
|
||||
pfUI.uf.pet.buff.buffs[i]:RegisterForClicks("RightButtonUp")
|
||||
pfUI.uf.pet.buff.buffs[i]:ClearAllPoints()
|
||||
pfUI.uf.pet.buff.buffs[i]:SetPoint("BOTTOMLEFT", pfUI.uf.pet.hp, "TOPLEFT", (i-8*row)*1 + (i-8*row)*buffsize - buffsize -1 , 1*row + buffsize*row +1)
|
||||
pfUI.uf.pet.buff.buffs[i]:SetWidth(buffsize)
|
||||
pfUI.uf.pet.buff.buffs[i]:SetHeight(buffsize)
|
||||
pfUI.uf.pet.buff.buffs[i]:SetNormalTexture(nil)
|
||||
pfUI.uf.pet.buff.buffs[i]:SetScript("OnEnter", function()
|
||||
GameTooltip:SetOwner(this, "ANCHOR_BOTTOMRIGHT")
|
||||
GameTooltip:SetUnitBuff("pet", id)
|
||||
end)
|
||||
|
||||
pfUI.uf.pet.buff.buffs[i]:SetScript("OnLeave", function()
|
||||
GameTooltip:Hide()
|
||||
end)
|
||||
end
|
||||
|
||||
pfUI.uf.pet.buff.refreshBuffs = function ()
|
||||
local buffsize = pfUI.uf.pet.hp:GetWidth()/8 - 1
|
||||
for i=1, 16 do
|
||||
local texture, stacks = UnitBuff("pet",i)
|
||||
pfUI.uf.pet.buff.buffs[i]:SetBackdrop(
|
||||
{ bgFile = texture, tile = false, tileSize = buffsize,
|
||||
edgeFile = "Interface\\AddOns\\pfUI\\img\\border", edgeSize = 8,
|
||||
insets = { left = 0, right = 0, top = 0, bottom = 0}
|
||||
})
|
||||
|
||||
if texture then
|
||||
pfUI.uf.pet.buff.buffs[i]:Show()
|
||||
if stacks > 1 then
|
||||
pfUI.uf.pet.buff.buffs[i].stacks:SetText(stacks)
|
||||
else
|
||||
pfUI.uf.pet.buff.buffs[i].stacks:SetText("")
|
||||
end
|
||||
else
|
||||
pfUI.uf.pet.buff.buffs[i]:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
pfUI.uf.pet.debuff = CreateFrame("Frame", nil)
|
||||
pfUI.uf.pet.debuff:RegisterEvent("PLAYER_AURAS_CHANGED")
|
||||
pfUI.uf.pet.debuff:RegisterEvent("PLAYER_TARGET_CHANGED")
|
||||
pfUI.uf.pet.debuff:RegisterEvent("UNIT_AURA")
|
||||
pfUI.uf.pet.debuff:SetScript("OnEvent", function()
|
||||
pfUI.uf.pet.debuff.refreshBuffs()
|
||||
end)
|
||||
|
||||
pfUI.uf.pet.debuff.debuffs = {}
|
||||
for i=1, 16 do
|
||||
local id = i
|
||||
pfUI.uf.pet.debuff.debuffs[i] = CreateFrame("Button", "pfUITargetDebuff" .. i, pfUI.uf.pet)
|
||||
pfUI.uf.pet.debuff.debuffs[i].stacks = pfUI.uf.pet.debuff.debuffs[i]:CreateFontString(nil, "OVERLAY", pfUI.uf.pet.debuff.debuffs[i])
|
||||
pfUI.uf.pet.debuff.debuffs[i].stacks:SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 10, "OUTLINE")
|
||||
pfUI.uf.pet.debuff.debuffs[i].stacks:SetPoint("BOTTOMRIGHT", pfUI.uf.pet.debuff.debuffs[i], 2, -2)
|
||||
pfUI.uf.pet.debuff.debuffs[i].stacks:SetJustifyH("LEFT")
|
||||
pfUI.uf.pet.debuff.debuffs[i].stacks:SetShadowColor(0, 0, 0)
|
||||
pfUI.uf.pet.debuff.debuffs[i].stacks:SetShadowOffset(0.8, -0.8)
|
||||
pfUI.uf.pet.debuff.debuffs[i].stacks:SetTextColor(1,1,.5)
|
||||
pfUI.uf.pet.debuff.debuffs[i]:RegisterForClicks("RightButtonUp")
|
||||
pfUI.uf.pet.debuff.debuffs[i]:ClearAllPoints()
|
||||
|
||||
local row = 0;
|
||||
local top = 0;
|
||||
local debuffsize = pfUI.uf.pet.hp:GetWidth()/8 - 1
|
||||
if i > 8 then row = 1 end
|
||||
if pfUI.uf.pet.buff.buffs[1]:IsShown() then top = top + 1 end
|
||||
if pfUI.uf.pet.buff.buffs[9]:IsShown() then top = top + 1 end
|
||||
|
||||
pfUI.uf.pet.debuff.debuffs[i]:SetPoint("BOTTOMLEFT", pfUI.uf.pet.hp, "TOPLEFT",
|
||||
(i-8*row)*1 + (i-8*row)*debuffsize - debuffsize -1 ,
|
||||
1*row + debuffsize*row +1 + (top*(debuffsize+1))
|
||||
)
|
||||
|
||||
pfUI.uf.pet.debuff.debuffs[i]:SetWidth(debuffsize)
|
||||
pfUI.uf.pet.debuff.debuffs[i]:SetHeight(debuffsize)
|
||||
pfUI.uf.pet.debuff.debuffs[i]:SetNormalTexture(nil)
|
||||
pfUI.uf.pet.debuff.debuffs[i]:SetScript("OnEnter", function()
|
||||
GameTooltip:SetOwner(this, "ANCHOR_BOTTOMRIGHT")
|
||||
GameTooltip:SetUnitDebuff("pet", id)
|
||||
end)
|
||||
pfUI.uf.pet.debuff.debuffs[i]:SetScript("OnLeave", function()
|
||||
GameTooltip:Hide()
|
||||
end)
|
||||
pfUI.uf.pet.debuff.debuffs[i]:SetScript("OnClick", function()
|
||||
CancelPlayerBuff(GetPlayerBuff(id-1,"HARMFUL"))
|
||||
end)
|
||||
end
|
||||
|
||||
pfUI.uf.pet.debuff.refreshBuffs = function ()
|
||||
local debuffsize = pfUI.uf.pet.hp:GetWidth()/8 - 1
|
||||
for i=1, 16 do
|
||||
local row = 0;
|
||||
local top = 0;
|
||||
if i > 8 then row = 1 end
|
||||
if pfUI.uf.pet.buff.buffs[1]:IsShown() then top = top + 1 end
|
||||
if pfUI.uf.pet.buff.buffs[9]:IsShown() then top = top + 1 end
|
||||
|
||||
pfUI.uf.pet.debuff.debuffs[i]:SetPoint("BOTTOMLEFT", pfUI.uf.pet.hp, "TOPLEFT",
|
||||
(i-8*row)*1 + (i-8*row)*debuffsize - debuffsize -1 ,
|
||||
1*row + debuffsize*row +1 + (top*(debuffsize+1))
|
||||
)
|
||||
local texture, stacks = UnitDebuff("pet",i)
|
||||
pfUI.uf.pet.debuff.debuffs[i]:SetBackdrop(
|
||||
{ bgFile = texture, tile = false, tileSize = debuffsize,
|
||||
edgeFile = "Interface\\AddOns\\pfUI\\img\\border_col", edgeSize = 8,
|
||||
insets = { left = 0, right = 0, top = 0, bottom = 0}
|
||||
})
|
||||
|
||||
local _,_,dtype = UnitDebuff("pet", i)
|
||||
if dtype == "Magic" then
|
||||
pfUI.uf.pet.debuff.debuffs[i]:SetBackdropBorderColor(0,1,1,1)
|
||||
elseif dtype == "Poison" then
|
||||
pfUI.uf.pet.debuff.debuffs[i]:SetBackdropBorderColor(0,1,0,1)
|
||||
elseif dtype == "Curse" then
|
||||
pfUI.uf.pet.debuff.debuffs[i]:SetBackdropBorderColor(1,0,1,1)
|
||||
else
|
||||
pfUI.uf.pet.debuff.debuffs[i]:SetBackdropBorderColor(1,0,0,1)
|
||||
end
|
||||
|
||||
if texture then
|
||||
pfUI.uf.pet.debuff.debuffs[i]:Show()
|
||||
if stacks > 1 then
|
||||
pfUI.uf.pet.debuff.debuffs[i].stacks:SetText(stacks)
|
||||
else
|
||||
pfUI.uf.pet.debuff.debuffs[i].stacks:SetText("")
|
||||
end
|
||||
else
|
||||
pfUI.uf.pet.debuff.debuffs[i]:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,361 @@
|
||||
PlayerFrame:Hide()
|
||||
PlayerFrame:UnregisterAllEvents()
|
||||
|
||||
pfUI.uf.player = CreateFrame("Button",nil,UIParent)
|
||||
pfUI.uf.player:SetWidth(pfUI.config.unitframes.width)
|
||||
pfUI.uf.player:SetHeight(pfUI.config.unitframes.height+pfUI.config.unitframes.pheight)
|
||||
pfUI.uf.player:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOM", -75, 125)
|
||||
pfUI.uf.player:RegisterForClicks('LeftButtonUp', 'RightButtonUp')
|
||||
pfUI.uf.player:SetScript("OnClick", function ()
|
||||
if arg1 == "RightButton" then
|
||||
ToggleDropDownMenu(1, nil, pfUI.uf.player.dropdown,"cursor")
|
||||
if UnitIsPartyLeader("player") then
|
||||
UIDropDownMenu_AddButton({text = "Reset Instances", func = ResetInstances, notCheckable = 1}, 1)
|
||||
end
|
||||
else
|
||||
TargetUnit("player")
|
||||
end
|
||||
end)
|
||||
|
||||
pfUI.uf.player.dropdown = getglobal("PlayerFrameDropDown")
|
||||
pfUI.uf.player.dropdowni = function()
|
||||
-- add reset button when alone
|
||||
if not (UnitInRaid("player") or GetNumPartyMembers() > 0) then
|
||||
UIDropDownMenu_AddButton({text = "Reset Instances", func = ResetInstances, notCheckable = 1}, 1)
|
||||
end
|
||||
UnitPopup_ShowMenu(pfUI.uf.player.dropdown, "SELF", "player")
|
||||
end
|
||||
UIDropDownMenu_Initialize(pfUI.uf.player.dropdown, pfUI.uf.player.dropdowni, "MENU")
|
||||
|
||||
pfUI.uf.player:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
pfUI.uf.player:RegisterEvent("UNIT_HEALTH")
|
||||
pfUI.uf.player:RegisterEvent("UNIT_MAXHEALTH")
|
||||
pfUI.uf.player:RegisterEvent("UNIT_DISPLAYPOWER")
|
||||
pfUI.uf.player:RegisterEvent("UNIT_MANA")
|
||||
pfUI.uf.player:RegisterEvent("UNIT_MAXMANA")
|
||||
pfUI.uf.player:RegisterEvent("UNIT_RAGE")
|
||||
pfUI.uf.player:RegisterEvent("UNIT_MAXRAGE")
|
||||
pfUI.uf.player:RegisterEvent("UNIT_ENERGY")
|
||||
pfUI.uf.player:RegisterEvent("UNIT_MAXENERGY")
|
||||
|
||||
pfUI.uf.player:SetScript("OnEvent", function()
|
||||
if event == "UNIT_DISPLAYPOWER" or event == "PLAYER_ENTERING_WORLD" then
|
||||
pfUI.uf.player.power.bar:SetValue(0)
|
||||
end
|
||||
|
||||
local hp, hpmax = UnitHealth("player"), UnitHealthMax("player")
|
||||
local power, powermax = UnitMana("player"), UnitManaMax("player")
|
||||
|
||||
local cr, cg, cb = pfUI.cache.class_r, pfUI.cache.class_g, pfUI.cache.class_b
|
||||
local perc = hp / hpmax
|
||||
|
||||
pfUI.uf.player.hp.bar:SetMinMaxValues(0, hpmax)
|
||||
pfUI.uf.player.hp.bar:SetStatusBarColor(cr, cg, cb, hp / hpmax / 4 + .75)
|
||||
|
||||
local r1, g1, b1, r2, g2, b2
|
||||
if perc <= 0.5 then
|
||||
perc = perc * 2; r1, g1, b1 = .9, .5, .5; r2, g2, b2 = .9, .9, .5
|
||||
else
|
||||
perc = perc * 2 - 1; r1, g1, b1 = .9, .9, .5; r2, g2, b2 = .5, .9, .5
|
||||
end
|
||||
local hr, hg, hb = r1 + (r2 - r1)*perc, g1 + (g2 - g1)*perc, b1 + (b2 - b1)*perc
|
||||
pfUI.uf.player.hpText:SetTextColor(hr, hg, hb,1)
|
||||
|
||||
if hp ~= hpmax then
|
||||
pfUI.uf.player.hpText:SetText(hp .. " - " .. ceil(hp / hpmax * 100) .. "%")
|
||||
else
|
||||
pfUI.uf.player.hpText:SetText(hp)
|
||||
end
|
||||
|
||||
PowerColor = ManaBarColor[UnitPowerType("player")];
|
||||
pfUI.uf.player.power.bar:SetStatusBarColor(PowerColor.r + .5, PowerColor.g +.5, PowerColor.b +.5, 1)
|
||||
pfUI.uf.player.power.bar:SetMinMaxValues(0, UnitManaMax("player"))
|
||||
|
||||
pfUI.uf.player.powerText:SetTextColor(PowerColor.r + .5, PowerColor.g +.5, PowerColor.b +.5,1)
|
||||
|
||||
pfUI.uf.player.powerText:SetText( UnitMana("player") )
|
||||
|
||||
pfUI.uf.player.hpReal = hp
|
||||
pfUI.uf.player.powerReal = power
|
||||
end)
|
||||
|
||||
pfUI.uf.player:SetScript("OnUpdate", function()
|
||||
local hpDisplay = pfUI.uf.player.hp.bar:GetValue()
|
||||
local hpReal = pfUI.uf.player.hpReal
|
||||
local hpDiff = abs(hpReal - hpDisplay)
|
||||
|
||||
if hpDisplay < hpReal then
|
||||
pfUI.uf.player.hp.bar:SetValue(hpDisplay + ceil(hpDiff / pfUI.config.unitframes.animation_speed))
|
||||
elseif hpDisplay > hpReal then
|
||||
pfUI.uf.player.hp.bar:SetValue(hpDisplay - ceil(hpDiff / pfUI.config.unitframes.animation_speed))
|
||||
end
|
||||
|
||||
local powerDisplay = pfUI.uf.player.power.bar:GetValue()
|
||||
local powerReal = pfUI.uf.player.powerReal
|
||||
local powerDiff = abs(powerReal - powerDisplay)
|
||||
|
||||
if powerDisplay < powerReal then
|
||||
pfUI.uf.player.power.bar:SetValue(powerDisplay + ceil(powerDiff / pfUI.config.unitframes.animation_speed))
|
||||
elseif powerDisplay > powerReal then
|
||||
pfUI.uf.player.power.bar:SetValue(powerDisplay - ceil(powerDiff / pfUI.config.unitframes.animation_speed))
|
||||
end
|
||||
end)
|
||||
|
||||
pfUI.uf.player.hp = CreateFrame("Frame",nil, pfUI.uf.player)
|
||||
pfUI.uf.player.hp:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.uf.player.hp:SetHeight(pfUI.config.unitframes.height)
|
||||
pfUI.uf.player.hp:SetPoint("TOPRIGHT",pfUI.uf.player,"TOPRIGHT")
|
||||
pfUI.uf.player.hp:SetPoint("TOPLEFT",pfUI.uf.player,"TOPLEFT")
|
||||
|
||||
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:ClearAllPoints()
|
||||
pfUI.uf.player.hp.bar:SetPoint("TOPLEFT", pfUI.uf.player.hp, "TOPLEFT", 3, -3)
|
||||
pfUI.uf.player.hp.bar:SetPoint("BOTTOMRIGHT", pfUI.uf.player.hp, "BOTTOMRIGHT", -3, 3)
|
||||
|
||||
pfUI.uf.player.hp.bar:SetMinMaxValues(0, 100)
|
||||
|
||||
pfUI.uf.player.hp.bar.portrait = CreateFrame("PlayerModel",nil,pfUI.uf.player.hp.bar)
|
||||
pfUI.uf.player.hp.bar.portrait:SetAllPoints(pfUI.uf.player.hp.bar)
|
||||
pfUI.uf.player.hp.bar.portrait:RegisterEvent("UNIT_PORTRAIT_UPDATE")
|
||||
pfUI.uf.player.hp.bar.portrait:RegisterEvent("UNIT_MODEL_CHANGED")
|
||||
pfUI.uf.player.hp.bar.portrait:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
pfUI.uf.player.hp.bar.portrait:SetScript("OnEvent", function() this.update() end)
|
||||
pfUI.uf.player.hp.bar.portrait:SetScript("OnShow", function() this.update() end)
|
||||
|
||||
pfUI.uf.player.hp.bar.portrait.update = function ()
|
||||
pfUI.uf.player.hp.bar.portrait:SetUnit("player");
|
||||
pfUI.uf.player.hp.bar.portrait:SetCamera(0)
|
||||
pfUI.uf.player.hp.bar.portrait:SetAlpha(0.10)
|
||||
end
|
||||
|
||||
pfUI.uf.player.power = CreateFrame("Frame",nil, pfUI.uf.player)
|
||||
pfUI.uf.player.power:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.uf.player.power:SetPoint("TOPLEFT",pfUI.uf.player.hp,"BOTTOMLEFT",0,3)
|
||||
pfUI.uf.player.power:SetPoint("BOTTOMRIGHT",pfUI.uf.player,"BOTTOMRIGHT",0,0)
|
||||
|
||||
pfUI.uf.player.power.bar = CreateFrame("StatusBar", nil, pfUI.uf.player.power)
|
||||
pfUI.uf.player.power.bar:ClearAllPoints()
|
||||
pfUI.uf.player.power.bar:SetPoint("TOPLEFT", pfUI.uf.player.power, "TOPLEFT", 3, -3)
|
||||
pfUI.uf.player.power.bar:SetPoint("BOTTOMRIGHT", pfUI.uf.player.power, "BOTTOMRIGHT", -3, 3)
|
||||
|
||||
pfUI.uf.player.power.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
|
||||
|
||||
pfUI.uf.player.power.bar:SetBackdropColor(0,0,0,1)
|
||||
pfUI.uf.player.power.bar:SetStatusBarColor(0,1,0)
|
||||
pfUI.uf.player.power.bar:SetMinMaxValues(0, 100)
|
||||
|
||||
pfUI.uf.player.hpText = pfUI.uf.player:CreateFontString("Status", "HIGH", "GameFontNormal")
|
||||
pfUI.uf.player.hpText:SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 10, "OUTLINE")
|
||||
pfUI.uf.player.hpText:ClearAllPoints()
|
||||
pfUI.uf.player.hpText:SetJustifyH("RIGHT")
|
||||
pfUI.uf.player.hpText:SetFontObject(GameFontWhite)
|
||||
pfUI.uf.player.hpText:SetText("5000")
|
||||
|
||||
pfUI.uf.player.powerText = pfUI.uf.player:CreateFontString("Status", "HIGH", "GameFontNormal")
|
||||
pfUI.uf.player.powerText:SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 10, "OUTLINE")
|
||||
pfUI.uf.player.powerText:ClearAllPoints()
|
||||
pfUI.uf.player.powerText:SetJustifyH("LEFT")
|
||||
pfUI.uf.player.powerText:SetFontObject(GameFontWhite)
|
||||
pfUI.uf.player.powerText:SetText("5000")
|
||||
|
||||
pfUI.uf.player.hpText:SetParent(pfUI.uf.player.hp.bar)
|
||||
pfUI.uf.player.hpText:SetPoint("RIGHT",pfUI.uf.player.hp.bar, "RIGHT", -10, 0)
|
||||
pfUI.uf.player.powerText:SetParent(pfUI.uf.player.hp.bar)
|
||||
pfUI.uf.player.powerText:SetPoint("LEFT",pfUI.uf.player.hp.bar, "LEFT", 10, 0)
|
||||
|
||||
pfUI.uf.player.buff = CreateFrame("Frame", nil)
|
||||
pfUI.uf.player.buff:RegisterEvent("PLAYER_AURAS_CHANGED")
|
||||
pfUI.uf.player.buff:SetScript("OnEvent", function()
|
||||
pfUI.uf.player.buff.refreshBuffs()
|
||||
end)
|
||||
|
||||
pfUI.uf.player.buff.buffs = {}
|
||||
for i=1, 16 do
|
||||
local id = i
|
||||
local row = 0
|
||||
if i <= 8 then row = 0 else row = 1 end
|
||||
|
||||
pfUI.uf.player.buff.buffs[i] = CreateFrame("Button", "pfUIPlayerBuff" .. i, pfUI.uf.player)
|
||||
pfUI.uf.player.buff.buffs[i].stacks = pfUI.uf.player.buff.buffs[i]:CreateFontString(nil, "OVERLAY", pfUI.uf.player.buff.buffs[i])
|
||||
pfUI.uf.player.buff.buffs[i].stacks:SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 10, "OUTLINE")
|
||||
pfUI.uf.player.buff.buffs[i].stacks:SetPoint("BOTTOMRIGHT", pfUI.uf.player.buff.buffs[i], 2, -2)
|
||||
pfUI.uf.player.buff.buffs[i].stacks:SetJustifyH("LEFT")
|
||||
pfUI.uf.player.buff.buffs[i].stacks:SetShadowColor(0, 0, 0)
|
||||
pfUI.uf.player.buff.buffs[i].stacks:SetShadowOffset(0.8, -0.8)
|
||||
pfUI.uf.player.buff.buffs[i].stacks:SetTextColor(1,1,.5)
|
||||
pfUI.uf.player.buff.buffs[i].cd = pfUI.uf.player.buff.buffs[i]:CreateFontString(nil, "OVERLAY", pfUI.uf.player.buff.buffs[i])
|
||||
pfUI.uf.player.buff.buffs[i].cd:SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 10, "OUTLINE")
|
||||
pfUI.uf.player.buff.buffs[i].cd:SetPoint("CENTER", pfUI.uf.player.buff.buffs[i], 0, 0)
|
||||
pfUI.uf.player.buff.buffs[i].cd:SetJustifyH("LEFT")
|
||||
pfUI.uf.player.buff.buffs[i].cd:SetShadowColor(0, 0, 0)
|
||||
pfUI.uf.player.buff.buffs[i].cd:SetShadowOffset(0.8, -0.8)
|
||||
pfUI.uf.player.buff.buffs[i].cd:SetTextColor(1,1,1)
|
||||
|
||||
pfUI.uf.player.buff.buffs[i]:RegisterForClicks("RightButtonUp")
|
||||
pfUI.uf.player.buff.buffs[i]:ClearAllPoints()
|
||||
pfUI.uf.player.buff.buffs[i]:SetPoint("BOTTOMLEFT", pfUI.uf.player, "TOPLEFT", (i-8*row)*1 + (i-8*row)*pfUI.config.unitframes.buff_size - pfUI.config.unitframes.buff_size -1 , 1*row + pfUI.config.unitframes.buff_size*row +1)
|
||||
pfUI.uf.player.buff.buffs[i]:SetWidth(pfUI.config.unitframes.buff_size)
|
||||
pfUI.uf.player.buff.buffs[i]:SetHeight(pfUI.config.unitframes.buff_size)
|
||||
pfUI.uf.player.buff.buffs[i]:SetNormalTexture(nil)
|
||||
pfUI.uf.player.buff.buffs[i]:SetScript("OnEnter", function()
|
||||
GameTooltip:SetOwner(this, "ANCHOR_BOTTOMRIGHT")
|
||||
GameTooltip:SetPlayerBuff(GetPlayerBuff(id-1,"HELPFUL"))
|
||||
end)
|
||||
|
||||
pfUI.uf.player.buff.buffs[i]:SetScript("OnLeave", function()
|
||||
GameTooltip:Hide()
|
||||
end)
|
||||
|
||||
pfUI.uf.player.buff.buffs[i]:SetScript("OnClick", function()
|
||||
CancelPlayerBuff(GetPlayerBuff(id-1,"HELPFUL"))
|
||||
end)
|
||||
pfUI.uf.player.buff.buffs[i]:SetScript("OnUpdate", function()
|
||||
for i=1, 16 do
|
||||
local timeleft = GetPlayerBuffTimeLeft(GetPlayerBuff(i-1,"HELPFUL"))
|
||||
if timeleft ~= nil and timeleft < 99 and timeleft ~= 0 then
|
||||
pfUI.uf.player.buff.buffs[i].cd:SetText(ceil(timeleft))
|
||||
else
|
||||
pfUI.uf.player.buff.buffs[i].cd:SetText("")
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
pfUI.uf.player.buff.refreshBuffs = function ()
|
||||
for i=1, 16 do
|
||||
local stacks = GetPlayerBuffApplications(GetPlayerBuff(i-1,"HELPFUL"))
|
||||
pfUI.uf.player.buff.buffs[i]:SetBackdrop(
|
||||
{ bgFile = GetPlayerBuffTexture(GetPlayerBuff(i-1,"HELPFUL")), tile = false, tileSize = pfUI.config.unitframes.buff_size,
|
||||
edgeFile = "Interface\\AddOns\\pfUI\\img\\border", edgeSize = 8,
|
||||
insets = { left = 0, right = 0, top = 0, bottom = 0}
|
||||
})
|
||||
|
||||
if GetPlayerBuffTexture(GetPlayerBuff(i-1,"HELPFUL")) then
|
||||
pfUI.uf.player.buff.buffs[i]:Show()
|
||||
local stacks = GetPlayerBuffApplications(GetPlayerBuff(i-1,"HELPFUL"))
|
||||
if stacks > 1 then
|
||||
pfUI.uf.player.buff.buffs[i].stacks:SetText(stacks)
|
||||
else
|
||||
pfUI.uf.player.buff.buffs[i].stacks:SetText("")
|
||||
end
|
||||
else
|
||||
pfUI.uf.player.buff.buffs[i]:Hide()
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
pfUI.uf.player.debuff = CreateFrame("Frame", nil)
|
||||
pfUI.uf.player.debuff:RegisterEvent("PLAYER_AURAS_CHANGED")
|
||||
pfUI.uf.player.debuff:SetScript("OnEvent", function()
|
||||
pfUI.uf.player.debuff.refreshBuffs()
|
||||
end)
|
||||
|
||||
pfUI.uf.player.debuff.debuffs = {}
|
||||
for i=1, 16 do
|
||||
local id = i
|
||||
pfUI.uf.player.debuff.debuffs[i] = CreateFrame("Button", "pfUIPlayerDebuff" .. i, pfUI.uf.player)
|
||||
pfUI.uf.player.debuff.debuffs[i].stacks = pfUI.uf.player.debuff.debuffs[i]:CreateFontString(nil, "OVERLAY", pfUI.uf.player.debuff.debuffs[i])
|
||||
pfUI.uf.player.debuff.debuffs[i].stacks:SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 10, "OUTLINE")
|
||||
pfUI.uf.player.debuff.debuffs[i].stacks:SetPoint("BOTTOMRIGHT", pfUI.uf.player.debuff.debuffs[i], 2, -2)
|
||||
pfUI.uf.player.debuff.debuffs[i].stacks:SetJustifyH("LEFT")
|
||||
pfUI.uf.player.debuff.debuffs[i].stacks:SetShadowColor(0, 0, 0)
|
||||
pfUI.uf.player.debuff.debuffs[i].stacks:SetShadowOffset(0.8, -0.8)
|
||||
pfUI.uf.player.debuff.debuffs[i].stacks:SetTextColor(1,1,.5)
|
||||
pfUI.uf.player.debuff.debuffs[i].cd = pfUI.uf.player.debuff.debuffs[i]:CreateFontString(nil, "OVERLAY", pfUI.uf.player.debuff.debuffs[i])
|
||||
pfUI.uf.player.debuff.debuffs[i].cd:SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 10, "OUTLINE")
|
||||
pfUI.uf.player.debuff.debuffs[i].cd:SetPoint("CENTER", pfUI.uf.player.debuff.debuffs[i], 0, 0)
|
||||
pfUI.uf.player.debuff.debuffs[i].cd:SetJustifyH("LEFT")
|
||||
pfUI.uf.player.debuff.debuffs[i].cd:SetShadowColor(0, 0, 0)
|
||||
pfUI.uf.player.debuff.debuffs[i].cd:SetShadowOffset(0.8, -0.8)
|
||||
pfUI.uf.player.debuff.debuffs[i].cd:SetTextColor(1,1,1)
|
||||
|
||||
pfUI.uf.player.debuff.debuffs[i]:RegisterForClicks("RightButtonUp")
|
||||
pfUI.uf.player.debuff.debuffs[i]:ClearAllPoints()
|
||||
|
||||
local row = 0;
|
||||
local top = 0;
|
||||
if i > 8 then row = 1 end
|
||||
if pfUI.uf.player.buff.buffs[1]:IsShown() then top = top + 1 end
|
||||
if pfUI.uf.player.buff.buffs[9]:IsShown() then top = top + 1 end
|
||||
|
||||
pfUI.uf.player.debuff.debuffs[i]:SetPoint("BOTTOMLEFT", pfUI.uf.player, "TOPLEFT", (i-8*row)*1 + (i-8*row)*pfUI.config.unitframes.debuff_size - pfUI.config.unitframes.debuff_size -1 , 1*row + pfUI.config.unitframes.debuff_size*row +1)
|
||||
|
||||
pfUI.uf.player.debuff.debuffs[i]:SetWidth(pfUI.config.unitframes.debuff_size)
|
||||
pfUI.uf.player.debuff.debuffs[i]:SetHeight(pfUI.config.unitframes.debuff_size)
|
||||
pfUI.uf.player.debuff.debuffs[i]:SetNormalTexture(nil)
|
||||
pfUI.uf.player.debuff.debuffs[i]:SetScript("OnEnter", function()
|
||||
GameTooltip:SetOwner(this, "ANCHOR_BOTTOMRIGHT")
|
||||
GameTooltip:SetPlayerBuff(GetPlayerBuff(id-1,"HARMFUL"))
|
||||
end)
|
||||
|
||||
pfUI.uf.player.debuff.debuffs[i]:SetScript("OnLeave", function()
|
||||
GameTooltip:Hide()
|
||||
end)
|
||||
|
||||
pfUI.uf.player.debuff.debuffs[i]:SetScript("OnClick", function()
|
||||
CancelPlayerBuff(GetPlayerBuff(id-1,"HARMFUL"))
|
||||
end)
|
||||
pfUI.uf.player.debuff.debuffs[i]:SetScript("OnUpdate", function()
|
||||
for i=1, 16 do
|
||||
local timeleft = GetPlayerBuffTimeLeft(GetPlayerBuff(i-1,"HARMFUL"))
|
||||
if timeleft ~= nil and timeleft < 99 and timeleft ~= 0 then
|
||||
pfUI.uf.player.debuff.debuffs[i].cd:SetText(ceil(timeleft))
|
||||
else
|
||||
pfUI.uf.player.debuff.debuffs[i].cd:SetText("")
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
pfUI.uf.player.debuff.refreshBuffs = function ()
|
||||
for i=1, 16 do
|
||||
local row = 0;
|
||||
local top = 0;
|
||||
if i > 8 then row = 1 end
|
||||
if pfUI.uf.player.buff.buffs[1]:IsShown() then top = top + 1 end
|
||||
if pfUI.uf.player.buff.buffs[9]:IsShown() then top = top + 1 end
|
||||
|
||||
pfUI.uf.player.debuff.debuffs[i]:SetPoint("BOTTOMLEFT", pfUI.uf.player, "TOPLEFT",
|
||||
(i-8*row)*1 + (i-8*row)*pfUI.config.unitframes.debuff_size - pfUI.config.unitframes.debuff_size -1 ,
|
||||
1*row + pfUI.config.unitframes.debuff_size*row +1 + (top*(pfUI.config.unitframes.debuff_size+1))
|
||||
)
|
||||
|
||||
local stacks = GetPlayerBuffApplications(GetPlayerBuff(i-1,"HARMFUL"))
|
||||
pfUI.uf.player.debuff.debuffs[i]:SetBackdrop(
|
||||
{ bgFile = GetPlayerBuffTexture(GetPlayerBuff(i-1,"HARMFUL")), tile = false, tileSize = pfUI.config.unitframes.debuff_size,
|
||||
edgeFile = "Interface\\AddOns\\pfUI\\img\\border_col", edgeSize = 8,
|
||||
insets = { left = 0, right = 0, top = 0, bottom = 0}
|
||||
})
|
||||
|
||||
local _,_,dtype = UnitDebuff("player", i)
|
||||
if dtype == "Magic" then
|
||||
pfUI.uf.player.debuff.debuffs[i]:SetBackdropBorderColor(0,1,1,1)
|
||||
elseif dtype == "Poison" then
|
||||
pfUI.uf.player.debuff.debuffs[i]:SetBackdropBorderColor(0,1,0,1)
|
||||
elseif dtype == "Curse" then
|
||||
pfUI.uf.player.debuff.debuffs[i]:SetBackdropBorderColor(1,0,1,1)
|
||||
elseif dtype == "Disease" then
|
||||
pfUI.uf.player.debuff.debuffs[i]:SetBackdropBorderColor(1,1,0,1)
|
||||
|
||||
else
|
||||
pfUI.uf.player.debuff.debuffs[i]:SetBackdropBorderColor(1,0,0,1)
|
||||
end
|
||||
|
||||
if GetPlayerBuffTexture(GetPlayerBuff(i-1,"HARMFUL")) then
|
||||
pfUI.uf.player.debuff.debuffs[i]:Show()
|
||||
local stacks = GetPlayerBuffApplications(GetPlayerBuff(i-1,"HARMFUL"))
|
||||
if stacks > 1 then
|
||||
pfUI.uf.player.debuff.debuffs[i].stacks:SetText(stacks)
|
||||
else
|
||||
pfUI.uf.player.debuff.debuffs[i].stacks:SetText("")
|
||||
end
|
||||
else
|
||||
pfUI.uf.player.debuff.debuffs[i]:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,63 @@
|
||||
GameMenuFrameHeader:SetTexture(nil)
|
||||
GameMenuFrame:SetHeight(GameMenuFrame:GetHeight()-20)
|
||||
GameMenuFrame:SetWidth(GameMenuFrame:GetWidth()-30)
|
||||
|
||||
_, class = UnitClass("player")
|
||||
local color = RAID_CLASS_COLORS[class]
|
||||
local cr, cg, cb = color.r , color.g, color.b
|
||||
|
||||
local buttons = {
|
||||
"GameMenuButtonOptions",
|
||||
"GameMenuButtonSoundOptions",
|
||||
"GameMenuButtonUIOptions",
|
||||
"GameMenuButtonKeybindings",
|
||||
"GameMenuButtonMacros",
|
||||
"GameMenuButtonLogout",
|
||||
"GameMenuButtonQuit",
|
||||
"GameMenuButtonContinue",
|
||||
"StaticPopup1Button1",
|
||||
"StaticPopup1Button2",
|
||||
"StaticPopup2Button1",
|
||||
"StaticPopup2Button2",
|
||||
}
|
||||
local boxes = {
|
||||
"StaticPopup1",
|
||||
"StaticPopup2",
|
||||
"GameMenuFrame",
|
||||
"DropDownList1MenuBackdrop",
|
||||
"DropDownList2MenuBackdrop",
|
||||
"DropDownList1Backdrop",
|
||||
"DropDownList2Backdrop",
|
||||
}
|
||||
|
||||
for _, button in pairs(buttons) do
|
||||
local b = getglobal(button)
|
||||
b:SetBackdrop(pfUI.backdrop)
|
||||
b:SetNormalTexture(nil)
|
||||
b:SetHighlightTexture(nil)
|
||||
b:SetPushedTexture(nil)
|
||||
b:SetDisabledTexture(nil)
|
||||
b:SetScript("OnEnter", function()
|
||||
b:SetBackdrop(pfUI.backdrop_col)
|
||||
b:SetBackdropBorderColor(cr,cg,cb,1)
|
||||
end)
|
||||
b:SetScript("OnLeave", function()
|
||||
b:SetBackdrop(pfUI.backdrop)
|
||||
b:SetBackdropBorderColor(1,1,1,1)
|
||||
end)
|
||||
b:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 10, "OUTLINE")
|
||||
end
|
||||
|
||||
for _, box in pairs(boxes) do
|
||||
local b = getglobal(box)
|
||||
b:SetBackdrop(pfUI.backdrop)
|
||||
b:SetBackdropColor(0,0,0,.5)
|
||||
end
|
||||
|
||||
for i,v in ipairs({GameMenuFrame:GetRegions()}) do
|
||||
if v.SetTextColor then
|
||||
v:SetTextColor(1,1,1,.5)
|
||||
v:SetPoint("TOP", GameMenuFrame, "TOP", 0, -6)
|
||||
v:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 10, "OUTLINE")
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,417 @@
|
||||
TargetFrame:Hide()
|
||||
TargetFrame:UnregisterAllEvents()
|
||||
|
||||
pfUI.uf.target = CreateFrame("Button",nil,UIParent)
|
||||
pfUI.uf.target:Hide()
|
||||
pfUI.uf.target:RegisterEvent("PLAYER_TARGET_CHANGED")
|
||||
pfUI.uf.target:SetScript("OnEvent", function()
|
||||
if UnitExists("target") then
|
||||
pfUI.uf.target:Show()
|
||||
else
|
||||
pfUI.uf.target:Hide()
|
||||
end
|
||||
end)
|
||||
pfUI.uf.target:SetWidth(pfUI.config.unitframes.width)
|
||||
pfUI.uf.target:SetHeight(pfUI.config.unitframes.height+pfUI.config.unitframes.pheight)
|
||||
pfUI.uf.target:SetPoint("BOTTOMLEFT", UIParent, "BOTTOM", 75, 125)
|
||||
|
||||
pfUI.uf.target:RegisterForClicks('LeftButtonUp', 'RightButtonUp')
|
||||
pfUI.uf.target:SetScript("OnClick", function ()
|
||||
if arg1 == "RightButton" then
|
||||
ToggleDropDownMenu(1, nil, TargetFrameDropDown, "cursor")
|
||||
end
|
||||
end)
|
||||
|
||||
pfUI.uf.target:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
pfUI.uf.target:RegisterEvent("PLAYER_TARGET_CHANGED")
|
||||
pfUI.uf.target:RegisterEvent("UNIT_HEALTH")
|
||||
pfUI.uf.target:RegisterEvent("UNIT_MAXHEALTH")
|
||||
pfUI.uf.target:RegisterEvent("UNIT_DISPLAYPOWER")
|
||||
pfUI.uf.target:RegisterEvent("UNIT_MANA")
|
||||
pfUI.uf.target:RegisterEvent("UNIT_MAXMANA")
|
||||
pfUI.uf.target:RegisterEvent("UNIT_RAGE")
|
||||
pfUI.uf.target:RegisterEvent("UNIT_MAXRAGE")
|
||||
pfUI.uf.target:RegisterEvent("UNIT_ENERGY")
|
||||
pfUI.uf.target:RegisterEvent("UNIT_MAXENERGY")
|
||||
|
||||
pfUI.uf.target:SetScript("OnEvent", function()
|
||||
if UnitExists("target") then pfUI.uf.target:Show() else
|
||||
pfUI.uf.target:Hide()
|
||||
return
|
||||
end
|
||||
|
||||
if event == "PLAYER_TARGET_CHANGED" or event == "PLAYER_ENTERING_WORLD" then
|
||||
pfUI.uf.target.power.bar:SetValue(0)
|
||||
pfUI.uf.target.hp.bar:SetValue(0)
|
||||
end
|
||||
|
||||
local hp, hpmax
|
||||
if MobHealth3 then
|
||||
hp, hpmax = MobHealth3:GetUnitHealth("target")
|
||||
else
|
||||
hp, hpmax = UnitHealth("target"), UnitHealthMax("target")
|
||||
end
|
||||
local power, powermax = UnitMana("target"), UnitManaMax("target")
|
||||
|
||||
if hp ~= hpmax and hpmax ~= 100 then
|
||||
pfUI.uf.target.hpText:SetText( hp .. " - " .. ceil(hp / hpmax * 100) .. "%")
|
||||
else
|
||||
pfUI.uf.target.hpText:SetText( hp)
|
||||
end
|
||||
|
||||
local color
|
||||
if UnitIsPlayer("target") then
|
||||
_, class = UnitClass("target")
|
||||
color = RAID_CLASS_COLORS[class]
|
||||
else
|
||||
color = UnitReactionColor[UnitReaction("target", "player")]
|
||||
end
|
||||
local r, g, b = (color.r + .5) * .5, (color.g + .5) * .5, (color.b + .5) * .5
|
||||
|
||||
pfUI.uf.target.hp.bar:SetMinMaxValues(0, hpmax)
|
||||
pfUI.uf.target.hp.bar:SetStatusBarColor(r, g, b, hp / hpmax / 4 + .75)
|
||||
pfUI.uf.target.powerText:SetTextColor(r, g, b, 1)
|
||||
|
||||
local perc = hp / hpmax
|
||||
local r1, g1, b1, r2, g2, b2
|
||||
if perc <= 0.5 then
|
||||
perc = perc * 2; r1, g1, b1 = .9, .5, .5; r2, g2, b2 = .9, .9, .5
|
||||
else
|
||||
perc = perc * 2 - 1; r1, g1, b1 = .9, .9, .5; r2, g2, b2 = .5, .9, .5
|
||||
end
|
||||
local r, g, b = r1 + (r2 - r1)*perc, g1 + (g2 - g1)*perc, b1 + (b2 - b1)*perc
|
||||
pfUI.uf.target.hpText:SetTextColor(r, g, b,1)
|
||||
|
||||
local leveldiff = UnitLevel("player") - UnitLevel("target")
|
||||
local levelcolor
|
||||
if leveldiff >= 9 then
|
||||
levelcolor = "555555"
|
||||
elseif leveldiff >= 3 then
|
||||
levelcolor = "55ff55"
|
||||
elseif leveldiff >= -2 then
|
||||
levelcolor = "aaff55"
|
||||
elseif leveldiff >= -4 then
|
||||
levelcolor = "ffaa55"
|
||||
else
|
||||
levelcolor = "ff5555"
|
||||
end
|
||||
|
||||
local name = string.sub(UnitName("target"),1,25)
|
||||
if strlen(UnitName("target")) > 25 then
|
||||
name = name .. "..."
|
||||
end
|
||||
|
||||
local level = UnitLevel("target")
|
||||
if level == -1 then level = "??" end
|
||||
|
||||
if UnitClassification("target") == "worldboss" then
|
||||
level = level .. "B"
|
||||
elseif UnitClassification("target") == "rareelite" then
|
||||
level = level .. "R+"
|
||||
elseif UnitClassification("target") == "elite" then
|
||||
level = level .. "+"
|
||||
elseif UnitClassification("target") == "rare" then
|
||||
level = level .. "R"
|
||||
end
|
||||
|
||||
pfUI.uf.target.powerText:SetText( "|cff" .. levelcolor .. level .. "|r " .. name)
|
||||
|
||||
PowerColor = ManaBarColor[UnitPowerType("target")];
|
||||
pfUI.uf.target.power.bar:SetStatusBarColor(PowerColor.r + .5, PowerColor.g +.5, PowerColor.b +.5, 1)
|
||||
pfUI.uf.target.power.bar:SetMinMaxValues(0, UnitManaMax("target"))
|
||||
|
||||
pfUI.uf.target.hpReal = hp
|
||||
pfUI.uf.target.powerReal = power
|
||||
end)
|
||||
|
||||
pfUI.uf.target:SetScript("OnUpdate", function()
|
||||
if not UnitExists("target") then return end
|
||||
|
||||
local hpDisplay = pfUI.uf.target.hp.bar:GetValue()
|
||||
local hpReal = pfUI.uf.target.hpReal
|
||||
local hpDiff = abs(hpReal - hpDisplay)
|
||||
|
||||
if hpDisplay < hpReal then
|
||||
pfUI.uf.target.hp.bar:SetValue(hpDisplay + ceil(hpDiff / pfUI.config.unitframes.animation_speed))
|
||||
elseif hpDisplay > hpReal then
|
||||
pfUI.uf.target.hp.bar:SetValue(hpDisplay - ceil(hpDiff / pfUI.config.unitframes.animation_speed))
|
||||
end
|
||||
|
||||
local powerDisplay = pfUI.uf.target.power.bar:GetValue()
|
||||
local powerReal = pfUI.uf.target.powerReal
|
||||
local powerDiff = abs(powerReal - powerDisplay)
|
||||
|
||||
if powerDisplay < powerReal then
|
||||
pfUI.uf.target.power.bar:SetValue(powerDisplay + ceil(powerDiff / pfUI.config.unitframes.animation_speed))
|
||||
elseif powerDisplay > powerReal then
|
||||
pfUI.uf.target.power.bar:SetValue(powerDisplay - ceil(powerDiff / pfUI.config.unitframes.animation_speed))
|
||||
end
|
||||
end)
|
||||
|
||||
pfUI.uf.target.hp = CreateFrame("Frame",nil, pfUI.uf.target)
|
||||
pfUI.uf.target.hp:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.uf.target.hp:SetHeight(pfUI.config.unitframes.height)
|
||||
pfUI.uf.target.hp:SetPoint("TOPLEFT",pfUI.uf.target,"TOPLEFT")
|
||||
pfUI.uf.target.hp:SetPoint("TOPRIGHT",pfUI.uf.target,"TOPRIGHT")
|
||||
|
||||
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:ClearAllPoints()
|
||||
pfUI.uf.target.hp.bar:SetPoint("TOPLEFT", pfUI.uf.target.hp, "TOPLEFT", 3, -3)
|
||||
pfUI.uf.target.hp.bar:SetPoint("BOTTOMRIGHT", pfUI.uf.target.hp, "BOTTOMRIGHT", -3, 3)
|
||||
|
||||
pfUI.uf.target.hp.bar:SetMinMaxValues(0, 100)
|
||||
pfUI.uf.target.hp.bar:SetValue(100)
|
||||
|
||||
pfUI.uf.target.hp.bar.portrait = CreateFrame("PlayerModel",nil,pfUI.uf.target.hp.bar)
|
||||
pfUI.uf.target.hp.bar.portrait:SetAllPoints(pfUI.uf.target.hp.bar)
|
||||
pfUI.uf.target.hp.bar.portrait:RegisterEvent("UNIT_PORTRAIT_UPDATE")
|
||||
pfUI.uf.target.hp.bar.portrait:RegisterEvent("UNIT_MODEL_CHANGED")
|
||||
pfUI.uf.target.hp.bar.portrait:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
pfUI.uf.target.hp.bar.portrait:RegisterEvent("PLAYER_TARGET_CHANGED")
|
||||
|
||||
pfUI.uf.target.hp.bar.portrait:SetScript("OnEvent", function() this.update() end)
|
||||
pfUI.uf.target.hp.bar.portrait:SetScript("OnShow", function() this.update() end)
|
||||
|
||||
pfUI.uf.target.hp.bar.portrait.update = function ()
|
||||
pfUI.uf.target.hp.bar.portrait:SetUnit("target");
|
||||
pfUI.uf.target.hp.bar.portrait:SetCamera(0)
|
||||
pfUI.uf.target.hp.bar.portrait:SetAlpha(0.10)
|
||||
end
|
||||
|
||||
pfUI.uf.target.power = CreateFrame("Frame",nil, pfUI.uf.target)
|
||||
|
||||
pfUI.uf.target.power:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.uf.target.power:SetPoint("TOPLEFT",pfUI.uf.target.hp,"BOTTOMLEFT",0,3)
|
||||
pfUI.uf.target.power:SetPoint("BOTTOMRIGHT",pfUI.uf.target,"BOTTOMRIGHT",0,0)
|
||||
|
||||
pfUI.uf.target.power.bar = CreateFrame("StatusBar", nil, pfUI.uf.target.power)
|
||||
pfUI.uf.target.power.bar:ClearAllPoints()
|
||||
pfUI.uf.target.power.bar:SetPoint("TOPLEFT", pfUI.uf.target.power, "TOPLEFT", 3, -3)
|
||||
pfUI.uf.target.power.bar:SetPoint("BOTTOMRIGHT", pfUI.uf.target.power, "BOTTOMRIGHT", -3, 3)
|
||||
pfUI.uf.target.power.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
|
||||
|
||||
pfUI.uf.target.power.bar:SetBackdropColor(0,0,0,1)
|
||||
pfUI.uf.target.power.bar:SetStatusBarColor(0,0,0)
|
||||
pfUI.uf.target.power.bar:SetMinMaxValues(0, 100)
|
||||
pfUI.uf.target.power.bar:SetValue(100)
|
||||
|
||||
pfUI.uf.target.hpText = pfUI.uf.target:CreateFontString("Status", "HIGH", "GameFontNormal")
|
||||
pfUI.uf.target.hpText:SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 10, "OUTLINE")
|
||||
pfUI.uf.target.hpText:ClearAllPoints()
|
||||
pfUI.uf.target.hpText:SetParent(pfUI.uf.target.hp.bar)
|
||||
pfUI.uf.target.hpText:SetPoint("RIGHT",pfUI.uf.target.hp.bar, "RIGHT", -10, 0)
|
||||
pfUI.uf.target.hpText:SetJustifyH("RIGHT")
|
||||
pfUI.uf.target.hpText:SetFontObject(GameFontWhite)
|
||||
pfUI.uf.target.hpText:SetText("5000")
|
||||
|
||||
pfUI.uf.target.powerText = pfUI.uf.target:CreateFontString("Status", "HIGH", "GameFontNormal")
|
||||
pfUI.uf.target.powerText:SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 10, "OUTLINE")
|
||||
pfUI.uf.target.powerText:ClearAllPoints()
|
||||
pfUI.uf.target.powerText:SetParent(pfUI.uf.target.hp.bar)
|
||||
pfUI.uf.target.powerText:SetPoint("LEFT",pfUI.uf.target.hp.bar, "LEFT", 10, 0)
|
||||
pfUI.uf.target.powerText:SetJustifyH("LEFT")
|
||||
pfUI.uf.target.powerText:SetFontObject(GameFontWhite)
|
||||
pfUI.uf.target.powerText:SetText("5000")
|
||||
|
||||
pfUI.uf.target.combopoints = CreateFrame("Frame")
|
||||
|
||||
pfUI.uf.target.combopoints:RegisterEvent("UNIT_COMBO_POINTS")
|
||||
pfUI.uf.target.combopoints:RegisterEvent("PLAYER_COMBO_POINTS")
|
||||
pfUI.uf.target.combopoints:RegisterEvent("UNIT_DISPLAYPOWER")
|
||||
pfUI.uf.target.combopoints:RegisterEvent("PLAYER_TARGET_CHANGED")
|
||||
pfUI.uf.target.combopoints:RegisterEvent('UNIT_ENERGY');
|
||||
pfUI.uf.target.combopoints:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
|
||||
pfUI.uf.target.combopoint1 = CreateFrame("Frame")
|
||||
pfUI.uf.target.combopoint2 = CreateFrame("Frame")
|
||||
pfUI.uf.target.combopoint3 = CreateFrame("Frame")
|
||||
pfUI.uf.target.combopoint4 = CreateFrame("Frame")
|
||||
pfUI.uf.target.combopoint5 = CreateFrame("Frame")
|
||||
|
||||
pfUI.uf.target.combopoints:SetScript("OnEvent", function()
|
||||
if event == "PLAYER_ENTERING_WORLD" then
|
||||
for point=1, 5 do
|
||||
pfUI.uf.target["combopoint" .. point]:SetFrameStrata("HIGH")
|
||||
pfUI.uf.target["combopoint" .. point]:SetWidth(12)
|
||||
pfUI.uf.target["combopoint" .. point]:SetHeight(12)
|
||||
pfUI.uf.target["combopoint" .. point]:SetBackdrop({
|
||||
bgFile = "Interface\\AddOns\\pfUI\\img\\bar", tile = true, tileSize = 8,
|
||||
edgeFile = "Interface\\AddOns\\pfUI\\img\\border", edgeSize = 8,
|
||||
insets = {left = 0, right = 0, top = 0, bottom = 0},
|
||||
})
|
||||
pfUI.uf.target["combopoint" .. point]:SetPoint("TOPLEFT", pfUI.uf.target, "TOPRIGHT", 3, -(point - 1) * 13)
|
||||
|
||||
if point < 3 then
|
||||
pfUI.uf.target["combopoint" .. point]:SetBackdropColor(1, .3, .3, .75)
|
||||
elseif point < 4 then
|
||||
pfUI.uf.target["combopoint" .. point]:SetBackdropColor(1, 1, .3, .75)
|
||||
else
|
||||
pfUI.uf.target["combopoint" .. point]:SetBackdropColor(.3, 1, .3, .75)
|
||||
end
|
||||
pfUI.uf.target["combopoint" .. point]:Hide()
|
||||
end
|
||||
else
|
||||
local combopoints = GetComboPoints("target")
|
||||
for point=1, 5 do
|
||||
pfUI.uf.target["combopoint" .. point]:Hide()
|
||||
end
|
||||
for point=1, combopoints do
|
||||
pfUI.uf.target["combopoint" .. point]:Show()
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
pfUI.uf.target.buff = CreateFrame("Frame", nil)
|
||||
pfUI.uf.target.buff:RegisterEvent("PLAYER_AURAS_CHANGED")
|
||||
pfUI.uf.target.buff:RegisterEvent("PLAYER_AURAS_CHANGED")
|
||||
pfUI.uf.target.buff:RegisterEvent("PLAYER_TARGET_CHANGED")
|
||||
pfUI.uf.target.buff:RegisterEvent("UNIT_AURA")
|
||||
pfUI.uf.target.buff:SetScript("OnEvent", function()
|
||||
pfUI.uf.target.buff.refreshBuffs()
|
||||
end)
|
||||
|
||||
pfUI.uf.target.buff.buffs = {}
|
||||
for i=1, 16 do
|
||||
local id = i
|
||||
local row = 0
|
||||
if i <= 8 then row = 0 else row = 1 end
|
||||
|
||||
pfUI.uf.target.buff.buffs[i] = CreateFrame("Button", "pfUITargetBuff" .. i, pfUI.uf.target)
|
||||
pfUI.uf.target.buff.buffs[i].stacks = pfUI.uf.target.buff.buffs[i]:CreateFontString(nil, "OVERLAY", pfUI.uf.target.buff.buffs[i])
|
||||
pfUI.uf.target.buff.buffs[i].stacks:SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 10, "OUTLINE")
|
||||
pfUI.uf.target.buff.buffs[i].stacks:SetPoint("BOTTOMRIGHT", pfUI.uf.target.buff.buffs[i], 2, -2)
|
||||
pfUI.uf.target.buff.buffs[i].stacks:SetJustifyH("LEFT")
|
||||
pfUI.uf.target.buff.buffs[i].stacks:SetShadowColor(0, 0, 0)
|
||||
pfUI.uf.target.buff.buffs[i].stacks:SetShadowOffset(0.8, -0.8)
|
||||
pfUI.uf.target.buff.buffs[i].stacks:SetTextColor(1,1,.5)
|
||||
|
||||
pfUI.uf.target.buff.buffs[i]:RegisterForClicks("RightButtonUp")
|
||||
pfUI.uf.target.buff.buffs[i]:ClearAllPoints()
|
||||
pfUI.uf.target.buff.buffs[i]:SetPoint("BOTTOMLEFT", pfUI.uf.target, "TOPLEFT", (i-8*row)*1 + (i-8*row)*pfUI.config.unitframes.buff_size - pfUI.config.unitframes.buff_size -1 , 1*row + pfUI.config.unitframes.buff_size*row +1)
|
||||
pfUI.uf.target.buff.buffs[i]:SetWidth(pfUI.config.unitframes.buff_size)
|
||||
pfUI.uf.target.buff.buffs[i]:SetHeight(pfUI.config.unitframes.buff_size)
|
||||
pfUI.uf.target.buff.buffs[i]:SetNormalTexture(nil)
|
||||
pfUI.uf.target.buff.buffs[i]:SetScript("OnEnter", function()
|
||||
GameTooltip:SetOwner(this, "ANCHOR_BOTTOMRIGHT")
|
||||
GameTooltip:SetUnitBuff("target", id)
|
||||
end)
|
||||
|
||||
pfUI.uf.target.buff.buffs[i]:SetScript("OnLeave", function()
|
||||
GameTooltip:Hide()
|
||||
end)
|
||||
end
|
||||
|
||||
pfUI.uf.target.buff.refreshBuffs = function ()
|
||||
for i=1, 16 do
|
||||
local texture, stacks = UnitBuff("target",i)
|
||||
pfUI.uf.target.buff.buffs[i]:SetBackdrop(
|
||||
{ bgFile = texture, tile = false, tileSize = pfUI.config.unitframes.buff_size,
|
||||
edgeFile = "Interface\\AddOns\\pfUI\\img\\border", edgeSize = 8,
|
||||
insets = { left = 0, right = 0, top = 0, bottom = 0}
|
||||
})
|
||||
|
||||
if texture then
|
||||
pfUI.uf.target.buff.buffs[i]:Show()
|
||||
if stacks > 1 then
|
||||
pfUI.uf.target.buff.buffs[i].stacks:SetText(stacks)
|
||||
else
|
||||
pfUI.uf.target.buff.buffs[i].stacks:SetText("")
|
||||
end
|
||||
else
|
||||
pfUI.uf.target.buff.buffs[i]:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
pfUI.uf.target.debuff = CreateFrame("Frame", nil)
|
||||
pfUI.uf.target.debuff:RegisterEvent("PLAYER_AURAS_CHANGED")
|
||||
pfUI.uf.target.debuff:RegisterEvent("PLAYER_TARGET_CHANGED")
|
||||
pfUI.uf.target.debuff:RegisterEvent("UNIT_AURA")
|
||||
pfUI.uf.target.debuff:SetScript("OnEvent", function()
|
||||
pfUI.uf.target.debuff.refreshBuffs()
|
||||
end)
|
||||
|
||||
pfUI.uf.target.debuff.debuffs = {}
|
||||
for i=1, 16 do
|
||||
local id = i
|
||||
pfUI.uf.target.debuff.debuffs[i] = CreateFrame("Button", "pfUITargetDebuff" .. i, pfUI.uf.target)
|
||||
pfUI.uf.target.debuff.debuffs[i].stacks = pfUI.uf.target.debuff.debuffs[i]:CreateFontString(nil, "OVERLAY", pfUI.uf.target.debuff.debuffs[i])
|
||||
pfUI.uf.target.debuff.debuffs[i].stacks:SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 10, "OUTLINE")
|
||||
pfUI.uf.target.debuff.debuffs[i].stacks:SetPoint("BOTTOMRIGHT", pfUI.uf.target.debuff.debuffs[i], 2, -2)
|
||||
pfUI.uf.target.debuff.debuffs[i].stacks:SetJustifyH("LEFT")
|
||||
pfUI.uf.target.debuff.debuffs[i].stacks:SetShadowColor(0, 0, 0)
|
||||
pfUI.uf.target.debuff.debuffs[i].stacks:SetShadowOffset(0.8, -0.8)
|
||||
pfUI.uf.target.debuff.debuffs[i].stacks:SetTextColor(1,1,.5)
|
||||
pfUI.uf.target.debuff.debuffs[i]:RegisterForClicks("RightButtonUp")
|
||||
pfUI.uf.target.debuff.debuffs[i]:ClearAllPoints()
|
||||
|
||||
local row = 0;
|
||||
local top = 0;
|
||||
if i > 8 then row = 1 end
|
||||
if pfUI.uf.target.buff.buffs[1]:IsShown() then top = top + 1 end
|
||||
if pfUI.uf.target.buff.buffs[9]:IsShown() then top = top + 1 end
|
||||
|
||||
pfUI.uf.target.debuff.debuffs[i]:SetPoint("BOTTOMLEFT", pfUI.uf.target, "TOPLEFT",
|
||||
(i-8*row)*1 + (i-8*row)*pfUI.config.unitframes.debuff_size - pfUI.config.unitframes.debuff_size -1 ,
|
||||
1*row + pfUI.config.unitframes.debuff_size*row +1 + (top*(pfUI.config.unitframes.debuff_size+1))
|
||||
)
|
||||
|
||||
pfUI.uf.target.debuff.debuffs[i]:SetWidth(pfUI.config.unitframes.debuff_size)
|
||||
pfUI.uf.target.debuff.debuffs[i]:SetHeight(pfUI.config.unitframes.debuff_size)
|
||||
pfUI.uf.target.debuff.debuffs[i]:SetNormalTexture(nil)
|
||||
pfUI.uf.target.debuff.debuffs[i]:SetScript("OnEnter", function()
|
||||
GameTooltip:SetOwner(this, "ANCHOR_BOTTOMRIGHT")
|
||||
GameTooltip:SetUnitDebuff("target", id)
|
||||
end)
|
||||
pfUI.uf.target.debuff.debuffs[i]:SetScript("OnLeave", function()
|
||||
GameTooltip:Hide()
|
||||
end)
|
||||
pfUI.uf.target.debuff.debuffs[i]:SetScript("OnClick", function()
|
||||
CancelPlayerBuff(GetPlayerBuff(id-1,"HARMFUL"))
|
||||
end)
|
||||
end
|
||||
|
||||
pfUI.uf.target.debuff.refreshBuffs = function ()
|
||||
for i=1, 16 do
|
||||
local row = 0;
|
||||
local top = 0;
|
||||
if i > 8 then row = 1 end
|
||||
if pfUI.uf.target.buff.buffs[1]:IsShown() then top = top + 1 end
|
||||
if pfUI.uf.target.buff.buffs[9]:IsShown() then top = top + 1 end
|
||||
|
||||
pfUI.uf.target.debuff.debuffs[i]:SetPoint("BOTTOMLEFT", pfUI.uf.target, "TOPLEFT",
|
||||
(i-8*row)*1 + (i-8*row)*pfUI.config.unitframes.debuff_size - pfUI.config.unitframes.debuff_size -1 ,
|
||||
1*row + pfUI.config.unitframes.debuff_size*row +1 + (top*(pfUI.config.unitframes.debuff_size+1))
|
||||
)
|
||||
local texture, stacks = UnitDebuff("target",i)
|
||||
pfUI.uf.target.debuff.debuffs[i]:SetBackdrop(
|
||||
{ bgFile = texture, tile = false, tileSize = pfUI.config.unitframes.debuff_size,
|
||||
edgeFile = "Interface\\AddOns\\pfUI\\img\\border_col", edgeSize = 8,
|
||||
insets = { left = 0, right = 0, top = 0, bottom = 0}
|
||||
})
|
||||
|
||||
local _,_,dtype = UnitDebuff("target", i)
|
||||
if dtype == "Magic" then
|
||||
pfUI.uf.target.debuff.debuffs[i]:SetBackdropBorderColor(0,1,1,1)
|
||||
elseif dtype == "Poison" then
|
||||
pfUI.uf.target.debuff.debuffs[i]:SetBackdropBorderColor(0,1,0,1)
|
||||
elseif dtype == "Curse" then
|
||||
pfUI.uf.target.debuff.debuffs[i]:SetBackdropBorderColor(1,0,1,1)
|
||||
else
|
||||
pfUI.uf.target.debuff.debuffs[i]:SetBackdropBorderColor(1,0,0,1)
|
||||
end
|
||||
|
||||
if texture then
|
||||
pfUI.uf.target.debuff.debuffs[i]:Show()
|
||||
if stacks > 1 then
|
||||
pfUI.uf.target.debuff.debuffs[i].stacks:SetText(stacks)
|
||||
else
|
||||
pfUI.uf.target.debuff.debuffs[i].stacks:SetText("")
|
||||
end
|
||||
else
|
||||
pfUI.uf.target.debuff.debuffs[i]:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,118 @@
|
||||
pfUI.uf.targettargetNotify = CreateFrame("Button",nil,UIParent)
|
||||
pfUI.uf.targettargetNotify:SetScript("OnUpdate", function()
|
||||
if UnitExists("targettarget") then pfUI.uf.targettarget:Show() else pfUI.uf.targettarget:Hide() end
|
||||
end)
|
||||
|
||||
pfUI.uf.targettarget = CreateFrame("Button",nil,UIParent)
|
||||
pfUI.uf.targettarget:Hide()
|
||||
|
||||
pfUI.uf.targettarget:SetWidth(100)
|
||||
pfUI.uf.targettarget:SetHeight(25)
|
||||
pfUI.uf.targettarget:SetPoint("BOTTOM", UIParent , "BOTTOM", 0, 125)
|
||||
pfUI.uf.targettarget:SetBackdrop(pfUI.backdrop)
|
||||
|
||||
pfUI.uf.targettarget:RegisterForClicks('LeftButtonUp', 'RightButtonUp')
|
||||
pfUI.uf.targettarget:SetScript("OnClick", function ()
|
||||
TargetUnit("targettarget")
|
||||
end)
|
||||
pfUI.uf.targettarget.bg = CreateFrame("Frame",nil,pfUI.uf.targettarget)
|
||||
pfUI.uf.targettarget.bg = pfUI.uf.targettarget:CreateTexture(nil,"BACKGROUND")
|
||||
pfUI.uf.targettarget.bg:SetAllPoints(pfUI.uf.targettarget)
|
||||
|
||||
pfUI.uf.targettarget:SetScript("OnUpdate", function()
|
||||
if not UnitExists("targettarget") then pfUI.uf.targettarget:Hide(); return end
|
||||
|
||||
local color
|
||||
if UnitIsPlayer("targettarget") then
|
||||
_, class = UnitClass("targettarget")
|
||||
color = RAID_CLASS_COLORS[class]
|
||||
else
|
||||
color = UnitReactionColor[UnitReaction("targettarget", "player")]
|
||||
end
|
||||
|
||||
pfUI.uf.targettarget.hp.bar:SetMinMaxValues(0, UnitHealthMax("targettarget"))
|
||||
|
||||
local r, g, b = (color.r + .5) * .5, (color.g + .5) * .5, (color.b + .5) * .5
|
||||
|
||||
pfUI.uf.targettarget.hp.bar:SetStatusBarColor(r, g, b, UnitHealth("targettarget") / UnitHealthMax("targettarget") / 4 + .75)
|
||||
pfUI.uf.targettarget.hp.text:SetTextColor(r+.3,g+.3,b+.3, 1)
|
||||
pfUI.uf.targettarget.hp.text:SetText( UnitName("targettarget"))
|
||||
|
||||
local display, real
|
||||
display = pfUI.uf.targettarget.hp.bar:GetValue()
|
||||
real = UnitHealth("targettarget")
|
||||
diff = abs(real - display)
|
||||
if display < real then
|
||||
pfUI.uf.targettarget.hp.bar:SetValue(display + ceil(diff / pfUI.config.unitframes.animation_speed))
|
||||
elseif display > real then
|
||||
pfUI.uf.targettarget.hp.bar:SetValue(display - ceil(diff / pfUI.config.unitframes.animation_speed))
|
||||
end
|
||||
|
||||
PowerColor = ManaBarColor[UnitPowerType("targettarget")];
|
||||
pfUI.uf.targettarget.power.bar:SetStatusBarColor(PowerColor.r + .5, PowerColor.g +.5, PowerColor.b +.5, 1)
|
||||
pfUI.uf.targettarget.power.bar:SetMinMaxValues(0, UnitManaMax("targettarget"))
|
||||
|
||||
local display, real
|
||||
display = pfUI.uf.targettarget.power.bar:GetValue()
|
||||
real = UnitMana("targettarget")
|
||||
diff = abs(real - display)
|
||||
if display < real then
|
||||
pfUI.uf.targettarget.power.bar:SetValue(display + ceil(diff / pfUI.config.unitframes.animation_speed))
|
||||
elseif display > real then
|
||||
pfUI.uf.targettarget.power.bar:SetValue(display - ceil(diff / pfUI.config.unitframes.animation_speed))
|
||||
end
|
||||
end)
|
||||
|
||||
pfUI.uf.targettarget.hp = CreateFrame("Frame",nil, pfUI.uf.targettarget)
|
||||
pfUI.uf.targettarget.hp:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.uf.targettarget.hp:SetPoint("TOPLEFT", pfUI.uf.targettarget, "TOPLEFT", 0, 0)
|
||||
pfUI.uf.targettarget.hp:SetPoint("BOTTOMRIGHT", pfUI.uf.targettarget, "BOTTOMRIGHT", 0, 0)
|
||||
pfUI.uf.targettarget.hp:SetPoint("TOP",pfUI.uf.targettarget,"TOP")
|
||||
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:ClearAllPoints()
|
||||
pfUI.uf.targettarget.hp.bar:SetPoint("TOPLEFT", pfUI.uf.targettarget.hp, "TOPLEFT", 3, -3)
|
||||
pfUI.uf.targettarget.hp.bar:SetPoint("BOTTOMRIGHT", pfUI.uf.targettarget.hp, "BOTTOMRIGHT", -3, 3)
|
||||
pfUI.uf.targettarget.hp.bar:SetMinMaxValues(0, 100)
|
||||
pfUI.uf.targettarget.hp.bar:SetValue(100)
|
||||
|
||||
pfUI.uf.targettarget.hp.bar.portrait = CreateFrame("PlayerModel",nil,pfUI.uf.targettarget.hp.bar)
|
||||
pfUI.uf.targettarget.hp.bar.portrait:SetAllPoints(pfUI.uf.targettarget.hp.bar)
|
||||
pfUI.uf.targettarget.hp.bar.portrait:RegisterEvent("UNIT_PORTRAIT_UPDATE")
|
||||
pfUI.uf.targettarget.hp.bar.portrait:RegisterEvent("UNIT_MODEL_CHANGED")
|
||||
pfUI.uf.targettarget.hp.bar.portrait:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
pfUI.uf.targettarget.hp.bar.portrait:RegisterEvent("PLAYER_TARGET_CHANGED")
|
||||
|
||||
pfUI.uf.targettarget.hp.bar.portrait:SetScript("OnEvent", function() this.update() end)
|
||||
pfUI.uf.targettarget.hp.bar.portrait:SetScript("OnShow", function() this.update() end)
|
||||
|
||||
pfUI.uf.targettarget.hp.bar.portrait.update = function ()
|
||||
pfUI.uf.targettarget.hp.bar.portrait:SetUnit("targettarget");
|
||||
pfUI.uf.targettarget.hp.bar.portrait:SetCamera(0)
|
||||
pfUI.uf.targettarget.hp.bar.portrait:SetAlpha(0.10)
|
||||
end
|
||||
|
||||
pfUI.uf.targettarget.power = CreateFrame("Frame",nil, pfUI.uf.targettarget)
|
||||
pfUI.uf.targettarget.power:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.uf.targettarget.power:SetPoint("TOPLEFT", pfUI.uf.targettarget.hp, "BOTTOMLEFT", 0, -3)
|
||||
pfUI.uf.targettarget.power:SetPoint("TOPRIGHT", pfUI.uf.targettarget.hp, "BOTTOMRIGHT", 0, -3)
|
||||
pfUI.uf.targettarget.power:SetHeight(8)
|
||||
pfUI.uf.targettarget.power:SetPoint("TOPLEFT",pfUI.uf.targettarget.hp,"BOTTOMLEFT",0,3)
|
||||
pfUI.uf.targettarget.power.bar = CreateFrame("StatusBar", nil, pfUI.uf.targettarget.power)
|
||||
pfUI.uf.targettarget.power.bar:ClearAllPoints()
|
||||
pfUI.uf.targettarget.power.bar:SetPoint("TOPLEFT", pfUI.uf.targettarget.power, "TOPLEFT", 3, -3)
|
||||
pfUI.uf.targettarget.power.bar:SetPoint("BOTTOMRIGHT", pfUI.uf.targettarget.power, "BOTTOMRIGHT", -3, 3)
|
||||
pfUI.uf.targettarget.power.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
|
||||
pfUI.uf.targettarget.power.bar:SetBackdropColor(0,0,0,1)
|
||||
pfUI.uf.targettarget.power.bar:SetStatusBarColor(0,0,0)
|
||||
pfUI.uf.targettarget.power.bar:SetMinMaxValues(0, 100)
|
||||
pfUI.uf.targettarget.power.bar:SetValue(100)
|
||||
|
||||
pfUI.uf.targettarget.hp.text = pfUI.uf.targettarget.hp.bar:CreateFontString("Status", "LOW", "GameFontNormal")
|
||||
pfUI.uf.targettarget.hp.text:SetFont("Interface\\AddOns\\pfUI\\fonts\\homespun.ttf", 8, "OUTLINE")
|
||||
pfUI.uf.targettarget.hp.text:ClearAllPoints()
|
||||
pfUI.uf.targettarget.hp.text:SetAllPoints(pfUI.uf.targettarget.hp.bar)
|
||||
pfUI.uf.targettarget.hp.text:SetPoint("CENTER", 0, 0)
|
||||
pfUI.uf.targettarget.hp.text:SetJustifyH("CENTER")
|
||||
pfUI.uf.targettarget.hp.text:SetFontObject(GameFontWhite)
|
||||
pfUI.uf.targettarget.hp.text:SetText("n/a")
|
||||
@@ -0,0 +1,25 @@
|
||||
if pfUI.config.unitframes.layout == "tukui" then
|
||||
pfUI.uf.player.caption = CreateFrame("Frame",nil, pfUI.uf.player)
|
||||
pfUI.uf.player.caption:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.uf.player.caption:SetHeight(18)
|
||||
pfUI.uf.player.caption:SetPoint("TOPRIGHT",pfUI.uf.player,"BOTTOMRIGHT",0,-1)
|
||||
pfUI.uf.player.caption:SetPoint("TOPLEFT",pfUI.uf.player,"BOTTOMLEFT",0,-1)
|
||||
|
||||
pfUI.uf.player.hpText:SetParent(pfUI.uf.player.caption)
|
||||
pfUI.uf.player.hpText:SetPoint("RIGHT",pfUI.uf.player.caption, "RIGHT", -3, 0)
|
||||
|
||||
pfUI.uf.player.powerText:SetParent(pfUI.uf.player.caption)
|
||||
pfUI.uf.player.powerText:SetPoint("LEFT",pfUI.uf.player.caption, "LEFT", 5, 0)
|
||||
|
||||
pfUI.uf.target.caption = CreateFrame("Frame",nil, pfUI.uf.target)
|
||||
pfUI.uf.target.caption:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.uf.target.caption:SetHeight(18)
|
||||
pfUI.uf.target.caption:SetPoint("TOPRIGHT",pfUI.uf.target,"BOTTOMRIGHT",0,-1)
|
||||
pfUI.uf.target.caption:SetPoint("TOPLEFT",pfUI.uf.target,"BOTTOMLEFT",0,-1)
|
||||
|
||||
pfUI.uf.target.hpText:SetParent(pfUI.uf.target.caption)
|
||||
pfUI.uf.target.hpText:SetPoint("RIGHT",pfUI.uf.target.caption, "RIGHT", -3, 0)
|
||||
|
||||
pfUI.uf.target.powerText:SetParent(pfUI.uf.target.caption)
|
||||
pfUI.uf.target.powerText:SetPoint("LEFT",pfUI.uf.target.caption, "LEFT", 5, 0)
|
||||
end
|
||||
@@ -0,0 +1,137 @@
|
||||
pfUI.xp = CreateFrame("Frame",nil, pfUI.bars.bottom)
|
||||
pfUI.xp:SetWidth(10)
|
||||
pfUI.xp:SetPoint("TOPLEFT",pfUI.chat.left,"TOPRIGHT", 1, 0)
|
||||
pfUI.xp:SetPoint("BOTTOMLEFT",pfUI.chat.left,"BOTTOMRIGHT",1, 0)
|
||||
pfUI.xp:SetFrameStrata("BACKGROUND")
|
||||
pfUI.xp:SetBackdrop(pfUI.backdrop)
|
||||
pfUI.xp:RegisterEvent("PLAYER_LEVEL_UP")
|
||||
pfUI.xp:RegisterEvent("PLAYER_XP_UPDATE")
|
||||
pfUI.xp:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
|
||||
pfUI.xp:SetScript("OnEvent", function()
|
||||
if UnitXPMax("player") ~= 0 then
|
||||
pfUI.xp.bar:SetMinMaxValues(0, UnitXPMax("player"))
|
||||
pfUI.xp.bar:SetValue(UnitXP("player"))
|
||||
if GetXPExhaustion() then
|
||||
pfUI.xp.restedbar:Show()
|
||||
pfUI.xp.restedbar:SetMinMaxValues(0, UnitXPMax("player"))
|
||||
pfUI.xp.restedbar:SetValue(UnitXP("player") + GetXPExhaustion())
|
||||
pfUI.xp.restedbar:SetAlpha(pfUI.xp:GetAlpha()/2)
|
||||
else
|
||||
pfUI.xp.restedbar:Hide()
|
||||
end
|
||||
pfUI.xp:SetAlpha(1)
|
||||
pfUI.xp.tick = GetTime() + 3.00
|
||||
|
||||
else
|
||||
pfUI.xp:Hide(0)
|
||||
end
|
||||
end)
|
||||
|
||||
pfUI.xp:SetScript("OnUpdate",function()
|
||||
if pfUI.xp:GetAlpha() == 0 or pfUI.xp.mouseover == true then return end
|
||||
if not pfUI.xp.tick then
|
||||
pfUI.xp.tick = GetTime() + 0.01
|
||||
end
|
||||
|
||||
if GetTime() >= pfUI.xp.tick then
|
||||
pfUI.xp.tick = nil
|
||||
pfUI.xp:SetAlpha(pfUI.xp:GetAlpha() - .05)
|
||||
pfUI.xp.restedbar:SetAlpha(pfUI.xp:GetAlpha()/2)
|
||||
end
|
||||
end);
|
||||
|
||||
pfUI.xp:EnableMouse()
|
||||
pfUI.xp:SetScript("OnEnter", function()
|
||||
pfUI.xp.mouseover = true
|
||||
pfUI.xp:SetAlpha(1)
|
||||
pfUI.xp.restedbar:SetAlpha(pfUI.xp:GetAlpha()/2)
|
||||
|
||||
end)
|
||||
|
||||
pfUI.xp:SetScript("OnLeave", function()
|
||||
pfUI.xp.mouseover = false
|
||||
pfUI.xp.tick = GetTime() + 3.00
|
||||
end)
|
||||
|
||||
pfUI.xp.bar = CreateFrame("StatusBar", nil, pfUI.xp)
|
||||
pfUI.xp.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
|
||||
pfUI.xp.bar:ClearAllPoints()
|
||||
pfUI.xp.bar:SetPoint("TOPLEFT", pfUI.xp, "TOPLEFT", 3, -3)
|
||||
pfUI.xp.bar:SetPoint("BOTTOMRIGHT", pfUI.xp, "BOTTOMRIGHT", -3, 3)
|
||||
pfUI.xp.bar:SetStatusBarColor(.25,.25,1,1)
|
||||
pfUI.xp.bar:SetMinMaxValues(0, 100)
|
||||
pfUI.xp.bar:SetOrientation("VERTICAL")
|
||||
pfUI.xp.bar:SetValue(59)
|
||||
|
||||
pfUI.xp.restedbar = CreateFrame("StatusBar", nil, pfUI.xp)
|
||||
pfUI.xp.restedbar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
|
||||
pfUI.xp.restedbar:ClearAllPoints()
|
||||
pfUI.xp.restedbar:SetPoint("TOPLEFT", pfUI.xp, "TOPLEFT", 3, -3)
|
||||
pfUI.xp.restedbar:SetPoint("BOTTOMRIGHT", pfUI.xp, "BOTTOMRIGHT", -3, 3)
|
||||
pfUI.xp.restedbar:SetFrameStrata("HIGH")
|
||||
pfUI.xp.restedbar:SetStatusBarColor(1,.25,1,1)
|
||||
pfUI.xp.restedbar:SetMinMaxValues(0, 100)
|
||||
pfUI.xp.restedbar:SetOrientation("VERTICAL")
|
||||
|
||||
pfUI.rep = CreateFrame("Frame",nil, pfUI.bars.bottom)
|
||||
pfUI.rep:SetWidth(10)
|
||||
pfUI.rep:SetPoint("TOPRIGHT",pfUI.chat.right,"TOPLEFT", -1, 0)
|
||||
pfUI.rep:SetPoint("BOTTOMRIGHT",pfUI.chat.right,"BOTTOMLEFT",-1, 0)
|
||||
pfUI.rep:SetFrameStrata("BACKGROUND")
|
||||
pfUI.rep:SetBackdrop(pfUI.backdrop)
|
||||
|
||||
pfUI.rep.bar = CreateFrame("StatusBar", nil, pfUI.rep)
|
||||
pfUI.rep.bar:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
|
||||
pfUI.rep.bar:ClearAllPoints()
|
||||
pfUI.rep.bar:SetPoint("TOPLEFT", pfUI.rep, "TOPLEFT", 3, -3)
|
||||
pfUI.rep.bar:SetPoint("BOTTOMRIGHT", pfUI.rep, "BOTTOMRIGHT", -3, 3)
|
||||
pfUI.rep.bar:SetMinMaxValues(0, 100)
|
||||
pfUI.rep.bar:SetOrientation("VERTICAL")
|
||||
pfUI.rep.bar:SetValue(59)
|
||||
|
||||
pfUI.rep:RegisterEvent("UPDATE_FACTION")
|
||||
pfUI.rep:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
|
||||
pfUI.rep:SetScript("OnEvent", function()
|
||||
pfUI.rep:SetAlpha(0)
|
||||
for i=1, GetNumFactions() do
|
||||
local name, description, standingID, barMin, barMax, barValue, atWarWith, canToggleAtWar, isHeader, isCollapsed, isWatched = GetFactionInfo(i);
|
||||
if isWatched then
|
||||
barMax = barMax - barMin;
|
||||
barValue = barValue - barMin;
|
||||
barMin = 0;
|
||||
|
||||
pfUI.rep.bar:SetMinMaxValues(barMin, barMax)
|
||||
pfUI.rep.bar:SetValue(barValue)
|
||||
local color = FACTION_BAR_COLORS[standingID];
|
||||
pfUI.rep.bar:SetStatusBarColor((color.r + .5) * .5, (color.g + .5) * .5, (color.b + .5) * .5, 1)
|
||||
pfUI.rep:SetAlpha(1)
|
||||
pfUI.rep.tick = GetTime() + 3.00
|
||||
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
pfUI.rep:SetScript("OnUpdate",function()
|
||||
if pfUI.rep:GetAlpha() == 0 or pfUI.rep.mouseover == true then return end
|
||||
if not pfUI.rep.tick then
|
||||
pfUI.rep.tick = GetTime() + 0.01
|
||||
end
|
||||
|
||||
if GetTime() >= pfUI.rep.tick then
|
||||
pfUI.rep.tick = nil
|
||||
pfUI.rep:SetAlpha(pfUI.rep:GetAlpha() - .05)
|
||||
end
|
||||
end)
|
||||
|
||||
pfUI.rep:EnableMouse()
|
||||
pfUI.rep:SetScript("OnEnter", function()
|
||||
pfUI.rep.mouseover = true
|
||||
pfUI.rep:SetAlpha(1)
|
||||
end)
|
||||
|
||||
pfUI.rep:SetScript("OnLeave", function()
|
||||
pfUI.rep.mouseover = false
|
||||
pfUI.rep.tick = GetTime() + 3.00
|
||||
end)
|
||||
@@ -0,0 +1,97 @@
|
||||
SLASH_RELOAD1 = '/rl'; -- 3.
|
||||
function SlashCmdList.RELOAD(msg, editbox) -- 4.
|
||||
ReloadUI()
|
||||
end
|
||||
|
||||
pfUI = CreateFrame("Frame",nil,UIParent)
|
||||
pfUI.backdrop = {
|
||||
bgFile = "Interface\\AddOns\\pfUI\\img\\bg", tile = true, tileSize = 8,
|
||||
edgeFile = "Interface\\AddOns\\pfUI\\img\\border", edgeSize = 8,
|
||||
insets = {left = 0, right = 0, top = 0, bottom = 0},
|
||||
}
|
||||
|
||||
pfUI.backdrop_gitter = {
|
||||
bgFile = "Interface\\AddOns\\pfUI\\img\\gitter", tile = true, tileSize = 8,
|
||||
}
|
||||
|
||||
pfUI.backdrop_col = {
|
||||
bgFile = "Interface\\AddOns\\pfUI\\img\\bg", tile = true, tileSize = 8,
|
||||
edgeFile = "Interface\\AddOns\\pfUI\\img\\border_col", edgeSize = 8,
|
||||
insets = {left = 0, right = 0, top = 0, bottom = 0},
|
||||
}
|
||||
|
||||
pfUI.playerDB = {}
|
||||
|
||||
pfUI.config = {
|
||||
["unitframes"] = {
|
||||
animation_speed = 1,
|
||||
buff_size = "22",
|
||||
debuff_size = "22",
|
||||
layout = "default",
|
||||
width = 200,
|
||||
height = 50,
|
||||
pheight = 10,
|
||||
},
|
||||
["bars"] = {
|
||||
icon_size = "22",
|
||||
border = 2,
|
||||
}
|
||||
}
|
||||
|
||||
function moveit()
|
||||
-- don't call it "grid" to avoid confusion with grid (addon) module
|
||||
pfUI.gitter = CreateFrame("Frame", nil, UIParent)
|
||||
pfUI.gitter:SetFrameStrata("BACKGROUND")
|
||||
pfUI.gitter:SetPoint("TOPLEFT", 0, 0, "TOPLEFT")
|
||||
pfUI.gitter:SetPoint("BOTTOMRIGHT", 0, 0, "BOTTOMRIGHT")
|
||||
pfUI.gitter:SetBackdrop(pfUI.backdrop_gitter)
|
||||
pfUI.gitter:SetBackdropColor(0,0,0,1)
|
||||
|
||||
local movable = { pfUI.minimap, pfUI.chat.left, pfUI.chat.right,
|
||||
pfUI.uf.player, pfUI.uf.target, pfUI.uf.targettarget, pfUI.uf.pet,
|
||||
pfUI.bars.shapeshift, pfUI.bars.bottomleft, pfUI.bars.bottomright,
|
||||
pfUI.bars.vertical, pfUI.bars.pet, pfUI.bars.bottom }
|
||||
|
||||
for _,frame in pairs(movable) do
|
||||
local frame = frame
|
||||
frame:Show()
|
||||
frame:SetMovable(true)
|
||||
|
||||
frame.drag = CreateFrame("Frame", nil, frame)
|
||||
frame.drag:SetAllPoints(frame)
|
||||
frame.drag:SetFrameStrata("DIALOG")
|
||||
frame.drag.bg = frame.drag:CreateTexture()
|
||||
frame.drag.bg:SetAllPoints(frame.drag)
|
||||
frame.drag.bg:SetTexture(.2,1,.8,1)
|
||||
frame.drag:SetAlpha(.25)
|
||||
frame.drag:EnableMouse(true)
|
||||
|
||||
frame.drag:SetScript("OnMouseDown",function()
|
||||
frame:StartMoving()
|
||||
end)
|
||||
|
||||
frame.drag:SetScript("OnMouseUp",function()
|
||||
frame:StopMovingOrSizing()
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
pfUI.cache = CreateFrame("Frame",nil,UIParent)
|
||||
pfUI.cache:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
pfUI.cache:SetScript("OnEvent", function()
|
||||
_, class = UnitClass("player")
|
||||
local color = RAID_CLASS_COLORS[class]
|
||||
pfUI.cache.class_r, pfUI.cache.class_g, pfUI.cache.class_b = (color.r + .5) * .5, (color.g + .5) * .5, (color.b + .5) * .5
|
||||
|
||||
end)
|
||||
|
||||
message = function (msg)
|
||||
DEFAULT_CHAT_FRAME:AddMessage("|cffcccc33INFO: |cffffff55"..msg)
|
||||
end
|
||||
|
||||
ScriptErrors:SetScript("OnShow", function(msg)
|
||||
DEFAULT_CHAT_FRAME:AddMessage("|cffcc3333ERROR: |cffff5555"..ScriptErrors_Message:GetText())
|
||||
ScriptErrors:Hide()
|
||||
end)
|
||||
|
||||
pfUI.uf = CreateFrame("Frame",nil,UIParent)
|
||||
@@ -0,0 +1,28 @@
|
||||
## Interface: 11200
|
||||
## Title: |cff33ffccpf|cffffffffUI
|
||||
## Author: Eric (Shagu) Mauser, 2016
|
||||
## Notes: An User Intface written completely from scratch
|
||||
## Version: 0.1 BETA
|
||||
# XXSavedVariables: pfUI.config, pfUI.playerDB
|
||||
|
||||
# main
|
||||
pfUI.lua
|
||||
|
||||
env\colors.lua
|
||||
env\locales.lua
|
||||
|
||||
modules\actionbar.lua
|
||||
modules\chat.lua
|
||||
modules\font.lua
|
||||
modules\panel.lua
|
||||
modules\player.lua
|
||||
modules\target.lua
|
||||
modules\targettarget.lua
|
||||
modules\pet.lua
|
||||
modules\minimap.lua
|
||||
modules\skin.lua
|
||||
modules\xpbar.lua
|
||||
modules\autoshift.lua
|
||||
modules\bags.lua
|
||||
modules\cooldown.lua
|
||||
modules\uf_tukui.lua
|
||||
Reference in New Issue
Block a user