Co-authored-by: osiu97 <osiu97@gmail.com> Reviewed-on: #19
This commit was merged in pull request #19.
This commit is contained in:
@@ -128,6 +128,19 @@ function buildHTML() {
|
||||
<option value="portrait-right">Right Side Test (Portrait)</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-bottom: 12px;">
|
||||
<label class="form-label">Movement Mode</label>
|
||||
<select id="text-mode-select" class="form-input" style="width:100%;">
|
||||
<option value="direct">Direct (Normal)</option>
|
||||
<option value="snaky">Snaky</option>
|
||||
<option value="erratic">Erratic</option>
|
||||
<option value="jumpy">Jumpy</option>
|
||||
<option value="hesitant">Hesitant</option>
|
||||
<option value="overshoot">Overshoot</option>
|
||||
<option value="random">Random</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Settings -->
|
||||
<div style="background: var(--surface-2); padding: 10px; border-radius: var(--radius-sm); margin-bottom: 12px;">
|
||||
@@ -264,9 +277,11 @@ function delay(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
async function executeMove(spot) {
|
||||
async function executeMove(spot, forceDirect = false) {
|
||||
UI.log(`Spelling: ${spot.label}`, 'info');
|
||||
return await Motion.goto(spot.x, spot.y);
|
||||
const modeEl = document.getElementById('text-mode-select');
|
||||
const mode = forceDirect ? 'direct' : (modeEl ? modeEl.value : 'direct');
|
||||
return await Motion.goto(spot.x, spot.y, mode);
|
||||
}
|
||||
|
||||
async function spellText(text) {
|
||||
@@ -298,7 +313,7 @@ async function spellText(text) {
|
||||
const spot = spots.find(s => s.id.toUpperCase() === char);
|
||||
|
||||
if (spot) {
|
||||
await executeMove(spot);
|
||||
await executeMove(spot, i === 0);
|
||||
// Wait for delay
|
||||
await delay(Settings.delay);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user