This small mod is an animated unit frames for (nearly) any UI.
Installation note for users of previous versions: You will need to exit the game and restart for new files to be recognized. If you install the mod while logged in, quit and log back in instead of reloading the UI.
__ New in 1.82 __
- Updated for 3.0 patch
- /adapt goes to options panel
__ New in 1.8 __
- Added an options panel (ESC to Game Menu->Interface->Addons->Adapt)
- Removed slash commands (options panel takes their place)
- Added option for full model portraits
When a mod requests a portrait to be drawn, this mod intercepts the request and instead draws a model to the dimensions of the intended texture, dynamically creating the model if one didn't exist for that texture yet.
In theory it should work with all mods that use SetPortraitTexture, including default, DUF, HitList, Elite Player Frame, etc.
This mod is meant to be configuration-free (especially if you use the default unit frames), but you can change some options by hitting ESC to the Game Menu, clicking Interface, then Addon tab at the top and Selecting Adapt.
Limitations:
There is no way to apply a real mask to a model. To make models fit into "circle" portaits, the square is shrunk to fit within the circle.
There is no way to know whether some portraits should be square while others circle. Choose which one you prefer overall.
There's not a lot of wiggle room for models to be under/over other frames/textures.
If a "circle" portrait is too small or too large, try "square". This mod doesn't watch for frames to resize and can't shift estimated circle boundries to moving anchors.
Some mods do wild things with frameStrata. This mod can't guarantee the background will show up or that the model will even be over the background instead of under. Try toggling the background on/off.
While this mod attempts to be universal, it can't guarantee it will work with every conceivable way that textures can be drawn/layered.
I found that Adapt doesn't save the setting for background transparency on the avatar portrait in the unit frame. Since reporting that bug, I checked my Adapt SV:
Back is set false, but the code appears to be looking for ON or OFF. Need to trace through and find out all the places where "Back" is defined and assigned values. Then determine if you want the function return or value to be ON/OFF or TRUE/FALSE.
Likely places to check to confirm you're getting or setting the desired value include:
Code:
Adapt.lua 45 Back = "ON", -- "ON" or "OFF" whether background shows
Adapt.lua 130 frame.backLayer = frame:CreateTexture(modelName.."Back","BACKGROUND")
Adapt.lua 135 if Adapt_Settings.Back=="OFF" then
Adapt.lua 166 local back = Adapt.Textures[textureName].backLayer
Adapt.lua 173 if Adapt_Settings.Back=="OFF" then
Adapt.lua 194 if Adapt_Settings.Back=="ON" then
Adapt.lua 200 AdaptOptionsCheckButtonTransparent:SetChecked((Adapt_Settings.Back=="OFF") and 1 or nil)
Adapt.lua 296 Adapt_Settings.Back = AdaptOptionsCheckButtonTransparent:GetChecked() and "OFF" or "ON"
Adapt.lua 352 Adapt.OldSettings.Back = Adapt_Settings.Back
Adapt.lua 373 Adapt_Settings.Back = Adapt.OldSettings.Back
HTH (P.S.: My money is on line 200.)
As a temporary work-around, I'm going to modify the SV value by hand and then avoid entering the Adapt configuration panel (so it doesn't reset the incorrect value).
If you use a non default UI Scale it seems to mess things up a bit, is there any way i can move the 3d models back a bit? They seem to be clipping with the frame a bit, ie http://i35.tinypic.com/10yl5rm.jpg
Seems to work ok with "Full model" ticked though. But id rather have the default 3d portrait
* NEW - Frame:HookScript("name", function) - Exactly equivalent to hooksecurefunc(), but usable with frame script handlers. (Note that like hooksecurefunc(), this is not intended as a general hooking replacement, but to allow hooking of secure frame handlers.)
dunno if it can solve this anyhow, I tried replacing that hooksecurefunc() line with this
Adapt 1.7.1 crashes the PTR 2.1.0 client (on loading).
Only happens after the 1st ptr patch: client build 6592 (and onward?)
PTR 0.1.0.6577 = Adapt works fine.
PTR 0.1.0.6592 = client crashes.
Tested with Adapt loaded only (no other addons).
And adding Adapt to other addons.
WoW client crashes with a "fatal exception" error at the end of the loading progress bar.
Edit: Followup.
1. comment out hooksecurefunc("SetPortraitTexture",Adapt.newSetPortraitTexture)
2. enter world normally.
3. alt-tab, edit the hook back in.
4. ReloadUI.
Adapt works ok... (?) Edit: Followup #2.
Changing this:RegisterEvent("PLAYER_LOGIN") to
this:RegisterEvent("PLAYER_ENTERING_WORLD")
and moving hooksecurefunc("SetPortraitTexture",Adapt.newSetPortraitTexture)
from .OnLoad() to .OnEvent() stops the client crashing and Adapt seems to be working but still occasionally causes "fatal exception" type errors to the client.
This is obviously not a bug report, Adapt works great on the current Live Realms.
Just a little advance notice for the future
I play an Undead male a lot and i have noticed that half of his face is cut off in the potrait. I think this has some thing to do with how the undead slouch over instead of standing up straight. Am I the only one having this problem? Or is any one else having it? If I can fix it how do i do that? (may be changing the coordinates for the undead model to the left some more?)
I LOVE having the animated textures in the windows... although targetoftarget is a little annoying with the constant resets (I'm guessing the ui tests every couple of seconds to see what your target is targeting, hence refreshing the window and causing the "stutter")
I used the /adapt list command though, and disabled that frame - viola! Perfect!!
Oops yeah I can see the : being a problem. In retrospect the name of this mod is ridiculously long. I should probably just shorten it to 'Adapt'
On the GUI, if/when it's made it would include options for background. My secret wish is for some more camera position controls that can run off SetCamera(0). Then a GUI would definitely be useful. Unfortunately I'm far from bored lately, especially this past month, but we'll see. I enjoy writing GUIs.
If you get bored or something, you could make a GUI. I don't see it being important at the moment, however.
I was wondering if you could possibly add the option of having a black background along with the class-based colors and no background options. Either that or perhaps some sort of brightness adjustment on the colors.