diff --git a/Modules/Blizzard/LootStyle.lua b/Modules/Blizzard/LootStyle.lua index d8a1f92..6a5970f 100644 --- a/Modules/Blizzard/LootStyle.lua +++ b/Modules/Blizzard/LootStyle.lua @@ -54,10 +54,35 @@ local function handleMessageFilter(events, filterFunc, shouldAdd) end end -local function simulateLootRoll() +local function simulateLootRoll(db) local itemID = 49623 - local name, itemLink, quality = GetItemInfo(itemID) - local db = E.db.Extras.blizzard[modName].LootBars + local name, itemLink, quality, name1, itemLink1, quality1, texture1, _, _, texture = GetItemInfo(itemID) + + if not quality then + for bagID = 0, NUM_BAG_SLOTS do + for slotID = 1, GetContainerNumSlots(bagID) do + itemID = GetContainerItemID(bagID, slotID) + if itemID then + name, itemLink, quality, _, _, _, _, _, _, texture = GetItemInfo(itemID) + if quality then + if quality > 1 then + break + else + name1, itemLink1, quality1, texture1 = name, itemLink, quality, texture + end + end + end + end + end + end + if not quality then + if quality1 then + name, itemLink, quality, texture = name1, itemLink1, quality1, texture1 + else + return + end + end + local FRAME_WIDTH, FRAME_HEIGHT = db.widthBar, db.heightBar testlootbar = testlootbar or CreateFrame("Frame", "extrastestlootbar", E.UIParent) @@ -84,7 +109,7 @@ local function simulateLootRoll() itemButton.icon = itemButton:CreateTexture(nil, "OVERLAY") itemButton.icon:SetAllPoints() itemButton.icon:SetTexCoord(unpack(E.TexCoords)) - itemButton.icon:SetTexture("Interface\\Icons\\INV_Axe_113") + itemButton.icon:SetTexture(texture) testlootbar.itemButton = itemButton @@ -460,7 +485,7 @@ function mod:LoadConfig(db) name = L["Loot Bars"], guiInline = true, get = function(info) return db.LootBars[info[#info]] end, - set = function(info, value) db.LootBars[info[#info]] = value simulateLootRoll() self:Toggle(db) end, + set = function(info, value) db.LootBars[info[#info]] = value simulateLootRoll(db.LootBars) self:Toggle(db) end, args = { enabled = { order = 1, diff --git a/Modules/General/Bags.lua b/Modules/General/Bags.lua index c48f03f..7be6fca 100644 --- a/Modules/General/Bags.lua +++ b/Modules/General/Bags.lua @@ -1633,39 +1633,41 @@ function mod:ConfigureContainer(f, isBank, db, numColumns, buttonSize, buttonSpa self:HandleSortButton(f, true, isBank, numColumns, buttonSize, buttonSpacing) if next(layoutSections) then - local cleanup = {} - for i, section in ipairs(sections) do - if section.isSpecialBag then - local bagID = section.bagID - if buttonMap[bagID] then - local numSlots, bagType = GetContainerNumFreeSlots(bagID) - if numSlots == 0 or (not bagType or bagType == 0) or (db.specialBags[bagID] and db.specialBags[bagID] ~= GetBagName(bagID)) then - buttonMap[bagID] = {} - db.specialBags[bagID] = false - tremove(sections, i) - tremove(layoutSections, i) - cleanup[bagID] = true + if not isBank or f:IsShown() then + local cleanup = {} + for i, section in ipairs(sections) do + if section.isSpecialBag then + local bagID = section.bagID + if buttonMap[bagID] then + local numSlots, bagType = GetContainerNumFreeSlots(bagID) + if numSlots == 0 or (not bagType or bagType == 0) or (db.specialBags[bagID] and db.specialBags[bagID] ~= GetBagName(bagID)) then + buttonMap[bagID] = {} + db.specialBags[bagID] = false + tremove(sections, i) + tremove(layoutSections, i) + cleanup[bagID] = true + end end end end - end - if next(cleanup) then - for _, section in ipairs(layoutSections) do - if section.isSpecialBag and cleanup[section.bagID] then - for _, button in ipairs(section.buttons) do - if button.highlight then - button.highlight:Hide() - button.highlight = nil + if next(cleanup) then + for _, section in ipairs(layoutSections) do + if section.isSpecialBag and cleanup[section.bagID] then + for _, button in ipairs(section.buttons) do + if button.highlight then + button.highlight:Hide() + button.highlight = nil + end + end + local frame = section.frame + if frame then + frame:Hide() + section.frame = nil end - end - local frame = section.frame - if frame then - frame:Hide() - section.frame = nil end end + if E.RefreshGUI then E:RefreshGUI() end end - if E.RefreshGUI then E:RefreshGUI() end end local currentRowColumns for i, section in ipairs(layoutSections) do diff --git a/Modules/Nameplates/Cooldowns.lua b/Modules/Nameplates/Cooldowns.lua index e9ff7fb..d37f947 100644 --- a/Modules/Nameplates/Cooldowns.lua +++ b/Modules/Nameplates/Cooldowns.lua @@ -1540,4 +1540,4 @@ function mod:InitializeCallback() mod:Toggle(db) end -core.modules[modName] = mod.InitializeCallback +core.modules[modName] = mod.InitializeCallback \ No newline at end of file diff --git a/Modules/Nameplates/StyleFilter.lua b/Modules/Nameplates/StyleFilter.lua index d9cd299..693b573 100644 --- a/Modules/Nameplates/StyleFilter.lua +++ b/Modules/Nameplates/StyleFilter.lua @@ -949,4 +949,4 @@ function mod:InitializeCallback() mod:Toggle(db) end -core.modules[modName] = mod.InitializeCallback +core.modules[modName] = mod.InitializeCallback \ No newline at end of file diff --git a/Modules/Unitframes/ColorFilter.lua b/Modules/Unitframes/ColorFilter.lua index d60f423..499bb5f 100644 --- a/Modules/Unitframes/ColorFilter.lua +++ b/Modules/Unitframes/ColorFilter.lua @@ -1841,4 +1841,4 @@ function mod:InitializeCallback() mod:Toggle(db) end -core.modules[modName] = mod.InitializeCallback +core.modules[modName] = mod.InitializeCallback \ No newline at end of file diff --git a/Modules/Unitframes/Cooldowns.lua b/Modules/Unitframes/Cooldowns.lua index 51b5128..4431e9e 100644 --- a/Modules/Unitframes/Cooldowns.lua +++ b/Modules/Unitframes/Cooldowns.lua @@ -73,7 +73,7 @@ local iconPositions = mod.iconPositions for frameType, number in pairs({['arena'] = 5, ['party'] = 5, ['raid'] = 40}) do for i = 1, number do - petList[frameType..i] = format("%s%s%s", frameType, i, 'pet') + petList[frameType..i] = format("%s%s%s", frameType, i, 'pet') end end @@ -1684,4 +1684,4 @@ function mod:InitializeCallback() mod:Toggle(db) end -core.modules[modName] = mod.InitializeCallback +core.modules[modName] = mod.InitializeCallback \ No newline at end of file