Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
noname08662 authored Jan 21, 2025
1 parent 4fc8079 commit 8ff09ca
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 36 deletions.
35 changes: 30 additions & 5 deletions Modules/Blizzard/LootStyle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down Expand Up @@ -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,
Expand Down
54 changes: 28 additions & 26 deletions Modules/General/Bags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Modules/Nameplates/Cooldowns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1540,4 +1540,4 @@ function mod:InitializeCallback()
mod:Toggle(db)
end

core.modules[modName] = mod.InitializeCallback
core.modules[modName] = mod.InitializeCallback
2 changes: 1 addition & 1 deletion Modules/Nameplates/StyleFilter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -949,4 +949,4 @@ function mod:InitializeCallback()
mod:Toggle(db)
end

core.modules[modName] = mod.InitializeCallback
core.modules[modName] = mod.InitializeCallback
2 changes: 1 addition & 1 deletion Modules/Unitframes/ColorFilter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1841,4 +1841,4 @@ function mod:InitializeCallback()
mod:Toggle(db)
end

core.modules[modName] = mod.InitializeCallback
core.modules[modName] = mod.InitializeCallback
4 changes: 2 additions & 2 deletions Modules/Unitframes/Cooldowns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -1684,4 +1684,4 @@ function mod:InitializeCallback()
mod:Toggle(db)
end

core.modules[modName] = mod.InitializeCallback
core.modules[modName] = mod.InitializeCallback

0 comments on commit 8ff09ca

Please sign in to comment.