diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2b0745fa..a6c0f57c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,4 +41,8 @@ jobs: - name: Package and release TBC uses: BigWigsMods/packager@v2.0.8 with: - args: -g bcc \ No newline at end of file + args: -g bcc + - name: Package and release Wrath + uses: BigWigsMods/packager@v2.0.8 + with: + args: -g wrath \ No newline at end of file diff --git a/AdiBags.toc b/AdiBags.toc index 1f81ddc7..bb8f6077 100644 --- a/AdiBags.toc +++ b/AdiBags.toc @@ -21,6 +21,7 @@ ## Interface-Retail: 90207 ## Interface-Classic: 11403 ## Interface-BCC: 20504 +## Interface-Wrath: 30400 ## Title: AdiBags ## Notes: Adirelle's bag addon. diff --git a/AdiBags_Config/AdiBags_Config.toc b/AdiBags_Config/AdiBags_Config.toc index ff5ee4cb..11896d37 100644 --- a/AdiBags_Config/AdiBags_Config.toc +++ b/AdiBags_Config/AdiBags_Config.toc @@ -2,6 +2,7 @@ ## Interface-Retail: 90207 ## Interface-Classic: 11403 ## Interface-BCC: 20504 +## Interface-Wrath: 30400 ## Title: AdiBags Configuration ## Notes: Adirelle's bag addon. diff --git a/core/Constants.lua b/core/Constants.lua index 984a50c9..c54cb3e4 100644 --- a/core/Constants.lua +++ b/core/Constants.lua @@ -26,7 +26,7 @@ local L = addon.L addon.isRetail = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE addon.isClassic = WOW_PROJECT_ID == WOW_PROJECT_CLASSIC addon.isBCC = WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC and LE_EXPANSION_LEVEL_CURRENT == LE_EXPANSION_BURNING_CRUSADE -addon.isWOTLK = WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC and LE_EXPANSION_LEVEL_CURRENT == LE_EXPANSION_NORTHREND +addon.isWrath = WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC and LE_EXPANSION_LEVEL_CURRENT == LE_EXPANSION_NORTHREND -- cell map. + wipe(self.currencyToCell) + + -- Clear all cells and columns completely. + for i, column in ipairs(self.columns) do + for ii, cell in ipairs(column.cells) do + cell.fs:SetText("") + cell.text = "" + cell.name = "" + cell.icon = "" + addon.RemoveTooltip(cell.frame) + end + column.frame:SetSize(0,0) + end + + -- Get all the currency information from the player and store it. local shown, hideZeroes = self.db.profile.shown, self.db.profile.hideZeroes for i, currencyListInfo in IterateCurrencies() do if shown[currencyListInfo.name] and (currencyListInfo.quantity > 0 or not hideZeroes) then - tinsert(values, BreakUpLargeNumbers(currencyListInfo.quantity)) - tinsert(values, format(ICON_STRING, currencyListInfo.iconFileID)) + tinsert(values, { + quantity = BreakUpLargeNumbers(currencyListInfo.quantity), + icon = format(ICON_STRING, currencyListInfo.iconFileID), + name = currencyListInfo.name + }) end end local widget, fs = self.widget, self.fontstring + -- Set the cell values. if #values > 0 then - fs:SetText(tconcat(values, "")) - widget:Show() - widget:SetSize( - fs:GetStringWidth(), - ceil(fs:GetStringHeight()) + 3 - ) + for i, value in ipairs(values) do + local columnPosition = ((i-1) % self.db.profile.width)+1 + local rowPosition = ceil(i / self.db.profile.width) + local column = self.columns[columnPosition] + local cell = column.cells[rowPosition] + cell.icon = value.icon + cell.name = value.name + cell.text = value.icon .. value.quantity + cell.fs:SetText(cell.text) + cell.frame:SetSize( + cell.fs:GetStringWidth(), + ceil(cell.fs:GetStringHeight())+3 + ) + -- Set the cell's tooltip. + addon.SetupTooltip(cell.frame, cell.name, "ANCHOR_BOTTOMLEFT") + + -- Resize the columns as needed. + if column.frame:GetWidth() < cell.frame:GetWidth() then + column.frame:SetWidth(cell.frame:GetWidth()) + end + column.frame:SetHeight(column.frame:GetHeight() + cell.frame:GetHeight()) + self.currencyToCell[value.name] = cell + end + + -- Loop over every active column and get the total width + -- of all columns for the parent widget. + local totalWidth = 0 + for i = 1, self.db.profile.width do + totalWidth = totalWidth + self.columns[i].frame:GetWidth() + end + + -- The first column will always be the longest column, so get the height + -- of the first column and set the parent widget to this size. + widget:SetSize(totalWidth, self.columns[1].frame:GetHeight()) wipe(values) else widget:Hide() end - + widget:Show() updating = false end @@ -206,6 +308,21 @@ function mod:GetOptions() type = 'toggle', order = 20, }, - text = addon:CreateFontOptions(self.font, nil, 30) + text = addon:CreateFontOptions(self.font, nil, 30), + layout = { + name = L['Layout'], + type = 'group', + order = 100, + inline = true, + args = { + width = { + name = L['Currencies per row'], + type = 'range', + min = 3, + max = 10, + step = 1 + } + } + }, }, addon:GetOptionHandler(self, false, function() return self:Update() end) end diff --git a/modules/FilterOverride.lua b/modules/FilterOverride.lua index 25b90564..9be2735a 100644 --- a/modules/FilterOverride.lua +++ b/modules/FilterOverride.lua @@ -115,10 +115,10 @@ end function mod:OnEnable() self:UpdateOptions() - self:RegisterEvent('CURSOR_UPDATE') + self:RegisterEvent('CURSOR_CHANGED') addon.RegisterSectionHeaderScript(self, 'OnTooltipUpdate', 'OnTooltipUpdateSectionHeader') addon.RegisterSectionHeaderScript(self, 'OnClick', 'OnClickSectionHeader') - self:CURSOR_UPDATE() + self:CURSOR_CHANGED() end function mod:OnDisable() @@ -480,7 +480,7 @@ end function mod:OnTooltipUpdateSectionHeader(_, header, tooltip) if GetCursorInfo() == "item" then if header.section.name ~= FREE_SPACE then - tooltip:AddLine(L["Drop your item there to add it to this section."]) + tooltip:AddLine(L["Click here with your item to add it to this section."]) tooltip:AddLine(L["Press Alt while doing so to open a dropdown menu."]) end elseif header.section:GetKey() ~= JUNK_KEY then @@ -521,7 +521,7 @@ function mod:OnReceiveDragSectionHeader(_, header) end end -function mod:CURSOR_UPDATE() +function mod:CURSOR_CHANGED() if GetCursorInfo() == "item" then addon.RegisterSectionHeaderScript(self, 'OnReceiveDrag', 'OnReceiveDragSectionHeader') else diff --git a/modules/ItemLevel.lua b/modules/ItemLevel.lua index 4ed9bfae..23d60a5b 100644 --- a/modules/ItemLevel.lua +++ b/modules/ItemLevel.lua @@ -26,8 +26,17 @@ local L = addon.L local _G = _G local abs = _G.math.abs local GetItemInfo = _G.GetItemInfo -local ITEM_QUALITY_HEIRLOOM = _G.Enum.ItemQuality.Heirloom -local ITEM_QUALITY_POOR = _G.Enum.ItemQuality.Poor +local ITEM_QUALITY_HEIRLOOM +local ITEM_QUALITY_POOR + +if addon.isRetail then + ITEM_QUALITY_HEIRLOOM = _G.Enum.ItemQuality.Heirloom + ITEM_QUALITY_POOR = _G.Enum.ItemQuality.Poor +else + ITEM_QUALITY_HEIRLOOM = _G.LE_ITEM_QUALITY_HEIRLOOM + ITEM_QUALITY_POOR = _G.LE_ITEM_QUALITY_POOR +end + local QuestDifficultyColors = _G.QuestDifficultyColors local UnitLevel = _G.UnitLevel local modf = _G.math.modf diff --git a/modules/NewItemTracking.lua b/modules/NewItemTracking.lua index 65693c51..6fa5cf7a 100644 --- a/modules/NewItemTracking.lua +++ b/modules/NewItemTracking.lua @@ -30,7 +30,15 @@ local GetContainerItemInfo = _G.GetContainerItemInfo local GetContainerNumSlots = _G.GetContainerNumSlots local GetInventoryItemID = _G.GetInventoryItemID local GetInventoryItemLink = _G.GetInventoryItemLink -local ITEM_QUALITY_POOR = _G.Enum.ItemQuality.Poor + +local ITEM_QUALITY_POOR + +if addon.isRetail then + ITEM_QUALITY_POOR = _G.Enum.ItemQuality.Poor +else + ITEM_QUALITY_POOR = _G.LE_ITEM_QUALITY_POOR +end + local next = _G.next local pairs = _G.pairs local PlaySound = _G.PlaySound diff --git a/widgets/ContainerFrame.lua b/widgets/ContainerFrame.lua index 1c317373..dbbf7276 100644 --- a/widgets/ContainerFrame.lua +++ b/widgets/ContainerFrame.lua @@ -647,6 +647,7 @@ function containerProto:UpdateContent(bag) local prevSlotId = slotData.slotId local prevLink = slotData.link local prevTexture = slotData.texture + local prevEquipSlot = slotData.equipSlot -- If links only differ in character level that's the same item local sameItem = addon.IsSameLinkButLevel(slotData.link, link) @@ -655,13 +656,12 @@ function containerProto:UpdateContent(bag) slotData.itemId = itemId slotData.name, slotData.quality, slotData.iLevel, slotData.reqLevel, slotData.class, slotData.subclass, slotData.equipSlot, slotData.texture, slotData.vendorPrice = name, quality, iLevel, reqLevel, class, subclass, equipSlot, texture, vendorPrice slotData.maxStack = maxStack or (link and 1 or 0) - if sameItem then -- Items that are the same item but have mutated are marked as "new" to make them more visble. -- However, only things with a new texture are marked as new, i.e. wrapped items. - if prevTexture ~= texture then + if prevTexture ~= texture and equipSlot ~= prevEquipSlot then sameChanged[slotData.slotId] = slotData - addon:SendMessage('AdiBags_AddNewItem', slotData.link) + addon:SendMessage('AdiBags_AddNewItem', slotData.link) else changed[slotData.slotId] = slotData end diff --git a/widgets/ItemButton.lua b/widgets/ItemButton.lua index 007bb9b8..71c1cba8 100644 --- a/widgets/ItemButton.lua +++ b/widgets/ItemButton.lua @@ -37,8 +37,17 @@ local GetItemQualityColor = _G.GetItemQualityColor local hooksecurefunc = _G.hooksecurefunc local IsContainerItemAnUpgrade = _G.IsContainerItemAnUpgrade local IsInventoryItemLocked = _G.IsInventoryItemLocked -local ITEM_QUALITY_COMMON = _G.Enum.ItemQuality.Common -local ITEM_QUALITY_POOR = _G.Enum.ItemQuality.Poor +local ITEM_QUALITY_COMMON +local ITEM_QUALITY_POOR + +if addon.isRetail then + ITEM_QUALITY_COMMON = _G.Enum.ItemQuality.Common + ITEM_QUALITY_POOR = _G.Enum.ItemQuality.Poor +else + ITEM_QUALITY_COMMON = _G.LE_ITEM_QUALITY_COMMON + ITEM_QUALITY_POOR = _G.LE_ITEM_QUALITY_POOR +end + local next = _G.next local pairs = _G.pairs local select = _G.select