Jump to content
×
×
  • Create New...
  • 0

change text color


semoka10

Question

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

Spoiler

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

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

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

        self.UpdateDialog()
        self.SetTop()
        self.Show()

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

|cffFF0000

 

so it will be like:

REFINE_SUCCESS_PROBALITY    |cffFF0000Successrate: %d%%

 

  • Love 1
Link to comment
Share on other sites

  • 0

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


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.