Jump to content

Official Pickup Slot Effect


Mali

Recommended Posts

  • Honorable Member

M2 Download Center

This is the hidden content, please
( Internal )

This is the hidden content, please

I already created some of it for the transmutation system.

It's best to separate it.

Client part is from 2018 official root.

You can set different colors:

Spoiler

.jpg

You can enable flash effect:

Spoiler

.gif

Spoiler
self.wndItem.SetSlotDiffuseColor(i, wndMgr.COLOR_TYPE_YELLOW)
self.wndItem.SetSlotFlashEffect(i, True)

 

  • Metin2 Dev 205
  • kekw 2
  • Love 99
  • Love 9
  • Good 63
  • Scream 4
  • Think 2
  • Smile Tear 1
  • Confused 4
  • Cry 2
  • Not Good 2
  • Angry 2
  • Dislove 7
Link to comment
Share on other sites

I'm getting this error

Spoiler

0924 16:27:16495 :: uiInventory:1679: RuntimeWarning: tp_compare didn't return -1 or -2 for exception

0924 16:27:16495 :: Traceback (most recent call last):

0924 16:27:16495 ::   File "game.py", line 838, in RefreshInventory

0924 16:27:16495 ::   File "interfaceModule.py", line 692, in RefreshInventory

0924 16:27:16495 ::   File "uiInventory.py", line 840, in RefreshItemSlot

0924 16:27:16495 ::   File "uiInventory.py", line 765, in RefreshBagSlotWindow

0924 16:27:16495 ::   File "uiInventory.py", line 1679, in __HighlightSlot_Refresh

0924 16:27:16495 :: SystemError
0924 16:27:16495 :: : 
0924 16:27:16495 :: ..\Objects\longobject.c:998: bad argument to internal function

 

Edited by rares2017
  • Metin2 Dev 1
  • Love 1
  • Good 1
Link to comment
Share on other sites

9 hours ago, rares2017 said:

I'm getting this error

  Reveal hidden contents

0924 16:27:16495 :: uiInventory:1679: RuntimeWarning: tp_compare didn't return -1 or -2 for exception

0924 16:27:16495 :: Traceback (most recent call last):

0924 16:27:16495 ::   File "game.py", line 838, in RefreshInventory

0924 16:27:16495 ::   File "interfaceModule.py", line 692, in RefreshInventory

0924 16:27:16495 ::   File "uiInventory.py", line 840, in RefreshItemSlot

0924 16:27:16495 ::   File "uiInventory.py", line 765, in RefreshBagSlotWindow

0924 16:27:16495 ::   File "uiInventory.py", line 1679, in __HighlightSlot_Refresh

0924 16:27:16495 :: SystemError
0924 16:27:16495 :: : 
0924 16:27:16495 :: ..\Objects\longobject.c:998: bad argument to internal function

 

pythonutils.cpp 

https://pastebin.com/ 20PmKT5WcX

pythonutils.h

https://pastebin.com/ ar70SR4c

(Delete space after /)

 

Edited by Etzhel
  • Metin2 Dev 3
  • Love 3
  • Good 4
Link to comment
Share on other sites

  • Honorable Member

I checked for other pages and there is no problem with that.

please do not paste your files here, use pastebin.

and do not spam here, write him in pm.

  • Good 1
Link to comment
Share on other sites

4 hours ago, Mali said:

I checked for other pages and there is no problem with that.

Do you mind sharing your uiinventory.py?

#Edit

I already did it. Thanks for the release!

Edited by Fryxion
  • Metin2 Dev 1
Link to comment
Share on other sites

1 hour ago, EAkar said:

The effect comes when an object comes to the 2nd inventory. But when you move the mouse over the object, the effect does not go away.

I do not recommend using any of the systems it shares. It's always causing trouble and it's problematic. It also does not offer support.

Keep using Lent's reflection system and using the martysama highlight system. Because they are the best.

System it's working very well:
https://metin2.download/video/RZDy3YOtC8YauoW83ULww0GU2SXtJl76/.mp4

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

  • Honorable Member
13 minutes ago, rares2017 said:

Great example for using different colors.

s5hLPmi.png

thank you 🥰

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

@Mali flash not work

Syserr:
 

0924 16:27:16495 :: uiInventory:1679: RuntimeWarning: tp_compare didn't return -1 or -2 for exception

0924 16:27:16495 :: Traceback (most recent call last):

0924 16:27:16495 ::   File "game.py", line 838, in RefreshInventory

0924 16:27:16495 ::   File "interfaceModule.py", line 692, in RefreshInventory

0924 16:27:16495 ::   File "uiInventory.py", line 840, in RefreshItemSlot

0924 16:27:16495 ::   File "uiInventory.py", line 765, in RefreshBagSlotWindow

0924 16:27:16495 ::   File "uiInventory.py", line 1679, in __HighlightSlot_Refresh

0924 16:27:16495 :: SystemError
0924 16:27:16495 :: : 
0924 16:27:16495 :: ..\Objects\longobject.c:998: bad argument to internal function

Link to comment
Share on other sites

1 hour ago, Maze said:

@Mali flash not work

Syserr:
 

0924 16:27:16495 :: uiInventory:1679: RuntimeWarning: tp_compare didn't return -1 or -2 for exception

0924 16:27:16495 :: Traceback (most recent call last):

0924 16:27:16495 ::   File "game.py", line 838, in RefreshInventory

0924 16:27:16495 ::   File "interfaceModule.py", line 692, in RefreshInventory

0924 16:27:16495 ::   File "uiInventory.py", line 840, in RefreshItemSlot

0924 16:27:16495 ::   File "uiInventory.py", line 765, in RefreshBagSlotWindow

0924 16:27:16495 ::   File "uiInventory.py", line 1679, in __HighlightSlot_Refresh

0924 16:27:16495 :: SystemError
0924 16:27:16495 :: : 
0924 16:27:16495 :: ..\Objects\longobject.c:998: bad argument to internal function

ScriptLib/PythonUtils.cpp
comment #define PyLong_AsUnsignedLong PyLong_AsUnsignedLongLong.

Link to comment
Share on other sites

  • Honorable Member
2 hours ago, Maze said:

@Mali flash not work

Syserr:
 

0924 16:27:16495 :: uiInventory:1679: RuntimeWarning: tp_compare didn't return -1 or -2 for exception

0924 16:27:16495 :: Traceback (most recent call last):

0924 16:27:16495 ::   File "game.py", line 838, in RefreshInventory

0924 16:27:16495 ::   File "interfaceModule.py", line 692, in RefreshInventory

0924 16:27:16495 ::   File "uiInventory.py", line 840, in RefreshItemSlot

0924 16:27:16495 ::   File "uiInventory.py", line 765, in RefreshBagSlotWindow

0924 16:27:16495 ::   File "uiInventory.py", line 1679, in __HighlightSlot_Refresh

0924 16:27:16495 :: SystemError
0924 16:27:16495 :: : 
0924 16:27:16495 :: ..\Objects\longobject.c:998: bad argument to internal function

FIXED

Link to comment
Share on other sites

@Mali
                    if constInfo.IS_BLEND_POTION_PERM(itemVnum):
                        r, g, b = (255.00 / 255.0), (102.00 / 255.0), (178.00 / 255.0)
                    elif constInfo.IS_BLEND_POTION_NORM(itemVnum):
                        r, g, b = (255.00 / 200.0), (255.00 / 255.0), (204.00 / 255.0)
                    else:
                        r, g, b = (153.00 / 200.0), (76.00 / 255.0), (0.00 / 255.0)

how do i use for example here?

Link to comment
Share on other sites

5 minutes ago, Maze said:

@Mali
                    if constInfo.IS_BLEND_POTION_PERM(itemVnum):
                        r, g, b = (255.00 / 255.0), (102.00 / 255.0), (178.00 / 255.0)
                    elif constInfo.IS_BLEND_POTION_NORM(itemVnum):
                        r, g, b = (255.00 / 200.0), (255.00 / 255.0), (204.00 / 255.0)
                    else:
                        r, g, b = (153.00 / 200.0), (76.00 / 255.0), (0.00 / 255.0)

how do i use for example here?

 if constInfo.IS_BLEND_POTION_PERM(itemVnum):
                isActivated = 0 != metinSocket[1]
                if isActivated:
                    self.wndItem.ActivateSlot(i)
                    self.wndItem.SetSlotDiffuseColor(i, wndMgr.COLOR_TYPE_PURPLE) (or whatever color you want)
                    self.wndItem.SetSlotFlashEffect(i, True)
                else:
                    self.wndItem.DeactivateSlot(i)

  • Good 1
Link to comment
Share on other sites

I took a look at this system, it is a bit nonsensical because after throwing and collecting an item (the same), the effect of receiving in the inventory reappears.  An interesting solution with blinking, although it requires a bit of refinement.

Link to comment
Share on other sites

19 minutes ago, Crowlai said:

I took a look at this system, it is a bit nonsensical because after throwing and collecting an item (the same), the effect of receiving in the inventory reappears.  An interesting solution with blinking, although it requires a bit of refinement.

Why would that be nonsensical? The works just fine. You pick up something (same item or not) and it gets all flashy so you know you just picked that up.  Say you didn t have this and you threw away an item that you don t want and by mistake you pick it up again, now you don t know about it but with this you are sure to know you ve picked it up again by mistake.

Link to comment
Share on other sites

1 hour ago, Crowlai said:

I took a look at this system, it is a bit nonsensical because after throwing and collecting an item (the same), the effect of receiving in the inventory reappears.  An interesting solution with blinking, although it requires a bit of refinement.

I also like to have the items not flash when dropping them from the inventory and picking them up. For anyone who wants to achieve this:

item.h

Spoiler

Search for:

DWORD		GetLastOwnerPID()	{ return m_dwLastOwnerPID; }

Add:

void		SetLastOwnerPID(DWORD pid) { m_dwLastOwnerPID = pid; }

 

item.cpp @ bool CItem::AddToCharacter(LPCHARACTER ch, TItemPos Cell, bool bHighlight)

Spoiler

Search for:

	if (ch->GetDesc())
		m_dwLastOwnerPID = ch->GetPlayerID();

Add ABOVE:

	if (bHighlight)
		bHighlight = this->GetLastOwnerPID() != ch->GetPlayerID();

 

input_db.cpp @ void CInputDB::ItemLoad(LPDESC d, const char* c_pData)

Spoiler

Search for:

item->SetAttributes(p->aAttr);

Add under:

item->SetLastOwnerPID(p->owner);

 

 

Edited by blanco
  • Love 1
Link to comment
Share on other sites

On 10/3/2021 at 10:40 PM, narcisxb said:

Did anyone solve for AUTO POTS? Effect won t work anymore.

I solved mine just changing "ActivateSlot" to "ActivateSlotOld". 

 

If that didn't solve your problem, pm me.

Edited by Fryxion
Link to comment
Share on other sites

#find

        if player.DRAGON_SOUL_INVENTORY == inven_type:
            if app.ENABLE_DRAGON_SOUL_SYSTEM:
                self.wndDragonSoul.HighlightSlot(inven_pos)

#change

        elif player.INVENTORY == inven_type:
            if app.ENABLE_HIGHLIGHT_SYSTEM:
                self.wndInventory.HighlightSlot(inven_pos)

 

 

Edited by Giecu
Link to comment
Share on other sites

uiCharacter.py(line:401) __LoadWindow
uiCharacter.py(line:250) __BindObject
uiCharacter.py(line:292) __SetEmotionSlot

CharacterWindow.__LoadWindow - <type 'exceptions.AttributeError'>:'GridSlotWindow' object has no attribute 'SetSelectItemSlotEvent'

1018 18:06:24345 :: ============================================================================================================
1018 18:06:24345 :: Abort!!!!

Link to comment
Share on other sites



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