View Single Post
11-07-10, 09:25 AM   #27
Taroven
A Cyclonian
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 49
Code:
local sechan = CreateFrame("Frame", nil, nil, "SecureHandlerStateTemplate")
sechan:SetAttribute("_onstate-aurastate", [[
local buffs = self:GetFrameRef("auraframe1")
local debuffs = self:GetFrameRef("auraframe2")
local state = newstate == "invehicle" and "vehicle" or "player"
buffs:SetAttribute("unit",state)
debuffs:SetAttribute("unit",state)
]])

sechan:SetFrameRef("auraframe1", buffs)
sechan:SetFrameRef("auraframe2", debuffs)
RegisterStateDriver(sechan, "aurastate", "[vehicleui] invehicle; notinvehicle")
Not sure about the framerefs, but that at least gets rid of the if statement.
__________________
Former author of EventHorizon Continued and Other Releases.
  Reply With Quote