Jump to content
ASIKOO

python UIToolTIP : Bonus slot available

Recommended Posts

Hi,

 

It shows in the description of your item that it's possible to add a bonus to it. It works up to 7 bonuses.

 

Révélation

132926t11.png132926t22.png

 

 

Tutorial

 

Révélation

 

1. uitooltip.py

Révélation

Find :



	CONDITION_COLOR = 0xffBEB47D

Add :



	BONUS_COLOR = 0xffE5E58A

In 



	def __AppendAttributeInformation

Find :



		if 0 != attrSlot:

Add :



			count = 0

Find :



				if affectString:
					affectColor = self.__GetAttributeColor(i, value)
					self.AppendTextLine(affectString, affectColor)

Add :



				if value > 0:
					count = count+1

			if (count == 0) and (item.GetItemType() == item.ITEM_TYPE_ARMOR or (item.GetItemType() == item.ITEM_TYPE_WEAPON and item.GetItemSubType() != item.WEAPON_ARROW)):
				self.AppendTextLine(localeInfo.TOOLTIP_ITEM_BONUS_FIRSTADD, self.BONUS_COLOR)

			if (count < 7 and count != 0) and (item.GetItemType() == item.ITEM_TYPE_ARMOR or (item.GetItemType() == item.ITEM_TYPE_WEAPON and item.GetItemSubType() != item.WEAPON_ARROW)):
				self.AppendTextLine(localeInfo.TOOLTIP_ITEM_BONUS_NEXTADD, self.BONUS_COLOR)

 

 

2. locale_game.txt

Révélation


TOOLTIP_ITEM_BONUS_FIRSTADD	Vous pouvez ajouter des bonus
TOOLTIP_ITEM_BONUS_NEXTADD	Vous pouvez ajouter un bonus supplémentaire

 

 

 

Sincerly,

ASIKOO

  • Love 11

Share this post


Link to post
Posted (edited)

Thanks for release, already i did something like this in a topic from 2019, so here's:

 

 5SKFcab.png qitNeab.png gq6ofab.png

 

  • locale/en/locale_game.txt
ATTR_6TH_7TH_POSSIBILITY	You can add an additional bonus.
  • root/uiToolTip.py
# Search for:
	def __AppendAttributeInformation(self, attrSlot):
		if 0 != attrSlot:
			for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
				type = attrSlot[i][0]
				value = attrSlot[i][1]

				if 0 == value:
					continue

				affectString = self.__GetAffectString(type, value)
				if affectString:
					affectColor = self.__GetAttributeColor(i, value)
					self.AppendTextLine(affectString, affectColor)
# Replace with:
	def __AppendAttributeInformation(self, attrSlot, attrRareStart = player.ITEM_ATTRIBUTE_SLOT_MAX_NUM, attrRareCount = 2):
		if not self.__IsAttr(attrSlot):
			return

		attrCount = 0
		for attrIndex, (attrType, attrValue) in enumerate(attrSlot):
			if attrValue:
				affectString = self.__GetAffectString(attrType, attrValue)
				if affectString:
					self.AppendTextLine(affectString, self.__GetAttributeColor(attrIndex, attrValue))
					attrCount += 1

		if attrCount in range(attrRareStart, (attrRareStart + attrRareCount) + 1):
			self.AppendTextLine(localeInfo.ATTR_6TH_7TH_POSSIBILITY, self.CONDITION_COLOR)


 

Edited by VegaS™ (see edit history)
  • Love 2

Share this post


Link to post
Posted (edited)
36 minutes ago, VegaS™ said:

Thanks for release, already i did something like this in a topic from 2019, so here's:

 

 5SKFcab.png qitNeab.png gq6ofab.png

 

  • locale/en/locale_game.txt

ATTR_6TH_7TH_POSSIBILITY	You can add an additional bonus.
  • root/uiToolTip.py

# Search for:
	def __AppendAttributeInformation(self, attrSlot):
		if 0 != attrSlot:
			for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
				type = attrSlot[i][0]
				value = attrSlot[i][1]

				if 0 == value:
					continue

				affectString = self.__GetAffectString(type, value)
				if affectString:
					affectColor = self.__GetAttributeColor(i, value)
					self.AppendTextLine(affectString, affectColor)
# Replace with:
	def __AppendAttributeInformation(self, attrSlot, attrRareStart = player.ITEM_ATTRIBUTE_SLOT_MAX_NUM, attrRareCount = 2):
		if not self.__IsAttr(attrSlot):
			return

		attrCount = 0
		for attrIndex, (attrType, attrValue) in enumerate(attrSlot):
			if attrValue:
				affectString = self.__GetAffectString(attrType, attrValue)
				if affectString:
					self.AppendTextLine(affectString, self.__GetAttributeColor(attrIndex, attrValue))
					attrCount += 1

		if attrCount in range(attrRareStart, (attrRareStart + attrRareCount) + 1):
			self.AppendTextLine(localeInfo.ATTR_6TH_7TH_POSSIBILITY, self.CONDITION_COLOR)


 

 

Thanks for release

this is better
but your code still good VegaS

Edited by Khaled (see edit history)

Share this post


Link to post

Nice idea, thank you :)

Spoiler

56beca3b6a.png

 

  • Sad 1

Share this post


Link to post

Vegas already did that and his is working perfect like official :D but still thank you!

Share this post


Link to post

It depends on the server, obviously if your server doesn't have the 6th and 7th bonuses available, then you need to edit the code.

  • Love 2

Share this post


Link to post

Anyone know how to block description for ARROW? Because in code is declared:

item.GetItemType() == item.ITEM_TYPE_WEAPON

Its a bug because arrow with bonuses is impossible..

  • Love 1

Share this post


Link to post
41 minutes ago, Cunoo said:

Anyone know how to block description for ARROW? Because in code is declared:


item.GetItemType() == item.ITEM_TYPE_WEAPON

Its a bug because arrow with bonuses is impossible..

Spoiler

if (count == 0) and (item.GetItemType() == item.ITEM_TYPE_ARMOR or item.GetItemType() == item.ITEM_TYPE_WEAPON):

if (count == 0) and (item.GetItemType() == item.ITEM_TYPE_ARMOR or (item.GetItemType() == item.ITEM_TYPE_WEAPON and item.GetItemSubType() != item.WEAPON_ARROW)):

Spoiler

if (count < 7 and count != 0) and (item.GetItemType() == item.ITEM_TYPE_ARMOR or item.GetItemType() == item.ITEM_TYPE_WEAPON):

if (count < 7 and count != 0) and (item.GetItemType() == item.ITEM_TYPE_ARMOR or (item.GetItemType() == item.ITEM_TYPE_WEAPON and item.GetItemSubType() != item.WEAPON_ARROW)):

Spoiler

		enum EWeaponSubTypes
		{
			WEAPON_SWORD,
			WEAPON_DAGGER,
			WEAPON_BOW,
			WEAPON_TWO_HANDED,
			WEAPON_BELL,
			WEAPON_FAN,
			WEAPON_ARROW,
			WEAPON_NUM_TYPES,

			WEAPON_NONE = WEAPON_NUM_TYPES+1,
		};

 

 

  • Love 2

Share this post


Link to post

Cool!

Thats I want ❤️ just how to declare subtype in uitooltip :D

Share this post


Link to post
2 hours ago, Mali61 said:
  Reveal hidden contents
  Reveal hidden contents
  Reveal hidden contents

 

 

Well seen for the arrows

thx :) 

Share this post


Link to post
Posted (edited)
if value > 0:
					count = count+1

nonsense, remove the if value, just add count = count + 1 bc otherwise, weapons or armors with - bonus like toxicsword or smth like this wont get the tooltip.

 

and for official like, use this:

 

			if (count > 4 and count < 7) and (item.GetItemType() == item.ITEM_TYPE_ARMOR or (item.GetItemType() == item.ITEM_TYPE_WEAPON and item.GetItemSubType() != item.WEAPON_ARROW)):
				self.AppendTextLine(localeInfo.TOOLTIP_ITEM_BONUS_NEXTADD, self.BONUS_COLOR)

it only shows when you have already 4 bonus in item, not for first bonus. (for me, i use it only to show for 6 and 7. bonus, not for 5th.) if you want for 5th bonus, edit the count > 4 to count > 3.)

Edited by Mafuyu (see edit history)

Share this post


Link to post

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
  • Recently Browsing   0 members

    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.