Jump to content
×
×
  • Create New...

Pick Up With Filter & Instant


Recommended Posts

  • Administrator

You are creating the 25000th topic! 🥰

  • Love 1

If you want to contact the Metin2 Dev team, please open a ticket on the Discord server or
you can send a private message, don't forget to include the whole team as the recipient...

english_banner.gif

Link to comment
Share on other sites

  • Honorable Member

kEEkWsT.png

 

Try to avoid python memory leaks with lambdas in setevent.

Button.SetToggleDownEvent(ui.__mem_func__(self.__OnClickPickUpFilterButton), Index)

 

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

  • Honorable Member
8 minutes ago, xP3NG3Rx said:

kEEkWsT.png

 

Try to avoid python memory leaks with lambdas in setevent.

Button.SetToggleDownEvent(ui.__mem_func__(self.__OnClickPickUpFilterButton), Index)

 

45c6255bd1.png

i will use my vegas wildcard.

@VegaS™

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

  • Honorable Member

Ahh okay, I see.

Old shit class from 2004:

Spoiler
class ToggleButton(Button):
	def __init__(self):
		Button.__init__(self)

		self.eventUp = None
		self.eventDown = None

	def __del__(self):
		Button.__del__(self)

		self.eventUp = None
		self.eventDown = None

	def SetToggleUpEvent(self, event):
		self.eventUp = event

	def SetToggleDownEvent(self, event):
		self.eventDown = event

	def RegisterWindow(self, layer):
		self.hWnd = wndMgr.RegisterToggleButton(self, layer)

	def OnToggleUp(self):
		if self.eventUp:
			self.eventUp()

	def OnToggleDown(self):
		if self.eventDown:
			self.eventDown()

 

From 2018:

Spoiler
class ToggleButton(Button):
	def __init__(self):
		Button.__init__(self)

		self.eventUp = None
		self.eventDown = None

		self.eventUpArgs = None
		self.eventDownArgs = None

	def __del__(self):
		Button.__del__(self)

		self.eventUp = None
		self.eventDown = None

	def SetToggleUpEvent(self, event, *args):
		self.eventUp = event
		self.eventUpArgs = args

	def SetToggleDownEvent(self, event, *args):
		self.eventDown = event
		self.eventDownArgs = args

	def RegisterWindow(self, layer):
		self.hWnd = wndMgr.RegisterToggleButton(self, layer)

	def OnToggleUp(self):
		if self.eventUp:
			if self.eventUpArgs:
				apply(self.eventUp, self.eventUpArgs)
			else:
				self.eventUp()

	def OnToggleDown(self):
		if self.eventDown:
			if self.eventDownArgs:
				apply(self.eventDown, self.eventDownArgs)
			else:
				self.eventDown()

 

 

  • Love 3
  • Good 1
Link to comment
Share on other sites

Good job.

 

One sugestion: Use a BYTE for all filters or a 16 bits type (if it's not enough). You can easly set on every bit of the variable a flag value (0 = not set, 1 = set) and it's more optimized and easier to store in config.

 

spacer.png

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

  • Honorable Member
1 hour ago, Johnny69 said:

Good job.

 

One sugestion: Use a BYTE for all filters or a 16 bits type (if it's not enough). You can easly set on every bit of the variable a flag value (0 = not set, 1 = set) and it's more optimized and easier to store in config.

 

spacer.png

 

Bitset is more useful for this system, I used it in the update. 

Thanks anyway.

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

  • 2 weeks later...
  • 8 months later...

It works perfectly! Is it possible to change it to when the item is locked and click on it to pick up? In other words, leave the filter only on the 'Z' key?

 

Edit: 

I would like to make more precise checks, looking at the item's subtype, how can I use type and subtype at the same time?

IsWearableFlag(CItemData::WEARABLE_SHIELD): return 9;

Edited by Klaus
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
On 8/25/2021 at 4:33 PM, Klaus said:

It works perfectly! Is it possible to change it to when the item is locked and click on it to pick up? In other words, leave the filter only on the 'Z' key?

 

Edit: 

I would like to make more precise checks, looking at the item's subtype, how can I use type and subtype at the same time?

IsWearableFlag(CItemData::WEARABLE_SHIELD): return 9;

I'm following the same questions.

Thanks!

Link to comment
Share on other sites

  • 1 month later...
  • Honorable Member

142676680-98a5679f-da7c-4944-a01d-f2f844

Spoiler

-) Costume Category(BODY, HAIR)

-) Skillforget

+) Chest(GIFTBOX)

+) Potion(USE_POTION, USE_ABILITY_UP, USE_POTION_NODELAY, USE_POTION_CONTINUE)

+) Material

+) Picking Method

 

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

2 minutes ago, rares2017 said:

I had this problem too and it was solved with #include "../gamelib/ItemData.h" in PythonSystem.h

I tried but it shows the same error 😞 

can you please share with me your pythonsystem.h? also, do you have VS22 ?

Edited by SCOOB
Link to comment
Share on other sites

Yeah.. I still have VS2013 so if someone can find a fix for the errors on this vs version, that would be awesome. If not, no problem.

 

Solved Thanks @ Malifor the tips!

If anyone has this problem:

 

Comment the static constexpr line from the header file and then go to the cpp file:

 

Search for:

 

inputFile.open

and

outputFile.open

and then change them like this:

inputFile.open("pickupfile.dat", std::ios::binary);

outputFile.open("pickupfile.dat", std::ios::binary);

 

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

  • Recently Browsing   0 members

    • No registered users viewing this page.


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.