Mobile: perfom operations when the app lost focus [SOLVED]
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Mobile: perfom operations when the app lost focus [SOLVED]
Is it possible de perfom operations when the app lost focus on mobile phone ?
Last edited by Jibus on Wed Oct 19, 2016 3:51 am, edited 1 time in total.
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Mobile: perfom operations when the app lost focus
What sort of operation? There generally isn't time to do anything other than save the state when the application loses focus on mobile.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Mobile: perfom operations when the app lost focus
I would like to connect to a server in order to update some data.
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Mobile: perfom operations when the app lost focus
You can take a look at check_suspend in renpy/display/core.py, and hook in before the second save on line 2297. There's no guarantees it will work - once the power button is pushed, the app is supposed to get to sleep ASAP, and contacting a server seems the opposite of that.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Mobile: perfom operations when the app lost focus
Ok, thank you ! I am not a huge fan of changing core file but I will have a look !
Who is online
Users browsing this forum: No registered users