Back to Faultline
SOURCE / PINNED RELEASE

Made of little things.

Faultline

Release
da1ffaa5624c…
Author-recorded commit
60f5f03189db…
License
LICENSE
Author’s source reference
nostr://npub182jczunncwe0jn6frpqwq3e0qjws7yqqnc3auccqv9nte2dnd63scjm4rf/wss%3A%2F%2Fgit.napplet.soy%2F/n-6932b12c78c

Archive hash verified: 5a2e0492417ec4e7…. The source-to-build association is the author’s claim; it has not been independently rebuilt.

src/napplet-settings.ts
import { config } from '@napplet/sdk';
import { runtimeHasDomain } from './domain-availability.js';
import schema from '../config.schema.json';
import { clamp } from './maps';
export const settings = { sensitivity: 1, scale: 1 };
if (runtimeHasDomain('config')) {
  void (async () => {
    if (!config.schema)
      await config.registerSchema(schema as Parameters<typeof config.registerSchema>[0]);
    const sub = config.subscribe((v) => {
      settings.sensitivity =
        typeof v.lookSensitivity === 'number' ? clamp(v.lookSensitivity, 0.3, 2.5) : 1;
      settings.scale = typeof v.renderScale === 'number' ? clamp(v.renderScale, 0.5, 1) : 1;
      window.dispatchEvent(new Event('gameconfig'));
    });
    window.addEventListener('pagehide', () => sub.close(), { once: true });
  })().catch(() => {
    /* The built-in sensitivity and resolution remain available. */
  });
}