View Single Post
07-05-12, 07:33 AM   #6
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
Originally Posted by zork View Post
I have not enough knowledge of the secure state driver but maybe there are some events missing?
Like: UPDATE_VEHICLE_ACTIONBAR or UPDATE_OVERRIDE_ACTIONBAR
Doesn't matter if any events are missing for the SecureStateDriver as it updates via an OnUpdate script every 0.2 seconds, all the events do is force it to update immediately instead of wait on the timer.

Originally Posted by zork View Post
RegisterStateDriver(self, "page", getBarPage())
Your problem is you are passing the return value of getBarPage so basically you are doing the equivalent of:
Code:
RegisterStateDriver(self, "page", 1)
when you want to pass a string that contains the appropriate macro conditionals to return the correct page number.
Code:
RegisterStateDriver(self, "page", "[vehicleui] 12; [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")
Of course it still won't work in some cases because I don't think Blizzard has updated the C side of things for parsing macro conditionals or updated RestrictedEnvironment to include new functions. Basically any page over 11 is undetectable to us in a secure fashion except for page 12 when there is a skinned vehicle UI.

Here is a stripped down version of ActionBarController_UpdateAll that shows what states we can determine in a secure manner and which ones we cannot:
Code:
function ActionBarController_UpdateAll()
	if  (HasVehicleActionBar() and UnitVehicleSkin("player"))
	or (HasOverrideActionBar() and GetOverrideBarSkin()) then
		if HasVehicleActionBar() then
			-- Ok, [vehicleui], actionpage = GetVehicleBarIndex() = 12
		else
			-- ???, actionpage = GetOverrideBarIndex() = 14
		end
	elseif (HasVehicleActionBar()) then
		-- ???, actionpage = GetVehicleBarIndex() = 12
		-- [pet] works for Dominate Mind but would conflict with Shadow Fiend
	elseif (HasOverrideActionBar()) then
		-- ???, actionpage = GetOverrideBarIndex() = 14
	elseif (HasTempShapeshiftActionBar()) then
		-- ???, actionpage = GetTempShapeshiftBarIndex() = 13
	elseif (HasBonusActionBar() and GetActionBarPage() == 1) then
		-- Ok, [bonusbar:1-5], actionpage = GetBonusBarIndex() = 7 - 11
	else
		-- Ok, [bar:1-6], actionpage = GetActionBarPage() = 1 - 6
	end
end