/trunk
frame.castbar.bar:SetMinMaxValues(0, 1) |
-- uninterruptible cast shield ----------------------------------------- |
frame.castbar.shield = frame.castbar:CreateTexture(nil, 'ARTWORK') |
frame.castbar.shield = frame.overlay:CreateTexture(nil, 'ARTWORK') |
frame.castbar.shield:SetTexture('Interface\\AddOns\\Kui_Nameplates\\Shield') |
frame.castbar.shield:SetTexCoord(0, .46875, 0, .5625) |
frame.castbar.shield:SetSize(14, 17) |
frame.castbar.shield:SetPoint('CENTER', frame.castbar.bg, 0, 1) |
frame.castbar.shield:SetSize(addon.sizes.shieldw, addon.sizes.shieldh) |
frame.castbar.shield:SetPoint('LEFT', frame.castbar.bg, -7, 0) |
frame.castbar.shield:SetBlendMode('BLEND') |
frame.castbar.shield:SetDrawLayer('ARTWORK', 7) |
end |
end) |
frame.castbar:HookScript('OnHide', function(bar) |
bar.shield:Hide() |
end) |
frame.castbar:SetScript('OnUpdate', OnCastbarUpdate) |
end |
------------------------------------------------------------------------ Hide -- |
addon:RegisterSize('frame', 'cbheight', 4) |
addon:RegisterSize('frame', 'icon', 16) |
addon:RegisterSize('frame', 'shieldw', 10) |
addon:RegisterSize('frame', 'shieldh', 12) |
addon:InitModuleOptions(self) |
end |
local kn = LibStub('AceAddon-3.0'):GetAddon('KuiNameplates') |
--KuiNameplatesDebug=true |
-- uncommenting this line will display a white box where the default UI's |
-- nameplate is rendered, a black background where the pixel-perfect plate from |
-- this addon is rendered (if "Fix aliasing" is enabled), the GUID/name |
-- status of any visible plates and the detected reaction type of the plate. |
kn.font = '' |
kn.fontSizes = {} |
} |
local loadedGUIDs, loadedNames = {}, {} |
local targetExists |
local targetExists, targetFound |
local profile, uiscale |
--------------------------------------------------------------------- globals -- |
self.carrier:Hide() |
end |
if self.guid then |
-- remove guid from the store and unset it |
loadedGUIDs[self.guid] = nil |
self.guid = nil |
end |
if self.guid and loadedGUIDs[self.guid] == self then |
-- remove guid from the store |
loadedGUIDs[self.guid] = nil end |
self.guid = nil |
if loadedNames[self.name.text] == self then |
-- remove name from store |
-- if there are name duplicates, this will be recreated in an onupdate |
end |
-- fade to the new value |
self.fadingTo = self.currentAlpha |
local alphaChange = (self.fadingTo - (self.lastAlpha or 0)) |
self.fadingTo = self.currentAlpha |
local alphaChange = (self.fadingTo - (self.lastAlpha or 0)) |
kui.frameFade(self.carrier and self.carrier or self, { |
mode = alphaChange < 0 and 'OUT' or 'IN', |
self.defaultAlpha == 1 and |
self.name.text == UnitName('target') |
then |
-- this frame is targeted |
if not self.target then |
-- the frame just became targeted |
self.target = true |
self:StoreGUID(UnitGUID('target')) |
-- this frame is probably targeted |
if not targetFound then |
-- this frame is definitely targeted |
targetFound = true |
if self.carrier then |
-- move this frame above others |
-- default UI uses a level of 10 by default & 20 on the target |
self.carrier:SetFrameLevel(10) |
end |
if not self.target then |
-- just became targeted |
self.target = true |
self:StoreGUID(UnitGUID('target')) |
if profile.hp.mouseover then |
self.health.p:Show() |
if self.health.mo then self.health.mo:Show() end |
if self.carrier then |
-- move this frame above others |
-- default UI uses a level of 10 by default & 20 on the target |
self.carrier:SetFrameLevel(10) |
end |
if profile.hp.mouseover then |
self.health.p:Show() |
if self.health.mo then self.health.mo:Show() end |
end |
kn:SendMessage('KuiNameplates_PostTarget', self) |
end |
kn:SendMessage('KuiNameplates_PostTarget', self) |
end |
elseif self.target then |
self.target = nil |
if self.carrier then |
self.carrier:SetFrameLevel(1) |
end |
if not self.highlighted and profile.hp.mouseover then |
self.health.p:Hide() |
if self.health.mo then self.health.mo:Hide() end |
end |
end |
if not self.target and self.carrier then |
self.carrier:SetFrameLevel(1) |
end |
--------------------------------------------------------------- Mouseover -- |
if self.oldHighlight:IsShown() then |
if not self.highlighted then |
-- [debug] |
if _G['KuiNameplatesDebug'] then |
if self.guid and loadedGUIDs[self.guid] == self then |
if self.guid then |
self.guidtext:SetText(self.guid) |
if loadedGUIDs[self.guid] ~= self then |
self.guidtext:SetTextColor(1,0,0) |
else |
self.guidtext:SetTextColor(1,1,1) |
end |
else |
self.guidtext:SetText(nil) |
end |
---------------------------------------------------------------------- Events -- |
function kn:PLAYER_TARGET_CHANGED() |
targetExists = UnitExists('target') |
targetFound = nil |
end |
-- automatic toggling of enemy frames |