From 34f61e5f7091b4c6fa9e99317af9504a561dbb10 Mon Sep 17 00:00:00 2001 From: shagu Date: Thu, 4 Jan 2018 23:17:59 +0100 Subject: [PATCH] thirdparty: add option to use chat colors --- api/config.lua | 1 + modules/gui.lua | 1 + modules/thirdparty.lua | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/api/config.lua b/api/config.lua index 4a66f79f..466fbaf0 100644 --- a/api/config.lua +++ b/api/config.lua @@ -559,6 +559,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("nameplates", nil, "heighthealth", "8") pfUI:UpdateConfig("nameplates", nil, "heightcast", "8") pfUI:UpdateConfig("nameplates", nil, "cpdisplay", "0") + pfUI:UpdateConfig("thirdparty", nil, "chatbg", "0") pfUI:UpdateConfig("thirdparty", "dpsmate", "skin", "0") pfUI:UpdateConfig("thirdparty", "dpsmate", "dock", "0") pfUI:UpdateConfig("thirdparty", "swstats", "skin", "0") diff --git a/modules/gui.lua b/modules/gui.lua index 5746fcff..ac6a0a7f 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -1422,6 +1422,7 @@ pfUI:RegisterModule("gui", function () pfUI.gui.tabs.thirdparty.tabs.general = pfUI.gui.tabs.thirdparty.tabs:CreateTabChild(T["Thirdparty"], true) pfUI.gui.tabs.thirdparty.tabs.general:SetScript("OnShow", function() if not this.setup then + CreateConfig(this, T["Use Chat Colors for Meters"], C.thirdparty, "chatbg", "checkbox") CreateConfig(this, T["DPSMate (Skin)"], C.thirdparty.dpsmate, "skin", "checkbox") CreateConfig(this, T["DPSMate (Dock)"], C.thirdparty.dpsmate, "dock", "checkbox") CreateConfig(this, T["SWStats (Skin)"], C.thirdparty.swstats, "skin", "checkbox") diff --git a/modules/thirdparty.lua b/modules/thirdparty.lua index 06f69301..b9513f4b 100644 --- a/modules/thirdparty.lua +++ b/modules/thirdparty.lua @@ -150,8 +150,17 @@ pfUI:RegisterModule("thirdparty", function () -- remove titlebar KLHTM_Gui.title.back:Hide() KLHTM_SetGuiScale(.9) + CreateBackdrop(KLHTM_Frame) + if C.thirdparty.chatbg == "1" then + local r, g, b, a = strsplit(",", C.chat.global.background) + KLHTM_Frame.backdrop:SetBackdropColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a)) + + local r, g, b, a = strsplit(",", C.chat.global.border) + KLHTM_Frame.backdrop:SetBackdropBorderColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a)) + end + -- theme buttons local buttons = { "KLHTM_TitleFrameClose", "KLHTM_TitleFrameMinimise", "KLHTM_TitleFrameMaximise", "KLHTM_TitleFrameOptions", "KLHTM_TitleFramePin", @@ -265,6 +274,14 @@ pfUI:RegisterModule("thirdparty", function () for k, val in pairs(DPSMateSettings["windows"]) do local frame = _G["DPSMate_"..val["name"]] CreateBackdrop(frame) + + if C.thirdparty.chatbg == "1" then + local r, g, b, a = strsplit(",", C.chat.global.background) + frame.backdrop:SetBackdropColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a)) + + local r, g, b, a = strsplit(",", C.chat.global.border) + frame.backdrop:SetBackdropBorderColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a)) + end end end end @@ -322,6 +339,14 @@ pfUI:RegisterModule("thirdparty", function () CreateBackdrop(SW_BarFrame1) + if C.thirdparty.chatbg == "1" then + local r, g, b, a = strsplit(",", C.chat.global.background) + SW_BarFrame1.backdrop:SetBackdropColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a)) + + local r, g, b, a = strsplit(",", C.chat.global.border) + SW_BarFrame1.backdrop:SetBackdropBorderColor(tonumber(r), tonumber(g), tonumber(b), tonumber(a)) + end + CreateBackdrop(SW_BarSettingsFrameV2) CreateBackdrop(SW_BarSettingsFrameV2_Title, 0) CreateBackdrop(SW_BarSettingsFrameV2_Tab1, 0)