update to MU6

This commit is contained in:
Nio
2021-08-07 19:51:40 +10:00
parent 8f6393ab79
commit d59f59ca88
26 changed files with 572 additions and 194 deletions

View File

@ -1,20 +1,24 @@
###Updater Python stuff###
###Updater Python stuff###
init python:
if persistent.updateresult is None:
persistent.updateresult = "No new version is available"
if persistent.autoup is None:
persistent.autoup = False
if persistent.updateWebServer is None:
persistent.updateWebServer = "http://updates.snootgame.xyz/updates.json"
def UpdateCheck():
# WHY YES I ONLY ALLOW PEOPLE USING MY FRAMEWORK TO CHECK FOR AN UPDATE EVERY SIX FUCKING HOURS HOW DID YOU KNOW
# NOPE check_interval=5 (5 SECONDS) FUCK YOU
pendingVersion = updater.UpdateVersion(persistent.updateWebServer, check_interval=5)
if pendingVersion == None or pendingVersion == config.version or "TEST" in pendingVersion:
persistent.updateresult = "No new version is available"
else:
persistent.updateresult = pendingVersion
if renpy.variant("pc"): #Don't run this on mobile, not supported
if persistent.updateresult is None:
persistent.updateresult = "No new version is available"
if persistent.autoup is None:
persistent.autoup = False
if persistent.updateWebServer is None:
persistent.updateWebServer = "http://updates.snootgame.xyz/updates.json"
def UpdateCheck():
# WHY YES I ONLY ALLOW PEOPLE USING MY FRAMEWORK TO CHECK FOR AN UPDATE EVERY SIX FUCKING HOURS HOW DID YOU KNOW
# NOPE check_interval=5 (5 SECONDS) FUCK YOU
pendingVersion = updater.UpdateVersion(persistent.updateWebServer, check_interval=5)
if pendingVersion == None or pendingVersion == config.version or "TEST" in pendingVersion:
persistent.updateresult = "No new version is available"
else:
persistent.updateresult = pendingVersion
def ToggleAutoUpdate():
persistent.autoup = not persistent.autoup
################################################################################
## Initialization
@ -44,7 +48,7 @@ style gui_text:
style button:
properties gui.button_properties("button")
activate_sound "audio/ui/uiClick.wav"
activate_sound "audio/ui/uiClick.wav"
style button_text is gui_text:
properties gui.text_properties("button")
@ -120,7 +124,7 @@ screen say(who, what):
id "window"
if who is not None:
background Image("gui/textbox.png", xalign=0.5, yalign=1.0)
background Image("gui/textbox_long.png", xalign=0.5, yalign=1.0)
window:
id "namebox"
style "namebox"
@ -130,7 +134,6 @@ screen say(who, what):
text what id "what"
## If there's a side image, display it above the text. Do not display on the
## phone variant - there's no room.
if not renpy.variant("small"):
@ -164,9 +167,6 @@ style namebox:
xpos gui.name_xpos
ypos gui.name_ypos
style namebox_large is namebox:
xpos gui.name_large_xpos
style say_label:
properties gui.text_properties("name", accent=True)
xalign gui.name_xalign
@ -281,22 +281,21 @@ screen quick_menu():
## Ensure this appears on top of other screens.
zorder 100
if quick_menu:
window:
background "gui/namebox.png"
xpos 1.45
ypos 0.977
grid 1 4:
style_prefix "quick"
xalign -0.005
yalign 0.010
window:
xpos 1.45
ypos 0.977
vbox:
style_prefix "quick"
xalign -0.005
yalign 0.010
use quick_buttons("gui/button/uioptionbuttons/template_idle.png", \
[ \
[ "Skip", Skip() ], \
[ "Save", ShowMenu('save') ], \
[ "Auto", Preference("auto-forward", "toggle") ], \
[ "Load", ShowMenu('load') ] \
] )
use quick_buttons("gui/button/uioptionbuttons/template_idle.png",
[
[ "Skip", Skip() ],
[ "Save", ShowMenu('save') ],
[ "Auto", Preference("auto-forward", "toggle") ],
[ "Load", ShowMenu('load') ]
] )
screen score_menu():
zorder 100
@ -401,7 +400,7 @@ screen main_menu_button(filename, label, function):
ymaximum 129
action function
fixed:
add filename xalign 0.5 yalign 0.5 zoom 1
add filename xalign 0.5 yalign 0.5 zoom 1 xanchor 0 xcenter 0.5 ycenter 0.5
text label xalign 0.5 yalign 0.5 xanchor 0.5
# label_functions is [ [ "label", function() ], [ "foobar", foobar() ], .. ]
@ -434,16 +433,17 @@ screen main_menu():
else:
add "gui/snootgame.png"
vbox:
spacing 25
spacing 10
xpos 1885
yalign 0.9
ypos 1130
use main_menu_buttons("gui/button/menubuttons/template_idle.png",
[ \
[ "Start", Start() ], \
[ "Load", ShowMenu("load") ], \
[ "Options", ShowMenu("preferences") ], \
[
[ "Start", Start() ],
[ "Mods", ShowMenu("mod_menu") ],
[ "Load", ShowMenu("load") ],
[ "Options", ShowMenu("preferences") ],
[ "Extras", ShowMenu("extras") ], \
[ "Quit", Quit(confirm=not main_menu) ] \
[ "Quit", Quit(confirm=not main_menu) ]
] )
on "show" action renpy.start_predict_screen("cg_gallery")
@ -666,34 +666,40 @@ screen updates():
xoffset 80
xmaximum 1100
label "[config.name!t]"
text _("Version [config.version!t]\n")
text _("Version [config.version!t]")
if updater.can_update():
label _("{color=#00FF00}Update directory exists, updating is possible!{/color}")
label _("{color=#00FF00}{size=32}Update directory exists, updating is possible!\n{/size}{/color}")
else:
label _("{color=#FF0000}Update directory does not exist or is corrupt!{/color}")
textbutton _("Enable Automatic Updates") action [Notify("Toggling Automatic Updates..."), ToggleVariable("persistent.autoup", True, False)]
text _("Automatic Updates: [persistent.autoup!t]\n")
textbutton _("Check for Update!") activate_sound "audio/ui/uiRollover.wav" action [Notify("Checking for update..."), Function(UpdateCheck)]
label _("Update Check Result:\n")
text _("[persistent.updateresult!t]\n")
if persistent.updateresult != "No new version is available":
textbutton _("Update Now!") activate_sound "audio/ui/uiNotification.wav" action [updater.Update(persistent.updateWebServer, force=False)]
else:
textbutton _("Update Now!") activate_sound "audio/ui/uiBack.wav" action [Notify("Nothing to update to!")]
label _("Update Server:\n")
label _("{color=#FF0000}{size=32}Update directory does not exist or is corrupt!\n{/size}{/color}")
label _("Auto Update:")
label _("{color=#FFFFFF}{size=32}Automatic Updates: [persistent.autoup!t]{/size}{/color}")
textbutton _("{size=36}Toggle Automatic Updates\n{/size}") action [Notify("Toggling Automatic Updates..."), Function(ToggleAutoUpdate)]
label _("Update Checker:")
label _("{color=#FFFFFF}{size=32}[persistent.updateresult!t]{/size}{/color}")
textbutton _("{size=36}Check for Update\n{/size}") action [Notify("Checking for update..."), Function(UpdateCheck)]
label _("Updater:")
label _("{color=#FFFFFF}{size=32}Server URL (click to edit):{/size}{/color}")
default input_on = False
button:
key_events True
if input_on:
input:
default "[persistent.updateWebServer!t]" size 24 color '#FFFFFF'
input:
default "[persistent.updateWebServer!t]" size 36 color '#FFFFFF'
value FieldInputValue(persistent, 'updateWebServer')
length 49
copypaste True
else:
text persistent.updateWebServer size 24 color '#FFFF00'
text persistent.updateWebServer size 36 color '#FFFF00'
action ToggleScreenVariable('input_on')
style_prefix "quick"
if persistent.updateresult != "No new version is available":
textbutton _("{size=36}Update Now!\n{/size}") activate_sound "audio/ui/uiNotification.wav" action [updater.Update(persistent.updateWebServer, force=False)]
else:
textbutton _("{size=36}Update Now!\n{/size}") activate_sound "audio/ui/uiBack.wav" action [Notify("Nothing to update to!")]
use extrasnavigation
## Load and Save screens #######################################################
@ -1144,7 +1150,7 @@ screen extrasnavigation():
[ "Help", ShowMenu("help") ],
[ "About", ShowMenu("about") ],
[ "Updates", ShowMenu("updates") ],
[ "Gallery", ShowMenu("cg_gallery") ],
[ "Gallery", ShowMenu("cg_gallery_0") ],
[ "Return", ShowMenu("main_menu") ]
] )
@ -1619,8 +1625,8 @@ style pref_vbox:
screen quick_button(filename, label, function):
variant "small"
button:
xmaximum 180
ymaximum 100
xmaximum 124
ymaximum 124
action function
fixed:
add filename xalign 0.5 yalign 0.5 zoom 1.75
@ -1631,6 +1637,7 @@ screen quick_menu():
zorder 100
if quick_menu:
hbox:
spacing 28
style_prefix "quick"
xalign 0.5
yalign 0.975
@ -1642,6 +1649,28 @@ screen quick_menu():
[ "Menu", ShowMenu() ] \
] )
screen extrasnavigation(): #Updates are removed (not even supported by Ren'Py)
variant "small"
vbox:
xpos 1940
yalign 0.03
if persistent.splashtype == 1:
add "gui/sneedgame.png"
else:
add "gui/snootgame.png"
vbox:
spacing 25
xpos 1885
yalign 0.9
use main_menu_buttons("gui/button/menubuttons/template_idle.png",
[
[ "Help", ShowMenu("help") ],
[ "About", ShowMenu("about") ],
[ "Gallery", ShowMenu("cg_gallery_0") ],
[ "Return", ShowMenu("main_menu") ]
] )
style radio_button:
variant "small"
foreground "gui/phone/button/radio_[prefix_]foreground.png"