Thread Tools Display Modes
Old 06-30-12, 04:13 PM   #1
Maul
Ion Engines, Engage!
 
Maul's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 401
Macro Changes

The macro conditional [bonusbar] seems to be non-functional as of right now. Not sure if this is intended and/or if there is a replacement.

Last edited by Maul : 07-11-12 at 01:40 PM. Reason: Renamed Title
Maul is offline  
Old 07-04-12, 10:03 AM   #2
Maul
Ion Engines, Engage!
 
Maul's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 401
A further clarification, it seems [bonusbar:5] is no longer functional.

[vehicleui] works as a replacement for vehicles, but this does not help with possess states.

If anyone has a solution for possess (Dominate Mind (aka Mind Control)) or for the few instances that look like a vehicle UI but are really a possess state, I am all ears
__________________

Twitter: @IonMaul | Windows Live: trinityui@live.com | Google Talk: trinityui@gmail.com
Maul is offline  
Old 07-04-12, 05:33 PM   #3
Vrul
A Chromatic Dragonspawn
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 194
The action page for possession is now 12 but [bonusbar:6] doesn't work. Possession is still handled like a vehicle for the most part though so maybe they need to update the macro conditions for vehicles or add a new one for possess.
Vrul is offline  
Old 07-05-12, 04:31 AM   #4
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,308
Actually they changed the complete ActionBarController.

BonusBar and VehicleBar are gone. Instead they introduced a bar called OverrideBar.

The problem that I'm having with the default buttons is that the bar does not swap anymore. When entering a vehicle the actionbar1 buttons stay the same and buttons are added to the overridebar. What triggers the swap is the ActionBarController_UpdateAll() function that is triggered on event.

Lua Code:
  1. event == "UPDATE_BONUS_ACTIONBAR"
  2.     event == "UPDATE_VEHICLE_ACTIONBAR"
  3.     event == "UPDATE_OVERRIDE_ACTIONBAR"
  4.     event == "ACTIONBAR_PAGE_CHANGED"

A function that returns the correct pageid is
Lua Code:
  1. local function getBarPage()
  2.     print("getting pages")
  3.     if ( HasBonusActionBar() or HasOverrideActionBar() or HasVehicleActionBar() or HasTempShapeshiftActionBar() ) then
  4.       if (HasVehicleActionBar()) then
  5.         return GetVehicleBarIndex()
  6.       elseif (HasOverrideActionBar()) then
  7.         return GetOverrideBarIndex()
  8.       elseif (HasTempShapeshiftActionBar()) then
  9.         return GetTempShapeshiftBarIndex()
  10.       elseif (HasBonusActionBar() and GetActionBarPage() == 1) then
  11.         return GetBonusBarIndex()
  12.       else
  13.         return GetActionBarPage()
  14.       end
  15.     else
  16.       return GetActionBarPage()
  17.     end
  18.   end

But how to call that function onstate and how to make the statedriver trigger onevent?

My problem is described here:
http://www.wowinterface.com/forums/s...649#post257649

I checked the state driver:
https://github.com/Ketho/wow-ui-sour...river.lua#L184

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

To make my bar work I need to change the actionpage attribute on the buttons. Of course securly and for all the given events. I have no clue how to do it.

I'm not sure but I think I finally understood the state driver. There very few stateids like "visibility" that have pre-defined functions. That one show/hides a frame based on the macro condition. All other stateids define the function called via self:SetAttribute('_onstate-STATEID', ([[FUNCTION]]))

But if there is no event that updates the attribute (because the event not being registered to the state driver manager) it will not work.

Lua Code:
  1. self:SetAttribute('_onstate-page', ([[
  2.   if not newstate then return end
  3.   newstate = tonumber(newstate)
  4.   for id = 1, %s do
  5.     buttons[id]:SetAttribute("actionpage", newstate)
  6.   end
  7. ]]):format(NUM_ACTIONBAR_BUTTONS))
  8. RegisterStateDriver(self, "page", getBarPage())
  9. RegisterStateDriver(self, "visibility", "[vehicleui][target=vehicle,exists] show;hide")

I know that the 3rd argument is the result of any kind of macro condition. The getBarPage() function will deliver the pageid that could be used to update the actionpage of all the buttons provided.

I might be wrong here but I think that UPDATE_VEHICLE_ACTIONBAR and UPDATE_OVERRIDE_ACTIONBAR are missing as registered events on the SecureStateDriverManager. That's why there is no update fired once entering a vehicle. (Because that is triggered by new events which have not been added yet to the statedrivermanager)

In WoW 4.3 the VehicleBar was loaded to the BonusActionBar aswell. That was removed and that change is not reflected by the state driver.

Not sure but are we allowed to add events to the statedriver manager manually? That way doing this could be the solution:
Lua Code:
  1. SecureStateDriverManager:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR");
  2. SecureStateDriverManager:RegisterEvent("UPDATE_OVERRIDE_ACTIONBAR");
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

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

Last edited by zork : 07-05-12 at 08:42 AM.
zork is offline  
Old 07-05-12, 05:54 AM   #5
Maul
Ion Engines, Engage!
 
Maul's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 401
Originally Posted by zork View Post
Maybe there is an [overridebar] condition?
Already tried it, and many, many other combinations

I have been looking around to see if there is a way to dump macro conditionals, but have not found anything yet.

You may be onto something in regards to the events needing to be added. I have not really examined the secure state code or the restricted environment code too much with the beta, because for my needs almost everything is working save for possess. Though, I have not tried anything with the extra action button either. And if it were not for the existing [vehicleui] conditional, there seems to be no way for addons to hook or mimic the new override action bar scheme (without addon breaking taint)
__________________

Twitter: @IonMaul | Windows Live: trinityui@live.com | Google Talk: trinityui@gmail.com
Maul is offline  
Old 07-05-12, 07:33 AM   #6
Vrul
A Chromatic Dragonspawn
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 194
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
Vrul is offline  
Old 07-05-12, 07:54 AM   #7
Tuller
A Black Drake
 
Tuller's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 84
My kingdom for:
  • HasVehicleActionBar(),
  • HasOverrideActionBar()
  • HasTempShapeshiftActionBar(),
  • HasBonusActionBar()
being published to the restricted environment, along with suitable macro conditionals for each. I'm more confused as to what HasTempShapeshiftActionBar() is used for.
Tuller is offline  
Old 07-05-12, 08:37 AM   #8
Vrul
A Chromatic Dragonspawn
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 194
You don't need HasBonusActionBar() since GetBonusBarOffset() is in the RestrictedEnvironment already and returns 0 if there isn't a bonus bar.
Vrul is offline  
Old 07-05-12, 09:03 AM   #9
Maul
Ion Engines, Engage!
 
Maul's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 401
Originally Posted by Vrul View Post
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.
This is pretty much what I suspect, but I just wanted to get it out there so it is a known issue.

My want is simple, a macro conditional for possess that I can use with RegisterStateDriver(). I'd rather not have to get more complicated than that
__________________

Twitter: @IonMaul | Windows Live: trinityui@live.com | Google Talk: trinityui@gmail.com
Maul is offline  
Old 07-05-12, 09:07 AM   #10
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,308
Can SecureHandlerWrapScript help us out? I would say no because the macro condition would not fire?!
http://www.wowinterface.com/forums/s...ad.php?t=43341
http://books.google.de/books?id=tOSD...Script&f=false
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

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

Last edited by zork : 07-05-12 at 09:27 AM.
zork is offline  
Old 07-05-12, 11:11 AM   #11
Tuller
A Black Drake
 
Tuller's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 84
Originally Posted by zork View Post
Can SecureHandlerWrapScript help us out? I would say no because the macro condition would not fire?!
http://www.wowinterface.com/forums/s...ad.php?t=43341
http://books.google.de/books?id=tOSD...Script&f=false
Without looking at code, you could probably attach a secureshowhide frame to the possess bar in order to figure out when it was shown/hidden in a secure environment.


Also, this reminds me:
WTB macro states for the ExtraActionBar
Tuller is offline  
Old 07-05-12, 11:45 AM   #12
Maul
Ion Engines, Engage!
 
Maul's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 401
Originally Posted by Tuller View Post
WTB macro states for the ExtraActionBar
Okay, I want two things
__________________

Twitter: @IonMaul | Windows Live: trinityui@live.com | Google Talk: trinityui@gmail.com
Maul is offline  
 

Go BackWoWInterface » WoD Beta » MoP archived threads » [bonusbar] macro conditional

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off