From 63859b37f2392a7b420bc5d56cfa5bb818970a9b Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Sat, 1 Jun 2024 20:46:53 +0100 Subject: [PATCH] Partial Implementation of Navigation menus --- .../book/book_background.png | 3 + .../book/book_bar_empty.png | 3 + .../creamy_pumpkin_pie/book/book_bar_full.png | 3 + .../book/book_button_check_checked.png | 3 + .../book/book_button_check_empty.png | 3 + .../book/book_button_radio_checked.png | 3 + .../book/book_button_radio_empty.png | 3 + .../creamy_pumpkin_pie/book/book_label.png | 3 + .../creamy_pumpkin_pie/book/book_label2.png | 3 + .../book/book_page_left.png | 3 + .../book/book_page_right.png | 3 + .../creamy_pumpkin_pie/book/book_select.png | 3 + .../creamy_pumpkin_pie/book/book_slider.png | 3 + .../book/book_slider_thumb.png | 3 + .../creamy_pumpkin_pie/book/book_spacer.png | 3 + game/gui/creamy_pumpkin_pie/book/book_tab.png | 3 + game/scripts/gui/_gui_.rpy | 4 +- game/scripts/gui/main_menu.rpy | 263 ++++++++++++- game/scripts/gui/preferences.rpy | 369 +++++++----------- game/scripts/gui/save_files.rpy | 253 +++++++----- game/scripts/options.rpy | 11 +- 21 files changed, 602 insertions(+), 346 deletions(-) create mode 100644 game/gui/creamy_pumpkin_pie/book/book_background.png create mode 100644 game/gui/creamy_pumpkin_pie/book/book_bar_empty.png create mode 100644 game/gui/creamy_pumpkin_pie/book/book_bar_full.png create mode 100644 game/gui/creamy_pumpkin_pie/book/book_button_check_checked.png create mode 100644 game/gui/creamy_pumpkin_pie/book/book_button_check_empty.png create mode 100644 game/gui/creamy_pumpkin_pie/book/book_button_radio_checked.png create mode 100644 game/gui/creamy_pumpkin_pie/book/book_button_radio_empty.png create mode 100644 game/gui/creamy_pumpkin_pie/book/book_label.png create mode 100644 game/gui/creamy_pumpkin_pie/book/book_label2.png create mode 100644 game/gui/creamy_pumpkin_pie/book/book_page_left.png create mode 100644 game/gui/creamy_pumpkin_pie/book/book_page_right.png create mode 100644 game/gui/creamy_pumpkin_pie/book/book_select.png create mode 100644 game/gui/creamy_pumpkin_pie/book/book_slider.png create mode 100644 game/gui/creamy_pumpkin_pie/book/book_slider_thumb.png create mode 100644 game/gui/creamy_pumpkin_pie/book/book_spacer.png create mode 100644 game/gui/creamy_pumpkin_pie/book/book_tab.png diff --git a/game/gui/creamy_pumpkin_pie/book/book_background.png b/game/gui/creamy_pumpkin_pie/book/book_background.png new file mode 100644 index 00000000..e6f068bf --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/book/book_background.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d00b635eec9535bae1e5d4457b794edb5ec947594999ed4b661af6e9b987e1e +size 150200 diff --git a/game/gui/creamy_pumpkin_pie/book/book_bar_empty.png b/game/gui/creamy_pumpkin_pie/book/book_bar_empty.png new file mode 100644 index 00000000..80358654 --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/book/book_bar_empty.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:295863c9a97693f41596d8f3efa1c01ac37b8d53dd6d308c75d5f10e6483e661 +size 24667 diff --git a/game/gui/creamy_pumpkin_pie/book/book_bar_full.png b/game/gui/creamy_pumpkin_pie/book/book_bar_full.png new file mode 100644 index 00000000..f8e5441a --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/book/book_bar_full.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:959b0e2aae91ae63fc06dd196884fa4a159677d98568c67cd3a5547b80a4c9bd +size 31217 diff --git a/game/gui/creamy_pumpkin_pie/book/book_button_check_checked.png b/game/gui/creamy_pumpkin_pie/book/book_button_check_checked.png new file mode 100644 index 00000000..113e221f --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/book/book_button_check_checked.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be3432246789cd6fffed1ef0ee2e017ba38cea00ad6914be1845f1ddf3ee97f6 +size 6854 diff --git a/game/gui/creamy_pumpkin_pie/book/book_button_check_empty.png b/game/gui/creamy_pumpkin_pie/book/book_button_check_empty.png new file mode 100644 index 00000000..267df215 --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/book/book_button_check_empty.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed540b83b69b30cc26e602ebde069ccedcd8fb749f89fbf5e95fce98ace4943c +size 5349 diff --git a/game/gui/creamy_pumpkin_pie/book/book_button_radio_checked.png b/game/gui/creamy_pumpkin_pie/book/book_button_radio_checked.png new file mode 100644 index 00000000..6b9f4a52 --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/book/book_button_radio_checked.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc1275d3e886ab36b5f47e42a5baec4f1d0683c0d7bd417c690775d40efb583f +size 6441 diff --git a/game/gui/creamy_pumpkin_pie/book/book_button_radio_empty.png b/game/gui/creamy_pumpkin_pie/book/book_button_radio_empty.png new file mode 100644 index 00000000..7d99c32b --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/book/book_button_radio_empty.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f52fcd63f40fe7e416992893f4ec22786b7cbb1c02dc2c4d9116be92c15c2cbc +size 4500 diff --git a/game/gui/creamy_pumpkin_pie/book/book_label.png b/game/gui/creamy_pumpkin_pie/book/book_label.png new file mode 100644 index 00000000..b31465b1 --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/book/book_label.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:568497b8e77dec8799f003c7c7466d29595eff1904248aa16d302e4a90cc6655 +size 55607 diff --git a/game/gui/creamy_pumpkin_pie/book/book_label2.png b/game/gui/creamy_pumpkin_pie/book/book_label2.png new file mode 100644 index 00000000..f06999ce --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/book/book_label2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8f9019142b5fb7353c89089bddcc503f0f7420e1b77a5523d222cd583bd9553 +size 23712 diff --git a/game/gui/creamy_pumpkin_pie/book/book_page_left.png b/game/gui/creamy_pumpkin_pie/book/book_page_left.png new file mode 100644 index 00000000..f62d1ac5 --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/book/book_page_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a98ec3c3ee3efb3454baf61fb444967c69dd71a45062b8f493a0609e3561b586 +size 148811 diff --git a/game/gui/creamy_pumpkin_pie/book/book_page_right.png b/game/gui/creamy_pumpkin_pie/book/book_page_right.png new file mode 100644 index 00000000..cc9a98ec --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/book/book_page_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:118feac9267ae8fa7c728aecd2694da59b5de9635ea2fb91a70215f32bdfed55 +size 151677 diff --git a/game/gui/creamy_pumpkin_pie/book/book_select.png b/game/gui/creamy_pumpkin_pie/book/book_select.png new file mode 100644 index 00000000..5304bab9 --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/book/book_select.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:625a2dbba4dc66b16377c3714e04fc3f5e549d2ce70da2a0cb02d48417fa6b76 +size 4770 diff --git a/game/gui/creamy_pumpkin_pie/book/book_slider.png b/game/gui/creamy_pumpkin_pie/book/book_slider.png new file mode 100644 index 00000000..80358654 --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/book/book_slider.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:295863c9a97693f41596d8f3efa1c01ac37b8d53dd6d308c75d5f10e6483e661 +size 24667 diff --git a/game/gui/creamy_pumpkin_pie/book/book_slider_thumb.png b/game/gui/creamy_pumpkin_pie/book/book_slider_thumb.png new file mode 100644 index 00000000..6ecc8c4a --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/book/book_slider_thumb.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a3927b2d5dbca83c34e2f8261a8890eed39cd363269c140e778db4e47ee1fcb +size 7646 diff --git a/game/gui/creamy_pumpkin_pie/book/book_spacer.png b/game/gui/creamy_pumpkin_pie/book/book_spacer.png new file mode 100644 index 00000000..01d40b2a --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/book/book_spacer.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:55f99f147007a9f27072c3e30b50b88ba6297eba8e9f3f26623f250cfdfe7eb7 +size 12146 diff --git a/game/gui/creamy_pumpkin_pie/book/book_tab.png b/game/gui/creamy_pumpkin_pie/book/book_tab.png new file mode 100644 index 00000000..0145ae99 --- /dev/null +++ b/game/gui/creamy_pumpkin_pie/book/book_tab.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ee9361508a4b5bed8da75f6be80c04786cd5b6c100d6456d28480901cb46570 +size 7070 diff --git a/game/scripts/gui/_gui_.rpy b/game/scripts/gui/_gui_.rpy index c030a2cc..88b7c6d1 100644 --- a/game/scripts/gui/_gui_.rpy +++ b/game/scripts/gui/_gui_.rpy @@ -120,8 +120,8 @@ define config.thumbnail_width = 94 define config.thumbnail_height = 50 # Save slots table -define gui.file_slot_cols = 2 -define gui.file_slot_rows = 6 +define gui.file_slot_cols = 4 +define gui.file_slot_rows = 12 # Spacing define gui.pref_spacing = 9 diff --git a/game/scripts/gui/main_menu.rpy b/game/scripts/gui/main_menu.rpy index c0526ef3..dc6808a4 100644 --- a/game/scripts/gui/main_menu.rpy +++ b/game/scripts/gui/main_menu.rpy @@ -176,9 +176,11 @@ screen game_menu(title, scroll=None, yinitial=0.0): padding (15, 15, 15, 15) transclude - use navigation(title): + use navigation(title) - label title xalign .5 + # use navigation(title): + + # label title xalign .5 if main_menu and not title == "Updater": key "game_menu" action ShowMenu("main_menu") @@ -287,23 +289,250 @@ screen navigation(title=None): textbutton _("Help") action ShowMenu("help") sensitive is_sensitive textbutton _("Quit to menu") action MainMenu() sensitive is_sensitive +screen navigation2(title="Title"): + style_prefix "navigation" + + default category = "settings" + default subcategory = "general" + default page = 0 + + frame: + vbox: + style_prefix "navigation_tabs" + + textbutton "Save" action [SetLocalVariable("subcategory", None), SetLocalVariable("category", "save")] selected (category=="save") at navigation_tabs + textbutton "Load" action [SetLocalVariable("subcategory", None), SetLocalVariable("category", "load")] selected (category=="load") at navigation_tabs + textbutton "Settings" action [SetLocalVariable("subcategory", "general"), SetLocalVariable("category", "settings")] at navigation_tabs + null height 35 + textbutton "Return" action Return() at navigation_tabs + + if category == "save": + vbox: + style_prefix "navigation_subtabs" + + textbutton "Autosaves" action FilePage("auto") at navigation_tabs + textbutton "QuickSaves" action FilePage("quick") at navigation_tabs + null height 35 + textbutton "Next" action FilePageNext() at navigation_tabs + textbutton "Previous" action FilePagePrevious() at navigation_tabs + + use file_slots(_("Save")) + elif category == "load": + vbox: + style_prefix "navigation_subtabs" + + textbutton "Autosaves" action FilePage("auto") at navigation_tabs + textbutton "QuickSaves" action FilePage("quick") at navigation_tabs + null height 35 + textbutton "Next" action FilePageNext() at navigation_tabs + textbutton "Previous" action FilePagePrevious() at navigation_tabs + + use file_slots(_("Load")) + elif category == "settings": + vbox: + style_prefix "navigation_subtabs" + + textbutton "General" action SetLocalVariable("subcategory", "general") at navigation_tabs + textbutton "Display" action SetLocalVariable("subcategory", "display") at navigation_tabs + textbutton "Audio" action SetLocalVariable("subcategory", "audio") at navigation_tabs + textbutton "Accessibility" action SetLocalVariable("subcategory", "accessibility") at navigation_tabs + + if subcategory == "audio": + use preferences_sound + elif subcategory == "accessibility": + use preferences_accessibility + elif subcategory == "display": + use preferences_visuals + elif subcategory == "general": + use preferences_general + +transform navigation_tabs: + subpixel True + xzoom 1.0 + yanchor 0.5 + on hover: + easein 0.1 xzoom 1.1 + easeout 0.1 xzoom 1.0 + +style navigation_frame is empty: + align (0.5, 0.5) + xysize (750, 512) + background Image("gui/creamy_pumpkin_pie/book/book_background.png", oversample=4) + +style navigation_page_left is empty: + fit_first True + xanchor 1.0 + pos (364, 8) + xysize (343, 490) + background Image("gui/creamy_pumpkin_pie/book/book_page_left.png", oversample=4) + +style navigation_page_right is empty: + fit_first True + xanchor 0.0 + pos (364, 8) + xysize (343, 490) + background Image("gui/creamy_pumpkin_pie/book/book_page_right.png", oversample=4) + style navigation_vbox: - xsize 250 - spacing gui.navigation_spacing - xoffset -150 - xpos 1.0 - xanchor 0.5 + fit_first True + xfill True + pos (12, 12) -style navigation_button is gui_button: - # size_group "navigation" - background None +style navigation_label: + xalign 0.5 + xpadding 80 + xoffset -12 + ysize 38 + background Frame(Image("gui/creamy_pumpkin_pie/book/book_label.png", oversample=4), 80, 0, 80, 0, tile=False) + +style navigation_tabs_vbox: + yspacing 10 + pos (721, 50) + +style navigation_tabs_button: + ysize 35 + left_padding 15 + right_padding 30 + selected_right_padding 50 + background Frame(Image("gui/creamy_pumpkin_pie/book/book_tab.png", oversample=4), 0, 0, 80, 0, tile=False) + selected_background Frame(Image("gui/creamy_pumpkin_pie/book/book_tab.png", oversample=4), 0, 0, 80, 0, tile=False) + insensitive_background Frame(Transform(Image("gui/creamy_pumpkin_pie/book/book_tab.png", oversample=4), matrixcolor=SaturationMatrix(0.0)), 0, 0, 80, 0, tile=False) + +style navigation_tabs_button_text is who: + color "#ffffff" + outlines [(2, "#000000", 1, 1)] + hinting "auto" + font gui.bold_font + size 20 + yalign 0.5 + +style navigation_subtabs_vbox: + xanchor 1.0 + pos (23, 50) + yspacing 10 + +style navigation_subtabs_button: + xalign 1.0 + ysize 35 + right_padding 15 + left_padding 30 + selected_left_padding 50 + background Frame(Transform(Image("gui/creamy_pumpkin_pie/book/book_tab.png", oversample=4), xzoom=-1), 80, 0, 0, 0, tile=False) + insensitive_background Frame(Transform(Image("gui/creamy_pumpkin_pie/book/book_tab.png", oversample=4), xzoom=-1, matrixcolor=SaturationMatrix(0.0)), 80, 0, 0, 0, tile=False) + +style navigation_subtabs_button_text is navigation_tabs_button_text + +style navigation_label_text: + ypos 8 + color "#704F32" + size 28 + +style navigation_text: + color "#704F32" + outlines [(1, "#704f3215", -1, -1), (1, "#704f3238", 1, 1)] + size 20 + +style navigation_sublabel is navigation_text: xalign 0.5 -style navigation_button_text is gui_button_text: - background None - size 19 +style navigation_checkbox_vbox: + fit_first True + xfill True + yspacing 4 +style navigation_checkbox_label is navigation_label: + xsize 206 + background Transform(Image("gui/creamy_pumpkin_pie/book/book_spacer.png", oversample=4), xalign=0.5) +style navigation_checkbox_label_text is navigation_label_text: xalign 0.5 - idle_color Color('#888') - hover_color '#fff' - selected_color '#fff' - insensitive_color Color('#888', alpha=0.5) + size 24 + +style navigation_button: + padding (6, 4) + hover_background Frame(Image("gui/creamy_pumpkin_pie/book/book_select.png", oversample=4), 20, 0, 20, 0, tile=False) + +style navigation_button_text is navigation_text: + insensitive_color "#704F3280" + +style navigation_checkbox_button: + padding (6, 4) + hover_background Frame(Image("gui/creamy_pumpkin_pie/book/book_select.png", oversample=4), 20, 0, 20, 0, tile=False) + foreground Transform(Image("gui/creamy_pumpkin_pie/book/book_button_check_empty.png", oversample=4), xpos=6, yalign=0.5) + selected_foreground Transform(Image("gui/creamy_pumpkin_pie/book/book_button_check_checked.png", oversample=4), xpos=6, yalign=0.5) + insensitive_foreground Transform(Image("gui/creamy_pumpkin_pie/book/book_button_check_empty.png", oversample=4), alpha=0.5, xpos=6, yalign=0.5) + +style navigation_checkbox_button_text is navigation_text: + first_indent 24 + insensitive_color "#704F3280" + +style navigation_checkbox_text is navigation_text + +style navigation_radio_vbox: + fit_first True + # xfill True # TODO: WTF? Why does it break the entire menu? + yspacing 4 + +style navigation_radio_label is navigation_label: + xsize 206 + background Image("gui/creamy_pumpkin_pie/book/book_spacer.png", oversample=4) +style navigation_radio_label_text is navigation_label_text: + xalign 0.5 + size 24 + +style navigation_radio_button: + padding (6, 4) + hover_background Frame(Image("gui/creamy_pumpkin_pie/book/book_select.png", oversample=4), 20, 0, 20, 0, tile=False) + foreground Transform(Image("gui/creamy_pumpkin_pie/book/book_button_radio_empty.png", oversample=4), xpos=6, yalign=0.5) + selected_foreground Transform(Image("gui/creamy_pumpkin_pie/book/book_button_radio_checked.png", oversample=4), xpos=6, yalign=0.5) + insensitive_foreground Transform(Image("gui/creamy_pumpkin_pie/book/book_button_radio_empty.png", oversample=4), alpha=0.5, xpos=6, yalign=0.5) + +style navigation_radio_button_text is navigation_text: + first_indent 24 + insensitive_color "#704F3280" + +style navigation_slider is empty: + xalign 0.5 + xmaximum 300 + ysize 20 + left_bar Frame(Image("gui/creamy_pumpkin_pie/book/book_slider.png", oversample=4), tile=False) + right_bar Frame(Image("gui/creamy_pumpkin_pie/book/book_slider.png", oversample=4), tile=False) + thumb Image("gui/creamy_pumpkin_pie/book/book_slider_thumb.png", oversample=4) + thumb_offset 16 + +style navigation_bar is empty: + xalign 0.5 + xmaximum 300 + ysize 20 + left_bar Frame(Image("gui/creamy_pumpkin_pie/book/book_bar_full.png", oversample=4), tile=False) + right_bar Frame(Image("gui/creamy_pumpkin_pie/book/book_bar_empty.png", oversample=4), tile=False) + hover_right_bar Fixed(Frame(Image("gui/creamy_pumpkin_pie/book/book_select.png", oversample=4), 20, 4, 20, 4, tile=False), Frame(Image("gui/creamy_pumpkin_pie/book/book_bar_empty.png", oversample=4), tile=False)) + hover_left_bar Fixed(Frame(Image("gui/creamy_pumpkin_pie/book/book_select.png", oversample=4), 20, 4, 20, 4, tile=False), Frame(Image("gui/creamy_pumpkin_pie/book/book_bar_full.png", oversample=4), tile=False)) + +style navigation_grid is empty: + xspacing 35 + yspacing 0 + ypos 20 + +style navigation_picture_button: + padding (6, 4) + hover_background Frame(Image("gui/creamy_pumpkin_pie/book/book_select.png", oversample=4), 20, 0, 20, 0, tile=False) + +# style navigation_vbox: +# xsize 250 +# spacing gui.navigation_spacing +# xoffset -150 +# xpos 1.0 +# xanchor 0.5 + +# style navigation_button is gui_button: +# # size_group "navigation" +# background None +# xalign 0.5 + +# style navigation_button_text is gui_button_text: +# background None +# size 19 +# xalign 0.5 +# idle_color Color('#888') +# hover_color '#fff' +# selected_color '#fff' +# insensitive_color Color('#888', alpha=0.5) diff --git a/game/scripts/gui/preferences.rpy b/game/scripts/gui/preferences.rpy index a07c00be..e5fae4bf 100644 --- a/game/scripts/gui/preferences.rpy +++ b/game/scripts/gui/preferences.rpy @@ -49,263 +49,162 @@ screen preferences(page="general"): action Show("preferences", config.intra_transition, "accessibility") screen preferences_general(): - hbox: - box_wrap True - + frame style "navigation_page_left": vbox: - style_prefix gui.theme("check") + label _("General") + vbox: + style_prefix "navigation_checkbox" - label _("Interface") - textbutton _("Animations") action settings.Toggle("animations") - textbutton _("Tutorials") action settings.Toggle("tutorials") + textbutton _("Tutorials") action settings.Toggle("tutorials") - if not renpy.mobile: - textbutton _("Tooltips") action settings.Toggle("tooltip") - textbutton _("System Cursor") action Preference("system cursor", "toggle") - textbutton _("Automatic Updates") action settings.Toggle("updates") - textbutton _("Autosave") action ToggleField(store, "_autosave") + 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") - default trans = config.intra_transition + text _("Skipping") + textbutton _("Skip Unseen Text") action Preference("skip", "toggle") + textbutton _("Until dialog menu") action InvertSelected(Preference("after choices", "toggle")) - vbox: - style_prefix gui.theme("radio") + text _("Text Speed") + bar value Preference("text speed") style "navigation_bar" - label "Theme" - textbutton "Auto" action [ - settings.Set("theme", "auto"), - Function(renpy.transition, trans), - Function(renpy.restart_interaction) - ] - textbutton "Day" action [ - settings.Set("theme", "light"), - Function(renpy.transition, trans), - Function(renpy.restart_interaction) - ] - textbutton "Night" action [ - settings.Set("theme", "dark"), - Function(renpy.transition, trans), - Function(renpy.restart_interaction) - ] - vbox: - style_prefix gui.theme("check") - label _("Skipping") - textbutton _("Skip Unseen Text") action Preference("skip", "toggle") - textbutton _("Until dialog menu") action InvertSelected(Preference("after choices", "toggle")) - vbox: - style_prefix gui.theme("radio") - label _("Language") - textbutton "English" action Language(None) - textbutton "中文" action Language("chinese") - hbox: - box_wrap True - - vbox: - style_prefix gui.theme("slider") - spacing gui.pref_spacing / 2 - - label _("Text Speed") - bar value Preference("text speed") - - label _("Auto-Forward Time") - bar value Preference("auto-forward time") - - hbox: - box_wrap True - - vbox: - style_prefix gui.theme("check") + 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": + pass screen preferences_visuals(): - vbox: - hbox: - box_wrap True - + frame style "navigation_page_left": + vbox: + label _("Display") if renpy.variant("pc") or renpy.variant("web"): vbox: - style_prefix gui.theme("radio") - label _("Display") + style_prefix "navigation_radio" textbutton _("Fullscreen") action Preference("display", "fullscreen") textbutton _("Windowed") action Preference("display", "any window") - textbutton _("V-Sync") action [ InvertSelected(ToggleField(_preferences, "gl_tearing")), _DisplayReset() ] style gui.theme("check_button") - - # Probably redundant now that we have aspect ratio preservation. - # if not preferences.fullscreen: - # textbutton _("Reset window"): - # action Preference("display", "window") - # sensitive (renpy.get_physical_size() != (config.screen_width, config.screen_height)) - - - vbox: - style_prefix gui.theme("radio") + 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" - label "Framerate" + 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)] - textbutton (f"{int(renpy.get_refresh_rate())} fps") action [Preference("gl framerate", None), Notify(fps_msg)] - if renpy.get_refresh_rate() > 60: - textbutton "60 fps" action [Preference("gl framerate", 60), Notify(fps_msg)] - textbutton "30 fps" action [Preference("gl framerate", 30), 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": + pass + +screen preferences_sound(): + 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" + frame style "navigation_page_right": + pass + +screen preferences_accessibility(): + frame style "navigation_page_left": + vbox: + label _("Accessibility") + + 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 gui.theme("radio") + style_prefix "navigation_checkbox" - label _("Renderer") + textbutton _("Text-to-speech"): + action Preference("self voicing", "toggle") - default renderer_used = renpy.get_renderer_info()["renderer"] + text _("Text-to-speech Accentuation") + bar value Preference("self voicing volume drop") style "navigation_bar" - 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")) - - vbox: - style_prefix gui.theme("check") - - label "Advanced" - - textbutton _("Transitions") action Preference("transitions", "toggle") - textbutton _("Videos") action InvertSelected(Preference("video sprites", "toggle")) - textbutton _("Power-saving") action Preference("gl powersave", "toggle") - textbutton _("multithreading") action settings.Toggle("multithreading") tooltip "Improves performance by executing tasks asynchronously. (Requires restart)" - #if not renpy.mobile: - #textbutton _("Preserve Aspect Ratio") action [settings.Toggle("preserve_aspect_ratio"), _DisplayReset()] - - vbox: - style_prefix gui.theme("slider") - - label _("Image cache ([persistent.custom_settings['image_cache_size']]MB)") - - hbox: - bar value DictValue(persistent.custom_settings, "image_cache_size", range=1792, max_is_zero=False, style="slider", 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." - - text get_gpu_info() yalign 1.0 size 10 - -screen preferences_sound(): - hbox: - box_wrap True - - vbox: - style_prefix gui.theme("slider") - spacing gui.pref_spacing / 2 - - if config.has_music: - label _("Music Volume") - hbox: - bar value Preference("music volume") - - if config.has_sound: - label _("Sound Volume") - hbox: - bar value Preference("sound volume") - if config.sample_sound: - textbutton _("Test") action Play("sound", config.sample_sound) - - label _("Weather Volume") - hbox: - bar value Preference("weather volume") - if config.sample_sound: - textbutton _("Test") action Play("weather", config.sample_sound) - - if config.has_voice: - label _("Voice Volume") - hbox: - bar value Preference("voice volume") - if config.sample_voice: - textbutton _("Test") action Play("voice", config.sample_voice) - - if config.has_music or config.has_sound or config.has_voice: - null height gui.pref_spacing - - textbutton _("Mute All"): - action Preference("all mute", "toggle") - style gui.theme("check_button") - - textbutton _("Mute when minimized"): - action Preference("audio when minimized", "toggle") - selected (not _preferences.audio_when_minimized) - style gui.theme("check_button") - -screen preferences_accessibility(): - - vbox: - text "Disclaimer" size 18 xalign 0.5 - hbox: - xmaximum 731 - text "These menu options are intended to improve accessibility and may not work well in all cases where text might overflow. When changing font, text size or spacing try to keep it close to the default size." size 14 - - hbox: - box_wrap True - - vbox: - style_prefix gui.theme("radio") - - label _("Text Font") - - textbutton _("Default"): - action Preference("font transform", None) - - textbutton _("DejaVu Sans"): - action Preference("font transform", "dejavusans") - - textbutton _("Opendyslexic"): - action Preference("font transform", "opendyslexic") - - vbox: - - label _("Text Scaling") - - hbox: - style_prefix gui.theme("radio") - - textbutton "V. small" action Preference("font size", 0.7) - textbutton "Small" action Preference("font size", 0.9) - textbutton "Normal" action Preference("font size", 1.0) - textbutton "Large" action Preference("font size", 1.2) - textbutton "V. Large" action Preference("font size", 1.4) - - label _("Vertical Text Spacing") - - hbox: - style_prefix gui.theme("radio") - - textbutton "V. small" action Preference("font line spacing", 0.7) - textbutton "Small" action Preference("font line spacing", 0.9) - textbutton "Normal" action Preference("font line spacing", 1.0) - textbutton "Large" action Preference("font line spacing", 1.2) - textbutton "V. Large" action Preference("font line spacing", 1.4) - - if not renpy.mobile: - hbox: - vbox: - style_prefix gui.theme("check") - - label _("Text-to-speech") - - textbutton _("Text-to-speech"): - action Preference("self voicing", "toggle") - - vbox: - style_prefix gui.theme("slider") - - label _("Text-to-speech Accentuation") - - bar value Preference("self voicing volume drop") - - vbox: - label _("Advanced") - - textbutton "Delete persistent data ({color=#f00}!{/color})": - style gui.theme("pref_button") - action Confirm(gui.CONFIRM_DELETE_PERSISTENT, Function(delete_persistent)) - - textbutton "Delete save files ({color=#f00}!{/color})": - style gui.theme("pref_button") - action Confirm(gui.CONFIRM_DELETE_SAVES, Function(delete_saves)) + 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": + pass define gui.CONFIRM_DELETE_PERSISTENT = """{color=#7a0000}Warning!{/color} {size=-4}You are about to reset all persistent data, including diff --git a/game/scripts/gui/save_files.rpy b/game/scripts/gui/save_files.rpy index a50545bb..35c3195d 100644 --- a/game/scripts/gui/save_files.rpy +++ b/game/scripts/gui/save_files.rpy @@ -11,132 +11,211 @@ init offset = -1 screen save(): - - tag menu - use file_slots(_("Save")) screen load(): - - tag menu - use file_slots(_("Load")) screen file_slots(title): - default page_name = FilePageNameInputValue(pattern=_("Page {}"), auto=_("Auto Saves"), quick=_("Quick Saves")) - default page_modifier = 0 + default time_format = "{#file_time}%#d %B, %Y, %#H:%M" if renpy.windows else "{#file_time}%-d %B, %Y, %-H:%M" - use game_menu(title): - - fixed: - - # This ensures the input will get the enter event before any of the buttons do - order_reverse True - - # The page name, which can be edited by clicking on a button + frame style "navigation_page_left": + vbox: button: - style gui.theme("page_label") - - key_events True - xalign 0.5 + style "navigation_label" action page_name.Toggle() + input: + style "navigation_label_text" + value page_name - hbox: - spacing 9 - input: - style gui.theme("page_label_text") - value page_name + grid 2 3: + for i in range(1, 7): + vbox style "file_vbox": + text "[i]." offset (-10, 16) size 16 + text FileTime(i, format=time_format) size 10 xalign 0.5 + + button: + style "navigation_picture_button" + xysize (135, 75) - if page_name.editable: - text "{size=-4}{font=[gui.glyph_font]}✎{/font}{/size}" + if FileLoadable(i): + add FileScreenshot(i) xysize (135, 75) + else: + add "#ffffff80" xysize (135, 75) + + if not FileCompatible(i) and title == "Load": + action Confirm(gui.SAVE_INCOMPATIBLE_WARNING, FileAction(i)) + else: + action FileAction(i) - ## The grid of file slots. - grid gui.file_slot_cols gui.file_slot_rows: - style_prefix gui.theme("slot") + textbutton "{unicode}✘{/unicode}" action FileDelete(i) xalign 1.0 style "file_delete" + if FileLoadable(i): + $ playtime = FileJson(i, "playtime", missing=0) + $ minutes, seconds = divmod(int(playtime), 60) + $ hours, minutes = divmod(minutes, 60) + text f"Playtime: {hours}H {minutes}M {seconds}S" size 10 xalign 0.5 yoffset 4 - xalign 0.5 - yalign 0.5 + frame style "navigation_page_right": + vbox: + null height 38 + # button: + # style "navigation_label" + # action page_name.Toggle() + # input: + # style "navigation_label_text" + # value page_name - spacing gui.slot_spacing + grid 2 3: + for i in range(7, 13): + vbox style "file_vbox": + text "[i]." offset (-10, 16) size 16 + text FileTime(i, format=time_format) size 10 xalign 0.5 + + button: + style "navigation_picture_button" + xysize (135, 75) - transpose True + if FileLoadable(i): + add FileScreenshot(i) xysize (135, 75) + else: + add "#ffffff80" xysize (135, 75) + + if not FileCompatible(i) and title == "Load": + action Confirm(gui.SAVE_INCOMPATIBLE_WARNING, FileAction(i)) + else: + action FileAction(i) - for i in range(gui.file_slot_cols * gui.file_slot_rows): + textbutton "{unicode}✘{/unicode}" action FileDelete(i) xalign 1.0 style "file_delete" + if FileLoadable(i): + $ playtime = FileJson(i, "playtime", missing=0) + $ minutes, seconds = divmod(int(playtime), 60) + $ hours, minutes = divmod(minutes, 60) + text f"Playtime: {hours}H {minutes}M {seconds}S" size 10 xalign 0.5 yoffset 4 - $ slot = i + 1 +style file_delete - button: - if not FileCompatible(slot) and title == "Load": - action Confirm(gui.SAVE_INCOMPATIBLE_WARNING, FileAction(slot)) - else: - action FileAction(slot) +style file_delete_text: + color "#ffffff" - has fixed +style file_vbox is empty: + fit_first True + xfill False + yfill False + xsize 135 + spacing 0 + pos (4, -16) - if FileLoadable(slot): - add FileScreenshot(slot) + # use game_menu(title): - vbox: - style_prefix "slot_button" - xpos config.thumbnail_width - xsize gui.slot_width - config.thumbnail_width - gui.slot_height - yalign 0.5 + # fixed: - if FileCompatible(slot): - default slot_time_format = "{#file_time}%#d %B, %Y, %#H:%M" if renpy.windows else "{#file_time}%-d %B, %Y, %-H:%M" - $ day = FileJson(slot, "day", missing="Unknown") - $ playtime = FileJson(slot, "playtime", missing=0) - $ minutes, seconds = divmod(int(playtime), 60) - $ hours, minutes = divmod(minutes, 60) + # # This ensures the input will get the enter event before any of the buttons do + # order_reverse True - text FileTime(slot, format=slot_time_format) - text f"Day: {day}" - text f"Playtime: {hours}H {minutes}M {seconds}S" - else: - text "INCOMPATIBLE VERSION" color "#f00" + # # The page name, which can be edited by clicking on a button + # button: + # style gui.theme("page_label") - textbutton "{font=[gui.glyph_font]}✘{/font}": - style "slot_delete_button" - action FileDelete(slot) + # key_events True + # xalign 0.5 + # action page_name.Toggle() - key "save_delete" action FileDelete(slot) - else: - text f"Empty Slot {FileSlotName(slot, gui.file_slot_cols * gui.file_slot_rows)}." style "slot_button_text" + # hbox: + # spacing 9 + # input: + # style gui.theme("page_label_text") + # value page_name - ## Buttons to access other pages. - hbox: - style_prefix gui.theme("page") + # if page_name.editable: + # text "{size=-4}{font=[gui.glyph_font]}✎{/font}{/size}" - align (0.5, 1.0) - yoffset 8 + # ## The grid of file slots. + # grid gui.file_slot_cols gui.file_slot_rows: + # style_prefix gui.theme("slot") - spacing gui.page_spacing + # xalign 0.5 + # yalign 0.5 - textbutton _("<") action FilePagePrevious() + # spacing gui.slot_spacing - if config.has_autosave: - textbutton _("{#auto_page}A") action FilePage("auto") keysym "K_a" + # transpose True - if config.has_quicksave: - textbutton _("{#quick_page}Q") action FilePage("quick") keysym "K_q" + # for i in range(gui.file_slot_cols * gui.file_slot_rows): + + # $ slot = i + 1 + + # button: + # if not FileCompatible(slot) and title == "Load": + # action Confirm(gui.SAVE_INCOMPATIBLE_WARNING, FileAction(slot)) + # else: + # action FileAction(slot) + + # has fixed + + # if FileLoadable(slot): + # add FileScreenshot(slot) + + # vbox: + # style_prefix "slot_button" + # xpos config.thumbnail_width + # xsize gui.slot_width - config.thumbnail_width - gui.slot_height + # yalign 0.5 + + # if FileCompatible(slot): + # default slot_time_format = "{#file_time}%#d %B, %Y, %#H:%M" if renpy.windows else "{#file_time}%-d %B, %Y, %-H:%M" + # $ day = FileJson(slot, "day", missing="Unknown") + # $ playtime = FileJson(slot, "playtime", missing=0) + # $ minutes, seconds = divmod(int(playtime), 60) + # $ hours, minutes = divmod(minutes, 60) + + # text FileTime(slot, format=slot_time_format) + # text f"Day: {day}" + # text f"Playtime: {hours}H {minutes}M {seconds}S" + # else: + # text "INCOMPATIBLE VERSION" color "#f00" + + # textbutton "{font=[gui.glyph_font]}✘{/font}": + # style "slot_delete_button" + # action FileDelete(slot) + + # key "save_delete" action FileDelete(slot) + # else: + # text f"Empty Slot {FileSlotName(slot, gui.file_slot_cols * gui.file_slot_rows)}." style "slot_button_text" + + # ## Buttons to access other pages. + # hbox: + # style_prefix gui.theme("page") + + # align (0.5, 1.0) + # yoffset 8 + + # spacing gui.page_spacing + + # textbutton _("<") action FilePagePrevious() + + # if config.has_autosave: + # textbutton _("{#auto_page}A") action FilePage("auto") keysym "K_a" + + # if config.has_quicksave: + # textbutton _("{#quick_page}Q") action FilePage("quick") keysym "K_q" - $ page_modifier = max(0, int(FilePageName(str(page_modifier+9), str(page_modifier+9)))-9) + # $ page_modifier = max(0, int(FilePageName(str(page_modifier+9), str(page_modifier+9)))-9) - for page in range(1+page_modifier, 10+page_modifier): - textbutton "[page]": - xminimum 40 - action FilePage(page) - if page < 10: - keysym f"K_{page}" + # for page in range(1+page_modifier, 10+page_modifier): + # textbutton "[page]": + # xminimum 40 + # action FilePage(page) + # if page < 10: + # keysym f"K_{page}" - textbutton _(">") action FilePageNext() + # textbutton _(">") action FilePageNext() - key ["mousedown_4", "K_RIGHT", "repeat_K_RIGHT"] action FilePageNext() - key ["mousedown_5", "K_LEFT", "repeat_K_LEFT"] action FilePagePrevious() + # key ["mousedown_4", "K_RIGHT", "repeat_K_RIGHT"] action FilePageNext() + # key ["mousedown_5", "K_LEFT", "repeat_K_LEFT"] action FilePagePrevious() style page_label is gui_label diff --git a/game/scripts/options.rpy b/game/scripts/options.rpy index c71ca2a8..2078b865 100644 --- a/game/scripts/options.rpy +++ b/game/scripts/options.rpy @@ -10,17 +10,18 @@ default preferences.gl_powersave = False default preferences.audio_when_minimized = False init python: - settings.default("theme", "auto") - settings.default("text_color_day", "#402313ff") - settings.default("text_color_night", "#341c0fff") - settings.default("text_outline", "#00000000") + settings.default("theme", "auto") # TODO: Scrapped. + settings.default("text_color_day", "#402313ff") # TODO: Scrapped. + settings.default("text_color_night", "#341c0fff") # TODO: Scrapped. + settings.default("text_outline", "#00000000") # TODO: Scrapped. settings.default("tooltip", True) settings.default("tutorials", True) - settings.default("preserve_aspect_ratio", True) + settings.default("preserve_aspect_ratio", True) # TODO: Scrapped. settings.default("animations", True) settings.default("updates", True) settings.default("image_cache_size", 512) settings.default("multithreading", True) + settings.default("kinetictext", True) renpy.music.register_channel("background", "sfx", True) renpy.music.register_channel("sound2", "sfx", False)