Jump to content

How can I get name of selected item?


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

Link to comment
Share on other sites

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

 

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