comparison Comments.lua @ 581:78e9cbbf3d58 11.0.2-1

Updated for Patch 11.0.2 changes.
author MMOSimca
date Tue, 20 Aug 2024 09:42:51 -0400
parents 95af8e72aa19
children
comparison
equal deleted inserted replaced
580:211556c5167b 581:78e9cbbf3d58
194 comment_func(DATA_TYPE_MAPPING[data_type] or data_type:upper(), data, data_subtype, subdata) 194 comment_func(DATA_TYPE_MAPPING[data_type] or data_type:upper(), data, data_subtype, subdata)
195 end 195 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.C_QuestLog.GetSelectedQuest()
200 200
201 if not index or not _G.QuestMapFrame:IsVisible() then 201 if not index or not _G.QuestMapFrame:IsVisible() then
202 WDP:Print("You must select a quest from the World Map's 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, _, _, is_header, _, _, _, idnum = _G.GetQuestLogTitle(index) 205 local info = _G.C_QuestLog.GetInfo(index)
206 206
207 if is_header then 207 if not info or info.isHeader then
208 WDP:Print("You must select a quest from the World Map's 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", info.title, info.questID)
212 end 212 end
213 213
214 local function CreateAchievementComment() 214 local function CreateAchievementComment()
215 if not _G.AchievementFrame or not _G.AchievementFrame:IsVisible() 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.")
358 358
359 line = display:AddLine(("Item: %s"):format(item_name)) 359 line = display:AddLine(("Item: %s"):format(item_name))
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.C_QuestLog.GetSelectedQuest()
364 364
365 if quest_index and _G.QuestMapFrame:IsVisible() and not _G.QuestScrollFrame:IsVisible() then 365 if quest_index and _G.QuestMapFrame:IsVisible() and not _G.QuestScrollFrame:IsVisible() then
366 local title, _, _, is_header = _G.GetQuestLogTitle(quest_index) 366 local info = _G.C_QuestLog.GetInfo(quest_index)
367 367
368 if not is_header then 368 if info and not info.isHeader then
369 line = display:AddLine(("Quest: %s"):format(title)) 369 line = display:AddLine(("Quest: %s"):format(info.title))
370 display:SetLineScript(line, "OnMouseUp", CreateComment, CreateQuestComment) 370 display:SetLineScript(line, "OnMouseUp", CreateComment, CreateQuestComment)
371 end 371 end
372 end 372 end
373 373
374 if display:GetLineCount() == 3 then 374 if display:GetLineCount() == 3 then
498 _G.EditBox_SetFocus(self.edit_box) 498 _G.EditBox_SetFocus(self.edit_box)
499 end) 499 end)
500 500
501 panel.scroll_frame = scroll_frame 501 panel.scroll_frame = scroll_frame
502 502
503 local edit_container = _G.CreateFrame("Frame", nil, scroll_frame) 503 local edit_container = _G.CreateFrame("Frame", nil, scroll_frame, BackdropTemplateMixin and "BackdropTemplate")
504 edit_container:SetPoint("TOPLEFT", scroll_frame, -7, 7) 504 edit_container:SetPoint("TOPLEFT", scroll_frame, -7, 7)
505 edit_container:SetPoint("BOTTOMRIGHT", scroll_frame, 7, -7) 505 edit_container:SetPoint("BOTTOMRIGHT", scroll_frame, 7, -7)
506 edit_container:SetFrameLevel(scroll_frame:GetFrameLevel() - 1) 506 edit_container:SetFrameLevel(scroll_frame:GetFrameLevel() - 1)
507 edit_container:SetBackdrop({ 507 edit_container:SetBackdrop({
508 bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], 508 bgFile = [[Interface\Tooltips\UI-Tooltip-Background]],
518 } 518 }
519 }) 519 })
520 520
521 edit_container:SetBackdropBorderColor(_G.TOOLTIP_DEFAULT_COLOR.r, _G.TOOLTIP_DEFAULT_COLOR.g, _G.TOOLTIP_DEFAULT_COLOR.b) 521 edit_container:SetBackdropBorderColor(_G.TOOLTIP_DEFAULT_COLOR.r, _G.TOOLTIP_DEFAULT_COLOR.g, _G.TOOLTIP_DEFAULT_COLOR.b)
522 edit_container:SetBackdropColor(0, 0, 0) 522 edit_container:SetBackdropColor(0, 0, 0)
523 edit_container:ApplyBackdrop()
523 524
524 local link_button = _G.CreateFrame("Button", "$parentLinkButton", panel) 525 local link_button = _G.CreateFrame("Button", "$parentLinkButton", panel)
525 link_button:SetSize(32, 16) 526 link_button:SetSize(32, 16)
526 link_button:SetPoint("TOPRIGHT", edit_container, "BOTTOMRIGHT", 5, 0) 527 link_button:SetPoint("TOPRIGHT", edit_container, "BOTTOMRIGHT", 5, 0)
527 528
639 -- }) 640 -- })
640 -- 641 --
641 -- private.data_obj = data_obj 642 -- private.data_obj = data_obj
642 -- LibStub("LibDBIcon-1.0"):Register(ADDON_NAME, data_obj, private.db.global.config.minimap_icon) 643 -- LibStub("LibDBIcon-1.0"):Register(ADDON_NAME, data_obj, private.db.global.config.minimap_icon)
643 644
644 _G.GameTooltip:HookScript("OnTooltipSetItem", function(self) 645 TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Item, function(self)
645 end) 646 end)
646 647
647 _G["BINDING_HEADER_WOWDB_PROFILER"] = "WoWDB Profiler" 648 _G["BINDING_HEADER_WOWDB_PROFILER"] = "WoWDB Profiler"
648 end 649 end