mirror of
https://git.cavemanon.xyz/Cavemanon/SnootGame.git
synced 2025-02-02 06:46:34 +01:00
at long last, update + autoupdate working as intended
This commit is contained in:
parent
e02118180e
commit
4338796483
2 changed files with 22 additions and 12 deletions
|
@ -1,14 +1,18 @@
|
||||||
###Updater Python stuff###
|
###Updater Python stuff###
|
||||||
init python:
|
init python:
|
||||||
|
if persistent.updateresult is None:
|
||||||
|
persistent.updateresult = "No new version is available"
|
||||||
|
if persistent.autoup is None:
|
||||||
|
persistent.autoup = False
|
||||||
|
|
||||||
|
updateWebServer = "http://updates.snootgame.xyz/updates.json"
|
||||||
|
|
||||||
def UpdateCheck():
|
def UpdateCheck():
|
||||||
renpy.notify("Updater Ran")
|
pendingVersion = updater.UpdateVersion(updateWebServer)
|
||||||
pendingVersion = updater.UpdateVersion("https://updates.snootgame.xyz/updates.json")
|
|
||||||
if pendingVersion == None:
|
if pendingVersion == None:
|
||||||
persistent.updateresult = "No New Version is Available"
|
persistent.updateresult = "No new version is available"
|
||||||
renpy.notify(persistent.updateresult)
|
|
||||||
else:
|
else:
|
||||||
renpy.notify(persistent.updateresult + "can be downloaded")
|
persistent.updateresult = pendingVersion
|
||||||
updater.Update("https://updates.snootgame.xyz/updates.json", force=True)
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
## Initialization
|
## Initialization
|
||||||
|
@ -16,7 +20,6 @@ init python:
|
||||||
|
|
||||||
init offset = -1
|
init offset = -1
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
## Styles
|
## Styles
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -397,7 +400,6 @@ screen main_menu():
|
||||||
imagebutton auto "gui/button/menubuttons/extrasbutton_%s.png" action ShowMenu("extras")
|
imagebutton auto "gui/button/menubuttons/extrasbutton_%s.png" action ShowMenu("extras")
|
||||||
imagebutton auto "gui/button/menubuttons/quitbutton_%s.png" action Quit(confirm=not main_menu)
|
imagebutton auto "gui/button/menubuttons/quitbutton_%s.png" action Quit(confirm=not main_menu)
|
||||||
|
|
||||||
|
|
||||||
style main_menu_frame is empty
|
style main_menu_frame is empty
|
||||||
style main_menu_vbox is vbox
|
style main_menu_vbox is vbox
|
||||||
style main_menu_text is gui_text
|
style main_menu_text is gui_text
|
||||||
|
@ -731,11 +733,12 @@ screen updates():
|
||||||
label "[config.name!t]"
|
label "[config.name!t]"
|
||||||
text _("Your Version is [config.version!t]\n")
|
text _("Your Version is [config.version!t]\n")
|
||||||
##style_prefix "check"
|
##style_prefix "check"
|
||||||
label _("Auto Update")
|
textbutton _("Enable Automatic Updates") action [Notify("Toggling Automatic Updates..."), ToggleVariable("persistent.autoup", True, False)]
|
||||||
#textbutton _("Enable Automatic Updates") action ToggleVariable("persistent.autoup", True, False)
|
text _("Automatic Updates: [persistent.autoup!t]\n")
|
||||||
textbutton _("Update Now!") action Function(UpdateCheck)
|
textbutton _("Check for Update!") action [Notify("Checking for update..."), Function(UpdateCheck)]
|
||||||
label _("Update Result:\n")
|
label _("Update Check Result:\n")
|
||||||
text _("[persistent.updateresult!t]\n")
|
text _("[persistent.updateresult!t]\n")
|
||||||
|
textbutton _("Update Now!") action updater.Update(updateWebServer, force=True)
|
||||||
textbutton "Back to Extras" action ShowMenu("extras")
|
textbutton "Back to Extras" action ShowMenu("extras")
|
||||||
vbox:
|
vbox:
|
||||||
xpos 1942
|
xpos 1942
|
||||||
|
|
|
@ -292,6 +292,13 @@ image black = "#000"
|
||||||
label splashscreen:
|
label splashscreen:
|
||||||
$ persistent.splashtype = random.randint(0,2000 - 1)
|
$ persistent.splashtype = random.randint(0,2000 - 1)
|
||||||
$ renpy.movie_cutscene("images/intros/CaveManonProductions.webm")
|
$ renpy.movie_cutscene("images/intros/CaveManonProductions.webm")
|
||||||
|
|
||||||
|
if persistent.autoup:
|
||||||
|
python:
|
||||||
|
UpdateCheck()
|
||||||
|
if persistent.updateresult != "No new version is available":
|
||||||
|
updater.update(updateWebServer, force=True)
|
||||||
|
|
||||||
stop sound
|
stop sound
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue