Jump to content

Uitooltip.py write under the bonus?


Recommended Posts

hace 2 horas, Asterix dijo:

 

Hello everyone! Today I was looking at the "uitooltip.py". And I immediately had an idea. Having it need to give a visual rarity, not script in game, to costumes. What is the function that governs the inclusion of colored writing under the bonuses? Thanks to anyone who can help me!

Idk if I understand your question, but if I did -> Search:

				self.__AppendAttributeInformation(attrSlot)

You will find more than one match (for weapon, armor, belt, rings, costume), so select it like you want (in this case costume).

Then make a new line and add something like:

				self.AppendTextLine("some text...", self.MY_NEW_COLOR)

And finally search NORMAL_COLOR in class ToolTip(ui.ThinBoard), make a new line and define MY_NEW_COLOR:

	NORMAL_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
	MY_NEW_COLOR = grp.GenerateColor(0.6863, 0.9725, 0.3216, 1.0)

And change the color like you want...

  • Love 1
Link to comment
Share on other sites

En 23/11/2018 a las 21:21, Asterix dijo:

Thanks my friend... 

 

But i think that i have do a check of value, because i have need of more variety of colour based by value

So you can define a new function, before def __GetAttributeColor(self, index, value) like this:

	def __AppendItemRarity(self, attrSlot):
		RareList = ["Common","Uncommon","Rare","Legendary","Epic","From other universe"]
		idxRarity = 0
		if 0 != attrSlot:
			for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
				type = attrSlot[i][0]
				value = attrSlot[i][1]
				if value == 0:
					continue

				# HERE IS WHERE YOU MUST CHECK THE VALUES AND TYPES #
				# you have type and value, so you can increase idxRarity
				# like you want
				# ...............

		# The next lines is if idxRarity between 0 and 100
		if idxRarity == 0: self.AppendTextLine(RareList[0], self.COLOR_RARE_0)
		elif idxRarity < 20: self.AppendTextLine(RareList[1], self.COLOR_RARE_1)
		elif idxRarity < 40: self.AppendTextLine(RareList[2], self.COLOR_RARE_2)
		elif idxRarity < 60: self.AppendTextLine(RareList[3], self.COLOR_RARE_3)
		elif idxRarity < 80: self.AppendTextLine(RareList[4], self.COLOR_RARE_4)
		else: self.AppendTextLine(RareList[5], self.COLOR_RARE_5)

Search:

				self.__AppendAttributeInformation(attrSlot)

And add after:

				self.__AppendItemRarity(attrSlot)

And don't forget to define the colors in class ToolTip(ui.ThinBoard).

############
Some tips:
- You can make a dictionary with some types and ranges of values to simplify.
- You can use the same condition in attributes with "same values" (for example in defenses against weapons).
############

Example (i did it to test) :

example.png.24adbce9b178e1a33f305c23c6cf09cb.png

  • Love 2
Link to comment
Share on other sites

10 hours ago, xUniverse said:

Quindi puoi definire una nuova funzione, prima di def __GetAttributeColor (self, index, value) in  questo modo:


	
		   
		  
			
				 
					
				
				
				
		
		 
		 
		 
		 
		 
		

Ricerca:


E aggiungi dopo:


E non dimenticare di definire i colori nella classe  ToolTip (ui.ThinBoard).

############
- È possibile creare un dizionario con alcuni tipi e intervalli di valori da semplificare.
- È possibile utilizzare la stessa condizione in attributi con "stessi valori" (ad esempio nelle difese contro le armi).
############

Esempio (l'ho fatto per testare) :

example.png.24adbce9b178e1a33f305c23c6cf09cb.png

Hi!

i don’t understand where is  the check of value

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 0

      QuickSell in SpecialInventory Problem

    2. 12

      Legendary items effect

    3. 0

      M2Project Research | Teamler - Beta Tester

    4. 5

      How To Directx9 Device Creation with Multiple Thread Support

    5. 25

      Increase Safebox / Warehouse

    6. 25

      Increase Safebox / Warehouse

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