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 !
Fixing issues when guide is completed and no followup to load

 * Guides now default back to "no guide loaded" guide, which cannot be 
 completed
 * Clicking the status frame in "No Guide" will open the guide list 
 instead of the objective list
 * Guide list properly shows complete guides as 100%
 * Shift-clicking a guide in the list will wipe it's completion
tekkub (author)
Thu Dec 20 15:36:35 -0800 2007
commit  5fc9011030b46af7982ba24264ede3cf95fc43fe
tree    aeb22f1fb0725647e0664db472236f570b576b64
parent  d73808be034662924f688e7dd2b1d76b4457d71c
...
161
162
163
 
 
164
165
166
...
161
162
163
164
165
166
167
168
0
@@ -161,6 +161,8 @@ function TourGuide:UpdateOHPanel(value)
0
         row.text:SetTextColor(1, 0.82, 0)
0
         row.check:Enable()
0
       end
0
+
0
+ if self.db.char.currentguide == "No Guide" then row.check:Disable() end
0
     end
0
   end
0
 end
...
23
24
25
 
 
 
 
 
 
 
 
 
 
 
26
27
28
29
30
31
 
 
 
32
 
 
 
 
 
 
 
 
 
33
34
35
...
58
59
60
 
 
61
62
63
...
81
82
83
84
 
85
86
 
87
88
89
90
91
 
92
93
94
...
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
 
 
 
 
 
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
...
76
77
78
79
80
81
82
83
...
101
102
103
 
104
105
 
106
107
108
109
110
 
111
112
113
114
0
@@ -23,13 +23,31 @@ local function OnShow(self)
0
 end
0
 
0
 
0
+local function HideTooltip() GameTooltip:Hide() end
0
+
0
+
0
+local function ShowTooltip(f)
0
+ if TourGuide.db.char.completion[f.guide] ~= 1 then return end
0
+
0
+ GameTooltip:SetOwner(f, "ANCHOR_RIGHT")
0
+ GameTooltip:SetText("This guide has been completed. Shift-click to reset it.", nil, nil, nil, nil, true)
0
+end
0
+
0
+
0
 local function OnClick(self)
0
- local text = self.guide
0
- if not text then self:SetChecked(false)
0
- else
0
- TourGuide:LoadGuide(text)
0
- TourGuide:UpdateStatusFrame()
0
+ if IsShiftKeyDown() then
0
+ TourGuide.db.char.completion[self.guide] = nil
0
+ TourGuide.db.char.turnins[self.guide] = {}
0
     TourGuide:UpdateGuidesPanel()
0
+ GameTooltip:Hide()
0
+ else
0
+ local text = self.guide
0
+ if not text then self:SetChecked(false)
0
+ else
0
+ TourGuide:LoadGuide(text)
0
+ TourGuide:UpdateStatusFrame()
0
+ TourGuide:UpdateGuidesPanel()
0
+ end
0
   end
0
 end
0
 
0
@@ -58,6 +76,8 @@ function TourGuide:CreateGuidesPanel()
0
     local text = ww.SummonFontString(row, nil, "GameFontWhite", nil, "LEFT", 6, 0)
0
 
0
     row:SetScript("OnClick", OnClick)
0
+ row:SetScript("OnEnter", ShowTooltip)
0
+ row:SetScript("OnLeave", HideTooltip)
0
 
0
     row.text = text
0
     rows[i] = row
0
@@ -81,14 +101,14 @@ end
0
 function TourGuide:UpdateGuidesPanel()
0
   if not frame or not frame:IsVisible() then return end
0
   for i,row in ipairs(rows) do
0
- row.i = i + offset
0
+ row.i = i + offset + 1
0
 
0
- local name = self.guidelist[i + offset]
0
+ local name = self.guidelist[i + offset + 1]
0
     local complete = self.db.char.currentguide == name and (self.current-1)/#self.actions or self.db.char.completion[name]
0
     row.guide = name
0
 
0
     local r,g,b = self.ColorGradient(complete or 0)
0
- local text = complete and complete == 1 and name.." [Done]" or complete and complete ~= 0 and string.format("%s |cff%02x%02x%02x[%d%%]", name, r*255, g*255, b*255, complete*100) or name
0
+ local text = complete and complete ~= 0 and string.format("%s |cff%02x%02x%02x[%d%%]", name, r*255, g*255, b*255, complete*100) or name
0
     row.text:SetText(text)
0
     row:SetChecked(self.db.char.currentguide == name)
0
   end
...
114
115
116
117
 
118
119
120
 
 
121
122
123
...
114
115
116
 
117
118
119
 
120
121
122
123
124
0
@@ -114,10 +114,11 @@ local function ParseQuests(...)
0
 end
0
 
0
 
0
-function TourGuide:LoadGuide(name)
0
+function TourGuide:LoadGuide(name, complete)
0
   if not name then return end
0
 
0
- if self.actions then self.db.char.completion[self.db.char.currentguide] = (self.current-1)/#self.actions end
0
+ if complete then self.db.char.completion[self.db.char.currentguide] = 1
0
+ elseif self.actions then self.db.char.completion[self.db.char.currentguide] = (self.current-1)/#self.actions end
0
 
0
   self.db.char.currentguide = self.guides[name] and name or self.guidelist[1]
0
   self:DebugF(1, "Loading guide: %s", name)
...
117
118
119
 
 
120
121
122
...
252
253
254
255
256
 
257
258
259
260
 
 
 
 
 
 
 
261
262
263
...
117
118
119
120
121
122
123
124
...
254
255
256
 
 
257
258
 
 
 
259
260
261
262
263
264
265
266
267
268
0
@@ -117,6 +117,8 @@ function TourGuide:SetText(i)
0
   if action ~= "ACCEPT" and action ~= "TURNIN" then icon:SetTexCoord(4/48, 44/48, 4/48, 44/48) end
0
   text:SetText(newtext)
0
   check:SetChecked(false)
0
+ check:SetButtonState("NORMAL")
0
+ if self.db.char.currentguide == "No Guide" then check:Disable() else check:Enable() end
0
   if i == 1 then f:SetWidth(FIXEDWIDTH + text:GetWidth()) end
0
   newsize = FIXEDWIDTH + text:GetWidth()
0
 
0
@@ -252,12 +254,15 @@ end
0
 
0
 
0
 f:SetScript("OnClick", function(self, btn)
0
- if btn == "RightButton" then
0
- OptionHouse:Open("Tour Guide", "Objectives")
0
+ if TourGuide.db.char.currentguide == "No Guide" then OptionHouse:Open("Tour Guide", "Guides")
0
   else
0
- local i = TourGuide:GetQuestLogIndexByName()
0
- if i then SelectQuestLogEntry(i) end
0
- ShowUIPanel(QuestLogFrame)
0
+ if btn == "RightButton" then
0
+ OptionHouse:Open("Tour Guide", "Objectives")
0
+ else
0
+ local i = TourGuide:GetQuestLogIndexByName()
0
+ if i then SelectQuestLogEntry(i) end
0
+ ShowUIPanel(QuestLogFrame)
0
+ end
0
   end
0
 end)
0
 
...
39
40
41
42
 
 
43
44
45
...
76
77
78
79
80
81
82
83
84
 
85
86
87
...
39
40
41
 
42
43
44
45
46
...
77
78
79
 
 
 
 
 
 
80
81
82
83
0
@@ -39,7 +39,8 @@ function TourGuide:Initialize()
0
       turnins = {},
0
       cachedturnins = {},
0
       trackquests = true,
0
- completion = {}
0
+ completion = {},
0
+ currentguide = "No Guide",
0
     },
0
   })
0
   if self.db.char.turnedin then self.db.char.turnedin = nil end -- Purge old table if present
0
@@ -76,12 +77,7 @@ end
0
 
0
 
0
 function TourGuide:LoadNextGuide()
0
- local name = self.nextzones[self.db.char.currentguide]
0
- if not name then return end
0
-
0
---~ for i,quest in ipairs(self.quests) do self.turnedin[quest] = nil end -- Clean out old completed objectives, to avoid conflicts
0
-
0
- self:LoadGuide(name)
0
+ self:LoadGuide(self.nextzones[self.db.char.currentguide] or "No Guide", true)
0
   self:UpdateGuidesPanel()
0
   return true
0
 end
...
30
31
32
 
 
33
34
35
...
30
31
32
33
34
35
36
 
0
@@ -30,6 +30,7 @@ OHGuides.lua
0
 UnlistedQuest.lua
0
 QuestTracking.lua
0
 
0
+NilGuide.lua
0
+
0
 TourGuide_Alliance\Guides.xml
0
 TourGuide_Horde\Guides.xml
0
-

Comments

    No one has commented yet.