/
}, |
} |
}, |
fonts = { |
name = 'Fonts', |
type = 'group', |
args = { |
options = { |
name = 'Global font settings', |
type = 'group', |
inline = true, |
args = { |
font = { |
name = 'Font', |
desc = 'The font used for all text on nameplates', |
type = 'select', |
dialogControl = 'LSM30_Font', |
values = AceGUIWidgetLSMlists.font, |
}, |
fontscale = { |
name = 'Font scale', |
desc = 'The scale of all fonts displayed on nameplates', |
type = 'range', |
min = 0.01, |
softMax = 2, |
}, |
outline = { |
name = 'Outline', |
desc = 'Dsiplay an outline on all fonts', |
type = 'toggle', |
}, |
monochrome = { |
name = 'Monochrome', |
desc = 'Don\'t anti-alias fonts', |
type = 'toggle' |
}, |
} |
}, |
sizes = { |
name = 'Sizes', |
type = 'group', |
inline = true, |
args = { |
combopoints = { |
name = 'Combo points', |
type = 'range', |
min = 1, |
softMax = 20 |
}, |
large = { |
name = 'Large', |
desc = 'Used for health on normal nameplates', |
type = 'range', |
min = 1, |
softMax = 20 |
}, |
spellname = { |
name = 'Spell name', |
type = 'range', |
min = 1, |
softMax = 20 |
}, |
name = { |
name = 'Name & level', |
type = 'range', |
min = 1, |
softMax = 20 |
}, |
small = { |
name = 'Small', |
desc = 'Used for contextual health on normal nameplates and name on trivial nameplates', |
type = 'range', |
min = 1, |
softMax = 20 |
}, |
} |
} |
} |
}, |
reload = { |
name = 'Reload UI', |
type = 'execute', |
} |
} |
local fontsOptions = { |
name = 'Fonts', |
handler = addon:GetOptionHandler(addon), |
type = 'group', |
get = 'Get', |
set = 'Set', |
args = { |
fontoptions = { |
name = 'Global font settings', |
type = 'group', |
inline = true, |
args = { |
font = { |
name = 'Font', |
desc = 'The font used for all text on nameplates', |
type = 'select', |
dialogControl = 'LSM30_Font', |
values = AceGUIWidgetLSMlists.font, |
}, |
fontscale = { |
name = 'Font scale', |
desc = 'The scale of all fonts displayed on nameplates', |
type = 'range', |
min = 0.01, |
softMax = 2, |
}, |
outline = { |
name = 'Outline', |
desc = 'Dsiplay an outline on all fonts', |
type = 'toggle', |
}, |
monochrome = { |
name = 'Monochrome', |
desc = 'Don\'t anti-alias fonts', |
type = 'toggle' |
}, |
} |
}, |
fontsizes = { |
name = 'Sizes', |
type = 'group', |
inline = true, |
args = { |
combopoints = { |
name = 'Combo points', |
type = 'range', |
min = 1, |
softMax = 20 |
}, |
large = { |
name = 'Large', |
desc = 'Used for health on normal nameplates', |
type = 'range', |
min = 1, |
softMax = 20 |
}, |
spellname = { |
name = 'Spell name', |
type = 'range', |
min = 1, |
softMax = 20 |
}, |
name = { |
name = 'Name & level', |
type = 'range', |
min = 1, |
softMax = 20 |
}, |
small = { |
name = 'Small', |
desc = 'Used for contextual health on normal nameplates and name on trivial nameplates', |
type = 'range', |
min = 1, |
softMax = 20 |
}, |
} |
} |
} |
} |
-- create module.ConfigChanged function |
-- TODO cycle these when changing profiles (or something) |
function addon:CreateConfigChangedListener(module) |
AceConfig:RegisterOptionsTable('kuinameplates', options) |
AceConfigDialog:AddToBlizOptions('kuinameplates', 'Kui Nameplates') |
AceConfig:RegisterOptionsTable('kuinameplatesfonts', fontsOptions) |
AceConfigDialog:AddToBlizOptions('kuinameplatesfonts', 'Fonts', 'Kui Nameplates') |
end |
--------------------------------------------------------------- Slash command -- |
tapped = true, -- use grey health bar colour for tapped units |
smooth = true -- smoothly animate health bar changes |
}, |
fontoptions = { |
font = (latin and 'Yanone Kaffesatz' or LSM:GetDefault(LSM.MediaType.FONT)), |
fontscale = 1.0, |
outline = true, |
monochrome = false, |
}, |
fontsizes = { |
combopoints = 13, |
large = 10, |
spellname = 9, |
name = 9, |
small = 8 |
}, |
fonts = { |
options = { |
font = (latin and 'Yanone Kaffesatz' or LSM:GetDefault(LSM.MediaType.FONT)), |
fontscale = 1.0, |
outline = true, |
monochrome = false, |
}, |
sizes = { |
combopoints = 13, |
large = 10, |
spellname = 9, |
name = 9, |
small = 8 |
}, |
} |
} |
} |
function kn:ScaleFontSizes() |
local k, size |
for k, size in pairs(defaultSizes.font) do |
self.fontSizes[k] = size * profile.fontoptions.fontscale |
self.fontSizes[k] = size * profile.fonts.options.fontscale |
if uiscale then |
self.fontSizes[k] = self.fontSizes[k] / uiscale |
self:ScaleFontSizes() |
-- fetch font path from lsm |
self.font = LSM:Fetch(LSM.MediaType.FONT, profile.fontoptions.font) |
self.font = LSM:Fetch(LSM.MediaType.FONT, profile.fonts.options.font) |
-------------------------------------- Health bar smooth update functions -- |
-- (spoon-fed by oUF_Smooth) |
frame.castbar.shield:Hide() |
-- cast bar text ------------------------------------------------------- |
if self.db.profile.spellname then |
if self.db.profile.display.spellname then |
frame.castbar.name = frame:CreateFontString(frame.castbar, { |
font = addon.font, size = 'name', outline = "OUTLINE" }) |
frame.castbar.name:SetPoint('TOPLEFT', frame.castbar.bg, 'BOTTOMLEFT', 2, -2) |
frame.castbar.name:SetJustifyH('LEFT') |
end |
if self.db.profile.casttime then |
if self.db.profile.display.casttime then |
frame.castbar.max = frame:CreateFontString(frame.castbar, { |
font = addon.font, size = 'name', outline = "OUTLINE" }) |
frame.castbar.max:SetPoint('TOPRIGHT', frame.castbar.bg, 'BOTTOMRIGHT', -2, -1) |
-- scripts ------------------------------------------------------------- |
frame.castbar:HookScript('OnShow', function(bar) |
if bar.interruptible then |
bar.bar:SetStatusBarColor(unpack(self.db.profile.barcolour)) |
bar.bar:SetStatusBarColor(unpack(self.db.profile.display.barcolour)) |
bar.shield:Hide() |
else |
bar.bar:SetStatusBarColor(.8, .1, .1) |
self.db = addon.db:RegisterNamespace(self.moduleName, { |
profile = { |
enabled = true, |
casttime = true, |
spellname = true, |
spellicon = true, |
barcolour = { .43, .47, .55, 1 }, |
display = { |
casttime = true, |
spellname = true, |
spellicon = true, |
barcolour = { .43, .47, .55, 1 }, |
} |
} |
}) |