From 6b8c9adb7f3a6cf639099036f6dd6de8086fade5 Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Wed, 19 Jul 2023 22:11:55 +0100 Subject: [PATCH] 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 --- game/scripts/gui/main_menu.rpy | 2 +- game/scripts/options.rpy | 2 +- game/scripts/utility/updater.rpy | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/game/scripts/gui/main_menu.rpy b/game/scripts/gui/main_menu.rpy index 14190223..ec01c15a 100644 --- a/game/scripts/gui/main_menu.rpy +++ b/game/scripts/gui/main_menu.rpy @@ -255,7 +255,7 @@ screen navigation(title=None): if not title: 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) else: textbutton "Check for updates" action CheckUpdates(300) sensitive (not prerelease) diff --git a/game/scripts/options.rpy b/game/scripts/options.rpy index 86d59851..f1fd1f74 100644 --- a/game/scripts/options.rpy +++ b/game/scripts/options.rpy @@ -38,7 +38,7 @@ define config.debug = config.developer or prerelease define config.console = True # Game version and naming -define config.version = "1.45.2" +define config.version = "1.45.3" define compatible_version = 1.451 define config.name = "Witch Trainer Silver" diff --git a/game/scripts/utility/updater.rpy b/game/scripts/utility/updater.rpy index 14c1ed17..370be1ae 100644 --- a/game/scripts/utility/updater.rpy +++ b/game/scripts/utility/updater.rpy @@ -5,6 +5,10 @@ init python: UPDATE_VER = None UPDATE_HINT = "" + if config.developer: + persistent._update_version = {} + persistent._update_last_checked = {} + @renpy.pure class CheckUpdates(Action): 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) - if version_float(UPDATE_VER) < version_float(): + if version_float(UPDATE_VER) > version_float(): if not self.onetime: UPDATE_HINT = "New game version available!" renpy.restart_interaction() if self.autostart: renpy.invoke_in_new_context(updater.update, self.url, simulate=self.simulate, **self.kwargs) - elif not UPDATE_VER: - ui.timer(2.0, SetVariable("UPDATE_HINT", "Server is not responding.")) + # elif not UPDATE_VER: + # ui.timer(2.0, SetVariable("UPDATE_HINT", "Server is not responding.")) elif not self.onetime: ui.timer(2.0, SetVariable("UPDATE_HINT", "You are already up-to-date."))