Jump to content
  • 0

change text color



I can't figure out how to change the text color of a specific line in the client, to be specific the "Succes rate" of upgrading an item. 

In uirefine.py i have


    def Open(self, scrollItemPos, targetItemPos):
        self.scrollItemPos = scrollItemPos
        self.targetItemPos = targetItemPos

        percentage = self.GetRefineSuccessPercentage(scrollItemPos, targetItemPos)
        if 0 == percentage:
        self.successPercentage.SetText(localeInfo.REFINE_SUCCESS_PROBALITY % (percentage))

        itemIndex = player.GetItemIndex(targetItemPos)
        metinSlot = []
        for i in xrange(player.METIN_SOCKET_MAX_NUM):
            metinSlot.append(player.GetItemMetinSocket(targetItemPos, i))
        self.toolTip.AddItemData(itemIndex, metinSlot)


I think i have to change the color before  self.successPercentage.SetText(localeInfo.REFINE_SUCCESS_PROBALITY % (percentage))   but I couldn't find any function to do so. i'm really bad at Python, thanks for your help.

  • Metin2 Dev 1
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
1 minute ago, semoka10 said:

How precisely?

you have to add |cff + hex color

search google for Hex colors 

for example hex color for red is #FF0000

so to use it



so it will be like:

REFINE_SUCCESS_PROBALITY    |cffFF0000Successrate: %d%%


  • Love 1
Link to comment
Share on other sites

  • 0
  • Bronze

Go to your uiscript/refinedialog.py. There is an element called "SuccessPercentage" here find it. This is the success percentage text. If you want it to have a color, simply add this line:

"color" : "red"


It should look something like this:


                    "name" : "SuccessPercentage",
                    "type" : "text",
                    "text" : uiScriptLocale.REFINE_INFO,
	                "color" : "red",
                    "horizontal_align" : "center",
                    "vertical_align" : "bottom",
                    "text_horizontal_align" : "center",
                    "x" : 0,
                    "y" : 70,
Edited by Finnael
  • Love 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Activity

    1. 5
    2. 5

      Zodiac Roulette (Aeldra event concept)

    3. 0

      I am looking for a team for PVP Server!

    4. 0

      How about get quest flag from binary??

    5. 5

      Zodiac Roulette (Aeldra event concept)

    6. 5

      Zodiac Roulette (Aeldra event concept)

    7. 5

      Zodiac Roulette (Aeldra event concept)

    8. 12

      REAL_TIME_FIRST_USE items not being expired in the safe-box

  • Recently Browsing

    • No registered users viewing this page.
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.