Skip to content

Stats panel: Character | Mercenary tabs with merc skills - #103

Open
errolgr wants to merge 2 commits into
Project-Diablo-2:mainfrom
errolgr:feature/merc-stats-tab
Open

errolgr wants to merge 2 commits into
Project-Diablo-2:mainfrom
errolgr:feature/merc-stats-tab

Conversation

@errolgr

@errolgr errolgr commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Character | Mercenary tabs to the advanced stats panel, so the merc's stats can be read without opening the merc inventory. The Mercenary page also shows the merc type and aura, max life, level, and a Skills box listing every merc skill with its level (total (base+bonus) when +skills apply) and the damage of its attack skill.

Problem

Today the panel shows merc stats only while the merc inventory (O) is open; as soon as it closes the panel switches back to the character. There is no way to see the merc's skill levels or what +skills items actually give the merc.

Changes

File Change
BH/Drawing/Stats/StatsDisplay.cpp DrawTabs: a Character | Mercenary strip at the top of the panel. Without a merc it reads Character | No mercenary (greyed, the click does nothing). The selected tab is kept when the panel is reopened; opening the merc inventory selects Mercenary as before.
Merc page: Mercenary: Act N <aura> header, max life and level, in place of rows that don't apply to a merc.
DrawMercSkills: a Skills box next to the main panel (left of it with statsOnRight): every named merc skill as Name: total, or Name: total (base+bonus) with +skills; plus the attack skill damage at the total level (physical and elemental).
The main panel keeps the same size on both tabs (the old size-from-the-last-row logic is gone).
BH/Drawing/Stats/StatsDisplay.h Tab rectangles/state, skills-box rectangle for InRange, declarations.
BH/D2Ptrs.h D2COMMON_10121_GetMinElemDamage / 11091_GetMaxElemDamage for elemental skill damage.

Testing

In game (PD2 Season 13 client, single player): no merc, then an Act 1 Fire Arrow rogue hired from Kashya; each drawn line is compared with the server-side merc (skill levels, life, level, damage from #10567/#10297 and #10121/#11091). Then +2 all skills is put on the merc.

Result
Before (current BH, and shipped PD2 BH) no tabs; merc stats only with the merc inventory open
After (this PR) all checks pass
Check Drawn
No merc Character | No mercenary (greyed)
Header Mercenary: Act 1 Vigor
Skills Vigor: 7, Fire Arrow: 7, Exploding Arrow: 7, Dodge: 5, Evade: 5
Attack damage Fire Arrow: 25-69
+2 all skills Vigor: 9 (7+2), Fire Arrow: 9 (7+2), Dodge: 7 (5+2), …, Fire Arrow: 40-90
Layout every row inside the 600 px screen

Also checked by hand: Act 4 merc with the most skills (6) with +2 all skills: all rows fit.

Before (shipped BH): needs the merc inventory After: Character tab
before after
After: Mercenary tab + Skills box After: +2 all skills (base+bonus)
merc plus2
After: no mercenary
no merc

Unit tests (native build of StatsDisplay.cpp against a fake engine): tabs, no-merc state, skills box rows and position, (base+bonus) formatting.

Runtime: 10/10 + 10/10 cold launches (PD2 and vanilla) with the branch build, no crashes. The other in-game scenarios have the same results as on main.

Full evidence: PR-EVIDENCE.md

…fe and a Skills section (skill/aura levels incl. +skills, attack skill damage)
…x screen); panel keeps the Character page's size
@errolgr
errolgr marked this pull request as ready for review October 5, 2026 01:57
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