Mercurial > wow > wowdb-profiler
comparison Comments.lua @ 358:703714202ffe 6.0.2-1
Merge with WoD
author | MMOSimca <MMOSimca@gmail.com> |
---|---|
date | Tue, 14 Oct 2014 00:36:05 -0400 |
parents | 2ca6db4e2296 |
children | de1f7476805e |
comparison
equal
deleted
inserted
replaced
328:3487529df8e5 | 358:703714202ffe |
---|---|
113 | 113 |
114 if not unit_idnum then | 114 if not unit_idnum then |
115 WDP:Printf("Unable to determine unit from '%s'", unit_id) | 115 WDP:Printf("Unable to determine unit from '%s'", unit_id) |
116 return | 116 return |
117 end | 117 end |
118 local type_name = private.UNIT_TYPE_NAMES[unit_type + 1] | 118 local type_name = private.UNIT_TYPE_NAMES[unit_type] |
119 local unit_name = is_command and _G.UnitName(unit_id) or comment_units[unit_id].name | 119 local unit_name = is_command and _G.UnitName(unit_id) or comment_units[unit_id].name |
120 | 120 |
121 table.wipe(comment_units) | 121 table.wipe(comment_units) |
122 NewComment(type_name, unit_name, unit_idnum) | 122 NewComment(type_name, unit_name, unit_idnum) |
123 end | 123 end |
196 end -- do-block | 196 end -- do-block |
197 | 197 |
198 local function CreateQuestComment() | 198 local function CreateQuestComment() |
199 local index = _G.GetQuestLogSelection() | 199 local index = _G.GetQuestLogSelection() |
200 | 200 |
201 if not index or not _G.QuestLogFrame:IsShown() then | 201 if not index or not _G.QuestMapFrame:IsVisible() then |
202 WDP:Print("You must select a quest from the Quest frame.") | 202 WDP:Print("You must select a quest from the World Map's Quest frame.") |
203 return | 203 return |
204 end | 204 end |
205 local title, _, tag, _, is_header, _, _, _, idnum = _G.GetQuestLogTitle(index) | 205 local title, _, tag, _, is_header, _, _, _, idnum = _G.GetQuestLogTitle(index) |
206 | 206 |
207 if is_header then | 207 if is_header then |
208 WDP:Print("You must select a quest from the Quest frame.") | 208 WDP:Print("You must select a quest from the World Map's Quest frame.") |
209 return | 209 return |
210 end | 210 end |
211 NewComment("QUEST", title, idnum) | 211 NewComment("QUEST", title, idnum) |
212 end | 212 end |
213 | 213 |
214 local function CreateAchievementComment() | 214 local function CreateAchievementComment() |
215 if not _G.AchievementFrame or not _G.AchievementFrame:IsShown() or not _G.AchievementFrameAchievements.selection then | 215 if not _G.AchievementFrame or not _G.AchievementFrame:IsVisible() or not _G.AchievementFrameAchievements.selection then |
216 WDP:Print("You must select an achievement from the Achievement frame.") | 216 WDP:Print("You must select an achievement from the Achievement frame.") |
217 return | 217 return |
218 end | 218 end |
219 | 219 |
220 for _, button in next, _G.AchievementFrameAchievementsContainer.buttons do | 220 for _, button in next, _G.AchievementFrameAchievementsContainer.buttons do |
317 display:SetLineScript(line, "OnMouseUp", CreateComment, { CreateUnitComment, unit_id }) | 317 display:SetLineScript(line, "OnMouseUp", CreateComment, { CreateUnitComment, unit_id }) |
318 end | 318 end |
319 end | 319 end |
320 end | 320 end |
321 | 321 |
322 if _G.AchievementFrame and _G.AchievementFrame:IsShown() and _G.AchievementFrameAchievements.selection then | 322 if _G.AchievementFrame and _G.AchievementFrame:IsVisible() and _G.AchievementFrameAchievements.selection then |
323 for _, button in next, _G.AchievementFrameAchievementsContainer.buttons do | 323 for _, button in next, _G.AchievementFrameAchievementsContainer.buttons do |
324 if button.selected then | 324 if button.selected then |
325 line = display:AddLine(("Achievement: %s"):format(button.label:GetText())) | 325 line = display:AddLine(("Achievement: %s"):format(button.label:GetText())) |
326 display:SetLineScript(line, "OnMouseUp", CreateComment, CreateAchievementComment) | 326 display:SetLineScript(line, "OnMouseUp", CreateComment, CreateAchievementComment) |
327 break | 327 break |
360 display:SetLineScript(line, "OnMouseUp", CreateComment, CreateItemComment) | 360 display:SetLineScript(line, "OnMouseUp", CreateComment, CreateItemComment) |
361 end | 361 end |
362 | 362 |
363 local quest_index = _G.GetQuestLogSelection() | 363 local quest_index = _G.GetQuestLogSelection() |
364 | 364 |
365 if quest_index and _G.QuestLogFrame:IsShown() then | 365 if quest_index and _G.QuestMapFrame:IsVisible() and not _G.QuestScrollFrame:IsVisible() then |
366 local title, _, tag, _, is_header, _, _, _, idnum = _G.GetQuestLogTitle(quest_index) | 366 local title, _, tag, _, is_header, _, _, _, idnum = _G.GetQuestLogTitle(quest_index) |
367 | 367 |
368 if not is_header then | 368 if not is_header then |
369 line = display:AddLine(("Quest: %s"):format(title)) | 369 line = display:AddLine(("Quest: %s"):format(title)) |
370 display:SetLineScript(line, "OnMouseUp", CreateComment, CreateQuestComment) | 370 display:SetLineScript(line, "OnMouseUp", CreateComment, CreateQuestComment) |