Triforce v0.9.0

Character tab, faster renderer defaults, HD rumble shipped, and the 11-30 bug pass: ending softlock below 60 fps, adult first-night lock, Intel Arc robust buffers, adult map, randomizer load order.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-30 20:55:14 -06:00
parent 8cb23131f9
commit 822ee913bc
86 changed files with 8128 additions and 438 deletions

View File

@@ -235,9 +235,9 @@ document.addEventListener('pointerdown', e => {
});
/* ---------------- screens ---------------- */
const MAIN = ['home', 'mods', 'rando', 'saves', 'settings'];
const MAIN = ['home', 'mods', 'rando', 'char', 'saves', 'settings'];
const FIRST_RUN = ['welcome', 'reveal', 'done'];
const MUSIC = { welcome: null, reveal: 'saria', work: 'temple', done: 'itemget', home: 'fairy', saves: 'fairy', mods: 'fairy', rando: 'fairy', settings: 'fairy', bench: 'fairy', brun: null, playing: null };
const MUSIC = { welcome: null, reveal: 'saria', work: 'temple', done: 'itemget', home: 'fairy', saves: 'fairy', mods: 'fairy', rando: 'fairy', char: 'fairy', settings: 'fairy', bench: 'fairy', brun: null, playing: null };
let screen = null;
function go(name) {
if (name === screen || !$('#s-' + name)) return;
@@ -256,6 +256,7 @@ function go(name) {
if (name === 'mods' && !S.mods.loaded) cmd('mods.list', { tab: S.mods.tab, q: '' });
if (name === 'saves') cmd('saves.list');
if (name === 'rando') cmd('rando.open');
if (typeof charShown === 'function') charShown(name); // (the Character page: char.js)
cmd('screen', { s: name });
}
function afterOneShot(name) { if (name === 'itemget' && (MUSIC[screen] === 'fairy' || screen === 'done')) music('fairy'); }
@@ -884,6 +885,7 @@ onHost(m => {
if (m.rando && m.rando.schema) S.randoSchema = m.rando.schema; // (OOTRR's settings come once; the rows every time)
if (m.randoMade) S.rtab = 'seeds';
if ((m.rando || m.randoMade) && typeof drawRando === 'function') drawRando();
if (m.char && typeof drawChar === 'function') drawChar();
if (m.done) { $('#doneEb').textContent = S.done.eb || ''; $('#doneLead').textContent = S.done.lead || ''; }
break;
}
@@ -896,6 +898,7 @@ onHost(m => {
case 'choice': openChoice(m); break;
case 'ask': openAsk(m); break;
case 'bench': onBench(m); break;
case 'charLook': case 'charExact': case 'charCal': if (typeof charMessage === 'function') charMessage(m); break;
case 'copy': navigator.clipboard && navigator.clipboard.writeText(m.text).then(() => toast('Copied'), () => toast('Could not copy')); break;
}
});
@@ -906,7 +909,7 @@ document.addEventListener('keydown', e => {
if (document.activeElement && document.activeElement.tagName === 'INPUT' && !['Escape', 'Enter', 'ArrowDown', 'ArrowUp', 'Tab'].includes(e.key)) return;
const k = e.key; let used = true;
const ca = { ArrowLeft: [-1, 0], ArrowRight: [1, 0], ArrowUp: [0, 1], ArrowDown: [0, -1] }[k];
if (ca && colorNudge(ca[0], ca[1])) { } // (the colour picker's square and hue take the arrows first)
if (ca && (colorNudge(ca[0], ca[1]) || (typeof charNudge === 'function' && charNudge(ca[0], ca[1])))) { } // (the colour picker's square and hue take the arrows first)
else if (focused && focused.dataset.vol && (k === 'ArrowLeft' || k === 'ArrowRight')) { setVol(focused.dataset.vol, S.sound[focused.dataset.vol] + (k === 'ArrowLeft' ? -.05 : .05)); sfx('cursor'); }
else if (focused && (focused.dataset.gkey || focused.dataset.rkey) && (k === 'ArrowLeft' || k === 'ArrowRight')) gNudge(k === 'ArrowLeft' ? -1 : 1);
else if (k === 'ArrowLeft') move(-1, 0); else if (k === 'ArrowRight') move(1, 0);
@@ -927,10 +930,11 @@ function pad(t) {
const gp = [...(navigator.getGamepads ? navigator.getGamepads() : [])].find(g => g && g.connected); if (!gp) return;
const B = i => gp.buttons[i] && gp.buttons[i].pressed;
const edge = (i, fn) => { const p = B(i); if (p && !held[i]) { document.body.classList.add('kb'); unlocked = true; fn(); } held[i] = p; };
const slide = d => { if (colorNudge(d, 0)) return true; if (focused && focused.dataset.vol) { setVol(focused.dataset.vol, S.sound[focused.dataset.vol] + d * .05); sfx('cursor'); return true; } return gNudge(d); };
const slide = d => { if (colorNudge(d, 0) || (typeof charNudge === 'function' && charNudge(d, 0))) return true; if (focused && focused.dataset.vol) { setVol(focused.dataset.vol, S.sound[focused.dataset.vol] + d * .05); sfx('cursor'); return true; } return gNudge(d); };
edge(0, () => activate(focused)); edge(1, back); edge(4, () => tab(-1)); edge(5, () => tab(1));
edge(3, toggleMute); edge(9, () => { if (MAIN.includes(screen)) go('settings'); });
edge(12, () => colorNudge(0, 1) || move(0, -1)); edge(13, () => colorNudge(0, -1) || move(0, 1)); edge(14, () => slide(-1) || move(-1, 0)); edge(15, () => slide(1) || move(1, 0));
const cn = (dx, dy) => colorNudge(dx, dy) || (typeof charNudge === 'function' && charNudge(dx, dy));
edge(12, () => cn(0, 1) || move(0, -1)); edge(13, () => cn(0, -1) || move(0, 1)); edge(14, () => slide(-1) || move(-1, 0)); edge(15, () => slide(1) || move(1, 0));
const x = gp.axes[0] || 0, y = gp.axes[1] || 0, dir = Math.abs(x) > .55 ? (x > 0 ? 'r' : 'l') : Math.abs(y) > .55 ? (y > 0 ? 'd' : 'u') : '';
if (dir && (dir !== stickDir || t - stickAt > 220)) {
document.body.classList.add('kb'); stickAt = t + (dir !== stickDir ? 160 : 0);