Skip to content

Add enemy level display on nameplates#150

Open
itsDNNS wants to merge 2 commits intoEllesmereGaming:mainfrom
itsDNNS:feature/nameplate-level-display
Open

Add enemy level display on nameplates#150
itsDNNS wants to merge 2 commits intoEllesmereGaming:mainfrom
itsDNNS:feature/nameplate-level-display

Conversation

@itsDNNS
Copy link
Copy Markdown

@itsDNNS itsDNNS commented Mar 18, 2026

Summary

  • Show unit level as a colored prefix before the enemy name on nameplates
  • Uses GetCreatureDifficultyColor for difficulty-based coloring (gray/green/yellow/orange/red)
  • Bosses (level -1) display as "??" in red
  • Two new settings: showLevel (default: true), levelDifficultyColor (default: true)

Implementation

  • New GetLevelPrefix(unit) helper that builds a WoW color-coded string (|cffRRGGBB)
  • Integrated into UpdateName() — level is prepended to the name text
  • Both settings added to _displayPresetKeys for per-spec preset support
  • Zero new UI elements — uses existing FontString with inline color codes

Test plan

  • Verify level shows before enemy names on hostile nameplates
  • Verify difficulty colors match expected values (gray → green → yellow → orange → red)
  • Verify bosses show "??" in red
  • Verify showLevel = false hides the level prefix
  • Verify levelDifficultyColor = false falls back to gold color
  • Verify name truncation is acceptable with level prefix on narrow bars

itsDNNS added 2 commits March 18, 2026 09:08
Show unit level as a colored prefix before the enemy name,
using WoW's GetCreatureDifficultyColor for difficulty-based
coloring (gray/green/yellow/orange/red). Bosses show as "??".

Controlled via two new settings:
- showLevel (default: true)
- levelDifficultyColor (default: true)
- Boss (level -1): hardcode red instead of passing -1 to
  GetCreatureDifficultyColor which misinterprets it as low level
- Skip level display for critters/level-0 units (level <= 0)
- Add 25px width compensation in UpdateNameWidth when showLevel
  is enabled to prevent name truncation
- Cache GetCreatureDifficultyColor at file scope for consistency
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