Update config.lua

Modified the GUI
This commit is contained in:
jKalfis
2026-09-04 11:06:57 +01:00
committed by GitHub
parent deec91ba94
commit c152ad2c7f
+113 -54
View File
@@ -1,17 +1,47 @@
------------------------------------------------------------
-- pfUI-DQB
-- config.lua
--
-- Default configuration for DQB.
-- GUI registration is handled by gui.lua.
------------------------------------------------------------
local DQB = pfUI and pfUI.dqb
if not DQB then
return
end
-- Default configuration
------------------------------------------------------------
-- Helpers
------------------------------------------------------------
local function GetPFUIFont()
if pfUI and pfUI.font_default then
return pfUI.font_default
end
return "Interface\\AddOns\\pfUI\\fonts\\Myriad-Pro.ttf"
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
------------------------------------------------------------
-- Initialize configuration
------------------------------------------------------------
function DQB:InitializeConfig()
-- Root
if not pfUI_config then
pfUI_config = {}
end
@@ -19,8 +49,11 @@ function DQB:InitializeConfig()
if not pfUI_config.dqb then
pfUI_config.dqb = {}
end
-- GENERAL
--------------------------------------------------------
-- General
--------------------------------------------------------
if not pfUI_config.dqb.general then
pfUI_config.dqb.general = {}
end
@@ -30,24 +63,27 @@ function DQB:InitializeConfig()
if general.enable == nil then
general.enable = "1"
end
-- QUEST & GOSSIP
--------------------------------------------------------
-- Quest & Gossip
--------------------------------------------------------
if not pfUI_config.dqb.questgossip then
pfUI_config.dqb.questgossip = {}
end
local questgossip = pfUI_config.dqb.questgossip
-- Presets
if questgossip.pfui_style == nil then
questgossip.pfui_style = "0"
-- No style selected by default.
if questgossip.use_pfui_style == nil then
questgossip.use_pfui_style = "0"
end
if questgossip.fix_fonts == nil then
questgossip.fix_fonts = "0"
if questgossip.use_custom_style == nil then
questgossip.use_custom_style = "0"
end
-- Custom
-- Custom settings.
if not questgossip.custom then
questgossip.custom = {}
end
@@ -59,42 +95,50 @@ function DQB:InitializeConfig()
end
if custom.background_color == nil then
custom.background_color = "0,0,0,0.85"
custom.background_color = "000000"
end
if custom.background_alpha == nil then
custom.background_alpha = "0.85"
custom.background_alpha = GetPFUIBackgroundAlpha()
end
if custom.font == nil then
custom.font = "Interface\\AddOns\\pfUI\\fonts\\Myriad-Pro.ttf"
custom.font = GetPFUIFont()
end
if custom.title_color == nil then
custom.title_color = "1,0.84,0"
custom.title_color = "ffd700"
end
if custom.text_color == nil then
custom.text_color = "1,1,1"
custom.text_color = "ffffff"
end
-- QUEST LOG
-- Separate opacity for the pfUI preset.
if questgossip.pfui_background_alpha == nil then
questgossip.pfui_background_alpha = GetPFUIBackgroundAlpha()
end
--------------------------------------------------------
-- Quest Log
--------------------------------------------------------
if not pfUI_config.dqb.questlog then
pfUI_config.dqb.questlog = {}
end
local questlog = pfUI_config.dqb.questlog
-- Presets
if questlog.pfui_style == nil then
questlog.pfui_style = "0"
-- No style selected by default.
if questlog.use_pfui_style == nil then
questlog.use_pfui_style = "0"
end
if questlog.fix_fonts == nil then
questlog.fix_fonts = "0"
if questlog.use_custom_style == nil then
questlog.use_custom_style = "0"
end
-- Custom
-- Custom settings.
if not questlog.custom then
questlog.custom = {}
end
@@ -106,43 +150,50 @@ function DQB:InitializeConfig()
end
if custom.background_color == nil then
custom.background_color = "0,0,0,0.85"
custom.background_color = "000000"
end
if custom.background_alpha == nil then
custom.background_alpha = "0.85"
custom.background_alpha = GetPFUIBackgroundAlpha()
end
if custom.font == nil then
custom.font = "Interface\\AddOns\\pfUI\\fonts\\Myriad-Pro.ttf"
custom.font = GetPFUIFont()
end
if custom.title_color == nil then
custom.title_color = "1,0.84,0"
custom.title_color = "ffd700"
end
if custom.text_color == nil then
custom.text_color = "1,1,1"
custom.text_color = "ffffff"
end
-- BOOKS
-- Books corresponds to brues pfUI's itemtext.lua.
-- Separate opacity for the pfUI preset.
if questlog.pfui_background_alpha == nil then
questlog.pfui_background_alpha = GetPFUIBackgroundAlpha()
end
--------------------------------------------------------
-- Books
--------------------------------------------------------
if not pfUI_config.dqb.books then
pfUI_config.dqb.books = {}
end
local books = pfUI_config.dqb.books
-- Presets
if books.pfui_style == nil then
books.pfui_style = "0"
-- No style selected by default.
if books.use_pfui_style == nil then
books.use_pfui_style = "0"
end
if books.fix_fonts == nil then
books.fix_fonts = "0"
if books.use_custom_style == nil then
books.use_custom_style = "0"
end
-- Custom
-- Custom settings.
if not books.custom then
books.custom = {}
end
@@ -154,29 +205,37 @@ function DQB:InitializeConfig()
end
if custom.background_color == nil then
custom.background_color = "0,0,0,0.85"
custom.background_color = "000000"
end
if custom.background_alpha == nil then
custom.background_alpha = "0.85"
custom.background_alpha = GetPFUIBackgroundAlpha()
end
if custom.font == nil then
custom.font = "Interface\\AddOns\\pfUI\\fonts\\Myriad-Pro.ttf"
custom.font = GetPFUIFont()
end
if custom.title_color == nil then
custom.title_color = "1,0.84,0"
custom.title_color = "ffd700"
end
if custom.text_color == nil then
custom.text_color = "1,1,1"
custom.text_color = "ffffff"
end
-- MERCHANT
-- Kept untouched for now.
-- Separate opacity for the pfUI preset.
if books.pfui_background_alpha == nil then
books.pfui_background_alpha = GetPFUIBackgroundAlpha()
end
--------------------------------------------------------
-- Merchant
--
-- Reserved for later.
--------------------------------------------------------
if not pfUI_config.dqb.merchant then
pfUI_config.dqb.merchant = {}
end
end