Clicking outfits do not apply the appaearances if Extended saved set (v3.1.1) (v3.2)
Ketrel opened this issue ยท 8 comments
In 3.1.1 all sets are listed, but when trying to click one from the saved sets (transmog vendor ui), clicking the Extended Saved Sets has no effects, but clicking the normal Saved Sets applies the appearances as expected.
The symptom is the same with clicking from the graphical list and selecting from the drop down.
No Lua error is produced.
I'm not sure of the solution but it looks like the issue is lines 6950-6959 in Wardrobe.lua
----Contains new data tables
if outfit.itemTransmogInfoList then
local ItemTransmogInfoList = {}
local actor = WardrobeTransmogFrame.ModelScene:GetPlayerActor();
for i = 1, 19 do
local info = outfit.itemTransmogInfoList[i]
local itemTransmogInfo = ItemUtil.CreateItemTransmogInfo(info.appearanceID, info.secondaryAppearanceID, info.illusionID);
actor:SetItemTransmogInfo(itemTransmogInfo, slotID, false);
end
end
It looks like the outfit object at this point does not have a itemTransmogInfoList
key, so this doesn't happen at all.
Adding the following else block seems to take care of it, though I don't know if it's the most elegant solution
else
local ItemTransmogInfoList = {}
local actor = WardrobeTransmogFrame.ModelScene:GetPlayerActor();
local info = {}
for i = 1, 19 do
if outfit[i] ~= nil then
info.slotName = addon.Globals.INVENTORY_SLOT_NAMES[i];
info.appearanceID = outfit[i]
info.secondaryAppearanceID = Constants.Transmog.NoTransmogID
info.illusionID = Constants.Transmog.NoTransmogID
if i == 16 then
info.secondaryAppearanceID = Constants.Transmog.NoTransmogID
info.illusionID = outfit.mainHandEnchant
elseif i == 17 then
info.secondaryAppearanceID = Constants.Transmog.NoTransmogID
info.illusionID = outfit.offHandEnchant
end
local itemTransmogInfo = ItemUtil.CreateItemTransmogInfo(info.appearanceID, info.secondaryAppearanceID, info.illusionID);
actor:SetItemTransmogInfo(itemTransmogInfo, i, false);
if info.slotName ~= nil then
--print(info.slotName)
local tmLoc = TransmogUtil.CreateTransmogLocation(info.slotName, Enum.TransmogType.Appearance, Enum.TransmogModification.None)
local tmPend = TransmogUtil.CreateTransmogPendingInfo(Enum.TransmogPendingType.Apply, info.appearanceID)
C_Transmog.SetPending(tmLoc, tmPend)
end
end
end
end
That elseblock gets it mostly functional from what I can tell. I don't think it's necessarily the best way to handle it, but I lua is not my strongpoint and wow's api documentation...well
This doesn't seem to work as well as I hoped.
The initial issue is still present in 3.2
I may have an idea of how this can be fixed. I'm looking on if I could do it.
There's two current problems.
- Extended outfits saved prior to 3.0 do not have corresponding values for: itemTransmogInfoList so that section never executes
- For newly saved ones, the block while setting the appearance, doesn't also do: SetPending
Issue 1 is the one I'm trying to do a work around. I'm looking at where the data is loaded, and I'm thinking the best option may be to generate a generic set of values for the existing data if none exists. I'm looking into this one.
Issue 2 is pretty easily solvable, I'm pretty sure I already found a fix for that.
I can't make any promises on this one, but if I get it working, I'll submit a pull request with the fixes.
Thanks for all the comments and info. It jogged my memory on how I initially updated everything before I inadvertently deleted it.
Sadly, still get this for a pre-9.1 extra set:
Interface\AddOns\BetterWardrobe\Modules\Wardrobe.lua:7088: Usage: <unnamed>:SetItemTransmogInfo(ItemTransmogInfo [,weaponSlotID, canRecurse])
It seems since the loop also traverses across non-Transmog slot keys of the outfit table, the appearanceID is nil, and the itemTransmogInfo created with that is an invalid parameter for SetItemTransmogInfo.
This causes a fatal error on the Neck slot already, so that only the Head slot is changed.
Aaaaaand any changes from selecting an extra set are only applied to the model, not the actual Transmog slots, whether for newly saved sets or previously existing ones, sadly without Lua error.
PS: attempting to save over an existing set gives me:
...rface\AddOns\BetterWardrobe\Modules\SavedOutfits.lua:220: attempt to call method 'SaveOutfit' (a nil value)
Nulgar, #197 should fix the issue with the pending slots, as well as the neck slot should it get merged.