WTS/game/scripts/gui/settings.rpy
2024-06-22 13:40:33 +01:00

227 lines
9.8 KiB
Plaintext

init offset = -1
screen settings_general():
frame style "navigation_page_left":
vbox:
label _("General")
vbox:
style_prefix "navigation_checkbox"
textbutton _("Tutorials") action settings.Toggle("tutorials")
if not renpy.mobile:
textbutton _("Tooltips") action settings.Toggle("tooltip") tooltip _("This is a tooltip.")
textbutton _("System Cursor") action Preference("system cursor", "toggle")
textbutton _("Autosaves") action ToggleField(store, "_autosave")
textbutton _("Automatic Update Checks") action settings.Toggle("updates")
textbutton _("Kinetic Text") action settings.Toggle("kinetictext") tooltip "{bounce}Kinetic Text Example.{/bounce}"
text _("Skipping")
textbutton _("Skip Unseen Text") action Preference("skip", "toggle")
textbutton _("Skip Until dialog menu") action InvertSelected(Preference("after choices", "toggle"))
text _("Text Speed")
bar value Preference("text speed") style "navigation_bar"
text _("Auto-Forward Time")
bar value Preference("auto-forward time") style "navigation_bar"
textbutton _("Power-saving") action Preference("gl powersave", "toggle")
textbutton _("multithreading") action settings.Toggle("multithreading") tooltip "Improves performance by executing tasks asynchronously. (Requires restart)"
frame style "navigation_page_right":
if settings.get("tooltip"):
add "doodle_hermione" align (0.5, 0.5)
else:
add "doodle_hermione2" align (0.5, 0.5)
screen settings_display():
frame style "navigation_page_left":
vbox:
label _("Display")
if renpy.variant("pc") or renpy.variant("web"):
vbox:
style_prefix "navigation_radio"
textbutton _("Fullscreen") action Preference("display", "fullscreen")
textbutton _("Windowed") action Preference("display", "any window")
textbutton _("Tearing") action [ ToggleField(_preferences, "gl_tearing"), _DisplayReset() ] style "navigation_checkbox_button"
textbutton _("Reset Window size"):
style "navigation_button"
action Preference("display", "window")
sensitive (renpy.get_physical_size() != (config.screen_width, config.screen_height) and not preferences.fullscreen)
default fps_msg = _("Framerate preference may take effect after restarting the game")
text _("Framerate")
hbox:
style_prefix "navigation_radio"
textbutton _("30 FPS") action [Preference("gl framerate", 30), Notify(fps_msg)]
if renpy.get_refresh_rate() >= 60:
textbutton _("60 FPS") action [Preference("gl framerate", 60), Notify(fps_msg)]
textbutton (_(f"{int(renpy.get_refresh_rate())} FPS")) action [Preference("gl framerate", None), Notify(fps_msg)]
if not renpy.variant("web"):
default renderer_used = renpy.get_renderer_info()["renderer"]
text _("Renderer")
hbox:
style_prefix "navigation_radio"
textbutton _("OpenGL"):
selected renderer_used == "gl2"
action Confirm(_("Changing renderer requires a full restart, do it now?\nUnsaved progress will be lost."), Function(set_renderer, "gl2"))
textbutton _("DirectX"):
sensitive renpy.windows
selected renderer_used == "angle2"
action Confirm(_("Changing renderer requires a full restart, do it now?\nUnsaved progress will be lost."), Function(set_renderer, "angle2"))
text _("Image cache ([persistent.custom_settings['image_cache_size']]MB)")
bar value DictValue(persistent.custom_settings, "image_cache_size", range=1792, max_is_zero=False, style="navigation_bar", offset=256, step=128, force_step=True, action=Notify(_("Restart the game to apply image cache size changes."))) tooltip _("Improves performance at a cost of higher memory usage.")
null height 35
text get_gpu_info() yalign 1.0 size 12
frame style "navigation_page_right":
add "doodle_brewing" align (0.5, 0.5)
screen settings_audio():
frame style "navigation_page_left":
vbox:
label _("Audio")
text _("Music Volume")
bar value Preference("music volume") style "navigation_bar"
text _("Sound Volume")
bar value Preference("sound volume") style "navigation_bar"
text _("Weather Volume")
bar value Preference("weather volume") style "navigation_bar"
# label _("Voice Volume")
# hbox:
# bar value Preference("voice volume")
# if config.sample_voice:
# textbutton _("Test") action Play("voice", config.sample_voice)
textbutton _("Mute All"):
action Preference("all mute", "toggle")
style "navigation_checkbox_button"
textbutton _("Mute when minimized"):
action Preference("audio when minimized", "toggle")
selected (not _preferences.audio_when_minimized)
style "navigation_checkbox_button"
add "doodle_owl" align (0.5, 0.9)
frame style "navigation_page_right":
add "doodle_letter" align (0.5, 0.5)
screen settings_other():
frame style "navigation_page_left":
vbox:
label _("Other")
text _("Text Font")
vbox:
style_prefix "navigation_radio"
textbutton _("Default"):
action Preference("font transform", None)
textbutton _("DejaVu Sans"):
action Preference("font transform", "dejavusans")
textbutton _("Opendyslexic"):
action Preference("font transform", "opendyslexic")
text _("Text Scaling")
hbox:
style_prefix "navigation_radio"
textbutton _("Small") action Preference("font size", 0.8)
textbutton _("Default") action Preference("font size", 1.0)
textbutton _("Large") action Preference("font size", 1.2)
text _("Vertical Text Spacing")
hbox:
style_prefix "navigation_radio"
textbutton _("Small") action Preference("font line spacing", 0.8)
textbutton _("Default") action Preference("font line spacing", 1.0)
textbutton _("Large") action Preference("font line spacing", 1.2)
if not renpy.mobile:
vbox:
style_prefix "navigation_checkbox"
textbutton _("Text-to-speech"):
action Preference("self voicing", "toggle")
text _("Text-to-speech Accentuation")
bar value Preference("self voicing volume drop") style "navigation_bar"
text _("Advanced")
vbox:
textbutton _("Delete persistent data ({color=#f00}!{/color})") action Confirm(gui.CONFIRM_DELETE_PERSISTENT, Function(delete_persistent))
textbutton _("Delete save files ({color=#f00}!{/color})") action Confirm(gui.CONFIRM_DELETE_SAVES, Function(delete_saves))
frame style "navigation_page_right":
add "doodle_glasses" align (0.5, 0.1)
frame style "navigation_note":
xysize (180, 180)
pos (20, 130)
at transform:
rotate 6
text _("TIP: If text overflows, try reducing vertical text spacing.")
frame style "navigation_note":
xysize (180, 180)
pos (25, 230)
at transform:
rotate -4
text _("You could also try changing the font, it might help! :)")
define gui.CONFIRM_DELETE_PERSISTENT = _("""{color=#7a0000}Warning!{/color}
{size=-4}You are about to reset all persistent data, including
achievements, seen text, and preferences.{/size}\n
Are you sure?""")
define gui.CONFIRM_DELETE_SAVES = _("""{color=#7a0000}Warning!{/color}
{size=-4}You are about to delete all save files, including
auto saves, quick saves, and manual saves.{/size}\n
Are you sure?""")
define gui.SAVE_INCOMPATIBLE_WARNING = _("""{color=#7a0000}Warning!{/color}
{size=-4}The save file you are attempting to load is not compatible
with the current game version. While you can try loading it,
doing so may result in unexpected crashes and bugs.
Proceed anyway?""")
init python:
def delete_persistent():
renpy.loadsave.location.unlink_persistent()
renpy.persistent.should_save_persistent = False
renpy.quit(relaunch=True)
def delete_saves():
for fn in renpy.list_saved_games(fast=True):
renpy.unlink_save(fn)
def set_renderer(s):
preferences.renderer = s if s in ("gl2", "angle2") else "auto"
renpy.quit(relaunch=True)
screen _self_voicing():
layer "interface"
zorder 1500
if _preferences.self_voicing == "clipboard":
$ message = _("Clipboard voicing enabled. Press 'shift+C' to disable.")
elif _preferences.self_voicing == "debug":
$ message = _("Text-to-speech would say \"[renpy.display.tts.last]\". Press 'alt+shift+V' to disable.")
else:
$ message = _("Text-to-speech enabled. Press 'shift+v' to disable.")
text message:
alt ""
xpos 10
ypos 35
color "#fff"
outlines [ (1, "#0008", 0, 0)]