From d1236b470cdc3350ec5d23a7bd08dce70ccf2934 Mon Sep 17 00:00:00 2001 From: Dasemu Date: Tue, 20 Oct 2026 12:45:46 +0200 Subject: [PATCH] feat(renpy): book-style Spanish menus and save/load register - Ship the Spanish UI translation (common + screens) with the template, overlaid by the work's tl/, and force config.language so a stale persistent preference cannot fall back to English. - Redesign main menu, game menu frame, save/load, preferences, history, help, about, confirm, notify and quick menu in the title-card style (gold rules, framed cards, deterministic PIL ornaments). - Save slots: thumbnail, scene title, date and verse excerpt from save JSON metadata; four large slots per page, Roman-numeral pages, separate Autosaves/Quick saves tabs, per-slot delete, no Sync. - Phone (small/touch) variants and e2e checks for save metadata. Co-Authored-By: Claude Opus 5.5 --- src/vnpipe/renpy_gen.py | 174 ++- src/vnpipe/renpy_templates/game/gui.rpy | 39 +- .../game/gui/overlay/confirm.png | Bin 38668 -> 0 bytes .../game/gui/overlay/game_menu.png | Bin 39474 -> 0 bytes .../game/gui/overlay/main_menu.png | Bin 39536 -> 0 bytes .../game/gui/phone/overlay/game_menu.png | Bin 38737 -> 0 bytes .../game/gui/phone/overlay/main_menu.png | Bin 39632 -> 0 bytes src/vnpipe/renpy_templates/game/menus.rpy | 27 + src/vnpipe/renpy_templates/game/screens.rpy | 921 ++++++++++---- .../renpy_templates/tl/spanish/common.rpy | 1121 +++++++++++++++++ .../renpy_templates/tl/spanish/screens.rpy | 244 ++++ tests/test_renpy_gen.py | 67 +- 12 files changed, 2291 insertions(+), 302 deletions(-) delete mode 100644 src/vnpipe/renpy_templates/game/gui/overlay/confirm.png delete mode 100644 src/vnpipe/renpy_templates/game/gui/overlay/game_menu.png delete mode 100644 src/vnpipe/renpy_templates/game/gui/overlay/main_menu.png delete mode 100644 src/vnpipe/renpy_templates/game/gui/phone/overlay/game_menu.png delete mode 100644 src/vnpipe/renpy_templates/game/gui/phone/overlay/main_menu.png create mode 100644 src/vnpipe/renpy_templates/tl/spanish/common.rpy create mode 100644 src/vnpipe/renpy_templates/tl/spanish/screens.rpy diff --git a/src/vnpipe/renpy_gen.py b/src/vnpipe/renpy_gen.py index 645a740..7fc7cc6 100644 --- a/src/vnpipe/renpy_gen.py +++ b/src/vnpipe/renpy_gen.py @@ -164,21 +164,40 @@ def scan_audio(out: Path) -> Audio: def copy_translations(work: Work, out: Path) -> list[Path]: - """Copy ``/tl/**/*.rpy`` into ``game/tl/`` and set ``[ui].language`` as default.""" - src_root = work.path("tl") + """Install the UI translation for ``[ui].language`` and make it the only language. + + vnpipe ships ``renpy_templates/tl//`` (Ren'Py's common strings plus every string + of the template screens); ``/tl/**/*.rpy`` is copied on top, so a work file with the + same path replaces the shipped one. ``config.language`` (not only + ``config.default_language``, which applies on first run) forces the language even when a + persistent preference from an older build says otherwise. + """ dest_root = out / "game" / "tl" lang_file = out / "game" / "language.rpy" + language = work.data.get("ui", {}).get("language") + sources: dict[Path, Path] = {} + roots = [TEMPLATE_DIR / "tl" / language] if language else [] + roots.append(work.path("tl")) + for i, root in enumerate(roots): + if not root.is_dir(): + continue + prefix = Path(language) if i == 0 and language else Path() + for src in sorted(root.rglob("*.rpy")): + sources[prefix / src.relative_to(root)] = src written = [] - if src_root.is_dir(): + if sources: shutil.rmtree(dest_root, ignore_errors=True) - for src in sorted(src_root.rglob("*.rpy")): - dest = dest_root / src.relative_to(src_root) + for rel, src in sorted(sources.items()): + dest = dest_root / rel dest.parent.mkdir(parents=True, exist_ok=True) shutil.copyfile(src, dest) written.append(dest) - language = work.data.get("ui", {}).get("language") if language: - write_text(lang_file, f"define config.default_language = {quote(language)}\n") + write_text( + lang_file, + f"define config.default_language = {quote(language)}\n" + f"define config.language = {quote(language)}\n", + ) written.append(lang_file) else: lang_file.unlink(missing_ok=True) @@ -722,13 +741,19 @@ def _solid(size: tuple[int, int], color: tuple[int, ...]) -> Image.Image: def _check_image(selected: bool, round_: bool) -> Image.Image: + """Preference marks: a diamond (radio) or a square (check), filled with gold when set.""" img = Image.new("RGBA", (38, 38), (0, 0, 0, 0)) draw = ImageDraw.Draw(img) - box = [4, 4, 33, 33] - shape = draw.ellipse if round_ else draw.rectangle - shape(box, outline=IVORY + (255,), width=3) - if selected: - shape([12, 12, 25, 25], fill=ACCENT + (255,)) + if round_: + outer = [(19, 4), (34, 19), (19, 34), (4, 19)] + inner = [(19, 11), (27, 19), (19, 27), (11, 19)] + draw.polygon(outer, outline=IVORY + (200,), width=2) + if selected: + draw.polygon(inner, fill=ACCENT + (255,)) + else: + draw.rectangle([6, 6, 31, 31], outline=IVORY + (200,), width=2) + if selected: + draw.rectangle([12, 12, 25, 25], fill=ACCENT + (255,)) return img @@ -739,6 +764,84 @@ def _slot_image(border_alpha: int, fill_alpha: int) -> Image.Image: return img +def _card_image(fill: tuple[int, ...], outer_alpha: int, inner_alpha: int) -> Image.Image: + """A book-plate panel: tinted fill, a gold outline and a fainter inner rule 5 px inside. + Used as a Frame with 12 px borders, so the double rule never scales.""" + img = Image.new("RGBA", (64, 64), fill) + draw = ImageDraw.Draw(img) + draw.rectangle([0, 0, 63, 63], outline=ACCENT + (outer_alpha,), width=2) + draw.rectangle([5, 5, 58, 58], outline=ACCENT + (inner_alpha,), width=1) + return img + + +def _rule_image(width: int, height: int, diamond: int) -> Image.Image: + """A gold rule fading out at both ends, with a small diamond at its centre.""" + img = Image.new("RGBA", (width, height), (0, 0, 0, 0)) + mid_y = height // 2 + half = width / 2 + for x in range(width): + alpha = round(255 * min(1.0, (1 - abs(x + 0.5 - half) / half) * 1.6)) + img.putpixel((x, mid_y), ACCENT + (alpha,)) + img.putpixel((x, mid_y + 1), ACCENT + (alpha // 2,)) + cx, d = width // 2, diamond + ImageDraw.Draw(img).polygon( + [(cx, mid_y - d), (cx + d, mid_y), (cx, mid_y + d), (cx - d, mid_y)], fill=ACCENT + (255,) + ) + return img + + +def _nav_marker(alpha: int) -> Image.Image: + """Navigation highlight: a gold bar on the left edge and a tint fading to the right.""" + img = Image.new("RGBA", (96, 8), (0, 0, 0, 0)) + for x in range(96): + a = alpha if x < 4 else round(alpha * 0.28 * (1 - (x - 4) / 92)) + for y in range(8): + img.putpixel((x, y), ACCENT + (a,)) + return img + + +def _line_bar(color: tuple[int, ...], thickness: int) -> Image.Image: + """A bar/slider track: a thin horizontal line centred in a transparent 48x48 tile.""" + img = Image.new("RGBA", (48, 48), (0, 0, 0, 0)) + top = 24 - thickness // 2 + ImageDraw.Draw(img).rectangle([0, top, 47, top + thickness - 1], fill=color) + return img + + +def _vline_bar(color: tuple[int, ...], thickness: int) -> Image.Image: + return _line_bar(color, thickness).transpose(Image.Transpose.ROTATE_90) + + +def _diamond_thumb(width: int, height: int) -> Image.Image: + img = Image.new("RGBA", (width, height), (0, 0, 0, 0)) + cx, cy = width // 2, height // 2 + r = min(cx, cy) - 1 + ImageDraw.Draw(img).polygon( + [(cx, cy - r), (cx + r, cy), (cx, cy + r), (cx - r, cy)], + fill=ACCENT + (255,), + outline=DARK + (255,), + ) + return img + + +def _hairline() -> Image.Image: + """A faint gold line on the top edge (a Frame with a 1 px top border keeps it 1 px).""" + img = Image.new("RGBA", (64, 4), (0, 0, 0, 0)) + ImageDraw.Draw(img).line([(0, 0), (63, 0)], fill=ACCENT + (70,)) + return img + + +def _vignette() -> Image.Image: + """Menu shade (scaled up to the screen): darker towards the edges, never opaque.""" + w, h = 192, 108 + img = Image.new("RGBA", (w, h)) + for y in range(h): + for x in range(w): + d = min(1.0, (((x - w / 2) / (w / 2)) ** 2 + ((y - h / 2) / (h / 2)) ** 2) ** 0.5) + img.putpixel((x, y), DARK + (round(120 + 115 * d * d),)) + return img + + def gui_extra_images() -> dict[str, Image.Image]: """Deterministic simple GUI images, keyed by path relative to ``game/``.""" base: dict[str, Image.Image] = { @@ -751,22 +854,35 @@ def gui_extra_images() -> dict[str, Image.Image]: "button/check_selected_foreground.png": _check_image(True, False), "button/radio_foreground.png": _check_image(False, True), "button/radio_selected_foreground.png": _check_image(True, True), - "bar/left.png": _solid((48, 48), ACCENT + (255,)), - "bar/right.png": _solid((48, 48), IVORY + (60,)), - "bar/top.png": _solid((48, 48), IVORY + (60,)), - "bar/bottom.png": _solid((48, 48), ACCENT + (255,)), - "slider/horizontal_bar.png": _solid((48, 48), IVORY + (60,)), - "slider/horizontal_thumb.png": _solid((20, 38), ACCENT + (255,)), - "slider/vertical_bar.png": _solid((48, 48), IVORY + (60,)), - "slider/vertical_thumb.png": _solid((38, 20), ACCENT + (255,)), - "scrollbar/horizontal_bar.png": _solid((48, 48), IVORY + (40,)), - "scrollbar/horizontal_thumb.png": _solid((48, 48), ACCENT + (255,)), - "scrollbar/vertical_bar.png": _solid((48, 48), IVORY + (40,)), - "scrollbar/vertical_thumb.png": _solid((48, 48), ACCENT + (255,)), + "bar/left.png": _line_bar(ACCENT + (255,), 6), + "bar/right.png": _line_bar(IVORY + (70,), 2), + "bar/top.png": _vline_bar(IVORY + (70,), 2), + "bar/bottom.png": _vline_bar(ACCENT + (255,), 6), + "slider/horizontal_bar.png": _line_bar(IVORY + (90,), 2), + "slider/horizontal_thumb.png": _diamond_thumb(34, 38), + "slider/vertical_bar.png": _vline_bar(IVORY + (90,), 2), + "slider/vertical_thumb.png": _diamond_thumb(38, 34), + "scrollbar/horizontal_bar.png": _line_bar(IVORY + (50,), 2), + "scrollbar/horizontal_thumb.png": _line_bar(ACCENT + (220,), 6), + "scrollbar/vertical_bar.png": _vline_bar(IVORY + (50,), 2), + "scrollbar/vertical_thumb.png": _vline_bar(ACCENT + (220,), 6), + # Menu ornaments (screens.rpy): panels, rules, navigation marker, menu shade. + "vn/card_background.png": _card_image(DARK + (215,), 120, 45), + "vn/card_hover_background.png": _card_image((38, 31, 22, 235), 255, 140), + "vn/card_empty.png": _card_image(DARK + (120,), 55, 0), + "vn/rule.png": _rule_image(520, 18, 6), + "vn/rule_small.png": _rule_image(240, 14, 4), + "vn/nav_background.png": _solid((96, 8), (0, 0, 0, 0)), + "vn/nav_hover_background.png": _nav_marker(130), + "vn/nav_selected_background.png": _nav_marker(255), + "vn/nav_selected_hover_background.png": _nav_marker(255), + "vn/vignette.png": _vignette(), + "vn/hairline.png": _hairline(), } result = dict(base) for path, img in base.items(): - result[f"phone/{path}"] = img + if not path.startswith("vn/"): # ornaments are not looked up by variant prefix + result[f"phone/{path}"] = img return {f"gui/{path}": img for path, img in sorted(result.items())} @@ -806,7 +922,11 @@ testcase default: pause 1.0 # Actions, not label text: stock menu labels may be translated. run Start() -@@PICK@@ advance until eval (e2e_state["end"]) timeout 900 +@@PICK@@ pause 1.0 + # A save carries the scene title shown by the load screen. + run FileSave(1, confirm=False) + assert eval (FileJson(1, "vn_scene") is not None) + advance until eval (e2e_state["end"]) timeout 900 advance until screen "main_menu" timeout 60 @@MENUS@@ assert eval (e2e_state["end"]) """ @@ -834,6 +954,8 @@ def render_e2e(styles: dict[str, Any], ui: dict[str, str]) -> str: " run Return()\n" ' assert screen "main_menu"\n' ) + for screen in ("load", "preferences", "about"): + menus += f' run ShowMenu("{screen}")\n assert screen "{screen}"\n run Return()\n' return E2E_TESTCASE.replace("@@PICK@@", pick).replace("@@MENUS@@", menus) diff --git a/src/vnpipe/renpy_templates/game/gui.rpy b/src/vnpipe/renpy_templates/game/gui.rpy index d2c2043..0d91572 100644 --- a/src/vnpipe/renpy_templates/game/gui.rpy +++ b/src/vnpipe/renpy_templates/game/gui.rpy @@ -28,21 +28,21 @@ define config.check_conflicting_properties = True define gui.accent_color = '#c9a25b' ## The color used for a text button when it is neither selected nor hovered. -define gui.idle_color = '#888888' +define gui.idle_color = '#b4a990' ## The small color is used for small text, which needs to be brighter/darker to ## achieve the same effect. -define gui.idle_small_color = '#aaaaaa' +define gui.idle_small_color = '#cfc4ab' ## The color that is used for buttons and bars that are hovered. -define gui.hover_color = '#dec79c' +define gui.hover_color = '#ecd4a0' ## The color used for a text button when it is selected but not focused. A ## button is selected if it is the current screen or preference value. -define gui.selected_color = '#ffffff' +define gui.selected_color = '#d9b46a' ## The color used for a text button when it cannot be selected. -define gui.insensitive_color = '#8888887f' +define gui.insensitive_color = '#7d74647f' ## Colors used for the portions of bars that are not filled in. These are not ## used directly, but are used when re-generating bar image files. @@ -188,10 +188,10 @@ define gui.confirm_button_text_xalign = 0.5 define gui.page_button_borders = Borders(15, 6, 15, 6) -define gui.quick_button_borders = Borders(15, 6, 15, 0) -define gui.quick_button_text_size = 21 +define gui.quick_button_borders = Borders(18, 6, 18, 6) +define gui.quick_button_text_size = 24 define gui.quick_button_text_idle_color = gui.idle_small_color -define gui.quick_button_text_selected_color = gui.accent_color +define gui.quick_button_text_selected_color = gui.selected_color ## You can also add your own customizations, by adding properly-named variables. ## For example, you can uncomment the following line to set the width of a @@ -211,9 +211,9 @@ define gui.choice_button_borders = Borders(150, 8, 150, 8) define gui.choice_button_text_font = gui.text_font define gui.choice_button_text_size = gui.text_size define gui.choice_button_text_xalign = 0.5 -define gui.choice_button_text_idle_color = '#888888' -define gui.choice_button_text_hover_color = "#ffffff" -define gui.choice_button_text_insensitive_color = '#8888887f' +define gui.choice_button_text_idle_color = '#cfc4ab' +define gui.choice_button_text_hover_color = '#ecd4a0' +define gui.choice_button_text_insensitive_color = '#7d74647f' ## File Slot Buttons ########################################################### @@ -237,8 +237,8 @@ define config.thumbnail_width = 384 define config.thumbnail_height = 216 ## The number of columns and rows in the grid of save slots. -define gui.file_slot_cols = 3 -define gui.file_slot_rows = 2 +define gui.file_slot_cols = 1 +define gui.file_slot_rows = 4 ## Positioning and Spacing ##################################################### @@ -251,10 +251,10 @@ define gui.file_slot_rows = 2 define gui.navigation_xpos = 60 ## The vertical position of the skip indicator. -define gui.skip_ypos = 15 +define gui.skip_ypos = 36 ## The vertical position of the notify screen. -define gui.notify_ypos = 68 +define gui.notify_ypos = 36 ## The spacing between menu choices. define gui.choice_spacing = 33 @@ -341,7 +341,7 @@ define config.history_length = 250 ## The height of a history screen entry, or None to make the height variable at ## the cost of performance. -define gui.history_height = 210 +define gui.history_height = None ## Additional space to add between history screen entries. define gui.history_spacing = 0 @@ -424,7 +424,7 @@ init python: @gui.variant def touch(): - gui.quick_button_borders = Borders(60, 21, 60, 0) + gui.quick_button_borders = Borders(54, 18, 54, 10) ## This changes the size and spacing of various GUI elements to ensure they ## are easily visible on phones. @@ -454,14 +454,13 @@ init python: gui.navigation_spacing = 30 gui.pref_button_spacing = 15 - gui.history_height = 285 gui.history_text_width = 1035 gui.quick_button_text_size = 30 ## File button layout. - gui.file_slot_cols = 2 - gui.file_slot_rows = 2 + gui.file_slot_cols = 1 + gui.file_slot_rows = 3 ## NVL-mode. gui.nvl_height = None diff --git a/src/vnpipe/renpy_templates/game/gui/overlay/confirm.png b/src/vnpipe/renpy_templates/game/gui/overlay/confirm.png deleted file mode 100644 index b95c47cb6a2ad08172b303f66b13a8be1313c623..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 38668 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 aFgiLD-`AeMy{ocG*?)!nknt#YV(bs1D1X)f diff --git a/src/vnpipe/renpy_templates/game/gui/phone/overlay/game_menu.png b/src/vnpipe/renpy_templates/game/gui/phone/overlay/game_menu.png deleted file mode 100644 index 564cff00a45922384001a5c6a53b68096eea192a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 38737 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 OFeb_7RAQt_zw!sllNqD{ diff --git a/src/vnpipe/renpy_templates/game/menus.rpy b/src/vnpipe/renpy_templates/game/menus.rpy index 6b3faca..fc40915 100644 --- a/src/vnpipe/renpy_templates/game/menus.rpy +++ b/src/vnpipe/renpy_templates/game/menus.rpy @@ -4,12 +4,37 @@ ## Labels of the scenes the player has reached; updated when a scene starts. default persistent.vn_seen_scenes = set() +## The scene being played (a label of `vn_scenes`); saved with the game. +default vn_current_scene = None + init python: def vn_mark_scene(label): + store.vn_current_scene = label if label not in persistent.vn_seen_scenes: persistent.vn_seen_scenes.add(label) renpy.save_persistent() + ## Save metadata shown by the file slots (screens.rpy): the scene title and the first + ## line of the text on screen. Text tags are dropped and markup is escaped. + VN_EXCERPT_CHARS = 90 + + def vn_excerpt(what): + line = renpy.filter_text_tags(what or "", allow=[]).strip().split("\n")[0].strip() + if len(line) > VN_EXCERPT_CHARS: + line = line[:VN_EXCERPT_CHARS].rsplit(" ", 1)[0] + "…" + return line.replace("[", "[[").replace("{", "{{") + + def vn_save_json(d): + titles = dict((l, t) for l, t in vn_scenes) + if store.vn_current_scene in titles: + d["vn_scene"] = titles[store.vn_current_scene] + if _history_list: + last = _history_list[-1] + d["vn_who"] = (last.who or "").replace("[", "[[").replace("{", "{{") + d["vn_line"] = vn_excerpt(last.what) + + config.save_json_callbacks.append(vn_save_json) + screen vn_scene_select(): tag menu @@ -33,6 +58,8 @@ style vn_scenes_button_text is gui_button_text style vn_scenes_button: properties gui.button_properties("navigation_button") xalign 0.0 + padding (26, 5, 20, 5) + background Frame("gui/vn/nav_[prefix_]background.png", 6, 0) style vn_scenes_button_text: properties gui.text_properties("navigation_button") diff --git a/src/vnpipe/renpy_templates/game/screens.rpy b/src/vnpipe/renpy_templates/game/screens.rpy index 467db21..212b210 100644 --- a/src/vnpipe/renpy_templates/game/screens.rpy +++ b/src/vnpipe/renpy_templates/game/screens.rpy @@ -230,10 +230,11 @@ style choice_button_text is default: properties gui.text_properties("choice_button") + ## Quick Menu screen ########################################################### ## ## The quick menu is displayed in-game to provide easy access to the out-of-game -## menus. +## menus. It sits on its own dark strip so it stays legible over any textbox. screen quick_menu(): @@ -242,18 +243,21 @@ screen quick_menu(): if quick_menu: - hbox: - style_prefix "quick" - style "quick_menu" + frame: + style "quick_frame" - textbutton _("Back") action Rollback() - textbutton _("History") action ShowMenu('history') - textbutton _("Skip") action Skip() alternate Skip(fast=True, confirm=True) - textbutton _("Auto") action Preference("auto-forward", "toggle") - textbutton _("Save") action ShowMenu('save') - textbutton _("Q.Save") action QuickSave() - textbutton _("Q.Load") action QuickLoad() - textbutton _("Prefs") action ShowMenu('preferences') + hbox: + style_prefix "quick" + style "quick_menu" + + textbutton _("Back") action Rollback() + textbutton _("History") action ShowMenu('history') + textbutton _("Skip") action Skip() alternate Skip(fast=True, confirm=True) + textbutton _("Auto") action Preference("auto-forward", "toggle") + textbutton _("Save") action ShowMenu('save') + textbutton _("Q.Save") action QuickSave() + textbutton _("Q.Load") action QuickLoad() + textbutton _("Prefs") action ShowMenu('preferences') ## This code ensures that the quick_menu screen is displayed in-game, whenever @@ -263,19 +267,41 @@ init python: default quick_menu = True +style quick_frame is empty style quick_menu is hbox style quick_button is default style quick_button_text is button_text -style quick_menu: +style quick_frame: xalign 0.5 yalign 1.0 + padding (24, 2, 24, 2) + background Solid("#0b0907b8") + +style quick_menu: + spacing 4 style quick_button: properties gui.button_properties("quick_button") style quick_button_text: properties gui.text_properties("quick_button") + kerning 1 + + +################################################################################ +## Shared menu ornaments +################################################################################ + +## A gold rule with a diamond at its centre (as on the scene title cards). +image vn_rule = "gui/vn/rule.png" +image vn_rule_small = "gui/vn/rule_small.png" + +## Darkens a menu background towards the edges so the panels stay readable. +image vn_vignette = Transform("gui/vn/vignette.png", xysize=(config.screen_width, config.screen_height)) + +## A diamond glyph, from a font that has it. +define vn_diamond = "{font=DejaVuSans.ttf}◆{/font}" ################################################################################ @@ -285,17 +311,13 @@ style quick_button_text: ## Navigation screen ########################################################### ## ## This screen is included in the main and game menus, and provides navigation -## to other menus, and to start the game. +## to other menus, and to start the game. On the main menu it is a centred list +## under the title; in the game menus, a column on the left. -screen navigation(): +screen navigation(centered=False): vbox: - style_prefix "navigation" - - xpos gui.navigation_xpos - yalign 0.5 - - spacing gui.navigation_spacing + style_prefix ("main_nav" if centered else "navigation") if main_menu: @@ -337,20 +359,53 @@ screen navigation(): textbutton _("Quit") action Quit(confirm=not main_menu) +style navigation_vbox is vbox style navigation_button is gui_button style navigation_button_text is gui_button_text +style navigation_vbox: + xpos gui.navigation_xpos + yalign 0.5 + spacing gui.navigation_spacing + style navigation_button: size_group "navigation" properties gui.button_properties("navigation_button") + xminimum 300 + padding (26, 9, 20, 9) + background Frame("gui/vn/nav_[prefix_]background.png", 6, 0) style navigation_button_text: properties gui.text_properties("navigation_button") + size 31 + kerning 1 + +style main_nav_vbox is vbox +style main_nav_button is gui_button +style main_nav_button_text is gui_button_text + +style main_nav_vbox: + xalign 0.5 + ypos 520 + spacing 2 + +style main_nav_button: + xalign 0.5 + padding (40, 4) + +style main_nav_button_text: + properties gui.text_properties("navigation_button") + size 34 + kerning 3 + xalign 0.5 + textalign 0.5 + outlines [(2, "#000000a0", 0, 1)] ## Main Menu screen ############################################################ ## -## Used to display the main menu when Ren'Py starts. +## Used to display the main menu when Ren'Py starts: the title as on a book's +## title page, a gold rule, and the menu centred below. ## ## https://www.renpy.org/doc/html/screen_special.html#main-menu @@ -360,16 +415,7 @@ screen main_menu(): tag menu add gui.main_menu_background - - ## Darkens the background so the title reads well. - add Solid("#000000a8") - - ## The left strip behind the navigation. - frame: - style "main_menu_frame" - - ## The actual contents of the main menu are in the navigation screen. - use navigation + add "vn_vignette" if gui.show_name: @@ -379,32 +425,29 @@ screen main_menu(): text "[config.name!t]": style "main_menu_title" + add "vn_rule" xalign 0.5 + if vn_subtitle: text "[vn_subtitle!t]": style "main_menu_subtitle" - text "[config.version]": - style "main_menu_version" + ## The actual contents of the main menu are in the navigation screen. + use navigation(centered=True) + + text "[config.version]": + style "main_menu_version" -style main_menu_frame is empty style main_menu_vbox is vbox style main_menu_text is gui_text style main_menu_title is main_menu_text style main_menu_subtitle is main_menu_text style main_menu_version is main_menu_text -style main_menu_frame: - xsize 420 - yfill True - - background "gui/overlay/main_menu.png" - style main_menu_vbox: - xpos 420 - xsize 1500 - yalign 0.42 - spacing 36 + xalign 0.5 + ypos 150 + spacing 22 style main_menu_text: properties gui.text_properties("main_menu", accent=True) @@ -412,30 +455,36 @@ style main_menu_text: style main_menu_title: properties gui.text_properties("title") size 132 - kerning 10 + kerning 14 xalign 0.5 - text_align 0.5 + textalign 0.5 color "#efe6d2" outlines [(4, "#000000b0", 0, 3)] style main_menu_subtitle: - size 46 + size 44 italic True kerning 3 xalign 0.5 - text_align 0.5 + textalign 0.5 color "#c9a25b" outlines [(3, "#000000b0", 0, 2)] style main_menu_version: properties gui.text_properties("version") - xalign 0.5 + size 20 + color "#efe6d260" + xalign 1.0 + yalign 1.0 + xoffset -30 + yoffset -20 ## Game Menu screen ############################################################ ## -## This lays out the basic common structure of a game menu screen. It's called -## with the screen title, and displays the background, title, and navigation. +## This lays out the basic common structure of a game menu screen: the art +## behind a dark shade, a navigation column on the left with the work's title, +## and the screen title over the content, underlined by the gold rule. ## ## The scroll parameter can be None, or one of "viewport" or "vpgrid". ## This screen is intended to be used with one or more children, which are @@ -450,58 +499,68 @@ screen game_menu(title, scroll=None, yinitial=0.0, spacing=0): else: add gui.game_menu_background - ## The game menu is darker than the main menu so text stays legible. - add Solid("#000000d0") + add "vn_vignette" + add Solid("#000000a0") + + ## The navigation column. + frame: + style "game_menu_navigation_frame" + + text "[config.name!t]": + style "game_menu_work_title" frame: - style "game_menu_outer_frame" + style "game_menu_work_rule" + add "vn_rule_small" - hbox: + ## The title and its rule, centred over the content. + vbox: + style "game_menu_title_vbox" - ## Reserve space for the navigation section. - frame: - style "game_menu_navigation_frame" + label title - frame: - style "game_menu_content_frame" + add "vn_rule" xalign 0.5 - if scroll == "viewport": + frame: + style "game_menu_content_frame" - viewport: - yinitial yinitial - scrollbars "vertical" - mousewheel True - draggable True - pagekeys True + if scroll == "viewport": - side_yfill True + viewport: + yinitial yinitial + scrollbars "vertical" + mousewheel True + draggable True + pagekeys True - vbox: - spacing spacing + side_yfill True - transclude - - elif scroll == "vpgrid": - - vpgrid: - cols 1 - yinitial yinitial - - scrollbars "vertical" - mousewheel True - draggable True - pagekeys True - - side_yfill True - - spacing spacing - - transclude - - else: + vbox: + spacing spacing transclude + elif scroll == "vpgrid": + + vpgrid: + cols 1 + yinitial yinitial + + scrollbars "vertical" + mousewheel True + draggable True + pagekeys True + + side_yfill True + + spacing spacing + + transclude + + else: + + transclude + use navigation textbutton _("Return"): @@ -509,15 +568,15 @@ screen game_menu(title, scroll=None, yinitial=0.0, spacing=0): action Return() - label title - if main_menu: key "game_menu" action ShowMenu("main_menu") -style game_menu_outer_frame is empty style game_menu_navigation_frame is empty style game_menu_content_frame is empty +style game_menu_title_vbox is vbox +style game_menu_work_title is gui_text +style game_menu_work_rule is empty style game_menu_viewport is gui_viewport style game_menu_side is gui_side style game_menu_scrollbar is gui_vscrollbar @@ -528,23 +587,40 @@ style game_menu_label_text is gui_label_text style return_button is navigation_button style return_button_text is navigation_button_text -style game_menu_outer_frame: - bottom_padding 45 - top_padding 180 - - background "gui/overlay/game_menu.png" - style game_menu_navigation_frame: - xsize 420 + xsize 400 yfill True + background Fixed(Solid("#0b0907d8"), Solid("#c9a25b50", xsize=1, ysize=960, xpos=399, ypos=60)) + +style game_menu_work_title: + xpos 200 + xanchor 0.5 + xmaximum 360 + textalign 0.5 + ypos 62 + size 34 + kerning 8 + color gui.accent_color + +style game_menu_work_rule: + xpos 200 + xanchor 0.5 + ypos 122 + +style game_menu_title_vbox: + xpos 1160 + xanchor 0.5 + ypos 44 + spacing 4 style game_menu_content_frame: - left_margin 60 - right_margin 30 - top_margin 15 + xpos 480 + ypos 228 + xsize 1360 + ysize 800 style game_menu_viewport: - xsize 1380 + xsize 1360 style game_menu_vscrollbar: unscrollable gui.unscrollable @@ -553,13 +629,14 @@ style game_menu_side: spacing 15 style game_menu_label: - xpos 75 - ysize 180 + xalign 0.5 style game_menu_label_text: - size 75 - color gui.accent_color - yalign 0.5 + size 76 + kerning 3 + color "#efe6d2" + xalign 0.5 + outlines [(3, "#00000090", 0, 2)] style return_button: xpos gui.navigation_xpos @@ -570,46 +647,63 @@ style return_button: ## About screen ################################################################ ## ## This screen gives credit and copyright information about the game and Ren'Py. -## -## There's nothing special about this screen, and hence it also serves as an -## example of how to make a custom screen. screen about(): tag menu - ## This use statement includes the game_menu screen inside this one. The - ## vbox child is then included inside the viewport inside the game_menu - ## screen. use game_menu(_("About"), scroll="viewport"): style_prefix "about" vbox: + xsize 1300 + spacing 6 label "[config.name!t]" - text _("Version [config.version!t]\n") + text _("Version [config.version!t]\n") style "about_version" ## gui.about is usually set in options.rpy. if gui.about: text "[gui.about!t]\n" - text _("Made with {a=https://www.renpy.org/}Ren'Py{/a} [renpy.version_only].\n\n[renpy.license!t]") + add "vn_rule_small" + null height 16 + + text _("Made with {a=https://www.renpy.org/}Ren'Py{/a} [renpy.version_only].\n\n[renpy.license!t]"): + style "about_small" style about_label is gui_label style about_label_text is gui_label_text style about_text is gui_text +style about_version is about_text +style about_small is about_text style about_label_text: - size gui.label_text_size + size 48 + kerning 4 + color gui.accent_color + +style about_text: + size 30 + +style about_version: + size 24 + italic True + color "#efe6d2a0" + +style about_small: + size 22 + color "#efe6d2b0" ## Load and Save screens ####################################################### ## -## These screens are responsible for letting the player save the game and load -## it again. Since they share nearly everything in common, both are implemented -## in terms of a third screen, file_slots. +## Both screens share file_slots: a page of saves shown as entries of a book's +## register (thumbnail, scene title, the line that was on screen and the date), +## a page name the player can edit, and pages numbered in Roman numerals. The +## load screen adds the autosave and quick save pages. ## ## https://www.renpy.org/doc/html/screen_special.html#save https:// ## www.renpy.org/doc/html/screen_special.html#load @@ -618,6 +712,10 @@ screen save(): tag menu + ## The automatic and quick save pages are only offered when loading. + on "show" action If(FileCurrentPage() in ("auto", "quick"), FilePage(1)) + on "replace" action If(FileCurrentPage() in ("auto", "quick"), FilePage(1)) + use file_slots(_("Save")) @@ -628,9 +726,52 @@ screen load(): use file_slots(_("Load")) +init python: + + def vn_roman(n): + """1 -> I, 4 -> IV, 9 -> IX, ...""" + out = "" + for value, numeral in ((1000, "M"), (900, "CM"), (500, "D"), (400, "CD"), (100, "C"), + (90, "XC"), (50, "L"), (40, "XL"), (10, "X"), (9, "IX"), (5, "V"), (4, "IV"), + (1, "I")): + while n >= value: + out += numeral + n -= value + return out + + class VnPageNameInputValue(FilePageNameInputValue): + """The editable page name, whose default uses the Roman page number.""" + + def _default(self, page): + return __(self.pattern).format(vn_roman(int(page))) + + def get_text(self): + page = self.get_page() + if page in ("auto", "quick"): + return FilePageNameInputValue.get_text(self) + default = self._default(page) + rv = persistent._file_page_name.get(int(page), default) + if not rv.strip(): + current, active = renpy.get_editable_input_value() + if not ((current is self) and active): + rv = default + return rv + + def set_text(self, s): + page = self.get_page() + if page in ("auto", "quick"): + return + if s == self._default(page): + persistent._file_page_name.pop(int(page), None) + else: + persistent._file_page_name[int(page)] = s + + screen file_slots(title): - default page_name_value = FilePageNameInputValue(pattern=_("Page {}"), auto=_("Automatic saves"), quick=_("Quick saves")) + default page_name_value = VnPageNameInputValue(pattern=_("Page {}"), auto=_("Automatic saves"), quick=_("Quick saves")) + + $ loading = title != _("Save") use game_menu(title): @@ -640,7 +781,7 @@ screen file_slots(title): ## buttons do. order_reverse True - ## The page name, which can be edited by clicking on a button. + ## The page name, which can be edited by clicking on it. button: style "page_label" @@ -652,110 +793,227 @@ screen file_slots(title): style "page_label_text" value page_name_value - ## The grid of file slots. + ## The slots of this page, one entry per row. grid gui.file_slot_cols gui.file_slot_rows: style_prefix "slot" xalign 0.5 - yalign 0.5 + ypos 70 spacing gui.slot_spacing for i in range(gui.file_slot_cols * gui.file_slot_rows): $ slot = i + 1 + $ info = FileJson(slot) - button: - action FileAction(slot) + fixed: + style "slot_fixed" - has vbox + button: + action FileAction(slot) + if info is None: + style "slot_empty_button" - add FileScreenshot(slot) xalign 0.5 + hbox: + spacing 34 + yalign 0.5 - text FileTime(slot, format=_("{#file_time}%A, %B %d %Y, %H:%M"), empty=_("empty slot")): - style "slot_time_text" + frame: + style "slot_thumb_frame" + if info is None: + frame: + style "slot_thumb_blank" + text vn_diamond style "slot_thumb_empty" + else: + add Transform(FileScreenshot(slot), xysize=gui.vn_slot_thumb) - text FileSaveName(slot): - style "slot_name_text" + vbox: + yalign 0.5 + spacing 6 - key "save_delete" action FileDelete(slot) + if info is None: + text _("empty slot") style "slot_empty_text" + else: + text (info.get("vn_scene") or FileSaveName(slot) or _("Saved game")): + style "slot_scene_text" + if info.get("vn_line"): + hbox: + spacing 14 + if info.get("vn_who"): + text info["vn_who"] style "slot_who_text" + text ("«" + info["vn_line"] + "»") style "slot_line_text" + text FileTime(slot, format=_("{#vn_file_time}%A, %d/%m/%Y · %H:%M")): + style "slot_time_text" + + key "save_delete" action FileDelete(slot) + + if info is not None: + textbutton _("Delete"): + style "slot_delete_button" + action FileDelete(slot) ## Buttons to access other pages. - vbox: + hbox: style_prefix "page" xalign 0.5 yalign 1.0 + yoffset -6 + spacing gui.page_spacing - hbox: - xalign 0.5 - - spacing gui.page_spacing - - textbutton _("<") action FilePagePrevious() - key "save_page_prev" action FilePagePrevious() + textbutton "‹" action FilePagePrevious(auto=loading, quick=loading) text_style "page_arrow_text" + key "save_page_prev" action FilePagePrevious(auto=loading, quick=loading) + ## Saving into the automatic or quick slots makes no sense, so + ## those pages are only offered when loading. + if loading: if config.has_autosave: - textbutton _("{#auto_page}A") action FilePage("auto") + textbutton _("Autosaves") action FilePage("auto") if config.has_quicksave: - textbutton _("{#quick_page}Q") action FilePage("quick") + textbutton _("Quick saves") action FilePage("quick") - ## range(1, 10) gives the numbers from 1 to 9. - for page in range(1, 10): - textbutton "[page]" action FilePage(page) + text vn_diamond style "page_separator" - textbutton _(">") action FilePageNext() - key "save_page_next" action FilePageNext() + ## range(1, 10) gives the numbers from 1 to 9. + for page in range(1, 10): + textbutton vn_roman(page) action FilePage(page) - if config.has_sync: - if CurrentScreenName() == "save": - textbutton _("Upload Sync"): - action UploadSync() - xalign 0.5 - else: - textbutton _("Download Sync"): - action DownloadSync() - xalign 0.5 + textbutton "›" action FilePageNext(auto=loading, quick=loading) text_style "page_arrow_text" + key "save_page_next" action FilePageNext(auto=loading, quick=loading) +## Size of the slot thumbnails (config.thumbnail_* is the saved size). +define gui.vn_slot_thumb = (256, 144) + style page_label is gui_label style page_label_text is gui_label_text style page_button is gui_button style page_button_text is gui_button_text +style page_arrow_text is page_button_text +style page_separator is gui_text +style slot_fixed is fixed style slot_button is gui_button +style slot_empty_button is slot_button style slot_button_text is gui_button_text -style slot_time_text is slot_button_text -style slot_name_text is slot_button_text +style slot_thumb_frame is empty +style slot_thumb_blank is empty +style slot_thumb_empty is gui_text +style slot_scene_text is gui_text +style slot_who_text is gui_text +style slot_line_text is gui_text +style slot_time_text is gui_text +style slot_empty_text is gui_text +style slot_delete_button is gui_button +style slot_delete_button_text is gui_button_text style page_label: - xpadding 75 - ypadding 5 + xpadding 60 + ypadding 4 xalign 0.5 style page_label_text: textalign 0.5 layout "subtitle" + size 32 + italic True + kerning 2 + color gui.accent_color hover_color gui.hover_color style page_button: properties gui.button_properties("page_button") + yalign 0.5 style page_button_text: properties gui.text_properties("page_button") + size 28 + kerning 2 + +style page_arrow_text: + font "DejaVuSans.ttf" + size 40 + +style page_separator: + size 16 + color "#c9a25b90" + yalign 0.5 + xmargin 18 + +style slot_fixed: + xsize 1360 + ysize 156 style slot_button: - properties gui.button_properties("slot_button") + xfill True + yfill True + padding (18, 10, 18, 10) + background Frame("gui/vn/card_[prefix_]background.png", 12, 12) -style slot_button_text: - properties gui.text_properties("slot_button") +style slot_empty_button: + background Frame("gui/vn/card_empty.png", 12, 12) + hover_background Frame("gui/vn/card_hover_background.png", 12, 12) + +style slot_thumb_frame: + padding (2, 2) + background Solid("#c9a25b70") + yalign 0.5 + +style slot_thumb_blank: + xysize gui.vn_slot_thumb + background Solid("#0b0907") + +style slot_thumb_empty: + align (0.5, 0.5) + size 22 + color "#c9a25b60" + +style slot_scene_text: + size 30 + kerning 2 + color gui.accent_color + hover_color gui.hover_color + xmaximum 860 + +style slot_who_text: + size 23 + color "#efe6d290" + +style slot_line_text: + size 24 + italic True + color "#efe6d2" + xmaximum 760 + +style slot_time_text: + size 21 + color "#efe6d290" + +style slot_empty_text: + size 26 + italic True + color "#efe6d260" + hover_color gui.hover_color + +style slot_delete_button: + xalign 1.0 + yalign 0.5 + xoffset -28 + padding (14, 6) + +style slot_delete_button_text: + size 22 + kerning 1 + idle_color "#efe6d2a8" + hover_color "#e6866f" ## Preferences screen ########################################################## ## ## The preferences screen allows the player to configure the game to better suit -## themselves. +## themselves. Each group of choices sits on its own framed panel. ## ## https://www.renpy.org/doc/html/screen_special.html#preferences @@ -766,88 +1024,102 @@ screen preferences(): use game_menu(_("Preferences"), scroll="viewport"): vbox: + spacing 30 hbox: box_wrap True + spacing 30 + box_wrap_spacing 30 if renpy.variant("pc") or renpy.variant("web"): - vbox: - style_prefix "radio" - label _("Display") - textbutton _("Window") action Preference("display", "window") - textbutton _("Fullscreen") action Preference("display", "fullscreen") + frame: + style "pref_panel" + vbox: + style_prefix "radio" + label _("Display") + textbutton _("Window") action Preference("display", "window") + textbutton _("Fullscreen") action Preference("display", "fullscreen") - vbox: - style_prefix "check" - label _("Skip") - textbutton _("Unseen Text") action Preference("skip", "toggle") - textbutton _("After Choices") action Preference("after choices", "toggle") - textbutton _("Transitions") action InvertSelected(Preference("transitions", "toggle")) + frame: + style "pref_panel" + vbox: + style_prefix "check" + label _("Skip") + textbutton _("Unseen Text") action Preference("skip", "toggle") + textbutton _("After Choices") action Preference("after choices", "toggle") + textbutton _("Transitions") action InvertSelected(Preference("transitions", "toggle")) if len(vn_art_styles) > 1: - vbox: - style_prefix "radio" - label "@@ART_STYLE_TITLE@@" - for style_id, style_label in vn_art_styles: - textbutton style_label action SetField(persistent, "art_style", style_id) + frame: + style "pref_panel" + vbox: + style_prefix "radio" + label "@@ART_STYLE_TITLE@@" + for style_id, style_label in vn_art_styles: + textbutton style_label action SetField(persistent, "art_style", style_id) - ## Additional vboxes of type "radio_pref" or "check_pref" can be + ## Additional panels of type "radio_pref" or "check_pref" can be ## added here, to add additional creator-defined preferences. - null height (4 * gui.pref_spacing) - hbox: style_prefix "slider" box_wrap True + spacing 30 + box_wrap_spacing 30 - vbox: + frame: + style "pref_panel" + vbox: - label _("Text Speed") + label _("Text Speed") - bar value Preference("text speed") + bar value Preference("text speed") - label _("Auto-Forward Time") + label _("Auto-Forward Time") - bar value Preference("auto-forward time") + bar value Preference("auto-forward time") - vbox: + frame: + style "pref_panel" + vbox: - if config.has_music: - label _("Music Volume") + if config.has_music: + label _("Music Volume") - hbox: - bar value Preference("music volume") + hbox: + bar value Preference("music volume") - if config.has_sound: + if config.has_sound: - label _("Sound Volume") + label _("Sound Volume") - hbox: - bar value Preference("sound volume") + hbox: + bar value Preference("sound volume") - if config.sample_sound: - textbutton _("Test") action Play("sound", config.sample_sound) + if config.sample_sound: + textbutton _("Test") action Play("sound", config.sample_sound) - if config.has_voice: - label _("Voice Volume") + if config.has_voice: + label _("Voice Volume") - hbox: - bar value Preference("voice volume") + hbox: + bar value Preference("voice volume") - if config.sample_voice: - textbutton _("Test") action Play("voice", config.sample_voice) + 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 + 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 "mute_all_button" + textbutton _("Mute All"): + action Preference("all mute", "toggle") + style "mute_all_button" +style pref_panel is empty style pref_label is gui_label style pref_label_text is gui_label_text style pref_vbox is vbox @@ -874,15 +1146,22 @@ style slider_pref_vbox is pref_vbox style mute_all_button is check_button style mute_all_button_text is check_button_text +style pref_panel: + background Frame("gui/vn/card_background.png", 12, 12) + padding (30, 22, 30, 28) + style pref_label: top_margin gui.pref_spacing - bottom_margin 3 + bottom_margin 8 style pref_label_text: yalign 1.0 + size 28 + kerning 2 + color gui.accent_color style pref_vbox: - xsize 338 + xsize 370 style radio_vbox: spacing gui.pref_button_spacing @@ -916,14 +1195,13 @@ style slider_button_text: properties gui.text_properties("slider_button") style slider_vbox: - xsize 675 + xsize 580 ## History screen ############################################################## ## -## This is a screen that displays the dialogue history to the player. While -## there isn't anything special about this screen, it does have to access the -## dialogue history stored in _history_list. +## This is a screen that displays the dialogue history to the player, each entry +## under a faint rule. It accesses the dialogue history in _history_list. ## ## https://www.renpy.org/doc/html/history.html @@ -982,6 +1260,9 @@ style history_label_text is gui_label_text style history_window: xfill True ysize gui.history_height + top_padding 18 + bottom_padding 18 + background Frame("gui/vn/hairline.png", 0, 1, 0, 0) style history_name: xpos gui.history_name_xpos @@ -992,6 +1273,8 @@ style history_name: style history_name_text: min_width gui.history_name_width textalign gui.history_name_xalign + size 28 + kerning 1 style history_text: xpos gui.history_text_xpos @@ -1001,12 +1284,15 @@ style history_text: min_width gui.history_text_width textalign gui.history_text_xalign layout ("subtitle" if gui.history_text_xalign else "tex") + size 28 style history_label: xfill True style history_label_text: xalign 0.5 + italic True + color "#efe6d2a0" ## Help screen ################################################################# @@ -1026,9 +1312,11 @@ screen help(): style_prefix "help" vbox: - spacing 23 + spacing 16 hbox: + xalign 0.5 + spacing 20 textbutton _("Keyboard") action SetScreenVariable("device", "keyboard") textbutton _("Mouse") action SetScreenVariable("device", "mouse") @@ -1036,6 +1324,8 @@ screen help(): if GamepadExists(): textbutton _("Gamepad") action SetScreenVariable("device", "gamepad") + null height 10 + if device == "keyboard": use keyboard_help elif device == "mouse": @@ -1155,20 +1445,28 @@ style help_text is gui_text style help_button: properties gui.button_properties("help_button") - xmargin 12 + padding (26, 8, 20, 8) + background Frame("gui/vn/nav_[prefix_]background.png", 6, 0) style help_button_text: properties gui.text_properties("help_button") + size 30 + kerning 1 style help_label: - xsize 375 - right_padding 30 + xsize 420 + right_padding 36 style help_label_text: - size gui.text_size + size 28 + color gui.accent_color xalign 1.0 textalign 1.0 +style help_text: + size 28 + xmaximum 880 + ################################################################################ @@ -1179,7 +1477,7 @@ style help_label_text: ## Confirm screen ############################################################## ## ## The confirm screen is called when Ren'Py wants to ask the player a yes or no -## question. +## question: a framed plate between two gold rules. ## ## https://www.renpy.org/doc/html/screen_special.html#confirm @@ -1192,14 +1490,16 @@ screen confirm(message, yes_action, no_action): style_prefix "confirm" - add "gui/overlay/confirm.png" + add Solid("#000000b8") frame: vbox: xalign .5 yalign .5 - spacing 45 + spacing 36 + + add "vn_rule" xalign 0.5 label _(message): style "confirm_prompt" @@ -1207,7 +1507,7 @@ screen confirm(message, yes_action, no_action): hbox: xalign 0.5 - spacing 150 + spacing 120 textbutton _("Yes") action yes_action textbutton _("No") action no_action @@ -1223,20 +1523,27 @@ style confirm_button is gui_medium_button style confirm_button_text is gui_medium_button_text style confirm_frame: - background Frame([ "gui/confirm_frame.png", "gui/frame.png"], gui.confirm_frame_borders, tile=gui.frame_tile) - padding gui.confirm_frame_borders.padding + background Frame("gui/vn/card_background.png", 12, 12) + padding (90, 54, 90, 54) xalign .5 yalign .5 + xmaximum 1200 style confirm_prompt_text: textalign 0.5 layout "subtitle" + size 34 + color "#efe6d2" style confirm_button: properties gui.button_properties("confirm_button") + padding (40, 8) + background Frame("gui/vn/nav_[prefix_]background.png", 6, 0) style confirm_button_text: properties gui.text_properties("confirm_button") + size 36 + kerning 3 ## Skip indicator screen ####################################################### @@ -1282,12 +1589,15 @@ style skip_text is gui_text style skip_triangle is skip_text style skip_frame: + xpos 36 ypos gui.skip_ypos - background Frame("gui/skip.png", gui.skip_frame_borders, tile=gui.frame_tile) - padding gui.skip_frame_borders.padding + background Frame("gui/vn/card_background.png", 12, 12) + padding (28, 12, 28, 12) style skip_text: - size gui.notify_text_size + size 26 + kerning 2 + color gui.accent_color style skip_triangle: ## We have to use a font that has the BLACK RIGHT-POINTING SMALL TRIANGLE @@ -1308,7 +1618,10 @@ screen notify(message): style_prefix "notify" frame at notify_appear: - text "[message!tq]" + hbox: + spacing 16 + text vn_diamond style "notify_mark" + text "[message!tq]" timer 3.25 action Hide('notify') @@ -1323,15 +1636,23 @@ transform notify_appear: style notify_frame is empty style notify_text is gui_text +style notify_mark is notify_text style notify_frame: + xalign 0.5 ypos gui.notify_ypos - - background Frame("gui/notify.png", gui.notify_frame_borders, tile=gui.frame_tile) - padding gui.notify_frame_borders.padding + background Frame("gui/vn/card_background.png", 12, 12) + padding (36, 14, 40, 14) style notify_text: properties gui.text_properties("notify") + size 28 + color "#efe6d2" + +style notify_mark: + size 16 + color gui.accent_color + yalign 0.5 ## NVL screen ################################################################## @@ -1563,15 +1884,25 @@ screen quick_menu(): if quick_menu: - hbox: - style "quick_menu" - style_prefix "quick" + frame: + style "quick_frame" - textbutton _("Back") action Rollback() - textbutton _("Skip") action Skip() alternate Skip(fast=True, confirm=True) - textbutton _("Auto") action Preference("auto-forward", "toggle") - textbutton _("Menu") action ShowMenu() + hbox: + style "quick_menu" + style_prefix "quick" + textbutton _("Back") action Rollback() + textbutton _("Skip") action Skip() alternate Skip(fast=True, confirm=True) + textbutton _("Auto") action Preference("auto-forward", "toggle") + textbutton _("Menu") action ShowMenu() + + +## On touch screens the quick menu has bigger buttons: it goes to the top right +## corner, clear of the dialogue. +style quick_frame: + variant "touch" + xalign 1.0 + yalign 0.0 style window: variant "small" @@ -1589,30 +1920,116 @@ style nvl_window: variant "small" background "gui/phone/nvl.png" -style main_menu_frame: +style navigation_vbox: variant "small" - background "gui/phone/overlay/main_menu.png" + spacing 4 -style game_menu_outer_frame: +style navigation_button_text: variant "small" - background "gui/phone/overlay/game_menu.png" + size 40 + +style main_menu_vbox: + variant "small" + ypos 90 + +style main_nav_vbox: + variant "small" + ypos 500 + spacing 0 + +style main_nav_button_text: + variant "small" + size 46 style game_menu_navigation_frame: variant "small" - xsize 510 + xsize 440 + background Fixed(Solid("#0b0907d8"), Solid("#c9a25b50", xsize=1, ysize=960, xpos=439, ypos=60)) + +style game_menu_work_title: + variant "small" + xpos 220 + +style game_menu_work_rule: + variant "small" + xpos 220 + +style game_menu_title_vbox: + variant "small" + xpos 1190 + ypos 30 style game_menu_content_frame: variant "small" - top_margin 0 + xpos 500 + ypos 200 + xsize 1380 + ysize 840 -style game_menu_viewport: +style slot_fixed: variant "small" - xsize 1305 + ysize 206 + +style slot_scene_text: + variant "small" + size 40 + +style slot_who_text: + variant "small" + size 32 + +style slot_line_text: + variant "small" + size 32 + +style slot_time_text: + variant "small" + size 30 + +style slot_empty_text: + variant "small" + size 36 + +style slot_delete_button_text: + variant "small" + size 32 + +style page_button_text: + variant "small" + size 38 style pref_vbox: variant "small" xsize 600 +style pref_label_text: + variant "small" + size 40 + +style history_name_text: + variant "small" + size 36 + +style history_text: + variant "small" + size 36 + +style confirm_prompt_text: + variant "small" + size 46 + +style confirm_button_text: + variant "small" + size 50 + +style notify_text: + variant "small" + size 38 + +style about_text: + variant "small" + size 38 + style bar: variant "small" ysize gui.bar_size diff --git a/src/vnpipe/renpy_templates/tl/spanish/common.rpy b/src/vnpipe/renpy_templates/tl/spanish/common.rpy new file mode 100644 index 0000000..1231517 --- /dev/null +++ b/src/vnpipe/renpy_templates/tl/spanish/common.rpy @@ -0,0 +1,1121 @@ +## Ren'Py's own UI strings in Spanish (Spain): the Ren'Py SDK translation +## (launcher/game/tl/spanish/common.rpy, MIT licence) with corrections and the strings it +## lacks. Copied into game/tl/spanish/ by `vnpipe renpy` when [ui].language = "spanish". + +translate spanish strings: + + old "{#weekday}Monday" + new "Lunes" + + old "{#weekday}Tuesday" + new "Martes" + + old "{#weekday}Wednesday" + new "Miércoles" + + old "{#weekday}Thursday" + new "Jueves" + + old "{#weekday}Friday" + new "Viernes" + + old "{#weekday}Saturday" + new "Sábado" + + old "{#weekday}Sunday" + new "Domingo" + + old "{#weekday_short}Mon" + new "Lun." + + old "{#weekday_short}Tue" + new "Mar." + + old "{#weekday_short}Wed" + new "Mié." + + old "{#weekday_short}Thu" + new "Jue." + + old "{#weekday_short}Fri" + new "Vie." + + old "{#weekday_short}Sat" + new "Sab." + + old "{#weekday_short}Sun" + new "Dom." + + old "{#month}January" + new "Enero" + + old "{#month}February" + new "Febrero" + + old "{#month}March" + new "Marzo" + + old "{#month}April" + new "Abril" + + old "{#month}May" + new "Mayo" + + old "{#month}June" + new "Junio" + + old "{#month}July" + new "Julio" + + old "{#month}August" + new "Agosto" + + old "{#month}September" + new "Septiembre" + + old "{#month}October" + new "Octubre" + + old "{#month}November" + new "Noviembre" + + old "{#month}December" + new "Diciembre" + + old "{#month_short}Jan" + new "Ene." + + old "{#month_short}Feb" + new "Feb." + + old "{#month_short}Mar" + new "Mar." + + old "{#month_short}Apr" + new "Abr." + + old "{#month_short}May" + new "May." + + old "{#month_short}Jun" + new "Jun." + + old "{#month_short}Jul" + new "Jul." + + old "{#month_short}Aug" + new "Ago." + + old "{#month_short}Sep" + new "Sep." + + old "{#month_short}Oct" + new "Oct." + + old "{#month_short}Nov" + new "Nov." + + old "{#month_short}Dec" + new "Dic." + + old "%b %d, %H:%M" + new "%d de %b, %H:%M" + + old "Save slot %s: [text]" + new "Guardar ranura %s: [text]" + + old "Load slot %s: [text]" + new "Cargar ranura %s: [text]" + + old "Delete slot [text]" + new "Borrar partida [text]" + + old "File page auto" + new "Página de autoguardado" + + old "File page quick" + new "Página de guardado rápido" + + old "File page [text]" + new "Página [text]" + + old "Next file page." + new "Página siguiente." + + old "Previous file page." + new "Página anterior." + + old "Quick save complete." + new "Guardado rápido completado." + + old "Quick save." + new "Guardado rápido." + + old "Quick load." + new "Carga rápida." + + old "Language [text]" + new "Idioma [text]" + + old "The interactive director is not enabled here." + new "El director interactivo no está habilitado aquí." + + old "⬆" + new "⬆" + + old "⬇" + new "⬇" + + old "Done" + new "Hecho" + + old "(statement)" + new "(sentencia)" + + old "(tag)" + new "(etiqueta)" + + old "(attributes)" + new "(atributos)" + + old "(transform)" + new "(transformación)" + + old "(transition)" + new "(transición)" + + old "(channel)" + new "(canal)" + + old "(filename)" + new "(archivo)" + + old "Change" + new "Cambiar" + + old "Add" + new "Añadir" + + old "Cancel" + new "Cancelar" + + old "Remove" + new "Eliminar" + + old "Statement:" + new "Sentencia:" + + old "Tag:" + new "Etiqueta:" + + old "Attributes:" + new "Atributos:" + + old "Transforms:" + new "Transformaciones:" + + old "Behind:" + new "Detrás:" + + old "Transition:" + new "Transición:" + + old "Channel:" + new "Canal:" + + old "Audio Filename:" + new "Archivo de audio:" + + old "Are you sure?" + new "¿Seguro?" + + old "Are you sure you want to delete this save?" + new "¿Seguro que quieres borrar esta partida?" + + old "Are you sure you want to overwrite your save?" + new "¿Seguro que quieres sobrescribir esta partida?" + + old "Loading will lose unsaved progress.\nAre you sure you want to do this?" + new "Al cargar se perderá el progreso no guardado.\n¿Seguro que quieres continuar?" + + old "Are you sure you want to quit?" + new "¿Seguro que quieres salir?" + + old "Are you sure you want to return to the main menu?\nThis will lose unsaved progress." + new "¿Seguro que quieres volver al menú principal?\nSe perderá el progreso no guardado." + + old "Are you sure you want to end the replay?" + new "¿Seguro que quieres finalizar la repetición?" + + old "Are you sure you want to begin skipping?" + new "¿Seguro que quieres empezar a saltar?" + + old "Are you sure you want to skip to the next choice?" + new "¿Seguro que quieres saltar hasta la próxima elección?" + + old "Are you sure you want to skip unseen dialogue to the next choice?" + new "¿Seguro que quieres saltar el texto no leído hasta la próxima elección?" + + old "Failed to save screenshot as %s." + new "No se pudo guardar la captura de pantalla como %s." + + old "Saved screenshot as %s." + new "Captura de pantalla guardada como %s." + + old "Self-voicing disabled." + new "Lectura en voz alta desactivada." + + old "Clipboard voicing enabled. " + new "Lectura al portapapeles activada. " + + old "Self-voicing enabled. " + new "Lectura en voz alta activada. " + + old "bar" + new "bar" + + old "selected" + new "seleccionado" + + old "viewport" + new "viewport" + + old "horizontal scroll" + new "deslizamiento horizontal" + + old "vertical scroll" + new "deslizamiento vertical" + + old "activate" + new "activar" + + old "deactivate" + new "desactivar" + + old "increase" + new "aumentar" + + old "decrease" + new "disminuir" + + old "Skip Mode" + new "Saltando" + + old "This program contains free software under a number of licenses, including the MIT License and GNU Lesser General Public License. A complete list of software, including links to full source code, can be found {a=https://www.renpy.org/l/license}here{/a}." + new "Este programa contiene {i}software{/i} libre sujeto a diversas licencias que incluyen la licencia MIT y la {i}GNU Lesser General Public License{/i} (Licencia Pública General Reducida de GNU). Puedes encontrar la lista completa {i}de software{/i}, con enlaces al código fuente completo, {a=https://www.renpy.org/l/license}aquí (en inglés){/a}." + + old "display" + new "pantalla" + + old "transitions" + new "transiciones" + + old "skip transitions" + new "saltar transiciones" + + old "video sprites" + new "sprites de vídeo" + + old "show empty window" + new "muestra ventana vacía" + + old "text speed" + new "velocidad de texto" + + old "joystick" + new "joystick" + + old "joystick..." + new "joystick..." + + old "skip" + new "saltar" + + old "skip unseen [text]" + new "saltar no leído [text]" + + old "skip unseen text" + new "saltar texto no leído" + + old "begin skipping" + new "empezar a saltar" + + old "after choices" + new "tras elecciones" + + old "skip after choices" + new "saltar tras elecciones" + + old "auto-forward time" + new "tiempo autoavance" + + old "auto-forward" + new "autoavance" + + old "Auto forward" + new "Autoavance" + + old "auto-forward after click" + new "autoavanzar después del clic" + + old "automatic move" + new "movimiento automático" + + old "wait for voice" + new "espera la voz" + + old "voice sustain" + new "mantener voz" + + old "self voicing" + new "lectura en voz alta" + + old "clipboard voicing" + new "voz en clipboard" + + old "debug voicing" + new "depurar voz" + + old "emphasize audio" + new "enfatizar audio" + + old "rollback side" + new "lado de retroceso" + + old "gl powersave" + new "gl ahorro de energía" + + old "gl framerate" + new "gl cuadros por s." + + old "gl tearing" + new "gl tearing" + + old "music volume" + new "volumen música" + + old "sound volume" + new "volumen sonido" + + old "voice volume" + new "volumen voz" + + old "mute music" + new "silenciar música" + + old "mute sound" + new "silenciar sonido" + + old "mute voice" + new "silenciar voz" + + old "mute all" + new "silenciar todo" + + old "Clipboard voicing enabled. Press 'shift+C' to disable." + new "Lectura al portapapeles activada. Pulsa Mayús+C para desactivarla." + + old "Self-voicing would say \"[renpy.display.tts.last]\". Press 'alt+shift+V' to disable." + new "La lectura en voz alta diría \"[renpy.display.tts.last]\". Pulsa Alt+Mayús+V para desactivarla." + + old "Self-voicing enabled. Press 'v' to disable." + new "Lectura en voz alta activada. Pulsa V para desactivarla." + + old "Empty Slot." + new "Espacio libre." + + old "Previous" + new "Anterior" + + old "Next" + new "Siguiente" + + old "Joystick Mapping" + new "Mapeado del mando" + + old "Developer Menu" + new "Menú de desarrollo" + + old "Interactive Director (D)" + new "Director interactivo (D)" + + old "Reload Game (Shift+R)" + new "Reiniciar juego (Shift+R)" + + old "Console (Shift+O)" + new "Consola (Mayús.+O)" + + old "Variable Viewer" + new "Visor de variables" + + old "Image Location Picker" + new "Selector de posición en imágenes" + + old "Filename List" + new "Lista de archivos" + + old "Show Image Load Log (F4)" + new "Mostrar registro de carga de imagen (F4)" + + old "Hide Image Load Log (F4)" + new "Ocultar registro de carga de imagen (F4)" + + old "Image Attributes" + new "Image Attributes" + + old "[name] [attributes] (hidden)" + new "[name] [attributes] (hidden)" + + old "[name] [attributes]" + new "[name] [attributes]" + + old "Nothing to inspect." + new "Nada para inspeccionar." + + old "Hide deleted" + new "Hide deleted" + + old "Show deleted" + new "Show deleted" + + old "Return to the developer menu" + new "Volver al menú de desarrollo" + + old "Rectangle: %r" + new "Rectángulo: %r" + + old "Mouse position: %r" + new "Posición del ratón: %r" + + old "Right-click or escape to quit." + new "Clic-derecho o escape para salir." + + old "Rectangle copied to clipboard." + new "Rectángulo copiado al portapapeles." + + old "Position copied to clipboard." + new "Posición copiada al portapapeles." + + old "Type to filter: " + new "Escribe para filtrar: " + + old "Textures: [tex_count] ([tex_size_mb:.1f] MB)" + new "Texturas: [tex_count] ([tex_size_mb:.1f] MB)" + + old "Image cache: [cache_pct:.1f]% ([cache_size_mb:.1f] MB)" + new "Caché de imagen: [cache_pct:.1f]% ([cache_size_mb:.1f] MB)" + + old "✔ " + new "✔ " + + old "✘ " + new "✘ " + + old "\n{color=#cfc}✔ predicted image (good){/color}\n{color=#fcc}✘ unpredicted image (bad){/color}\n{color=#fff}Drag to move.{/color}" + new "\n{color=#cfc}✔ imagen prevista (correcto){/color}\n{color=#fcc}✘ imagen no prevista (fallido){/color}\n{color=#fff}Arrastra para mover.{/color}" + + old "Displayable Inspector" + new "Inspector de visualizables" + + old "Size" + new "Tamaño" + + old "Style" + new "Estilo" + + old "Location" + new "Ubicación" + + old "Inspecting Styles of [displayable_name!q]" + new "Inspeccionando estilos de [displayable_name!q]" + + old "displayable:" + new "visualizable:" + + old " (no properties affect the displayable)" + new " (no hay propiedades que afecten la visualización)" + + old " (default properties omitted)" + new " (propiedades por defecto omitidas)" + + old "" + new "" + + old "a" + new "a" + + old "q" + new "r" + + old "Contacting App Store\nPlease Wait..." + new "Contactando con la App Store\nEspera, por favor..." + + old "The Ren'Py Updater is not supported on mobile devices." + new "El Actualizador de Ren'Py no es compatible con dispositivos móviles." + + old "An error is being simulated." + new "Se simula un error." + + old "Either this project does not support updating, or the update status file was deleted." + new "O bien este proyecto no es compatible con la actualización o el archivo de estado de la actualización se ha eliminado." + + old "This account does not have permission to perform an update." + new "Esta cuenta no tiene permiso para realizar una actualización." + + old "This account does not have permission to write the update log." + new "Esta cuenta no tiene permiso para escribir en el registro de actualización." + + old "Could not verify update signature." + new "No se pudo verificar la actualización de firmas." + + old "The update file was not downloaded." + new "El archivo de actualización no se ha descargado." + + old "The update file does not have the correct digest - it may have been corrupted." + new "El archivo de actualización no tiene el 'digest' correcto - es posible que esté dañado." + + old "While unpacking {}, unknown type {}." + new "Tipo desconocido {1} al desempaquetar {0}." + + old "Updater" + new "Actualizador" + + old "An error has occurred:" + new "Ha sucedido un error:" + + old "Checking for updates." + new "Buscando actualizaciones." + + old "This program is up to date." + new "Este programa está actualizado." + + old "[u.version] is available. Do you want to install it?" + new "[u.version] está disponible. ¿Quieres instalarla?" + + old "Preparing to download the updates." + new "Preparando para descargar la actualización." + + old "Downloading the updates." + new "Descargando la actualización." + + old "Unpacking the updates." + new "Desempaquetando la actualización." + + old "Finishing up." + new "Finalizando." + + old "The updates have been installed. The program will restart." + new "La actualización ha sido instalada. El programa se reiniciará." + + old "The updates have been installed." + new "La actualización ha sido instalada." + + old "The updates were cancelled." + new "La actualización ha sido cancelada." + + old "Proceed" + new "Continuar" + + old "Image [index] of [count] locked." + new "Imagen [index] de [count] bloqueada." + + old "prev" + new "ant." + + old "next" + new "sig." + + old "slideshow" + new "presentación" + + old "return" + new "volver" + + old "Renderer" + new "Renderizador" + + old "Automatically Choose" + new "Escoger automáticamente" + + old "Force Angle/DirectX Renderer" + new "Forzar 'Angle/DirectX Renderer'" + + old "Force OpenGL Renderer" + new "Forzar renderizador OpenGL" + + old "Force Software Renderer" + new "Forzar renderizado por software" + + old "NPOT" + new "NPOT" + + old "Enable" + new "Activar" + + old "Disable" + new "Desactivar" + + old "Powersave" + new "Ahorro de energía" + + old "Framerate" + new "Cuadros por s." + + old "Screen" + new "Pantalla" + + old "60" + new "60" + + old "30" + new "30" + + old "Tearing" + new "Tearing" + + old "Changes will take effect the next time this program is run." + new "Los cambios se aplicarán la próxima vez que el programa se ejecute." + + old "Performance Warning" + new "Aviso de funcionamiento" + + old "This computer is using software rendering." + new "Este ordenador usa 'software rendering'." + + old "This computer is not using shaders." + new "Este ordenador no usa 'shaders'." + + old "This computer is displaying graphics slowly." + new "Este ordenador muestra los gráficos lentamente." + + old "This computer has a problem displaying graphics: [problem]." + new "Este ordenador tiene un problema mostrando los gráficos: [problem]." + + old "Its graphics drivers may be out of date or not operating correctly. This can lead to slow or incorrect graphics display. Updating DirectX could fix this problem." + new "Los controladores gráficos pueden estar obsoletos o no funcionar adecuadamente. Esto puede conllevar que los gráficos se muestren lenta o incorrectamente. Actualizar DirectX puede solucionar este problema." + + old "Its graphics drivers may be out of date or not operating correctly. This can lead to slow or incorrect graphics display." + new "Los controladores gráficos pueden estar obsoletos o no funcionar adecuadamente. Esto puede conllevar que los gráficos se muestren lenta o incorrectamente." + + old "Update DirectX" + new "Actualizar DirectX" + + old "Continue, Show this warning again" + new "Continuar. Mostrar este aviso de nuevo" + + old "Continue, Don't show warning again" + new "Continuar. No mostrar este aviso de nuevo" + + old "Updating DirectX." + new "Actualizando DirectX." + + old "DirectX web setup has been started. It may start minimized in the taskbar. Please follow the prompts to install DirectX." + new "La instalación web de DirectX ha comenzado. Puede haber iniciado minimizada en la barra de tareas. Siga las instrucciones para instalar DirectX." + + old "{b}Note:{/b} Microsoft's DirectX web setup program will, by default, install the Bing toolbar. If you do not want this toolbar, uncheck the appropriate box." + new "{b}Nota:{/b} El programa de instalación de DirectX de Microsoft instalará, por defecto, la barra Bing. Si no desea esta barra, desactive la casilla correspondiente." + + old "When setup finishes, please click below to restart this program." + new "Cuando la instalación acabe, haga clic abajo para reiniciar el programa." + + old "Restart" + new "Reiniciar" + + old "Select Gamepad to Calibrate" + new "Selecciona mando para calibrar" + + old "No Gamepads Available" + new "No hay mandos disponibles" + + old "Calibrating [name] ([i]/[total])" + new "Calibrando [name] ([i]/[total])" + + old "Press or move the [control!s] [kind]." + new "Pulsa o mueve: [control!s] [kind]." + + old "Skip (A)" + new "Salto (A)" + + old "Back (B)" + new "Atrás (B)" + + old "Open" + new "Abrir" + + old "Opens the traceback.txt file in a text editor." + new "Abre el archivo de rastreo 'traceback.txt' en un editor de texto." + + old "Copy" + new "Copiar" + + old "Copies the traceback.txt file to the clipboard." + new "Copiar el archivo traceback.txt al portapapeles." + + old "An exception has occurred." + new "Ha sucedido una excepción." + + old "Rollback" + new "Volver atrás" + + old "Attempts a roll back to a prior time, allowing you to save or choose a different choice." + new "Intenta volver a un momento anterior y permite guardar o escoger una opción diferente." + + old "Ignore" + new "Ignorar" + + old "Ignores the exception, allowing you to continue." + new "Ignora la excepción y permite continuar." + + old "Ignores the exception, allowing you to continue. This often leads to additional errors." + new "Ignora la excepción y permite continuar. Suele conllevar más errores." + + old "Reload" + new "Recargar" + + old "Reloads the game from disk, saving and restoring game state if possible." + new "Recarga el juego del disco, guardando y restaurando la partida si es posible." + + old "Console" + new "Consola" + + old "Opens a console to allow debugging the problem." + new "Abre una consola y permite depurar el problema." + + old "Quits the game." + new "Sale del juego." + + old "Parsing the script failed." + new "Error en el análisis del código." + + old "Opens the errors.txt file in a text editor." + new "Abre el archivo de errores, 'errors.txt', en un editor de texto." + + old "Copies the errors.txt file to the clipboard." + new "Copia el archivo errors.txt al portapapeles." + + old "Copy BBCode" + new "Copiar BBCode" + + old "Copies the traceback.txt file to the clipboard as BBcode for forums like https://lemmasoft.renai.us/." + new "Copia el archivo traceback.txt en el portapapeles como BBcode para foros como https://lemmasoft.renai.us/." + + old "Copy Markdown" + new "Copiar Markdown" + + old "Copies the traceback.txt file to the clipboard as Markdown for Discord." + new "Copia el archivo traceback.txt al portapapeles como Markdown para Discord." + + old "Copies the errors.txt file to the clipboard as BBcode for forums like https://lemmasoft.renai.us/." + new "Copia el archivo errors.txt en el portapapeles como BBcode para foros como https://lemmasoft.renai.us/." + + old "Copies the errors.txt file to the clipboard as Markdown for Discord." + new "Copia el archivo errors.txt al portapapeles como Markdown para Discord." + + old "Font Override" + new "Sobreescribir fuente" + + old "Default" + new "Por defecto" + + old "DejaVu Sans" + new "DejaVu Sans" + + old "Opendyslexic" + new "Opendyslexic" + + old "Text Size Scaling" + new "Escala del tamaño del texto" + + old "Reset" + new "Reiniciar" + + old "Line Spacing Scaling" + new "Escala del interlineado" + + old "Self-Voicing" + new "Lectura en voz alta" + + old "Off" + new "Apagado" + + old "Text-to-speech" + new "Texto a voz" + + old "Clipboard" + new "Portapapeles" + + old "Debug" + new "Depurar" + + old "font transform" + new "transformación de fuente" + + old "font size" + new "tamaño de fuente" + + old "font line spacing" + new "interlineado de la fuente" + + old "The options on this menu are intended to improve accessibility. They may not work with all games, and some combinations of options may render the game unplayable. This is not an issue with the game or engine. For the best results when changing fonts, try to keep the text size the same as it originally was." + new "Las opciones en este menú están destinadas a mejorar la accesibilidad. Es posible que no funcionen con todos los juegos, y algunas combinaciones de opciones pueden hacer que el juego no se pueda jugar. Esto no es un problema con el juego o el motor. Para obtener los mejores resultados al cambiar las fuentes, intente mantener el tamaño del texto igual al original." + + old "High Contrast Text" + new "Texto de alto contraste" + + old "Self-Voicing Volume Drop" + new "Bajada de volumen al leer en voz alta" + + old "self voicing volume drop" + new "bajada de volumen al leer en voz alta" + + old "system cursor" + new "cursor del sistema" + + old "renderer menu" + new "menú de renderizado" + + old "accessibility menu" + new "menú de accesibilidad" + + old "high contrast text" + new "texto de alto contraste" + + old "Force GL Renderer" + new "Forzar renderizador GL" + + old "Force ANGLE Renderer" + new "Forzar renderizador ANGLE" + + old "Force GLES Renderer" + new "Forzar renderizador GLES" + + old "Force GL2 Renderer" + new "Forzar renderizador GL2" + + old "Force ANGLE2 Renderer" + new "Forzar renderizador ANGLE2" + + old "Force GLES2 Renderer" + new "Forzar renderizador GLES2" + + old "Enable (No Blocklist)" + new "Habilitar (sin Blocklist)" + + old "This game requires use of GL2 that can't be initialised." + new "Este juego requiere el uso de GL2 que no se puede inicializar." + + old "The {a=edit:1:log.txt}log.txt{/a} file may contain information to help you determine what is wrong with your computer." + new "El archivo {a=edit:1:log.txt}log.txt{/a} puede contener información para ayudarte a encontrar el problema en tu ordenador." + + old "More details on how to fix this can be found in the {a=[url]}documentation{/a}." + new "Puede encontrar más detalles sobre cómo solucionar este problema en la {a=[url]} documentación {/a}." + + old "Change render options" + new "Cambiar las opciones de renderizado" + + old "Press or move the '[control!s]' [kind]." + new "Pulsa o mueve: '[control!s]' [kind]." + +# Strings missing from the Ren'Py SDK translation (Ren'Py 8.5), added by vnpipe. +translate spanish strings: + + old "Click to play the video." + new "Haz clic para reproducir el vídeo." + + old "Self-voicing support is limited when using a touch screen." + new "La lectura en voz alta es limitada con una pantalla táctil." + + old "Mono Audio" + new "Audio mono" + + old "Kerning" + new "Interletraje" + + old "Accessibility Menu. Use up and down arrows to navigate, and enter to activate buttons and bars." + new "Menú de accesibilidad. Usa las flechas arriba y abajo para moverte, e Intro para activar botones y barras." + + old "Self-Voicing and Audio" + new "Lectura en voz alta y audio" + + old "Text" + new "Texto" + + old "Open [text] directory." + new "Abrir la carpeta [text]." + + old "Click to toggle attribute, right click to toggle negative attribute." + new "Clic para alternar el atributo, clic derecho para alternar el atributo negativo." + + old "Click to set transform, right click to add to transform list." + new "Clic para fijar la transformación, clic derecho para añadirla a la lista." + + old "Customize director.transforms to add more transforms." + new "Modifica director.transforms para añadir más transformaciones." + + old "Click to set, right click to add to behind list." + new "Clic para fijar, clic derecho para añadir a la lista «behind»." + + old "Click to set." + new "Clic para fijar." + + old "Customize director.transitions to add more transitions." + new "Modifica director.transitions para añadir más transiciones." + + old "Customize director.audio_channels to add more channels." + new "Modifica director.audio_channels para añadir más canales." + + old "Are you sure you want to continue where you left off?" + new "¿Seguro que quieres continuar donde lo dejaste?" + + old "This save was created on a different device. Maliciously constructed save files can harm your computer. Do you trust this save's creator and everyone who could have changed the file?" + new "Esta partida se guardó en otro dispositivo. Un archivo de partida manipulado puede dañar tu ordenador. ¿Confías en quien la creó y en cualquiera que haya podido modificar el archivo?" + + old "Do you trust the device the save was created on? You should only choose yes if you are the device's sole user." + new "¿Confías en el dispositivo donde se guardó la partida? Elige «Sí» solo si eres su único usuario." + + old "self voicing enable" + new "activar lectura en voz alta" + + old "self voicing disable" + new "desactivar lectura en voz alta" + + old "clipboard voicing enable" + new "activar lectura al portapapeles" + + old "clipboard voicing disable" + new "desactivar lectura al portapapeles" + + old "debug voicing enable" + new "activar lectura de depuración" + + old "debug voicing disable" + new "desactivar lectura de depuración" + + old "audio when minimized" + new "audio con la ventana minimizada" + + old "audio when unfocused" + new "audio con la ventana en segundo plano" + + old "web cache preload" + new "precarga de la caché web" + + old "voice after game menu" + new "voz tras el menú del juego" + + old "restore window position" + new "restaurar la posición de la ventana" + + old "mono audio" + new "audio mono" + + old "font kerning" + new "interletraje de la fuente" + + old "reset" + new "restablecer" + + old "main volume" + new "volumen general" + + old "mute main" + new "silenciar el volumen general" + + old "Speech Bubble Editor" + new "Editor de bocadillos" + + old "(hide)" + new "(ocultar)" + + old "(clear retained bubbles)" + new "(borrar los bocadillos retenidos)" + + old "Sync downloaded." + new "Sincronización descargada." + + old "Could not connect to the Ren'Py Sync server." + new "No se pudo conectar con el servidor de Ren'Py Sync." + + old "The Ren'Py Sync server timed out." + new "El servidor de Ren'Py Sync no respondió a tiempo." + + old "An unknown error occurred while connecting to the Ren'Py Sync server." + new "Error desconocido al conectar con el servidor de Ren'Py Sync." + + old "The Ren'Py Sync server does not have a copy of this sync. The sync ID may be invalid, or it may have timed out." + new "El servidor de Ren'Py Sync no tiene esta sincronización. Puede que el ID no sea válido o que haya caducado." + + old "Please enter the sync ID you generated.\nNever enter a sync ID you didn't create yourself." + new "Introduce el ID de sincronización que generaste.\nNunca introduzcas un ID que no hayas creado tú." + + old "The sync ID is not in the correct format." + new "El ID de sincronización no tiene el formato correcto." + + old "The sync could not be decrypted." + new "No se pudo descifrar la sincronización." + + old "The sync belongs to a different game." + new "La sincronización pertenece a otro juego." + + old "The sync contains a file with an invalid name." + new "La sincronización contiene un archivo con un nombre no válido." + + old "This will upload your saves to the {a=https://sync.renpy.org}Ren'Py Sync Server{/a}.\nDo you want to continue?" + new "Tus partidas se subirán al {a=https://sync.renpy.org}servidor de Ren'Py Sync{/a}.\n¿Quieres continuar?" + + old "Enter Sync ID" + new "Introduce el ID de sincronización" + + old "This will contact the {a=https://sync.renpy.org}Ren'Py Sync Server{/a}." + new "Se contactará con el {a=https://sync.renpy.org}servidor de Ren'Py Sync{/a}." + + old "Sync Success" + new "Sincronización completada" + + old "The Sync ID is:" + new "El ID de sincronización es:" + + old "You can use this ID to download your save on another device.\nThis sync will expire in an hour.\nRen'Py Sync is supported by {a=https://www.renpy.org/sponsors.html}Ren'Py's Sponsors{/a}." + new "Puedes usar este ID para descargar tus partidas en otro dispositivo.\nLa sincronización caduca en una hora.\nRen'Py Sync existe gracias a los {a=https://www.renpy.org/sponsors.html}mecenas de Ren'Py{/a}." + + old "Continue" + new "Continuar" + + old "Sync Error" + new "Error de sincronización" + + old "Translation identifier: [identifier]" + new "Identificador de traducción: [identifier]" + + old " translates [tl.filename]:[tl.linenumber]" + new " traduce [tl.filename]:[tl.linenumber]" + + old "\n{color=#fff}Copied to clipboard.{/color}" + new "\n{color=#fff}Copiado al portapapeles.{/color}" + + old "No update methods found." + new "No se encontró ningún método de actualización." + + old "Could not download file list: " + new "No se pudo descargar la lista de archivos: " + + old "File list digest does not match." + new "La suma de comprobación de la lista de archivos no coincide." + + old "Preparing to download the game data." + new "Preparando la descarga de los datos del juego." + + old "Downloading the game data." + new "Descargando los datos del juego." + + old "The game data has been downloaded." + new "Los datos del juego se han descargado." + + old "An error occurred when trying to download game data:" + new "Se produjo un error al descargar los datos del juego:" + + old "This game cannot be run until the game data has been downloaded." + new "El juego no puede ejecutarse hasta que se descarguen sus datos." + + old "Retry" + new "Reintentar" diff --git a/src/vnpipe/renpy_templates/tl/spanish/screens.rpy b/src/vnpipe/renpy_templates/tl/spanish/screens.rpy new file mode 100644 index 0000000..befa4fd --- /dev/null +++ b/src/vnpipe/renpy_templates/tl/spanish/screens.rpy @@ -0,0 +1,244 @@ +## The strings of vnpipe's template screens (renpy_templates/game/*.rpy) in Spanish (Spain). +## Keep in step with the template: tests/test_renpy_gen.py checks every _("...") string. + +translate spanish strings: + + old "Back" + new "Atrás" + + old "History" + new "Historial" + + old "Skip" + new "Saltar" + + old "Auto" + new "Auto" + + old "Save" + new "Guardar" + + old "Q.Save" + new "Guardar rápido" + + old "Q.Load" + new "Cargar rápido" + + old "Prefs" + new "Opciones" + + old "Start" + new "Comenzar" + + old "Load" + new "Cargar" + + old "Preferences" + new "Opciones" + + old "End Replay" + new "Terminar la repetición" + + old "Main Menu" + new "Menú principal" + + old "About" + new "Acerca de" + + old "Help" + new "Ayuda" + + old "Quit" + new "Salir" + + old "Return" + new "Volver" + + old "Version [config.version!t]\n" + new "Versión [config.version!t]\n" + + old "Made with {a=https://www.renpy.org/}Ren'Py{/a} [renpy.version_only].\n\n[renpy.license!t]" + new "Hecho con {a=https://www.renpy.org/}Ren'Py{/a} [renpy.version_only].\n\n[renpy.license!t]" + + old "Page {}" + new "Página {}" + + old "Automatic saves" + new "Autoguardado" + + old "Quick saves" + new "Guardado rápido" + + old "empty slot" + new "Espacio libre" + + old "Saved game" + new "Partida guardada" + + old "{#vn_file_time}%A, %d/%m/%Y · %H:%M" + new "{#vn_file_time}%A, %d/%m/%Y · %H:%M" + + old "Delete" + new "Borrar" + + old "Autosaves" + new "Autoguardado" + + old "Display" + new "Pantalla" + + old "Window" + new "Ventana" + + old "Fullscreen" + new "Pantalla completa" + + old "Unseen Text" + new "Texto no leído" + + old "After Choices" + new "Tras las elecciones" + + old "Transitions" + new "Transiciones" + + old "Text Speed" + new "Velocidad del texto" + + old "Auto-Forward Time" + new "Avance automático" + + old "Music Volume" + new "Volumen de la música" + + old "Sound Volume" + new "Volumen de los efectos" + + old "Test" + new "Probar" + + old "Voice Volume" + new "Volumen de las voces" + + old "Mute All" + new "Silenciar todo" + + old "The dialogue history is empty." + new "El historial está vacío." + + old "Keyboard" + new "Teclado" + + old "Mouse" + new "Ratón" + + old "Gamepad" + new "Mando" + + old "Enter" + new "Intro" + + old "Advances dialogue and activates the interface." + new "Avanza el diálogo y activa la interfaz." + + old "Space" + new "Espacio" + + old "Advances dialogue without selecting choices." + new "Avanza el diálogo sin elegir opciones." + + old "Arrow Keys" + new "Flechas" + + old "Navigate the interface." + new "Recorren la interfaz." + + old "Escape" + new "Esc" + + old "Accesses the game menu." + new "Abre el menú del juego." + + old "Ctrl" + new "Ctrl" + + old "Skips dialogue while held down." + new "Salta el diálogo mientras se mantiene pulsada." + + old "Tab" + new "Tab" + + old "Toggles dialogue skipping." + new "Activa o desactiva el salto del diálogo." + + old "Page Up" + new "Re Pág" + + old "Rolls back to earlier dialogue." + new "Vuelve al diálogo anterior." + + old "Page Down" + new "Av Pág" + + old "Rolls forward to later dialogue." + new "Avanza hasta el diálogo siguiente." + + old "Hides the user interface." + new "Oculta la interfaz." + + old "Takes a screenshot." + new "Hace una captura de pantalla." + + old "Toggles assistive {a=https://www.renpy.org/l/voicing}self-voicing{/a}." + new "Activa o desactiva la {a=https://www.renpy.org/l/voicing}lectura en voz alta{/a}." + + old "Opens the accessibility menu." + new "Abre el menú de accesibilidad." + + old "Left Click" + new "Clic izquierdo" + + old "Middle Click" + new "Clic central" + + old "Right Click" + new "Clic derecho" + + old "Mouse Wheel Up" + new "Rueda hacia arriba" + + old "Mouse Wheel Down" + new "Rueda hacia abajo" + + old "Right Trigger\nA/Bottom Button" + new "Gatillo derecho\nA/Botón inferior" + + old "Left Trigger\nLeft Shoulder" + new "Gatillo izquierdo\nBotón superior izquierdo" + + old "Right Shoulder" + new "Botón superior derecho" + + old "D-Pad, Sticks" + new "Cruceta, palancas" + + old "Start, Guide, B/Right Button" + new "Start, Guía, B/Botón derecho" + + old "Y/Top Button" + new "Y/Botón superior" + + old "Calibrate" + new "Calibrar" + + old "Yes" + new "Sí" + + old "No" + new "No" + + old "Skipping" + new "Saltando" + + old "Menu" + new "Menú" diff --git a/tests/test_renpy_gen.py b/tests/test_renpy_gen.py index d4729b0..ce9765a 100644 --- a/tests/test_renpy_gen.py +++ b/tests/test_renpy_gen.py @@ -1,5 +1,6 @@ import json import os +import re import subprocess from pathlib import Path @@ -434,22 +435,80 @@ def test_scan_and_copy_audio(work, tmp_path): assert "audio/scenes/x.ogg" in audio.files -def test_copy_translations_and_default_language(work, tmp_path): +def test_copy_translations_and_forced_language(work, tmp_path): root = tmp_path / "w" (root / "tl/spanish").mkdir(parents=True) - (root / "tl/spanish/common.rpy").write_text("translate spanish strings:\n", encoding="utf-8") + work_common = "translate spanish strings:\n" + (root / "tl/spanish/common.rpy").write_text(work_common, encoding="utf-8") + (root / "tl/spanish/extra.rpy").write_text(work_common, encoding="utf-8") data = {**work.data, "ui": {**work.data.get("ui", {}), "language": "spanish"}} out = tmp_path / "out" copied = renpy_gen.copy_translations(type(work)(root=root, data=data), out) - assert (out / "game/tl/spanish/common.rpy").is_file() + tl = out / "game/tl/spanish" + # vnpipe's own translation ships; a work file with the same path replaces it + shipped = renpy_gen.TEMPLATE_DIR / "tl/spanish/screens.rpy" + assert (tl / "screens.rpy").read_bytes() == shipped.read_bytes() + assert (tl / "common.rpy").read_text(encoding="utf-8") == work_common + assert (tl / "extra.rpy").is_file() lang = out / "game/language.rpy" assert lang in copied - assert lang.read_text(encoding="utf-8") == 'define config.default_language = "spanish"\n' + # config.language beats a persistent preference left by an older build + assert lang.read_text(encoding="utf-8") == ( + 'define config.default_language = "spanish"\ndefine config.language = "spanish"\n' + ) # Without [ui].language the stale file is removed. renpy_gen.copy_translations(type(work)(root=tmp_path / "none", data=work.data), out) assert not lang.exists() +def _tl_strings(path: Path) -> list[str]: + return re.findall(r'^\s*old "((?:[^"\\]|\\.)*)"$', path.read_text(encoding="utf-8"), re.M) + + +def test_shipped_spanish_covers_every_template_string(): + """Every _("...") string of the template screens has exactly one Spanish translation.""" + template = "" + for path in sorted((renpy_gen.TEMPLATE_DIR / "game").glob("*.rpy")): + template += path.read_text(encoding="utf-8") + wanted = set(re.findall(r'(? 70 + olds = [] + for path in sorted((renpy_gen.TEMPLATE_DIR / "tl/spanish").glob("*.rpy")): + olds += _tl_strings(path) + assert len(olds) == len(set(olds)), "a string translated twice breaks Ren'Py" + assert sorted(wanted - set(olds)) == [] + + +def test_no_sync_buttons(project): + options = (project / "game/options.rpy").read_text(encoding="utf-8") + assert "define config.has_sync = False" in options + screens = (project / "game/screens.rpy").read_text(encoding="utf-8") + assert "UploadSync" not in screens and "DownloadSync" not in screens + + +def test_menu_ornaments_are_deterministic(): + a, b = renpy_gen.gui_extra_images(), renpy_gen.gui_extra_images() + assert a.keys() == b.keys() + assert all(a[k].tobytes() == b[k].tobytes() for k in a) + for name in ("card_background", "card_hover_background", "rule", "nav_selected_background"): + assert f"gui/vn/{name}.png" in a + assert "gui/phone/vn/rule.png" not in a # ornaments are not looked up per variant + rule = a["gui/vn/rule.png"] + mid = rule.height // 2 + # bright in the middle, faded at the ends + assert rule.getpixel((0, mid))[3] < 10 and rule.getpixel((rule.width // 3, mid))[3] == 255 + + +def test_save_metadata_and_slots(project): + menus = (project / "game/menus.rpy").read_text(encoding="utf-8") + assert "config.save_json_callbacks.append(vn_save_json)" in menus + assert "store.vn_current_scene = label" in menus + screens = (project / "game/screens.rpy").read_text(encoding="utf-8") + assert 'info.get("vn_scene")' in screens and 'info["vn_line"]' in screens + assert "FileDelete(slot)" in screens and "vn_roman(page)" in screens + + def test_mood_directory_is_a_playlist(work, annotated): block = scene_block(renpy_gen.render_script(work, annotated, _audio()), "lyric") assert _music_lines(block) == [