forked from Cavemanon/SnootGame
standardize and minify py-related functions
also includes transitions fix
This commit is contained in:
@ -9,8 +9,8 @@ init python:
|
|||||||
persistent.updateWebServer = "http://updates.snootgame.xyz/updates.json"
|
persistent.updateWebServer = "http://updates.snootgame.xyz/updates.json"
|
||||||
|
|
||||||
def UpdateCheck():
|
def UpdateCheck():
|
||||||
# WHY YES I ONLY ALLOW PEOPLE USING MY FRAMEWORK TO CHECK FOR AN UPDATE EVERY SIX FUCKING HOURS HOW DID YOU KNOW
|
# 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
|
# NOPE check_interval=5 (5 SECONDS) FUCK YOU
|
||||||
pendingVersion = updater.UpdateVersion(persistent.updateWebServer, check_interval=5)
|
pendingVersion = updater.UpdateVersion(persistent.updateWebServer, check_interval=5)
|
||||||
if pendingVersion == None or pendingVersion == config.version or "TEST" in pendingVersion:
|
if pendingVersion == None or pendingVersion == config.version or "TEST" in pendingVersion:
|
||||||
persistent.updateresult = "No new version is available"
|
persistent.updateresult = "No new version is available"
|
||||||
@ -20,47 +20,17 @@ init python:
|
|||||||
#idk non-functional dummies for uisounds hackery
|
#idk non-functional dummies for uisounds hackery
|
||||||
#coming soon
|
#coming soon
|
||||||
|
|
||||||
|
def onclick_audio(flag, audio_filename=["audio/ui/uiOptionOff.wav", "audio/ui/uiOptionOff.wav", "audio/ui/uiOptionOff.wav"]):
|
||||||
|
renpy.play(audio_filename[int(flag)])
|
||||||
|
|
||||||
def ToggleAutoUpdate():
|
def ToggleAutoUpdate():
|
||||||
if persistent.autoup == True:
|
onclick_audio(persistent.autoup)
|
||||||
renpy.play("audio/ui/uiOptionOff.wav")
|
preferences.autoup = not preferences.autoup
|
||||||
else:
|
|
||||||
renpy.play("audio/ui/uiOptionOn.wav")
|
|
||||||
persistent.autoup = not persistent.autoup
|
|
||||||
|
|
||||||
def ToggleLewd():
|
def ToggleAutoForwardMove():
|
||||||
if persistent.lewd == True:
|
onclick_audio(persistent.afm_enable)
|
||||||
renpy.play("audio/ui/uiOptionOff.wav")
|
preferences.afm_enable = not preferences.afm_enable
|
||||||
else:
|
|
||||||
renpy.play("audio/ui/uiOptionOn.wav")
|
|
||||||
# persistent.lewd = not persistent.lewd
|
|
||||||
|
|
||||||
def ToggleScroll():
|
|
||||||
if persistent.scroll == True:
|
|
||||||
renpy.play("audio/ui/uiOptionOff.wav")
|
|
||||||
else:
|
|
||||||
renpy.play("audio/ui/uiOptionOn.wav")
|
|
||||||
# persistent.scroll = not persistent.scroll
|
|
||||||
|
|
||||||
def ToggleSkip():
|
|
||||||
if preferences.skip_unseen == True:
|
|
||||||
renpy.play("audio/ui/uiOptionOff.wav")
|
|
||||||
else:
|
|
||||||
renpy.play("audio/ui/uiOptionOn.wav")
|
|
||||||
# preferences.skip_unseen = not preferences.skip_unseen
|
|
||||||
|
|
||||||
def ToggleAfterChoices():
|
|
||||||
if preferences.skip_after_choices == True:
|
|
||||||
renpy.play("audio/ui/uiOptionOff.wav")
|
|
||||||
else:
|
|
||||||
renpy.play("audio/ui/uiOptionOn.wav")
|
|
||||||
# preferences.skip_after_choices = not preferences.skip_after_choices
|
|
||||||
|
|
||||||
def ToggleTransitions():
|
|
||||||
if preferences.transitions == True:
|
|
||||||
renpy.play("audio/ui/uiOptionOff.wav")
|
|
||||||
else:
|
|
||||||
renpy.play("audio/ui/uiOptionOn.wav")
|
|
||||||
# preferences.transitions = not preferences.transitions
|
|
||||||
|
|
||||||
# def ToggleMuteAll():
|
# def ToggleMuteAll():
|
||||||
# if preferences.all_mute == True:
|
# if preferences.all_mute == True:
|
||||||
@ -69,12 +39,6 @@ init python:
|
|||||||
# renpy.play("audio/ui/uiOptionOn.wav")
|
# renpy.play("audio/ui/uiOptionOn.wav")
|
||||||
# preferences.all_mute = not preferences.all_mute
|
# preferences.all_mute = not preferences.all_mute
|
||||||
|
|
||||||
def ToggleAutoForwardMove():
|
|
||||||
if preferences.afm_enable == True:
|
|
||||||
renpy.play("audio/ui/uiOptionOff.wav")
|
|
||||||
else:
|
|
||||||
renpy.play("audio/ui/uiOptionOn.wav")
|
|
||||||
preferences.afm_enable = not preferences.afm_enable
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
## Initialization
|
## Initialization
|
||||||
@ -941,20 +905,19 @@ screen preferences():
|
|||||||
vbox:
|
vbox:
|
||||||
style_prefix "check"
|
style_prefix "check"
|
||||||
label _("Naughty Stuff")
|
label _("Naughty Stuff")
|
||||||
textbutton _("Enable Lewd Images") action [Function(ToggleLewd), ToggleVariable("persistent.lewd", True, False)]
|
textbutton _("Enable Lewd Images") action [Function(onclick_audio, persistent.lewd), ToggleVariable("persistent.lewd", True, False)]
|
||||||
|
|
||||||
vbox:
|
vbox:
|
||||||
style_prefix "check"
|
style_prefix "check"
|
||||||
label _("Requires Restart")
|
label _("Requires Restart")
|
||||||
textbutton _("Enable Forward-Scroll Movement") action [Function(ToggleScroll), ToggleVariable("persistent.scroll", True, False)]
|
textbutton _("Enable Forward-Scroll Movement") action [Function(onclick_audio, persistent.scroll), ToggleVariable("persistent.scroll", True, False)]
|
||||||
|
|
||||||
|
|
||||||
vbox:
|
vbox:
|
||||||
style_prefix "check"
|
style_prefix "check"
|
||||||
label _("Skip")
|
label _("Skip")
|
||||||
textbutton _("Unseen Text") action [Function(ToggleSkip), ToggleVariable("preferences.skip_unseen", True, False)]
|
textbutton _("Unseen Text") action [Function(onclick_audio, preferences.skip_unseen), ToggleVariable("preferences.skip_unseen", True, False)]
|
||||||
textbutton _("After Choices") action [Function(ToggleAfterChoices), ToggleVariable("preferences.skip_after_choices", True, False)]
|
textbutton _("After Choices") action [Function(onclick_audio, preferences.skip_after_choices), ToggleVariable("preferences.skip_after_choices", True, False)]
|
||||||
textbutton _("Transitions") action [InvertSelected(Function(ToggleTransitions)), ToggleVariable("preferences.transitions", True, False)]
|
textbutton _("Transitions") action [Function(onclick_audio, preferences.transitions), ToggleVariable("preferences.transitions", 0, 2)]
|
||||||
|
|
||||||
## Additional vboxes of type "radio_pref" or "check_pref" can be
|
## Additional vboxes of type "radio_pref" or "check_pref" can be
|
||||||
## added here, to add additional creator-defined preferences.
|
## added here, to add additional creator-defined preferences.
|
||||||
|
Reference in New Issue
Block a user