return true; |
end; |
ApplyFeature = function(desc, state) |
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) code:AppendCode([[ |
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) |
if desc.test then |
code:AppendCode([[ |
local ph, pfh, ih = 300, 0.5, 100; |
local pheal = VFL.strcolor(1,1,1) .. "+" .. 300 .. " " .. VFL.strcolor(0.75,0,0) .. "-" .. 100; |
]]); |
else |
code:AppendCode([[ |
local ph, _, pfh, ih = unit:AllSmartHealth(); |
local umh = unit:MissingHealth(); |
local pheal = ""; |
if umh and umh > 0 then pheal = VFL.strcolor(0.75,0,0) .. "-" .. umh; end |
if ih and ih > 0 then pheal = VFL.strcolor(1,1,1) .. "+" .. ih .. " " .. pheal; end |
]]); end); |
]]); |
end |
end); |
-- Event hinting |
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer"); |
mux:Event_UnitMask("UNIT_HEAL_PREDICTION", mux:GetPaintMask("HEAL_PREDICTION")); |