View Single Post
05-30-16, 03:26 PM   #15
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
I tested it. It is in fact still really simple to do. This is all you need:
https://github.com/zorker/rothui/blo...rTest/bar1.lua

Currently debating if I want to add it. It helps merging a lot of bars. One does not even need to create a vehicle exit button. One can just reparent the OverrideActionBar.LeaveButton and change its visibility based on the canexitvehicle macro condition.

Ok I did change it. Was super easy to implement:

https://github.com/zorker/rothui/com...85cc2000a2091d

The main part is this macro condition:
Code:
"[vehicleui] 1; [possessbar] 2; [overridebar] 3; [shapeshift] 4; [bar:2] 5; [bar:3] 6; [bar:4] 7; [bar:5] 8; [bar:6] 9; [bonusbar:1] 10; [bonusbar:2] 11; [bonusbar:3] 12; [bonusbar:4] 13; 14"
Basically just a number that counts up for each macro condition. I only need it to fire the __onstate-page trigger. In the function we have access to all the functions that the actionbarcontroller has access to aswell.
Lua Code:
  1. frame:SetAttribute("_onstate-page", [[
  2.       if HasVehicleActionBar() then
  3.         newstate = GetVehicleBarIndex()
  4.       elseif HasOverrideActionBar() then
  5.         newstate = GetOverrideBarIndex()
  6.       elseif HasTempShapeshiftActionBar() then
  7.         newstate = GetTempShapeshiftBarIndex()
  8.       elseif GetBonusBarOffset() > 0 then
  9.         newstate = GetBonusBarOffset()+6
  10.       else
  11.         newstate = GetActionBarPage()
  12.       end
  13.       for i, button in next, buttons do
  14.         button:SetAttribute("actionpage", newstate);
  15.       end
  16.     ]])

Result: https://github.com/zorker/rothui/blo.../init.lua#L100
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

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

Last edited by zork : 05-30-16 at 05:46 PM.