I'm here again
I've been tweaking the tooltip
system to improve his width size, but after implementing it (OWSAP Width tooltip
fix), all text lines were forced into a horizontally centered position due to the fix. However, this caused issues with specific text lines, like jewel names and timers, where we actually want custom positioning... (at least for this implementation)
So, let me walk you through what I did to fix it properly, and make it future-proof for any font or size changes!
Find TextLine class in UI.py and make it like this:
Reacționează

la acest mesaj și conținutul se va afișa automat.
Find the function:
Reacționează

la acest mesaj și conținutul se va afișa automat.
Add this below:
Reacționează

la acest mesaj și conținutul se va afișa automat.
Why this?
I introduced a new property in the ui.TextLine class — ignoreAlignment — with future flexibility in mind...
The goal was to give more control over which text lines should follow the automatic horizontal center alignment applied by the tooltip system.
By default, all text lines get centered (now because of the OWSAP fix), which is great in most cases. But there are situations where we need custom positioning, like with jewel names, timers, or spirit
stone effects.
So now, anytime I want a TextLine to ignore the automatic alignment, I can simply call:
Reacționează

la acest mesaj și conținutul se va afișa automat.
This keeps the code clean, avoids hardcoding special cases all over the place, and makes it super easy to handle future exceptions without breaking the tooltip layout.
It already came in handy... not just for the jewel tooltips, but also for spirit stone lines and any other future custom additions that I do have.
Let's proceed tho
Now, we apply this custom property to the jewel name and timer text lines.
Find this line:
Reacționează

la acest mesaj și conținutul se va afișa automat.
Add this below:
Reacționează

la acest mesaj și conținutul se va afișa automat.
let's do the same for timeTextLine, find this line:
Reacționează

la acest mesaj și conținutul se va afișa automat.
Add this below:
Reacționează

la acest mesaj și conținutul se va afișa automat.
Now, these specific text lines will ignore the automatic tooltip alignment and will follow our custom positioning instead.
Previously, jewel names and timers had hardcoded positions (for the fix I did in the previous message). But, as I was reviewing the changes, I had an "Aha!" moment:
"Wait... what if we change the font or text size? Everything breaks!" 
(Which actually happened to me...)
So instead of using fixed positions, let's dynamically calculate the center based on text width, so it works no matter the font size or text length.
Warning:: This can be applied even without the tooltip width fix by OWSAP. If you followed the changes on my previous message, you can apply this new setpositions.
Find this line:
Reacționează

la acest mesaj și conținutul se va afișa automat.
Add this below:
Reacționează

la acest mesaj și conținutul se va afișa automat.
Find this line:
Reacționează

la acest mesaj și conținutul se va afișa automat.
Add this below:
Reacționează

la acest mesaj și conținutul se va afișa automat.
Now, the jewel name and the timer is also perfectly centered without worrying about text size
Let's modify the global alignment function to respect our new ignoreAlignment property
Find the function:
Reacționează

la acest mesaj și conținutul se va afișa automat.
Replace it with:
Reacționează

la acest mesaj și conținutul se va afișa automat.
All normal text lines will still center, but jewel names and timers will be left alone for custom alignment, just like want
This same issue happens with Spirit Stones, but since this fix was focused on jewels, I'll focus on them only for this topic.
But if you understood what I did here, you can easily apply this fix to Spirit Stones too!
Result of this change (BEFORE and AFTER having the tooltip width fix changes as well):
![[Py] Finisaje pe aceeasi linie in tooltip - Mesaj 7 - Imagine 4 [Py] Finisaje pe aceeasi linie in tooltip - Mesaj 7 - Imagine 4](https://i.imgur.com/oiFZTTl.png)