修复特殊节点反馈并强化跟手缩放和选关标题
This commit is contained in:
@@ -10,7 +10,7 @@ export class Haptics{
|
||||
const fallback=()=>{if(generation!==this.generation||request!==this.request||this.now()-sentAt>FEEDBACK.hapticGapMs||!this.enabled)return;this.graded=false;try{this.api.vibrateShort({fail(){}});}catch{}};
|
||||
try{this.api.vibrateShort(this.graded?{type,fail:fallback}:{fail(){}});}catch{if(this.graded)fallback();}
|
||||
}
|
||||
play(kind){if(!['move','checkpoint','complete'].includes(kind))return;this.pulse(kind==='move'?'light':'medium',kind!=='move');
|
||||
play(kind){if(!['move','undo','checkpoint','complete'].includes(kind))return;this.pulse(kind==='move'||kind==='undo'?'light':'medium',kind!=='move'&&kind!=='undo');
|
||||
if(kind==='complete'&&this.enabled&&this.graded&&!this.preview&&typeof this.api?.vibrateShort==='function'){const generation=this.generation;const timer=this.later(()=>{this.timers.delete(timer);if(generation===this.generation&&this.graded)this.pulse('light',true);},FEEDBACK.completeHapticDelayMs);this.timers.add(timer);}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user