WoWInterface SVN KuiNameplates

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 119 to Rev 118
    Reverse comparison

Rev 119 → Rev 118

Kui_Nameplates/config.lua
1,5 → 1,4
local addon, ns = ...
local kui = LibStub('Kui-1.0')
 
------------------------------------------------------------------ Ace config --
local AceConfig = LibStub('AceConfig-3.0')
7,6 → 6,23
 
--------------------------------------------------------------- Options table --
do
local fontSelection = {
'Yanone Kaffeesatz',
'Accidental Presidency',
'Standard font (Friz Quadrata)',
'Chat font (Arial Narrow)',
'Morpheus',
'Skurri',
}
local fontSelectionValues = {
kui.m.f.yanone,
kui.m.f.accid,
STANDARD_TEXT_FONT,
select(1, DEFAULT_CHAT_FRAME:GetFont()),
'Fonts\\MORPHEUS.ttf',
'Fonts\\skurri.ttf',
}
 
local handler = {}
local options = {
name = 'Kui Nameplates',
54,17 → 70,17
name = 'Font',
desc = 'The font used for all text on frames',
type = 'select',
dialogControl = 'LSM30_Font',
values = AceGUIWidgetLSMlists.font,
order = 4
get = 'GetFont',
set = 'SetFont',
values = fontSelection
},
fontscale = {
name = 'Font scale',
desc = 'The scale of all fonts displayed on nameplates',
type = 'range',
min = 0.01,
min = 0,
softMax = 2,
order = 5
order = 4
}
}
},
267,7 → 283,23
ns.db.profile[info[1]][info[#info]] = val
end
end
 
function handler:GetFont(info)
local path = ns.db.profile[info[1]][info[#info]]
 
for id, thisPath in pairs(fontSelectionValues) do
if path == thisPath then
return id
end
end
 
return 1
end
 
function handler:SetFont(info, val)
ns.db.profile[info[1]][info[#info]] = fontSelectionValues[val]
end
 
AceConfig:RegisterOptionsTable('kuinameplates', options)
AceConfigDialog:AddToBlizOptions('kuinameplates', 'Kui Nameplates')
end
Kui_Nameplates/lib/embeds.xml
1,14 → 1,10
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
<Script file="LibStub\LibStub.lua"/>
<Include file="Kui\kui.xml"/>
 
<Include file="Ace3\CallbackHandler-1.0\CallbackHandler-1.0.xml"/>
<Include file="Ace3\AceAddon-3.0\AceAddon-3.0.xml"/>
<Include file="Ace3\AceDB-3.0\AceDB-3.0.xml"/>
<Include file="Ace3\AceDBOptions-3.0\AceDBOptions-3.0.xml"/>
<Include file="Ace3\AceGUI-3.0\AceGUI-3.0.xml"/>
<Include file="Ace3\AceConfig-3.0\AceConfig-3.0.xml"/>
 
<Include file="LibSharedMedia-3.0\lib.xml"/>
<Include file="Ace3\AceGUI-3.0-SharedMediaWidgets\widget.xml"/>
<Include file="Ace3\AceDB-3.0\AceDB-3.0.xml"/>
<Include file="Ace3\AceDBOptions-3.0\AceDBOptions-3.0.xml"/>
</Ui>
Kui_Nameplates/core.lua
4,18 → 4,10
]]
local addon, ns = ...
local kui = LibStub('Kui-1.0')
local LSM = LibStub('LibSharedMedia-3.0')
 
LibStub('AceAddon-3.0'):NewAddon(ns, 'KuiNameplates')
 
-- add yanone kaffesatz and accidental presidency to LSM (only supports latin)
LSM:Register(LSM.MediaType.FONT, 'Yanone Kaffesatz', kui.m.f.yanone)
LSM:Register(LSM.MediaType.FONT, 'Accidental Presidency', kui.m.f.accid)
-- TODO should probably move LSM stuff into Kui, and replace the table there
ns.kui = kui
 
local locale = GetLocale()
local latin = (locale ~= 'zhCN' and locale ~= 'zhTW' and locale ~= 'koKR' and locale ~= 'ruRU')
 
-------------------------------------------------------------- Default config --
local defaults = {
profile = {
24,7 → 16,7
highlight = true, -- highlight plates on mouse-over
combopoints = true, -- display combo points
fixaa = true, -- attempt to make plates appear sharper (with some drawbacks)
font = (latin and 'Yanone Kaffesatz' or LSM:GetDefault(LSM.MediaType.FONT)), -- the font used for all text
font = kui.m.f.yanone, -- the font used for all text
fontscale = 1.0, -- the scale of all displayed font sizes
},
fade = {
40,6 → 32,40
glowcolour = { 1, 0, 0, 1, 1 } -- the glow colour to use when you have threat
},
hp = {
--[[
syntax help:
 
A simple pattern is used to determine what text should be displayed for health.
A pattern consists of rules seperated by semi-colons (;).
A rule consists of the condition followed by the result of the rule seperated by a colon (:).
 
For example:
A rule: condition:result
A pattern: rule1;rule2;rule3 (etc)
 
Valid conditions are as follows:
<= : When health is less than or equal to its maximum value...
< : When health is less than its maximum value...
= : When health is equal to its maximum value...
 
Valid results are:
c : the current, precise health value (i.e. 128.4k)
d : precise value of health that is currently missing (i.e. -12.3k)
m : the maximum amount of health
p : the current amount of health in percent
 
Health display defaults to blank if no rule is matched.
 
The default patterns and their meanings are:
 
Friendly: =:m;<:d;
Meaning: When at max health, display max health (=:m;)
When below max health, display health deficit (<:d;)
 
Hostile: <:p;
Meaning: When below max health, display health as a percentage.
Otherwise, display nothing.
]]
friendly = '=:m;<:d;', -- health display pattern for friendly units
hostile = '<:p;', -- health display pattern for hostile/neutral units
showalt = true, -- show alternate (contextual) health values as well as main values
52,8 → 78,8
spellname = true, -- display spell name
spellicon = true, -- display spell icon
barcolour = { .43, .47, .55, 1 }, -- the colour of the spell bar (interruptible casts)
warnings = false, -- display spell cast warnings on any plates
usenames = false -- use unit names to display cast warnings on their correct frames: may increase memory usage and may cause warnings to be displayed on incorrect frames when there are many units with the same name. Reccommended on for PvP, off for PvE.
warnings = true, -- display spell cast warnings on any plates
usenames = true -- use unit names to display cast warnings on their correct frames: may increase memory usage and may cause warnings to be displayed on incorrect frames when there are many units with the same name. Reccommended on for PvP, off for PvE.
},
}
}
Kui_Nameplates/layout.lua
4,8 → 4,10
]]
 
local addon, ns = ...
local kui = LibStub('Kui-1.0')
local LSM = LibStub('LibSharedMedia-3.0')
local kui = ns.kui
local uiscale, prevuiscale
local loadedGUIDs, loadedNames, targetExists, profile
= {}, {}
 
-- our frame, whee
ns.f = CreateFrame('Frame')
26,8 → 28,6
['SPELL_PERIODIC_HEAL'] = true
}
 
local font, uiscale, prevuiscale
local loadedGUIDs, loadedNames, targetExists, profile = {}, {}
local origSizes, origFontSizes, sizes, fontSizes = {},{},{},{}
 
--------------------------------------------------------------------- globals --
177,7 → 177,7
local blue = (1 - (1 / 5) * self.points)
 
self:SetText(self.points)
self:SetFont(font, size, 'OUTLINE')
self:SetFont(profile.general.font, size, 'OUTLINE')
self:SetTextColor(1, 1, blue)
elseif self:GetText() then
self:SetText('')
858,14 → 858,14
 
-- health text -------------------------------------------------------------
frame.health.p = kui.CreateFontString(frame.overlay, {
font = font, size = fontSizes.large, outline = "OUTLINE" })
font = profile.general.font, size = fontSizes.large, outline = "OUTLINE" })
frame.health.p:SetJustifyH('RIGHT')
 
frame.health.p:SetPoint('BOTTOMRIGHT', frame.health, 'TOPRIGHT', -2, uiscale and -(3/uiscale) or -3)
 
if profile.hp.showalt then
frame.health.mo = kui.CreateFontString(frame.overlay, {
font = font, size = fontSizes.small, outline = "OUTLINE" })
font = profile.general.font, size = fontSizes.small, outline = "OUTLINE" })
frame.health.mo:SetJustifyH('RIGHT')
 
frame.health.mo:SetPoint('BOTTOMRIGHT', frame.health, -2, uiscale and -(3/uiscale) or -3)
874,7 → 874,7
 
-- level text --------------------------------------------------------------
frame.level = kui.CreateFontString(frame.level, { reset = true,
font = font, size = fontSizes.name, outline = 'OUTLINE' })
font = profile.general.font, size = fontSizes.name, outline = 'OUTLINE' })
frame.level:SetParent(frame.overlay)
 
frame.level:ClearAllPoints()
882,7 → 882,7
 
-- name text ---------------------------------------------------------------
frame.name = kui.CreateFontString(frame.overlay, {
font = font, size = fontSizes.name, outline = 'OUTLINE' })
font = profile.general.font, size = fontSizes.name, outline = 'OUTLINE' })
frame.name:SetJustifyH('LEFT')
 
frame.name:SetHeight(8)
893,7 → 893,7
-- combo point text --------------------------------------------------------
if profile.general.combopoints then
frame.cp = kui.CreateFontString(frame.health,
{ font = font, size = fontSizes.combopoints, outline = 'OUTLINE', shadow = true })
{ font = profile.general.font, size = fontSizes.combopoints, outline = 'OUTLINE', shadow = true })
frame.cp:SetPoint('LEFT', frame.health, 'RIGHT', 5, 1)
 
frame.cp.Update = ComboPointsUpdate
947,17 → 947,17
-- cast bar text -------------------------------------------------------
if profile.castbar.spellname then
frame.castbar.name = kui.CreateFontString(frame.castbar, {
font = font, size = fontSizes.name, outline = "OUTLINE" })
font = profile.general.font, size = fontSizes.name, outline = "OUTLINE" })
frame.castbar.name:SetPoint('TOPLEFT', frame.castbar, 'BOTTOMLEFT', 2, -2)
end
 
if profile.castbar.casttime then
frame.castbar.max = kui.CreateFontString(frame.castbar, {
font = font, size = fontSizes.name, outline = "OUTLINE" })
font = profile.general.font, size = fontSizes.name, outline = "OUTLINE" })
frame.castbar.max:SetPoint('TOPRIGHT', frame.castbar, 'BOTTOMRIGHT', -2, -1)
 
frame.castbar.curr = kui.CreateFontString(frame.castbar, {
font = font, size = fontSizes.small, outline = "OUTLINE" })
font = profile.general.font, size = fontSizes.small, outline = "OUTLINE" })
frame.castbar.curr:SetAlpha(.5)
frame.castbar.curr:SetPoint('TOPRIGHT', frame.castbar.max, 'TOPLEFT', -1, -1)
end
1002,7 → 1002,7
if profile.castbar.warnings then
-- casting spell name
frame.castWarning = kui.CreateFontString(frame.overlay, {
font = font, size = fontSizes.spellname, outline = 'OUTLINE' })
font = profile.general.font, size = fontSizes.spellname, outline = 'OUTLINE' })
frame.castWarning:SetPoint('BOTTOMLEFT', frame.level, 'TOPLEFT', 0, 1)
frame.castWarning:Hide()
 
1022,7 → 1022,7
 
-- incoming healing
frame.incWarning = kui.CreateFontString(frame.overlay, {
font = font, size = fontSizes.small, outline = 'OUTLINE' })
font = profile.general.font, size = fontSizes.small, outline = 'OUTLINE' })
frame.incWarning:SetPoint('BOTTOMRIGHT', frame.health.p, 'TOPRIGHT', 1)
frame.incWarning:Hide()
 
1065,15 → 1065,15
frame:SetBackdropColor(1, 1, 1, .5)
 
frame.isfriend = kui.CreateFontString(frame, {
font = font, size = 10, outline = 'OUTLINE' })
font = profile.general.font, size = 10, outline = 'OUTLINE' })
frame.isfriend:SetPoint('BOTTOM', frame, 'TOP')
 
frame.guidtext = kui.CreateFontString(frame, {
font = font, size = 10, outline = "OUTLINE" })
font = profile.general.font, size = 10, outline = "OUTLINE" })
frame.guidtext:SetPoint('TOP', frame, 'BOTTOM')
 
frame.nametext = kui.CreateFontString(frame, {
font = font, size = 10, outline = "OUTLINE" })
font = profile.general.font, size = 10, outline = "OUTLINE" })
frame.nametext:SetPoint('TOP', frame.guidtext, 'BOTTOM')
]]
 
1459,9 → 1459,6
fontSizes[k] = size * profile.general.fontscale
end
 
-- fetch font path from lsm
font = LSM:Fetch(LSM.MediaType.FONT, profile.general.font)
 
ns.f:SetScript('OnUpdate', self.OnUpdate)
ns.f:SetScript('OnEvent', self.OnEvent)