Jump to content
  • We need you!

    You must register to discover all the features of our community!

  • 0

change text color


semoka10
Go to solution Solved by Asentrix,

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.

Link to post

4 answers to this question

Recommended Posts

  • 0
  • VIP
  • Solution
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 post
  • 0
  • VIP
Posted (edited)

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 (see edit history)
  • Love 1
Link to post
Guest
This topic is now closed to further replies.


×
×
  • 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.