reepblue Posted October 4, 2020 Share Posted October 4, 2020 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 } 1 1 Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted October 4, 2020 Share Posted October 4, 2020 Closing and hiding are not necessarily the same thing though. You probably want to use events for any kind of advanced window handling. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted October 4, 2020 Author Share Posted October 4, 2020 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. 1 Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted October 6, 2020 Share Posted October 6, 2020 If anything, I think calling window::Closed() should reset the state, like how MouseHit does. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted October 6, 2020 Author Share Posted October 6, 2020 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. 1 Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted October 6, 2020 Share Posted October 6, 2020 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. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted October 6, 2020 Author Share Posted October 6, 2020 Ah, maybe do window::Close(bool) and have the default be true. 1 Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.