From e10dcfca1bd26a9565c5516fff486cf89a92ef19 Mon Sep 17 00:00:00 2001 From: andrew6180 <16847730+andrew6180@users.noreply.github.com> Date: Wed, 9 Aug 2023 15:06:48 -0700 Subject: [PATCH] Remove enchant search, fix lua error with elvui --- Bagnon/Bagnon.toc | 2 +- Bagnon/components/item.lua | 56 +++++++--------------------- Bagnon_GuildBank/components/item.lua | 16 -------- 3 files changed, 14 insertions(+), 60 deletions(-) diff --git a/Bagnon/Bagnon.toc b/Bagnon/Bagnon.toc index fdc55bf..bd3d9b0 100644 --- a/Bagnon/Bagnon.toc +++ b/Bagnon/Bagnon.toc @@ -4,7 +4,7 @@ ## Notes: Single window displays for your inventory, bank, and keys ## SavedVariables: BagnonGlobalSettings ## SavedVariablesPerCharacter: BagnonFrameSettings -## Version: 2.13.3 +## Version: 2.13.4 ## OptionalDeps: Ace3, Bagnon_Armory, LibItemSearch embeds.xml localization.xml diff --git a/Bagnon/components/item.lua b/Bagnon/components/item.lua index 559f2a5..e5c8324 100644 --- a/Bagnon/components/item.lua +++ b/Bagnon/components/item.lua @@ -294,38 +294,24 @@ end --item slot color function ItemSlot:UpdateSlotColor() + local normalTexture = self:GetNormalTexture() -- elvui nukes this function (in a bad way) + local r, g, b = 1, 1, 1 if (not self:GetItem()) and self:ColoringBagSlots() then if self:IsKeyRingSlot() then - local r, g, b = self:GetKeyringSlotColor() - SetItemButtonTextureVertexColor(self, r, g, b) - self:GetNormalTexture():SetVertexColor(r, g, b) - return - end - - if self:IsAmmoBagSlot() then - local r, g, b = self:GetAmmoSlotColor() - SetItemButtonTextureVertexColor(self, r, g, b) - self:GetNormalTexture():SetVertexColor(r, g, b) - return - end - - if self:IsTradeBagSlot() then - local r, g, b = self:GetTradeSlotColor() - SetItemButtonTextureVertexColor(self, r, g, b) - self:GetNormalTexture():SetVertexColor(r, g, b) - return - end - - if self:IsShardBagSlot() then - local r, g, b = self:GetShardSlotColor() - SetItemButtonTextureVertexColor(self, r, g, b) - self:GetNormalTexture():SetVertexColor(r, g, b) - return + r, g, b = self:GetKeyringSlotColor() + elseif self:IsAmmoBagSlot() then + r, g, b = self:GetAmmoSlotColor() + elseif self:IsTradeBagSlot() then + r, g, b = self:GetTradeSlotColor() + elseif self:IsShardBagSlot() then + r, g, b = self:GetShardSlotColor() end end - SetItemButtonTextureVertexColor(self, 1, 1, 1) - self:GetNormalTexture():SetVertexColor(1, 1, 1) + SetItemButtonTextureVertexColor(self, r, g, b) + if normalTexture then + normalTexture:SetVertexColor(r, g, b) + end end --item count @@ -343,20 +329,7 @@ function ItemSlot:SetLocked(locked) SetItemButtonDesaturated(self, locked) end -function ItemSlot:UpdateMEName() - local itemLink = self:GetItem() - if itemLink then - self.MEName = strlower(GetREData(GetREInSlot(self:GetBag(), self:GetID()))['spellName']) - return - end -end - function ItemSlot:UpdateLocked() - if self:IsLocked() then - self.MEName = "" - else - self:UpdateMEName() - end self:SetLocked(self:IsLocked()) end @@ -469,9 +442,6 @@ function ItemSlot:UpdateSearch() if search and search ~= '' then local itemLink = self:GetItem() shouldFade = not (itemLink and (ItemSearch:Find(itemLink, search))) - if self.MEName and string.find(self.MEName, string.lower(search)) then - shouldFade = false - end end if shouldFade then diff --git a/Bagnon_GuildBank/components/item.lua b/Bagnon_GuildBank/components/item.lua index 2c07f1b..b93c556 100644 --- a/Bagnon_GuildBank/components/item.lua +++ b/Bagnon_GuildBank/components/item.lua @@ -260,20 +260,7 @@ function ItemSlot:SetLocked(locked) SetItemButtonDesaturated(self, locked, 0.5, 0.5, 0.5) end -function ItemSlot:UpdateMEName() - local itemLink = self:GetItem() - if itemLink then - self.MEName = strlower(GetREData(GetGuildBankItemMysticEnchant(self:GetSlot()))['spellName']) - return - end -end - function ItemSlot:UpdateLocked() - if self:IsLocked() then - self.MEName = "" - else - self:UpdateMEName() - end self:SetLocked(self:IsLocked()) end @@ -357,9 +344,6 @@ function ItemSlot:UpdateSearch() if search and search ~= '' then local itemLink = self:GetItem() shouldFade = not (itemLink and ItemSearch:Find(itemLink, search)) - if self.MEName and string.find(self.MEName, string.lower(search)) then - shouldFade = false - end end if shouldFade then