mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +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_pGraphics = Kernel()->RequestInterface<IEngineGraphics>();
|
||||||
m_pConsole = Kernel()->RequestInterface<IConsole>();
|
m_pConsole = Kernel()->RequestInterface<IConsole>();
|
||||||
|
m_pConfigManager = Kernel()->RequestInterface<IConfigManager>();
|
||||||
|
|
||||||
MouseModeRelative();
|
MouseModeRelative();
|
||||||
|
|
||||||
|
@ -824,6 +825,9 @@ int CInput::Update()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SDL_WINDOWEVENT_MINIMIZED:
|
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);
|
Graphics()->WindowDestroyNtf(Event.window.windowID);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class IEngineGraphics;
|
class IEngineGraphics;
|
||||||
|
class IConfigManager;
|
||||||
|
|
||||||
class CInput : public IEngineInput
|
class CInput : public IEngineInput
|
||||||
{
|
{
|
||||||
|
@ -59,6 +60,7 @@ public:
|
||||||
private:
|
private:
|
||||||
IEngineGraphics *m_pGraphics;
|
IEngineGraphics *m_pGraphics;
|
||||||
IConsole *m_pConsole;
|
IConsole *m_pConsole;
|
||||||
|
IConfigManager *m_pConfigManager;
|
||||||
|
|
||||||
IEngineGraphics *Graphics() const { return m_pGraphics; }
|
IEngineGraphics *Graphics() const { return m_pGraphics; }
|
||||||
IConsole *Console() const { return m_pConsole; }
|
IConsole *Console() const { return m_pConsole; }
|
||||||
|
|
Loading…
Reference in a new issue