fix bugs for classes that dont have any stances (yet)

This commit is contained in:
Hendrik Leppkes
2008-02-21 16:53:12 +00:00
parent 17ed1caa90
commit 720bd42401
3 changed files with 10 additions and 3 deletions
+5 -3
View File
@@ -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
+4
View File
@@ -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)
+1
View File
@@ -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