Jump to content
  • Join-Us

    https://metin2.dev is the 1st international community on Metin2 development. Join us to develop your skills and share your knowledge with the community, respectful and ethical forum.

  • 0

HyperlinkItemToolTip ImageBox


ReFresh

Question

  • Premium

Hey guys,

someone got an idea how to make ImageBox part of ToolTip thinboard window?

Now you cannot close the ToolTip thinboard window by clicking on ImageBox, in this case it's item socket image.

You can try it by yourself:

Send item link to chat with ITEM_PRISM (Glass of Insight):

21235071113.png

Then try to click for example on socket image, it won't close the ToolTip thinboard window:

212311slot.png

File: uiToolTip.py

Spoiler
class HyperlinkItemToolTip(ItemToolTip):
	def __init__(self):
		ItemToolTip.__init__(self, isPickable=True)

	def SetHyperlinkItem(self, tokens):
		minTokenCount = 3 + player.METIN_SOCKET_MAX_NUM
		maxTokenCount = minTokenCount + 2 * player.ATTRIBUTE_SLOT_MAX_NUM
		if tokens and len(tokens) >= minTokenCount and len(tokens) <= maxTokenCount:
			head, vnum, flag = tokens[:3]
			itemVnum = int(vnum, 16)
			metinSlot = [int(metin, 16) for metin in tokens[3:6]]

			rests = tokens[6:]
			if rests:
				attrSlot = []

				rests.reverse()
				while rests:
					key = int(rests.pop(), 16)
					if rests:
						val = int(rests.pop())
						attrSlot.append((key, val))

				attrSlot += [(0, 0)] * (player.ATTRIBUTE_SLOT_MAX_NUM - len(attrSlot))
			else:
				attrSlot = [(0, 0)] * player.ATTRIBUTE_SLOT_MAX_NUM

			self.ClearToolTip()
			self.AddItemData(itemVnum, metinSlot, attrSlot)

			ItemToolTip.OnUpdate(self)

	def OnUpdate(self):
		pass

	def OnMouseLeftButtonDown(self):
		self.Hide()

 

With this function, you should be able to close the ToolTip thinboard window, but for some reason it's not working with clicking on the ImageBox:

Spoiler
def OnMouseLeftButtonDown(self):
	self.Hide()

 

If someone got an idea for solution, I will be really glad!

Thanks for possible answers!

Sincerely,

ReFresh

Edited by ReFresh
  • Metin2 Dev 1

I'll be always helpful! 👊 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

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


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