Skip to content

bugfix(raidframes): auto-scale portraits for druid forms - #3422

Open
TzahalHPal wants to merge 1 commit into
EllesmereGaming:mainfrom
TzahalHPal:feat/party-portrait-auto-scale
Open

TzahalHPal wants to merge 1 commit into
EllesmereGaming:mainfrom
TzahalHPal:feat/party-portrait-auto-scale

Conversation

@TzahalHPal

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds an Auto-Scale Portraits toggle to the Party panel's Portrait Zoom cog (Raid & Party Frames → Party → Portrait → the cog on Size). It is off by default.

With Art Style set to 3D Portrait and 3D Zoom above 300, the game frames a character by its height. Creature-shaped models get their camera from their own creature data instead. Druid forms such as bear, cat and travel form come out much bigger or smaller than the characters next to them, often off-centre. A travel form's camera, for example, sits about twice as close as a character's and aims at its feet.

With the toggle on, any model that is longer or wider than it is tall is sized and centred like a character, blended in from 3D Zoom 300 to 500. Models at least as tall as they are long and wide keep the game's own camera exactly. That covers player characters and upright forms like Moonkin. Works in retail and WoW Forever.

How was it tested?

In game (retail and WoW Forever, v9.8.7 with this change; v9.8.8 doesn't change either file):

  • 5-player party at 3D Zoom 500, Detached Left. A druid shifted through caster, bear, cat, travel form and Moonkin.
    • Forms are sized and centred like the characters.
    • Characters and Moonkin are unchanged with the toggle on or off.
  • Dragged 3D Zoom 500 → 100 → 500 repeatedly, with the toggle on and off, then toggled it off and on.
    • Forms always came back sized and placed correctly.
    • Turning it off always gave the game's own camera.
  • An offline party member's question mark is unchanged.

Offline (Lua 5.1 harness with a fake client, against the stock v9.8.7 / v9.8.8 portrait file):

  • Toggle off: call-for-call identical to stock across 6,888 sequences of setting, unit, form, offline and zoom changes. Each sequence was run with three model-load timings (instant, cached and async).
  • Toggle on, or flipped at random: frame state identical to stock apart from camera distance, position and the probe.
    • Every covered model ends up with the expected distance and placement.
    • Uncovered models and question marks keep the stock camera.
    • The fake client re-aims its camera at a moved model the way the game does.
  • Targeted checks: 36, covering bear, travel form and another creature form built from in-game measurements, zoom drags, toggling, resizes, offline, cached loads and the options preview.
  • .tools/guardrails.py passes, and .tools/extract-locale-keys.sh reports no new keys.

Screenshots

The option

image

Checklist

  • New settings default OFF (no behavior change without opt-in)
  • Zero cost while disabled: no events registered, no polling, no hooks doing work, no tickers; nothing built beyond an inert event frame or combat queue
    • With the toggle off, no scripts are set and the probe scene is never created. The only added work is a few nil checks on paths that already run.
  • Cheap while enabled: event-driven (no polling, no timer-based logic, no per-frame allocations)
    • It runs on the model's own OnModelLoaded and OnSizeChanged. One C_Timer.After(0) call (with a pending flag, like ClickCast) reads the camera on the next frame, because the game moves its camera a frame after a load or zoom change.
    • Each model file is measured once on an off-screen ModelScene actor and cached.
  • No writes onto Blizzard-owned frames (weak-table pattern used); HookScript/hooksecurefunc only, never SetScript on Blizzard frames
    • Scripts are set only on EUI's own portrait PlayerModel. The probe is a private ModelScene.
  • Tested in-game on live; no version gates or pre-Midnight APIs added
    • Every API used exists in both Midnight and WoW Forever. Secret values are guarded with issecretvalue.

Adds an opt-in Auto-Scale Portraits toggle (default off) to the party
Portrait Zoom cog. Above 3D Zoom 300, models longer or wider than they
are tall (druid bear, cat and travel forms, ghost wolf) get a camera
distance and placement that size them like a character; characters keep
the game's own camera.

Each model file is measured once on an off-screen probe actor. The fit
runs one frame after a model load or zoom change, never moves the camera
under a moved model, and nothing is registered while the option is off.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant