Mercurial > wow > reaction
comparison StanceButton.lua @ 286:77609bfa804e stable
Merge 1.1 beta 8 to stable
author | Flick |
---|---|
date | Sat, 11 Jun 2011 10:57:00 -0700 |
parents | 5b9c0164a491 |
children | 276165a0e860 |
comparison
equal
deleted
inserted
replaced
272:71d1a5e47e72 | 286:77609bfa804e |
---|---|
1 local addonName, addonTable = ... | 1 local _, ns = ... |
2 local ReAction = addonTable.ReAction | 2 local ReAction = ns.ReAction |
3 local L = ReAction.L | 3 local L = ReAction.L |
4 local _G = _G | 4 local _G = _G |
5 local CreateFrame = CreateFrame | 5 local CreateFrame = CreateFrame |
6 local format = string.format | 6 local format = string.format |
7 local GetCVar = GetCVar | 7 local GetCVar = GetCVar |
51 | 51 |
52 ReAction.Button.Stance = Stance | 52 ReAction.Button.Stance = Stance |
53 ReAction:RegisterBarType(Stance) | 53 ReAction:RegisterBarType(Stance) |
54 | 54 |
55 function Stance:New( config, bar, idx, idHint ) | 55 function Stance:New( config, bar, idx, idHint ) |
56 local name = format("ReAction_%s_Stance_%d",bar:GetName(),idx) | 56 self = Super.New(self, config, bar, idx, "SecureActionButtonTemplate, ActionButtonTemplate" ) |
57 | |
58 self = Super.New(self, name, config, bar, idx, "SecureActionButtonTemplate, ActionButtonTemplate" ) | |
59 | 57 |
60 local f = self:GetFrame() | 58 local f = self:GetFrame() |
61 local barFrame = bar:GetFrame() | 59 local barFrame = bar:GetFrame() |
62 local config = self:GetConfig() | 60 local config = self:GetConfig() |
63 | 61 |
111 self.updatePending = true | 109 self.updatePending = true |
112 else | 110 else |
113 self.updatePending = false | 111 self.updatePending = false |
114 local idx = self:GetActionID() | 112 local idx = self:GetActionID() |
115 local f = self:GetFrame() | 113 local f = self:GetFrame() |
116 if idx > GetNumShapeshiftForms() then | 114 if idx > GetNumShapeshiftForms() and not ReAction:GetConfigMode() then |
117 f:Hide() | 115 f:Hide() |
118 else | 116 else |
119 f:SetAttribute("spell", select(2,GetShapeshiftFormInfo(idx))) | 117 f:SetAttribute("spell", select(2,GetShapeshiftFormInfo(idx))) |
120 f:Show() | 118 f:Show() |
121 self:Update() | 119 self:Update() |