Jump to content

Item Slot Tooltip


Go to solution Solved by VegaS™,

Recommended Posts

  • Forum Moderator
  • Solution

Try this.

Search for:

	self.itemSlot = self.GetChild("item_slot")

Add after:

	self.itemSlot.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
	self.itemSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))

Search for:

        self.itemSlot.SetOverInItemEvent = lambda arg = vnum: self.OverInItem(arg)
        self.itemSlot.SetOverOutItemEvent = lambda arg = self.tooltipItem: self.OverOutItem(arg)

Replace it with:

	# Clear the tooltip line.
	self.tooltipItem.ClearToolTip()
	# Insert the description of item.
	self.tooltipItem.SetInventoryItem(vnum)
	# Hide the tooltip line because after you insert a description, the ShowToolTip is called.
	self.tooltipItem.HideToolTip()

Search for:

	def OverInItem(self, vnum):
		self.tooltipItem.SetInventoryItem(vnum)
		self.tooltipItem.Show()
   
	def OverOutItem(self, tooltip):
		self.tooltipItem.HideToolTip()
		self.tooltipItem.ClearToolTip()

Replace it with:

    def OverInItem(self):
		if self.tooltipItem:
			self.tooltipItem.ShowToolTip()
   
    def OverOutItem(self):
		if self.tooltipItem:
			self.tooltipItem.HideToolTip()

 

  • Love 2
Link to comment
Share on other sites

7 hours ago, VegaS™ said:

Try this.

Search for:


	self.itemSlot = self.GetChild("item_slot")

Add after:


	self.itemSlot.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
	self.itemSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))

Search for:


        self.itemSlot.SetOverInItemEvent = lambda arg = vnum: self.OverInItem(arg)
        self.itemSlot.SetOverOutItemEvent = lambda arg = self.tooltipItem: self.OverOutItem(arg)

Replace it with:


	# Clear the tooltip line.
	self.tooltipItem.ClearToolTip()
	# Insert the description of item.
	self.tooltipItem.SetInventoryItem(vnum)
	# Hide the tooltip line because after you insert a description, the ShowToolTip is called.
	self.tooltipItem.HideToolTip()

Search for:


	def OverInItem(self, vnum):
		self.tooltipItem.SetInventoryItem(vnum)
		self.tooltipItem.Show()
   
	def OverOutItem(self, tooltip):
		self.tooltipItem.HideToolTip()
		self.tooltipItem.ClearToolTip()

Replace it with:


    def OverInItem(self):
		if self.tooltipItem:
			self.tooltipItem.ShowToolTip()
   
    def OverOutItem(self):
		if self.tooltipItem:
			self.tooltipItem.HideToolTip()

 

Thank you!!

Link to comment
Share on other sites

  • Gold

@Paikei I tried to use your code but I got an error:

0308 15:24:21738 ::   File "game.py", line 1351, in OnMouseLeftButtonUp

0308 15:24:21738 ::   File "game.py", line 1388, in __PutItem

0308 15:24:21738 ::   File "game.py", line 1446, in __DropItem

0308 15:24:21738 :: TypeError
0308 15:24:21738 :: : 
0308 15:24:21738 :: Open() takes exactly 3 arguments (1 given)
0308 15:24:21738 :: 

Can you help me with it please?

I'll be always helpful! 👊 

Link to comment
Share on other sites

vor 33 Minuten schrieb ReFresh:

@Paikei I tried to use your code but I got an error:


0308 15:24:21738 ::   File "game.py", line 1351, in OnMouseLeftButtonUp

0308 15:24:21738 ::   File "game.py", line 1388, in __PutItem

0308 15:24:21738 ::   File "game.py", line 1446, in __DropItem

0308 15:24:21738 :: TypeError
0308 15:24:21738 :: : 
0308 15:24:21738 :: Open() takes exactly 3 arguments (1 given)
0308 15:24:21738 :: 

Can you help me with it please? game.py line 1446

call all arguments

Link to comment
Share on other sites

  • Gold

@Syriza Tried, and got the same error but with many arguments.

In this line is problem:

def Open(self, vnum, count):

I'm calling not defined functions

Idk how should I define them, I tried to define them in init of uicommon dialog class but the uitoolip of item wasn't showed.

I'll be always helpful! 👊 

Link to comment
Share on other sites

vor einer Stunde schrieb ReFresh:

@Syriza Tried, and got the same error but with many arguments.

In this line is problem:

def Open(self, vnum, count):

I'm calling not defined functions

Idk how should I define them, I tried to define them in init of uicommon dialog class but the uitoolip of item wasn't showed.

You need to define the function, from where you call it. i will sent you example tomorrow, i remember having files with this Feature.

  • Love 1
Link to comment
Share on other sites

  • Gold

@Syriza

Look, if I'll define the functions inside of:

def __init__(self):

Like:

		self.vnum = mouseModule.mouseController.GetAttachedItemIndex()
		self.count = mouseModule.mouseController.GetAttachedItemCount()

And call it inside the 

def Open(self):

It will show the dialog and item in slots and count of item but the ThinBoard with bonuses and item description etc. is not showed. I can see only small piece of thinboard like 1x1 cm when I mouse over the item.

  • Confused 1

I'll be always helpful! 👊 

Link to comment
Share on other sites

vor 28 Minuten schrieb ReFresh:

@Syriza

Look, if I'll define the functions inside of:


def __init__(self):

Like:


		self.vnum = mouseModule.mouseController.GetAttachedItemIndex()
		self.count = mouseModule.mouseController.GetAttachedItemCount()

And call it inside the 


def Open(self):

It will show the dialog and item in slots and count of item but the ThinBoard with bonuses and item description etc. is not showed. I can see only small piece of thinboard like 1x1 cm when I mouse over the item.

 

Hmm, i think someone else need to help you bro, now i dont know too.

  • Confused 1
Link to comment
Share on other sites

4 hours ago, ReFresh said:

@Syriza

Look, if I'll define the functions inside of:


def __init__(self):

Like:


		self.vnum = mouseModule.mouseController.GetAttachedItemIndex()
		self.count = mouseModule.mouseController.GetAttachedItemCount()

And call it inside the 


def Open(self):

It will show the dialog and item in slots and count of item but the ThinBoard with bonuses and item description etc. is not showed. I can see only small piece of thinboard like 1x1 cm when I mouse over the item.

in game.py inside "def __DropItem", search for itemDropQuestionDialog.Open(....)

replace with    itemDropQuestionDialog.Open(dropItemIndex, attachedItemIndex, attachedItemCount)

Link to comment
Share on other sites

  • Gold

@Paikei

If I replace this:

itemDropQuestionDialog.Open()

with this:

itemDropQuestionDialog.Open(dropItemIndex, attachedItemIndex, attachedItemCount)

It will need one more argument in Open() function in uicommon.py.

What I have to add to make it working? I just removed one argument from itemDropQuestionDialog so it looks like this now:

itemDropQuestionDialog.Open(attachedItemIndex, attachedItemCount)

It allow to me to open the drop dialog but the problem is: I still cannot see the ThinBoard with bonuses and item description etc.. I can see only small piece of thinboard like 1x1 cm when I mouse over the item.

I'll be always helpful! 👊 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

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.