mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-17 13:38:18 +00:00
Merge pull request #8975 from furo321/android-save-minimized
Save the config file when the app is minimized on Android
This commit is contained in:
commit
255694c061
|
@ -80,6 +80,7 @@ void CInput::Init()
|
|||
|
||||
m_pGraphics = Kernel()->RequestInterface<IEngineGraphics>();
|
||||
m_pConsole = Kernel()->RequestInterface<IConsole>();
|
||||
m_pConfigManager = Kernel()->RequestInterface<IConfigManager>();
|
||||
|
||||
MouseModeRelative();
|
||||
|
||||
|
@ -824,6 +825,9 @@ int CInput::Update()
|
|||
}
|
||||
break;
|
||||
case SDL_WINDOWEVENT_MINIMIZED:
|
||||
#if defined(CONF_PLATFORM_ANDROID) // Save the config when minimized on Android.
|
||||
m_pConfigManager->Save();
|
||||
#endif
|
||||
Graphics()->WindowDestroyNtf(Event.window.windowID);
|
||||
break;
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <vector>
|
||||
|
||||
class IEngineGraphics;
|
||||
class IConfigManager;
|
||||
|
||||
class CInput : public IEngineInput
|
||||
{
|
||||
|
@ -59,6 +60,7 @@ public:
|
|||
private:
|
||||
IEngineGraphics *m_pGraphics;
|
||||
IConsole *m_pConsole;
|
||||
IConfigManager *m_pConfigManager;
|
||||
|
||||
IEngineGraphics *Graphics() const { return m_pGraphics; }
|
||||
IConsole *Console() const { return m_pConsole; }
|
||||
|
|
Loading…
Reference in a new issue