mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-23 08:06:55 +00:00
thirdparty: add ktm support
This commit is contained in:
Vendored
+4
@@ -198,11 +198,15 @@ function pfUI.api:SkinButton(button, cr, cg, cb)
|
||||
b:SetHighlightTexture(nil)
|
||||
b:SetPushedTexture(nil)
|
||||
b:SetDisabledTexture(nil)
|
||||
local funce = b:GetScript("OnEnter")
|
||||
local funcl = b:GetScript("OnLeave")
|
||||
b:SetScript("OnEnter", function()
|
||||
if funce then funce() end
|
||||
pfUI.api:CreateBackdrop(b, nil, true)
|
||||
b:SetBackdropBorderColor(cr,cg,cb,1)
|
||||
end)
|
||||
b:SetScript("OnLeave", function()
|
||||
if funcl then funcl() end
|
||||
pfUI.api:CreateBackdrop(b, nil, true)
|
||||
end)
|
||||
b:SetFont(pfUI.font_default, pfUI_config.global.font_size, "OUTLINE")
|
||||
|
||||
@@ -145,6 +145,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("thirdparty", "wim", "enable", "1")
|
||||
pfUI:UpdateConfig("thirdparty", "healcomm", "enable", "1")
|
||||
pfUI:UpdateConfig("thirdparty", "cleanup", "enable", "1")
|
||||
pfUI:UpdateConfig("thirdparty", "ktm", "enable", "1")
|
||||
pfUI:UpdateConfig("position", nil, nil, nil)
|
||||
pfUI:UpdateConfig("disabled", nil, nil, nil)
|
||||
end
|
||||
|
||||
@@ -1013,6 +1013,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui:CreateConfig(pfUI.gui.thirdparty, "WIM:", pfUI_config.thirdparty.wim, "enable", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.thirdparty, "HealComm:", pfUI_config.thirdparty.healcomm, "enable", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.thirdparty, "CleanUp:", pfUI_config.thirdparty.cleanup, "enable", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.thirdparty, "KLH Threat Meter:", pfUI_config.thirdparty.ktm, "enable", "checkbox")
|
||||
|
||||
-- [[ bottom section ]] --
|
||||
|
||||
|
||||
+78
-1
@@ -86,7 +86,7 @@ pfUI:RegisterModule("thirdparty", function ()
|
||||
pfUIhookWIM_PostMessage = WIM_PostMessage
|
||||
WIM_PostMessage = function(user, msg, ttype, from, raw_msg)
|
||||
pfUIhookWIM_PostMessage(user, msg, ttype, from, raw_msg)
|
||||
pfUI.api:CreateBackdrop(getglobal("WIM_msgFrame" .. user))
|
||||
pfUI.api:CreateBackdrop(getglobal("WIM_msgFrame" .. user), nil, nil, true)
|
||||
getglobal("WIM_msgFrame" .. user .. "From"):ClearAllPoints()
|
||||
getglobal("WIM_msgFrame" .. user .. "From"):SetPoint("TOP", 0, -10)
|
||||
|
||||
@@ -392,4 +392,81 @@ pfUI:RegisterModule("thirdparty", function ()
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
local function pfSetupKTM()
|
||||
-- use pfUI border for main window
|
||||
pfUI.api:CreateBackdrop(KLHTM_Frame)
|
||||
|
||||
-- remove titlebar
|
||||
KLHTM_Gui.title.back:Hide()
|
||||
|
||||
-- theme buttons
|
||||
local buttons = { "KLHTM_TitleFrameClose", "KLHTM_TitleFrameMinimise",
|
||||
"KLHTM_TitleFrameMaximise", "KLHTM_TitleFrameOptions", "KLHTM_TitleFramePin",
|
||||
"KLHTM_TitleFrameUnpin", "KLHTM_TitleFrameSelfView", "KLHTM_TitleFrameRaidView",
|
||||
"KLHTM_TitleFrameMasterTarget", "KLHTM_SelfFrameBottomReset" }
|
||||
|
||||
for i, button in pairs(buttons) do
|
||||
local b = getglobal(button)
|
||||
pfUI.api:SkinButton(b)
|
||||
b:SetScale(.8)
|
||||
|
||||
-- remove red background on some buttons
|
||||
for i,v in ipairs({b:GetRegions()}) do
|
||||
if v.SetTexture and i == 1 then
|
||||
v:SetTexture(0,0,0,0)
|
||||
end
|
||||
end
|
||||
|
||||
local p,rt,rp,xo,yo = b:GetPoint()
|
||||
if not b.pfSet and i > 1 then
|
||||
b:SetPoint(p,rt,rp,xo - 3,yo)
|
||||
b.pfSet = true
|
||||
end
|
||||
end
|
||||
|
||||
-- name buttons
|
||||
KLHTM_TitleFrameClose:SetText("x")
|
||||
KLHTM_TitleFrameMinimise:SetText("_")
|
||||
KLHTM_TitleFrameMaximise:SetText("_")
|
||||
KLHTM_TitleFrameOptions:SetText("O")
|
||||
KLHTM_TitleFramePin:SetText("P")
|
||||
KLHTM_TitleFrameUnpin:SetText("U")
|
||||
KLHTM_TitleFrameSelfView:SetText("S")
|
||||
KLHTM_TitleFrameRaidView:SetText("R")
|
||||
KLHTM_TitleFrameMasterTarget:SetText("T")
|
||||
|
||||
-- skin rows (raid)
|
||||
for i in pairs(KLHTM_Gui.raid.rows) do
|
||||
KLHTM_Gui.raid.rows[i].bar:SetTexture("Interface\\AddOns\\pfUI\\img\\bar")
|
||||
KLHTM_Gui.raid.rows[i].bar:SetAlpha(.75)
|
||||
end
|
||||
|
||||
-- skin rows (self)
|
||||
for i in pairs(KLHTM_Gui.self.rows) do
|
||||
KLHTM_Gui.self.rows[i].bar:SetTexture("Interface\\AddOns\\pfUI\\img\\bar")
|
||||
KLHTM_Gui.self.rows[i].bar:SetAlpha(.75)
|
||||
end
|
||||
|
||||
-- remove seperators
|
||||
KLHTM_RaidFrameLine:Hide()
|
||||
KLHTM_RaidFrameBottomLine:Hide()
|
||||
KLHTM_SelfFrameLine:Hide()
|
||||
KLHTM_SelfFrameBottomLine:Hide()
|
||||
end
|
||||
|
||||
if pfUI_config.thirdparty.ktm.enable == "1" then
|
||||
if KLHTM_Gui then
|
||||
pfSetupKTM()
|
||||
else
|
||||
local pfHookKTM = CreateFrame("Frame", nil)
|
||||
pfHookKTM:RegisterEvent("VARIABLES_LOADED")
|
||||
pfHookKTM:SetScript("OnEvent",function()
|
||||
if KLHTM_Gui then
|
||||
pfHookKTM:UnregisterEvent("VARIABLES_LOADED")
|
||||
pfSetupKTM()
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
end)
|
||||
Reference in New Issue
Block a user