From fc3f4c5ceea38bf07340170fe91831439a63f39c Mon Sep 17 00:00:00 2001 From: jKalfis Date: Fri, 4 Sep 2026 11:19:39 +0100 Subject: [PATCH] Update config.lua --- config.lua | 238 ++++++++++++++++++++++------------------------------- 1 file changed, 98 insertions(+), 140 deletions(-) diff --git a/config.lua b/config.lua index 6eaceb1..1d0f326 100644 --- a/config.lua +++ b/config.lua @@ -21,21 +21,108 @@ local function GetPFUIFont() return pfUI.font_default end + if pfUI_config + and pfUI_config.global + and pfUI_config.global.font_default then + return pfUI_config.global.font_default + end + return "Interface\\AddOns\\pfUI\\fonts\\Myriad-Pro.ttf" end +local function GetPFUIBackgroundColor() + if pfUI_config + and pfUI_config.global + and pfUI_config.global.background_color then + return pfUI_config.global.background_color + end + + return "0,0,0,1" +end + local function GetPFUIBackgroundAlpha() - -- Try to use the pfUI global background alpha. if pfUI_config and pfUI_config.global and pfUI_config.global.background_alpha ~= nil then return tostring(pfUI_config.global.background_alpha) end - -- Fallback to the value commonly used by pfUI. return "0.75" end +------------------------------------------------------------ +-- Module defaults +------------------------------------------------------------ + +local function InitializeModule(module) + + if not module then + return + end + + -------------------------------------------------------- + -- No style selected by default. + -------------------------------------------------------- + + if module.use_pfui_style == nil then + module.use_pfui_style = "0" + end + + if module.use_custom_style == nil then + module.use_custom_style = "0" + end + + -------------------------------------------------------- + -- pfUI Style + -------------------------------------------------------- + + if module.pfui_background_alpha == nil then + module.pfui_background_alpha = GetPFUIBackgroundAlpha() + end + + -------------------------------------------------------- + -- Custom Style + -------------------------------------------------------- + + if not module.custom then + module.custom = {} + end + + local custom = module.custom + + if custom.remove_parchment == nil then + custom.remove_parchment = "1" + end + + if custom.background_color == nil then + custom.background_color = GetPFUIBackgroundColor() + end + + if custom.background_alpha == nil then + custom.background_alpha = GetPFUIBackgroundAlpha() + end + + if custom.font == nil then + custom.font = GetPFUIFont() + end + + -------------------------------------------------------- + -- DQB visual defaults + -- + -- Titles = Gold + -- Text = White + -------------------------------------------------------- + + if custom.title_color == nil then + custom.title_color = "1,0.82,0,1" + end + + if custom.text_color == nil then + custom.text_color = "1,1,1,1" + end + +end + ------------------------------------------------------------ -- Initialize configuration ------------------------------------------------------------ @@ -72,52 +159,9 @@ function DQB:InitializeConfig() pfUI_config.dqb.questgossip = {} end - local questgossip = pfUI_config.dqb.questgossip - - -- No style selected by default. - if questgossip.use_pfui_style == nil then - questgossip.use_pfui_style = "0" - end - - if questgossip.use_custom_style == nil then - questgossip.use_custom_style = "0" - end - - -- Custom settings. - if not questgossip.custom then - questgossip.custom = {} - end - - local custom = questgossip.custom - - if custom.remove_parchment == nil then - custom.remove_parchment = "1" - end - - if custom.background_color == nil then - custom.background_color = "000000" - end - - if custom.background_alpha == nil then - custom.background_alpha = GetPFUIBackgroundAlpha() - end - - if custom.font == nil then - custom.font = GetPFUIFont() - end - - if custom.title_color == nil then - custom.title_color = "ffd700" - end - - if custom.text_color == nil then - custom.text_color = "ffffff" - end - - -- Separate opacity for the pfUI preset. - if questgossip.pfui_background_alpha == nil then - questgossip.pfui_background_alpha = GetPFUIBackgroundAlpha() - end + InitializeModule( + pfUI_config.dqb.questgossip + ) -------------------------------------------------------- -- Quest Log @@ -127,52 +171,9 @@ function DQB:InitializeConfig() pfUI_config.dqb.questlog = {} end - local questlog = pfUI_config.dqb.questlog - - -- No style selected by default. - if questlog.use_pfui_style == nil then - questlog.use_pfui_style = "0" - end - - if questlog.use_custom_style == nil then - questlog.use_custom_style = "0" - end - - -- Custom settings. - if not questlog.custom then - questlog.custom = {} - end - - local custom = questlog.custom - - if custom.remove_parchment == nil then - custom.remove_parchment = "1" - end - - if custom.background_color == nil then - custom.background_color = "000000" - end - - if custom.background_alpha == nil then - custom.background_alpha = GetPFUIBackgroundAlpha() - end - - if custom.font == nil then - custom.font = GetPFUIFont() - end - - if custom.title_color == nil then - custom.title_color = "ffd700" - end - - if custom.text_color == nil then - custom.text_color = "ffffff" - end - - -- Separate opacity for the pfUI preset. - if questlog.pfui_background_alpha == nil then - questlog.pfui_background_alpha = GetPFUIBackgroundAlpha() - end + InitializeModule( + pfUI_config.dqb.questlog + ) -------------------------------------------------------- -- Books @@ -182,52 +183,9 @@ function DQB:InitializeConfig() pfUI_config.dqb.books = {} end - local books = pfUI_config.dqb.books - - -- No style selected by default. - if books.use_pfui_style == nil then - books.use_pfui_style = "0" - end - - if books.use_custom_style == nil then - books.use_custom_style = "0" - end - - -- Custom settings. - if not books.custom then - books.custom = {} - end - - local custom = books.custom - - if custom.remove_parchment == nil then - custom.remove_parchment = "1" - end - - if custom.background_color == nil then - custom.background_color = "000000" - end - - if custom.background_alpha == nil then - custom.background_alpha = GetPFUIBackgroundAlpha() - end - - if custom.font == nil then - custom.font = GetPFUIFont() - end - - if custom.title_color == nil then - custom.title_color = "ffd700" - end - - if custom.text_color == nil then - custom.text_color = "ffffff" - end - - -- Separate opacity for the pfUI preset. - if books.pfui_background_alpha == nil then - books.pfui_background_alpha = GetPFUIBackgroundAlpha() - end + InitializeModule( + pfUI_config.dqb.books + ) -------------------------------------------------------- -- Merchant