Revision 10

This commit is contained in:
Robin 2021-01-13 15:41:39 +01:00
commit 811b03fc74
7 changed files with 118 additions and 0 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "Common"]
path = Common
url = https://git.grml.de/rilgamon/Common.git

1
Common Submodule

@ -0,0 +1 @@
Subproject commit 762c59c6c6abc6ecaa71f3e36bb2c6dd16b8e0ed

96
core.lua Normal file
View File

@ -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)

BIN
icon2.tga Normal file

Binary file not shown.

6
license.txt Normal file
View File

@ -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.

3
pack.xml Normal file
View File

@ -0,0 +1,3 @@
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
<Script file="core.lua"/>
</Ui>

9
zz_Quest.toc Normal file
View File

@ -0,0 +1,9 @@
## Interface: 90002
## Title: zz Quest
## Notes: Quick overview of your quests
## Author: Rilgamon
## X-WoWI-ID: 25654
## SavedVariables: zz_QuestDB
## OptionalDeps: Ace3, BrokerPack, zzLibCommon
Common\common.xml
pack.xml