fix: mailbox error
This commit is contained in:
+1
-4
@@ -16,13 +16,10 @@ function Main:Initialize()
|
|||||||
addon.Modules.DB:Initialize()
|
addon.Modules.DB:Initialize()
|
||||||
|
|
||||||
-- Initialize cross-account sharing (optional, requires GudaIO DLL)
|
-- Initialize cross-account sharing (optional, requires GudaIO DLL)
|
||||||
if addon.Modules.SharedData then
|
if addon.Modules.SharedData and addon.Modules.SharedData.Initialize then
|
||||||
addon.Modules.SharedData:Initialize()
|
addon.Modules.SharedData:Initialize()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Clean up blacklist for deleted characters (after shared import)
|
|
||||||
addon.Modules.DB:CleanupBlacklist()
|
|
||||||
|
|
||||||
-- Initialize item detection (before scanners, as they may use it)
|
-- Initialize item detection (before scanners, as they may use it)
|
||||||
if addon.Modules.ItemDetection then
|
if addon.Modules.ItemDetection then
|
||||||
addon.Modules.ItemDetection:Initialize()
|
addon.Modules.ItemDetection:Initialize()
|
||||||
|
|||||||
+6
-1
@@ -14,15 +14,20 @@ addon.Modules.SharedData = SharedData
|
|||||||
function SharedData:Initialize()
|
function SharedData:Initialize()
|
||||||
-- Clean up any leaked shared characters from the old approach
|
-- Clean up any leaked shared characters from the old approach
|
||||||
if Guda_DB and Guda_DB.characters then
|
if Guda_DB and Guda_DB.characters then
|
||||||
|
-- Collect keys to remove first (can't modify table during pairs iteration)
|
||||||
|
local toRemove = {}
|
||||||
for fullName, data in pairs(Guda_DB.characters) do
|
for fullName, data in pairs(Guda_DB.characters) do
|
||||||
if data.isShared then
|
if data.isShared then
|
||||||
Guda_DB.characters[fullName] = nil
|
table.insert(toRemove, fullName)
|
||||||
else
|
else
|
||||||
-- Strip leaked fields from own characters
|
-- Strip leaked fields from own characters
|
||||||
data.isShared = nil
|
data.isShared = nil
|
||||||
data.account = nil
|
data.account = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
for _, fullName in ipairs(toRemove) do
|
||||||
|
Guda_DB.characters[fullName] = nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Initialize in-memory shared characters table
|
-- Initialize in-memory shared characters table
|
||||||
|
|||||||
+9
-8
@@ -277,9 +277,14 @@ function Tooltip:AddInventoryInfo(tooltip, link)
|
|||||||
local currentPlayerName = addon.Modules.DB:GetPlayerFullName()
|
local currentPlayerName = addon.Modules.DB:GetPlayerFullName()
|
||||||
local currentRealm = GetRealmName()
|
local currentRealm = GetRealmName()
|
||||||
|
|
||||||
-- Count items across characters on current realm only (own + shared)
|
-- Count items across characters on current realm only
|
||||||
local function countFromSource(source, isSharedSource)
|
local sources = { { data = Guda_DB.characters, shared = false } }
|
||||||
for charName, charData in pairs(source) do
|
if addon.sharedCharacters then
|
||||||
|
table.insert(sources, { data = addon.sharedCharacters, shared = true })
|
||||||
|
end
|
||||||
|
|
||||||
|
for _, source in ipairs(sources) do
|
||||||
|
for charName, charData in pairs(source.data) do
|
||||||
if type(charData) == "table" and charData.realm == currentRealm and not addon.Modules.DB:IsGoldBlacklisted(charName) then
|
if type(charData) == "table" and charData.realm == currentRealm and not addon.Modules.DB:IsGoldBlacklisted(charName) then
|
||||||
local isCurrentChar = (charName == currentPlayerName)
|
local isCurrentChar = (charName == currentPlayerName)
|
||||||
local bagCount, bankCount, equippedCount, mailCount = CountItemsForCharacter(itemID, charData, isCurrentChar)
|
local bagCount, bankCount, equippedCount, mailCount = CountItemsForCharacter(itemID, charData, isCurrentChar)
|
||||||
@@ -302,15 +307,11 @@ function Tooltip:AddInventoryInfo(tooltip, link)
|
|||||||
entry.mailCount = mailCount
|
entry.mailCount = mailCount
|
||||||
entry.equippedCount = equippedCount
|
entry.equippedCount = equippedCount
|
||||||
entry.isCurrent = isCurrentChar
|
entry.isCurrent = isCurrentChar
|
||||||
entry.isShared = isSharedSource
|
entry.isShared = source.shared
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
countFromSource(Guda_DB.characters, false)
|
|
||||||
if addon.sharedCharacters then
|
|
||||||
countFromSource(addon.sharedCharacters, true)
|
|
||||||
end
|
|
||||||
-- Clean up any stale entries beyond current count
|
-- Clean up any stale entries beyond current count
|
||||||
for i = ccIndex + 1, table.getn(characterCounts) do
|
for i = ccIndex + 1, table.getn(characterCounts) do
|
||||||
characterCounts[i] = nil
|
characterCounts[i] = nil
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
## Title: Guda
|
## Title: Guda
|
||||||
## Notes: All-in-one bag and bank addon for World of Warcraft 1.12.1 (Turtle WoW)
|
## Notes: All-in-one bag and bank addon for World of Warcraft 1.12.1 (Turtle WoW)
|
||||||
## Author: Vati
|
## Author: Vati
|
||||||
## Version: 2.2.1
|
## Version: 2.2.0
|
||||||
## SavedVariables: Guda_DB
|
## SavedVariables: Guda_DB
|
||||||
## SavedVariablesPerCharacter: Guda_CharDB
|
## SavedVariablesPerCharacter: Guda_CharDB
|
||||||
## OptionalDeps: pfUI
|
## OptionalDeps: pfUI
|
||||||
|
|||||||
+4
-3295
File diff suppressed because it is too large
Load Diff
+8
-4
@@ -2653,8 +2653,10 @@ local function Guda_BagMailboxMenu_Initialize()
|
|||||||
local info = {}
|
local info = {}
|
||||||
info.text = addon.Modules.Utils:ColorText(char.name, r, g, b)
|
info.text = addon.Modules.Utils:ColorText(char.name, r, g, b)
|
||||||
info.func = function()
|
info.func = function()
|
||||||
addon.Modules.MailboxFrame:ShowCharacter(charFullName)
|
if addon.Modules.MailboxFrame and addon.Modules.MailboxFrame.ShowCharacter then
|
||||||
if not Guda_MailboxFrame:IsShown() then
|
addon.Modules.MailboxFrame:ShowCharacter(charFullName)
|
||||||
|
end
|
||||||
|
if Guda_MailboxFrame and not Guda_MailboxFrame:IsShown() then
|
||||||
Guda_MailboxFrame:Show()
|
Guda_MailboxFrame:Show()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2673,8 +2675,10 @@ local function Guda_BagMailboxMenu_Initialize()
|
|||||||
local info = {}
|
local info = {}
|
||||||
info.text = addon.Modules.Utils:ColorText(char.name, r, g, b)
|
info.text = addon.Modules.Utils:ColorText(char.name, r, g, b)
|
||||||
info.func = function()
|
info.func = function()
|
||||||
addon.Modules.MailboxFrame:ShowCharacter(charFullName)
|
if addon.Modules.MailboxFrame and addon.Modules.MailboxFrame.ShowCharacter then
|
||||||
if not Guda_MailboxFrame:IsShown() then
|
addon.Modules.MailboxFrame:ShowCharacter(charFullName)
|
||||||
|
end
|
||||||
|
if Guda_MailboxFrame and not Guda_MailboxFrame:IsShown() then
|
||||||
Guda_MailboxFrame:Show()
|
Guda_MailboxFrame:Show()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+2
-2
@@ -379,7 +379,7 @@ local function Guda_MailboxCharacterMenu_Initialize()
|
|||||||
local info = {}
|
local info = {}
|
||||||
info.text = addon.Modules.Utils:ColorText(char.name, r, g, b)
|
info.text = addon.Modules.Utils:ColorText(char.name, r, g, b)
|
||||||
info.func = function() MailboxFrame:ShowCharacter(charFullName) end
|
info.func = function() MailboxFrame:ShowCharacter(charFullName) end
|
||||||
local currentViewChar = MailboxFrame:GetCurrentViewChar and MailboxFrame:GetCurrentViewChar()
|
local currentViewChar = MailboxFrame.GetCurrentViewChar and MailboxFrame:GetCurrentViewChar()
|
||||||
info.checked = (currentViewChar == charFullName or (not currentViewChar and charFullName == currentPlayerFullName))
|
info.checked = (currentViewChar == charFullName or (not currentViewChar and charFullName == currentPlayerFullName))
|
||||||
UIDropDownMenu_AddButton(info)
|
UIDropDownMenu_AddButton(info)
|
||||||
end
|
end
|
||||||
@@ -400,7 +400,7 @@ local function Guda_MailboxCharacterMenu_Initialize()
|
|||||||
local info = {}
|
local info = {}
|
||||||
info.text = addon.Modules.Utils:ColorText(char.name, r, g, b)
|
info.text = addon.Modules.Utils:ColorText(char.name, r, g, b)
|
||||||
info.func = function() MailboxFrame:ShowCharacter(charFullName) end
|
info.func = function() MailboxFrame:ShowCharacter(charFullName) end
|
||||||
local currentViewChar = MailboxFrame:GetCurrentViewChar and MailboxFrame:GetCurrentViewChar()
|
local currentViewChar = MailboxFrame.GetCurrentViewChar and MailboxFrame:GetCurrentViewChar()
|
||||||
info.checked = (currentViewChar == charFullName)
|
info.checked = (currentViewChar == charFullName)
|
||||||
UIDropDownMenu_AddButton(info)
|
UIDropDownMenu_AddButton(info)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user