I am developing a Python tutorial and for this purpose I thought I was a good idea to open the developer options. The developer options allow to access a Python console, know the variables that currently exist and of course you are able to cheat (weee!).
Although I am not fan of cheating, a Python console in a Python tutorial, sounds cool. Unfortunately, such console is NOT available in Android devices. So it raises the question, does Ren'py can know which OS is running. The answer is a big NO! however Python can know that. So if it detects an Android...
If there is any mistake, make me know, Thanks!
See the code below:
Code: Select all
init:
import re, os
...yada yada dialogues
...
label OS:
python:
if re.match(r".*(cyanogenmod|gbaedb).*", os.uname()[2]):
h "The developer options are not available for Android"
h "If you want to use it, please install this program in Laptop or desktop computer"
else:
h "You are about to open the developer console"
h 'I know, that it sounds cheese but with "with a lot of power there is a lot of responsibility"'
h "Please {color=#f00}NEVER CREATE A VARIABLE WITH THE SAME NAME THAT THE ONES THAT EXIT{/color}\nThe program for sure will break!"
h "In the next dialog the game will restart"
python
persistent.developer = True
renpy.quit(relaunch=True)