View Single Post
05-31-16, 11:16 AM   #19
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
I just uploaded the latest version. Here is what I ended up using:

Page condition:
Code:
"[vehicleui]vui; [possessbar]pb; [overridebar]ob; [shapeshift]ss; [bonusbar:1]bb1; [bonusbar:2]bb2; [bonusbar:3]bb3; [bonusbar:4]bb4; [bonusbar:5]bb5; [bar:2]b2; [bar:3]b3; [bar:4]b4; [bar:5]b5; [bar:6]b6; [form]frm; [bar:1]b1; xx"
https://github.com/zorker/rothui/blo...config.lua#L80

Page Statedriver:
Lua Code:
  1. for i, button in next, buttonList do
  2.   frame:SetFrameRef(cfg.buttonName..i, button);
  3. end
  4. frame:Execute(([[
  5.   buttons = table.new()
  6.   for i=1, %d do
  7.     table.insert(buttons, self:GetFrameRef("%s"..i))
  8.   end
  9. ]]):format(cfg.numButtons, cfg.buttonName))
  10. frame:SetAttribute("_onstate-page", [[
  11.   if HasVehicleActionBar() then
  12.     newstate = GetVehicleBarIndex()
  13.   elseif HasOverrideActionBar() then
  14.     newstate = GetOverrideBarIndex()
  15.   elseif HasTempShapeshiftActionBar() then
  16.     newstate = GetTempShapeshiftBarIndex()
  17.   elseif GetBonusBarOffset() > 0 then
  18.     newstate = GetBonusBarOffset()+6
  19.   else
  20.     newstate = GetActionBarPage()
  21.   end
  22.   for i, button in next, buttons do
  23.     button:SetAttribute("actionpage", newstate);
  24.   end
  25. ]])
  26. RegisterStateDriver(frame, "page", cfg.framePage)
https://github.com/zorker/rothui/blo.../init.lua#L104
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)