Skip to content

Hook:Aokana 同一句被设两次时,第二次也隐藏原文 - #696

Open
Plastic-time wants to merge 5 commits into
ilynthn:mainfrom
Plastic-time:rrfz/unity-same-setter-twin
Open

Plastic-time wants to merge 5 commits into
ilynthn:mainfrom
Plastic-time:rrfz/unity-same-setter-twin

Conversation

@Plastic-time

@Plastic-time Plastic-time commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

问题

Aokana 开着「隐藏游戏原文」,可游戏自己的日文还留在对话框里,MeguLit 的日文又叠在上面,一句话显示两遍。

日志显示,每句台词经 TMP_Text.set_text 设了两次,来自同一个 Hook 的两个上下文:

  • 选中的那个写回了,原文被透明色包住。
  • 大约半秒后,另一个上下文又把原文设了一遍,屏幕上显示的是这一次。

这个上下文两边都没接住:

  • E609 的日文双胞胎排除了同一个 Hook(sel.code!=c.code),注释说交给 ManyUnityContexts。
  • ManyUnityContexts 只在 embed 回调里检查,而这个上下文没开写回,只走 OnOutput,一直被当成 aux。

改动

  • JaTwinHit:选中的 Unity 文本 setter 自己的另一个上下文(code 和 name 相同),重复选中的那句时也算日文双胞胎,第一次重复就打开写回,开头几句也能藏住。别的 Hook 仍要重复两次。
  • Aokana 的打字机上下文每帧都给每个字单独套 <alpha>,外层透明色盖不住。这种帧把字换成空白,标签和 alpha 原样保留。
  • 切换选中流时,赢下切换的那一句也算进双胞胎判断。
  • 「同一句」只认这句本身,或打字机缓冲(每行都是这句的开头,最后一行是整句)。几句并排的 backlog 页不算。写回时一帧必须是整句。
  • E560 的保护对双胞胎同样生效:2 秒内超过两个双胞胎写同一句,就转成覆盖模式。Aokana 正好两个(第二个 setter 和打字机)。
  • HookBridge --self-test 会跑这些规则。

在 Aokana(Steam 版)里实测:从第二句起原文不再出现,打字过程中也藏住,退出确认框等界面文字不受影响。切换流之后的第一句还会显示原文。单独一行的 backlog 或存档预览如果在新句出现 1.5 秒内显示同一句,也会被遮住。

修改前 / 修改后:

修改前

修改后

The same-setter twin now turns on at its first repeat, and repeats are
compared without tags, so grey read lines count. Aokana's typewriter
sets the whole line every frame with a per-character alpha fade; its
buffered frames match row by row, and its frames are blanked with every
tag and alpha kept.
The line that made MeguLit switch to the Aokana stream was not recorded as the
selected line, so its typewriter twin was only recognised from the next line
on, and the second line still showed the original.
A twin now repeats the line itself or a typewriter buffer of it (every
row a start of the line, the last the whole line); a backlog page that
merely holds the line is no twin. One embed frame must be the whole line.

A same-hook context counts at its first repeat only for a Unity text
setter, not any JIT:UNITY hook.

The E560 guard now covers twins: more than two twins writing the shown
line within 2 s go to cover mode, as other contexts of the selected
Unity setter already do. Aokana has two.

HookBridge --self-test runs the twin rules.
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