Jump to content

Recommended Posts

  • Active+ Member

Hey guys,

is here someone who know how to get name of selected item in this function?

I mean like % (name) so I can use it in locale_game as %s 

self.questionDialog.SetText(localeInfo.MESSENGER_DO_YOU_DELETE % (name))

def OnPressRemoveButton(self):
		if self.selectedItem:
			if self.selectedItem.CanRemove():
				self.questionDialog = uiCommon.QuestionDialogOneLine()
				self.questionDialog.SetText(localeInfo.MESSENGER_DO_YOU_DELETE)
				self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnRemove))
				self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
				self.questionDialog.Open()

Thanks for answers!

Sincerely,

ReFresh

I'll be always helpful!  😉

Link to comment
https://metin2.dev/topic/20569-how-can-i-get-name-of-selected-item/
Share on other sites

hace 31 minutos, ReFresh dijo:

Hey guys,

is here someone who know how to get name of selected item in this function?

I mean like % (name) so I can use it in locale_game as %s 

self.questionDialog.SetText(localeInfo.MESSENGER_DO_YOU_DELETE % (name))


def OnPressRemoveButton(self):
		if self.selectedItem:
			if self.selectedItem.CanRemove():
				self.questionDialog = uiCommon.QuestionDialogOneLine()
				self.questionDialog.SetText(localeInfo.MESSENGER_DO_YOU_DELETE)
				self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnRemove))
				self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
				self.questionDialog.Open()

Thanks for answers!

Sincerely,

ReFresh

First of all,

item.SelectItem(vnum)

and then

item.GetItemName()

  • Active+ Member
3 minutes ago, ѕeмa™ said:

First of all,

item.SelectItem(vnum)

and then

item.GetItemName()

I mean the selected "item" is player name from uimessenger list.

I'll be always helpful!  😉

  • Forum Moderator
self.questionDialog.SetText(localeInfo.MESSENGER_DO_YOU_DELETE % self.selectedItem.GetName())

 

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