Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Window::Show() should force closestate to true.


Recommended Posts

Fix this so I don't have to hack it. If you're not going to fix this in Leadwerks, definitely apply this in the new engine if you didn't already!

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void ConsoleWindow::Update()
{
	//if (m_pWindow->KeyHit(KEY_END) || m_pWindow->Closed()) App::Shutdown();

	if (m_pWindow->Closed())
	{
		m_pWindow->Hide();
	}

	if (m_pWindow->GetHidden()) return;

	....
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void WinApp::UpdateConsoleWindow()
{
#if defined (USE_INPUTCOMMANDS) && (LEADWERKS_3_1) // TEMP
	if (m_pConsoleWindow != NULL)
	{
		m_pConsoleWindow->Update();
		if (m_pWindow->KeyHit(Key::Tilde) && m_pConsoleWindow->GetEngineWindow()->GetHidden())
		{
			// HACK: set the window's closestate to false so it stays open.
			m_pConsoleWindow->GetEngineWindow()->closestate = false;
			m_pConsoleWindow->GetEngineWindow()->Show();
		}
	}
#endif
}

 

  • Like 1
  • Thanks 1
Link to post

Yeah but at-least for Leadwerks 4, there isn't a event polling for the Window class. If you take the line forcing the member to be true, the window would show for a split second before closing again. What I have now works really well, it's just that I'm worried I'll not have a way to implement this in the new engine as the members of most classes are private. 

  • Like 1
Link to post
3 hours ago, Josh said:

If anything, I think calling window::Closed() should reset the state, like how MouseHit does.

That's weird and not clear. There should be window::Open() then. 

I'll try that, however.

  • Like 1
Link to post

No, I am talking about behavior I could change. Right now, the window has one Closed() state that is set to true forever if the user ever closes it.

  • Like 1
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Facebook Twitter Youtube Github Steam
×
×
  • Create New...