Skip to content

Commit

Permalink
pfUI update
Browse files Browse the repository at this point in the history
  • Loading branch information
KasVital committed Jan 15, 2017
1 parent 177bca5 commit 7693cab
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 7 deletions.
4 changes: 3 additions & 1 deletion pfUI/modules/bags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ pfUI:RegisterModule("bags", function ()
if pfUI.chat then
pfUI.bag.left:SetPoint("BOTTOMLEFT", pfUI.chat.left, "BOTTOMLEFT", 0, 0)
pfUI.bag.left:SetPoint("BOTTOMRIGHT", pfUI.chat.left, "BOTTOMRIGHT", 0, 0)
pfUI.bag.left:SetWidth(pfUI_config.chat.left.width)
else
pfUI.bag.left:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 5, 5)
pfUI.bag.left:SetWidth(pfUI_config.chat.left.width)
Expand All @@ -182,6 +183,7 @@ pfUI:RegisterModule("bags", function ()
if pfUI.chat then
pfUI.bag.right:SetPoint("BOTTOMLEFT", pfUI.chat.right, "BOTTOMLEFT", 0, 0)
pfUI.bag.right:SetPoint("BOTTOMRIGHT", pfUI.chat.right, "BOTTOMRIGHT", 0, 0)
pfUI.bag.right:SetWidth(pfUI_config.chat.right.width)
else
pfUI.bag.right:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -5, 5)
pfUI.bag.right:SetWidth(pfUI_config.chat.right.width)
Expand All @@ -196,7 +198,7 @@ pfUI:RegisterModule("bags", function ()
frame:SetFrameStrata("HIGH")
pfUI.api:CreateBackdrop(frame, default_border)

pfUI.bag.button_size = (frame:GetWidth() / frame:GetEffectiveScale() - 2*default_border - 9*default_border*3)/ 10
pfUI.bag.button_size = (frame:GetWidth() - 2*default_border - 9*default_border*3)/ 10
local topspace = pfUI.bag.right.close:GetHeight() + default_border * 2

for id, bag in pairs(iterate) do
Expand Down
29 changes: 26 additions & 3 deletions pfUI/modules/chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,19 @@ pfUI:RegisterModule("chat", function ()
if pfUI_config.chat.global.custombg == "1" then
local r, g, b, a = pfUI.api.strsplit(",", pfUI_config.chat.global.background)
pfUI.chat.left.backdrop:SetBackdropColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a))

local r, g, b, a = pfUI.api.strsplit(",", pfUI_config.chat.global.border)
pfUI.chat.left.backdrop:SetBackdropBorderColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a))
end

pfUI.chat.left.panelTop = CreateFrame("Frame", "leftChatPanelTop", pfUI.chat.left)
pfUI.chat.left.panelTop:ClearAllPoints()
pfUI.chat.left.panelTop:SetHeight(pfUI_config.global.font_size+default_border*2)
pfUI.chat.left.panelTop:SetPoint("TOPLEFT", pfUI.chat.left, "TOPLEFT", default_border, -default_border)
pfUI.chat.left.panelTop:SetPoint("TOPRIGHT", pfUI.chat.left, "TOPRIGHT", -default_border, -default_border)
pfUI.api:CreateBackdrop(pfUI.chat.left.panelTop, default_border, nil, true)
if pfUI_config.chat.global.tabdock == "1" then
pfUI.api:CreateBackdrop(pfUI.chat.left.panelTop, default_border, nil, true)
end

-- whisper forwarding
pfUI.chat.left.panelTop.proxy = CreateFrame("Button", "leftChatWhisperProxy", pfUI.chat.left.panelTop)
Expand Down Expand Up @@ -184,14 +189,19 @@ pfUI:RegisterModule("chat", function ()
if pfUI_config.chat.global.custombg == "1" then
local r, g, b, a = pfUI.api.strsplit(",", pfUI_config.chat.global.background)
pfUI.chat.right.backdrop:SetBackdropColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a))

local r, g, b, a = pfUI.api.strsplit(",", pfUI_config.chat.global.border)
pfUI.chat.right.backdrop:SetBackdropBorderColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a))
end

pfUI.chat.right.panelTop = CreateFrame("Frame", "rightChatPanelTop", pfUI.chat.right)
pfUI.chat.right.panelTop:ClearAllPoints()
pfUI.chat.right.panelTop:SetHeight(pfUI_config.global.font_size+default_border*2)
pfUI.chat.right.panelTop:SetPoint("TOPLEFT", pfUI.chat.right, "TOPLEFT", default_border, -default_border)
pfUI.chat.right.panelTop:SetPoint("TOPRIGHT", pfUI.chat.right, "TOPRIGHT", -default_border, -default_border)
pfUI.api:CreateBackdrop(pfUI.chat.right.panelTop, default_border, nil, true)
if pfUI_config.chat.global.tabdock == "1" then
pfUI.api:CreateBackdrop(pfUI.chat.right.panelTop, default_border, nil, true)
end

pfUI.chat:RegisterEvent("PLAYER_ENTERING_WORLD")
pfUI.chat:RegisterEvent("UI_SCALE_CHANGED")
Expand All @@ -206,6 +216,13 @@ pfUI:RegisterModule("chat", function ()
function pfUI.chat:RefreshChat()
local panelheight = pfUI_config.global.font_size+default_border*5

if pfUI_config.chat.global.sticky == "1" then
ChatTypeInfo.WHISPER.sticky = 1
ChatTypeInfo.OFFICER.sticky = 1
ChatTypeInfo.RAID_WARNING.sticky = 1
ChatTypeInfo.CHANNEL.sticky = 1
end

for i,v in ipairs({ChatFrameMenuButton:GetRegions()}) do
v:SetAllPoints(ChatFrameMenuButton)
local _, class = UnitClass("player")
Expand All @@ -217,7 +234,13 @@ pfUI:RegisterModule("chat", function ()
local frame = getglobal("ChatFrame"..i)
local tab = getglobal("ChatFrame"..i.."Tab")

frame:SetTimeVisible(tonumber(pfUI_config.chat.global.fadetime))

if pfUI_config.chat.global.fadeout == "1" then
frame:SetFading(true)
frame:SetTimeVisible(tonumber(pfUI_config.chat.global.fadetime))
else
frame:SetFading(false)
end

if i == 3 and pfUI_config.chat.right.enable == "1" then
tab:SetParent(pfUI.chat.right.panelTop)
Expand Down
6 changes: 5 additions & 1 deletion pfUI/modules/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,15 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("chat", "right", "enable", "0")
pfUI:UpdateConfig("chat", "right", "width", "380")
pfUI:UpdateConfig("chat", "right", "height", "180")
pfUI:UpdateConfig("chat", "global", "tabdock", "1")
pfUI:UpdateConfig("chat", "global", "custombg", "0")
pfUI:UpdateConfig("chat", "global", "background", ".2,.2,.2,.5")
pfUI:UpdateConfig("chat", "global", "border", ".4,.4,.4,.5")
pfUI:UpdateConfig("chat", "global", "whispermod", "1")
pfUI:UpdateConfig("chat", "global", "whisper", "1,.6,1,1")
pfUI:UpdateConfig("chat", "global", "fadetime", "86400")
pfUI:UpdateConfig("chat", "global", "sticky", "1")
pfUI:UpdateConfig("chat", "global", "fadeout", "0")
pfUI:UpdateConfig("chat", "global", "fadetime", "300")

pfUI:UpdateConfig("nameplates", nil, "showcastbar", "1")
pfUI:UpdateConfig("nameplates", nil, "spellname", "0")
Expand Down
8 changes: 6 additions & 2 deletions pfUI/modules/gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -988,10 +988,14 @@ pfUI:RegisterModule("gui", function ()
pfUI.gui:CreateConfig(pfUI.gui.chat, "Left chat height:", pfUI_config.chat.left, "height")
pfUI.gui:CreateConfig(pfUI.gui.chat, "Right chat width:", pfUI_config.chat.right, "width")
pfUI.gui:CreateConfig(pfUI.gui.chat, "Right chat height:", pfUI_config.chat.right, "height")
pfUI.gui:CreateConfig(pfUI.gui.chat, "Use custom background:", pfUI_config.chat.global, "custombg", "checkbox")
pfUI.gui:CreateConfig(pfUI.gui.chat, "Background color:", pfUI_config.chat.global, "background", "color")
pfUI.gui:CreateConfig(pfUI.gui.chat, "Display chat-tab dock as panel:", pfUI_config.chat.global, "tabdock", "checkbox")
pfUI.gui:CreateConfig(pfUI.gui.chat, "Use custom colors for chats:", pfUI_config.chat.global, "custombg", "checkbox")
pfUI.gui:CreateConfig(pfUI.gui.chat, "Chat Background color:", pfUI_config.chat.global, "background", "color")
pfUI.gui:CreateConfig(pfUI.gui.chat, "Chat Border color:", pfUI_config.chat.global, "border", "color")
pfUI.gui:CreateConfig(pfUI.gui.chat, "Change layout of incoming whispers:", pfUI_config.chat.global, "whispermod", "checkbox")
pfUI.gui:CreateConfig(pfUI.gui.chat, "Color of incoming whispers:", pfUI_config.chat.global, "whisper", "color")
pfUI.gui:CreateConfig(pfUI.gui.chat, "Use sticky chat (remember last channel):", pfUI_config.chat.global, "sticky", "checkbox")
pfUI.gui:CreateConfig(pfUI.gui.chat, "Fade old chat messages:", pfUI_config.chat.global, "fadeout", "checkbox")
pfUI.gui:CreateConfig(pfUI.gui.chat, "Time in seconds until the chat gets faded:", pfUI_config.chat.global, "fadetime")

-- nameplates
Expand Down
4 changes: 4 additions & 0 deletions pfUI/modules/target.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ pfUI:RegisterModule("target", function ()
GameTooltip:FadeOut()
end)

pfUI.uf.target:SetScript("OnHide", function()
CloseDropDownMenus()
end)

pfUI.uf.target:SetScript("OnClick", function ()
if arg1 == "RightButton" then
ToggleDropDownMenu(1, nil, TargetFrameDropDown, "cursor")
Expand Down

0 comments on commit 7693cab

Please sign in to comment.