guide层v1: 全局向导交互层落地(状态签名earcon/turn cue/静默看门狗/纠错) + 6游戏接线 + 8句向导语音 + 测试全绿
- engine/guide.js 运行时合成8个签名earcon(方法论L2硬参数),off档零定时器,插播queue不顶对白 - settings: guide三档(full/standard/off默认full) + 语速2.2视障档;audio: isVoicePlaying()/setRateBoostEnabled() 清两个已知问题 - 6游戏按schemes§2接线: storyline看门狗+无效手势纠错、simon免扣重听看门狗、escape turn cue+提前卡关提示、rhythm gd_answer/gd_miss+结算看门狗+快进豁免、space首撞指令提示+结算看门狗、rpg格挡纠错+60s催促+状态签名 - 大厅设置面板+向导文档(14-guide-layer.md)+00-global-ux §6;R5台词表补4条一致性 - 试玩转写含向导事件;6 playtest(guide=off断言零改动)+guide.test(34断言)+资产终检全绿
This commit is contained in:
+24
-1
@@ -46,7 +46,8 @@
|
||||
*
|
||||
* **长按快进**:voice 播放中长按屏幕(gesture.js 派发的 window 事件
|
||||
* 'soundgame:longpress')→ 旁白临时 1.7 倍速(不变调),松开
|
||||
* ('soundgame:longpressend')恢复 settings.speed。游戏代码零改动。
|
||||
* ('soundgame:longpressend')恢复 settings.speed。游戏代码零改动;
|
||||
* 演奏类阶段可 setRateBoostEnabled(false) 按 game 豁免(见该方法)。
|
||||
*/
|
||||
|
||||
import { settings } from './settings.js';
|
||||
@@ -90,6 +91,7 @@ export class WebAudioEngine {
|
||||
this._bgmWanted = null; // { id, opts } 最近一次 BGM 请求(bgm=0 时只记不播)
|
||||
this._voice = null; // 当前对白 token(SoundTouch 管线,见 _playVoice)
|
||||
this._voiceQueue = []; // queue:true 时的等待队列
|
||||
this._rateBoostEnabled = true; // 长按快进开关(setRateBoostEnabled per-game 控制)
|
||||
|
||||
// 设置变更实时生效
|
||||
settings.subscribe((_, changed) => this._onSettingsChange(changed));
|
||||
@@ -249,6 +251,26 @@ export class WebAudioEngine {
|
||||
this.stopVoice();
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前是否有对白在播(含 queue 排队中的不算,只看正在播的这句)。
|
||||
* 收编各游戏对私有字段 _voice 的只读判定(如"单击是否跳句"的语境判断)。
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isVoicePlaying() {
|
||||
return this._voice !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 长按快进(旁白临时 1.7 倍速)的 per-game 开关,默认开启(保持全局行为)。
|
||||
* rhythm/space 等演奏/对局阶段传入 false 豁免——长按不再触发快进;
|
||||
* 若快进正在生效会立即恢复设置语速。回菜单/结算时传 true 恢复。
|
||||
* @param {boolean} on
|
||||
*/
|
||||
setRateBoostEnabled(on) {
|
||||
this._rateBoostEnabled = on !== false;
|
||||
if (!this._rateBoostEnabled) this._voiceBoost(false); // 已在快进则立即还原
|
||||
}
|
||||
|
||||
// ---------------- 内部实现 ----------------
|
||||
|
||||
/**
|
||||
@@ -449,6 +471,7 @@ export class WebAudioEngine {
|
||||
_voiceBoost(on) {
|
||||
const cur = this._voice;
|
||||
if (!cur || cur.stopped) return;
|
||||
if (on && !this._rateBoostEnabled) return; // per-game 豁免(演奏期不快进)
|
||||
const target = on ? LONGPRESS_BOOST : settings.get().speed;
|
||||
if (cur.st.tempo === target) return;
|
||||
this._updateVoicePos(cur);
|
||||
|
||||
Reference in New Issue
Block a user