comparison WowObjects.lua @ 33:1c0af1810e06

Removed the "petaction" and "merchant" objects. They are not (no longer?) supported by regular action bars, and so shouldn't be necessary on button bindings.
author madcatzinc@35b17cf1-18cd-47ff-9ca3-31d6b526ef09
date Thu, 25 Apr 2013 01:31:26 +0000
parents b7074b47cfc7
children 6ce173840e68
comparison
equal deleted inserted replaced
32:fc5f52d60d16 33:1c0af1810e06
147 ------------------------------------------------------------------------------ 147 ------------------------------------------------------------------------------
148 148
149 local WowSpell_methods = setmetatable({}, {__index=WowObject_methods}) 149 local WowSpell_methods = setmetatable({}, {__index=WowObject_methods})
150 local WowSpell_mt = {__index=WowSpell_methods} 150 local WowSpell_mt = {__index=WowSpell_methods}
151 151
152 local function WowSpell(type, spellbookID, spellbook) 152 local function WowSpell(spellbookID, spellbook)
153 local self = WowObject(type, spellbookID, spellbook) 153 local self = WowObject("spell", spellbookID, spellbook)
154 154
155 self.SpellbookID = spellbookID 155 self.SpellbookID = spellbookID
156 self.Spellbook = spellbook 156 self.Spellbook = spellbook
157 self.Name,self.Rank = GetSpellBookItemName(spellbookID, spellbook) 157 self.Name,self.Rank = GetSpellBookItemName(spellbookID, spellbook)
158 self.Texture = GetSpellBookItemTexture(spellbookID, spellbook) 158 self.Texture = GetSpellBookItemTexture(spellbookID, spellbook)
159 self.Type = type
160 159
161 setmetatable(self, WowSpell_mt) 160 setmetatable(self, WowSpell_mt)
162 161
163 return self 162 return self
164 end 163 end
252 function WowCompanion_methods:SetBinding(key) 251 function WowCompanion_methods:SetBinding(key)
253 self.Key = key 252 self.Key = key
254 local buttonFrame,parentFrame,name = CyborgMMO_CallbackFactory:AddCallback(function() self:DoAction() end) 253 local buttonFrame,parentFrame,name = CyborgMMO_CallbackFactory:AddCallback(function() self:DoAction() end)
255 SetOverrideBindingClick(parentFrame, true, key, name, "LeftButton") 254 SetOverrideBindingClick(parentFrame, true, key, name, "LeftButton")
256 -- SetOverrideBinding(hiddenModeChanger, true, key, "MACRO "..self.Index) 255 -- SetOverrideBinding(hiddenModeChanger, true, key, "MACRO "..self.Index)
257 end
258
259 ------------------------------------------------------------------------------
260
261 local WowMerchant_methods = setmetatable({}, {__index=WowObject_methods})
262 local WowMerchant_mt = {__index=WowMerchant_methods}
263
264 local function WowMerchant(index)
265 local self = WowObject("merchant", index, nil)
266
267 self.Name,
268 self.Texture,
269 self.Price,
270 self.Quantity,
271 self.NumAvailable,
272 self.IsUsable,
273 self.ExtendedCost = GetMerchantItemInfo(index)
274 self.Index = index
275
276 setmetatable(self, WowMerchant_mt)
277
278 return self
279 end
280
281 function WowMerchant_methods:DoAction()
282 CyborgMMO_DPrint("Use Item")
283 end
284
285 function WowMerchant_methods:Pickup()
286 self:PlaySound()
287 ClearCursor()
288 -- SetCursor(self.Texture)
289 return PickupMerchantItem(self.Index)
290 end
291
292 function WowMerchant_methods:SetBinding(key)
293 self.Key = key
294 SetOverrideBinding(CyborgMMO_CallbackFactory.Frame, true, key, "MERCHANT "..self.Index)
295 end 256 end
296 257
297 ------------------------------------------------------------------------------ 258 ------------------------------------------------------------------------------
298 259
299 local WowEquipmentSet_methods = setmetatable({}, {__index=WowObject_methods}) 260 local WowEquipmentSet_methods = setmetatable({}, {__index=WowObject_methods})
381 if type == "item" then 342 if type == "item" then
382 object = WowItem(...) 343 object = WowItem(...)
383 elseif type == "macro" then 344 elseif type == "macro" then
384 object = WowMacro(...) 345 object = WowMacro(...)
385 elseif type == "spell" then 346 elseif type == "spell" then
386 object = WowSpell(type, ...) 347 object = WowSpell(...)
387 elseif type == "petaction" then
388 object = WowSpell(type, ...)
389 elseif type == "merchant" then
390 object = WowMerchant(...)
391 elseif type == "companion" then 348 elseif type == "companion" then
392 object = WowCompanion(...) 349 object = WowCompanion(...)
393 elseif type == "equipmentset" then 350 elseif type == "equipmentset" then
394 object = WowEquipmentSet(type, ...) 351 object = WowEquipmentSet(type, ...)
395 elseif type == "callback" then 352 elseif type == "callback" then