-
Notifications
You must be signed in to change notification settings - Fork 675
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid a save/reload cycle when changing launcher theme.
Makes the problem found in #2816 less severe.
- Loading branch information
Showing
2 changed files
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,11 @@ init python: | |
|
||
show_legacy = os.path.exists(os.path.join(config.renpy_base, "templates", "english", "game", "script.rpy")) | ||
|
||
class RestartAtPreferences(Action): | ||
def __call__(self): | ||
renpy.session["launcher_start_label"] = "preferences" | ||
renpy.utter_restart() | ||
|
||
default persistent.legacy = False | ||
default persistent.force_new_tutorial = False | ||
default persistent.sponsor_message = True | ||
|
@@ -196,11 +201,11 @@ screen preferences: | |
|
||
textbutton _("Sponsor message") style "l_checkbox" action ToggleField(persistent, "sponsor_message") | ||
|
||
textbutton _("Default theme") style "l_checkbox" action [SetField(persistent, "theme", None), renpy.reload_script] | ||
|
||
textbutton _("Clear theme") style "l_checkbox" action [ToggleField(persistent, "theme", "clear", None), renpy.reload_script] | ||
add HALF_SPACER | ||
|
||
textbutton _("Dark theme") style "l_checkbox" action [ToggleField(persistent, "theme", "dark", None), renpy.reload_script] | ||
textbutton _("Default theme") style "l_checkbox" action [SetField(persistent, "theme", None), RestartAtPreferences() ] | ||
textbutton _("Clear theme") style "l_checkbox" action [SetField(persistent, "theme", "clear", None), RestartAtPreferences() ] | ||
textbutton _("Dark theme") style "l_checkbox" action [SetField(persistent, "theme", "dark", None), RestartAtPreferences()] | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
renpytom
Author
Member
|
||
|
||
|
||
if translations: | ||
|
Is it normal that dark (and clear) are SetFields and not ToggleFields now ?