From 811b03fc74b88393d22d72170ca19373f9ab74ef Mon Sep 17 00:00:00 2001 From: Robin Date: Wed, 13 Jan 2021 15:41:39 +0100 Subject: [PATCH] Revision 10 --- .gitmodules | 3 ++ Common | 1 + core.lua | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++ icon2.tga | Bin 0 -> 2848 bytes license.txt | 6 ++++ pack.xml | 3 ++ zz_Quest.toc | 9 +++++ 7 files changed, 118 insertions(+) create mode 100644 .gitmodules create mode 160000 Common create mode 100644 core.lua create mode 100644 icon2.tga create mode 100644 license.txt create mode 100644 pack.xml create mode 100644 zz_Quest.toc diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..34950ac --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Common"] + path = Common + url = https://git.grml.de/rilgamon/Common.git diff --git a/Common b/Common new file mode 160000 index 0000000..762c59c --- /dev/null +++ b/Common @@ -0,0 +1 @@ +Subproject commit 762c59c6c6abc6ecaa71f3e36bb2c6dd16b8e0ed diff --git a/core.lua b/core.lua new file mode 100644 index 0000000..d0c31bf --- /dev/null +++ b/core.lua @@ -0,0 +1,96 @@ +local name, addon = ... +local parentName = addon['parentName'] or "BrokerPack" +local childName = "zz_Quest" -- Change childName to your addons foldername + +local defaults = { +} + +local options = { +} + +local db +local ldbicon = LibStub:GetLibrary("LibDBIcon-1.0") +local function OnClick(self, button) + if(IsShiftKeyDown() and button == "LeftButton") then + addon['db']['global']['ldbicons'][childName]['hide'] = not addon['db']['global']['ldbicons'][childName]['hide'] + if(ldbicon) then + if(addon['db']['global']['ldbicons'][childName]['hide']) then + ldbicon:Hide(childName) + else + ldbicon:Show(childName) + end + end + else + if(InterfaceOptionsFrame:IsVisible() and not InCombatLockdown()) then + InterfaceOptionsFrame:Hide() + else + InterfaceOptionsFrame_OpenToCategory(name) + InterfaceOptionsFrame_OpenToCategory(name) -- Twice because of a bug in InterfaceOptionsFrame_OpenToCategory + end + end +end +local function OnText(message) + addon:OnText(childName, message) +end +local function getPref(pref) + return db[pref[#pref]] +end +local function QuestUpdate(self, event, ...) + local maxNumQuests = C_QuestLog.GetMaxNumQuestsCanAccept() + local numEntries, numQuests + if(C_QuestLog.GetNumQuestLogEntries) then + numEntries, numQuests = C_QuestLog.GetNumQuestLogEntries() + else + numEntries, numQuests = GetNumQuestLogEntries() + end + if(db['slots']) then + numQuests = maxNumQuests - numQuests + end + local line = format("%i/%i",numQuests, maxNumQuests) + if(numQuests==maxNumQuests or numQuests==0) then + line = addon:colorize(line, 'ff0000') + end + OnText(line) +end +local function setPref(pref,value) + db[pref[#pref]] = value + if(pref[#pref]=='slots') then + QuestUpdate() + end +end +local function OnTooltip(tip) + tip:AddLine(childName) + local mapid = C_Map.GetBestMapForUnit("player") + local quests = C_QuestLog.GetQuestsOnMap(mapid) + local header = {} + for num, quest in ipairs(quests) do + local objectives = C_QuestLog.GetQuestObjectives(quest['questID']) + if(#objectives>0) then + for num, objective in ipairs(objectives) do + if(not objective['finished']) then + if(not header[quest['questID']]) then + header[quest['questID']] = true + if(C_QuestLog.GetTitleForQuestID) then + tip:AddLine(C_QuestLog.GetTitleForQuestID(quest['questID'])) + else + tip:AddLine(C_QuestLog.GetQuestInfo(quest['questID'])) + end + end + tip:AddLine(addon:colorize(format(" %s", objective['text']),'ffffff')) + end + end + end + end +end +local function init() + options = addon:InitConfig(childName, true, { + ['type'] = "data source", -- 'data source | launcher' + ['name'] = childName, + ['OnClick'] = OnClick, + ['OnTooltipShow'] = OnTooltip, + }, getPref, setPref) + db = addon['db']['profile'][childName] + addon:AddConfigEntry(childName, "toggle","slots","Show free slots",nil,1,nil,nil,nil,nil,options['args'][childName]) + addon:RegisterFunc({'QUEST_ACCEPTED','QUEST_AUTOCOMPLETE','QUEST_COMPLETE','QUEST_DATA_LOAD_RESULT','QUEST_DETAIL','QUEST_LOG_CRITERIA_UPDATE','QUEST_LOG_UPDATE','QUEST_POI_UPDATE','QUEST_REMOVED','QUEST_TURNED_IN','QUEST_WATCH_LIST_CHANGED','QUEST_WATCH_UPDATE','QUESTLINE_UPDATE','TASK_PROGRESS_UPDATE','TREASURE_PICKER_CACHE_FLUSH','WAYPOINT_UPDATE','WORLD_QUEST_COMPLETED_BY_SPELL'}, "OnEvent", QuestUpdate) +end +addon:startup(name, childName, init, true, defaults) \ No newline at end of file diff --git a/icon2.tga b/icon2.tga new file mode 100644 index 0000000000000000000000000000000000000000..f675e12e0d0804417cc12c597a266809fb754edf GIT binary patch literal 2848 zcmY*b2Ut{R7X1e_f>=PnRTRQv%Nq2Mn;E|UKj;4Eo_pV8Y%=@brOD_|?q2}d zB*tV^n4HQAHe-PiQ(0ufloy(?X`0)ZjQmnsKaF4YPj0C^)6zH5{qIQ!GZ`>9IHeEw!t4DH6ejiZy33x-F2|Yk$HxSwd z_;vy|RU?@7lS>5?$Z7MtoVcx18JjRk^O#rC+g6~IwxqYy)(^CmeuuOGeocUTBj7^+ zH_vFp1iizNl&}K7dkjKn*IDoEb~F<6`wn8K_>-1LwE>R_%Aa7|3C2+Z+@#Ny?ytdS zEIP{XcI2{{&g50+Y`T*mZjb^MlyD9~B()47tgaW2YJ1@;?t`beA1)2UJj}0k!#I)M zhH1vO`HTtFc$85n!8(hZPfDd|8H0M;G62h{WULkb4n6M>==nT`zHb-~#EW>SYc+$o zSk#HXdnSX;TzZa2ap1C2VsgqeH@W;-%VkwdS(TBD@7hNY)6fT>qGmYd)Ztcc1MCW0 z;8ZPz10C>c^#H7LKj2V8B^0)v&m^s8@MvR@%XV7`MIX`H4^$Ie>BmvclG{cQA^C*h z`hIv;cEhWFkk^cdtQx>sQ7ew6)?l&ilM$w%X7m~4U(fi)6%&-0ip@jP_dJUGg%WHI z2!oDCAhcZ{VEeNqxKf53q)p`~oO#!bqpvElq`1w&R*k}%CzfH)A30Fmd4(&_Tpsln z2R(uG5KuEHGyNkDf%%2^^^zE)&ryjwqoNd!J=uo$GUGU-8A4 zmY!gLS#pXey2(i=%LJ3;Ryn^cC?_js(urq64k1VRwXp|LH~X@Hig6!iI}9TgXNoAzE1nXva#MR9NHILF#psY z$Sm6zM=qGeABw-pFtufRRbe(=k*vH{lc-zH4s`? zU7=z98|I$40qwJnFtYQ6>TcTs8ut3*gtOV|L#J#qrI1i%#3Up)PAbTA?tbi5y^LR`aEF#je?Orq%oc}j8j$DHFaYx7* z+H|lfvsa8$&SLV@rwR?;Rc{&mG zULMhBQ(aSOK_aziaA^yUJlna2B8lc6H>5*&qZCg0)YS1s*cp=? zja61WHh)uyOrFkN}gmfJ*b;qY+JgaR)P;~l6c9xU4DQB4#niEh3BFM0DfmII^3}!Qmmes5Lgn4WDHTuE2%-q4 z_?<+%(9jMOQ&VhOsf$H(=U^gZn74KdPNdh5iIjqMo^kkMwOJHR1DSDnWv08|JgA5U z09~9&Qi?Ka!BFalV2Wo%aai1mgXgSaVr&fEZ*-upJ{Nlfp5tUz3rzo$i`}7V`1<-& zu-VJZ_@w!pGMhMc@{;Qj-1HoUC#Y_UJc17+=n(qcN&R{Hnk{}l@DCW7?1foS3@*@+ zvq-L{%=7SlU>Xz*FJv$#JB3H(ADl`|T~}}CgS=MmnaN#!Bo3Jbwe&li!nUa&4m4Ek zBa?8exD9sAWXt@IG$zH^A5{RgR0F^_|B}{4FIv&G`7Sl`K#Hmx6j`7ij=k6yR4ifd) zzZS!{s0Uu<1GrH_FD#-Sn7*jPx5BjkS>~>pg0HrmXR?!(`Q2l0rLvP`nCfD6ws7mKADH~ig;d6g{AwyFf0^vwW3boo2g98^mhAt|aJ#`$ F_Fw4mm%so3 literal 0 HcmV?d00001 diff --git a/license.txt b/license.txt new file mode 100644 index 0000000..b9e992f --- /dev/null +++ b/license.txt @@ -0,0 +1,6 @@ +The following license excludes the libraries (Libs) included. See the libraries directory or website. + +This AddOn is public domain. That means you can change it, rename it or paint it yellow. +My name (Rilgamon) is valid only for WoWInterface.com and curse.com. +If you use/offer this addon on another website please remove my name. +If you want to give me credit you can replace it with a link to my profile on WoWInterface.com. \ No newline at end of file diff --git a/pack.xml b/pack.xml new file mode 100644 index 0000000..0f7eacc --- /dev/null +++ b/pack.xml @@ -0,0 +1,3 @@ + +