mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-28 02:16:02 +00:00
fe5b3b135b
The level string was brightened by +0.3 on all three channels before display, in the levelFromDB path and again in the OnUpdate colour sync. A flat offset desaturates toward white and costs the high tiers most, because their green/blue channels start near zero: verydifficult 1.00/0.50/0.25 becomes 1.00/0.80/0.55 and reads as yellow, impossible 1.00/0.10/0.10 becomes 1.00/0.40/0.40 and reads as orange. Orange and yellow ended up 0.2 apart on a single channel, so a mob 3-4 levels above the player showed yellow and a skull-range mob showed orange. Both offsets dropped. Ownership of the colour is now explicit through cache.levelfromdb so the two writers no longer race: the sync block stands down on ?? plates, and the DB path clears cache.levelcolor so the sync re-asserts cleanly once the level resolves. That also fixes a stale cache - nameplate.cache is built once at plate creation and survives pool reuse, so a recycled plate could keep the previous unit's colour. Deleting the sync block instead would be wrong: it is the only thing that colours the level on non-?? plates, and plate.level is created with no colour at all. Reported by Iden via Discord. (cherry picked from commit eaa9beac51953d2a959c67d5ff5bc50273a919c3) (cherry picked from commit 3fdb3b23136b260d111509e24e6d7b0d0b9b1b33)