I should probably start this by saying that I have absolutely no knowledge of how Python or RenPy works, I've only started learning a few days ago so please bear with me!
I'm using the code below to implement a feature for the game to check for updates. Note only "check" for updates, it's simply opening a txt file online, grabbing its content, and comparing it with the config.version.
Code: Select all
init python:
import webbrowser
import requests
import threading
try:
response = requests.get(
'https://whatever.com/whatever.txt')
data = response.text
if float(data) > float(config.version):
updateavailable = 1
else:
updateavailable = 0
except Exception as e:
updateavailable = 3
However, I would like to see how I can have this code executed only when a button (in the main menu) is pressed, and then have a screen to be shown saying that an update is available, or not, or if the checking has failed. As such:
Code: Select all
button:
image "gui/overlay/button_update_icon.png"
pos (449, 548)
action ?
Thank you in advance.