Bug fixes

* Fixed updater (AGAIN!!)
* Disabled the 'server not responding' hint because it doesn't really match what's happening in the server code
* Version bump
This commit is contained in:
LoafyLemon 2023-07-19 22:11:55 +01:00
parent 18721850f5
commit 37ed32f50d
3 changed files with 9 additions and 5 deletions

View File

@ -255,7 +255,7 @@ screen navigation(title=None):
if not title: if not title:
if not renpy.mobile: if not renpy.mobile:
if version_float(UPDATE_VER) < version_float(): if version_float(UPDATE_VER) > version_float():
textbutton "Install updates" action InstallUpdates() style_prefix "update_available" sensitive (not prerelease) textbutton "Install updates" action InstallUpdates() style_prefix "update_available" sensitive (not prerelease)
else: else:
textbutton "Check for updates" action CheckUpdates(300) sensitive (not prerelease) textbutton "Check for updates" action CheckUpdates(300) sensitive (not prerelease)

View File

@ -38,7 +38,7 @@ define config.debug = config.developer or prerelease
define config.console = True define config.console = True
# Game version and naming # Game version and naming
define config.version = "1.45.2" define config.version = "1.45.3"
define compatible_version = 1.451 define compatible_version = 1.451
define config.name = "Witch Trainer Silver" define config.name = "Witch Trainer Silver"

View File

@ -5,6 +5,10 @@ init python:
UPDATE_VER = None UPDATE_VER = None
UPDATE_HINT = "" UPDATE_HINT = ""
if config.developer:
persistent._update_version = {}
persistent._update_last_checked = {}
@renpy.pure @renpy.pure
class CheckUpdates(Action): class CheckUpdates(Action):
def __init__(self, interval=3600*6, simulate=None, onetime=False, autostart=True, **kwargs): def __init__(self, interval=3600*6, simulate=None, onetime=False, autostart=True, **kwargs):
@ -52,15 +56,15 @@ init python:
UPDATE_VER = persistent._update_version.get(url, None) UPDATE_VER = persistent._update_version.get(url, None)
if version_float(UPDATE_VER) < version_float(): if version_float(UPDATE_VER) > version_float():
if not self.onetime: if not self.onetime:
UPDATE_HINT = "New game version available!" UPDATE_HINT = "New game version available!"
renpy.restart_interaction() renpy.restart_interaction()
if self.autostart: if self.autostart:
renpy.invoke_in_new_context(updater.update, self.url, simulate=self.simulate, **self.kwargs) renpy.invoke_in_new_context(updater.update, self.url, simulate=self.simulate, **self.kwargs)
elif not UPDATE_VER: # elif not UPDATE_VER:
ui.timer(2.0, SetVariable("UPDATE_HINT", "Server is not responding.")) # ui.timer(2.0, SetVariable("UPDATE_HINT", "Server is not responding."))
elif not self.onetime: elif not self.onetime:
ui.timer(2.0, SetVariable("UPDATE_HINT", "You are already up-to-date.")) ui.timer(2.0, SetVariable("UPDATE_HINT", "You are already up-to-date."))