WIP: Fixes #7 - Game should be able to update itself #21

Closed
MichaelYick wants to merge 5 commits from updates into Patchy-Patch5

View File

@ -1,4 +1,16 @@
################################################################################ ###Updater Python stuff###
init python:
def UpdateCheck():
renpy.notify("Updater Ran")
pendingVersion = updater.UpdateVersion("https://updates.snootgame.xyz/updates.json")
if pendingVersion == None:
persistent.updateresult = "No New Version is Available"
renpy.notify(persistent.updateresult)
else:
renpy.notify(persistent.updateresult + "can be downloaded")
updater.Update("https://updates.snootgame.xyz/updates.json", force=True)
################################################################################
## Initialization ## Initialization
################################################################################ ################################################################################
@ -712,19 +724,16 @@ screen updates():
## The use statement includes another screen inside this one. The actual ## The use statement includes another screen inside this one. The actual
## contents of the main menu are in the navigation screen. ## contents of the main menu are in the navigation screen.
##todo add size
##add gui.game_menu_background
vbox: vbox:
coolestskinnieinthejungle marked this conversation as resolved Outdated
- 727 textbutton _("Update Now!") action UpdateCheck()
+ 727 textbutton _("Update Now!") action Function(UpdateCheck)

there's a way to automagically make this a commit that can edit it with the push of a button but i cant fucking remember how

```diff - 727 textbutton _("Update Now!") action UpdateCheck() + 727 textbutton _("Update Now!") action Function(UpdateCheck) ``` there's a way to automagically make this a commit that can edit it with the push of a button but i cant fucking remember how
xpos 1040 xpos 1140
# yalign 0.03
ypos 800 ypos 800
text _("UPDATES") #text _("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") label _("Auto Update")
textbutton _("Enable Automatic Updates") action ToggleVariable("persistent.autoup", True, False) #textbutton _("Enable Automatic Updates") action ToggleVariable("persistent.autoup", True, False)
textbutton _("Update Now!") ##action ("persistent.autoup", True, False) This should also set the value of updateresults textbutton _("Update Now!") action Function(UpdateCheck)
label _("Update Result:\n") label _("Update Result:\n")
text _("[persistent.updateresult!t]\n") text _("[persistent.updateresult!t]\n")
textbutton "Back to Extras" action ShowMenu("extras") textbutton "Back to Extras" action ShowMenu("extras")
@ -1244,11 +1253,11 @@ screen extrasnavigation():
# xpos 590 # xpos 590
xalign 0.79 xalign 0.79
yalign 1.0 #0.9 yalign 1.0 #0.9
imagebutton auto "gui/button/menubuttons/helpbutton_%s.png" action ShowMenu("help") imagebutton auto "gui/button/menubuttons/helpbutton_%s.png" action ShowMenu('help')
imagebutton auto "gui/button/menubuttons/aboutbutton_%s.png" action ShowMenu("about") imagebutton auto "gui/button/menubuttons/aboutbutton_%s.png" action ShowMenu('about')
imagebutton auto "gui/button/menubuttons/updatesbutton_%s.png" action ShowMenu("updates") imagebutton auto "gui/button/menubuttons/updatesbutton_%s.png" action ShowMenu('updates')
imagebutton auto "gui/button/menubuttons/gallerybutton_%s.png" action ShowMenu("gallery") imagebutton auto "gui/button/menubuttons/gallerybutton_%s.png" action ShowMenu('gallery')
imagebutton auto "gui/button/menubuttons/returnbutton_%s.png" action ShowMenu("main_menu") imagebutton auto "gui/button/menubuttons/returnbutton_%s.png" action ShowMenu('main_menu')
## Help screen ################################################################# ## Help screen #################################################################