marker position
This commit is contained in:
@@ -162,6 +162,11 @@ function DB:Initialize()
|
||||
Guda_CharDB.setProtectionExceptions = {}
|
||||
end
|
||||
|
||||
-- Initialize pinned slots storage
|
||||
if not Guda_CharDB.pinnedSlots then
|
||||
Guda_CharDB.pinnedSlots = {}
|
||||
end
|
||||
|
||||
-- Initialize CategoryManager for custom categories
|
||||
if addon.Modules.CategoryManager then
|
||||
addon.Modules.CategoryManager:Initialize()
|
||||
@@ -540,6 +545,37 @@ function DB:IsItemProtected(itemID)
|
||||
return false
|
||||
end
|
||||
|
||||
-------------------------------------------------
|
||||
-- Pinned Slots (per-character, slot-based)
|
||||
-- Slots pinned by the user are skipped during sorting.
|
||||
-- Key format: bagID * 1000 + slot
|
||||
-------------------------------------------------
|
||||
|
||||
function DB:IsPinnedSlot(bagID, slot)
|
||||
if not bagID or not slot or not Guda_CharDB or not Guda_CharDB.pinnedSlots then return false end
|
||||
return Guda_CharDB.pinnedSlots[bagID * 1000 + slot] and true or false
|
||||
end
|
||||
|
||||
function DB:TogglePinnedSlot(bagID, slot)
|
||||
if not bagID or not slot or not Guda_CharDB then return false end
|
||||
if not Guda_CharDB.pinnedSlots then
|
||||
Guda_CharDB.pinnedSlots = {}
|
||||
end
|
||||
local key = bagID * 1000 + slot
|
||||
if Guda_CharDB.pinnedSlots[key] then
|
||||
Guda_CharDB.pinnedSlots[key] = nil
|
||||
return false -- unpinned
|
||||
else
|
||||
Guda_CharDB.pinnedSlots[key] = true
|
||||
return true -- pinned
|
||||
end
|
||||
end
|
||||
|
||||
function DB:GetPinnedSlotSet()
|
||||
if not Guda_CharDB or not Guda_CharDB.pinnedSlots then return {} end
|
||||
return Guda_CharDB.pinnedSlots
|
||||
end
|
||||
|
||||
-- Cleanup old characters (not updated in 90 days)
|
||||
function DB:CleanupOldCharacters()
|
||||
local cutoff = time() - (90 * 24 * 60 * 60) -- 90 days
|
||||
|
||||
Reference in New Issue
Block a user