25 Commits

Author SHA1 Message Date
eb38af6045 feat: 新的版本号 2026-03-04 23:29:56 +08:00
d602d3afe9 fix: 修正新照片显示时间 2026-03-04 23:21:57 +08:00
8cc7e2ebbc fix: 背景音乐fadein时间减少 2026-03-04 23:19:34 +08:00
673b0882ea feat: 新增清除数据按钮 2026-03-04 23:01:16 +08:00
e00c084e61 fix: 用 Function(renpy.show_screen) 替换 ShowScreen
Ren'Py 8.5.2 中 ShowScreen 不在 py_eval globals 内,
改用 renpy.show_screen 经 Function 包装的方式调用:
- gallery_panel 花朵按钮 → Function(renpy.show_screen, "yitao_gallery")
- yitao_gallery 卡片按钮 → Function(renpy.show_screen, "gallery_detail", photo=photo)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 22:01:34 +08:00
591d10a5cc fix: 修正 add 语句不支持 xfill/yfill/xmaximum 的错误
Ren'Py add 语句不接受 xfill、yfill、xmaximum、ymaximum,
改用 xsize/ysize 显式指定尺寸:
- icon_gallery: xsize 112, ysize 112
- 照片卡片: xsize 425, ysize 567
- 详情页图片: xsize 960, ysize 1008

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 21:57:25 +08:00
dce1aaf9b2 feat: 实现 YITAO-REN GALLERY 画廊功能
- 新增 game/images/gallery/ 目录(5 张处理过的图片资源)
  · icon_gallery.png(花朵图标,256x256)
  · photo_pearl.png / photo_monalisa.jpg / photo_corridor.jpg / photo_sleeping.jpg(统一裁切 720x960)
- game/script.rpy: 新增 persistent.gallery_seen 和 gallery_photo4_unlocked 变量
- game/Chapters/Chapter1.rpy: Chapter1_Scene4 开头自动解锁"力学之美"照片
- game/screens.rpy:
  · gallery_panel 改造为右侧侧边栏(340px),含花朵图标入口
  · 新增 yitao_gallery 屏幕(4 张卡片横排,NEW 角标,锁定状态)
  · 新增 gallery_detail 屏幕(左图右文详情页)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 21:50:57 +08:00
e879b916c2 fix: 将渐进式下载文件移出gitignore 2026-03-02 23:30:57 +08:00
9c0f65f420 refactor: 修正安卓版本号 2026-03-02 23:17:36 +08:00
118f3d9462 refactor: dev0.0.8 2026-03-02 22:55:46 +08:00
acbce20e18 Merge remote dev: 保留本地最新版本
远程为旧版,冲突文件(script.rpy / screens.rpy / Chapter1.rpy)均以本地版本为准。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 03:47:23 +08:00
4e305599f2 Initial commit: XinLanDiary dev0.0.7
添加 HUD 画廊/日期面板:右上角页面图标按钮,点击弹出叠层显示当前游戏内日期(Day 1 = 2029年9月3日)。
修复 renpy.pygame.draw.rect 不支持 border_radius 的兼容性问题。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 03:44:59 +08:00
f447de7f62 fix: 修正版本 2026-02-26 22:51:17 +08:00
8e7b156d19 fix: 版本号更新 2026-02-26 22:50:20 +08:00
b9dc8b7105 fix: 修复一个错误 2026-02-26 22:38:23 +08:00
47f1733a95 feat: 增加了2个游戏背景音乐 2026-02-26 22:29:46 +08:00
230e5f8892 refactor: 将下课铃修改为ogg格式 2026-02-26 16:12:27 +08:00
4a348e578b 添加:主菜单背景音乐 2026-02-26 16:09:55 +08:00
2e273a782c 解决冲突:保留CLAUDE.md 2026-02-26 13:15:05 +08:00
b5452a0a8a 忽略编译的文件 2026-02-26 13:11:06 +08:00
890dea326d 忽略.rpymc 2026-02-26 13:02:35 +08:00
ec39996d7c 修改网页版加载界面 2026-02-26 13:00:07 +08:00
d2da64618a 删除重复的mac包 2026-02-26 12:59:49 +08:00
7bf578b6b0 删除错误的“语法错误判断” 2026-02-26 12:59:10 +08:00
13ecbdb246 删除 CLAUDE.md 2026-02-25 23:08:05 +08:00
21 changed files with 750 additions and 15 deletions

2
.gitignore vendored
View File

@@ -3,6 +3,7 @@
# ============================================= # =============================================
*.rpyc *.rpyc
*.rpyb *.rpyb
*.rpymc
game/cache/ game/cache/
game/saves/ game/saves/
game/temp/ game/temp/
@@ -57,7 +58,6 @@ CLAUDE.md
# ============================================= # =============================================
# Ren'Py / Android Build Artifacts # Ren'Py / Android Build Artifacts
# ============================================= # =============================================
progressive_download.txt
rapt/ rapt/
.android/ .android/

View File

@@ -20,11 +20,6 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
构建多平台发行版需通过 Ren'Py 启动器 GUI 操作,配置见 `project.json``android.json` 构建多平台发行版需通过 Ren'Py 启动器 GUI 操作,配置见 `project.json``android.json`
## 已知语法错误(需要修复)
- `game/Chapters/Chapter1.rpy:31` — 引用了未定义的变换 `move_to_bottomleft`
- `game/screens.rpy:318` — 按钮定义中存在非法中文标点符号(`。`
## 项目架构 ## 项目架构
### 核心文件 ### 核心文件

View File

@@ -7,7 +7,7 @@
"include_pil": false, "include_pil": false,
"include_sqlite": false, "include_sqlite": false,
"layout": null, "layout": null,
"name": "\u8398\u6f9c\u65e5\u8bb0b0.0.6", "name": "\u8398\u6f9c\u65e5\u8bb0b0.0.8.5",
"numeric_version": 1, "numeric_version": 1,
"orientation": "sensorLandscape", "orientation": "sensorLandscape",
"package": "com.rytstudio.xinlandiary", "package": "com.rytstudio.xinlandiary",

View File

@@ -3,15 +3,20 @@
label Chapter1_Scene1: label Chapter1_Scene1:
$ game_day = 1
$ game_period = "morning"
scene bg classroom featryt with fade scene bg classroom featryt with fade
system_ "【Day 1·上午·七班教室】"
me "{cps=25}九月的风还带着夏末的燥热,那道斜切过窗台的阳光,在黑板上画出一道明晃晃的线。\n就像我的人生被分成了两半——线的那头是重点班线的这头是我。" me "{cps=25}九月的风还带着夏末的燥热,那道斜切过窗台的阳光,在黑板上画出一道明晃晃的线。\n就像我的人生被分成了两半——线的那头是重点班线的这头是我。"
me "这道光就这么直直地切过来,像是在提醒我,你就在这儿,也只能在这儿了。\n曾经唾手可得如今遥不可及。" me "这道光就这么直直地切过来,像是在提醒我,你就在这儿,也只能在这儿了。\n曾经唾手可得如今遥不可及。"
pause 0.5 pause 0.5
show xingyu thinking at left
show xingyu thinking at left
xingyu "涛哥,你咋又对着黑板发呆?" xingyu "涛哥,你咋又对着黑板发呆?"
play music "audio/XinLanDiary-Part1.ogg" fadein 0.5
show xingyu laughing show xingyu laughing
xingyu "该不会是在研究光线折射角度吧?" xingyu "该不会是在研究光线折射角度吧?"
hide xingyu hide xingyu
@@ -35,7 +40,10 @@ label Chapter1_Scene1:
show xingyu laughing big show xingyu laughing big
xingyu "{cps=5}哈哈哈哈哈{cps=15}\n真是一对苦命鸳鸯" xingyu "{cps=5}哈哈哈哈哈{cps=15}\n真是一对苦命鸳鸯"
play sound "audio/xiakering.mp3" $ game_period = "after_school"
stop music fadeout 1.0
play sound "audio/AfterClassRing.ogg" noloop
queue sound "audio/MainMenu.ogg" fadein 1.0
scene bg black with fade scene bg black with fade
pause 1.0 pause 1.0
scene bg playground twilight scene bg playground twilight
@@ -52,13 +60,17 @@ label Chapter1_Scene1:
stop sound fadeout 1.0 stop sound fadeout 1.0
hide xingyu with dissolve hide xingyu with dissolve
play music "audio/MainMenu.ogg" fadein 1.0
me "那声'起义'在心里荡开了一个小涟漪。" me "那声'起义'在心里荡开了一个小涟漪。"
me "他说得对——但说出口的代价,比他想的要重得多。" me "他说得对——但说出口的代价,比他想的要重得多。"
hide ryt with dissolve hide ryt with dissolve
pause 0.8 pause 0.8
# 草稿原文:「教室里人快走空时,手机震动了」——切回空教室背景
scene bg classroom wide afterschool with dissolve
$ gallery_photo4_unlocked = True
lzx "画廊更新了,有惊喜。友情提示:这次可能会火。" lzx "画廊更新了,有惊喜。友情提示:这次可能会火。"
me "……“任懿涛观察日志?”" me "……“任懿涛观察日志?”"
@@ -68,6 +80,7 @@ label Chapter1_Scene1:
show ryt dialogue embarrass pocket at center with dissolve show ryt dialogue embarrass pocket at center with dissolve
me "三张连拍……全程记录,还加了学术注释。行吧,就是个玩笑。" me "三张连拍……全程记录,还加了学术注释。行吧,就是个玩笑。"
hide ryt with dissolve hide ryt with dissolve
stop music fadeout 1.0
$ lhy_stats["affection"] += 3 $ lhy_stats["affection"] += 3
$ lhy_stats["trust"] += 2 $ lhy_stats["trust"] += 2
@@ -79,8 +92,11 @@ label Chapter1_Scene1:
jump Chapter1_Scene2 jump Chapter1_Scene2
label Chapter1_Scene2: label Chapter1_Scene2:
$ game_day = 2
$ game_period = "morning"
scene bg classroom morning featryt with fade scene bg classroom morning featryt with fade
#system_ "【第二天早上】" play music "audio/XinLanDiary-Part1.ogg" fadein 2
system_ "【Day 2·早自习前·七班教室】"
me "第二天早上,一切都不一样了。" me "第二天早上,一切都不一样了。"
me "刚踏进七班,就感觉空气里有种微妙的兴奋。" me "刚踏进七班,就感觉空气里有种微妙的兴奋。"
@@ -111,12 +127,14 @@ label Chapter1_Scene2:
me "深吸一口气——经过八班队列时,我故意做了个跳起来打空气的动作,表情夸张。" me "深吸一口气——经过八班队列时,我故意做了个跳起来打空气的动作,表情夸张。"
hide ryt with dissolve hide ryt with dissolve
tongxue "哈哈哈哈——" tongxue "哈哈哈哈——"
stop music fadeout 1.0
me "果然,又是一阵笑声。" me "果然,又是一阵笑声。"
me "我的那层盔甲还在。 对吗?" me "我的那层盔甲还在。 对吗?"
pause 0.3 pause 0.3
# 关键场景:刘泓予看穿 # 关键场景:刘泓予看穿
play music "audio/MainMenu.ogg" fadein 2.0
show lhy dialogue normal at right with dissolve show lhy dialogue normal at right with dissolve
lhy "你刚才那个假动作面部肌肉的紧张程度是平时的1.3倍。" lhy "你刚才那个假动作面部肌肉的紧张程度是平时的1.3倍。"
show ryt dialogue embarrass pocket at left with dissolve show ryt dialogue embarrass pocket at left with dissolve
@@ -130,6 +148,8 @@ label Chapter1_Scene2:
me "但不知道为什么,被他这么一说……我反而松了口气。" me "但不知道为什么,被他这么一说……我反而松了口气。"
me "有人看见了,但没有嘲笑。只是……记录。" me "有人看见了,但没有嘲笑。只是……记录。"
#stop music fadeout 1.0
$ lhy_stats["affection"] += 5 $ lhy_stats["affection"] += 5
$ lhy_stats["trust"] += 5 $ lhy_stats["trust"] += 5
$ lhy_stats["empathy"] += 3 $ lhy_stats["empathy"] += 3
@@ -140,6 +160,7 @@ label Chapter1_Scene2:
label Chapter1_Scene3: label Chapter1_Scene3:
# —— 视角A苏雨桐·学生会会议室 —— # —— 视角A苏雨桐·学生会会议室 ——
$ game_period = "afternoon"
scene bg meetingroom meeting with fade scene bg meetingroom meeting with fade
"{cps=20}【同日下午·学生会会议室】" # system_ "【同日下午·学生会会议室】" "{cps=20}【同日下午·学生会会议室】" # system_ "【同日下午·学生会会议室】"
@@ -167,6 +188,8 @@ label Chapter1_Scene3:
yutong "我那天递给他的纸条上可不仅写了“恭喜”二字……" yutong "我那天递给他的纸条上可不仅写了“恭喜”二字……"
yutong "这句话,他没有回应。\n 或许他根本就没有看见……" yutong "这句话,他没有回应。\n 或许他根本就没有看见……"
stop music fadeout 1.0
$ yutong_stats["affection"] += 3 $ yutong_stats["affection"] += 3
$ yutong_stats["attention"] += 5 $ yutong_stats["attention"] += 5
$ yutong_stats["h_academicSupport"] += 1 $ yutong_stats["h_academicSupport"] += 1
@@ -174,6 +197,7 @@ label Chapter1_Scene3:
pause 0.5 pause 0.5
# —— 视角B林晓薇·高二一班走廊 —— # —— 视角B林晓薇·高二一班走廊 ——
play music "audio/XinLanDiary-Part1.ogg" fadein 2.0
scene bg corridor with dissolve scene bg corridor with dissolve
"【同日下午·高二一班走廊】" "【同日下午·高二一班走廊】"
@@ -183,11 +207,13 @@ label Chapter1_Scene3:
xiaowei "拍得好生动啊!你们说,要是我也这样跳起来打人,会不会也这么有效果?" xiaowei "拍得好生动啊!你们说,要是我也这样跳起来打人,会不会也这么有效果?"
tongxue "哈哈哈哈!" tongxue "哈哈哈哈!"
hide xiaowei with dissolve hide xiaowei with dissolve
stop music fadeout 1.0
"{cps=20}她笑着,眼睛却没有离开屏幕。" "{cps=20}她笑着,眼睛却没有离开屏幕。"
"{cps=20}那种真实的活力,让她觉得……在礼貌而疏离的文科班里,有什么东西被触动了。" "{cps=20}那种真实的活力,让她觉得……在礼貌而疏离的文科班里,有什么东西被触动了。"
#system_ "【切换账号:薇风拂晓】" #system_ "【切换账号:薇风拂晓】"
play music "audio/XinLanDiary-Part1.ogg" fadein 2.0
scene bg classroom phone closeup with dissolve scene bg classroom phone closeup with dissolve
system_ "好友列表:逍遥剑客 [[在线]" system_ "好友列表:逍遥剑客 [[在线]"
xiaowei_w "在吗?问个事。你们学校是不是有个挺搞笑的人?最近好像因为什么照片火了。" xiaowei_w "在吗?问个事。你们学校是不是有个挺搞笑的人?最近好像因为什么照片火了。"
@@ -202,6 +228,7 @@ label Chapter1_Scene3:
me "任懿涛正背对门口,和陈星宇比划着什么。大概又是游戏攻略。" me "任懿涛正背对门口,和陈星宇比划着什么。大概又是游戏攻略。"
hide ryt with dissolve hide ryt with dissolve
hide xingyu with dissolve hide xingyu with dissolve
stop music fadeout 1.0
$ xiaowei_stats["affection"] += 4 $ xiaowei_stats["affection"] += 4
$ xiaowei_stats["interactionFrequency"] += 2 $ xiaowei_stats["interactionFrequency"] += 2
@@ -210,6 +237,8 @@ label Chapter1_Scene3:
jump Chapter1_Scene4 jump Chapter1_Scene4
label Chapter1_Scene4: label Chapter1_Scene4:
$ game_period = "after_school"
play music "audio/MainMenu.ogg" fadein 2.0
scene bg classroom wide afterschool with fade scene bg classroom wide afterschool with fade
"{cps=20}【同日放学后·七班教室】" # system_ "【同日放学后·七班教室】" "{cps=20}【同日放学后·七班教室】" # system_ "【同日放学后·七班教室】"
@@ -250,6 +279,7 @@ label Chapter1_Scene4:
hide ryt with dissolve hide ryt with dissolve
# 反侦察行动 # 反侦察行动
play music "audio/XinLanDiary-Part1.ogg" fadein 2.0
show xingyu at left with dissolve show xingyu at left with dissolve
xingyu "各位!我有个绝妙的主意——" xingyu "各位!我有个绝妙的主意——"
xingyu "既然那个画廊这么喜欢拍涛哥,咱们不如搞个「反侦察行动」!" xingyu "既然那个画廊这么喜欢拍涛哥,咱们不如搞个「反侦察行动」!"
@@ -260,9 +290,12 @@ label Chapter1_Scene4:
xingyu "哎呀小卡你别扫兴!就是玩嘛!涛哥,你说干不干?" xingyu "哎呀小卡你别扫兴!就是玩嘛!涛哥,你说干不干?"
hide lhy with dissolve hide lhy with dissolve
stop music fadeout 0.8
show ryt dialogue normal at right with dissolve show ryt dialogue normal at right with dissolve
me "看着眼前这群人。认识不过一个多月——但他们就这么凑过来,商量这种无聊又有趣的计划。" me "看着眼前这群人。认识不过一个多月——但他们就这么凑过来,商量这种无聊又有趣的计划。"
me "在重点班时,从来没有过这样的时刻。" me "在重点班时,从来没有过这样的时刻。"
play music "audio/XinLanDiary-Part1.ogg" fadein 1.0
me "行啊!但咱们得专业!要有分工!有排班表!有应急预案!还要有——" me "行啊!但咱们得专业!要有分工!有排班表!有应急预案!还要有——"
hide ryt with dissolve hide ryt with dissolve
hide xingyu with dissolve hide xingyu with dissolve
@@ -275,6 +308,7 @@ label Chapter1_Scene4:
yh "我负责记录你们的失败过程。" yh "我负责记录你们的失败过程。"
hide yh with dissolve hide yh with dissolve
tongxue "哈哈哈哈哈!" tongxue "哈哈哈哈哈!"
stop music fadeout 1.0
show ryt dialogue normal at right with dissolve show ryt dialogue normal at right with dissolve
me "我也跟着笑。但眼睛不自觉地望向窗外。" me "我也跟着笑。但眼睛不自觉地望向窗外。"
@@ -294,6 +328,8 @@ label Chapter1_Scene4:
pause 0.5 pause 0.5
# 便利店 # 便利店
$ game_period = "evening"
play music "audio/XinLanDiary-Part2.ogg" fadein 2.0
scene bg convenience store with fade scene bg convenience store with fade
system_ "【傍晚17:25·校门外便利店】" system_ "【傍晚17:25·校门外便利店】"
@@ -347,6 +383,7 @@ label Chapter1_Scene4:
pause 0.5 pause 0.5
# 双视角结尾 # 双视角结尾
$ game_period = "night"
scene bg black with fade scene bg black with fade
system_ "【同夜·城市另一头】" system_ "【同夜·城市另一头】"

Binary file not shown.

BIN
game/audio/MainMenu.ogg Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

View File

@@ -27,7 +27,7 @@ define gui.show_name = True
## 游戏版本号。 ## 游戏版本号。
define config.version = "dev0.0.6" define config.version = "dev0.0.8.5"
## 放置在游戏内“关于”屏幕上的文本。将文本放在三个引号之间,并在段落之间留出空 ## 放置在游戏内“关于”屏幕上的文本。将文本放在三个引号之间,并在段落之间留出空
@@ -39,7 +39,8 @@ define gui.about = _p("""
\n 角色设计xwhy \n 角色设计xwhy
\n 程序FL \n 程序FL
\n 图像FL \n 图像FL
\n 感谢以下人员对项目做出的贡献yh, wjj等。 \n 音乐FL
\n 感谢以下人员对项目做出的贡献yh, Zeptyer等。
""") """)
@@ -69,7 +70,7 @@ define config.has_voice = False
## 将以下语句取消注释就可以设置标题界面播放的背景音乐文件。此文件将在整个游戏中 ## 将以下语句取消注释就可以设置标题界面播放的背景音乐文件。此文件将在整个游戏中
## 持续播放,直至音乐停止或其他文件开始播放。 ## 持续播放,直至音乐停止或其他文件开始播放。
# define config.main_menu_music = "main-menu-theme.ogg" define config.main_menu_music = "audio/MainMenu.ogg"
## 转场 ########################################################################## ## 转场 ##########################################################################

View File

@@ -136,6 +136,217 @@ screen say(who, what):
init python: init python:
config.character_id_prefixes.append('namebox') config.character_id_prefixes.append('namebox')
## 齿轮图标 Displayable 类
import math
import pygame
class GearDisplayable(renpy.Displayable):
"""
创建一个现代简洁风格的齿轮图标 Displayable
参数:
- size: 图标大小(像素)
- color: 齿轮颜色(十六进制)
- alpha: 透明度 (0.0-1.0)
"""
def __init__(self, size=48, color="#FFFFFF", alpha=0.85):
super(GearDisplayable, self).__init__()
self.size = size
self.color = color
self.alpha = alpha
def render(self, width, height, st, at):
# 创建渲染对象
render = renpy.Render(self.size, self.size)
# 创建surface
surface = pygame.Surface((self.size, self.size), pygame.SRCALPHA)
# 解析颜色
color_rgb = tuple(int(self.color.lstrip('#')[i:i+2], 16) for i in (0, 2, 4))
color_with_alpha = color_rgb + (int(self.alpha * 255),)
center = self.size // 2
outer_radius = self.size // 2 - 4 # 外圈半径
inner_radius = int(outer_radius * 0.4) # 内圆半径
tooth_height = int(outer_radius * 0.25) # 齿高
num_teeth = 8 # 齿数
# 绘制齿轮路径点
points = []
for i in range(num_teeth * 2):
angle = (i * 360 / (num_teeth * 2)) * math.pi / 180
if i % 2 == 0: # 齿尖
radius = outer_radius
else: # 齿根
radius = outer_radius - tooth_height
x = center + int(radius * math.cos(angle))
y = center + int(radius * math.sin(angle))
points.append((x, y))
# 绘制齿轮外圈
pygame.draw.polygon(surface, color_with_alpha, points, 0)
# 绘制内圆(镂空效果)
pygame.draw.circle(surface, (0, 0, 0, 0), (center, center), inner_radius)
# 绘制中心圆(增强设计感)
center_circle_radius = int(inner_radius * 0.5)
pygame.draw.circle(surface, color_with_alpha, (center, center), center_circle_radius, 0)
# 将surface绘制到render
render.blit(surface, (0, 0))
return render
def create_settings_gear_hover(size=96):
"""创建hover状态的齿轮更亮"""
return GearDisplayable(size=size, color="#FFFFFF", alpha=1.0)
def create_settings_gear_idle(size=96):
"""创建idle状态的齿轮"""
return GearDisplayable(size=size, color="#FFFFFF", alpha=0.9)
## 圆形画廊/日期图标 Displayable 类
class PageDisplayable(renpy.Displayable):
"""圆形画廊图标:白圆 + 深色纸张 + 白色线条"""
def __init__(self, size=48, alpha=0.85):
super(PageDisplayable, self).__init__()
self.size = size
self.alpha = alpha
def render(self, width, height, st, at):
size = self.size
a = int(self.alpha * 255)
surface = pygame.Surface((size, size), pygame.SRCALPHA)
center = size // 2
radius = size // 2 - 4
# 白色圆形背景
pygame.draw.circle(surface, (255, 255, 255, a), (center, center), radius)
# 深色纸张(圆角矩形,手动实现以兼容 renpy.pygame
pw = int(radius * 0.78)
ph = int(radius * 1.05)
px = center - pw // 2
py = center - ph // 2
paper_color = (32, 42, 68, min(a + 30, 255))
cr = 4 # 圆角半径
pygame.draw.rect(surface, paper_color, (px + cr, py, pw - 2 * cr, ph))
pygame.draw.rect(surface, paper_color, (px, py + cr, pw, ph - 2 * cr))
pygame.draw.circle(surface, paper_color, (px + cr, py + cr), cr)
pygame.draw.circle(surface, paper_color, (px + pw - cr, py + cr), cr)
pygame.draw.circle(surface, paper_color, (px + cr, py + ph - cr), cr)
pygame.draw.circle(surface, paper_color, (px + pw - cr, py + ph - cr), cr)
# 三条白色横线
lc = (210, 225, 245, int(self.alpha * 210))
lx0 = px + int(pw * 0.16)
lx1 = px + int(pw * 0.84)
for i in range(3):
ly = py + int(ph * 0.28) + i * int(ph * 0.22)
pygame.draw.line(surface, lc, (lx0, ly), (lx1, ly), max(2, size // 48))
render = renpy.Render(size, size)
render.blit(surface, (0, 0))
return render
def visit(self):
return []
def create_gallery_page_idle(size=96):
return PageDisplayable(size=size, alpha=0.85)
def create_gallery_page_hover(size=96):
return PageDisplayable(size=size, alpha=1.0)
## 游戏内日期字符串函数
import datetime as _dt
def get_game_date_str():
"""根据 game_day 和 game_period 返回完整游戏内日期字符串"""
base = _dt.date(store.game_start_year, store.game_start_month, store.game_start_day)
current = base + _dt.timedelta(days=store.game_day - 1)
period_map = {
"morning": "上午",
"afternoon": "下午",
"after_school": "放学后",
"evening": "傍晚",
"night": "深夜",
}
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 window is default
style say_label is default style say_label is default
style say_dialogue is default style say_dialogue is default
@@ -295,6 +506,451 @@ style quick_button_text:
properties gui.text_properties("quick_button") properties gui.text_properties("quick_button")
################################################################################
## HUD Overlay - 游戏内浮动图标
################################################################################
## 该屏幕在游戏进行时显示在左上角,提供快速访问菜单的图标按钮
screen hud_overlay():
## 确保在所有UI之上
zorder 101
## 只在游戏进行时显示,不在主菜单显示
if not main_menu and not renpy.context()._menu:
## 桌面版 - 左上角齿轮图标
if renpy.variant("pc") or renpy.variant("web"):
vbox:
xpos 40
ypos 40
imagebutton:
idle create_settings_gear_idle(96)
hover create_settings_gear_hover(96)
action ShowMenu()
tooltip "游戏菜单"
## 右上角画廊/日期图标1920 - 96 - 40 = 1784
fixed:
xpos 1784
ypos 40
xysize (96, 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:
xpos 30
ypos 30
imagebutton:
idle create_settings_gear_idle(112)
hover create_settings_gear_hover(112)
action ShowMenu()
## 移动端增大点击区域
xysize (120, 120)
## 移动端右上角画廊/日期图标
fixed:
xpos 1730
ypos 30
xysize (112, 112)
button:
xfill True
yfill True
background create_gallery_page_idle(112)
hover_background create_gallery_page_hover(112)
action ToggleScreen("gallery_panel")
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为持久显示的屏幕
init python:
config.overlay_screens.append("hud_overlay")
################################################################################
## 画廊/日期面板
################################################################################
screen gallery_panel():
zorder 150
modal True
## 全屏半透明背景,点击关闭
button:
xfill True
yfill True
background "#00000066"
action Hide("gallery_panel")
## 右侧侧边栏面板340×1080
frame:
xanchor 1.0
xpos 1920
yanchor 0.0
ypos 0
xysize (340, 1080)
background "#0d0f1ef0"
padding (0, 0, 0, 0)
vbox:
xfill True
spacing 0
## 顶部:日期 + 关闭按钮
frame:
xfill True
ysize 72
background None
padding (24, 0, 40, 0)
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")
################################################################################ ################################################################################
## 标题和游戏菜单屏幕 ## 标题和游戏菜单屏幕
################################################################################ ################################################################################
@@ -819,6 +1475,23 @@ screen preferences():
action Preference("all mute", "toggle") action Preference("all mute", "toggle")
style "mute_all_button" 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 is gui_label
style pref_label_text is gui_label_text style pref_label_text is gui_label_text

View File

@@ -72,6 +72,19 @@ default lzx_stats = {
"infoOpenness": 0, # 信息开放度 "infoOpenness": 0, # 信息开放度
} }
# ====== 时间系统变量 ======
default game_day = 1 # 游戏内日期(第几天)
default game_period = "morning"
# 可选值morning / afternoon / after_school / evening / night
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 # "力学之美"照片解锁标志
# ====== 可选:总字典管理(便于批量操作) ====== # ====== 可选:总字典管理(便于批量操作) ======
''' '''
@@ -113,10 +126,14 @@ transform zoom_to_upper_right:
# 快速放大并向左下偏移(画面看起来往右上移动) # 快速放大并向左下偏移(画面看起来往右上移动)
ease 0.3 zoom 1.7 xalign 0.6 yalign 0.2 ease 0.3 zoom 1.7 xalign 0.6 yalign 0.2
#label before_main_menu:
# $ renpy.music.play("andio/MainMenu.ogg", loop=True, fadein=2.0)
# 游戏在此开始。 # 游戏在此开始。
label start: label start:
# stop music fadeout 1.0
jump Chapter1_Scene1 jump Chapter1_Scene1
# 此处为游戏结尾。 # 此处为游戏结尾。

Binary file not shown.

10
progressive_download.txt Normal file
View File

@@ -0,0 +1,10 @@
# RenPyWeb progressive download rules - first match applies
# '+' = progressive download, '-' = keep in game.zip (default)
# See https://www.renpy.org/doc/html/build.html#classifying-and-ignoring-files for matching
#
# +/- type path
- image game/gui/**
- image game/images/ryt%20normal%20spec.png
+ image game/**
+ music game/audio/**
+ voice game/voice/**

View File

@@ -1,7 +1,9 @@
{ {
"build_update": false, "build_update": false,
"packages": [ "packages": [
"mac" "mac",
"linux",
"win"
], ],
"add_from": true, "add_from": true,
"force_recompile": true, "force_recompile": true,

BIN
web-presplash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB