comparison Comments.lua @ 335:2ca6db4e2296 WoD

More WoD Fixes: Changed IsShown to IsVisible and replaced QuestLogFrame with QuestMapFrame.
author MMOSimca <MMOSimca@gmail.com>
date Fri, 05 Sep 2014 01:18:51 -0400
parents 84817627cb22
children de1f7476805e
comparison
equal deleted inserted replaced
334:5bc69e705add 335:2ca6db4e2296
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)