shagu / pfUI

A User Interface Replacement for World of Warcraft: Vanilla & TBC
https://shagu.org/pfUI
MIT License
339 stars 117 forks source link

Title in the tooltip doesn't trim the character name from titles that are written after that name #1244

Closed Szalor closed 5 months ago

Szalor commented 7 months ago

The tooltip's title management currently only trims the character name from the title if the title is positioned before the character name. Example: pvpname: Sergeant Buster name: Buster Resulting pvptitle: Sergeant

However, when it comes to other titles (custom non pvp titles in Turtle WoW for instance) that come after the character name, we get the following behaviour: pvpname: Buster Still Alive name: Buster Resulting pvptitle: Buster Still Alive

Here's the fix that seems to be working for me so far:

in tooltip.lua: line 208: local pvptitle = gsub(pvpname or name,name, "", 1) pvptitle = gsub(pvptitle,"^%s(.-)%s$", "%1") --trimming spaces

line 228: if pvptitle ~= name and pvptitle ~= "" then

shagu commented 5 months ago

Thank you, fixed in the latest version. https://github.com/shagu/pfUI/commit/e843ccea2c16f69fab04433dde461bb98496af37