View Single Post
Unread 11-21-12, 08:25 PM   #14
Xrystal
nUI User and Supporter
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,049
well, I don't know whether I have understood that rightly but it isn't erroring out which is a good sign. unfortunately it hasn't made a difference.

Still using the nUI_PossessBar.lus file as it is the possessbar that is being affected it seems.

at the top I have added the following:
RegisterStateDriver( frame, "page", "[nui_vehicle] 12; [nui_override] 14; [bonusbar:5] 11; 1" );

visibility is still the same:
RegisterStateDriver( frame, "visibility", "[bonusbar:5] show; hide" );

I then have the following OnEvent code - the blocks headed with my name or with my name alongside is what has been added:

Lua Code:
  1. anchor:SetScript( "OnEvent",
  2.  
  3.     function( who, event )
  4.  
  5. --      nUI_ProfileStart( ProfileCounter, "OnEvent", event );
  6.    
  7.         if event == "PLAYER_ENTERING_WORLD"
  8.         or event == "UPDATE_POSSESS_BAR"        -- xrystal
  9.         or event == "UPDATE_OVERRIDE_ACTIONBAR" -- xrystal
  10.         or event == "UPDATE_BONUS_ACTIONBAR"
  11.         then
  12.            
  13.             frame.applyScale();
  14.  
  15.             -- xrystal
  16.             if event == "UPDATE_POSSESS_BAR" or event == "UPDATE_OVERRIDE_ACTIONBAR" then
  17.                 print("Here - ",event)
  18.                 print("HasVehicleActionBar = ", HasVehicleActionBar())
  19.                 print("HasOverrideActionBar= ", HasOverrideActionBar())
  20.                 print("UnitHasVehicleUI=",UnitHasVehicleUI())
  21.  
  22.                 if not InCombatLockdown() then
  23.                     if ((HasVehicleActionBar() and UnitVehicleSkin("player") and UnitVehicleSkin("player") ~= "") or UnitHasVehicleUI()) then
  24.                         print("Here - vehicle")
  25.                         nUI_ActionBar:SetAttribute( "page", "nui_vehicle" );
  26.                     end
  27.                     if ((HasOverrideActionBar() and GetOverrideBarSkin() and GetOverrideBarSkin() ~= "") ) then
  28.                         print("Here - override")
  29.                         nUI_ActionBar:SetAttribute( "page", "nui_override" );
  30.                     end
  31.                 else
  32.                 end
  33.             end
  34.  
  35.         end
  36.        
  37.         -- update the bar
  38.        
  39.         for i=1, #frame.Buttons do
  40.             frame.updateState( i );            
  41.         end
  42.        
  43. --      nUI_ProfileStop();
  44.        
  45.     end
  46. );

and of course registered the extra events.

Now whether I have done this stuff wrong I have no idea what else to do at least at the moment.
__________________
Xrystal is offline