/trunk
local font, sizes, fontSizes = '', {}, {} |
--------------------------------------------------------------------- globals -- |
local select, strfind, strsplit, pairs, ipairs, unpack |
= select, strfind, strsplit, pairs, ipairs, unpack |
local select, strfind, strsplit, pairs, ipairs, unpack, tinsert, type |
= select, strfind, strsplit, pairs, ipairs, unpack, tinsert, type |
-- helper for setting a given fontstring's font size |
local function SetFontSize(fontstring, size) |
condition = curr < max |
elseif condition == '=' then |
condition = curr == max |
elseif condition == '<=' then |
elseif condition == '<=' or condition == '=<' then |
condition = curr <= max |
else |
condition = nil |
end |
if condition then |
------------------------------------------------------- Frame script handlers -- |
local function OnFrameShow(self) |
if self.carrier then |
-- TODO or I could just make the positioning a function and call it here |
self.carrier.DoShow = true |
end |
SetFontSize(self.name, fontSizes.small) |
self.name:SetJustifyH('CENTER') |
self.name:SetPoint('BOTTOMLEFT', self.health, 'TOPLEFT', -10, -3) |
self.name:SetPoint('BOTTOMRIGHT', self.health, 'TOPRIGHT', 10, -3) |
self.name:SetPoint('BOTTOM', self.health, 'TOP', 0, -3) |
self.bg.fill:SetSize(sizes.twidth, sizes.theight) |
self.health:SetSize(sizes.twidth-2, sizes.theight-2) |
x = (x / uiscale) * scale |
y = (y / uiscale) * scale |
self.carrier:ClearAllPoints() |
self.carrier:SetPoint('BOTTOMLEFT', UIParent, 'BOTTOMLEFT', floor(x-(self.carrier:GetWidth()/2)), floor(y)) |
-- show the frame after it's been moved so it doesn't flash |
frame.carrier:SetFrameStrata('BACKGROUND') |
frame.carrier:SetSize(frame:GetWidth()/uiscale, frame:GetHeight()/uiscale) |
frame.carrier:SetScale(uiscale) |
frame.carrier:SetPoint('CENTER', UIParent) |
frame.carrier:Hide() |
-- [debug] |
if _G['KuiNameplatesDebug'] then |
frame.carrier:SetBackdrop({ bgFile = kui.m.t.solid }) |
-- Place code to be performed after a frame is hidden here. |
end |
---------------------------------------------------------------------- Target -- |
local function PostTarget(frame) |
-- Place code to be performed when a frame becomes the player's target here. |
end |
-------------------------------------------------------------------- Register -- |
kn.RegisterPostFunction('create', PostCreate) |
kn.RegisterPostFunction('show', PostShow) |
kn.RegisterPostFunction('hide', PostHide) |
['UNIT_SPELLCAST_CHANNEL_STOP'] = true |
} |
local GetNameplate = KuiNameplates.GetNameplate |
local UnitGUID, GetUnitName, UnitChannelInfo, UnitCastingInfo, GetTime, format = |
UnitGUID, GetUnitName, UnitChannelInfo, UnitCastingInfo, GetTime, format |
------------------------------------------------------------- Script handlers -- |
local function OnCastbarUpdate(bar, elapsed) |
-- [[debug]] |
--guid, name = UnitGUID('target'), GetUnitName('target') |
local f = kn.f:GetNameplate(guid, name) |
local f = kn.f:GetNameplate(guid, name:gsub('%-.+$', '')) |
if f then |
if not f.SetIncomingWarning or f.trivial then return end |
local spName, spSch = select(13, ...) |
}, |
fixaa = { |
name = 'Fix aliasing', |
desc = 'Attempt to make plates appear sharper. Has a positive effect on FPS, but will make plates appear a bit "loose", especially at low frame rates. Works best when uiscale is disabled and at good resolutions.', |
desc = 'Attempt to make plates appear sharper. Has a positive effect on FPS, but will make plates appear a bit "loose", especially at low frame rates. Works best when uiscale is disabled and at good resolutions.\n|cffff0000UI reload required to take effect.|r', |
type = 'toggle', |
order = 4 |
}, |