feat: track, untrack characters from money, inventory and view

This commit is contained in:
Vati
2026-04-06 13:28:14 +04:00
parent cfc9430fac
commit e40ef41602
5 changed files with 209 additions and 32 deletions
+22
View File
@@ -26,6 +26,11 @@ function DB:Initialize()
}
end
-- Initialize gold blacklist (account-wide)
if not Guda_DB.goldBlacklist then
Guda_DB.goldBlacklist = {}
end
-- Initialize character DB
if not Guda_CharDB then
Guda_CharDB = {
@@ -431,6 +436,23 @@ function DB:GetTotalMoney(sameFactionOnly, currentRealmOnly)
return total
end
-- Check if a character is excluded from gold/inventory tracking
function DB:IsGoldBlacklisted(fullName)
return Guda_DB.goldBlacklist and Guda_DB.goldBlacklist[fullName]
end
-- Toggle a character's exclusion from gold/inventory tracking
function DB:ToggleGoldBlacklist(fullName)
if not Guda_DB.goldBlacklist then
Guda_DB.goldBlacklist = {}
end
if Guda_DB.goldBlacklist[fullName] then
Guda_DB.goldBlacklist[fullName] = nil
else
Guda_DB.goldBlacklist[fullName] = true
end
end
-- Get character setting
function DB:GetSetting(key)
-- SavedVariables may not be initialized yet when some UI OnLoad scripts run
+2 -2
View File
@@ -279,8 +279,8 @@ function Tooltip:AddInventoryInfo(tooltip, link)
-- Count items across characters on current realm only
for charName, charData in pairs(Guda_DB.characters) do
-- Ensure charData is actually a table and on current realm
if type(charData) == "table" and charData.realm == currentRealm then
-- Ensure charData is actually a table, on current realm, and not blacklisted
if type(charData) == "table" and charData.realm == currentRealm and not addon.Modules.DB:IsGoldBlacklisted(charName) then
local isCurrentChar = (charName == currentPlayerName)
local bagCount, bankCount, equippedCount, mailCount = CountItemsForCharacter(itemID, charData, isCurrentChar)