fix bugs for classes that dont have any stances (yet)
This commit is contained in:
+5
-3
@@ -134,9 +134,11 @@ function module:GetStateOptionsTable()
|
||||
|
||||
do
|
||||
local defstancemap = self.DefaultStanceMap[playerclass]
|
||||
for k,v in pairs(defstancemap) do
|
||||
if not options.stances.args[v.id] then
|
||||
options.stances.args[v.id] = createOptionGroup(k, v.id)
|
||||
if defstancemap then
|
||||
for k,v in pairs(defstancemap) do
|
||||
if not options.stances.args[v.id] then
|
||||
options.stances.args[v.id] = createOptionGroup(k, v.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -146,6 +146,10 @@ function ButtonBar:UpdateButtonLayout()
|
||||
local numbuttons = #buttons
|
||||
local pad = self:GetPadding()
|
||||
|
||||
-- bail out if the bar has no buttons, for whatever reason
|
||||
-- (eg. stanceless class, or no stances learned yet, etc.)
|
||||
if numbuttons == 0 then return end
|
||||
|
||||
local Rows = self:GetRows()
|
||||
local ButtonPerRow = math_floor(numbuttons / Rows + 0.5) -- just a precaution
|
||||
Rows = math_floor(numbuttons / ButtonPerRow + 0.5)
|
||||
|
||||
@@ -54,6 +54,7 @@ function StanceBarMod:SetupOptions()
|
||||
name = "Stance Bar",
|
||||
desc = "Configure the Stance Bar",
|
||||
childGroups = "tab",
|
||||
disabled = function() return GetNumShapeshiftForms() == 0 end,
|
||||
}
|
||||
ActionBars.options.args["stance"].args = self.options.table
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user