chore: flatten Altoholic-Addon/ wrapper + add standard .gitignore/.gitattributes

Each DataStore_* / Altoholic_* addon now lives at the repo root, matching
the Exiles fork-layout convention (one folder per addon, no wrapper dir).
This commit is contained in:
2026-05-25 10:59:24 +02:00
parent 7789489aec
commit bbe2492a5b
387 changed files with 2 additions and 0 deletions
@@ -0,0 +1,55 @@
------------------------------------------------------------------------
r12 | pompachomp | 2010-02-19 18:58:04 +0000 (Fri, 19 Feb 2010) | 2 lines
Changed paths:
M /trunk/DataStore_Quests.toc
D /trunk/local.xml
A /trunk/locale.xml (from /trunk/local.xml:11)
local.xml->locale.xml
------------------------------------------------------------------------
r11 | thaoky | 2010-02-17 19:04:05 +0000 (Wed, 17 Feb 2010) | 1 line
Changed paths:
M /trunk/DataStore_Quests.lua
M /trunk/DataStore_Quests.toc
A /trunk/Locales
A /trunk/Locales/deDE.lua
A /trunk/Locales/enUS.lua
A /trunk/Locales/esES.lua
A /trunk/Locales/esMX.lua
A /trunk/Locales/frFR.lua
A /trunk/Locales/koKR.lua
A /trunk/Locales/repoenUS.lua
A /trunk/Locales/ruRU.lua
A /trunk/Locales/zhCN.lua
A /trunk/Locales/zhTW.lua
A /trunk/Options.lua
A /trunk/Options.xml
A /trunk/local.xml
Added 2 options to manage quest turn-ins & history auto-update.
------------------------------------------------------------------------
r10 | thaoky | 2010-02-15 18:12:05 +0000 (Mon, 15 Feb 2010) | 1 line
Changed paths:
M /trunk/DataStore_Quests.lua
Quest turn-ins are now detected and update the history DB.
------------------------------------------------------------------------
r9 | thaoky | 2010-02-03 19:00:55 +0000 (Wed, 03 Feb 2010) | 1 line
Changed paths:
M /trunk/DataStore_Quests.lua
Improved quest history support.
------------------------------------------------------------------------
r8 | thaoky | 2010-01-24 17:40:19 +0000 (Sun, 24 Jan 2010) | 1 line
Changed paths:
M /trunk/DataStore_Quests.lua
Added early support to manage quest history.
------------------------------------------------------------------------
r7 | thaoky | 2009-12-09 12:35:09 +0000 (Wed, 09 Dec 2009) | 1 line
Changed paths:
M /trunk/DataStore_Quests.toc
ToC Update
------------------------------------------------------------------------
+364
View File
@@ -0,0 +1,364 @@
--[[ *** DataStore_Quests ***
Written by : Thaoky, EU-Marécages de Zangar
July 8th, 2009
--]]
if not DataStore then return end
local addonName = "DataStore_Quests"
_G[addonName] = LibStub("AceAddon-3.0"):NewAddon(addonName, "AceConsole-3.0", "AceEvent-3.0", "AceTimer-3.0")
local addon = _G[addonName]
local THIS_ACCOUNT = "Default"
local AddonDB_Defaults = {
global = {
Options = {
TrackTurnIns = 1, -- by default, save the ids of completed quests in the history
AutoUpdateHistory = 1, -- if history has been queried at least once, auto update it at logon (fast operation - already in the game's cache)
},
Characters = {
['*'] = { -- ["Account.Realm.Name"]
lastUpdate = nil,
Quests = {},
QuestLinks = {},
Rewards = {},
History = {}, -- a list of completed quests, hash table ( [questID] = true )
HistoryBuild = nil, -- build version under which the history has been saved
HistorySize = 0,
HistoryLastUpdate = nil,
}
}
}
}
-- *** Utility functions ***
local function GetOption(option)
return addon.db.global.Options[option]
end
local function GetQuestLogIndexByName(name)
-- helper function taken from QuestGuru
for i = 1, GetNumQuestLogEntries() do
local title = GetQuestLogTitle(i);
if title == strtrim(name) then
return i
end
end
end
-- *** Scanning functions ***
local headersState = {}
local function SaveHeaders()
local headerCount = 0 -- use a counter to avoid being bound to header names, which might not be unique.
for i = GetNumQuestLogEntries(), 1, -1 do -- 1st pass, expand all categories
local _, _, _, _, isHeader, isCollapsed = GetQuestLogTitle(i)
if isHeader then
headerCount = headerCount + 1
if isCollapsed then
ExpandQuestHeader(i)
headersState[headerCount] = true
end
end
end
end
local function RestoreHeaders()
local headerCount = 0
for i = GetNumQuestLogEntries(), 1, -1 do
local _, _, _, _, isHeader = GetQuestLogTitle(i)
if isHeader then
headerCount = headerCount + 1
if headersState[headerCount] then
CollapseQuestHeader(i)
end
end
end
wipe(headersState)
end
local REWARD_TYPE_CHOICE = "c"
local REWARD_TYPE_REWARD = "r"
local REWARD_TYPE_SPELL = "s"
local function ScanQuests()
local char = addon.ThisCharacter
local quests = char.Quests
local links = char.QuestLinks
local rewards = char.Rewards
wipe(quests)
wipe(links)
wipe(rewards)
local currentSelection = GetQuestLogSelection() -- save the currently selected quest
SaveHeaders()
local RewardsCache = {}
for i = 1, GetNumQuestLogEntries() do
local title, _, questTag, groupSize, isHeader, _, isComplete = GetQuestLogTitle(i);
if isHeader then
quests[i] = "0|" .. (title or "")
else
SelectQuestLogEntry(i)
local money = GetQuestLogRewardMoney()
quests[i] = format("1|%s|%d|%d|%d", questTag or "", groupSize, money, isComplete or 0)
links[i] = GetQuestLink(i)
wipe(RewardsCache)
local num = GetNumQuestLogChoices() -- these are the actual item choices proposed to the player
if num > 0 then
for i = 1, num do
local _, _, numItems, _, isUsable = GetQuestLogChoiceInfo(i)
local link = GetQuestLogItemLink("choice", i)
if link then
local id = tonumber(link:match("item:(%d+)"))
if id then
table.insert(RewardsCache, REWARD_TYPE_CHOICE .."|"..id.."|"..numItems.."|"..(isUsable or 0))
end
end
end
end
num = GetNumQuestLogRewards() -- these are the rewards given anyway
if num > 0 then
for i = 1, num do
local _, _, numItems, _, isUsable = GetQuestLogRewardInfo(i)
local link = GetQuestLogItemLink("reward", i)
if link then
local id = tonumber(link:match("item:(%d+)"))
if id then
table.insert(RewardsCache, REWARD_TYPE_REWARD .. "|"..id.."|"..numItems.."|"..(isUsable or 0))
end
end
end
end
if GetQuestLogRewardSpell() then -- apparently, there is only one spell as reward
local _, _, isTradeskillSpell, isSpellLearned = GetQuestLogRewardSpell()
if isTradeskillSpell or isSpellLearned then
local link = GetQuestLogSpellLink()
if link then
local id = tonumber(link:match("spell:(%d+)"))
if id then
table.insert(RewardsCache, REWARD_TYPE_SPELL .. "|"..id)
end
end
end
end
if #RewardsCache > 0 then
rewards[i] = table.concat(RewardsCache, ",")
end
end
end
RestoreHeaders()
SelectQuestLogEntry(currentSelection) -- restore the selection to match the cursor, must be properly set if a user abandons a quest
addon.ThisCharacter.lastUpdate = time()
end
local function RefreshQuestHistory()
-- called 5 seconds after login, if the current character already has an history, one that was saved in the same build, then it's safe to refresh it automatically
local thisChar = addon.ThisCharacter
if not thisChar.HistoryLastUpdate then return end -- never scanned the history before ? exit
local _, version = GetBuildInfo()
if version and thisChar.HistoryBuild and version == thisChar.HistoryBuild then -- proceed if version is the same as the one saved in the db
QueryQuestsCompleted()
end
end
-- *** Event Handlers ***
local function OnPlayerAlive()
-- print("DataStore_Quests.lua") -- DEBUG 2025 07 21
if not UnitIsGhost("player") then return end -- only scan if player released spirit and went to graveyard
ScanQuests()
end
local function OnQuestLogUpdate()
addon:UnregisterEvent("QUEST_LOG_UPDATE") -- .. and unregister it right away, since we only want it to be processed once (and it's triggered way too often otherwise)
ScanQuests()
end
local function OnUnitQuestLogChanged() -- triggered when accepting/validating a quest .. but too soon to refresh data
addon:RegisterEvent("QUEST_LOG_UPDATE", OnQuestLogUpdate) -- so register for this one ..
end
local lastCompleteQuestLink
local function OnQuestComplete()
if GetOption("TrackTurnIns") ~= 1 then return end
-- "QUEST_COMPLETE" is triggered when the UI reaches the page where a player can click on the "Complete" Button.
-- At this point, only detect which quest we're dealing with, and save its link
local num = GetQuestLogIndexByName(GetTitleText());
if num then
lastCompleteQuestLink = GetQuestLink(num) -- or save quest id
end
end
local queryVerbose
local function OnQuestQueryComplete()
local thisChar = addon.ThisCharacter
local history = thisChar.History
local quests = {}
GetQuestsCompleted(quests)
local count = 0
for questID in pairs(quests) do
history[questID] = true
count = count + 1
end
local _, version = GetBuildInfo() -- save the current build, to know if we can requery and expect immediate execution
thisChar.HistoryBuild = version
thisChar.HistorySize = count
thisChar.HistoryLastUpdate = time()
if queryVerbose then
addon:Print("Quest history successfully retrieved!")
queryVerbose = nil
end
end
-- ** Mixins **
local function _GetQuestLogSize(character)
return #character.Quests
end
local function _GetQuestLogInfo(character, index)
local quest = character.Quests[index]
local link = character.QuestLinks[index]
local isHeader, questTag, groupSize, money, isComplete = strsplit("|", quest)
if isHeader == "0" then
return true, questTag -- questTag contains the title in a header line
end
isComplete = tonumber(isComplete)
return nil, link, questTag, tonumber(groupSize), tonumber(money), tonumber(isComplete)
end
local function _GetQuestLogNumRewards(character, index)
local reward = character.Rewards[index]
if reward then
return select(2, gsub(reward, ",", ",")) + 1 -- returns the number of rewards (=count of ^ +1)
end
return 0
end
local function _GetQuestLogRewardInfo(character, index, rewardIndex)
local reward = character.Rewards[index]
if not reward then return end
local i = 1
for v in reward:gmatch("([^,]+)") do
if rewardIndex == i then
local rewardType, id, numItems, isUsable = strsplit("|", v)
numItems = tonumber(numItems) or 0
isUsable = (isUsable and isUsable == 1) and true or nil
return rewardType, tonumber(id), numItems, isUsable
end
i = i + 1
end
end
local function _GetQuestInfo(link)
assert(type(link) == "string")
local questID, questLevel = link:match("quest:(%d+):(-?%d+)")
local questName = link:match("%[(.+)%]")
return questName, tonumber(questID), tonumber(questLevel)
end
local function _QueryQuestHistory()
QueryQuestsCompleted() -- this call triggers "QUEST_QUERY_COMPLETE"
queryVerbose = true
end
local function _GetQuestHistory(character)
return character.History
end
local function _GetQuestHistoryInfo(character)
-- return the size of the history, the timestamp, and the build under which it was saved
return character.HistorySize, character.HistoryLastUpdate, character.HistoryBuild
end
local function _IsQuestCompletedBy(character, questID)
return character.History[questID] -- nil = not completed (not in the table), true = completed
end
local PublicMethods = {
GetQuestLogSize = _GetQuestLogSize,
GetQuestLogInfo = _GetQuestLogInfo,
GetQuestLogNumRewards = _GetQuestLogNumRewards,
GetQuestLogRewardInfo = _GetQuestLogRewardInfo,
GetQuestInfo = _GetQuestInfo,
QueryQuestHistory = _QueryQuestHistory,
GetQuestHistory = _GetQuestHistory,
GetQuestHistoryInfo = _GetQuestHistoryInfo,
IsQuestCompletedBy = _IsQuestCompletedBy,
}
function addon:OnInitialize()
addon.db = LibStub("AceDB-3.0"):New(addonName .. "DB", AddonDB_Defaults)
DataStore:RegisterModule(addonName, addon, PublicMethods)
DataStore:SetCharacterBasedMethod("GetQuestLogSize")
DataStore:SetCharacterBasedMethod("GetQuestLogInfo")
DataStore:SetCharacterBasedMethod("GetQuestLogNumRewards")
DataStore:SetCharacterBasedMethod("GetQuestLogRewardInfo")
DataStore:SetCharacterBasedMethod("GetQuestHistory")
DataStore:SetCharacterBasedMethod("GetQuestHistoryInfo")
DataStore:SetCharacterBasedMethod("IsQuestCompletedBy")
end
function addon:OnEnable()
addon:RegisterEvent("PLAYER_ALIVE", OnPlayerAlive)
addon:RegisterEvent("UNIT_QUEST_LOG_CHANGED", OnUnitQuestLogChanged)
addon:RegisterEvent("QUEST_COMPLETE", OnQuestComplete)
addon:RegisterEvent("QUEST_QUERY_COMPLETE", OnQuestQueryComplete)
addon:SetupOptions()
if GetOption("AutoUpdateHistory") == 1 then -- if history has been queried at least once, auto update it at logon (fast operation - already in the game's cache)
addon:ScheduleTimer(RefreshQuestHistory, 5) -- refresh quest history 5 seconds later, to decrease the load at startup
end
end
function addon:OnDisable()
addon:UnregisterEvent("PLAYER_ALIVE")
addon:UnregisterEvent("UNIT_QUEST_LOG_CHANGED")
addon:UnregisterEvent("QUEST_QUERY_COMPLETE")
end
-- *** Hooks ***
local Orig_QuestRewardCompleteButton_OnClick = QuestRewardCompleteButton_OnClick;
function QuestRewardCompleteButton_OnClick()
if lastCompleteQuestLink then -- if there's a valid link
local questID = lastCompleteQuestLink:match("quest:(%d+):")
questID = tonumber(questID)
if questID then
addon.ThisCharacter.History[questID] = true -- mark the current quest ID as completed
addon:SendMessage("DATASTORE_QUEST_TURNED_IN", questID) -- trigger the DS event
end
lastCompleteQuestLink = nil
end
Orig_QuestRewardCompleteButton_OnClick();
end
QuestFrameCompleteQuestButton:SetScript("OnClick", QuestRewardCompleteButton_OnClick);
+19
View File
@@ -0,0 +1,19 @@
## Interface: 30300
## Title: DataStore_Quests
## Notes: Stores information about character quests
## Author: Thaoky (EU-Marécages de Zangar)
## Version: 3.3.001
## Dependencies: DataStore
## OptionalDeps: Ace3
## SavedVariables: DataStore_QuestsDB
## X-Category: Interface Enhancements
## X-Embeds: Ace3
## X-Curse-Packaged-Version: r12
## X-Curse-Project-Name: DataStore_Quests
## X-Curse-Project-ID: datastore_quests
## X-Curse-Repository-ID: wow/datastore_quests/mainline
locale.xml
DataStore_Quests.lua
Options.xml
+2
View File
@@ -0,0 +1,2 @@
All Rights Reserved unless otherwise explicitly stated.
+5
View File
@@ -0,0 +1,5 @@
local L = LibStub("AceLocale-3.0"):NewLocale( "DataStore_Quests", "deDE" )
if not L then return end
+16
View File
@@ -0,0 +1,16 @@
local debug = false
--[===[@debug@
debug = true
--@end-debug@]===]
local L = LibStub("AceLocale-3.0"):NewLocale("DataStore_Quests", "enUS", true, debug)
L["AUTO_UPDATE_DISABLED"] = "The quest history will remain in its current state, either empty or outdated."
L["AUTO_UPDATE_ENABLED"] = "A character's quest history will be refreshed every time you login with that character."
L["Auto-update History"] = true
L["AUTO_UPDATE_TITLE"] = "Auto-Update Quest History"
L["Track Quest Turn-ins"] = true
L["TRACK_TURNINS_DISABLED"] = "The quest history will remain in its current state, either empty or outdated."
L["TRACK_TURNINS_ENABLED"] = "Turned-in quests are saved into the history, to make sure it remains constantly valid."
L["TRACK_TURNINS_TITLE"] = "Track Quest Turn-ins"
+5
View File
@@ -0,0 +1,5 @@
local L = LibStub("AceLocale-3.0"):NewLocale( "DataStore_Quests", "esES" )
if not L then return end
+5
View File
@@ -0,0 +1,5 @@
local L = LibStub("AceLocale-3.0"):NewLocale( "DataStore_Quests", "esMX" )
if not L then return end
+13
View File
@@ -0,0 +1,13 @@
local L = LibStub("AceLocale-3.0"):NewLocale( "DataStore_Quests", "frFR" )
if not L then return end
L["AUTO_UPDATE_DISABLED"] = "L'historique de quêtes restera dans son état actuel, soit vide ou obsolète."
L["AUTO_UPDATE_ENABLED"] = "L'historique de quêtes d'un personnage sera rafraîchi à chaque connexion de ce personnage."
L["Auto-update History"] = "Mise à jour automatique de l'historique"
L["AUTO_UPDATE_TITLE"] = "Mise à jour automatique de l'historique de quêtes"
L["Track Quest Turn-ins"] = "Suivre les validations de quêtes"
L["TRACK_TURNINS_DISABLED"] = "L'historique de quêtes restera dans son état actuel, soit vide ou obsolète."
L["TRACK_TURNINS_ENABLED"] = "Les validations de quêtes sont sauvées dans l'historique, afin d'assurer qu'il soit toujours valide."
L["TRACK_TURNINS_TITLE"] = "Suivre les validations de quêtes"
+5
View File
@@ -0,0 +1,5 @@
local L = LibStub("AceLocale-3.0"):NewLocale( "DataStore_Quests", "koKR" )
if not L then return end
+12
View File
@@ -0,0 +1,12 @@
local L = LibStub("AceLocale-3.0"):NewLocale("DataStore_Quests", "enUS", true, true)
if not L then return end
L["Track Quest Turn-ins"] = true
L["Auto-update History"] = true
L["TRACK_TURNINS_DISABLED"] = "The quest history will remain in its current state, either empty or outdated."
L["TRACK_TURNINS_ENABLED"] = "Turned-in quests are saved into the history, to make sure it remains constantly valid."
L["TRACK_TURNINS_TITLE"] = "Track Quest Turn-ins"
L["AUTO_UPDATE_DISABLED"] = "The quest history will remain in its current state, either empty or outdated."
L["AUTO_UPDATE_ENABLED"] = "A character's quest history will be refreshed every time you login with that character."
L["AUTO_UPDATE_TITLE"] = "Auto-Update Quest History"
+5
View File
@@ -0,0 +1,5 @@
local L = LibStub("AceLocale-3.0"):NewLocale( "DataStore_Quests", "ruRU" )
if not L then return end
+5
View File
@@ -0,0 +1,5 @@
local L = LibStub("AceLocale-3.0"):NewLocale( "DataStore_Quests", "zhCN" )
if not L then return end
+5
View File
@@ -0,0 +1,5 @@
local L = LibStub("AceLocale-3.0"):NewLocale( "DataStore_Quests", "zhTW" )
if not L then return end
+20
View File
@@ -0,0 +1,20 @@
if not DataStore then return end
local addonName = "DataStore_Quests"
local addon = _G[addonName]
local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
function addon:SetupOptions()
DataStore:AddOptionCategory(DataStoreQuestsOptions, addonName, "DataStore")
-- localize options
DataStoreQuestsOptions_TrackTurnInsText:SetText(L["Track Quest Turn-ins"])
DataStoreQuestsOptions_AutoUpdateHistoryText:SetText(L["Auto-update History"])
DataStore:SetCheckBoxTooltip(DataStoreQuestsOptions_TrackTurnIns, L["TRACK_TURNINS_TITLE"], L["TRACK_TURNINS_ENABLED"], L["TRACK_TURNINS_DISABLED"])
DataStore:SetCheckBoxTooltip(DataStoreQuestsOptions_AutoUpdateHistory, L["AUTO_UPDATE_TITLE"], L["AUTO_UPDATE_ENABLED"], L["AUTO_UPDATE_DISABLED"])
-- restore saved options to gui
DataStoreQuestsOptions_TrackTurnIns:SetChecked(DataStore:GetOption(addonName, "TrackTurnIns"))
DataStoreQuestsOptions_AutoUpdateHistory:SetChecked(DataStore:GetOption(addonName, "AutoUpdateHistory"))
end
+47
View File
@@ -0,0 +1,47 @@
<Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.blizzard.com/wow/ui/">
<Script file="Options.lua"></Script>
<Frame name="DataStoreQuestsOptions" hidden="true">
<Size>
<AbsDimension x="615" y="306"/>
</Size>
<Frames>
<CheckButton name="$parent_TrackTurnIns" inherits="InterfaceOptionsSmallCheckButtonTemplate">
<Size>
<AbsDimension x="20" y="20"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="40" y="-40" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
DataStore:ToggleOption(self, "DataStore_Quests", "TrackTurnIns")
</OnClick>
</Scripts>
</CheckButton>
<CheckButton name="$parent_AutoUpdateHistory" inherits="InterfaceOptionsSmallCheckButtonTemplate">
<Size>
<AbsDimension x="20" y="20"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="$parent_TrackTurnIns" relativePoint="BOTTOM" >
<Offset>
<AbsDimension x="0" y="-10"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
DataStore:ToggleOption(self, "DataStore_Quests", "AutoUpdateHistory")
</OnClick>
</Scripts>
</CheckButton>
</Frames>
</Frame>
</Ui>
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.blizzard.com/wow/ui/" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Include file="Locales\deDE.lua"/>
<Include file="Locales\enUS.lua"/>
<Include file="Locales\esES.lua"/>
<Include file="Locales\esMX.lua"/>
<Include file="Locales\frFR.lua"/>
<Include file="Locales\koKR.lua"/>
<Include file="Locales\ruRU.lua"/>
<Include file="Locales\zhCN.lua"/>
<Include file="Locales\zhTW.lua"/>
</Ui>