Mercurial > wow > cyborg-mmo7
comparison WowObjects.lua @ 23:3b1c0b676583
Simplified the CallbackFactory object model.
| author | madcatzinc@35b17cf1-18cd-47ff-9ca3-31d6b526ef09 |
|---|---|
| date | Thu, 25 Apr 2013 01:30:36 +0000 |
| parents | cccc7661a2e6 |
| children | 6906d8ffd580 |
comparison
equal
deleted
inserted
replaced
| 22:0b0f51236a88 | 23:3b1c0b676583 |
|---|---|
| 45 | 45 |
| 46 return self | 46 return self |
| 47 end, | 47 end, |
| 48 | 48 |
| 49 ClearBinding = function(key) | 49 ClearBinding = function(key) |
| 50 local buttonFrame,parentFrame,name = CyborgMMO_CallbackFactory.Instance().AddCallback(CyborgMMO_WowObject.DoNothing) | 50 local buttonFrame,parentFrame,name = CyborgMMO_CallbackFactory:AddCallback(CyborgMMO_WowObject.DoNothing) |
| 51 SetOverrideBindingClick(parentFrame, true, key, name, "LeftButton") | 51 SetOverrideBindingClick(parentFrame, true, key, name, "LeftButton") |
| 52 end, | 52 end, |
| 53 | 53 |
| 54 DoNothing = function() | 54 DoNothing = function() |
| 55 end, | 55 end, |
| 136 buttonFrame:SetPushedTexture("Interface\\AddOns\\CyborgMMO7\\Graphics\\"..self.CallbackName.."Down.tga") | 136 buttonFrame:SetPushedTexture("Interface\\AddOns\\CyborgMMO7\\Graphics\\"..self.CallbackName.."Down.tga") |
| 137 buttonFrame:SetHighlightTexture("Interface\\AddOns\\CyborgMMO7\\Graphics\\"..self.CallbackName.."Over.tga") | 137 buttonFrame:SetHighlightTexture("Interface\\AddOns\\CyborgMMO7\\Graphics\\"..self.CallbackName.."Over.tga") |
| 138 end | 138 end |
| 139 | 139 |
| 140 self.DoAction = function() | 140 self.DoAction = function() |
| 141 local action = CyborgMMO_CallbackFactory.Instance().GetCallback(self.CallbackName) | 141 local action = CyborgMMO_CallbackFactory:GetCallback(self.CallbackName) |
| 142 CyborgMMO_DPrint("calling callback:- "..self.CallbackName) | 142 CyborgMMO_DPrint("calling callback:- "..self.CallbackName) |
| 143 action() | 143 action() |
| 144 end | 144 end |
| 145 | 145 |
| 146 self.PickupCallback = function() | 146 self.PickupCallback = function() |
| 166 ClearCursor() | 166 ClearCursor() |
| 167 self.PickupCallback() | 167 self.PickupCallback() |
| 168 end | 168 end |
| 169 | 169 |
| 170 self.SetBinding = function(key) | 170 self.SetBinding = function(key) |
| 171 local buttonFrame,parentFrame,name = CyborgMMO_CallbackFactory.Instance().AddCallback(self.DoAction) | 171 local buttonFrame,parentFrame,name = CyborgMMO_CallbackFactory:AddCallback(self.DoAction) |
| 172 SetOverrideBindingClick(CyborgMMO_CallbackFactory.Instance().Frame, true, key, name, "LeftButton") | 172 SetOverrideBindingClick(CyborgMMO_CallbackFactory.Frame, true, key, name, "LeftButton") |
| 173 end | 173 end |
| 174 | 174 |
| 175 return self | 175 return self |
| 176 end, | 176 end, |
| 177 } | 177 } |
| 205 -- SetCursor(self.Texture) | 205 -- SetCursor(self.Texture) |
| 206 return PickupItem(self.Link) | 206 return PickupItem(self.Link) |
| 207 end | 207 end |
| 208 | 208 |
| 209 self.SetBinding = function(key) | 209 self.SetBinding = function(key) |
| 210 SetOverrideBinding(CyborgMMO_CallbackFactory.Instance().Frame, true, key, "ITEM "..self.Name) | 210 SetOverrideBinding(CyborgMMO_CallbackFactory.Frame, true, key, "ITEM "..self.Name) |
| 211 end | 211 end |
| 212 | 212 |
| 213 return self | 213 return self |
| 214 end, | 214 end, |
| 215 } | 215 } |
| 239 end | 239 end |
| 240 | 240 |
| 241 self.SetBinding = function(key) | 241 self.SetBinding = function(key) |
| 242 CyborgMMO_DPrint("Binding to key "..key) | 242 CyborgMMO_DPrint("Binding to key "..key) |
| 243 self.Key = key | 243 self.Key = key |
| 244 SetOverrideBinding(CyborgMMO_CallbackFactory.Instance().Frame, true, self.Key, self.Type.." "..self.Name) | 244 SetOverrideBinding(CyborgMMO_CallbackFactory.Frame, true, self.Key, self.Type.." "..self.Name) |
| 245 end | 245 end |
| 246 | 246 |
| 247 return self | 247 return self |
| 248 end, | 248 end, |
| 249 } | 249 } |
| 272 return PickupMacro(self.Index) | 272 return PickupMacro(self.Index) |
| 273 end | 273 end |
| 274 | 274 |
| 275 self.SetBinding = function(key) | 275 self.SetBinding = function(key) |
| 276 self.Key = key | 276 self.Key = key |
| 277 SetOverrideBinding(CyborgMMO_CallbackFactory.Instance().Frame, true, key, "MACRO "..self.Index) | 277 SetOverrideBinding(CyborgMMO_CallbackFactory.Frame, true, key, "MACRO "..self.Index) |
| 278 end | 278 end |
| 279 | 279 |
| 280 return self | 280 return self |
| 281 end, | 281 end, |
| 282 } | 282 } |
| 308 return PickupCompanion(self.SubType, self.index) | 308 return PickupCompanion(self.SubType, self.index) |
| 309 end | 309 end |
| 310 | 310 |
| 311 self.SetBinding = function(key) | 311 self.SetBinding = function(key) |
| 312 self.Key = key | 312 self.Key = key |
| 313 local buttonFrame,parentFrame,name = CyborgMMO_CallbackFactory.Instance().AddCallback(self.DoAction) | 313 local buttonFrame,parentFrame,name = CyborgMMO_CallbackFactory:AddCallback(self.DoAction) |
| 314 SetOverrideBindingClick(parentFrame, true, key, name, "LeftButton") | 314 SetOverrideBindingClick(parentFrame, true, key, name, "LeftButton") |
| 315 -- SetOverrideBinding(hiddenModeChanger, true, key, "MACRO "..self.Index) | 315 -- SetOverrideBinding(hiddenModeChanger, true, key, "MACRO "..self.Index) |
| 316 end | 316 end |
| 317 | 317 |
| 318 return self | 318 return self |
| 346 return PickupMerchantItem(self.Index) | 346 return PickupMerchantItem(self.Index) |
| 347 end | 347 end |
| 348 | 348 |
| 349 self.SetBinding = function(key) | 349 self.SetBinding = function(key) |
| 350 self.Key = key | 350 self.Key = key |
| 351 SetOverrideBinding(CyborgMMO_CallbackFactory.Instance().Frame, true, key, "MERCHANT "..self.Index) | 351 SetOverrideBinding(CyborgMMO_CallbackFactory.Frame, true, key, "MERCHANT "..self.Index) |
| 352 end | 352 end |
| 353 | 353 |
| 354 return self | 354 return self |
| 355 end, | 355 end, |
| 356 } | 356 } |
| 378 return PickupEquipmentSetByName(self.Name) | 378 return PickupEquipmentSetByName(self.Name) |
| 379 end | 379 end |
| 380 | 380 |
| 381 self.SetBinding = function(key) | 381 self.SetBinding = function(key) |
| 382 self.Key = key | 382 self.Key = key |
| 383 local buttonFrame,parentFrame,name = CyborgMMO_CallbackFactory.Instance().AddCallback(self.DoAction); | 383 local buttonFrame,parentFrame,name = CyborgMMO_CallbackFactory:AddCallback(self.DoAction); |
| 384 SetOverrideBindingClick(parentFrame, true, key, name, "LeftButton") | 384 SetOverrideBindingClick(parentFrame, true, key, name, "LeftButton") |
| 385 end | 385 end |
| 386 | 386 |
| 387 return self | 387 return self |
| 388 end, | 388 end, |
