Im curious how do I make it as difficult as possible to quit a multiplayer game prematurely on a desktop?
Don’t get me wrong I want the players to quit whenever they want, but not without seeing the warning message that they’ll suffer penalties for quitting early.
Is there a way to consume the Alt-F4 keys and have a “Are you sure?” message appear instead?
Although I think there’s a way to handle this already somewhere, I can’t seem to find it right now… but one way would be to intercept the WM_QUIT and WM_CLOSE window messages using this How can i add window message? - #12 by gmpreussner_1
Setting the Return Value to true will close the game, false will not.
And finally set the GameInstance Blueprint you created in the editor as the default “Game Instance Class” in Project Settings → Maps & Modes → Game Instance.
Oh wow excellent! Thanks! However I already have a custom game instance, would it be possible to add this piece of code to it instead of making a completely new one? Sorry, just starting out with c++