Jump to content

Recommended Posts

hey i try to add rarity in the uitooltip via AddItemData for the attributes. For example, 1 to 5 is common and 6-7 is rare
I tried So
Does anyone have a solution?

greetings
if player.ATTRIBUTE_SLOT_RARE_START >=1 and player.ATTRIBUTE_SLOT_RARE_START <=5:
    self.AppendTextLine("Common", self.CONDITION_COLOR)

33arVAV.png

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/21954-uitooltip-rarity-in-additemdata/
Share on other sites

  • Forum Moderator

(2.5) Questions & Answers specific rules

  • Don't modify your thread (or reply to it) to mark it solved, and not explain the solution to the issue.

For those who want this, you can do something like: [Not tested]

 

This is the hidden content, please

  • Metin2 Dev 30
  • Scream 1
  • Good 4
  • Love 16
vor 13 Stunden schrieb VegaS™:

(2.5) Questions & Answers specific rules

  • Don't modify your thread (or reply to it) to mark it solved, and not explain the solution to the issue.

For those who want this, you can do something like: [Not tested]

  • uiToolTip.py

# Search for:
	def __SetSpecialItemTitle(self):
		self.AppendTextLine(item.GetItemName(), self.SPECIAL_TITLE_COLOR)
# Add after:
	def __GetRarityTitleByAttr(self, attrSlot):
		attrCount = len([slot for slot in attrSlot if slot[1]])

		if attrCount in range(1, player.ATTRIBUTE_SLOT_NORM_NUM + 1):
			return localeInfo.TOOLTIP_ITEM_TITLE_COMMON
		elif attrCount in range(player.ATTRIBUTE_SLOT_NORM_NUM + 1, player.ATTRIBUTE_SLOT_RARE_END + 1):
			return localeInfo.TOOLTIP_ITEM_TITLE_RARE
		return None

# Search for:
				self.__SetSpecialItemTitle()
# Add before:
				rarityTitle = self.__GetRarityTitleByAttr(attrSlot)
				if rarityTitle:
					self.AppendTextLine(rarityTitle, self.CONDITION_COLOR)
  • locale/uk/locale_game.txt

TOOLTIP_ITEM_TITLE_COMMON	Common
TOOLTIP_ITEM_TITLE_RARE	Rare

 

 
I'm sorry for breaking the rules.
Hey Vegas, Thank you for your solution!

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
  • 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.