View Single Post
05-30-16, 02:43 AM   #9
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
I need some help on macro conditions.

The biggest issues is this mess:
https://github.com/tomrus88/Blizzard...roller.lua#L99

That is Blizzard code to change the mainactionbar to the overridebar under certain conditions.

Here is the problem. I need to reflect that function only using the macro conditions here:
http://wow.gamepedia.com/Macro_conditionals

Those are the conditons that make sense:
Code:
actionbar:1/.../6 or bar:1/.../6 — Given action bar page is selected.
bonusbar:1/... — a (specific) bonus action bar is currently overriding the player's main action bar.
canexitvehicle — Player is in a vehicle and can exit it at will.
overridebar — Player's main action bar is currently replaced by the override action bar.
possessbar — Player's main action bar is currently replaced by the possess action bar.
shapeshift — Player's main action bar is currently replaced by a temporary shapeshift action bar.
vehicleui — Player has vehicle UI.
I need two conditions.
One that shows the OverrideActionBar when actions are loaded into it.
And a second one that shows the actions in the MainActionbar if the OverrideActionBar is not used.

Currently my conditions are like this:

OverrideActionBar

Blizzard conditions:
Lua Code:
  1. -- If we have a skinned vehicle bar or skinned override bar, display the OverrideActionBar
  2.     if ((HasVehicleActionBar() and UnitVehicleSkin("player") and UnitVehicleSkin("player") ~= "")
  3.     or (HasOverrideActionBar() and GetOverrideBarSkin() and GetOverrideBarSkin() ~= 0)) then
My macro condition:
Code:
"[overridebar][vehicleui][possessbar,@vehicle,exists] show; hide"
MainActionBar

Blizzard conditions:
Lua Code:
  1. -- If we have a non-skinned override bar of some sort, use the MainMenuBarArtFrame
  2.     elseif ( HasBonusActionBar() or HasOverrideActionBar() or HasVehicleActionBar() or HasTempShapeshiftActionBar() or C_PetBattles.IsInBattle() ) then
My macro condition:
Code:
"[petbattle][overridebar][vehicleui][possessbar,@vehicle,exists] hide; show"
Shapeshift and bonusbar are not yet included because they affect the mainactionbar only anyway. This works fine for many situations. But there seems to be a quest that returns true for [possessbar,@vehicle,exists] while not showing ablities in the overrideactionbar.

I have no macro condition that reflects the first Blizzard condition where they check for UnitVehicleSkin or OverrideBarSkin. That would problably solve my issue.

*edit*

One way out may be this right here:
https://github.com/tomrus88/Blizzard...onment.lua#L86

Most importantly: HasOverrideUI. That does not exist right? http://us.battle.net/wow/en/forum/topic/7350045197

Any ideas?

Sources:

Code:
/run local s=SecureCmdOptionParse print(s("[bonusbar]bb;nobb"),s("[canexitvehicle]cev;nocev"),s("[overridebar]ob;noob"),s("[possessbar]pb;nopb"),s("[shapeshift]tss;notss"),s("[vehicleui]vui;novui"),s("[@vehicle,exists]ve;nove"))
http://wowprogramming.com/docs/api/SecureCmdOptionParse
http://wow.gamepedia.com/Macro_conditionals
http://www.wowinterface.com/forums/s...ad.php?t=45083
__________________
| 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 : 05-30-16 at 03:34 AM.