View Single Post
06-03-16, 01:18 PM   #28
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Your nagging made me go to a quest that I knew from Wrath that always made problems.
You are right. Exactly the case on that quest. >_>
Returns wrong bar index upon entering. At least I now have a testcase.
http://imgur.com/EQxZUEx
Of course the bar index is correct after reload or if I add a wierd condition like modifier and hit CTRL.

Changed it back to
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.     for i, button in next, buttons do
  12.       button:SetAttribute("actionpage", newstate)
  13.     end
  14.   ]])
  15.   RegisterStateDriver(frame, "page", "[overridebar]14;[shapeshift]13;[vehicleui]12;[possessbar]11;[bonusbar:4]10;[bonusbar:3]9;[bonusbar:2]8;[bonusbar:1]7;[bar:6]6;[bar:5]5;[bar:4]4;[bar:3]3;[bar:2]2;1")

Now what might happen is that the condition does not match the actual bar-id in some cases. Because I know of some quests that trigger for possessbar and show stuff in the vehiclebar under index 12 (if I'm not totally mistaken).

Will keep it at that for now until further issues occur.

Code:
/run local s=SecureCmdOptionParse print(s("[bonusbar]bb;no-bb"),s("[canexitvehicle]cev;no-cev"),s("[overridebar]ob;no-ob"),s("[possessbar]pb;no-pb"),s("[shapeshift]ss;no-ss"),s("[vehicleui]vui;no-vui"),s("[@vehicle,exists]ve;no-ve"))
/run print("vb"..GetVehicleBarIndex(), "ob"..GetOverrideBarIndex(), "tss"..GetTempShapeshiftBarIndex(), "bb"..GetBonusBarIndex(), "ab"..GetActionBarPage())
/run print(HasVehicleActionBar() or "nov-ab", HasOverrideActionBar() or "no-ob", HasTempShapeshiftActionBar() or "no-tss", HasBonusActionBar() or "no-bb")
__________________
| 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 : 06-03-16 at 01:55 PM.