Mercurial > wow > cyborg-mmo7
comparison RatPageController.lua @ 4:d186f8cd5000
Renamed functions to avoid conflicts
author | madcatzinc@35b17cf1-18cd-47ff-9ca3-31d6b526ef09 |
---|---|
date | Mon, 28 May 2012 15:54:52 +0000 |
parents | bf9220814fb5 |
children | 6cb9a2936580 |
comparison
equal
deleted
inserted
replaced
3:461854a2849c | 4:d186f8cd5000 |
---|---|
16 | 16 |
17 --~ You should have received a copy of the GNU General Public License | 17 --~ You should have received a copy of the GNU General Public License |
18 --~ along with this program; if not, write to the Free Software | 18 --~ along with this program; if not, write to the Free Software |
19 --~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 19 --~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
20 | 20 |
21 RatPageController = { | 21 CyborgMMO_RatPageController = { |
22 new = function() | 22 new = function() |
23 local self = {}; | 23 local self = {}; |
24 RatPageModel.Instance().SetMode(1); | 24 CyborgMMO_RatPageModel.Instance().SetMode(1); |
25 | 25 |
26 self.SlotClicked = function(slot) | 26 self.SlotClicked = function(slot) |
27 local slotObject = nil | 27 local slotObject = nil |
28 slotObject = RatPageModel.Instance().GetObjectOnButton(slot.Id) | 28 slotObject = CyborgMMO_RatPageModel.Instance().GetObjectOnButton(slot.Id) |
29 RatPageModel.Instance().SetObjectOnButton(slot.Id, RatPageModel.Instance().GetMode(), self.GetCursorObject()); | 29 CyborgMMO_RatPageModel.Instance().SetObjectOnButton(slot.Id, CyborgMMO_RatPageModel.Instance().GetMode(), self.GetCursorObject()); |
30 | 30 |
31 if(slotObject ~= nil) then | 31 if(slotObject ~= nil) then |
32 slotObject.Pickup(); | 32 slotObject.Pickup(); |
33 end | 33 end |
34 | 34 |
35 end | 35 end |
36 | 36 |
37 self.ModeClicked = function(mode) | 37 self.ModeClicked = function(mode) |
38 msg("Setting mode "..tostring(mode.Id)); | 38 msg("Setting mode "..tostring(mode.Id)); |
39 RatPageModel.Instance().SetMode(mode.Id); | 39 CyborgMMO_RatPageModel.Instance().SetMode(mode.Id); |
40 end | 40 end |
41 | 41 |
42 self.GetCursorObject = function() | 42 self.GetCursorObject = function() |
43 local cursorObject = nil; | 43 local cursorObject = nil; |
44 if(nil ~= GetCursorInfo()) then | 44 if(nil ~= GetCursorInfo()) then |
45 local type, detail, subdetail = GetCursorInfo(); | 45 local type, detail, subdetail = GetCursorInfo(); |
46 cursorObject = WowObject.Create(type, detail, subdetail); | 46 cursorObject = CyborgMMO_WowObject.Create(type, detail, subdetail); |
47 ClearCursor(); | 47 ClearCursor(); |
48 end | 48 end |
49 return cursorObject; | 49 return cursorObject; |
50 end | 50 end |
51 | 51 |
52 self.CallbackDropped = function(callbackObject) | 52 self.CallbackDropped = function(callbackObject) |
53 local slot = nil; | 53 local slot = nil; |
54 local observers = RatPageModel.Instance().GetAllObservers(); | 54 local observers = CyborgMMO_RatPageModel.Instance().GetAllObservers(); |
55 for i = 1, (# observers) do | 55 for i = 1, (# observers) do |
56 if(MouseIsOver(observers[i])) then | 56 if(MouseIsOver(observers[i])) then |
57 slot = observers[i]; | 57 slot = observers[i]; |
58 break; | 58 break; |
59 end | 59 end |
60 end | 60 end |
61 if(nil ~= slot) then | 61 if(nil ~= slot) then |
62 RatPageModel.Instance().SetObjectOnButton(slot.Id, RatPageModel.Instance().GetMode(), callbackObject.wowObject); | 62 CyborgMMO_RatPageModel.Instance().SetObjectOnButton(slot.Id, CyborgMMO_RatPageModel.Instance().GetMode(), callbackObject.wowObject); |
63 end | 63 end |
64 end | 64 end |
65 | 65 |
66 | 66 |
67 | 67 |
76 end, | 76 end, |
77 | 77 |
78 m_Instance = nil, | 78 m_Instance = nil, |
79 | 79 |
80 Instance = function() | 80 Instance = function() |
81 if(nil == RatPageController.m_Instance) then | 81 if(nil == CyborgMMO_RatPageController.m_Instance) then |
82 RatPageController.m_Instance = RatPageController.new(); | 82 CyborgMMO_RatPageController.m_Instance = CyborgMMO_RatPageController.new(); |
83 end | 83 end |
84 return RatPageController.m_Instance; | 84 return CyborgMMO_RatPageController.m_Instance; |
85 end | 85 end |
86 } | 86 } |