Jump to content

Recommended Posts

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Honorable Member
Posted (edited)

Most probably after the popup window shows, the code returns before the mouseModule could have detached the icon instance.

Spoiler
	def onclickinshop(self, *args):
		#some code here
		if __this_is_not_allowed__(self, *args):
			self.popup.setText("Acest obiect nu este de blabla")
			return
		#some code here too
		mouseModule.mouseController.DeattachObject()

 

 

Start looking in the game.py (OnMouseLeftButtonUp function)
Also you can check with a simple debug message if the DeattachObject of the mouseModule runs or it doesn't, if it runs then the problem may be there inside the Detach function.

Edited by xP3NG3Rx
Link to comment
Share on other sites

12 minutes ago, xP3NG3Rx said:

Most probably after the popup window shows, the code returns before the mouseModule could have detached the icon instance.

  Hide contents
	def onclickinshop(self, *args):
		#some code here
		if __this_is_not_allowed__(self, *args):
			self.popup.setText("Acest obiect nu este de blabla")
			return
		#some code here too
		mouseModule.mouseController.DeattachObject()

 

 

Start looking in the game.py (OnMouseLeftButtonUp function)
Also you can check with a simple debug message if the DeattachObject of the mouseModule runs or it doesn't, if it runs then the problem may be there inside the Detach function.

can you help me ?

uiinventory

https://pastebin.com/BCDsifVd

game

https://pastebin.com/N57EBAVm

Link to comment
Share on other sites

  • Active+ Member

Everyone has this "problem". The problem is in uiShop.py in the function def SellAttachedItem. 
 

			if item.IsAntiFlag(item.ANTIFLAG_SELL):
				popup = uiCommon.PopupDialog()
				popup.SetText(localeInfo.SHOP_CANNOT_SELL_ITEM)
				popup.SetAcceptEvent(self.__OnClosePopupDialog)
				popup.Open()
				self.popup = popup
				return


Add a mouseModule.mouseController.DeattachObject() before the popup appears like this:

 

			if item.IsAntiFlag(item.ANTIFLAG_SELL):
				mouseModule.mouseController.DeattachObject()

				popup = uiCommon.PopupDialog()
				popup.SetText(localeInfo.SHOP_CANNOT_SELL_ITEM)
				popup.SetAcceptEvent(self.__OnClosePopupDialog)
				popup.Open()
				self.popup = popup
				return

 

Link to comment
Share on other sites

4 hours ago, Abel(Tiger) said:

Everyone has this "problem". The problem is in uiShop.py in the function def SellAttachedItem. 
 

			if item.IsAntiFlag(item.ANTIFLAG_SELL):
				popup = uiCommon.PopupDialog()
				popup.SetText(localeInfo.SHOP_CANNOT_SELL_ITEM)
				popup.SetAcceptEvent(self.__OnClosePopupDialog)
				popup.Open()
				self.popup = popup
				return


Add a mouseModule.mouseController.DeattachObject() before the popup appears like this:

 

			if item.IsAntiFlag(item.ANTIFLAG_SELL):
				mouseModule.mouseController.DeattachObject()

				popup = uiCommon.PopupDialog()
				popup.SetText(localeInfo.SHOP_CANNOT_SELL_ITEM)
				popup.SetAcceptEvent(self.__OnClosePopupDialog)
				popup.Open()
				self.popup = popup
				return

 

solved, thanks

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.