Jump to content

Preview item by pressing key, in real time? (render target)


Recommended Posts

  • Active+ Member

Hello! 😄 I would like if someone knows how to help me make the render target appear in real-time when I press LSHIFT. Currently, I have it set to the Shift key, but it only works if I press Shift first and then hover over the item. If I am already hovering over the item and press the "Shift" key, it doesn't work.

 

I have render target volvox: https://metin2.dev/topic/21680-render-target-remastered/

 

This is what I have now:

https://metin2.download/video/DuFjqM4Od23TNo6509GKsOdd2a2vu2uA/.mp4

 

The solution would be in "uitooltip," in the "def OnUpdate(self)" function, but I don't have the necessary knowledge in Python to solve it. I've tried...

 

An example of how I would like it to be is in the compare function that I have added, where if I am already hovering over the item and press CTRL, it works regardless of whether I hover over it before or not:

https://metin2.download/video/HjefzH05yOb7fOvh67l8qaM72lI9q0Ou/.mp4

 

I solved the compare issue after following a tutorial from a member on Dev, which says:

Quote

 

> I have improved the code about show/hide the compare tooltip because you need to press the button alt before moving the mouse over the item. My English isn't good, but here you can see the fix: [Link to the fix](https://metin2.download/picture/Mjw4S503geClPBngGrip5FPFRJM8U59F/.gif)

Open "uitooltip.py" and find:

 

if app.__COMPARE_TOOLTIP__ and app.IsPressed(app.DIK_LALT) and not slotIndex >= player.EQUIPMENT_SLOT_START and CompareItem:
    self.SetCompareItem(itemVnum)


 

Remove or comment out that code.

Now go to "def OnUpdate(self):" and over this code:

 

if app.__COMPARE_TOOLTIP__:
    if self.IsCompare:
        return


 

Add:

if app.IsPressed(app.DIK_G):
    if self.IsCompare:
        return
    if not self.CompareTooltip:
        self.SetCompareItem(self.itemVnum)
else:
    if self.CompareTooltip:
        self.CompareTooltip.Hide()
        self.IsCompare = False
        self.CompareTooltip = None

It should look like this: https://metin2.download/picture/23J65uMbQ9S6Wod7I1JJU52X4asyBN5f/.png

PD: I changed the key to G because the ALT key is used for the Rendertarget system, and two systems caused a bug in the same key. However, you can change the key to any you want.

 

Compare system: https://metin2.dev/topic/23623-compare-item-tooltip-system/

Edited by Metin2 Dev International
Core X - External 2 Internal

spacer.png

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

HI, first u need to check if the key u want to press is in the right file
For example if u want to use alt to make the render target show make sure that u have the def for that key in the part u want to open

Lets say u want to open it from inventory
U need to have something like this
 

			elif app.IsPressed(app.DIK_LALT):
				link = player.GetItemLink(itemSlotIndex)
				ime.PasteString(link)

In uiinventory.py and then in uitooltip.py before you call it for the rendertarget

If u need to make it to idk lets say offlineshop, go in idk offlineshopwindow.py and make sure u have the code about that key for example alt, it does not need to be the same as i posted above but you need to have it implemented so the rendertarget know . Otherwise u need to prerender that by presing alt and moving mouse in and out
make sure u have the rest of code if that file dont suport app.ispressed

Hope you solve it 🙂

Edited by lTz
Link to comment
Share on other sites

  • Active+ Member
Posted (edited)
On 1/7/2024 at 2:38 PM, lTz said:

HI, first u need to check if the key u want to press is in the right file
For example if u want to use alt to make the render target show make sure that u have the def for that key in the part u want to open

Lets say u want to open it from inventory
U need to have something like this
 

			elif app.IsPressed(app.DIK_LALT):
				link = player.GetItemLink(itemSlotIndex)
				ime.PasteString(link)

In uiinventory.py and then in uitooltip.py before you call it for the rendertarget

If u need to make it to idk lets say offlineshop, go in idk offlineshopwindow.py and make sure u have the code about that key for example alt, it does not need to be the same as i posted above but you need to have it implemented so the rendertarget know . Otherwise u need to prerender that by presing alt and moving mouse in and out
make sure u have the rest of code if that file dont suport app.ispressed

Hope you solve it 🙂

Thank you, but it was more complicated than that.

 

I solved it myself after 4 hours of trial and error:

 

https://metin2.download/video/Z1L6qJxxv4IoKU3A1nA4bEiUSJ4iTf3A/.mp4

Edited by Metin2 Dev International
Core X - External 2 Internal

spacer.png

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.