From a1c8434d469700c1303fb2928199b168a42c8579 Mon Sep 17 00:00:00 2001 From: Albert Valiev Date: Tue, 23 Jul 2024 16:06:41 +0200 Subject: [PATCH 1/2] Add Questie icons support --- Carbonite.Notes/Locales/deDE.lua | 3 + Carbonite.Notes/Locales/enUS.lua | 3 + Carbonite.Notes/Locales/esES.lua | 3 + Carbonite.Notes/Locales/esMX.lua | 3 + Carbonite.Notes/Locales/frFR.lua | 3 + Carbonite.Notes/Locales/itIT.lua | 3 + Carbonite.Notes/Locales/koKR.lua | 3 + Carbonite.Notes/Locales/ptBR.lua | 3 + Carbonite.Notes/Locales/ruRU.lua | 3 + Carbonite.Notes/Locales/zhCN.lua | 3 + Carbonite.Notes/Locales/zhTW.lua | 3 + Carbonite.Notes/NxFav.lua | 155 +++++++++++++++++++++++++++++-- 12 files changed, 179 insertions(+), 9 deletions(-) diff --git a/Carbonite.Notes/Locales/deDE.lua b/Carbonite.Notes/Locales/deDE.lua index 3607fbe..092d97c 100644 --- a/Carbonite.Notes/Locales/deDE.lua +++ b/Carbonite.Notes/Locales/deDE.lua @@ -49,6 +49,9 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true +L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true +L["Questie Icon Size"] = true + -- Keybinds L["Carbonite Notes"] = "Carbonite Notizen" L["NxTOGGLEFAV"] = "Notizen ein/ausblenden" diff --git a/Carbonite.Notes/Locales/enUS.lua b/Carbonite.Notes/Locales/enUS.lua index d54ff04..44f1d36 100644 --- a/Carbonite.Notes/Locales/enUS.lua +++ b/Carbonite.Notes/Locales/enUS.lua @@ -45,6 +45,9 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true +L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true +L["Questie Icon Size"] = true + -- Keybinds L["Carbonite Notes"] = "Carbonite Notes" L["NxTOGGLEFAV"] = "show/hide Notes" diff --git a/Carbonite.Notes/Locales/esES.lua b/Carbonite.Notes/Locales/esES.lua index fb9a22e..3bf2866 100644 --- a/Carbonite.Notes/Locales/esES.lua +++ b/Carbonite.Notes/Locales/esES.lua @@ -49,6 +49,9 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true +L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true +L["Questie Icon Size"] = true + -- Keybinds L["Carbonite Notes"] = "Carbonite Notes" L["NxTOGGLEFAV"] = "show/hide Notes" diff --git a/Carbonite.Notes/Locales/esMX.lua b/Carbonite.Notes/Locales/esMX.lua index 05692e0..34ba29c 100644 --- a/Carbonite.Notes/Locales/esMX.lua +++ b/Carbonite.Notes/Locales/esMX.lua @@ -49,6 +49,9 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true +L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true +L["Questie Icon Size"] = true + -- Keybinds L["Carbonite Notes"] = "Carbonite Notes" L["NxTOGGLEFAV"] = "show/hide Notes" diff --git a/Carbonite.Notes/Locales/frFR.lua b/Carbonite.Notes/Locales/frFR.lua index 899870a..bda2bc0 100644 --- a/Carbonite.Notes/Locales/frFR.lua +++ b/Carbonite.Notes/Locales/frFR.lua @@ -49,6 +49,9 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true +L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true +L["Questie Icon Size"] = true + -- Keybinds L["Carbonite Notes"] = "Carbonite Notes" L["NxTOGGLEFAV"] = "Afficher/Cacher Notes" diff --git a/Carbonite.Notes/Locales/itIT.lua b/Carbonite.Notes/Locales/itIT.lua index 09110cb..31bee27 100644 --- a/Carbonite.Notes/Locales/itIT.lua +++ b/Carbonite.Notes/Locales/itIT.lua @@ -49,6 +49,9 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true +L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true +L["Questie Icon Size"] = true + -- Keybinds L["Carbonite Notes"] = "Note Carbonite" L["NxTOGGLEFAV"] = "mostra/nascondi Note" diff --git a/Carbonite.Notes/Locales/koKR.lua b/Carbonite.Notes/Locales/koKR.lua index 0e179d6..b519d98 100644 --- a/Carbonite.Notes/Locales/koKR.lua +++ b/Carbonite.Notes/Locales/koKR.lua @@ -49,6 +49,9 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true +L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true +L["Questie Icon Size"] = true + -- Keybinds L["Carbonite Notes"] = "Carbonite Notes" L["NxTOGGLEFAV"] = "show/hide Notes" diff --git a/Carbonite.Notes/Locales/ptBR.lua b/Carbonite.Notes/Locales/ptBR.lua index 0b2b0b8..585dae0 100644 --- a/Carbonite.Notes/Locales/ptBR.lua +++ b/Carbonite.Notes/Locales/ptBR.lua @@ -49,6 +49,9 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true +L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true +L["Questie Icon Size"] = true + -- Keybinds L["Carbonite Notes"] = "Carbonite Notes" L["NxTOGGLEFAV"] = "show/hide Notes" diff --git a/Carbonite.Notes/Locales/ruRU.lua b/Carbonite.Notes/Locales/ruRU.lua index 8436e2d..4c7dfdb 100644 --- a/Carbonite.Notes/Locales/ruRU.lua +++ b/Carbonite.Notes/Locales/ruRU.lua @@ -49,6 +49,9 @@ L["Display RareScanner icons On Map"] = "Показывать на карте о L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = "Если у вас установлен плагин RareScanner, то включение этого параметра отобразит иконки RareScanner на карте" L["RareScanner Icon Size"] = "Размер иконки RareScanner" +L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = "Если у вас установлен плагин Questie, то вы можете отключить модуль заданий Carbonite и включить данный параметр чтобы отобразить иконки Questie на карте" +L["Questie Icon Size"] = "Размер иконки Questie" + -- Keybinds L["Carbonite Notes"] = "Заметки Carbonite" L["NxTOGGLEFAV"] = "Показать/Скрыть Заметки" diff --git a/Carbonite.Notes/Locales/zhCN.lua b/Carbonite.Notes/Locales/zhCN.lua index 264de71..427e360 100644 --- a/Carbonite.Notes/Locales/zhCN.lua +++ b/Carbonite.Notes/Locales/zhCN.lua @@ -45,6 +45,9 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true +L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true +L["Questie Icon Size"] = true + -- Keybinds L["Carbonite Notes"] = "Carbonite 标记模块" L["NxTOGGLEFAV"] = "显示/隐藏标记" diff --git a/Carbonite.Notes/Locales/zhTW.lua b/Carbonite.Notes/Locales/zhTW.lua index 80c267e..1f1a51c 100644 --- a/Carbonite.Notes/Locales/zhTW.lua +++ b/Carbonite.Notes/Locales/zhTW.lua @@ -49,6 +49,9 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true +L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true +L["Questie Icon Size"] = true + -- Keybinds L["Carbonite Notes"] = "Carbonite Notes" L["NxTOGGLEFAV"] = "show/hide Notes" diff --git a/Carbonite.Notes/NxFav.lua b/Carbonite.Notes/NxFav.lua index 81fad19..04ff197 100644 --- a/Carbonite.Notes/NxFav.lua +++ b/Carbonite.Notes/NxFav.lua @@ -34,6 +34,7 @@ BINDING_HEADER_CarboniteNotes = "|cffc0c0ff" .. L["Carbonite Notes"] .. "|r" BINDING_NAME_NxTOGGLEFAV = L["NxTOGGLEFAV"] local addonNotes = {} +local needQuestUpdate = false local defaults = { profile = { @@ -43,6 +44,8 @@ local defaults = { HandyNotesSize = 15, RareScanner = true, RareScannerSize = 32, + Questie = false, + QuestieSize = 15, }, Addons = { }, @@ -79,7 +82,7 @@ local function notesConfig() return Nx.fdb.profile.Notes.HandyNotes end, set = function() - local map = Nx.Map:GetMap (1) + local map = Nx.Map:GetMap (1) Nx.fdb.profile.Notes.HandyNotes = not Nx.fdb.profile.Notes.HandyNotes if Nx.fdb.profile.Notes.HandyNotes then Nx.Notes:HandyNotes(Nx.Map:GetCurrentMapAreaID()) @@ -98,7 +101,7 @@ local function notesConfig() order = 3, type = "range", width = "normal", - min = 10, + min = 10, max = 60, step = 5, name = L["Handnotes Icon Size"], @@ -106,7 +109,7 @@ local function notesConfig() return Nx.fdb.profile.Notes.HandyNotesSize end, set = function(input,value) - local map = Nx.Map:GetMap (1) + local map = Nx.Map:GetMap (1) Nx.fdb.profile.Notes.HandyNotesSize = value map:ClearIconType("!HANDY") Nx.Notes:HandyNotes(Nx.Map:GetCurrentMapAreaID()) @@ -119,7 +122,7 @@ local function notesConfig() end, }, rarescanner = { - order = 2, + order = 4, type = "toggle", width = "full", name = L["Display RareScanner icons On Map"], @@ -128,7 +131,7 @@ local function notesConfig() return Nx.fdb.profile.Notes.RareScanner end, set = function() - local map = Nx.Map:GetMap (1) + local map = Nx.Map:GetMap (1) Nx.fdb.profile.Notes.RareScanner = not Nx.fdb.profile.Notes.RareScanner if Nx.fdb.profile.Notes.RareScanner then Nx.Notes:RareScanner(Nx.Map:GetCurrentMapAreaID()) @@ -145,10 +148,10 @@ local function notesConfig() end, }, raresize = { - order = 3, + order = 5, type = "range", width = "normal", - min = 10, + min = 10, max = 60, step = 5, name = L["RareScanner Icon Size"], @@ -156,7 +159,7 @@ local function notesConfig() return Nx.fdb.profile.Notes.RareScannerSize end, set = function(input,value) - local map = Nx.Map:GetMap (1) + local map = Nx.Map:GetMap (1) Nx.fdb.profile.Notes.RareScannerSize = value map:ClearIconType("!RSR") map:ClearIconType("!RSRC") @@ -169,6 +172,55 @@ local function notesConfig() return true end, }, + questie = { + order = 6, + type = "toggle", + width = "full", + name = L["Display Questie icons On Map"], + desc = L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"], + get = function() + return Nx.fdb.profile.Notes.Questie + end, + set = function() + local map = Nx.Map:GetMap (1) + Nx.fdb.profile.Notes.Questie = not Nx.fdb.profile.Notes.Questie + if Nx.fdb.profile.Notes.Questie then + Nx.Notes:Questie(Nx.Map:GetCurrentMapAreaID()) + else + map:ClearIconType("!Questie") + end + end, + disabled = function() + if Questie then + return false + end + return true + end, + }, + questiesize = { + order = 7, + type = "range", + width = "normal", + min = 10, + max = 60, + step = 5, + name = L["Questie Icon Size"], + get = function() + return Nx.fdb.profile.Notes.QuestieSize + end, + set = function(input,value) + local map = Nx.Map:GetMap (1) + Nx.fdb.profile.Notes.QuestieSize = value + map:ClearIconType("!Questie") + Nx.Notes:Questie(Nx.Map:GetCurrentMapAreaID()) + end, + disabled = function() + if Questie then + return false + end + return true + end, + }, }, } end @@ -200,6 +252,29 @@ function CarboniteNotes:OnInitialize() Nx.Map.Maps[1].GIconMenu:AddItem (0, L["Add Note"], Nx.Notes.Menu_OnAddNote, Nx.Map.Maps[1]) Nx:AddToConfig("Notes Module",notesConfig(),L["Notes Module"]) tinsert(Nx.BrokerMenuTemplate,{ text = L["Toggle Notes"], func = function() Nx.Notes:ToggleShow() end }) + + if (not Nx.Quest and Questie and Nx.fdb.profile.Notes.Questie) then + CarboniteNotes:RegisterEvent ("PLAYER_LOGIN", "OnQuestUpdate") + CarboniteNotes:RegisterEvent ("UNIT_QUEST_LOG_CHANGED", "OnQuestUpdate") + CarboniteNotes:RegisterEvent ("QUEST_PROGRESS", "OnQuestUpdate") + CarboniteNotes:RegisterEvent ("QUEST_COMPLETE", "OnQuestUpdate") + CarboniteNotes:RegisterEvent ("QUEST_ACCEPTED", "OnQuestUpdate") + CarboniteNotes:RegisterEvent ("QUEST_REMOVED", "OnQuestUpdate") + CarboniteNotes:RegisterEvent ("QUEST_TURNED_IN", "OnQuestUpdate") + CarboniteNotes:RegisterEvent ("QUEST_DETAIL", "OnQuestUpdate") + CarboniteNotes:RegisterEvent ("WORLD_STATE_TIMER_START", "OnQuestUpdate") + CarboniteNotes:RegisterEvent ("WORLD_STATE_TIMER_STOP", "OnQuestUpdate") + local questieStartTimer = C_Timer.NewTimer(3, function(self) + if Questie.started then + needQuestUpdate = true + self:Cancel() + end + end) + end +end + +function CarboniteNotes:OnQuestUpdate (event, ...) + needQuestUpdate = true end function Nx.Notes:OnChat_msg_addon(msg, dist, target) @@ -1516,7 +1591,7 @@ function Nx.Notes:UpdateIcons() local mapId = map.MapId local draw = map.ScaleDraw > .3 and Nx.fdb.profile.Notes.ShowMap - if mapId == self.DrawMapId and draw == self.Draw and self.InstLevelSet == Nx.Map:GetCurrentMapDungeonLevel() then + if mapId == self.DrawMapId and draw == self.Draw and self.InstLevelSet == Nx.Map:GetCurrentMapDungeonLevel() and not needQuestUpdate then return end @@ -1575,6 +1650,8 @@ function Nx.Notes:UpdateIcons() end Nx.Notes:HandyNotes(mapId) Nx.Notes:RareScanner(mapId) + Nx.Notes:Questie(mapId) + needQuestUpdate = false --WorldMap_HijackTooltip(map.Frm) GameTooltip:Hide() end @@ -1741,6 +1818,66 @@ function Nx.Notes:RareScanner(mapId) end end + +function Nx.Notes:Questie(mapId) + local map = Nx.Map:GetMap (1) + if (Nx.fdb.profile.Notes.Questie and Questie and not Nx.Quest) then + questiepins = {} + + local FROM_ON_SHOW = true + WorldMapFrame:RefreshAll(FROM_ON_SHOW) + + for pin in WorldMapFrame:EnumeratePinsByTemplate("HereBeDragonsPinsTemplateQuestie") do + questiepins[#questiepins + 1] = pin + end + + local level = nil + + map:InitIconType ("!Questie", "WP", "", Nx.fdb.profile.Notes.QuestieSize or 15, Nx.fdb.profile.Notes.QuestieSize or 15) + map:SetIconTypeChop ("!Questie", true) + map:SetIconTypeLevel ("!Questie", 20) + + for _,questiepin in ipairs(questiepins) do + if questiepin.icon then + if questiepin.icon.UiMapID == map.MapId and questiepin.icon.data then + local x = questiepin.icon.x + local y = questiepin.icon.y + if x and y then + local texture = questiepin.icon.texture:GetTexture() or questiepin.icon.data.Icon + local scale = questiepin.icon.data.IconScale or 1 + local wx, wy = Nx.Map:GetWorldPos(mapId,x,y) + local icon = CreateFrame("Button", "QuestieCarb", UIParent) + local tmpFrame = WorldMapFrame:GetCanvas() + icon:SetParent(tmpFrame) + icon:ClearAllPoints() + icon:SetHeight(scale) + icon:SetWidth(scale) + icon:SetPoint("CENTER", tmpFrame, "TOPLEFT", x*tmpFrame:GetWidth(), -y*tmpFrame:GetHeight()) + local questienote = map:AddIconPt("!Questie", wx, wy, level, "FFFFFF", texture) + local tooltip = "" + + if questiepin.icon.data.ObjectiveData and questiepin.icon.data.QuestData then + qLevel = questiepin.icon.data.QuestData.questLevel + qName = questiepin.icon.data.QuestData.name + qObjName = questiepin.icon.data.ObjectiveData.Description + if questiepin.icon.data.ObjectiveData.Needed then + qNeeded = questiepin.icon.data.ObjectiveData.Needed + qCollected = questiepin.icon.data.ObjectiveData.Collected + tooltip = format("|cFFFFFF00[%s] %s\n |cFFcbcbcb|cFFEEEEEE%s/%s %s", qLevel, qName, qCollected, qNeeded, qObjName) + else + tooltip = format("|cFFFFFF00[%s] %s\n |cFFcbcbcb|cFFEEEEEE%s", qLevel, qName, qObjName) + end + end + + map:SetIconTip(questienote,tooltip) + map:SetIconUserData(questienote, questiepin) + end + end + end + end + needQuestUpdate = true + end +end --------------------------------------------------------------------------------------- function Nx.Notes:OnButToggleFav (but) From f6178d5fb3e85fe42843c09c7ae626a2f6fbe10f Mon Sep 17 00:00:00 2001 From: Albert Valiev Date: Wed, 24 Jul 2024 12:21:55 +0200 Subject: [PATCH 2/2] Fixed error on goto when Quest module is disabled, fixed RareScanner onMouseOver on additional icons --- Carbonite.Notes/Locales/deDE.lua | 3 - Carbonite.Notes/Locales/enUS.lua | 3 - Carbonite.Notes/Locales/esES.lua | 3 - Carbonite.Notes/Locales/esMX.lua | 3 - Carbonite.Notes/Locales/frFR.lua | 3 - Carbonite.Notes/Locales/itIT.lua | 3 - Carbonite.Notes/Locales/koKR.lua | 3 - Carbonite.Notes/Locales/ptBR.lua | 3 - Carbonite.Notes/Locales/ruRU.lua | 3 - Carbonite.Notes/Locales/zhCN.lua | 3 - Carbonite.Notes/Locales/zhTW.lua | 3 - Carbonite.Notes/NxFav.lua | 149 +------------------------------ Carbonite/NxMap.lua | 6 +- 13 files changed, 7 insertions(+), 181 deletions(-) diff --git a/Carbonite.Notes/Locales/deDE.lua b/Carbonite.Notes/Locales/deDE.lua index 092d97c..3607fbe 100644 --- a/Carbonite.Notes/Locales/deDE.lua +++ b/Carbonite.Notes/Locales/deDE.lua @@ -49,9 +49,6 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true -L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true -L["Questie Icon Size"] = true - -- Keybinds L["Carbonite Notes"] = "Carbonite Notizen" L["NxTOGGLEFAV"] = "Notizen ein/ausblenden" diff --git a/Carbonite.Notes/Locales/enUS.lua b/Carbonite.Notes/Locales/enUS.lua index 44f1d36..d54ff04 100644 --- a/Carbonite.Notes/Locales/enUS.lua +++ b/Carbonite.Notes/Locales/enUS.lua @@ -45,9 +45,6 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true -L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true -L["Questie Icon Size"] = true - -- Keybinds L["Carbonite Notes"] = "Carbonite Notes" L["NxTOGGLEFAV"] = "show/hide Notes" diff --git a/Carbonite.Notes/Locales/esES.lua b/Carbonite.Notes/Locales/esES.lua index 3bf2866..fb9a22e 100644 --- a/Carbonite.Notes/Locales/esES.lua +++ b/Carbonite.Notes/Locales/esES.lua @@ -49,9 +49,6 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true -L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true -L["Questie Icon Size"] = true - -- Keybinds L["Carbonite Notes"] = "Carbonite Notes" L["NxTOGGLEFAV"] = "show/hide Notes" diff --git a/Carbonite.Notes/Locales/esMX.lua b/Carbonite.Notes/Locales/esMX.lua index 34ba29c..05692e0 100644 --- a/Carbonite.Notes/Locales/esMX.lua +++ b/Carbonite.Notes/Locales/esMX.lua @@ -49,9 +49,6 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true -L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true -L["Questie Icon Size"] = true - -- Keybinds L["Carbonite Notes"] = "Carbonite Notes" L["NxTOGGLEFAV"] = "show/hide Notes" diff --git a/Carbonite.Notes/Locales/frFR.lua b/Carbonite.Notes/Locales/frFR.lua index bda2bc0..899870a 100644 --- a/Carbonite.Notes/Locales/frFR.lua +++ b/Carbonite.Notes/Locales/frFR.lua @@ -49,9 +49,6 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true -L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true -L["Questie Icon Size"] = true - -- Keybinds L["Carbonite Notes"] = "Carbonite Notes" L["NxTOGGLEFAV"] = "Afficher/Cacher Notes" diff --git a/Carbonite.Notes/Locales/itIT.lua b/Carbonite.Notes/Locales/itIT.lua index 31bee27..09110cb 100644 --- a/Carbonite.Notes/Locales/itIT.lua +++ b/Carbonite.Notes/Locales/itIT.lua @@ -49,9 +49,6 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true -L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true -L["Questie Icon Size"] = true - -- Keybinds L["Carbonite Notes"] = "Note Carbonite" L["NxTOGGLEFAV"] = "mostra/nascondi Note" diff --git a/Carbonite.Notes/Locales/koKR.lua b/Carbonite.Notes/Locales/koKR.lua index b519d98..0e179d6 100644 --- a/Carbonite.Notes/Locales/koKR.lua +++ b/Carbonite.Notes/Locales/koKR.lua @@ -49,9 +49,6 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true -L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true -L["Questie Icon Size"] = true - -- Keybinds L["Carbonite Notes"] = "Carbonite Notes" L["NxTOGGLEFAV"] = "show/hide Notes" diff --git a/Carbonite.Notes/Locales/ptBR.lua b/Carbonite.Notes/Locales/ptBR.lua index 585dae0..0b2b0b8 100644 --- a/Carbonite.Notes/Locales/ptBR.lua +++ b/Carbonite.Notes/Locales/ptBR.lua @@ -49,9 +49,6 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true -L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true -L["Questie Icon Size"] = true - -- Keybinds L["Carbonite Notes"] = "Carbonite Notes" L["NxTOGGLEFAV"] = "show/hide Notes" diff --git a/Carbonite.Notes/Locales/ruRU.lua b/Carbonite.Notes/Locales/ruRU.lua index 4c7dfdb..8436e2d 100644 --- a/Carbonite.Notes/Locales/ruRU.lua +++ b/Carbonite.Notes/Locales/ruRU.lua @@ -49,9 +49,6 @@ L["Display RareScanner icons On Map"] = "Показывать на карте о L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = "Если у вас установлен плагин RareScanner, то включение этого параметра отобразит иконки RareScanner на карте" L["RareScanner Icon Size"] = "Размер иконки RareScanner" -L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = "Если у вас установлен плагин Questie, то вы можете отключить модуль заданий Carbonite и включить данный параметр чтобы отобразить иконки Questie на карте" -L["Questie Icon Size"] = "Размер иконки Questie" - -- Keybinds L["Carbonite Notes"] = "Заметки Carbonite" L["NxTOGGLEFAV"] = "Показать/Скрыть Заметки" diff --git a/Carbonite.Notes/Locales/zhCN.lua b/Carbonite.Notes/Locales/zhCN.lua index 427e360..264de71 100644 --- a/Carbonite.Notes/Locales/zhCN.lua +++ b/Carbonite.Notes/Locales/zhCN.lua @@ -45,9 +45,6 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true -L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true -L["Questie Icon Size"] = true - -- Keybinds L["Carbonite Notes"] = "Carbonite 标记模块" L["NxTOGGLEFAV"] = "显示/隐藏标记" diff --git a/Carbonite.Notes/Locales/zhTW.lua b/Carbonite.Notes/Locales/zhTW.lua index 1f1a51c..80c267e 100644 --- a/Carbonite.Notes/Locales/zhTW.lua +++ b/Carbonite.Notes/Locales/zhTW.lua @@ -49,9 +49,6 @@ L["Display RareScanner icons On Map"] = true L["If you have RareScanner installed, allows it's icons on the Carbonite map"] = true L["RareScanner Icon Size"] = true -L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"] = true -L["Questie Icon Size"] = true - -- Keybinds L["Carbonite Notes"] = "Carbonite Notes" L["NxTOGGLEFAV"] = "show/hide Notes" diff --git a/Carbonite.Notes/NxFav.lua b/Carbonite.Notes/NxFav.lua index 04ff197..bc46fbe 100644 --- a/Carbonite.Notes/NxFav.lua +++ b/Carbonite.Notes/NxFav.lua @@ -34,7 +34,6 @@ BINDING_HEADER_CarboniteNotes = "|cffc0c0ff" .. L["Carbonite Notes"] .. "|r" BINDING_NAME_NxTOGGLEFAV = L["NxTOGGLEFAV"] local addonNotes = {} -local needQuestUpdate = false local defaults = { profile = { @@ -44,8 +43,6 @@ local defaults = { HandyNotesSize = 15, RareScanner = true, RareScannerSize = 32, - Questie = false, - QuestieSize = 15, }, Addons = { }, @@ -137,7 +134,6 @@ local function notesConfig() Nx.Notes:RareScanner(Nx.Map:GetCurrentMapAreaID()) else map:ClearIconType("!RSR") - map:ClearIconType("!RSRC") end end, disabled = function() @@ -162,7 +158,6 @@ local function notesConfig() local map = Nx.Map:GetMap (1) Nx.fdb.profile.Notes.RareScannerSize = value map:ClearIconType("!RSR") - map:ClearIconType("!RSRC") Nx.Notes:RareScanner(Nx.Map:GetCurrentMapAreaID()) end, disabled = function() @@ -172,55 +167,6 @@ local function notesConfig() return true end, }, - questie = { - order = 6, - type = "toggle", - width = "full", - name = L["Display Questie icons On Map"], - desc = L["If you have Questie installed, disable Carbonite Quest module and enable this to display Questie icons on Carbonite map"], - get = function() - return Nx.fdb.profile.Notes.Questie - end, - set = function() - local map = Nx.Map:GetMap (1) - Nx.fdb.profile.Notes.Questie = not Nx.fdb.profile.Notes.Questie - if Nx.fdb.profile.Notes.Questie then - Nx.Notes:Questie(Nx.Map:GetCurrentMapAreaID()) - else - map:ClearIconType("!Questie") - end - end, - disabled = function() - if Questie then - return false - end - return true - end, - }, - questiesize = { - order = 7, - type = "range", - width = "normal", - min = 10, - max = 60, - step = 5, - name = L["Questie Icon Size"], - get = function() - return Nx.fdb.profile.Notes.QuestieSize - end, - set = function(input,value) - local map = Nx.Map:GetMap (1) - Nx.fdb.profile.Notes.QuestieSize = value - map:ClearIconType("!Questie") - Nx.Notes:Questie(Nx.Map:GetCurrentMapAreaID()) - end, - disabled = function() - if Questie then - return false - end - return true - end, - }, }, } end @@ -252,29 +198,6 @@ function CarboniteNotes:OnInitialize() Nx.Map.Maps[1].GIconMenu:AddItem (0, L["Add Note"], Nx.Notes.Menu_OnAddNote, Nx.Map.Maps[1]) Nx:AddToConfig("Notes Module",notesConfig(),L["Notes Module"]) tinsert(Nx.BrokerMenuTemplate,{ text = L["Toggle Notes"], func = function() Nx.Notes:ToggleShow() end }) - - if (not Nx.Quest and Questie and Nx.fdb.profile.Notes.Questie) then - CarboniteNotes:RegisterEvent ("PLAYER_LOGIN", "OnQuestUpdate") - CarboniteNotes:RegisterEvent ("UNIT_QUEST_LOG_CHANGED", "OnQuestUpdate") - CarboniteNotes:RegisterEvent ("QUEST_PROGRESS", "OnQuestUpdate") - CarboniteNotes:RegisterEvent ("QUEST_COMPLETE", "OnQuestUpdate") - CarboniteNotes:RegisterEvent ("QUEST_ACCEPTED", "OnQuestUpdate") - CarboniteNotes:RegisterEvent ("QUEST_REMOVED", "OnQuestUpdate") - CarboniteNotes:RegisterEvent ("QUEST_TURNED_IN", "OnQuestUpdate") - CarboniteNotes:RegisterEvent ("QUEST_DETAIL", "OnQuestUpdate") - CarboniteNotes:RegisterEvent ("WORLD_STATE_TIMER_START", "OnQuestUpdate") - CarboniteNotes:RegisterEvent ("WORLD_STATE_TIMER_STOP", "OnQuestUpdate") - local questieStartTimer = C_Timer.NewTimer(3, function(self) - if Questie.started then - needQuestUpdate = true - self:Cancel() - end - end) - end -end - -function CarboniteNotes:OnQuestUpdate (event, ...) - needQuestUpdate = true end function Nx.Notes:OnChat_msg_addon(msg, dist, target) @@ -1591,7 +1514,7 @@ function Nx.Notes:UpdateIcons() local mapId = map.MapId local draw = map.ScaleDraw > .3 and Nx.fdb.profile.Notes.ShowMap - if mapId == self.DrawMapId and draw == self.Draw and self.InstLevelSet == Nx.Map:GetCurrentMapDungeonLevel() and not needQuestUpdate then + if mapId == self.DrawMapId and draw == self.Draw and self.InstLevelSet == Nx.Map:GetCurrentMapDungeonLevel() then return end @@ -1650,8 +1573,6 @@ function Nx.Notes:UpdateIcons() end Nx.Notes:HandyNotes(mapId) Nx.Notes:RareScanner(mapId) - Nx.Notes:Questie(mapId) - needQuestUpdate = false --WorldMap_HijackTooltip(map.Frm) GameTooltip:Hide() end @@ -1757,10 +1678,6 @@ function Nx.Notes:RareScanner(mapId) map:SetIconTypeChop ("!RSR", true) map:SetIconTypeLevel ("!RSR", 20) - map:InitIconType ("!RSRC", "WP", "", Nx.fdb.profile.Notes.RareScannerSize or 32, Nx.fdb.profile.Notes.RareScannerSize or 32) - map:SetIconTypeChop ("!RSRC", true) - map:SetIconTypeLevel ("!RSRC", 20) - for _,rspin in ipairs(rspins) do if rspin.POI then if rspin.POI.mapID == map.MapId then @@ -1808,9 +1725,9 @@ function Nx.Notes:RareScanner(mapId) icon:SetPoint("CENTER", tmpFrame, "TOPLEFT", x*tmpFrame:GetWidth(), -y*tmpFrame:GetHeight()) local tooltip = rspin.pin.POI.name local tooltipName = "GameTooltip" - local rsnote = map:AddIconPt("!RSRC", wx, wy, level, color, texture) + local rsnote = map:AddIconPt("!RSR", wx, wy, level, color, texture) map:SetIconTip(rsnote,tooltip) - map:SetIconUserData(rsnote, rspin) + map:SetIconUserData(rsnote, rspin.pin) end end end @@ -1818,66 +1735,6 @@ function Nx.Notes:RareScanner(mapId) end end - -function Nx.Notes:Questie(mapId) - local map = Nx.Map:GetMap (1) - if (Nx.fdb.profile.Notes.Questie and Questie and not Nx.Quest) then - questiepins = {} - - local FROM_ON_SHOW = true - WorldMapFrame:RefreshAll(FROM_ON_SHOW) - - for pin in WorldMapFrame:EnumeratePinsByTemplate("HereBeDragonsPinsTemplateQuestie") do - questiepins[#questiepins + 1] = pin - end - - local level = nil - - map:InitIconType ("!Questie", "WP", "", Nx.fdb.profile.Notes.QuestieSize or 15, Nx.fdb.profile.Notes.QuestieSize or 15) - map:SetIconTypeChop ("!Questie", true) - map:SetIconTypeLevel ("!Questie", 20) - - for _,questiepin in ipairs(questiepins) do - if questiepin.icon then - if questiepin.icon.UiMapID == map.MapId and questiepin.icon.data then - local x = questiepin.icon.x - local y = questiepin.icon.y - if x and y then - local texture = questiepin.icon.texture:GetTexture() or questiepin.icon.data.Icon - local scale = questiepin.icon.data.IconScale or 1 - local wx, wy = Nx.Map:GetWorldPos(mapId,x,y) - local icon = CreateFrame("Button", "QuestieCarb", UIParent) - local tmpFrame = WorldMapFrame:GetCanvas() - icon:SetParent(tmpFrame) - icon:ClearAllPoints() - icon:SetHeight(scale) - icon:SetWidth(scale) - icon:SetPoint("CENTER", tmpFrame, "TOPLEFT", x*tmpFrame:GetWidth(), -y*tmpFrame:GetHeight()) - local questienote = map:AddIconPt("!Questie", wx, wy, level, "FFFFFF", texture) - local tooltip = "" - - if questiepin.icon.data.ObjectiveData and questiepin.icon.data.QuestData then - qLevel = questiepin.icon.data.QuestData.questLevel - qName = questiepin.icon.data.QuestData.name - qObjName = questiepin.icon.data.ObjectiveData.Description - if questiepin.icon.data.ObjectiveData.Needed then - qNeeded = questiepin.icon.data.ObjectiveData.Needed - qCollected = questiepin.icon.data.ObjectiveData.Collected - tooltip = format("|cFFFFFF00[%s] %s\n |cFFcbcbcb|cFFEEEEEE%s/%s %s", qLevel, qName, qCollected, qNeeded, qObjName) - else - tooltip = format("|cFFFFFF00[%s] %s\n |cFFcbcbcb|cFFEEEEEE%s", qLevel, qName, qObjName) - end - end - - map:SetIconTip(questienote,tooltip) - map:SetIconUserData(questienote, questiepin) - end - end - end - end - needQuestUpdate = true - end -end --------------------------------------------------------------------------------------- function Nx.Notes:OnButToggleFav (but) diff --git a/Carbonite/NxMap.lua b/Carbonite/NxMap.lua index a299138..80ab6cc 100644 --- a/Carbonite/NxMap.lua +++ b/Carbonite/NxMap.lua @@ -3034,8 +3034,10 @@ end -- Generic icon goto function Nx.Map:GMenu_OnGoto() - if Nx.Quest.Watch then - Nx.Quest.Watch:ClearAutoTarget() + if Nx.Quest then + if Nx.Quest.Watch then + Nx.Quest.Watch:ClearAutoTarget() + end end if self.ClickType == 3001 then if Nx.Social then