From e83ff805382bedc4037ad4d5bd5af3156f144eb8 Mon Sep 17 00:00:00 2001 From: Meow <30401521+me0wg4ming@users.noreply.github.com> Date: Thu, 8 Jan 2026 19:02:02 +0100 Subject: [PATCH] Version 6.1.1 - Chat & Nameplate Level Fixes Bugfixes: - Fixed targeting high-level players overwriting known level with -1 - Chat now shows "??" instead of -1 for unknown levels - Nameplates now use stored level from database after reload - Nameplate level color now uses difficulty color when loaded from DB Config Changes: - Chat player level display now disabled by default --- README.md | 19 ++++++++++++++++--- api/config.lua | 2 +- libs/libunitscan.lua | 4 ++++ modules/chat.lua | 6 +++++- modules/nameplates.lua | 14 ++++++++++++++ pfUI-tbc.toc | 2 +- pfUI.toc | 2 +- 7 files changed, 42 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c7946aaa..7ffb4004 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # pfUI - Turtle WoW Edition -[![Version](https://img.shields.io/badge/version-6.1.0-blue.svg)](https://github.com/me0wg4ming/pfUI) +[![Version](https://img.shields.io/badge/version-6.1.1-blue.svg)](https://github.com/me0wg4ming/pfUI) [![Turtle WoW](https://img.shields.io/badge/Turtle%20WoW-1.18.0-brightgreen.svg)](https://turtlecraft.gg/) [![SuperWoW](https://img.shields.io/badge/SuperWoW-Enhanced-purple.svg)](https://github.com/balakethelock/SuperWoW) [![Nampower](https://img.shields.io/badge/Nampower-Optional-yellow.svg)](https://gitea.com/avitasia/nampower) @@ -14,11 +14,24 @@ This version includes significant performance improvements, DLL-enhanced feature --- +## What's New in Version 6.1.1 (January 8, 2026) + +### 🐛 Bugfixes + +- ✅ **Chat Level Display Fix** - Fixed targeting high-level players overwriting known level with -1. Now shows "??" for unknown levels instead of -1 +- ✅ **Nameplate Level Fix** - Nameplates now use stored level from database after reload instead of showing "??" +- ✅ **Nameplate Level Color** - Level color now correctly uses difficulty color when loaded from database + +### ⚙️ Config Changes + +- ✅ **Chat Player Levels** - Now disabled by default (was enabled) + +--- + ## What's New in Version 6.1.0 (January 8, 2026) ### 🐛 Bugfixes -- ✅ **Performance improvement for visible Nameplates** - ✅ **40-Yard Range Check Fix** - Fixed range check not working for raid/party frames due to throttle variable conflict (`this.tick` vs `this.throttleTick`) - ✅ **Aggro Indicator Fix** - Fixed aggro indicator not displaying properly on raid/party frames (same throttle issue) - ✅ **Aggro Detection Cache** - Improved aggro cache to only cache positive results, allowing instant detection when aggro changes while maintaining performance @@ -159,7 +172,7 @@ Turtle WoW includes TBC spells in the Vanilla client. This version includes all --- -**Version:** 6.1.0 +**Version:** 6.1.1 **Release Date:** January 8, 2026 **Compatibility:** Turtle WoW 1.18.0 **Optional DLLs:** SuperWoW, Nampower, UnitXP_SP3 (enhanced features when available) diff --git a/api/config.lua b/api/config.lua index de550b88..533caa8c 100644 --- a/api/config.lua +++ b/api/config.lua @@ -730,7 +730,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("chat", "text", "detecturl", "1") pfUI:UpdateConfig("chat", "text", "classcolor", "1") pfUI:UpdateConfig("chat", "text", "whosearchunknown", "0") - pfUI:UpdateConfig("chat", "text", "playerlevel", "1") + pfUI:UpdateConfig("chat", "text", "playerlevel", "0") pfUI:UpdateConfig("chat", "left", "width", "380") pfUI:UpdateConfig("chat", "left", "height", "180") pfUI:UpdateConfig("chat", "right", "enable", "0") diff --git a/libs/libunitscan.lua b/libs/libunitscan.lua index 45fab328..99a3a4a0 100644 --- a/libs/libunitscan.lua +++ b/libs/libunitscan.lua @@ -131,6 +131,8 @@ libunitscan:SetScript("OnEvent", function() if UnitIsPlayer(scan) then _, class = UnitClass(scan) level = UnitLevel(scan) + -- UnitLevel returns -1 for unknown levels, don't overwrite known values + level = level > 0 and level or nil name = UnitName(scan) guild = GetGuildInfo(scan) AddData("players", name, class, level, nil, guild) @@ -138,6 +140,8 @@ libunitscan:SetScript("OnEvent", function() _, class = UnitClass(scan) elite = UnitClassification(scan) level = UnitLevel(scan) + -- UnitLevel returns -1 for unknown levels, don't overwrite known values + level = level > 0 and level or nil name = UnitName(scan) AddData("mobs", name, class, level, elite) end diff --git a/modules/chat.lua b/modules/chat.lua index 5c706824..0bc00833 100644 --- a/modules/chat.lua +++ b/modules/chat.lua @@ -797,11 +797,15 @@ pfUI:RegisterModule("chat", "vanilla:tbc", function () local real, _ = strsplit(":", name) local level = GetPlayerLevel(real) - if level then + if level and level > 0 then local levelcolor = rgbhex(GetDifficultyColor(level)) -- Add level after the player name, before the closing bracket text = string.gsub(text, "(|Hplayer:" .. name .. "|h.-|h|r)" .. right, "%1 " .. levelcolor .. level .. "|r" .. right) + elseif level and level <= 0 then + -- Show ?? for unknown levels (e.g. -1 from UnitLevel) + text = string.gsub(text, "(|Hplayer:" .. name .. "|h.-|h|r)" .. right, + "%1 |cffff0000??|r" .. right) end end end diff --git a/modules/nameplates.lua b/modules/nameplates.lua index 6f65179a..30868e99 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -664,6 +664,14 @@ pfUI:RegisterModule("nameplates", "vanilla", function () local name = plate.original.name:GetText() local level = plate.original.level:IsShown() and plate.original.level:GetObjectType() == "FontString" and tonumber(plate.original.level:GetText()) or "??" local class, ulevel, elite, player, guild = GetUnitData(name, true) + + -- Use database level if available and valid (fixes ?? after reload) + local levelFromDB = false + if ulevel and ulevel > 0 then + level = ulevel + levelFromDB = true + end + local target = plate.istarget local mouseover = UnitExists("mouseover") and plate.original.glow:IsShown() or nil local unitstr = target and "target" or mouseover and "mouseover" or nil @@ -787,6 +795,12 @@ pfUI:RegisterModule("nameplates", "vanilla", function () plate.name:SetText(GetNameString(name)) plate.level:SetText(string.format("%s%s", level, (elitestrings[elite] or ""))) + + -- Set level color from GetDifficultyColor when using DB level + if levelFromDB and type(level) == "number" then + local color = GetDifficultyColor(level) + plate.level:SetTextColor(color.r + 0.3, color.g + 0.3, color.b + 0.3, 1) + end if guild and C.nameplates.showguildname == "1" then plate.guild:SetText(guild) diff --git a/pfUI-tbc.toc b/pfUI-tbc.toc index dde84456..8c4eafba 100644 --- a/pfUI-tbc.toc +++ b/pfUI-tbc.toc @@ -3,7 +3,7 @@ ## Author: Shagu ## Notes: A complete user interface replacement. ## Notes-ruRU: Полная замена пользовательского интерфейса. -## Version: 6.1.0 +## Version: 6.1.1 ## SavedVariables: pfUI_profiles, pfUI_addon_profiles, pfUI_cache ## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB diff --git a/pfUI.toc b/pfUI.toc index dd2e8306..a208d0f3 100644 --- a/pfUI.toc +++ b/pfUI.toc @@ -3,7 +3,7 @@ ## Author: Shagu ## Notes: A complete user interface replacement. ## Notes-ruRU: Полная замена пользовательского интерфейса. -## Version: 6.1.0 +## Version: 6.1.1 ## SavedVariables: pfUI_profiles, pfUI_addon_profiles, pfUI_cache ## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB