Working on the previous solution, maybe:
Lua Code:
G["castbar"] = {
["player"] = {
["width"] = 350,
["height"] = 35,
["point"] = {"CENTER", UIParent, "CENTER", 250, -200},
["iconSize"] = "height",
["spacing"] = 2,
},
}
then when using the configuration do something like:
Lua Code:
local height = G["castbar"]["player"]["height"]
local iconSize = G["castbar"]["player"]["iconSize"]
if iconSize=="height" then
iconSize = height
end
castbar:SetHeight(height)
icon:SetSize(iconSize,iconSize)
If in the future you decide to set iconSize to lets say 50, you just need to change the configuration value from "height" to 50, the code the uses the configuration will still work.