function update(bar)
local n = GetNumShapeshiftForms();
--for i=1,NUM_STANCE_SLOTS do
- for i=1,3 do
+ for i=1,4 do
local button = bar[i];
if i <= n then
local tex, active, castable = GetShapeshiftFormInfo(i);
else
icon:SetVertexColor(0.4, 0.4, 0.4);
end
- button:Show();
+ --button:Show();
else
- button:Hide();
+ --button:Hide();
end
end
end
elseif event == "PLAYER_LOGIN" then
-- TODO do class detection and only create necessary buttons
stancebar:UnregisterAllEvents();
- for i=1,3 do
+ local _, class = UnitClass("player");
+ if class ~= "PALADIN" and class ~= "DRUID" then
+ return
+ end
+ for i=1,4 do
create(i, self, self[i-1]);
end
update(self);
_G["BINDING_HEADER_OMAABSTANCE"] = "Stance Bar";
- for i = 1,3 do
+ for i = 1,4 do
_G[format("BINDING_NAME_CLICK OmaBTStance%d:LeftButton", i)] = format("Stance Bar Button %d", i);
end
stancebar:RegisterEvent("UPDATE_SHAPESHIFT_COOLDOWN");