Skip to content

Commit

Permalink
Add action bar stance paging for hero
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew6180 committed Oct 26, 2022
1 parent d17b757 commit 65a22eb
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Bartender4/ActionBars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ local abdefaults = {
stance = {
DRUID = { bear = 9, cat = 7, prowl = 8 },
WARRIOR = { battle = 7, def = 8, berserker = 9 },
ROGUE = { stealth = 7, shadowdance = 7 }
ROGUE = { stealth = 7, shadowdance = 7 },
HERO = { bear = 9, cat = 7, prowl = 8, stealth = 7, shadowdance = 7, battle = 7, def = 8, berserker = 9 },
},
},
visibility = {
Expand Down
8 changes: 7 additions & 1 deletion Bartender4/MultiCastBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
All rights reserved.
]]

if not HasMultiCastActionBar or select(2, UnitClass("player")) ~= "DRUID" then return end
if not HasMultiCastActionBar then return end

local classMask = UnitClassMask("player")

if not bit.contains(EnumUtil.CombineMasks(Enum.ClassMask.DRUID, Enum.ClassMask.HERO), classMask) then
return
end

-- fetch upvalues
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
Expand Down
1 change: 1 addition & 0 deletions Bartender4/Options/Bar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ end
local _, class = UnitClass("player")
local stanceClasses = {
DRUID = true,
HERO = true,
WARRIOR = true,
WARLOCK = true,
PRIEST = true,
Expand Down
8 changes: 7 additions & 1 deletion Bartender4/Options/MultiCastBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
All rights reserved.
]]

if not HasMultiCastActionBar or select(2, UnitClass("player")) ~= "DRUID" then return end
if not HasMultiCastActionBar then return end

local classMask = UnitClassMask("player")

if not bit.contains(EnumUtil.CombineMasks(Enum.ClassMask.DRUID, Enum.ClassMask.HERO), classMask) then
return
end

-- fetch upvalues
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
Expand Down
27 changes: 26 additions & 1 deletion Bartender4/StateBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,31 @@ local DefaultStanceMap = setmetatable({}, { __index = function(t,k)
newT = {
{ id = "metamorphosis", name = GetSpellInfo(59672), index = 2, type = "form"},
}
elseif k == "HERO" then
newT = {
-- Warrior
{ id = "battle", name = GetSpellInfo(2457), index = 1},
{ id = "def", name = GetSpellInfo(71), index = 2 },
{ id = "berserker", name = GetSpellInfo(2458), index = 3 },

-- Druid
{ id = "bear", name = GetSpellInfo(5487), index = 3 },
{ id = "cat", name = GetSpellInfo(768), index = 1 },
-- prowl is virtual, no real stance
{ id = "prowl", name = ("%s (%s)"):format((GetSpellInfo(768)), (GetSpellInfo(5215))), index = false},
{ id = "moonkin", name = GetSpellInfo(24858), index = 4 },
{ id = "treeoflife", name = GetSpellInfo(33891), index = 2 },

-- Rogue
{ id = "stealth", name = GetSpellInfo(1784), index = 1 },
{ id = "shadowdance", name = GetSpellInfo(51713), index = 2 },

-- Priest
{ id = "shadowform", name = GetSpellInfo(15473), index = 1 },

-- Warlock
{ id = "metamorphosis", name = GetSpellInfo(59672), index = 2, type = "form"},
}
end
rawset(t, k, newT)

Expand Down Expand Up @@ -134,7 +159,7 @@ function StateBar:UpdateStates(returnOnly)
local state = self:GetStanceState(v)
if state and state ~= 0 and v.index then
-- hack for druid prowl, since its no real "stance", but we want to handle it anyway
if playerclass == "DRUID" and v.id == "cat" then
if (playerclass == "DRUID" or playerclass == "HERO") and v.id == "cat" then
local prowl = self:GetStanceState("prowl")
if prowl and prowl ~= 0 then
table_insert(statedriver, fmt("[bonusbar:%s,stealth:1]%s", v.index, prowl))
Expand Down

0 comments on commit 65a22eb

Please sign in to comment.