mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
Save the config file when the app is minimized on Android
This commit is contained in:
parent
217103a0ee
commit
a266cd2f70
|
@ -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