Jump to content

Delete the "asking function" for some items


Recommended Posts

  • Bronze

Hello again metin2dev community.

.gif

in this video.. i have this notification for yes or no to be sure i sell what is want.. but i want to delete this function only for stones.. and more important to not appear this notification also if i select the button "sell" or how is on my video "vinde"

 

(maybe can sound of waste of time.. but trust me guys.. is a big change for players.. because they need to select yes every time and if they sell idk 30 items + they will die :D )

Link to comment
Share on other sites

  • Premium
On 1/20/2020 at 3:13 PM, SorinSmon said:

Hello again metin2dev community.

.gif

in this video.. i have this notification for yes or no to be sure i sell what is want.. but i want to delete this function only for stones.. and more important to not appear this notification also if i select the button "sell" or how is on my video "vinde"

 

(maybe can sound of waste of time.. but trust me guys.. is a big change for players.. because they need to select yes every time and if they sell idk 30 items + they will die :D )


Hey man, to achieve what you want you will have to do some changes in uishop.py.

Look for this piece of code
 

itemName = item.GetItemName()

questionDialog = uiCommon.QuestionDialog()
questionDialog.SetText(localeInfo.DO_YOU_SELL_ITEM(itemName, attachedCount, itemPrice))
		
questionDialog.SetAcceptEvent(lambda arg1=attachedSlotPos, arg2=attachedCount, arg3 = itemtype: self.OnSellItem(arg1, arg2, arg3))
questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
questionDialog.Open()
self.questionDialog = questionDialog

and change it to something like this
 

itemName = item.GetItemName()
itemType = item.GetItemType()
					
if self.btnSell.IsDown() or item.ITEM_TYPE_METIN == itemType:
	self.OnSellItem(attachedSlotPos, attachedCount, itemtype)
else:
	questionDialog = uiCommon.QuestionDialog()
	questionDialog.SetText(localeInfo.DO_YOU_SELL_ITEM(itemName, attachedCount, itemPrice))
		
	questionDialog.SetAcceptEvent(lambda arg1=attachedSlotPos, arg2=attachedCount, arg3 = itemtype: self.OnSellItem(arg1, arg2, arg3))
	questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
	questionDialog.Open()
	self.questionDialog = questionDialog


I am not 100% sure this will work. It is not tested. Anyway this is the part you need to focus on.
Hope this helps.

Best regards!
sndbn

 

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