From 673b0882eaa57f9c4ba61542675089a88f4cad45 Mon Sep 17 00:00:00 2001 From: Cafw Date: Wed, 4 Mar 2026 23:01:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/screens.rpy | 90 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 80 insertions(+), 10 deletions(-) diff --git a/game/screens.rpy b/game/screens.rpy index 97f6dc1..8c76af7 100644 --- a/game/screens.rpy +++ b/game/screens.rpy @@ -333,6 +333,20 @@ init python: persistent.gallery_seen = set() persistent.gallery_seen.add(photo_id) + def has_any_new_gallery_photo(): + for photo in GALLERY_PHOTOS: + if is_gallery_photo_unlocked(photo) and is_photo_new(photo["id"]): + return True + return False + + def clear_all_game_data(): + """清除所有存档和持久化数据,然后重启游戏。""" + for slot, _, _, _ in renpy.list_saved_games(regexp=r'.+'): + renpy.unlink_save(slot) + persistent._clear(progress=True) + renpy.save_persistent() + renpy.full_restart() + style window is default style say_label is default style say_dialogue is default @@ -518,16 +532,36 @@ screen hud_overlay(): tooltip "游戏菜单" ## 右上角画廊/日期图标(1920 - 96 - 40 = 1784) - vbox: + fixed: xpos 1784 ypos 40 + xysize (96, 96) - imagebutton: - idle create_gallery_page_idle(96) - hover create_gallery_page_hover(96) + button: + xfill True + yfill True + background create_gallery_page_idle(96) + hover_background create_gallery_page_hover(96) action ToggleScreen("gallery_panel") tooltip "画廊 / 日期" + if has_any_new_gallery_photo(): + frame: + xanchor 1.0 + xpos 96 + yanchor 0.0 + ypos 0 + xysize (36, 20) + background "#e03030" + padding (3, 2, 3, 2) + + text "NEW": + xalign 0.5 + yalign 0.5 + color "#ffffff" + size 13 + bold True + ## 移动端 - 稍大的图标,更易点击 elif renpy.variant("touch") or renpy.variant("small"): vbox: @@ -542,15 +576,34 @@ screen hud_overlay(): xysize (120, 120) ## 移动端右上角画廊/日期图标 - vbox: + fixed: xpos 1730 ypos 30 + xysize (112, 112) - imagebutton: - idle create_gallery_page_idle(112) - hover create_gallery_page_hover(112) + button: + xfill True + yfill True + background create_gallery_page_idle(112) + hover_background create_gallery_page_hover(112) action ToggleScreen("gallery_panel") - xysize (120, 120) + + if has_any_new_gallery_photo(): + frame: + xanchor 1.0 + xpos 112 + yanchor 0.0 + ypos 0 + xysize (36, 20) + background "#e03030" + padding (3, 2, 3, 2) + + text "NEW": + xalign 0.5 + yalign 0.5 + color "#ffffff" + size 13 + bold True ## 注册HUD overlay为持久显示的屏幕 @@ -592,7 +645,7 @@ screen gallery_panel(): xfill True ysize 72 background None - padding (24, 0, 24, 0) + padding (24, 0, 40, 0) hbox: xfill True @@ -1422,6 +1475,23 @@ screen preferences(): action Preference("all mute", "toggle") style "mute_all_button" + null height (4 * gui.pref_spacing) + + hbox: + style_prefix "check" + box_wrap True + + vbox: + label _("危险操作") + + textbutton _("清除所有数据"): + action Confirm( + _("此操作将清除所有存档和游戏进度,且无法撤销。\n确定要继续吗?"), + yes=Function(clear_all_game_data), + no=Hide("confirm") + ) + style "mute_all_button" + style pref_label is gui_label style pref_label_text is gui_label_text