Mercurial > wow > reaction
diff VehicleExitButton.lua @ 286:77609bfa804e stable
Merge 1.1 beta 8 to stable
author | Flick |
---|---|
date | Sat, 11 Jun 2011 10:57:00 -0700 |
parents | 5b9c0164a491 |
children | e337b39dc491 |
line wrap: on
line diff
--- a/VehicleExitButton.lua Wed May 11 09:53:48 2011 -0700 +++ b/VehicleExitButton.lua Sat Jun 11 10:57:00 2011 -0700 @@ -1,5 +1,5 @@ -local addonName, addonTable = ... -local ReAction = addonTable.ReAction +local _, ns = ... +local ReAction = ns.ReAction local L = ReAction.L local format = string.format @@ -29,9 +29,7 @@ ReAction:RegisterBarType(VExitButton) function VExitButton:New( config, bar, idx ) - local name = format("ReAction_%s_VehicleExit_%d",bar:GetName(),idx) - - self = Super.New(self, name, config, bar, idx, "SecureFrameTemplate, ActionButtonTemplate", "Button") + self = Super.New(self, config, bar, idx, "SecureFrameTemplate, ActionButtonTemplate", "Button") -- frame setup local f = self:GetFrame() @@ -96,12 +94,12 @@ -- auto show/hide when on a vehicle local config = bar:GetConfig() local f = bar:GetFrame() - if config.withControls then + if config.withControls or ReAction:GetConfigMode() then if bar.vehicleExitStateRegistered then UnregisterStateDriver(f, "unitexists") bar.vehicleExitStateRegistered = false end - bar:RegisterUnitWatch("vehicle",true) + bar:RegisterUnitWatch("vehicle",not ReAction:GetConfigMode()) else bar:RegisterUnitWatch("vehicle",false) if not bar.vehicleExitStateRegistered then