Jump to content

Recommended Posts

Hi guys , i have a little but difficult problem. I Press escape key on game window but not open SystemDialog . 

I Have not syserr but my tracef on debug : 

https://metin2.download/picture/ti55EoYtbCP75MCR01mTtC9QyGU8QS5A/.png

https://metin2.download/picture/1SkHLuuYoYHlQF2WN7b8CD0r7E4T36VA/.png

https://metin2.download/picture/R2Wwl5Kz79qnlXBW70vUOig70me1cVo0/.png

My Event :

	BOOL CWindow::RunPressEscapeKeyEvent()
	{
		TWindowContainer::reverse_iterator itor;
		for (itor = m_pChildList.rbegin(); itor != m_pChildList.rend(); ++itor)
		{
			CWindow * pWindow = *itor;
			
			if (pWindow->IsShow())
			{
				Tracenf("CloseWindow: %s", pWindow->GetName());
				if (pWindow->RunPressEscapeKeyEvent())
					return TRUE;
			}
		}
		
		Tracenf("CloseWindow2: %s", this->GetName());

		if (OnPressEscapeKey())
			return TRUE;

		Tracenf("CloseWindow3: %s", this->GetName());
		
		return FALSE;
	}

Thanks .

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/15847-onpressescapekeyevent-problem/
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

Be sure you have same on root/game.py

	def OnPressEscapeKey(self):
		if app.TARGET == app.GetCursor():
			app.SetCursor(app.NORMAL)
		elif TRUE == mouseModule.mouseController.isAttached():
			mouseModule.mouseController.DeattachObject()
		else:
			self.interface.OpenSystemDialog()
		return TRUE

 

3 minutes ago, Tasho said:

Be sure you have same on root/game.py


	def OnPressEscapeKey(self):
		if app.TARGET == app.GetCursor():
			app.SetCursor(app.NORMAL)
		elif TRUE == mouseModule.mouseController.isAttached():
			mouseModule.mouseController.DeattachObject()
		else:
			self.interface.OpenSystemDialog()
		return TRUE

 

	def OnPressEscapeKey(self):
		if app.TARGET == app.GetCursor():
			app.SetCursor(app.NORMAL)
		elif True == mouseModule.mouseController.isAttached():
			mouseModule.mouseController.DeattachObject()
		else:
			self.interface.OpenSystemDialog()
		return True

 

Then go and make a dbg on class where is opened for can be sure is called or is problem with your uiscript (some keys failed) and can't show and not all time show something on syserr.

root/uiSystem.py (replace the function OpenDialog) with this:

	def OpenDialog(self):
		import chat
		chat.AppendChat(chat.CHAT_TYPE_INFO, "uiSystem.SystemDialog().OpenDialog()")
		self.Show()

If he show you message and not appear the window that means you have problem in ../SystemDialog.py (uiscript or locale)

You can try also with:

#self.Show()
ui.ScriptWindow.Show(self)

 

6 minutes ago, Tasho said:

Then go and make a dbg on class where is opened for can be sure is called or is problem with your uiscript (some keys failed) and can't show and not all time show something on syserr.

root/uiSystem.py (replace the function OpenDialog) with this:


	def OpenDialog(self):
		import chat
		chat.AppendChat(chat.CHAT_TYPE_INFO, "uiSystem.SystemDialog().OpenDialog()")
		self.Show()

If he show you message and not appear the window that means you have problem in ../SystemDialog.py (uiscript or locale)

You can try also with:


#self.Show()
ui.ScriptWindow.Show(self)

 

Binary cant call OnPressEscapeKey ^^ I Press button system open system menu.

And not append chat ^^

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.