Skip to content

Commit

Permalink
2.1.67-Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldpaw committed Nov 1, 2023
1 parent 552bae3 commit a33befc
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Bagnon_ItemInfo/Defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ local optionDB = {
local addonName = string.gsub(Addon, "_", " ")

AceConfigRegistry:RegisterOptionsTable(addonName, optionDB)
AceConfigDialog:SetDefaultSize(addonName, 400, 300)
AceConfigDialog:SetDefaultSize(addonName, 404, 306)

SLASH_BAGNON_ITEMLEVEL1 = "/bif"
SlashCmdList["BAGNON_ITEMLEVEL"] = function(msg)
Expand Down
14 changes: 9 additions & 5 deletions Bagnon_ItemInfo/Modules/Garbage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,19 @@ local Addon, Private = ...
local Module = Bagnon:NewModule("Bagnon_Garbage")
local cache = {}

-- WoW API
local SetItemButtonDesaturated = SetItemButtonDesaturated

Private.cache[Module] = cache
Private.AddUpdater(Module, function(self)

if (self.hasItem and BagnonItemInfo_DB.enableGarbage and self.info.quality == 0 and not(self.locked or self.info.isLocked)) then
local db = BagnonItemInfo_DB

if (self.hasItem and db.enableGarbage and self.info.quality == 0 and not(self.locked or self.info.isLocked)) then

local overlay = cache[self]

if (BagnonItemInfo_DB.garbageOverlay) then
if (db.garbageOverlay) then
if (not overlay) then
overlay = self:CreateTexture()
overlay.icon = self.icon or _G[self:GetName().."IconTexture"]
Expand All @@ -44,15 +49,15 @@ Private.AddUpdater(Module, function(self)
overlay:SetColorTexture(.04, .013333333, .004705882, .6)
cache[self] = overlay
end
overlay:SetAlpha(.35 + .65*BagnonItemInfo_DB.garbageOverlayAlpha)
overlay:SetAlpha(.35 + .65*db.garbageOverlayAlpha)
overlay:Show()
else
if (overlay) then
overlay:Hide()
end
end

if (BagnonItemInfo_DB.garbageDesaturation) then
if (db.garbageDesaturation) then
SetItemButtonDesaturated(self, true)
else
SetItemButtonDesaturated(self, (self.locked or self.info.isLocked))
Expand Down Expand Up @@ -84,7 +89,6 @@ if (groupMethod) then
slot = bag and bag[slot]
if (slot) then
Private.updatesByModule[Module](slot)
--slot:UpdateLocked()
end
end
end
Expand Down
15 changes: 10 additions & 5 deletions Bagnon_ItemInfo/Modules/ItemBind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ local Addon, Private = ...
local Module = Bagnon:NewModule("Bagnon_BoE")
local cache = {}

-- Speed!
-- Lua API
local _G = _G
local ipairs = ipairs
local string_find = string.find

-- WoW API
local C_Container, C_TooltipInfo, TooltipUtil = C_Container, C_TooltipInfo, TooltipUtil
local CreateFrame, GetItemInfo, GetItemQualityColor = CreateFrame, GetItemInfo, GetItemQualityColor

-- Addon cache
local retail = Private.IsRetail
local wrath = Private.IsWrath
Expand Down Expand Up @@ -76,9 +80,10 @@ end
Private.cache[Module] = cache
Private.AddUpdater(Module, function(self)

local db = BagnonItemInfo_DB
local message, color, mult, _

if (self.hasItem and BagnonItemInfo_DB.enableItemBind) then
if (self.hasItem and db.enableItemBind) then

local quality, bind = self.info.quality, self.info.bind
if (not bind) then
Expand Down Expand Up @@ -156,9 +161,9 @@ Private.AddUpdater(Module, function(self)

message = bind == 3 and L["BoU"] or L["BoE"]

if (BagnonItemInfo_DB.enableRarityColoring) then
color = quality and colors[quality]
mult = (quality ~= 3 and quality ~= 4) and .7
if (db.enableRarityColoring) then
color = quality and colors[quality > 0 and quality or 1]
mult = (quality ~= 3 and quality ~= 4 and quality ~= 0 and quality ~= 1) and .7
end
end

Expand Down
16 changes: 11 additions & 5 deletions Bagnon_ItemInfo/Modules/ItemLevel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@ local Container = LibStub("C_Everywhere").Container

local cache = {}

-- Speed!
-- Lua API
local _G = _G
local ipairs = ipairs
local string_gsub = string.gsub
local string_match = string.match
local tonumber = tonumber

-- WoW API
local C_TooltipInfo, TooltipUtil = C_TooltipInfo, TooltipUtil
local CreateFrame, GetItemInfoInstant, GetItemQualityColor = CreateFrame, GetItemInfoInstant, GetItemQualityColor

local retail = Private.IsRetail
local tooltip = Private.tooltip
local tooltipName = Private.tooltipName
Expand All @@ -46,8 +51,8 @@ local battlepetclass = Enum.ItemClass.Battlepet
local font_object = NumberFont_Outline_Med or NumberFontNormal

-- Search patterns
local s_item_level = "^" .. string.gsub(ITEM_LEVEL, "%%d", "(%%d+)")
local s_num_slots = "^" .. (string.gsub(string.gsub(CONTAINER_SLOTS, "%%([%d%$]-)d", "(%%d+)"), "%%([%d%$]-)s", "%.+"))
local s_item_level = "^" .. string_gsub(ITEM_LEVEL, "%%d", "(%%d+)")
local s_num_slots = "^" .. (string_gsub(string_gsub(CONTAINER_SLOTS, "%%([%d%$]-)d", "(%%d+)"), "%%([%d%$]-)s", "%.+"))

-- Custom color cache
-- Allows us control, gives us speed.
Expand All @@ -72,9 +77,10 @@ end
Private.cache[Module] = cache
Private.AddUpdater(Module, function(self)

local db = BagnonItemInfo_DB
local message, color, _

if (self.hasItem and BagnonItemInfo_DB.enableItemLevel) then
if (self.hasItem and db.enableItemLevel) then

-- https://wowpedia.fandom.com/wiki/Enum.InventoryType
local class, equip, level, quality = self.info.class, self.info.equip, self.info.level, self.info.quality
Expand All @@ -88,7 +94,7 @@ Private.AddUpdater(Module, function(self)

-- We only want quality coloring on item- and pet levels, not bag slots.
if (isgear or ispet) then
if (BagnonItemInfo_DB.enableRarityColoring) then
if (db.enableRarityColoring) then
color = quality and colors[quality]
end
-- Update the bagnon cache
Expand Down
2 changes: 1 addition & 1 deletion Bagnon_ItemInfo/Modules/Uncollected.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ local Addon, Private = ...
local Module = Bagnon:NewModule("Bagnon_Uncollected")
local cache = {}

-- Speed!
-- Lua API
local _G = _G
local string_find = string.find

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [2.1.67-Release] 2023-11-01
### Changed
- Some minor performance tweaks. Everything matters!
- Made the BoE/BoU labels brighter for poor and common quality items.

## [2.1.66-Release] 2023-10-26
### Fixed
- All item qualities including poor and common will now display the BoE label when appropriate in Retail.
Expand Down

0 comments on commit a33befc

Please sign in to comment.