Jump to content

UIToolTIP : Bonus Slot Available


Recommended Posts

  • Administrator

M2 Download Center

Download Here ( Internal )

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 12

logo.pngmiaw-network.png
 

Link to post
  • Moderator

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

 

Hidden Content

    Give reaction to this post to see the hidden content.


 

Edited by VegaS™ (see edit history)
  • Love 9
Link to post
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)
Link to post
  • Honorable Member
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 3

no paid service

use at least c++11 and VS19, otherwise I won't help.

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

 

 

Well seen for the arrows

thx :) 

logo.pngmiaw-network.png
 

Link to post
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)
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



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