[SOLVED] reset preferences button
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
[SOLVED] reset preferences button
Hi. How can I make a button to reset the default preferences? Thanks for the help.
Last edited by Moshibit on Fri Mar 06, 2020 4:56 pm, edited 1 time in total.
Re: reset preferences button
You can use a list of actions that set different preferences values, like
Or make a function, that sets different preferences values and use Function action to run this function.
https://www.renpy.org/doc/html/screen_a ... Preference
Code: Select all
textbutton "Click!" action [Preference("display", "window") , Preference("text speed", 0), Preference("sound volume", 0.5) ]
Code: Select all
init python:
def my_func():
_preferences.display = "window"
_preferences.text_cps = 0
_preferences.volumes['sfx'] = 0.5
Code: Select all
textbutton "Click!" action Function(my_func)
Last edited by Alex on Fri Mar 06, 2020 1:23 pm, edited 1 time in total.
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: reset preferences button
hope this help you out
got this from here say thanks to IrinaLazareva for the code
viewtopic.php?t=51336#p493243
more info here
https://www.renpy.org/doc/html/screen_a ... references
got this from here say thanks to IrinaLazareva for the code
viewtopic.php?t=51336#p493243
Code: Select all
init python:
def restartPref():
_preferences.desktop_rollback_side = "disable"
_preferences.skip_after_choices = False
_preferences.skip_unseen = True
_preferences.text_cps = 14
Code: Select all
textbutton _("Clear") action Function(restartPref)
https://www.renpy.org/doc/html/screen_a ... references
Re: reset preferences button
Thanks
Who is online
Users browsing this forum: Exabot [Bot], fufuffiero, Google [Bot], Sugar_and_rice