Jump to content

UIToolTIP : Bonus Slot Available


Recommended Posts

  • Management

M2 Download Center

This is the hidden content, please
( 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

  • Metin2 Dev 22
  • Good 6
  • Love 20
Link to comment
Share on other sites

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

 

This is the hidden content, please


 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 25
  • Good 7
  • Love 21
Link to comment
Share on other sites

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 Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • 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

 

Link to comment
Share on other sites

  • Management
2 hours ago, Mali61 said:
  Reveal hidden contents
  Reveal hidden contents
  Reveal hidden contents

 

 

Well seen for the arrows

thx :) 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Announcements



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