Portrait:SetModelScale(number)
Hi.
I am trying to change the model scale of the player portrait. i've tried to use the Portrait:PostUpdate() function but without success. Code:
self.Portrait.PostUpdate = function(self, unit) self:SetModelScale(0.5) end thanks. edit: already answered, please disregard. i can post the solution if anyone has interest |
Quote:
|
so my intention was to use a portrait for the player without any border or background and placed on the bottom of the screen. but it was zoomed in too much so it was visible where are the borders of portrait frame.
so here are 2 solutions i've found/been told: 1. use Model:SetCamera(1) - this changes the whole portrait to something similar as in character screen (whole body seen), and it should be zoom-able 2. use PlayerModel:SetPortraitZoom(number) |
*edit*
IT WORKED...lol on first try. @haste the "SetCamera 0" settings seems to be deprecated. Try this: I changed the portrait.lua and male worgen portraits are now fixed. Seems like: SetPortraitZoom is the new SetCamera. lua Code:
First worgen male portrait working correctly :p |
Delete your post, ASAP! Otherwise, I predict even more of those hairy beasts flooding the game, soon! NOooooO! :p
|
Not need for so much code! this works perfect.
LUA Code:
And add to your portraits. LUA Code:
|
@Game
Sorry but my post is a bugfix for the oUF/elements/portrait.lua that haste is hopefully going to implement. I have no Github account otherwise I would post it there. Maybe someone else can. |
Quote:
|
zork, are you able to post your changes as a git format-patch (or diff)? That would allow me to commit the changes in your name. If it's too much hassle, let me know and I'll merge the changes in manually.
|
I registered and tried to pull a change request. No sure if I made that correct.
|
Quote:
@ Haste did a pull request. |
Thank you. :)
|
You both did it actually. With one minute between :P. The change is "merged" onto the API-6 branch now.
|
I spent some time now testing. Doing dungeon in the dungeonfinder. I have to push another fix my first post was OK, but incomplete. Swapping between questionmark and model bugs so I had to fix it.
This works for me currently in any situation (going from mark to model or from model to mark or model to model) lua Code:
The else condition can be removed entirely. What was important is to reset the GUID on questionmark (because it would not change back if you had the GUI, got mark later. It would stuck in mark) To make the model values apply the model must be cleared. Doesn't work otherwise. |
To bad so many of the model api functions are not documented.
But there is a function that sounds interesting. # PlayerModel:RefreshCamera() - This function is not yet documented # PlayerModel:RefreshUnit() - Updates the model's appearance to match that of its unit. Used in the default UI's inspect window when the player's target changes (changing the model to match the "new appearance" of the unit "target") or when the UNIT_MODEL_CHANGED event fires for the inspected unit (updating the model's appearance to reflect changes in the unit's equipment or shapeshift form). More: http://wowprogramming.com/docs/widgets/PlayerModel |
I revised my code and found the final bug.
Reseting the camdistancescale vales etc is needed before reseting the model otherwise it will not reload properly if you change from a gnome to a dwarf etc. I originally thought that clearing the model would wipe the model attributes but that is not the case. The attributes have to be set before the model rendering. lua Code:
|
All times are GMT -6. The time now is 08:52 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI