Skip to content

Commit d144495

Browse files
authored
Merge pull request #1 from Tyrsenus/9.1-Update
9.1 update, added TradeSkillMaster filtering.
2 parents 36abee7 + 346fe88 commit d144495

File tree

6 files changed

+392
-108
lines changed

6 files changed

+392
-108
lines changed

WardrobeTools/WardrobeTools.toc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
## Interface: 80000
1+
## Interface: 90100
22
## Title: WardrobeTools
3-
## Notes: Quickly soulbind items for collecting their appearance and mail them to other characters
3+
## Notes: A simple addon to streamline transmog/appearance collection.
44
## SavedVariables: WardrobeToolsADB
55
## SavedVariablesPerCharacter: WardrobeToolsCDB
6-
## Version: 0.9.9
6+
## Version: 1.0.0
77

88
## OptionalDeps: sUI
99
## X-SezzADB: WardrobeToolsADB

WardrobeTools/wardrobe/accountwide_outfits.lua

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ addon.OnEnable = function(self)
5050

5151
if (not S.InGame) then
5252
self:RegisterEvent("PLAYER_LOGIN");
53-
else
54-
self:SyncOutfits();
53+
--else
54+
--self:SyncOutfits();
55+
--self:SyncOutfits();
5556
end
5657
end
5758

@@ -73,16 +74,18 @@ addon.SyncOutfits = function(self)
7374

7475
-- fetch outfits from server
7576
local serverOutfits = {};
76-
for _, outfit in pairs(GetOutfits()) do
77-
local appearanceSources, mainHandEnchant, offHandEnchant = GetOutfitSources(outfit.outfitID);
77+
for _, outfit in ipairs(C_TransmogCollection.GetOutfits()) do
7878

79+
local appearanceSources, mainHandEnchant, offHandEnchant = C_TransmogCollection.GetOutfitSources(outfit);
80+
7981
serverOutfits[outfit.name] = {
8082
id = outfit.outfitID,
8183
icon = outfit.icon,
8284
appearanceSources = appearanceSources,
8385
mainHandEnchant = mainHandEnchant,
8486
offHandEnchant = offHandEnchant,
8587
};
88+
8689
end
8790

8891
-- compare outfits
@@ -167,7 +170,7 @@ addon.SyncOutfits = function(self)
167170
end
168171

169172
addon.PLAYER_LOGIN = function(self, event)
170-
self:SyncOutfits();
173+
--self:SyncOutfits();
171174
self:UnregisterEvent(event);
172175
end
173176

@@ -196,29 +199,29 @@ hooksecurefunc(C_TransmogCollection, "DeleteOutfit", function(outfitID)
196199
end
197200
end);
198201

199-
hooksecurefunc(C_TransmogCollection, "SaveOutfit", function(name, appearanceSources, mainHandEnchant, offHandEnchant, icon)
200-
-- We cannot use the passed arguments because they are different to C_TransmogCollection.GetOutfitSources() return values
201-
if (not addon.enabledState or syncing) then return; end
202-
203-
local found = false;
204-
for _, outfit in pairs(GetOutfits()) do
205-
if (outfit.name == name) then
206-
found = true;
207-
208-
local appearanceSources, mainHandEnchant, offHandEnchant = GetOutfitSources(outfit.outfitID);
209-
addon.outfits[name] = {
210-
id = outfit.outfitID,
211-
appearanceSources = appearanceSources,
212-
mainHandEnchant = mainHandEnchant,
213-
offHandEnchant = offHandEnchant,
214-
icon = icon,
215-
modifiedBy = myCharacter,
216-
};
217-
break;
218-
end
219-
end
220-
221-
if (not found) then
222-
addon:PrintError(strformat("Recently saved outfit %s not found on server!", name));
223-
end
224-
end);
202+
-- hooksecurefunc(C_TransmogCollection, "SaveOutfit", function(name, appearanceSources, mainHandEnchant, offHandEnchant, icon)
203+
-- -- We cannot use the passed arguments because they are different to C_TransmogCollection.GetOutfitSources() return values
204+
-- if (not addon.enabledState or syncing) then return; end
205+
206+
-- local found = false;
207+
-- for _, outfit in pairs(GetOutfits()) do
208+
-- if (outfit.name == name) then
209+
-- found = true;
210+
211+
-- local appearanceSources, mainHandEnchant, offHandEnchant = GetOutfitSources(outfit.outfitID);
212+
-- addon.outfits[name] = {
213+
-- id = outfit.outfitID,
214+
-- appearanceSources = appearanceSources,
215+
-- mainHandEnchant = mainHandEnchant,
216+
-- offHandEnchant = offHandEnchant,
217+
-- icon = icon,
218+
-- modifiedBy = myCharacter,
219+
-- };
220+
-- break;
221+
-- end
222+
-- end
223+
224+
-- if (not found) then
225+
-- addon:PrintError(strformat("Recently saved outfit %s not found on server!", name));
226+
-- end
227+
-- end);

WardrobeTools/wardrobe/appearance_collector.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,10 @@ addon.OnDisable = function(self)
277277
DeleteAppearanceCollectorEquipmentSet();
278278
end
279279

280-
addon.BindMouseWheel = function(self)
281-
SetOverrideBindingClick(self, true, "MOUSEWHEELUP", self:GetName());
282-
SetOverrideBindingClick(self, true, "MOUSEWHEELDOWN", self:GetName());
280+
addon.BindMouseWheel = function(self)
281+
--SetOverrideBindingClick(self, true, "MOUSEWHEELUP", self:GetName());
282+
--SetOverrideBindingClick(self, true, "MOUSEWHEELDOWN", self:GetName());
283+
return;
283284
end
284285

285286
addon.UnbindMouseWheel = function(self)

WardrobeTools/wardrobe/core.lua

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
4040
Returns values:
4141
isTradable (boolean)
42+
4243
4344
--]]
4445

@@ -125,6 +126,7 @@ local PlayerHasApperanceSource = function(item)
125126
return false;
126127
end
127128

129+
128130
local PlayerHasTransmog = function(item, checkSource, forceRefresh)
129131
if (not item or (checkSource and not S.ItemIsValidTransmogrifySource(item))) then return; end
130132
model:SetUnit("player");
@@ -146,9 +148,25 @@ local PlayerHasTransmog = function(item, checkSource, forceRefresh)
146148
local itemID = type(item) == "string" and tonumber(strmatch(item, "item:(%d+)")) or item;
147149
isCollected = C_TransmogCollection.PlayerHasTransmog(itemID);
148150
else
149-
model:TryOn(item);
150-
151-
local appearanceSourceID = model:GetSlotTransmogSources(equipSlotIDs[equipSlot]);
151+
model:TryOn(item,slot);
152+
153+
--local appearanceSourceID = model:GetSlotTransmogSources(equipSlotIDs[equipSlot]);
154+
155+
-- Credit to TorelTwiddler (CanIMogIt)
156+
157+
local transmogInfo = model:GetItemTransmogInfo(equipSlotIDs[equipSlot]);
158+
if transmogInfo and
159+
transmogInfo.appearanceID ~= nil and
160+
transmogInfo.appearanceID ~= 0 then
161+
-- Yes, that's right, we are setting `appearanceID` to the `sourceID`. Blizzard messed
162+
-- up the DressUpModel functions, so _they_ don't even know what they do anymore.
163+
-- The `appearanceID` field from `DressUpModel:GetItemTransmogInfo` is actually its
164+
-- source ID, not it's appearance ID.
165+
appearanceSourceID = transmogInfo.appearanceID
166+
end
167+
168+
--
169+
152170
if (appearanceSourceID == 0 and (equipSlotIDs[equipSlot] == 16 or equipSlotIDs[equipSlot] == 17)) then
153171
-- Even though the model is undressed it sometimes puts weapons into the offhand slot instead of the mainhand slot,
154172
-- especially when equipping 2 similar items (like two Baleful weapons with different attributes)
@@ -219,6 +237,7 @@ local PlayerHasTransmog = function(item, checkSource, forceRefresh)
219237
return isCollected, isCollectedSource;
220238
end
221239

240+
222241
S.PlayerHasTransmog = PlayerHasTransmog;
223242

224243
-----------------------------------------------------------------------------
@@ -231,7 +250,11 @@ local ItemIsValidTransmogrifySource = function(itemLink)
231250
if (itemClassID == LE_ITEM_CLASS_ARMOR and itemSubClassID == LE_ITEM_ARMOR_COSMETIC) then return true; end -- C_Transmog.GetItemInfo() doesn't like cosmetic armor
232251

233252
local isDressable = IsDressableItem(itemID);
234-
local _, _, canBeSource, noSourceReason = C_Transmog.GetItemInfo(itemID);
253+
-- message(itemID)
254+
255+
-- local _, _, canBeSource, noSourceReason = C_Transmog.GetItemInfo(itemID);
256+
local _, _, canBeSource, noSourceReason = select(1, C_Transmog.CanTransmogItem(itemID))
257+
235258
if (not isDressable or not canBeSource) then return false, noSourceReason; end
236259

237260
if (equipSlot == "INVTYPE_NECK" or equipSlot == "INVTYPE_FINGER" or equipSlot == "INVTYPE_TRINKET") then return false; end

0 commit comments

Comments
 (0)