forked from Cavemanon/SnootGame
set up a small system where the game will check if it needs updated and notifys you on its status. This should be replaced with a proper text notification though.
This commit is contained in:
@ -1,4 +1,16 @@
|
|||||||
################################################################################
|
#extra phython stuff for updating
|
||||||
|
init python:
|
||||||
|
def Update():
|
||||||
|
pendingVersion = updater.UpdateVersion("snootgame.xyz")
|
||||||
|
if pendingVersion == None:
|
||||||
|
status = "No New Version is Available"
|
||||||
|
renpy.notify(status)
|
||||||
|
else:
|
||||||
|
status = pendingVersion + "can be downloaded"
|
||||||
|
renpy.notify(status)
|
||||||
|
#TODO add code that shows an option that allows a user to download the new version if it is available
|
||||||
|
|
||||||
|
################################################################################
|
||||||
## Initialization
|
## Initialization
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
@ -630,7 +642,6 @@ style gallery_label_text:
|
|||||||
##
|
##
|
||||||
|
|
||||||
screen updates():
|
screen updates():
|
||||||
|
|
||||||
tag menu
|
tag menu
|
||||||
|
|
||||||
## This use statement includes the game_menu screen inside this one. The
|
## This use statement includes the game_menu screen inside this one. The
|
||||||
@ -641,20 +652,22 @@ screen updates():
|
|||||||
style_prefix "updates"
|
style_prefix "updates"
|
||||||
|
|
||||||
vbox:
|
vbox:
|
||||||
|
$ status = "tmp"
|
||||||
label "[config.name!t]"
|
label "[config.name!t]"
|
||||||
text _("Your Version is [config.version!t]\n")
|
text _("Your Version is [config.version!t]\n")
|
||||||
textbutton "[update]" ##action Update()
|
textbutton "Check For Update" action Update
|
||||||
textbutton "Back to Extras" action ShowMenu("extras")
|
textbutton "Back to Extras" action ShowMenu("extras")
|
||||||
|
text "Update Status : [status]"
|
||||||
|
#TODO
|
||||||
|
#add something where it will, after the button is pressed, show text with the result of the update.
|
||||||
|
|
||||||
## This is redefined in options.rpy to add text to the about screen.
|
## This is redefined in options.rpy to add text to the about screen.
|
||||||
define gui.update = ""
|
define gui.update = ""
|
||||||
|
|
||||||
|
|
||||||
style update_label is gui_label
|
style update_label is gui_label
|
||||||
style update_label_text is gui_label_text
|
style update_label_text is gui_label_text
|
||||||
|
|
||||||
style update_text is gui_text
|
style update_text is gui_text
|
||||||
style page_button is gui_button
|
style page_button is gui_button
|
||||||
style page_button_text is gui_button_text
|
style page_button_text is gui_button_text
|
||||||
|
Reference in New Issue
Block a user