7 mesaje
Administrator Administrator
  • Mesaje: 3449
  • Reacții: 48414
  • Mesaje utile: 29
  • Status: Pe aici.. 🤠
  • Server: Saga2 - Soon
  • Regat: Jinno
  • [ID Discord]
  • Contact:
    *Descriere:

    Aceasta este o modificare in python care schimba pozitia finisajelor in tooltip-ul itemelor.

    Adica, acestea vor aparea acum in linie, unul dupa altul.
    Initial acestea apareau unul sub altul.

    Daca vrei sa adaugi mai multe finisaje pe un obiect fa asta: imbunatatiri/mai-multe-finisaje-iteme-t781.html

    *Poze / Video:
    [Py] Finisaje pe aceeasi linie in tooltip - Mesaj 1 - Imagine 1
    *Link download / Code:

    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.

    Cum descarc de pe TeraBox?

    Afișează detalii Ascunde detalii
    • Este asemănător cu Mega.nz
    • Instalați-vă clientul lor de Download de aici
    • Faceți-vă un cont (vă puteți loga cu Facebook / Google / etc)
    • Dacă nu vreți să descărcați clientul de Download, folosiți acest site
    • Gata! Acum puteți descărca resursele

    De ce folosim TeraBox?

    • Este gratuit
    • Primești 1TB de spațiu gratuit la orice cont creat!
    • Este ușor de folosit și varianta premium este foarte ieftină
    • Fișierele nu sunt șterse niciodată
    TeraBox logo
    Te asteptam si pe serverul de Discord :p - aici ne-am strans toata comunitatea de Metin2 din Romania.
    Link: https://discord.gg/jWxeDSf7HP

    Suntem peste 1700 membri! - Avem chat activ zilnic, support, cereri, resurse. :D :ymcowboy:




    See full signature

    📢 Resurse Metin2 Premium!

    Zeci de resurse Metin2 Premium - exclusive și 100% funcționale începând cu 15.99€!.

    Vezi resursele Cumpără premium
    Premium
    Premium
    Anunț
  • Mesaje: 45
  • Reacții: 79
  • Mesaje utile: 0
  • Status: Pierd vremea ^.^
  • Regat: Chunjo
  • Medalii

    Administrator Administrator
  • Mesaje: 3449
  • Reacții: 48414
  • Mesaje utile: 29
  • Status: Pe aici.. 🤠
  • Server: Saga2 - Soon
  • Regat: Jinno
  • [ID Discord]
  • Contact:
    Avatar utilizator
    Administrator
    Administrator

    Mesaj de [HF]White »

    Te asteptam si pe serverul de Discord :p - aici ne-am strans toata comunitatea de Metin2 din Romania.
    Link: https://discord.gg/jWxeDSf7HP

    Suntem peste 1700 membri! - Avem chat activ zilnic, support, cereri, resurse. :D :ymcowboy:




    See full signature
  • Mesaje: 45
  • Reacții: 79
  • Mesaje utile: 0
  • Status: Pierd vremea ^.^
  • Regat: Chunjo
  • Medalii

    [HF]White scrie: 17 Dec 2024, 00:58
    syserr?

    merge ,greseala mea ca nu m-am uitat in sysser trebuia sa moific din localeInfo in localeinfo
    Avatar utilizator
    DnD
  • Mesaje: 15
  • Reacții: 83
  • Mesaje utile: 0
  • Status: Pierd vremea ^.^
  • Regat: Jinno
  • [ID Discord]
  • Contact:

    Medalii

    Avatar utilizator

    Mesaj de DnD »

    superb !
  • Mesaje: 5
  • Reacții: 58
  • Mesaje utile: 0
  • Status: Tax's
  • Regat: Chunjo
  • Medalii

    Mesaj de Eder »

    For those experiencing alignment issues, change 50 to the following values:

    Gem Name:
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.


    Icon Images:
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.


    Time Left:
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.


    NPC Explanation:
    We're replacing the fixed number (50) with a smarter calculation to make sure everything looks properly centered.
    Instead of using the same number for all positions, we now tell the system: "Find the middle of the tooltip and adjust from there."

    This makes sure names, icons, and timers are placed exactly where they should be, no matter the tooltip size.
    Now, everything will look cleaner and better aligned, without needing extra manual fixes.


    Detailed Explanation:
    In the updated logic, we're dynamically calculating element positions rather than using a fixed offset: self.toolTipWidth / 2 gets the horizontal center of the tooltip.

    Time left Adjustment:
    • For "Time Left", instead of aligning the text's starting point at the exact center, we divide it 2 times. This ensures the text appears centered visually rather than just aligning its left edge at the middle.

    Gem Name Adjustment:
    • Here, we push the text slightly forward instead of using / 2 again.
      This prevents it from being too far back while keeping alignment balanced.

    Icon Image Adjustment:
    • We reduced the spacing from 40 → 37 to pull the icons slightly backward, as they were too far forward before.


    Final Result:
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.



    The new values should work well for default tooltips, but minor adjustments might be needed depending on custom UI elements or font sizes.
  • Mesaje: 5
  • Reacții: 58
  • Mesaje utile: 0
  • Status: Tax's
  • Regat: Chunjo
  • Medalii

    Mesaj de Eder »

    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:
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.


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


    Add this below:
    Conținut: Ascuns
    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:
    Conținut: Ascuns
    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:
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.


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


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


    Add this below:
    Conținut: Ascuns
    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:
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.


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


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


    Add this below:
    Conținut: Ascuns
    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:
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.


    Replace it with:
    Conținut: Ascuns
    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 1 [Py] Finisaje pe aceeasi linie in tooltip - Mesaj 7 - Imagine 2

    [Py] Finisaje pe aceeasi linie in tooltip - Mesaj 7 - Imagine 3 [Py] Finisaje pe aceeasi linie in tooltip - Mesaj 7 - Imagine 4

    📢 Resurse Metin2 Premium!

    Zeci de resurse Metin2 Premium - exclusive și 100% funcționale începând cu 15.99€!.

    Vezi resursele Cumpără premium
    Premium
    Premium
    Anunț
    Scrie răspuns

    Creează-ți un cont sau autentifică-te pentru a participa la discuție

    Trebuie să fii membru pentru a răspunde

    Creează-ți un cont

    Membrii pot crea subiecte noi și pot descărca resurse Metin2 Gratuit!


    Te poți înregistra sau conecta rapid utilizând contul tău de Discord, Github sau Google.

    Înregistrare

    Autentifică-te

    Înapoi la “Îmbunătățiri”

    Informații

    Utilizatori ce navighează pe acest forum: DEVE, rawn3cr0, ZeroS și 4 vizitatori

    Discord ID copiat: