Jump to content

Recommended Posts

  • Honorable Member

M2 Download Center

This is the hidden content, please
( Internal )

This is the hidden content, please
( GitHub )

183321142430721-b4ea8201-0985-45f6-8973-

 

  • Metin2 Dev 334
  • kekw 2
  • Eyes 2
  • Dislove 5
  • Cry 1
  • Smile Tear 1
  • Think 5
  • Confused 2
  • Scream 3
  • Lmao 1
  • Good 78
  • Love 19
  • Love 205

 

Link to comment
https://metin2.dev/topic/25000-pick-up-with-filter-instant/
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
  • 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
  • Lmao 2
  • Love 3

 

  • 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()

 

 

  • Metin2 Dev 1
  • Good 1
  • Love 4

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

 

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

  • 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

 

33 minutes ago, rares2017 said:

I have this error, do you know how to solve it? https://metin2.download/picture/PzF9oR0lJ8vytSpwvBrzW2M15l2na3H8/.png

Edited by Metin2 Dev
Core X - External 2 Internal
16 minutes ago, SCOOB said:

I have this error, do you know how to solve it? https://metin2.download/picture/PzF9oR0lJ8vytSpwvBrzW2M15l2na3H8/.png

#include "../gamelib/ItemData.h" in PythonSystem.h

Edited by Metin2 Dev
Core X - External 2 Internal
  • Honorable Member
21 minutes ago, SCOOB said:

I have this error, do you know how to solve it? https://metin2.download/picture/PzF9oR0lJ8vytSpwvBrzW2M15l2na3H8/.png

https://en.cppreference.com/w/cpp/language/constexpr

Edited by Metin2 Dev
Core X - External 2 Internal

 

3 minutes ago, Mali said:

oh okay, so I need to update my binary source. got it.

Any work-around it until then? Thanks.

 

What about const auto?

Edited by SCOOB
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

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
  • Good 1
  • Love 1

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



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.