public
Description: WoW Powerleveling addon
Homepage: http://www.tekkub.net/
Clone URL: git://github.com/tekkub/tourguide.git
Click here to lend your support to: tourguide and make a donation at www.pledgie.com !
Move use item frame into it's own file
tekkub (author)
Fri Jul 11 19:57:52 -0700 2008
commit  a940aab26ff84b6eb6eadf46d0b45801086c6f35
tree    20298865173aacb9e5934617e4372bc9cfae9f13
parent  46809a541b04b93f3dfbbf070a1f0502381e9b7a
...
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
...
83
84
85
86
87
88
89
90
91
92
93
...
130
131
132
133
 
134
135
136
...
240
241
242
243
244
245
246
 
 
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
...
288
289
290
291
292
293
294
295
296
297
298
...
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
...
39
40
41
 
 
 
 
 
 
 
 
 
42
43
44
...
74
75
76
 
 
 
 
 
77
78
79
...
116
117
118
 
119
120
121
122
...
226
227
228
 
 
 
 
229
230
231
232
233
234
235
236
 
 
 
 
 
 
 
 
 
 
 
 
237
238
239
...
260
261
262
 
 
 
 
 
263
264
265
...
304
305
306
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -39,15 +39,6 @@ local icon = ww.SummonTexture(f, "ARTWORK", ICONSIZE, ICONSIZE, nil, "LEFT", che
0
 local text = ww.SummonFontString(f, "OVERLAY", "GameFontNormalSmall", nil, "RIGHT", -GAP-4, 0)
0
 text:SetPoint("LEFT", icon, "RIGHT", GAP-4, 0)
0
 
0
-local item = CreateFrame("Button", "TourGuideItemFrame", UIParent, "SecureActionButtonTemplate")
0
-item:SetFrameStrata("LOW")
0
-item:SetHeight(36)
0
-item:SetWidth(36)
0
-item:SetPoint("BOTTOMRIGHT", QuestWatchFrame, "TOPRIGHT", -62, 10)
0
-item:RegisterForClicks("anyUp")
0
-local itemicon = ww.SummonTexture(item, "ARTWORK", 24, 24, "Interface\\Icons\\INV_Misc_Bag_08")
0
-itemicon:SetAllPoints(item)
0
-item:Hide()
0
 
0
 local f2 = CreateFrame("Frame", nil, UIParent)
0
 local f2anchor = "RIGHT"
0
@@ -83,11 +74,6 @@ function TourGuide:PositionStatusFrame()
0
     f:ClearAllPoints()
0
     f:SetPoint(self.db.profile.statusframepoint, self.db.profile.statusframex, self.db.profile.statusframey)
0
   end
0
-
0
- if self.db.profile.itemframepoint then
0
- item:ClearAllPoints()
0
- item:SetPoint(self.db.profile.itemframepoint, self.db.profile.itemframex, self.db.profile.itemframey)
0
- end
0
 end
0
 
0
 local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("TourGuide", {text = "Bah!", icon = TourGuide.icons.KILL})
0
@@ -130,7 +116,7 @@ function TourGuide:SetText(i)
0
 end
0
 
0
 
0
-local lastmapped, lastmappedaction, tex, uitem
0
+local lastmapped, lastmappedaction
0
 function TourGuide:UpdateStatusFrame()
0
   self:Debug(1, "UpdateStatusFrame", self.current)
0
 
0
@@ -240,28 +226,14 @@ function TourGuide:UpdateStatusFrame()
0
   if not f2:IsVisible() then f:SetWidth(FIXEDWIDTH + text:GetWidth()) end
0
   newsize = FIXEDWIDTH + text:GetWidth()
0
 
0
- tex = useitem and select(10, GetItemInfo(tonumber(useitem)))
0
- uitem = useitem
0
- if InCombatLockdown() then self:RegisterEvent("PLAYER_REGEN_ENABLED")
0
- else self:PLAYER_REGEN_ENABLED() end
0
+ local usetex = useitem and select(10, GetItemInfo(tonumber(useitem)))
0
+ self:SetUseItem(usetex, useitem)
0
 
0
   self:UpdateOHPanel()
0
   self:UpdateGuidesPanel()
0
 end
0
 
0
 
0
-function TourGuide:PLAYER_REGEN_ENABLED()
0
- if tex then
0
- itemicon:SetTexture(tex)
0
- item:SetAttribute("type1", "item")
0
- item:SetAttribute("item1", "item:"..uitem)
0
- item:Show()
0
- tex = nil
0
- else item:Hide() end
0
- self:UnregisterEvent("PLAYER_REGEN_ENABLED")
0
-end
0
-
0
-
0
 function dataobj.OnClick(self, btn)
0
   if TourGuide.db.char.currentguide == "No Guide" then InterfaceOptionsFrame_OpenToFrame(TourGuide.guidespanel)
0
   else
0
@@ -288,11 +260,6 @@ f:SetScript("OnClick", dataobj.OnClick)
0
 check:SetScript("OnClick", function(self, btn) TourGuide:SetTurnedIn() end)
0
 
0
 
0
-item:HookScript("OnClick", function()
0
- if TourGuide:GetObjectiveInfo() == "USE" then TourGuide:SetTurnedIn() end
0
-end)
0
-
0
-
0
 function dataobj.OnLeave() GameTooltip:Hide() end
0
 function dataobj.OnEnter(self)
0
   local tip = TourGuide:GetObjectiveTag("N")
0
@@ -337,15 +304,3 @@ f:SetScript("OnDragStop", function(frame)
0
   frame:SetPoint(TourGuide.db.profile.statusframepoint, TourGuide.db.profile.statusframex, TourGuide.db.profile.statusframey)
0
   dataobj.OnEnter(frame)
0
 end)
0
-
0
-
0
-item:RegisterForDrag("LeftButton")
0
-item:SetMovable(true)
0
-item:SetClampedToScreen(true)
0
-item:SetScript("OnDragStart", item.StartMoving)
0
-item:SetScript("OnDragStop", function(frame)
0
- frame:StopMovingOrSizing()
0
- TourGuide:Debug(1, "Item frame moved", GetUIParentAnchor(frame))
0
- TourGuide.db.profile.itemframepoint, TourGuide.db.profile.itemframex, TourGuide.db.profile.itemframey = GetUIParentAnchor(frame)
0
-end)
0
-
...
52
53
54
 
55
56
57
...
52
53
54
55
56
57
58
0
@@ -52,6 +52,7 @@ function TourGuide:Initialize()
0
   self.db.char.currentguide = self.db.char.currentguide or self.guidelist[1]
0
   self:LoadGuide(self.db.char.currentguide)
0
   self:PositionStatusFrame()
0
+ self:PositionItemFrame()
0
 
0
 
0
   LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("TourGuide", {
...
27
28
29
 
30
31
32
...
27
28
29
30
31
32
33
0
@@ -27,6 +27,7 @@ TourGuide.lua
0
 Parser.lua
0
 Mapping.lua
0
 StatusFrame.lua
0
+ItemButton.lua
0
 Config.lua
0
 Help.lua
0
 ObjectivesFrame.lua

Comments

    No one has commented yet.