WoWInterface SVN KuiNameplates

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 124 to Rev 125
    Reverse comparison

Rev 124 → Rev 125

Kui_Nameplates/Kui_Nameplates.toc
2,7 → 2,7
## Author: Kesava
## Title: |cff9900ffKui|r Nameplates
## Notes: Prettier, lightweight, configurable nameplates.
## SavedVariablesPerCharacter: KuiNameplatesDB
## SavedVariables: KuiNameplatesDB
 
lib\embeds.xml
 
Kui_Nameplates/layout.lua
44,9 → 44,10
-------------------------------------------------- External calling functions --
local modules = {}
local postFunctions = {
create = {},
show = {},
hide = {}
target = {}, -- upon becoming the target
create = {}, -- post creation
show = {}, -- post OnFrameShow
hide = {} -- post OnFrameHide
}
 
local function CallPostFunction(typ, frame)
66,7 → 67,6
 
KuiNameplates.RegisterModule = function(name, obj)
if not modules[name] then
print('registered: '..name)
modules[name] = obj
end
end
144,25 → 144,6
self.bg:SetVertexColor(r, g, b, a)
end
 
-- Show the frame's castbar if it is casting
-- TODO update this for other units (party1target etc)
local function IsFrameCasting(self)
if not self.castbar or not self.target then return end
 
local name = UnitCastingInfo('target')
local channel = false
 
if not name then
name = UnitChannelInfo('target')
channel = true
end
 
if name then
-- if they're casting or channeling, try to show a castbar
ns.f:UNIT_SPELLCAST_START(self, 'target', channel)
end
end
 
local function StoreFrameGUID(self, guid)
if not guid then return end
if self.guid and loadedGUIDs[self.guid] then
396,9 → 377,8
 
-- force health update
OnHealthValueChanged(self.oldHealth, self.oldHealth:GetValue())
 
 
self:SetGlowColour()
self:IsCasting()
 
CallPostFunction('show', self)
end
618,9 → 598,8
self.health.p:Show()
if self.health.mo then self.health.mo:Show() end
end
 
-- check if the frame is casting
self:IsCasting()
 
CallPostFunction('target', self)
end
elseif self.target then
self.target = nil
743,7 → 722,6
frame.SetHealthColour = SetHealthColour
frame.SetNameColour = SetNameColour
frame.SetGlowColour = SetGlowColour
frame.IsCasting = IsFrameCasting
frame.StoreGUID = StoreFrameGUID
 
------------------------------------------------------------------ Layout --
Kui_Nameplates/custom-rename-me.lua
1,7 → 1,9
--[[
For Kui Nameplates
Rename this file to custom.lua to attach custom code to the addon.
Rename this file to custom.lua to attach custom code to the addon. Once
renamed, you'll need to completely restart WoW so that it detects the file.
]]
local kn = KuiNameplates
 
---------------------------------------------------------------------- Create --
local function PostCreate(frame)
19,6 → 21,6
end
 
-------------------------------------------------------------------- Register --
KuiNameplates.RegisterPostFunction('create', PostCreate)
KuiNameplates.RegisterPostFunction('show', PostShow)
KuiNameplates.RegisterPostFunction('hide', PostHide)
\ No newline at end of file +kn.RegisterPostFunction('create', PostCreate) +kn.RegisterPostFunction('show', PostShow) +kn.RegisterPostFunction('hide', PostHide) \ No newline at end of file
Kui_Nameplates/castbar.lua
275,6 → 275,24
frame.castbarbg:Hide()
end
 
function cb.IsCasting(frame)
-- TODO update this for other units (party1target etc)
if not frame.castbar or not frame.target then return end
 
local name = UnitCastingInfo('target')
local channel = false
 
if not name then
name = UnitChannelInfo('target')
channel = true
end
 
if name then
-- if they're casting or channeling, try to show a castbar
cb:UNIT_SPELLCAST_START(frame, 'target', channel)
end
end
 
-------------------------------------------------------------------- Register --
local function OnEvent(self, event, ...)
cb:UnitCastEvent(event, ...)
283,6 → 301,8
cb.Enable = function(self)
kn.RegisterPostFunction('create', self.CreateCastbar)
kn.RegisterPostFunction('hide', self.HideCastbar)
kn.RegisterPostFunction('show', self.IsCasting)
kn.RegisterPostFunction('target', self.IsCasting)
self:SetScript('OnEvent', OnEvent)
 
for event,_ in pairs(castEvents) do