### AtlasLoot Item Database API - Add/Get Module Source: https://context7.com/nanderson11/atlaslootenhanced/llms.txt Manage item databases for addon modules using the ItemDB. Use Add to register a new database and Get to retrieve an existing one. ```lua -- Add a new item database for an addon module -- Parameters: addonName (string), tierID (number - Encounter Journal tier) local data = AtlasLoot.ItemDB:Add("AtlasLoot_TheWarWithin", 11) ``` ```lua -- Get an existing item database by addon name local moduleData = AtlasLoot.ItemDB:Get("AtlasLoot_TheWarWithin") ``` -------------------------------- ### AtlasLoot Item Database API - Get Module List Source: https://context7.com/nanderson11/atlaslootenhanced/llms.txt Retrieve a list of all content (instances) available within a specific addon module from the ItemDB. ```lua -- Get list of all content in a module local contentList = AtlasLoot.ItemDB:GetModuleList("AtlasLoot_TheWarWithin") for i = 1, #contentList do print("Instance:", contentList[i]) end ``` -------------------------------- ### AtlasLoot Item Database API - Get Item Table Source: https://context7.com/nanderson11/atlaslootenhanced/llms.txt Retrieve the complete loot table for a specific boss and difficulty within an instance. The returned itemTable can be iterated to access individual item details. ```lua -- Get complete loot table for a specific boss/difficulty -- Returns: itemTable, tableType, difficultyData local items, tableType, diffData = AtlasLoot.ItemDB:GetItemTable( "AtlasLoot_TheWarWithin", -- addonName "The Stonevault", -- contentName (instance name) 1, -- boss index 2 -- difficulty index ) ``` ```lua -- Iterate through items in the loot table for i, item in ipairs(items) do local position = item[1] -- Display position local itemID = item[2] -- Item ID or item string print("Position:", position, "ItemID:", itemID) end ``` -------------------------------- ### Register Module Initialization Hooks Source: https://context7.com/nanderson11/atlaslootenhanced/llms.txt Execute code when AtlasLoot finishes loading or when a specific module is initialized. ```lua -- Add a function to run when AtlasLoot initializes AtlasLoot:AddInitFunc(function() print("AtlasLoot has finished initializing!") -- Access database after initialization local db = AtlasLoot.db local guiSettings = db.GUI -- Check addon settings if guiSettings.autoselect then print("Auto-select is enabled") end end) -- Add initialization function for a specific module AtlasLoot:AddInitFunc(function() print("My custom module initialized!") end, "MyCustomModule") -- Only runs when MyCustomModule loads ``` -------------------------------- ### Registering a World Map Button Source: https://github.com/nanderson11/atlaslootenhanced/blob/master/AtlasLoot/Libs/Krowi_WorldMapButtons/README.md Initializes the button object and registers it with the library using LibStub. ```lua local _, addon = ...; addon.Gui.WorldMapButton = {}; local worldMapButton = gui.WorldMapButton; addon.WorldMapButtons = LibStub("Krowi_WorldMapButtons-1.4"); -- Global world map buttons object function worldMapButton.Load() worldMapButton = addon.WorldMapButtons:Add("KrowiAF_WorldMapButton_Template", "BUTTON"); addon.Gui.WorldMapButton = worldMapButton; end ``` -------------------------------- ### AtlasLoot GUI Window Management Source: https://context7.com/nanderson11/atlaslootenhanced/llms.txt Programmatically control the main AtlasLoot interface using the GUI module. This allows for dynamic showing, hiding, and resetting of addon windows. ```lua -- Toggle the main AtlasLoot window (show if hidden, hide if shown) AtlasLoot.GUI:Toggle() ``` ```lua -- Access the main frame directly local mainFrame = AtlasLoot.GUI.frame ``` ```lua -- Check if the frame is currently visible if AtlasLoot.GUI.frame:IsShown() then print("AtlasLoot is currently open") end ``` ```lua -- Reset all frame positions to center of screen AtlasLoot.GUI.ResetFrames() ``` -------------------------------- ### Configure Item Button Click Handlers Source: https://context7.com/nanderson11/atlaslootenhanced/llms.txt Define custom interactions for item buttons in the loot browser using the ClickHandler system. ```lua -- Item click actions (configurable in options) -- Default bindings: -- Shift + Left Click: Add item link to chat -- Ctrl + Left Click: Open item in Dressing Room -- Alt + Left Click: Add/Remove item from Favourites -- Shift + Right Click: Open Azerite powers (for Azerite items) -- The ClickHandler system manages all button interactions local ItemClickHandler = AtlasLoot.ClickHandler:Add( "Item", -- Handler name { ChatLink = { "LeftButton", "Shift" }, DressUp = { "LeftButton", "Ctrl" }, SetFavourite = { "LeftButton", "Alt" }, types = { ChatLink = true, DressUp = true, SetFavourite = true, }, }, db.ClickHandler, -- Saved settings { { "ChatLink", "Chat Link", "Add item into chat" }, { "DressUp", "Dress up", "Shows the item in the Dressing room" }, { "SetFavourite", "Set Favourite", "Set/Remove the item as favourite" }, } ) -- Check what action a mouse button should perform local action = ItemClickHandler:Get("LeftButton") -- Returns action based on modifiers ``` -------------------------------- ### Creating a Button Template Source: https://github.com/nanderson11/atlaslootenhanced/blob/master/AtlasLoot/Libs/Krowi_WorldMapButtons/README.md Defines the XML structure for the button, including layers, textures, and script bindings. ```xml