Mercurial > wow > reaction
comparison BagButton.lua @ 286:77609bfa804e stable
Merge 1.1 beta 8 to stable
| author | Flick |
|---|---|
| date | Sat, 11 Jun 2011 10:57:00 -0700 |
| parents | 4e325f1ea6e1 |
| children | d1a56601267b |
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 |
| 47 -- | 47 -- |
| 48 -- Bag Button base class | 48 -- Bag Button base class |
| 49 -- | 49 -- |
| 50 | 50 |
| 51 function BagBase:New( btnCfg, bar, idx, idHint ) | 51 function BagBase:New( btnCfg, bar, idx, idHint ) |
| 52 local name = format("ReAction_%s_Bag_%d",bar:GetName(),idx) | |
| 53 | |
| 54 -- use a variable private leaf implementation class | 52 -- use a variable private leaf implementation class |
| 55 -- unlike traditional OO programming, we can initialize the leaf | 53 -- unlike traditional OO programming, we can initialize the leaf |
| 56 -- class before initializing its parent | 54 -- class before initializing its parent |
| 57 local class = Bag | 55 local class = Bag |
| 58 if idx == 1 then | 56 if idx == 1 then |
| 59 class = Backpack | 57 class = Backpack |
| 60 elseif idx == 6 then | 58 elseif idx == 6 then |
| 61 class = Keyring | 59 class = Keyring |
| 62 end | 60 end |
| 63 self = class:New(name, btnCfg, bar, idx) | 61 self = class:New(btnCfg, bar, idx) |
| 64 | 62 |
| 65 local f = self:GetFrame() | 63 local f = self:GetFrame() |
| 66 local config = self:GetConfig() | 64 local config = self:GetConfig() |
| 67 | 65 |
| 68 -- set up the bag ID pool | 66 -- set up the bag ID pool |
