Skip to content

Conversation

HardyNLee
Copy link
Contributor

介绍

  • 完全重新设计 UI,使其适应多分辨率与对触屏友好。
  • applyStyle 已覆盖 99% 的 UI,意味着用户可以几乎完全自定义任何一处 UI 而无需更改源码。
  • 初始化脚本现在是异步的,因为必须等待某些资源完全加载后才能获得正确参数。

Caution

此 PR 包含两个巨大的字体文件,拉取时需耐心等待

主要更改

Apply Style

  • apply style 现已几乎覆盖所有的 UI, 除了 dev panel 和一些必须要用代码设置的地方
  • 所有样式名统一为 snake_case

脚本初始化

脚本初始化函数现在是异步的,并且后一步必须等待前一步完成

翻译

补充了一些缺失的翻译

入场退场动画

现在几乎所有界面都有入场退场动画,包括 intro, choose 等脚本 UI

HTML

  • index.html 现在仅包含 3 个主要元素
    • root
    • launchScreen (开屏画面)
    • panicOverlay 容器
  • ebg 已被完全移除
  • 重新计算尺寸的函数被完全移除,因为现在有更好的方案
  • 自动旋转暂未开启,请自行在 index.scss 取消注释 html 样式下面那一大段
  • index.scss 移动至 index.html 旁边

开屏画面 launch screen

image
  • 用户可以替换 game 目录下的 logo.png 以自定义开屏 logo, 名称和后缀名不能改变, 若没有则回退到 webgal logo

LOGO

Logo 元素已被移除,因为现在已经迁移至 launch screen

Full Screen Perform

Full Screen Perform 元素被移除,子元素全部搬迁至 Stage 元素下

首次选择语言

image
  • 样式改动

标题界面

image
  • 背景图片默认是居中覆盖

文本框

image
  • 大幅调整了元素的嵌套关系
  • 文本框和名称框不再有单独的元素作为背景,而是传入一个 --textbox-background-opacity 变量,用户自行使用 before 或者 background-color: rgba(255, 255, 255, var(--textbox-background-opacity));
  • 移除了文本行数限制
  • 文本框高度会适应超长文字
  • textSize 参数现在不会被继承,不写就回退到设置里的字体大小
  • textSize 现在有样式文件控制,样式名为 .textbox_text_small .textbox_text_small .textbox_text_large
  • 修复了文字显示动画时长未与设置对齐的问题

文本框(电影模式)

image
  • 修复了文字显示动画缺失的问题
  • 文本框高度会适应超长文字
  • textSize 现在有样式文件控制,样式名为 .textbox_film_text_small .textbox_film_text_small .textbox_film_text_large

控制面板

image image image
  • BottomControlPanel 更名为 ControlPanel
  • ControlPanel 从 UI 目录移动到 Stage 目录,从 UI 元素下移动到 Stage 元素下
  • 移除了电影模式的控制面板,现在两种模式共用同一种 UI
  • 控制面板现在分为两部分
    • 常驻栏: 仅显示按钮图标
    • 详细列表: 显示所有按钮,并提供一个钉固按钮,将该按钮加入到常驻栏,被钉固的按钮在列表中靠后显示

选择列表

image
  • 现在选择列表是可滚动的

黑屏文字

image
  • 黑屏文字现默认居中显示
  • textSize 现在有样式文件控制

获取用户输入

image

全局对话框

image
  • yesno 被替换为 confirmcancel,并且 confirm 统一在右边

菜单

设置

image
  • 关于 页面现在是独立的页面

存档读档

image image

鉴赏界面

image image image
  • 现在 cg 和 bgm 可以显示名称与所属系列
  • 可以按系列筛选条目
  • cg 和 bgm 现分开为两个界面
  • 不再为 cg 分页

其他

  • 由于样式名被改变,因此旧有的 UI 模板是无法兼容的
  • 无法被现有的 UI 模板编辑器编辑
  • 样式随时可以改,您可以直接将其修改为合适的风格,不需要在这上面讨论太久,重点实际上是布局,多分辨率适配,竖屏适配和触屏友好
  • 在 edge(chromium), chrome, firefox 上测试正常,safari 没有条件测试
  • 由于功能耦合的比较严重,故合并为一个提交了
  • 暂时没有在 template 目录下安排 UI 模板,过段时间补充
  • 需要大量测试

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @HardyNLee, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求对用户界面进行了全面彻底的重新设计,旨在提升多分辨率兼容性和触屏操作体验。核心目标是提供更灵活的UI定制能力,优化启动流程,并通过引入丰富的动画效果,为用户带来更流畅、更现代的交互感受。

Highlights

  • UI完全重新设计: UI已完全重新设计,以适应多分辨率和触屏友好。
  • 样式自定义能力增强: applyStyle现在覆盖了99%的UI,用户几乎可以完全自定义任何UI而无需更改源码。
  • 异步初始化脚本: 初始化脚本现在是异步的,因为必须等待某些资源完全加载后才能获得正确参数。
  • 界面入场退场动画: 现在几乎所有界面都有入场退场动画,包括intro、choose等脚本UI。
  • index.html简化: index.html现在仅包含3个主要元素:root、launchScreen(开屏画面)和panicOverlay容器,ebg已被完全移除。
  • 控制面板统一: BottomControlPanel更名为ControlPanel,并从UI目录移动到Stage目录,两种模式共用同一种UI,并分为常驻栏和详细列表。
  • 文本框功能优化: 文本框大幅调整了元素的嵌套关系,不再有单独的背景元素,高度会适应超长文字,且textSize参数现在由样式文件控制。
  • 选择列表可滚动: 现在选择列表是可滚动的。
  • 全局对话框按钮统一: 全局对话框的'yes'和'no'被替换为'confirm'和'cancel',并且'confirm'统一在右边。
  • 鉴赏界面功能增强: 鉴赏界面现在cg和bgm可以显示名称与所属系列,可以按系列筛选条目,cg和bgm现分开为两个界面,且不再为cg分页。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

这是一个非常庞大且令人印象深刻的PR,它完全重新设计了UI。新的设计是现代的、响应式的,并且高度可定制。代码经过了大量的重构,带来了更好的结构、可读性和可维护性。关键的改进包括转向基于CSS的响应式布局、异步初始化以及为UI组件引入动画过渡。带有可固定按钮的新控制面板是一个很棒的功能。

我发现了一些需要注意的潜在问题。

if (vocal) {
playVocal(sentence);
} else if (key || pos) {
} else if (key || pos !== undefined) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

这个条件判断似乎有误。pos 被定义为字符串,所以 pos !== undefined 总是为 true。这会导致 key || true 的结果始终为 true,使得 performSimulateVocal() 在没有 vocal 参数时总是被调用,这可能不是预期的行为。之前的逻辑 key || pos 似乎更合理,如果意图是当 key 存在或 pos 不是空字符串时触发,那么 key || pos !== '' 会是更明确和健壮的写法。

Suggested change
} else if (key || pos !== undefined) {
} else if (key || pos !== '') {

Comment on lines 203 to 208
const handleCtrlKeydown = useCallback((e) => {
if (isCtrlKey(e) && isGameActive()) {
startFast();
stopAll();
}
}, []);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

handleCtrlKeydown 的逻辑似乎不正确。当用户按下 Ctrl 键时,应该启动快进模式,但当前代码调用了 stopAll(),这会停止快进。正确的逻辑应该是在 keydown 事件中调用 startFast()

Suggested change
const handleCtrlKeydown = useCallback((e) => {
if (isCtrlKey(e) && isGameActive()) {
startFast();
stopAll();
}
}, []);
const handleCtrlKeydown = useCallback((e) => {
if (isCtrlKey(e) && isGameActive()) {
startFast();
}
}, []);

fix: fast save preview position

fix: save load scss path

fix: minor issue

feat: custom stage resolution

fix: spine stage resolution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant