Skip to content

Commit

Permalink
v1.0.6
Browse files Browse the repository at this point in the history
- Bug fixes
- Tooltip will now automatically turn on description of whether the appearance vs source is uncollected
  • Loading branch information
Tyrsenus committed Dec 1, 2022
1 parent 4ac1b1c commit 19e02d3
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 24 deletions.
4 changes: 2 additions & 2 deletions WardrobeTools/WardrobeTools.toc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## Interface: 10002
## Interface: 100002
## Title: WardrobeTools
## Notes: A simple addon to streamline transmog/appearance collection.
## SavedVariables: WardrobeToolsADB
## SavedVariablesPerCharacter: WardrobeToolsCDB
## Version: 1.0.5
## Version: 1.0.6

## OptionalDeps: sUI
## X-SezzADB: WardrobeToolsADB
Expand Down
12 changes: 9 additions & 3 deletions WardrobeTools/wardrobe/appearance_collector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ local SetOverrideBindingClick, ClearOverrideBindings, SetOverrideBindingClick, C
-- WoW API/Constants
local SaveEquipmentSet, DeleteEquipmentSet, CreateEquipmentSet, UseEquipmentSet = C_EquipmentSet.SaveEquipmentSet, C_EquipmentSet.DeleteEquipmentSet, C_EquipmentSet.CreateEquipmentSet, C_EquipmentSet.UseEquipmentSet;
local GameTooltip_Hide = GameTooltip_Hide;
local LE_ITEM_CLASS_ARMOR = Enum.ItemClass.Armor;
local LE_ITEM_CLASS_WEAPON = Enum.ItemClass.Weapon;
local GetContainerNumSlots = C_Container.GetContainerNumSlots;
local GetContainerItemLink = C_Container.GetContainerItemLink;
local GetContainerItemID = C_Container.GetContainerItemID;

-----------------------------------------------------------------------------

Expand All @@ -41,13 +46,13 @@ local GetNextItem = function()

local bag, slot;
for bag = 0, 4 do
for slot = 1, C_Container.GetContainerNumSlots(bag) do
local link = C_Container.GetContainerItemLink(bag, slot);
for slot = 1, GetContainerNumSlots(bag) do
local link = GetContainerItemLink(bag, slot);

if (link and S.ItemIsValidTransmogrifySource(link) and not select(2, S.PlayerHasTransmog(link)) and S.IsBagItemTradable(bag, slot) and S.PlayerCanEquip(link)) then
local _, _, _, _, reqLevel, _, _, _, equipSlot, _, _, itemClassID = GetItemInfo(link);
if ((itemClassID == Enum.ItemClass.Armor or itemClassID == Enum.ItemClass.Weapon) and (not reqLevel or (reqLevel == 0 and equipSlot == "INVTYPE_BODY") or (reqLevel > 0 and reqLevel <= S.myLevel))) then

--tooltip:SetBagItem(bag, slot);
return bag, slot, equipSlot;
end
end
Expand All @@ -59,6 +64,7 @@ local ShowTooltip = function(self)
GameTooltip:SetOwner(self, "ANCHOR_TOP");

if (self.bag and self.slot) then
C_CVar.SetCVar("missingTransmogSourceInItemTooltips", "1")
GameTooltip:SetBagItem(self.bag, self.slot);
else
GameTooltip:AddLine("Close AppearanceCollector", 1, 1, 1);
Expand Down
39 changes: 20 additions & 19 deletions WardrobeTools/wardrobe/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ local PlayerCanEquip = function(itemLink)

-- Scan the tooltip for other restrictions.

--tooltip:SetHyperlink(itemLink);
tooltip:SetHyperlink(itemLink);

itemID = tonumber(itemLink:match("item:(%d+)"))
tooltipData = C_TooltipInfo.GetItemByID(itemID);
Expand Down Expand Up @@ -341,17 +341,22 @@ S.PlayerCanEquip = PlayerCanEquip;

local ITEM_SOULBOUND, ITEM_ACCOUNTBOUND, ITEM_BIND_TO_BNETACCOUNT, ITEM_BNETACCOUNTBOUND, ITEM_BIND_ON_PICKUP = ITEM_SOULBOUND, ITEM_ACCOUNTBOUND, ITEM_BIND_TO_BNETACCOUNT, ITEM_BNETACCOUNTBOUND, ITEM_BIND_ON_PICKUP;

local IsTooltipItemTradable = function(allowBoA)
for i = 1, 8 do
local text = _G["GameTooltipTextLeft"..i]:GetText();
local IsTooltipItemTradable = function(tooltipData, allowBoA)

if (not allowBoA and (text == ITEM_SOULBOUND or text == ITEM_BIND_ON_PICKUP or text == ITEM_ACCOUNTBOUND or text == ITEM_BIND_TO_BNETACCOUNT or text == ITEM_BNETACCOUNTBOUND)) then
return false;
elseif (allowBoA) then
if (text == ITEM_SOULBOUND or text == ITEM_BIND_ON_PICKUP) then
return false;
elseif (text == ITEM_ACCOUNTBOUND or text == ITEM_BIND_TO_BNETACCOUNT or text == ITEM_BNETACCOUNTBOUND) then
return true;
for i, line in ipairs(tooltipData.lines) do
TooltipUtil.SurfaceArgs(line);
for j, arg in ipairs(line.args) do
if arg.field == "leftText" or arg.field == "rightText" then
lineText = arg.stringVal;
if (not allowBoA and (lineText == ITEM_SOULBOUND or lineText == ITEM_BIND_ON_PICKUP or lineText == ITEM_ACCOUNTBOUND or lineText == ITEM_BIND_TO_BNETACCOUNT or lineText == ITEM_BNETACCOUNTBOUND)) then
return false;
elseif (allowBoA) then
if (lineText == ITEM_SOULBOUND or lineText == ITEM_BIND_ON_PICKUP) then
return false;
elseif (lineText == ITEM_ACCOUNTBOUND or lineText == ITEM_BIND_TO_BNETACCOUNT or lineText == ITEM_BNETACCOUNTBOUND) then
return true;
end
end
end
end
end
Expand All @@ -363,8 +368,9 @@ local IsBagItemTradable = function(bag, slot, allowBoA)
if (not bag or not slot) then
return false;
else
GameTooltip:SetBagItem(bag, slot);
return IsTooltipItemTradable(allowBoA);
--GameTooltip:SetBagItem(bag, slot);
tooltipData = C_TooltipInfo.GetBagItem(bag, slot);
return IsTooltipItemTradable(tooltipData, allowBoA);
end
end

Expand All @@ -378,9 +384,4 @@ local IsItemTradable = function(itemLink, allowBoA)
end

S.IsBagItemTradable = IsBagItemTradable;
S.IsItemTradable = IsItemTradable;





S.IsItemTradable = IsItemTradable;
4 changes: 4 additions & 0 deletions WardrobeTools/wardrobe/mailer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ local select, strlen, tinsert, tremove, strlower, next = select, string.len, tab
local GetItemClassInfo, GetItemSubClassInfo, GameTooltip_Hide, ClearCursor, ClickSendMailItemButton, SendMail, GetItemInfo = GetItemClassInfo, GetItemSubClassInfo, GameTooltip_Hide, ClearCursor, ClickSendMailItemButton, SendMail, GetItemInfo;
local INVTYPE_RANGED, INVTYPE_HOLDABLE = ATTACHMENTS_MAX_SEND;

local GetContainerNumSlots = C_Container.GetContainerNumSlots;
local GetContainerItemLink = C_Container.GetContainerItemLink;
local GetContainerItemID = C_Container.GetContainerItemID;
local PickupContainerItem = C_Container.PickupContainerItem;

-- Enum.ItemClass.Armor, Enum.ItemArmorSubclass.Cloth, Enum.ItemArmorSubclass.Leather, Enum.ItemArmorSubclass.Mail, Enum.ItemArmorSubclass.Plate, Enum.ItemClass.Weapon, Enum.ItemWeaponSubclass.Axe1H, Enum.ItemWeaponSubclass.Axe2H, Enum.ItemWeaponSubclass.Mace1H, Enum.ItemWeaponSubclass.Mace2H, Enum.ItemWeaponSubclass.Sword1H, Enum.ItemWeaponSubclass.Sword2H, Enum.ItemWeaponSubclass.Warglaive, Enum.ItemWeaponSubclass.Dagger, Enum.ItemWeaponSubclass.Unarmed, Enum.ItemWeaponSubclass.Polearm, Enum.ItemWeaponSubclass.Staff, Enum.ItemWeaponSubclass.Wand, Enum.ItemWeaponSubclass.Bows, Enum.ItemWeaponSubclass.Crossbow, Enum.ItemWeaponSubclass.Guns, Enum.ItemArmorSubclass.Shield, Enum.ItemArmorSubclass.Generic, INVTYPE_RANGED, INVTYPE_HOLDABLE = ATTACHMENTS_MAX_SEND, Enum.ItemClass.Armor, Enum.ItemArmorSubclass.Cloth, Enum.ItemArmorSubclass.Leather, Enum.ItemArmorSubclass.Mail, Enum.ItemArmorSubclass.Plate, Enum.ItemClass.Weapon, Enum.ItemWeaponSubclass.Axe1H, Enum.ItemWeaponSubclass.Axe2H, Enum.ItemWeaponSubclass.Mace1H, Enum.ItemWeaponSubclass.Mace2H, Enum.ItemWeaponSubclass.Sword1H, Enum.ItemWeaponSubclass.Sword2H, Enum.ItemWeaponSubclass.Warglaive, Enum.ItemWeaponSubclass.Dagger, Enum.ItemWeaponSubclass.Unarmed, Enum.ItemWeaponSubclass.Polearm, Enum.ItemWeaponSubclass.Staff, Enum.ItemWeaponSubclass.Wand, Enum.ItemWeaponSubclass.Bows, Enum.ItemWeaponSubclass.Crossbow, Enum.ItemWeaponSubclass.Guns, Enum.ItemArmorSubclass.Shield, Enum.ItemArmorSubclass.Generic,
-----------------------------------------------------------------------------
Expand Down

0 comments on commit 19e02d3

Please sign in to comment.