/trunk/RDX/Designs/Variables/Checks
name = "var_isEven"; |
title = VFLI.i18n("Var IsEvenGroup?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
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 isEven = true; |
]]); |
else |
code:AppendCode([[ |
local isEven = (unit:GetGroup() % 2 == 0); |
]]); |
end |
end); |
end; |
UIFromDescriptor = VFL.Nil; |
name = "var_targetexisted"; |
title = VFLI.i18n("Var IsTargetExisted?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
end; |
ApplyFeature = function(desc, state) |
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) |
if desc.test then |
code:AppendCode([[ |
local targetexisted = true; |
]]); |
else |
code:AppendCode([[ |
local targetexisted = UnitExists("target"); |
if targetexisted then targetexisted = true; else targetexisted = false; end |
]]); |
end |
end); |
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer"); |
local mask = mux:GetPaintMask("TARGET"); |
name = "var_tapped"; |
title = VFLI.i18n("Var IsTapped?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
end; |
ApplyFeature = function(desc, state) |
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) |
if desc.test then |
code:AppendCode([[ |
local tapped = true; |
]]); |
else |
code:AppendCode([[ |
local tapped = UnitIsTapped(uid) and (not UnitIsTappedByPlayer(uid)); |
]]); |
end |
end); |
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer"); |
local mask = mux:GetPaintMask("FLAGS"); |
name = "var_isEnemy"; |
title = VFLI.i18n("Var IsEnemy?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
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 isEnemy = true; |
]]); |
else |
code:AppendCode([[ |
local isEnemy = UnitIsEnemy(uid,"player"); |
]]); |
end |
end); |
end; |
UIFromDescriptor = VFL.Nil; |
name = "var_isMaxLevel"; |
title = VFLI.i18n("Var IsMaxLevel?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
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 ismaxlevel = true; |
]]); |
else |
code:AppendCode([[ |
local ismaxlevel = false; |
if UnitLevel(uid) == 80 then ismaxlevel = true; end; |
if UnitLevel(uid) == 85 then ismaxlevel = true; end; |
]]); |
end |
end); |
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer"); |
local mask = mux:GetPaintMask("XP_UPDATE"); |
name = "var_isnpc"; |
title = VFLI.i18n("Var IsNPC?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
end; |
ApplyFeature = function(desc, state) |
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) |
if desc.test then |
code:AppendCode([[ |
local isnpc = true; |
]]); |
else |
code:AppendCode([[ |
local isnpc = (not UnitIsPlayer(uid)); |
]]); |
end |
end); |
end; |
UIFromDescriptor = VFL.Nil; |
name = "var_issolar"; |
title = VFLI.i18n("Var EclipseDirection?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
end; |
ApplyFeature = function(desc, state) |
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) |
if desc.test then |
code:AppendCode([[ |
local eclipsedirection = true; |
]]); |
else |
code:AppendCode([[ |
local eclipsedirection = GetEclipseDirection(); |
]]); |
end |
end); |
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer"); |
local mask = mux:GetPaintMask("FLAGS"); |
name = "var_inrange"; |
title = VFLI.i18n("Var IsRaidInRange?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
end; |
ApplyFeature = function(desc, state) |
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) |
if desc.test then |
code:AppendCode([[ |
local inRange = true; |
]]); |
else |
code:AppendCode([[ |
local inRange = UnitInRange(uid); |
]]); |
end |
end); |
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer"); |
local mask = mux:GetPaintMask("RANGED"); |
name = "var_isGhost"; |
title = VFLI.i18n("Var IsGhost?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
end; |
ApplyFeature = function(desc, state) |
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) |
if desc.test then |
code:AppendCode([[ |
local isGhost = true; |
]]); |
else |
code:AppendCode([[ |
local isGhost = UnitIsGhost(uid); |
]]); |
end |
end); |
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer"); |
local mask = mux:GetPaintMask("FLAGS"); |
name = "var_ininn"; |
title = VFLI.i18n("Var IsInn?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
end; |
ApplyFeature = function(desc, state) |
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) |
if desc.test then |
code:AppendCode([[ |
local ininn = true; |
]]); |
else |
code:AppendCode([[ |
local ininn = IsResting(); |
]]); |
end |
end); |
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer"); |
local mask = mux:GetPaintMask("FLAGS"); |
name = "var_isDeath"; |
title = VFLI.i18n("Var IsDeath?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
end; |
ApplyFeature = function(desc, state) |
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) |
if desc.test then |
code:AppendCode([[ |
local isDeath = true; |
]]); |
else |
code:AppendCode([[ |
local isDeath = UnitIsDead(uid); |
]]); |
end |
end); |
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer"); |
local mask = mux:GetPaintMask("FLAGS"); |
name = "var_isExhaustion"; |
title = VFLI.i18n("Var IsExhaustion?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
end; |
ApplyFeature = function(desc, state) |
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) |
if desc.test then |
code:AppendCode([[ |
local isExhaustion = true; |
]]); |
else |
code:AppendCode([[ |
local nbexh, isExhaustion = GetXPExhaustion(), false; |
if nbexh then isExhaustion = true; end |
]]); |
end |
end); |
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer"); |
local mask = mux:GetPaintMask("XP_UPDATE"); |
name = "var_IsMaxHealthPower"; |
title = VFLI.i18n("Var IsMaxHealthPower?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
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 ismaxhealthpower = true; |
]]); |
else |
code:AppendCode([[ |
local ismaxhealthpower = false; |
local pt = unit:PowerType(); |
if unit:Health() == unit:MaxHealth() then |
end |
end |
]]); |
end |
end); |
local mux, mask = state:GetContainingWindowState():GetSlotValue("Multiplexer"), 0; |
mask = mux:GetPaintMask("POWER"); |
name = "var_inInstance"; |
title = VFLI.i18n("Var IsInInstance?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
end; |
ApplyFeature = function(desc, state) |
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) |
if desc.test then |
code:AppendCode([[ |
local inInstance = true; |
]]); |
else |
code:AppendCode([[ |
local inInstance = true; |
local posX = GetPlayerMapPosition(uid); |
if posX and (posX > 0) then inInstance = false; end |
]]); |
end |
end); |
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer"); |
local mask = mux:GetPaintMask("FLAGS"); |
name = "var_israidpartyleader"; |
title = VFLI.i18n("Var IsLeader?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
end; |
ApplyFeature = function(desc, state) |
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) |
if desc.test then |
code:AppendCode([[ |
local israidpartyleader = true; |
]]); |
else |
code:AppendCode([[ |
local israidpartyleader = nil; |
if GetNumRaidMembers() > 0 then |
_,israidpartyleader = GetRaidRosterInfo(RDXDAL.UIDToNumber(uid)); |
israidpartyleader = UnitIsPartyLeader(uid); |
end |
]]); |
end |
end); |
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer"); |
local mask = mux:GetPaintMask("FLAGS"); |
name = "var_incombat"; |
title = VFLI.i18n("Var IsInCombat?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
end; |
ApplyFeature = function(desc, state) |
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) |
if desc.test then |
code:AppendCode([[ |
local incombat = true; |
]]); |
else |
code:AppendCode([[ |
local incombat = UnitAffectingCombat(uid); |
]]); |
end |
end); |
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer"); |
local mask = mux:GetPaintMask("FLAGS"); |
name = "var_isElite"; |
title = VFLI.i18n("Var IsElite?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
end; |
ApplyFeature = function(desc, state) |
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) |
if desc.test then |
code:AppendCode([[ |
local isElite, isNotElite = true, false; |
]]); |
else |
code:AppendCode([[ |
local isElite, isNotElite = false, true; |
local strclasstype = UnitClassification(uid); |
if (strclasstype ~= "normal") then isElite = true; isNotElite = false; end |
]]); |
end |
end); |
end; |
UIFromDescriptor = VFL.Nil; |
name = "var_isMaxPower"; |
title = VFLI.i18n("Var IsMaxPower?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
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 ismaxpower = true; |
]]); |
else |
code:AppendCode([[ |
local ismaxpower = false; |
if unit:Power() == unit:MaxPower() then ismaxpower = true end; |
]]); |
end |
end); |
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer"); |
local mask = mux:GetPaintMask("POWER"); |
name = "var_existed"; |
title = VFLI.i18n("Var IsExisted?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
end; |
ApplyFeature = function(desc, state) |
state:Attach(state:Slot("EmitPaintPreamble"), true, function(code) |
if desc.test then |
code:AppendCode([[ |
local existed = true; |
]]); |
else |
code:AppendCode([[ |
local existed = UnitExists(uid); |
if existed then existed = true; else existed = false; end |
]]); |
end |
end); |
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer"); |
local mask = mux:GetPaintMask("FLAGS"); |
name = "var_isShiftDown"; |
title = VFLI.i18n("Var IsShiftHeldDown?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
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 isShiftDown = true; |
]]); |
else |
code:AppendCode([[ |
local isShiftDown = IsShiftKeyDown(); |
]]); |
end |
end); |
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer"); |
local mask = mux:GetPaintMask("HARDWARE"); |
name = "var_isAltDown"; |
title = VFLI.i18n("Var IsAltHeldDown?"); |
category = VFLI.i18n("Variables Check"); |
test = true; |
IsPossible = function(state) |
if not state:Slot("EmitPaintPreamble") then return nil; end |
return true; |
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 isAltDown = true; |
]]); |
else |
code:AppendCode([[ |
local isAltDown = IsAltKeyDown(); |
]]); |
end |
end); |
local mux = state:GetContainingWindowState():GetSlotValue("Multiplexer"); |
local mask = mux:GetPaintMask("HARDWARE"); |