View Single Post
08-18-13, 12:00 PM   #25
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,925
Good News:

This mini addon worked great, as long as it was a special bar, then again, like I said I have yet been able to figure out page swapping properly yet even with the druid forms. Now to check to see if the page idea will work with nUI.

edit: Added screenshots of mini addon working alongside regular blizz and with nUI 5 and as you can see nUI 5 isn't switching with the page switching macro conditional.

Lua Code:
  1. local addonName,addonData = ...
  2.  
  3. local actionBarFrame = CreateFrame("Frame","XUI_ActionBar_Frame",UIParent,"SecureHandlerStateTemplate,SecureHandlerAttributeTemplate,SecureHandlerShowHideTemplate")
  4. local eventFrame = CreateFrame("Frame","XUI_ActionBar_Events")
  5.  
  6. local function CheckEvents(self,event,...)
  7.     local args = { ... }
  8.    
  9.     if ( event == "ADDON_LOADED" and args[1] == addonName ) then
  10.         actionBarFrame:SetPoint("CENTER",UIParent,"CENTER",0,0)
  11.         actionBarFrame:SetAttribute( "XUI_ActionType","ACTIONBUTTON" )
  12.        
  13.         -- As a standalone Action Bar
  14.         actionBarFrame:SetAttribute( "actionpage", GetTempShapeshiftBarIndex() );
  15.        
  16.         -- As a page on the Main Action Bar
  17.         --actionBarFrame:SetAttribute( "actionpage", 1 );
  18.        
  19.         actionBarFrame.Buttons = { }
  20.         local lastButton = nil
  21.         for i = 1,12 do
  22.             actionBarFrame.Buttons[i] = CreateFrame("CheckButton","$parent_Button_"..i,actionBarFrame,"SecureActionButtonTemplate,ActionBarButtonTemplate")
  23.             actionBarFrame.Buttons[i]:SetID(i)
  24.             actionBarFrame.Buttons[i]:SetAttribute("action", i );
  25.             actionBarFrame.Buttons[i]:Show()
  26.             if ( lastButton ) then
  27.                 actionBarFrame.Buttons[i]:SetPoint("TOPLEFT",actionBarFrame.Buttons[i-1],"TOPRIGHT",1,0)
  28.             else
  29.                 actionBarFrame.Buttons[i]:SetPoint("TOPLEFT",actionBarFrame,"TOPLEFT",1,0)
  30.             end
  31.             lastButton = actionBarFrame.Buttons[i]
  32.             ActionButton_UpdateAction(lastButton);
  33.         end
  34.        
  35.         -- As a standalone Action Bar
  36.         RegisterStateDriver( actionBarFrame, "visibility", "[petbattle] hide; [shapeshift] show" );
  37.        
  38.         -- As a page on the Main Action Bar
  39.         --RegisterStateDriver( actionBarFrame, "visibility", "[petbattle] hide; show" );
  40.  
  41.         actionBarFrame:Execute(
  42.             [[
  43.                 ChildList     = newtable( self:GetChildren() );
  44.                 ActionButtons = newtable();
  45.                 actionType    = self:GetAttribute( "XUI_ActionType" );
  46.                
  47.                 local j = 1;
  48.                
  49.                 for i, child in ipairs( ChildList ) do
  50.                     if child:GetAttribute( "XUI_ActionType" ) then
  51.                         ActionButtons[j] = child;
  52.                         j = j+1;
  53.                     end
  54.                 end
  55.             ]]
  56.         );
  57.  
  58.         -- As a page on the Main Action Bar
  59.         --RegisterStateDriver(actionBarFrame, "page", "[vehicleui] GetVehicleBarIndex(); [shapeshift] GetTempShapeshiftBarIndex(); [extrabar] GetExtraBarIndex(); [overridebar] GetOverrideBarIndex(); [bar:2] 2; [bar:3] 3; [bar:4] 4; [bar:5] 5; [bar:6] 6; [bonusbar:1] 7; [bonusbar:2] 8; [bonusbar:3] 9; [bonusbar:4] 10; [bonusbar:5] 11;1" );
  60.        
  61.         actionBarFrame:Show()
  62.  
  63.     end
  64.    
  65. end
  66.  
  67. eventFrame:RegisterEvent("ACTIONBAR_UPDATE_STATE")
  68. eventFrame:RegisterEvent("ADDON_LOADED")
  69. eventFrame:RegisterEvent("ACTIONBAR_PAGE_CHANGED")
  70. eventFrame:RegisterEvent("UPDATE_BONUS_ACTIONBAR")
  71. eventFrame:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR")
  72. eventFrame:RegisterEvent("UPDATE_OVERRIDE_ACTIONBAR")
  73. eventFrame:RegisterEvent("UPDATE_SHAPESHIFT_FORM")
  74. eventFrame:RegisterEvent("UPDATE_POSSESS_BAR")
  75. eventFrame:RegisterEvent("UPDATE_EXTRA_ACTIONBAR")
  76.  
  77. eventFrame:SetScript("OnEvent",CheckEvents)
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_081813_185625.jpg
Views:	515
Size:	221.4 KB
ID:	7812  Click image for larger version

Name:	WoWScrnShot_081813_190306.jpg
Views:	497
Size:	249.4 KB
ID:	7813  
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818

Last edited by Xrystal : 08-18-13 at 12:06 PM.