Stanzilla / WoWUIBugs

World of Warcraft UI Bug Tracker
166 stars 7 forks source link

[Classic] PlayerModel SetDisplayInfo doesn't seem to work #459

Open maqjav opened 1 year ago

maqjav commented 1 year ago

Version: 1.14.4 (51311) Version: 3.4.3 (51572)

I tried the same code in Classic (1.14.3), Wrath and Retail and it works, however in the current Classic version it doesn't display anything:

local model = CreateFrame("PlayerModel", nil, UIParent)
model:SetSize(600, 800)
model:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
model:SetDisplayInfo(5444)
model:SetCamera(0)
model:RefreshCamera()
model:Show()

The ID I'm using belongs to this NPC https://www.wowhead.com/es/npc=6740

If I replace SetDisplayInfo(5444) with SetUnit("player") for example, then it works as usual.

I don't know if it doesn't recognize the ID, but I tried with several IDs and it didn't work with any of them.

EDIT: They have introduced the same bug in the latest build of Wrath.

Thanks.

maqjav commented 1 year ago

It isn't working in the released version 1.14.4 (51001).

pjeli commented 1 year ago

Hi there @maqjav - I was monitoring this for my own add-on and I was able to get around this by using SetCreature(id, display_id) method that was added to PlayerModel frame as part of the Dragonflight client change. Example of my code change: https://github.com/pjeli/Tombstones/commit/11dbb0818a38e1faf104b26c4919716bd822e87e. Seems just an API change.

maqjav commented 1 year ago

@pjeli thank you for the information. I will give it a try this afternoon. I wonder why they didn't make this change in the other versions of the game and only in classic. I guess it's a matter of time. Cheers.

maqjav commented 1 year ago

So I've been doing some tests and this is what I found.

  1. The function SetCreature(creatureID, displayID) isn't new, it exists since 2014 (at least).
  2. This function will display the model only if it exists in your cache, otherwise it won't show anything until you call it a second time.

With this example it will show up, but it requires the timer which increase the cost.

Close your game and delete the folder "Cache" before testing it.

local model = CreateFrame("PlayerModel", nil, UIParent)
model:SetSize(600, 800)
model:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
model:SetCreature(17075,17445)

C_Timer.After(1, function()
    model:SetCreature(17075,17445)
    model:Show() 
end)

Definetly I think this is a bug that they should fix.

pjeli commented 1 year ago

Very interesting - thanks for the info back. I will use this Timer delay for now.

I agree would be nice to have this fixed otherwise like it was prior.

uki-dev commented 10 months ago

Seems it is still broken in 1.14.4 (51829) 😭 Is it possible to use the SetCreature workaround for playable races?

DFortun81 commented 10 months ago

This appears to be broken in Wrath Classic as well.