Skip to content

feat: support textbox themes on say dialogue#950

Open
A-kirami wants to merge 2 commits into
OpenWebGAL:devfrom
A-kirami:feat/textbox-theme-for-say
Open

feat: support textbox themes on say dialogue#950
A-kirami wants to merge 2 commits into
OpenWebGAL:devfrom
A-kirami:feat/textbox-theme-for-say

Conversation

@A-kirami
Copy link
Copy Markdown
Contributor

概要

say 对话增加文本框主题能力,使文本框样式默认跟随说话人,并支持通过 -theme=... 在单句对话上覆盖样式。

改动内容

  • 为 stage state 新增 textboxTheme
  • 提取 resolveDialogDisplayState,集中处理对话显示态解析
  • say 默认根据 speaker 推导文本框主题
  • 支持通过 -theme=... 覆盖当前句的文本框主题
  • clear 默认同时清空显示名和文本框主题
  • 在文本框根节点暴露 data-textbox-theme,供模板样式使用
  • 更新 TextPreview 的 props 以适配新增的主题状态
  • 为对话显示态解析补充测试

使用示例

anon: sometext;
anon: sometext -theme=system;
.TextBox_Container[data-textbox-theme='anon'] .TextBox_Background {
  background: #FF8899;
}

Copy link
Copy Markdown
Contributor

@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

This pull request introduces a textboxTheme property to the stage state, enabling dynamic dialogue box themes based on the speaker or explicit overrides. Key changes include the addition of a resolveDialogDisplayState utility function with unit tests, and updates to the UI components to support the new theme attribute. A review comment suggested simplifying the logic in the new utility function using more idiomatic TypeScript operators.

Comment thread packages/webgal/src/Core/gameScripts/resolveDialogDisplayState.ts Outdated
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