Compare commits
4 Commits
e879b916c2
...
673b0882ea
| Author | SHA1 | Date | |
|---|---|---|---|
| 673b0882ea | |||
| e00c084e61 | |||
| 591d10a5cc | |||
| dce1aaf9b2 |
@@ -238,6 +238,7 @@ label Chapter1_Scene3:
|
||||
|
||||
label Chapter1_Scene4:
|
||||
$ game_period = "after_school"
|
||||
$ gallery_photo4_unlocked = True
|
||||
play music "audio/MainMenu.ogg" fadein 2.0
|
||||
scene bg classroom wide afterschool with fade
|
||||
"{cps=20}【同日放学后·七班教室】" # system_ "【同日放学后·七班教室】"
|
||||
|
||||
BIN
game/images/gallery/icon_gallery.png
Normal file
BIN
game/images/gallery/icon_gallery.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 96 KiB |
BIN
game/images/gallery/photo_corridor.jpg
Normal file
BIN
game/images/gallery/photo_corridor.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 54 KiB |
BIN
game/images/gallery/photo_monalisa.jpg
Normal file
BIN
game/images/gallery/photo_monalisa.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 89 KiB |
BIN
game/images/gallery/photo_pearl.png
Normal file
BIN
game/images/gallery/photo_pearl.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 MiB |
BIN
game/images/gallery/photo_sleeping.jpg
Normal file
BIN
game/images/gallery/photo_sleeping.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 106 KiB |
482
game/screens.rpy
482
game/screens.rpy
@@ -279,6 +279,74 @@ init python:
|
||||
period_text = period_map.get(store.game_period, "")
|
||||
return "{}年{}月{}日 {}".format(current.year, current.month, current.day, period_text)
|
||||
|
||||
## 画廊数据与辅助函数
|
||||
GALLERY_PHOTOS = [
|
||||
{
|
||||
"id": "pearl",
|
||||
"file": "images/gallery/photo_pearl.png",
|
||||
"title": "珍珠耳环",
|
||||
"desc": "某个无聊的午后,\n镜子里映出一张陌生的脸。\n古典与现代在此刻奇异地重叠。",
|
||||
"date": "2029.09.05",
|
||||
"always_unlocked": True,
|
||||
},
|
||||
{
|
||||
"id": "monalisa",
|
||||
"file": "images/gallery/photo_monalisa.jpg",
|
||||
"title": "永恒的微笑",
|
||||
"desc": "AI说,你和她很像。\n我觉得,那是在骂我。",
|
||||
"date": "2029.09.05",
|
||||
"always_unlocked": True,
|
||||
},
|
||||
{
|
||||
"id": "corridor",
|
||||
"file": "images/gallery/photo_corridor.jpg",
|
||||
"title": "考前",
|
||||
"desc": "考场门外,时间凝固了一样。\n走廊的灯光把影子拉得很长。",
|
||||
"date": "2029.09.10",
|
||||
"always_unlocked": True,
|
||||
},
|
||||
{
|
||||
"id": "sleeping",
|
||||
"file": "images/gallery/photo_sleeping.jpg",
|
||||
"title": "力学之美",
|
||||
"desc": "一切运动都趋向静止。\n这是物理定律,也是我的日常。\n\n——任懿涛",
|
||||
"date": "2029.10.01",
|
||||
"always_unlocked": False,
|
||||
},
|
||||
]
|
||||
|
||||
def is_gallery_photo_unlocked(photo):
|
||||
if photo["always_unlocked"]:
|
||||
return True
|
||||
if photo["id"] == "sleeping":
|
||||
return store.gallery_photo4_unlocked
|
||||
return False
|
||||
|
||||
def is_photo_new(photo_id):
|
||||
seen = persistent.gallery_seen
|
||||
if seen is None:
|
||||
return True
|
||||
return photo_id not in seen
|
||||
|
||||
def mark_photo_seen(photo_id):
|
||||
if persistent.gallery_seen is None:
|
||||
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
|
||||
@@ -464,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:
|
||||
@@ -488,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为持久显示的屏幕
|
||||
@@ -516,40 +623,334 @@ screen gallery_panel():
|
||||
button:
|
||||
xfill True
|
||||
yfill True
|
||||
background "#00000077"
|
||||
background "#00000066"
|
||||
action Hide("gallery_panel")
|
||||
|
||||
## 主面板(80% 屏幕:1536×864)
|
||||
## 右侧侧边栏面板(340×1080)
|
||||
frame:
|
||||
xalign 0.5
|
||||
yalign 0.5
|
||||
xysize (1536, 864)
|
||||
background "#0d0f1eee"
|
||||
padding (30, 20, 30, 20)
|
||||
xanchor 1.0
|
||||
xpos 1920
|
||||
yanchor 0.0
|
||||
ypos 0
|
||||
xysize (340, 1080)
|
||||
background "#0d0f1ef0"
|
||||
padding (0, 0, 0, 0)
|
||||
|
||||
## 右上角:日期 + 关闭按钮
|
||||
hbox:
|
||||
xalign 1.0
|
||||
yalign 0.0
|
||||
spacing 24
|
||||
vbox:
|
||||
xfill True
|
||||
spacing 0
|
||||
|
||||
text get_game_date_str():
|
||||
color "#a8c8f0"
|
||||
size 32
|
||||
yalign 0.5
|
||||
font "fonts/AlibabaPuHuiTi-3-55-Regular.ttf"
|
||||
## 顶部:日期 + 关闭按钮
|
||||
frame:
|
||||
xfill True
|
||||
ysize 72
|
||||
background None
|
||||
padding (24, 0, 40, 0)
|
||||
|
||||
textbutton "×":
|
||||
action Hide("gallery_panel")
|
||||
text_size 36
|
||||
text_color "#a8c8f0"
|
||||
text_hover_color "#ffffff"
|
||||
yalign 0.5
|
||||
hbox:
|
||||
xfill True
|
||||
yalign 0.5
|
||||
spacing 8
|
||||
|
||||
text get_game_date_str():
|
||||
color "#a8c8f0"
|
||||
size 26
|
||||
yalign 0.5
|
||||
font "fonts/AlibabaPuHuiTi-3-55-Regular.ttf"
|
||||
|
||||
frame:
|
||||
xfill True
|
||||
background None
|
||||
|
||||
textbutton "×":
|
||||
action Hide("gallery_panel")
|
||||
text_size 34
|
||||
text_color "#a8c8f0"
|
||||
text_hover_color "#ffffff"
|
||||
yalign 0.5
|
||||
|
||||
## 分割线
|
||||
frame:
|
||||
xfill True
|
||||
ysize 1
|
||||
background "#ffffff22"
|
||||
|
||||
## 工具栏标题
|
||||
frame:
|
||||
xfill True
|
||||
background None
|
||||
padding (24, 16, 24, 8)
|
||||
|
||||
text "工具栏":
|
||||
color "#778899"
|
||||
size 22
|
||||
font "fonts/AlibabaPuHuiTi-3-55-Regular.ttf"
|
||||
|
||||
## 画廊图标按钮
|
||||
button:
|
||||
xalign 0.5
|
||||
ysize 160
|
||||
background None
|
||||
hover_background "#ffffff11"
|
||||
action Function(renpy.show_screen, "yitao_gallery")
|
||||
|
||||
vbox:
|
||||
xalign 0.5
|
||||
yalign 0.5
|
||||
spacing 10
|
||||
|
||||
frame:
|
||||
xalign 0.5
|
||||
xysize (112, 112)
|
||||
background None
|
||||
padding (0, 0, 0, 0)
|
||||
|
||||
add "images/gallery/icon_gallery.png":
|
||||
fit "contain"
|
||||
xsize 112
|
||||
ysize 112
|
||||
|
||||
text "画廊":
|
||||
xalign 0.5
|
||||
color "#cccccc"
|
||||
size 22
|
||||
font "fonts/AlibabaPuHuiTi-3-55-Regular.ttf"
|
||||
|
||||
## ESC 键关闭
|
||||
key "game_menu" action Hide("gallery_panel")
|
||||
|
||||
|
||||
################################################################################
|
||||
## YITAO-REN GALLERY 主画廊屏幕
|
||||
################################################################################
|
||||
|
||||
screen yitao_gallery():
|
||||
zorder 155
|
||||
modal True
|
||||
|
||||
## 全屏深色背景
|
||||
frame:
|
||||
xfill True
|
||||
yfill True
|
||||
background "#0a0c1a"
|
||||
padding (0, 0, 0, 0)
|
||||
|
||||
vbox:
|
||||
xfill True
|
||||
yfill True
|
||||
spacing 0
|
||||
|
||||
## 顶栏(高 80px)
|
||||
frame:
|
||||
xfill True
|
||||
ysize 80
|
||||
background "#0d0f28cc"
|
||||
padding (48, 0, 48, 0)
|
||||
|
||||
hbox:
|
||||
xfill True
|
||||
yalign 0.5
|
||||
spacing 0
|
||||
|
||||
text "YITAO-REN GALLERY":
|
||||
color "#c8d8f0"
|
||||
size 32
|
||||
yalign 0.5
|
||||
font "fonts/AlibabaPuHuiTi-3-55-Regular.ttf"
|
||||
|
||||
frame:
|
||||
xfill True
|
||||
background None
|
||||
|
||||
textbutton "×":
|
||||
action Hide("yitao_gallery")
|
||||
text_size 38
|
||||
text_color "#a8c8f0"
|
||||
text_hover_color "#ffffff"
|
||||
yalign 0.5
|
||||
|
||||
## 照片卡片区(占剩余空间,垂直居中)
|
||||
frame:
|
||||
xfill True
|
||||
yfill True
|
||||
background None
|
||||
padding (0, 0, 0, 0)
|
||||
|
||||
hbox:
|
||||
xalign 0.5
|
||||
yalign 0.5
|
||||
spacing 24
|
||||
|
||||
for photo in GALLERY_PHOTOS:
|
||||
$ _pid = photo["id"]
|
||||
$ _unlocked = is_gallery_photo_unlocked(photo)
|
||||
$ _is_new = _unlocked and is_photo_new(_pid)
|
||||
|
||||
## 单张卡片(白色边框 = NEW)
|
||||
frame:
|
||||
xysize (425, 567)
|
||||
yalign 0.5
|
||||
background ("#ffffff" if _is_new else "#1a1c2a")
|
||||
padding ((3, 3, 3, 3) if _is_new else (0, 0, 0, 0))
|
||||
|
||||
if _unlocked:
|
||||
button:
|
||||
xfill True
|
||||
yfill True
|
||||
background None
|
||||
hover_background "#ffffff14"
|
||||
action [Function(mark_photo_seen, _pid), Function(renpy.show_screen, "gallery_detail", photo=photo)]
|
||||
|
||||
add photo["file"]:
|
||||
fit "cover"
|
||||
xsize 425
|
||||
ysize 567
|
||||
|
||||
else:
|
||||
## 未解锁:锁定状态
|
||||
frame:
|
||||
xfill True
|
||||
yfill True
|
||||
background "#111320"
|
||||
padding (0, 0, 0, 0)
|
||||
|
||||
text "?":
|
||||
xalign 0.5
|
||||
yalign 0.5
|
||||
color "#445566"
|
||||
size 80
|
||||
|
||||
## NEW 角标(绝对定位于卡片右上角)
|
||||
if _is_new:
|
||||
frame:
|
||||
xanchor 1.0
|
||||
xpos 422
|
||||
yanchor 0.0
|
||||
ypos 0
|
||||
xysize (60, 28)
|
||||
background "#e03030"
|
||||
padding (4, 2, 4, 2)
|
||||
|
||||
text "NEW":
|
||||
xalign 0.5
|
||||
yalign 0.5
|
||||
color "#ffffff"
|
||||
size 16
|
||||
bold True
|
||||
|
||||
key "game_menu" action Hide("yitao_gallery")
|
||||
|
||||
|
||||
################################################################################
|
||||
## 画廊详情屏幕
|
||||
################################################################################
|
||||
|
||||
screen gallery_detail(photo):
|
||||
zorder 160
|
||||
modal True
|
||||
|
||||
## 全屏背景
|
||||
frame:
|
||||
xfill True
|
||||
yfill True
|
||||
background "#0a0c1a"
|
||||
padding (0, 0, 0, 0)
|
||||
|
||||
vbox:
|
||||
xfill True
|
||||
yfill True
|
||||
spacing 0
|
||||
|
||||
## 顶栏(高 72px)
|
||||
frame:
|
||||
xfill True
|
||||
ysize 72
|
||||
background "#0d0f28cc"
|
||||
padding (40, 0, 40, 0)
|
||||
|
||||
textbutton "← YITAO-REN GALLERY":
|
||||
action Hide("gallery_detail")
|
||||
text_size 26
|
||||
text_color "#a8c8f0"
|
||||
text_hover_color "#ffffff"
|
||||
yalign 0.5
|
||||
|
||||
## 主体区域(左图右文)
|
||||
frame:
|
||||
xfill True
|
||||
yfill True
|
||||
background None
|
||||
padding (0, 0, 0, 0)
|
||||
|
||||
hbox:
|
||||
xfill True
|
||||
yfill True
|
||||
spacing 0
|
||||
|
||||
## 左栏:图片(55%,xsize 1056)
|
||||
frame:
|
||||
xsize 1056
|
||||
yfill True
|
||||
background None
|
||||
padding (0, 0, 0, 0)
|
||||
|
||||
add photo["file"]:
|
||||
xalign 0.5
|
||||
yalign 0.5
|
||||
fit "contain"
|
||||
xsize 960
|
||||
ysize 1008
|
||||
|
||||
## 右栏:文字信息(45%,xsize 864)
|
||||
frame:
|
||||
xsize 864
|
||||
yfill True
|
||||
background "#0d0f28"
|
||||
padding (60, 0, 60, 0)
|
||||
|
||||
vbox:
|
||||
xfill True
|
||||
yalign 0.3
|
||||
spacing 20
|
||||
|
||||
## 照片标题
|
||||
frame:
|
||||
xfill True
|
||||
background None
|
||||
padding (0, 40, 0, 16)
|
||||
|
||||
text photo["title"]:
|
||||
color "#ffffff"
|
||||
size 52
|
||||
font "fonts/AlibabaPuHuiTi-3-55-Regular.ttf"
|
||||
|
||||
## 水平分割线
|
||||
frame:
|
||||
xfill True
|
||||
ysize 1
|
||||
background "#ffffff44"
|
||||
|
||||
## 描述文字
|
||||
frame:
|
||||
xfill True
|
||||
background None
|
||||
padding (0, 20, 0, 20)
|
||||
|
||||
text photo["desc"]:
|
||||
color "#aaaaaa"
|
||||
size 26
|
||||
font "fonts/AlibabaPuHuiTi-3-55-Regular.ttf"
|
||||
line_spacing 12
|
||||
|
||||
## 发布日期
|
||||
text photo["date"]:
|
||||
color "#666666"
|
||||
size 20
|
||||
font "fonts/AlibabaPuHuiTi-3-55-Regular.ttf"
|
||||
|
||||
key "game_menu" action Hide("gallery_detail")
|
||||
|
||||
|
||||
################################################################################
|
||||
## 标题和游戏菜单屏幕
|
||||
################################################################################
|
||||
@@ -1074,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
|
||||
|
||||
@@ -81,6 +81,10 @@ default game_start_year = 2029
|
||||
default game_start_month = 9
|
||||
default game_start_day = 3 # Day 1 = 2029年9月3日(开学周一)
|
||||
|
||||
# ====== 画廊系统变量 ======
|
||||
default persistent.gallery_seen = set() # 已查看的照片 id 集合
|
||||
default gallery_photo4_unlocked = False # "力学之美"照片解锁标志
|
||||
|
||||
|
||||
# ====== 可选:总字典管理(便于批量操作) ======
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user