@lewismoten/gamemaker-sandbox-tools 3.1.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/NOTICE.md +105 -3
- package/README.md +301 -15
- package/dist/audio-files.js +82 -0
- package/dist/audio.js +23 -138
- package/dist/block-merge.js +43 -0
- package/dist/color-reduce.js +44 -0
- package/dist/colors.js +87 -0
- package/dist/delta.js +75 -0
- package/dist/disk-diff.js +220 -0
- package/dist/drawing.js +83 -869
- package/dist/embroidery/compile.js +85 -0
- package/dist/embroidery/dst.js +79 -0
- package/dist/embroidery/exp.js +26 -0
- package/dist/embroidery/fill.js +49 -0
- package/dist/embroidery/geom.js +82 -0
- package/dist/embroidery/pes.js +79 -0
- package/dist/embroidery/satin.js +29 -0
- package/dist/embroidery/simulate.js +30 -0
- package/dist/embroidery/strokeFont.js +253 -0
- package/dist/embroidery/svg.js +24 -0
- package/dist/embroidery/types.js +13 -0
- package/dist/embroidery/units.js +26 -0
- package/dist/embroidery/validate.js +15 -0
- package/dist/formats/blocks.js +1 -103
- package/dist/formats/character.js +1 -83
- package/dist/formats/cmf.js +1 -37
- package/dist/formats/fli.js +1 -296
- package/dist/formats/fliLimits.js +1 -54
- package/dist/formats/game.js +1 -193
- package/dist/formats/gif.js +1 -125
- package/dist/formats/graphicScripts.js +1 -44
- package/dist/formats/map.js +1 -38
- package/dist/formats/monster.js +1 -69
- package/dist/formats/palette.js +1 -58
- package/dist/formats/recording.js +1 -17
- package/dist/formats/sound.js +1 -44
- package/dist/formats/voc.js +1 -303
- package/dist/gif-shrink.js +56 -0
- package/dist/image/png.js +42 -0
- package/dist/images.js +81 -43
- package/dist/kit/actors.js +19 -0
- package/dist/kit/align.js +204 -0
- package/dist/kit/blit.js +45 -0
- package/dist/kit/blockRoles.js +97 -0
- package/dist/kit/clips.js +40 -0
- package/dist/kit/coverPaint.js +18 -0
- package/dist/kit/disk.js +76 -0
- package/dist/kit/fadeOut.js +13 -0
- package/dist/kit/fliClips.js +133 -0
- package/dist/kit/fliShrink.js +277 -0
- package/dist/kit/gameSim.js +235 -0
- package/dist/kit/hopBot.js +142 -0
- package/dist/kit/levelGen.js +1423 -0
- package/dist/kit/levelGrid.js +33 -0
- package/dist/kit/levelPicture.js +27 -0
- package/dist/kit/menuVersion.js +19 -0
- package/dist/kit/microText.js +35 -0
- package/dist/kit/mumble.js +74 -0
- package/dist/kit/music.js +8 -0
- package/dist/kit/palRamps.js +32 -0
- package/dist/kit/palette.js +49 -0
- package/dist/kit/pcText.js +72 -0
- package/dist/kit/photo.js +150 -0
- package/dist/kit/pixels.js +79 -0
- package/dist/kit/png.js +40 -0
- package/dist/kit/quantize.js +72 -0
- package/dist/kit/raytrace.js +379 -0
- package/dist/kit/recordedDemo.js +10 -0
- package/dist/kit/reel.js +77 -0
- package/dist/kit/road3d.js +67 -0
- package/dist/kit/routeChecks.js +8 -0
- package/dist/kit/saveSlots.js +11 -0
- package/dist/kit/sceneInit.js +13 -0
- package/dist/kit/sceneSim.js +112 -0
- package/dist/kit/screenText.js +15 -0
- package/dist/kit/sdftext.js +237 -0
- package/dist/kit/shading.js +69 -0
- package/dist/kit/song.js +251 -0
- package/dist/kit/songFx.js +179 -0
- package/dist/kit/sound.js +52 -0
- package/dist/kit/synthParts.js +20 -0
- package/dist/kit/tar.js +53 -0
- package/dist/kit/textBounds.js +84 -0
- package/dist/kit/textfit.js +246 -0
- package/dist/kit/transforms.js +57 -0
- package/dist/kit/tune.js +21 -0
- package/dist/look-alike.js +50 -0
- package/dist/menu-version.js +4 -0
- package/dist/mesh/colorBodies.js +137 -0
- package/dist/mesh/decimate.js +207 -0
- package/dist/mesh/meshCheck.js +51 -0
- package/dist/mesh/overhang.js +41 -0
- package/dist/mesh/sampledField.js +12 -0
- package/dist/mesh/stl.js +36 -0
- package/dist/mesh/surfaceNets.js +79 -0
- package/dist/mesh/tetraMesh.js +62 -0
- package/dist/mesh/threeMf.js +58 -0
- package/dist/mesh/zipFile.js +52 -0
- package/dist/microFont.js +101 -0
- package/dist/music/compose.js +72 -0
- package/dist/pack/meshPack.js +198 -0
- package/dist/pack/threeMfPack.js +92 -0
- package/dist/palette-reserve.js +116 -0
- package/dist/palettes.js +138 -0
- package/dist/release-notes.js +40 -0
- package/dist/simulation.js +16 -2774
- package/dist/text.js +74 -0
- package/dist/types/audio.d.ts +4 -0
- package/dist/types/audioFiles.d.ts +22 -0
- package/dist/types/audioWav.d.ts +4 -0
- package/dist/types/blockMerge.d.ts +24 -0
- package/dist/types/colorReduce.d.ts +23 -0
- package/dist/types/{web/packages/tools/src/colors.d.ts → colors.d.ts} +6 -0
- package/dist/types/delta.d.ts +32 -0
- package/dist/types/diskDiff.d.ts +47 -0
- package/dist/types/drawing.d.ts +15 -0
- package/dist/types/embroidery/compile.d.ts +3 -0
- package/dist/types/embroidery/dst.d.ts +13 -0
- package/dist/types/embroidery/exp.d.ts +8 -0
- package/dist/types/embroidery/fill.d.ts +6 -0
- package/dist/types/embroidery/geom.d.ts +19 -0
- package/dist/types/embroidery/pes.d.ts +10 -0
- package/dist/types/embroidery/satin.d.ts +11 -0
- package/dist/types/embroidery/simulate.d.ts +19 -0
- package/dist/types/embroidery/strokeFont.d.ts +20 -0
- package/dist/types/embroidery/svg.d.ts +3 -0
- package/dist/types/embroidery/types.d.ts +70 -0
- package/dist/types/embroidery/units.d.ts +10 -0
- package/dist/types/embroidery/validate.d.ts +22 -0
- package/dist/types/formats/blocks.d.ts +1 -0
- package/dist/types/formats/character.d.ts +1 -0
- package/dist/types/formats/cmf.d.ts +1 -0
- package/dist/types/formats/fli.d.ts +1 -0
- package/dist/types/formats/fliLimits.d.ts +1 -0
- package/dist/types/formats/game.d.ts +1 -0
- package/dist/types/formats/gif.d.ts +1 -0
- package/dist/types/formats/graphicScripts.d.ts +1 -0
- package/dist/types/formats/map.d.ts +1 -0
- package/dist/types/formats/monster.d.ts +1 -0
- package/dist/types/formats/palette.d.ts +1 -0
- package/dist/types/formats/recording.d.ts +1 -0
- package/dist/types/formats/sound.d.ts +1 -0
- package/dist/types/formats/voc.d.ts +1 -0
- package/dist/types/gifShrink.d.ts +8 -0
- package/dist/types/image/animatedGif.d.ts +9 -0
- package/dist/types/image/surface.d.ts +26 -0
- package/dist/types/images.d.ts +13 -0
- package/dist/types/kit/actors.d.ts +7 -0
- package/dist/types/kit/align.d.ts +93 -0
- package/dist/types/kit/audioEvents.d.ts +26 -0
- package/dist/types/kit/blit.d.ts +20 -0
- package/dist/types/kit/blockRoles.d.ts +243 -0
- package/dist/types/{games/kit → kit}/clips.d.ts +1 -1
- package/dist/types/kit/coverPaint.d.ts +7 -0
- package/dist/types/kit/disk.d.ts +15 -0
- package/dist/types/kit/fadeOut.d.ts +12 -0
- package/dist/types/kit/fliClips.d.ts +32 -0
- package/dist/types/kit/fliShrink.d.ts +149 -0
- package/dist/types/{games/kit → kit}/gameSim.d.ts +9 -5
- package/dist/types/kit/hopBot.d.ts +72 -0
- package/dist/types/kit/laserClearance.d.ts +16 -0
- package/dist/types/kit/laserJoints.d.ts +39 -0
- package/dist/types/kit/laserLayout.d.ts +54 -0
- package/dist/types/kit/laserPixels.d.ts +52 -0
- package/dist/types/kit/laserPreview.d.ts +9 -0
- package/dist/types/kit/laserSvg.d.ts +35 -0
- package/dist/types/kit/levelGen/castle.d.ts +17 -0
- package/dist/types/kit/levelGen/dungeon.d.ts +11 -0
- package/dist/types/kit/levelGen/forest.d.ts +17 -0
- package/dist/types/kit/levelGen/furnish.d.ts +31 -0
- package/dist/types/kit/levelGen/grid.d.ts +46 -0
- package/dist/types/kit/levelGen/index.d.ts +138 -0
- package/dist/types/kit/levelGen/interior.d.ts +18 -0
- package/dist/types/kit/levelGen/jumpModel.d.ts +78 -0
- package/dist/types/kit/levelGen/needs.d.ts +44 -0
- package/dist/types/kit/levelGen/overworld.d.ts +21 -0
- package/dist/types/kit/levelGen/platform.d.ts +59 -0
- package/dist/types/kit/levelGen/platformCap.d.ts +13 -0
- package/dist/types/kit/levelGen/platformReach.d.ts +37 -0
- package/dist/types/kit/levelGen/props.d.ts +37 -0
- package/dist/types/kit/levelGen/town.d.ts +24 -0
- package/dist/types/kit/levelGrid.d.ts +16 -0
- package/dist/types/kit/levelPicture.d.ts +9 -0
- package/dist/types/kit/menuVersion.d.ts +7 -0
- package/dist/types/kit/microText.d.ts +18 -0
- package/dist/types/kit/mumble.d.ts +41 -0
- package/dist/types/kit/music.d.ts +1 -0
- package/dist/types/kit/palMerge.d.ts +10 -0
- package/dist/types/kit/palRamps.d.ts +28 -0
- package/dist/types/kit/pcText.d.ts +19 -0
- package/dist/types/kit/photo.d.ts +69 -0
- package/dist/types/kit/png.d.ts +7 -0
- package/dist/types/kit/quantize.d.ts +20 -0
- package/dist/types/kit/raytrace.d.ts +169 -0
- package/dist/types/kit/recordedDemo.d.ts +1 -0
- package/dist/types/kit/road3d.d.ts +71 -0
- package/dist/types/kit/routeChecks.d.ts +6 -0
- package/dist/types/kit/saveSlots.d.ts +17 -0
- package/dist/types/kit/sceneInit.d.ts +11 -0
- package/dist/types/{games/kit → kit}/sceneSim.d.ts +5 -5
- package/dist/types/kit/screenText.d.ts +3 -0
- package/dist/types/kit/sdftext.d.ts +34 -0
- package/dist/types/kit/shading.d.ts +23 -0
- package/dist/types/kit/shareBlocks.d.ts +20 -0
- package/dist/types/kit/song.d.ts +89 -0
- package/dist/types/kit/songFx.d.ts +99 -0
- package/dist/types/kit/synthParts.d.ts +7 -0
- package/dist/types/kit/tar.d.ts +13 -0
- package/dist/types/kit/textfit.d.ts +74 -0
- package/dist/types/kit/transforms.d.ts +8 -0
- package/dist/types/lookAlike.d.ts +31 -0
- package/dist/types/menuVersionEntry.d.ts +1 -0
- package/dist/types/mesh/colorBodies.d.ts +18 -0
- package/dist/types/mesh/decimate.d.ts +10 -0
- package/dist/types/mesh/fieldTrinket.d.ts +40 -0
- package/dist/types/mesh/figureShapes.d.ts +24 -0
- package/dist/types/mesh/mesh.d.ts +9 -0
- package/dist/types/mesh/meshCheck.d.ts +22 -0
- package/dist/types/mesh/overhang.d.ts +24 -0
- package/dist/types/mesh/pixelFigure.d.ts +41 -0
- package/dist/types/mesh/sampledField.d.ts +3 -0
- package/dist/types/mesh/sdfShapes.d.ts +20 -0
- package/dist/types/mesh/stl.d.ts +9 -0
- package/dist/types/mesh/strokeText.d.ts +8 -0
- package/dist/types/mesh/surfaceNets.d.ts +14 -0
- package/dist/types/mesh/tetraMesh.d.ts +4 -0
- package/dist/types/mesh/threeMf.d.ts +12 -0
- package/dist/types/mesh/trinketKinds.d.ts +72 -0
- package/dist/types/mesh/trinketTool.d.ts +26 -0
- package/dist/types/mesh/voxel.d.ts +10 -0
- package/dist/types/mesh/zipFile.d.ts +13 -0
- package/dist/types/microFont.d.ts +6 -0
- package/dist/types/pack/meshPack.d.ts +26 -0
- package/dist/types/pack/threeMfPack.d.ts +11 -0
- package/dist/types/palettePresetData.d.ts +4 -0
- package/dist/types/palettePresets.d.ts +12 -0
- package/dist/types/paletteReserve.d.ts +52 -0
- package/dist/types/palettes.d.ts +4 -0
- package/dist/types/releaseNotes.d.ts +3 -0
- package/dist/types/simulation.d.ts +6 -0
- package/dist/types/{web/packages/tools/src/text.d.ts → text.d.ts} +6 -6
- package/package.json +145 -15
- package/dist/binary-D7wuaC5g.js +0 -120
- package/dist/pixels-DzfIIUOl.js +0 -76
- package/dist/types/games/kit/blit.d.ts +0 -10
- package/dist/types/games/kit/music.d.ts +0 -1
- package/dist/types/games/kit/pcText.d.ts +0 -8
- package/dist/types/games/kit/shading.d.ts +0 -11
- package/dist/types/web/packages/tools/src/audio.d.ts +0 -3
- package/dist/types/web/packages/tools/src/drawing.d.ts +0 -10
- package/dist/types/web/packages/tools/src/images.d.ts +0 -2
- package/dist/types/web/packages/tools/src/microFont.d.ts +0 -1
- package/dist/types/web/packages/tools/src/simulation.d.ts +0 -3
- package/dist/types/web/scripts/cdGames.d.ts +0 -103
- package/dist/types/web/scripts/gameShots.d.ts +0 -12
- package/dist/types/web/scripts/ogImage.d.ts +0 -21
- package/dist/types/web/src/audio/cmfLoad.d.ts +0 -7
- package/dist/types/web/src/audio/cmfPlayer.d.ts +0 -69
- package/dist/types/web/src/audio/context.d.ts +0 -12
- package/dist/types/web/src/audio/engine.d.ts +0 -39
- package/dist/types/web/src/audio/music.worklet.d.ts +0 -14
- package/dist/types/web/src/audio/opl.d.ts +0 -37
- package/dist/types/web/src/audio/output.d.ts +0 -13
- package/dist/types/web/src/desk/boxes/boxFacts.d.ts +0 -85
- package/dist/types/web/src/dosPlayer/fileExtensions.d.ts +0 -44
- package/dist/types/web/src/dosPlayer/patchRules.d.ts +0 -24
- package/dist/types/web/src/dosPlayer/patchTable.d.ts +0 -80
- package/dist/types/web/src/edition.d.ts +0 -6
- package/dist/types/web/src/eggs/eggState.d.ts +0 -26
- package/dist/types/web/src/eggs/eggs.d.ts +0 -31
- package/dist/types/web/src/engine/character.d.ts +0 -30
- package/dist/types/web/src/engine/funcKeys.d.ts +0 -33
- package/dist/types/web/src/engine/game.d.ts +0 -52
- package/dist/types/web/src/engine/keys.d.ts +0 -17
- package/dist/types/web/src/engine/machine.d.ts +0 -99
- package/dist/types/web/src/engine/menus.d.ts +0 -46
- package/dist/types/web/src/engine/monsters.d.ts +0 -19
- package/dist/types/web/src/engine/playGain.d.ts +0 -11
- package/dist/types/web/src/engine/playerLook.d.ts +0 -26
- package/dist/types/web/src/engine/recorder.d.ts +0 -60
- package/dist/types/web/src/engine/render.d.ts +0 -8
- package/dist/types/web/src/engine/scene.d.ts +0 -156
- package/dist/types/web/src/engine/scroll.d.ts +0 -16
- package/dist/types/web/src/engine/showGraphic.d.ts +0 -39
- package/dist/types/web/src/engine/slowPc.d.ts +0 -62
- package/dist/types/web/src/engine/touch.d.ts +0 -33
- package/dist/types/web/src/engine/world.d.ts +0 -215
- package/dist/types/web/src/export/gameAbout.d.ts +0 -15
- package/dist/types/web/src/formats/binary.d.ts +0 -44
- package/dist/types/web/src/formats/blocks.d.ts +0 -52
- package/dist/types/web/src/formats/character.d.ts +0 -65
- package/dist/types/web/src/formats/cmf.d.ts +0 -33
- package/dist/types/web/src/formats/fli.d.ts +0 -45
- package/dist/types/web/src/formats/fliLimits.d.ts +0 -13
- package/dist/types/web/src/formats/game.d.ts +0 -72
- package/dist/types/web/src/formats/gif.d.ts +0 -15
- package/dist/types/web/src/formats/graphicScripts.d.ts +0 -18
- package/dist/types/web/src/formats/highscore.d.ts +0 -10
- package/dist/types/web/src/formats/map.d.ts +0 -24
- package/dist/types/web/src/formats/monster.d.ts +0 -48
- package/dist/types/web/src/formats/palette.d.ts +0 -15
- package/dist/types/web/src/formats/recording.d.ts +0 -7
- package/dist/types/web/src/formats/sound.d.ts +0 -13
- package/dist/types/web/src/formats/voc.d.ts +0 -13
- package/dist/types/web/src/gfx/cp437Glyphs.d.ts +0 -2
- package/dist/types/web/src/gfx/font8x8.d.ts +0 -2
- package/dist/types/web/src/gfx/levelPicture.d.ts +0 -81
- package/dist/types/web/src/gfx/screen.d.ts +0 -46
- package/dist/types/web/src/gfx/titlePicture.d.ts +0 -21
- package/dist/types/web/src/input/chords.d.ts +0 -22
- package/dist/types/web/src/input/deskMouse.d.ts +0 -14
- package/dist/types/web/src/input/keyboard.d.ts +0 -39
- package/dist/types/web/src/input/scancodes.d.ts +0 -3
- package/dist/types/web/src/manual/printables/types.d.ts +0 -277
- package/dist/types/web/src/project/bizarre.d.ts +0 -28
- package/dist/types/web/src/project/companion.d.ts +0 -35
- package/dist/types/web/src/project/diskFacts.d.ts +0 -30
- package/dist/types/web/src/project/files.d.ts +0 -124
- package/dist/types/web/src/project/gameFiles.d.ts +0 -49
- package/dist/types/web/src/project/gamePack.d.ts +0 -17
- package/dist/types/web/src/project/health.d.ts +0 -30
- package/dist/types/web/src/project/secretGames.d.ts +0 -19
- package/dist/types/web/src/project/storage.d.ts +0 -46
- package/dist/types/web/src/project/streamGame.d.ts +0 -38
- package/dist/types/web/src/project/zip.d.ts +0 -33
- package/dist/types/web/src/retro/dos/disks.d.ts +0 -33
- package/dist/types/web/src/retro/text/cp437.d.ts +0 -4
- package/dist/types/web/src/seededRandom.d.ts +0 -6
- package/dist/types/web/src/tinHearts/deskHearts.d.ts +0 -33
- package/dist/types/web/src/tinHearts/manifest.d.ts +0 -30
- package/dist/types/web/src/tinHearts/tinHearts.d.ts +0 -84
- package/dist/types/web/src/walkthrough/format.d.ts +0 -92
- package/dist/types/web/src/walkthrough/madeUpScores.d.ts +0 -6
- package/dist/types/web/src/walkthrough/runtime.d.ts +0 -134
- /package/dist/types/{web/src/assistant → image}/png.d.ts +0 -0
- /package/dist/types/{games/kit → kit}/palette.d.ts +0 -0
- /package/dist/types/{games/kit → kit}/pixels.d.ts +0 -0
- /package/dist/types/{games/kit → kit}/reel.d.ts +0 -0
- /package/dist/types/{games/kit → kit}/sound.d.ts +0 -0
- /package/dist/types/{games/kit → kit}/textBounds.d.ts +0 -0
- /package/dist/types/{games/kit → kit}/tune.d.ts +0 -0
- /package/dist/types/{web/src/audio → music}/compose.d.ts +0 -0
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { type GameFiles } from './files.js';
|
|
2
|
-
declare const COMPANION_FORMAT = "gamemaker-companion";
|
|
3
|
-
/** One game file's extras: section name -> whatever its editor keeps there. */
|
|
4
|
-
type FileExtras = Record<string, unknown>;
|
|
5
|
-
export interface Companion {
|
|
6
|
-
format: typeof COMPANION_FORMAT;
|
|
7
|
-
version: number;
|
|
8
|
-
files: Record<string, FileExtras>;
|
|
9
|
-
/** Anything else a newer version wrote. */
|
|
10
|
-
[key: string]: unknown;
|
|
11
|
-
}
|
|
12
|
-
export declare function emptyCompanion(): Companion;
|
|
13
|
-
/** A companion from JSON text, bytes or an object; an empty one when it is not one. Unknown keys stay. */
|
|
14
|
-
export declare function parseCompanion(src: unknown): Companion;
|
|
15
|
-
/** Pretty JSON bytes, for the backup zip. */
|
|
16
|
-
export declare function serializeCompanion(c: Companion): Uint8Array;
|
|
17
|
-
/** True when it holds nothing worth keeping. */
|
|
18
|
-
export declare function isEmptyCompanion(c: Companion | undefined): boolean;
|
|
19
|
-
/** One section of a file's extras (e.g. the terrains of forest.bbl), or `fallback`. */
|
|
20
|
-
export declare function getSection<T>(c: Companion, file: string, section: string, fallback: T): T;
|
|
21
|
-
/** Sets (or, with undefined, removes) one section of a file's extras, in place. */
|
|
22
|
-
export declare function setSection(c: Companion, file: string, section: string, value: unknown): void;
|
|
23
|
-
/** A game file was renamed: its extras follow it. */
|
|
24
|
-
export declare function renameInCompanion(c: Companion, from: string, to: string): void;
|
|
25
|
-
/**
|
|
26
|
-
* Takes companion files (.gmx) out of imported files and returns what they held, merged
|
|
27
|
-
* (undefined when there were none). The game's own files are left as they were.
|
|
28
|
-
*/
|
|
29
|
-
export declare function takeCompanion(files: GameFiles): Companion | undefined;
|
|
30
|
-
/** The entries of a "Game files (.zip)" backup: every file, plus the companion when it holds anything. */
|
|
31
|
-
export declare function backupEntries(files: GameFiles, gam: string, companion?: Companion): {
|
|
32
|
-
name: string;
|
|
33
|
-
data: Uint8Array;
|
|
34
|
-
}[];
|
|
35
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { CatalogEntry } from './files.js';
|
|
2
|
-
/** The DOS player, renamed for each game (retro/computer/drives.ts gives it this size too). */
|
|
3
|
-
export declare const PLAYER_EXE_BYTES = 160598;
|
|
4
|
-
/** Bytes the DOS release adds to the game's files: the player .EXE, sound driver, CONFIG.BAT, README. */
|
|
5
|
-
export declare const DOS_EXTRA_BYTES: number;
|
|
6
|
-
type Sized = Pick<CatalogEntry, 'bytes' | 'original' | 'exe'>;
|
|
7
|
-
/** Bytes the game takes on the hard disk once installed (or unzipped). */
|
|
8
|
-
export declare function installedBytes(g: Sized): number;
|
|
9
|
-
/** How many 3½" 1.44 MB disks the game ships on. Every disk count shown anywhere comes from here. */
|
|
10
|
-
export declare function gameDisks(g: Sized): number;
|
|
11
|
-
export declare function disksLine(n: number): string;
|
|
12
|
-
/** A size as a 1995 catalog printed it: "812K" up to a megabyte, then "1.8 MB" (rounded up: it's what you need free). */
|
|
13
|
-
export declare function sizeText(bytes: number, space?: boolean): string;
|
|
14
|
-
export declare function hardDiskLine(g: Sized): string;
|
|
15
|
-
/** "One 3½" 1.44 MB disk · 1.8 MB on hard disk": what a catalog says about a game's size. */
|
|
16
|
-
export declare function storageLine(g: Sized): string;
|
|
17
|
-
export declare const zipName: (g: Pick<CatalogEntry, "exe" | "id">) => string;
|
|
18
|
-
/** The ZIP's size on a BBS: the game's files (their real pack size when the build measured it), the release's extras, FILE_ID.DIZ and the ZIP's own headers. */
|
|
19
|
-
export declare function zipBytes(g: Pick<CatalogEntry, 'bytes' | 'original' | 'exe' | 'files' | 'sizes' | 'packBytes' | 'id'>): number;
|
|
20
|
-
/** Characters a second Zmodem moves: 2400 bps (no compression), 14,400 with V.42bis (ZIPs don't shrink further, but the start and stop bits go). */
|
|
21
|
-
declare const MODEM_CPS: {
|
|
22
|
-
readonly 2400: 230;
|
|
23
|
-
readonly 14400: 1650;
|
|
24
|
-
};
|
|
25
|
-
export declare function transferMinutes(bytes: number, bps: keyof typeof MODEM_CPS): number;
|
|
26
|
-
/** "57 min", "2 hr 5 min". */
|
|
27
|
-
export declare function minutesText(min: number): string;
|
|
28
|
-
/** "57 min at 2400 · 8 min at 14.4k" */
|
|
29
|
-
export declare function downloadLine(bytes: number, sep?: string): string;
|
|
30
|
-
export {};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { GameFiles } from './gameFiles.js';
|
|
2
|
-
export { GameFiles, cdName, normalize, IGNORED_FILE, type FileStream } from './gameFiles.js';
|
|
3
|
-
import type { OriginalExtras } from '../../scripts/cdGames.js';
|
|
4
|
-
import type { Issue } from './health.js';
|
|
5
|
-
import type { BoxGame } from '../desk/boxes/boxFacts.js';
|
|
6
|
-
export interface CatalogEntry {
|
|
7
|
-
id: string;
|
|
8
|
-
title: string;
|
|
9
|
-
/** gameware: free samples that came with Game-Maker; shareware: play only. */
|
|
10
|
-
kind: 'gameware' | 'shareware';
|
|
11
|
-
/** Folder of the game's files, relative to the site root. */
|
|
12
|
-
path: string;
|
|
13
|
-
/** Shareware: the author's notice and registration details. */
|
|
14
|
-
notice?: string;
|
|
15
|
-
/** Shareware: CRC-32 of the .gam file. */
|
|
16
|
-
gamCrc?: number;
|
|
17
|
-
/** Total size of the game's files. */
|
|
18
|
-
bytes?: number;
|
|
19
|
-
/** Shareware: its DOS program name, e.g. ORB.EXE (shown, never served). */
|
|
20
|
-
exe?: string;
|
|
21
|
-
/** A few lines from the game's story or instructions. */
|
|
22
|
-
blurb?: string;
|
|
23
|
-
/** Credits, from the game's own screens or Wikipedia. */
|
|
24
|
-
author?: string;
|
|
25
|
-
company?: string;
|
|
26
|
-
year?: number;
|
|
27
|
-
/** Registration price as its author stated it ("Freeware" for free games). */
|
|
28
|
-
price?: string;
|
|
29
|
-
gam: string | null;
|
|
30
|
-
files: string[];
|
|
31
|
-
/** Size of each file in `files`, in bytes (missing from older catalogs). */
|
|
32
|
-
sizes?: number[];
|
|
33
|
-
/** Original games made for this project: label, box art, manual, sound card. */
|
|
34
|
-
original?: OriginalExtras;
|
|
35
|
-
/** Original games: a series of their own ("bizarre": The Bard of Bizarre's, see bizarre.ts). */
|
|
36
|
-
series?: string;
|
|
37
|
-
/** Built sites: every file but the .gif pictures has a gzip copy beside it (<file>.gz, see packedUrl). */
|
|
38
|
-
gz?: boolean;
|
|
39
|
-
/** Built sites: all its files in one gzipped file in its folder (project/gamePack.ts, openPack), named with a hash of its content. */
|
|
40
|
-
pack?: string;
|
|
41
|
-
/** Built sites: the size of its pack in bytes. */
|
|
42
|
-
packBytes?: number;
|
|
43
|
-
/** Built sites: what the quick check (project/health.ts) finds in it, so no file need be fetched to know. */
|
|
44
|
-
health?: Issue[];
|
|
45
|
-
/** Built sites, games with a box: its level count and screenshot captions from the .gam (desk/boxes/boxFacts.ts boxGame). */
|
|
46
|
-
boxGame?: BoxGame;
|
|
47
|
-
/** From games/catalog.json: its notice, manual and printables are in games/details/<id>.json (withDetails). */
|
|
48
|
-
details?: boolean; /** Original games: the site path of its walkthrough (src/walkthrough), when it has one. */
|
|
49
|
-
walkthrough?: string;
|
|
50
|
-
/** Original games: its DOS player look (games/<id>/player.json, dosPlayer/catalogPatches.ts). */
|
|
51
|
-
player?: unknown;
|
|
52
|
-
/** Built sites: its pictures are drawn already (games/shots/, gfx/levelPicture.ts builtShotPath). */
|
|
53
|
-
shots?: boolean;
|
|
54
|
-
/** …and its hero (games/shots/<id>-hero.png, gfx/levelPicture.ts builtHeroPath). */
|
|
55
|
-
heroShot?: boolean;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* A Sandbox Software game: one of ours, with its box, disk and manual. Other games built in
|
|
59
|
-
* ../games under another publisher's name (a BBS download such as The Bard of Bizarre's)
|
|
60
|
-
* are listed with the shareware instead.
|
|
61
|
-
*/
|
|
62
|
-
export declare function isSandboxGame(g: Pick<CatalogEntry, 'original' | 'company'>): boolean;
|
|
63
|
-
/** Forgets the fetched catalogs, so the next load lists what is current (a secret game revealed). */
|
|
64
|
-
export declare function forgetCatalog(): void;
|
|
65
|
-
/**
|
|
66
|
-
* The games catalog (games/index.json, about 300 kB). Many parts of the page ask for it;
|
|
67
|
-
* it is fetched once and shared. A failed fetch is forgotten so a later call retries.
|
|
68
|
-
*/
|
|
69
|
-
export declare function loadCatalog(base?: string): Promise<CatalogEntry[]>;
|
|
70
|
-
/**
|
|
71
|
-
* The games without their shareware notices, manuals and printables (games/catalog.json,
|
|
72
|
-
* an eighth of index.json): for a page that only needs the list, such as the play page.
|
|
73
|
-
* The full catalog when it is loaded already, or there is no short one.
|
|
74
|
-
*/
|
|
75
|
-
export declare function loadCatalogList(base?: string): Promise<CatalogEntry[]>;
|
|
76
|
-
/**
|
|
77
|
-
* The list the home page, the shelf and the disk box draw from: games/catalog.json (a quarter
|
|
78
|
-
* of index.json; manuals hold only their title until withDetails). The development server
|
|
79
|
-
* hands out the full catalog instead: it serves catalog.json from whatever scripts/cdGames.ts
|
|
80
|
-
* it was started with, which may be older than this page.
|
|
81
|
-
*/
|
|
82
|
-
export declare function loadGameList(base?: string): Promise<CatalogEntry[]>;
|
|
83
|
-
/** An entry with its shareware notice, manual and printables (games/details/<id>.json), for one from loadCatalogList. */
|
|
84
|
-
export declare function withDetails(entry: CatalogEntry, base?: string): Promise<CatalogEntry>;
|
|
85
|
-
/**
|
|
86
|
-
* Bytes of one file at a site-relative URL (e.g. games/gameware/sample/sample.gam), fetched once. Shared: do not modify them.
|
|
87
|
-
* `gz`: the file has a gzip copy beside it (a catalog entry's `gz`).
|
|
88
|
-
*/
|
|
89
|
-
export declare function fetchSiteFile(url: string, gz?: boolean): Promise<Uint8Array | undefined>;
|
|
90
|
-
/** A game's pack being read: its files so far, and each one as it comes (see openPack). */
|
|
91
|
-
export interface PackHandle {
|
|
92
|
-
files: ReadonlyMap<string, Uint8Array>;
|
|
93
|
-
/** true once every file is in; false when the pack failed (or was stopped): fetch what is missing on its own. */
|
|
94
|
-
done: Promise<boolean>;
|
|
95
|
-
/** No longer needed: stops the download when nobody else is reading it. */
|
|
96
|
-
stop(): void;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Starts reading a hosted game's pack (or joins the reading of it already going on), or
|
|
100
|
-
* undefined when it has none. `onFile` hears of each file in it: those in already at once,
|
|
101
|
-
* then the rest as they arrive, in pack order (play order, streamGame.ts packOrder). Shared:
|
|
102
|
-
* do not modify the files.
|
|
103
|
-
*/
|
|
104
|
-
export declare function openPack(entry: Pick<CatalogEntry, 'path' | 'pack'>, base?: string, onFile?: (name: string, bytes: Uint8Array) => void): PackHandle | undefined;
|
|
105
|
-
/**
|
|
106
|
-
* Starts reading a game's whole pack (when it has one), so the many files that are about to
|
|
107
|
-
* be read one by one (a box's paper, a manual's pictures) come in one request instead.
|
|
108
|
-
*/
|
|
109
|
-
export declare function warmPack(entry: Pick<CatalogEntry, 'path' | 'pack'>, base?: string): void;
|
|
110
|
-
/**
|
|
111
|
-
* One file of a hosted game, by the name a game uses for it (A-J.BKD finds the CD's
|
|
112
|
-
* a_j.bkd); undefined when the game has no such file or it could not be fetched. From the
|
|
113
|
-
* game's pack when that is here already (played, opened, or kept offline), else on its own.
|
|
114
|
-
*/
|
|
115
|
-
export declare function fetchGameFile(entry: Pick<CatalogEntry, 'path' | 'files' | 'gz' | 'pack'>, name: string, base?: string): Promise<Uint8Array | undefined>;
|
|
116
|
-
/**
|
|
117
|
-
* Every file of a hosted game (copies, to change freely): its pack, in one request, when it
|
|
118
|
-
* has one; files the pack did not bring (an older site, a failed download) one by one.
|
|
119
|
-
*/
|
|
120
|
-
export declare function loadHostedGame(entry: CatalogEntry, base?: string, onProgress?: (done: number, total: number) => void): Promise<GameFiles>;
|
|
121
|
-
/** Loads files picked with <input type=file multiple> or webkitdirectory, or dropped. */
|
|
122
|
-
export declare function loadFileList(list: Iterable<File>): Promise<GameFiles>;
|
|
123
|
-
/** "Eric-Jon Waugh · A-J Games · 1993" */
|
|
124
|
-
export declare function creditLine(g: Pick<CatalogEntry, 'author' | 'company' | 'year'>): string;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/** Files of a game still on their way from the site (project/streamGame.ts). */
|
|
2
|
-
export interface FileStream {
|
|
3
|
-
/** Resolves once these files are in, or known not to come; undefined when none is still coming. */
|
|
4
|
-
need(names: string[]): Promise<void> | undefined;
|
|
5
|
-
/** Fetches these next, without waiting for them. */
|
|
6
|
-
want(names: string[]): void;
|
|
7
|
-
}
|
|
8
|
-
export declare class GameFiles {
|
|
9
|
-
private files;
|
|
10
|
-
/** Notified after any change. */
|
|
11
|
-
onChange?: (name: string) => void;
|
|
12
|
-
/** Set while files are still arriving: the game waits for one it needs (engine/machine.ts, need). */
|
|
13
|
-
stream?: FileStream;
|
|
14
|
-
/** Asked before set or delete changes a file; throws to refuse (a game opened to look inside, editor/core/readOnly.ts). */
|
|
15
|
-
guard?: (name: string) => void;
|
|
16
|
-
constructor(entries?: Iterable<[string, Uint8Array]>);
|
|
17
|
-
get(name: string | undefined): Uint8Array | undefined;
|
|
18
|
-
has(name: string | undefined): boolean;
|
|
19
|
-
/** The stored name a reference opens (see cdName), or undefined when there is none. */
|
|
20
|
-
resolve(name: string | undefined): string | undefined;
|
|
21
|
-
set(name: string, bytes: Uint8Array): void;
|
|
22
|
-
/**
|
|
23
|
-
* A copy of these files to change freely. While files are still arriving here, the copy
|
|
24
|
-
* gets them too as it needs them (its own changes stay).
|
|
25
|
-
*/
|
|
26
|
-
copy(): GameFiles;
|
|
27
|
-
/** Adds a file that arrived (not one the game wrote): onChange is not told, and a file already here stays. */
|
|
28
|
-
put(name: string, bytes: Uint8Array): void;
|
|
29
|
-
delete(name: string): void;
|
|
30
|
-
names(): string[];
|
|
31
|
-
entries(): [string, Uint8Array][];
|
|
32
|
-
byExtension(ext: string): string[];
|
|
33
|
-
get size(): number;
|
|
34
|
-
/** The .gam file to play: the one named like the folder, else the first. */
|
|
35
|
-
mainGame(preferred?: string): string | undefined;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* File names as DOS saw them: lower case, without folders, and cut to 8.3. DOS dropped the
|
|
39
|
-
* extra letters silently, so games could name "nejillian.gif" and open NEJILLIA.GIF.
|
|
40
|
-
*/
|
|
41
|
-
export declare function normalize(name: string): string;
|
|
42
|
-
/**
|
|
43
|
-
* The name a file got on the Game-Maker CD. Its ISO 9660 copy allowed only A-Z, 0-9 and _,
|
|
44
|
-
* so A-J.BKD, PARSEC-W.GIF and CAN'T.GIF are a_j.bkd, parsec_w.gif and can_t.gif there,
|
|
45
|
-
* while the games still name them the DOS way. A name not found as is is looked up this way.
|
|
46
|
-
*/
|
|
47
|
-
export declare function cdName(name: string): string;
|
|
48
|
-
/** Files only meaningful to DOS. */
|
|
49
|
-
export declare const IGNORED_FILE: RegExp;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** The container of these files (not compressed). */
|
|
2
|
-
export declare function encodePack(entries: Iterable<[string, Uint8Array]>): Uint8Array;
|
|
3
|
-
/**
|
|
4
|
-
* Reads a pack as its bytes come in: push() each chunk (already unzipped) and get the files
|
|
5
|
-
* it completed. `done` once the end mark is read.
|
|
6
|
-
*/
|
|
7
|
-
export declare class PackReader {
|
|
8
|
-
private chunks;
|
|
9
|
-
private total;
|
|
10
|
-
/** Bytes the next step needs (it waits until that many are in, so a big file is joined once). */
|
|
11
|
-
private want;
|
|
12
|
-
private started;
|
|
13
|
-
done: boolean;
|
|
14
|
-
push(chunk: Uint8Array): [string, Uint8Array][];
|
|
15
|
-
}
|
|
16
|
-
/** Every file of a whole pack (not compressed). */
|
|
17
|
-
export declare function decodePack(bytes: Uint8Array): [string, Uint8Array][];
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
type Severity = 'error' | 'warning';
|
|
2
|
-
export interface Issue {
|
|
3
|
-
severity: Severity;
|
|
4
|
-
/** What kind of problem, for grouping in the report. */
|
|
5
|
-
kind: 'missing' | 'link' | 'name' | 'empty' | 'unreadable' | 'game' | 'dos';
|
|
6
|
-
/** The file the problem is in or about. */
|
|
7
|
-
file?: string;
|
|
8
|
-
message: string;
|
|
9
|
-
}
|
|
10
|
-
/** What the check needs to know about a game's files. Contents may be partial (see `get`). */
|
|
11
|
-
export interface FileSource {
|
|
12
|
-
names(): string[];
|
|
13
|
-
/** Contents, when known. A quick check only loads the .gam, .lst and .bkd files. */
|
|
14
|
-
get(name: string): Uint8Array | undefined;
|
|
15
|
-
/** Size in bytes, when known without loading. */
|
|
16
|
-
byteSize?(name: string): number | undefined;
|
|
17
|
-
}
|
|
18
|
-
/** The files a game might need to be checked quickly: the .gam and graphic scripts. */
|
|
19
|
-
export declare const QUICK_CHECK_FILE: RegExp;
|
|
20
|
-
/** DOS 8.3 names (the CD's underscore spellings are fine too). */
|
|
21
|
-
export declare function validDosName(name: string): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Checks a game. `deep` also reads every file with its format's reader (needs all
|
|
24
|
-
* contents in `src`); without it only names, sizes and the .gam/.lst/.bkd files are used.
|
|
25
|
-
*/
|
|
26
|
-
export declare function checkGame(src: FileSource, gam: string | undefined, opts?: {
|
|
27
|
-
deep?: boolean;
|
|
28
|
-
}): Issue[];
|
|
29
|
-
export declare function worstSeverity(issues: Issue[]): Severity | undefined;
|
|
30
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** Which gates are open now (GATE_BIT), 0 when nothing is revealed. */
|
|
2
|
-
export declare function secretsRevealed(): Promise<number>;
|
|
3
|
-
/** FNV-1a of an id: how code that must know a secret game (its box cover) knows it without naming it. */
|
|
4
|
-
export declare function idHash(id: string): number;
|
|
5
|
-
/**
|
|
6
|
-
* Whether a game is one of the secret ones, however a list came to name it (a dev server from
|
|
7
|
-
* before games/extra-<gate>.json lists them in games/index.json): the magazine and the credits never
|
|
8
|
-
* name one, even once it is revealed.
|
|
9
|
-
*/
|
|
10
|
-
export declare const isOldSecret: (id: string) => boolean;
|
|
11
|
-
/** Which gates the last list given out showed the secret games of (undefined: none given out yet). */
|
|
12
|
-
export declare const secretsListed: () => number | undefined;
|
|
13
|
-
/**
|
|
14
|
-
* The list as it should show: with the secret games (fetched from `base`extra-<gate>.json) whose
|
|
15
|
-
* gate is open added, and without any that an older dev server listed in it while still hidden.
|
|
16
|
-
*/
|
|
17
|
-
export declare function withSecretGames<T extends {
|
|
18
|
-
id: string;
|
|
19
|
-
}>(list: T[], base?: string): Promise<T[]>;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { GameFiles } from './files.js';
|
|
2
|
-
import type { Companion } from './companion.js';
|
|
3
|
-
export interface ProjectRecord {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
/** File name of the project's main .gam file within `files`. */
|
|
7
|
-
gam: string;
|
|
8
|
-
/** Date.now() of the last save; the project list is sorted newest first. */
|
|
9
|
-
updated: number;
|
|
10
|
-
/** The whole game directory: file name -> contents. */
|
|
11
|
-
files: Record<string, Uint8Array>;
|
|
12
|
-
/** Editor-only extras (companion.ts): never one of the game's files, so no export but the backup carries it. */
|
|
13
|
-
companion?: Companion;
|
|
14
|
-
}
|
|
15
|
-
/** Project summaries without their files. getAll() still loads the files, then drops them. */
|
|
16
|
-
export declare function listProjects(): Promise<Omit<ProjectRecord, 'files'>[]>;
|
|
17
|
-
export declare function loadProject(id: string): Promise<{
|
|
18
|
-
record: ProjectRecord;
|
|
19
|
-
files: GameFiles;
|
|
20
|
-
} | undefined>;
|
|
21
|
-
/**
|
|
22
|
-
* Stores a project. `companion` undefined keeps the one stored already (many callers only
|
|
23
|
-
* know the files), so the record is read and written in one transaction.
|
|
24
|
-
*/
|
|
25
|
-
export declare function saveProject(id: string, name: string, gam: string, files: GameFiles, companion?: Companion): Promise<void>;
|
|
26
|
-
/** The record to store: the given companion, else the stored one, else none. */
|
|
27
|
-
export declare function withCompanion(next: ProjectRecord, stored: ProjectRecord | undefined, companion?: Companion): ProjectRecord;
|
|
28
|
-
export declare function deleteProject(id: string): Promise<void>;
|
|
29
|
-
/** Files a game wrote while being played (high scores, saves), keyed by game id. */
|
|
30
|
-
export declare function loadSaveData(gameId: string): Promise<Record<string, Uint8Array>>;
|
|
31
|
-
/** Fired on window after writeSaveFile stores a file (a saved game can hold a felt egg). */
|
|
32
|
-
export declare const SAVES_CHANGED = "gm-saves-changed";
|
|
33
|
-
/**
|
|
34
|
-
* Adds or replaces one save file by rewriting the game's whole save record (read, change,
|
|
35
|
-
* put in separate transactions). Failures are logged, not thrown, so play goes on.
|
|
36
|
-
*/
|
|
37
|
-
export declare function writeSaveFile(gameId: string, name: string, bytes: Uint8Array, o?: {
|
|
38
|
-
quiet?: boolean;
|
|
39
|
-
}): Promise<void>;
|
|
40
|
-
/**
|
|
41
|
-
* Replaces a game's whole save record (restoring a backup, deleting a slot): files left out
|
|
42
|
-
* are gone afterwards. Fires SAVES_CHANGED. Unlike writeSaveFile, failures are thrown.
|
|
43
|
-
*/
|
|
44
|
-
export declare function replaceSaveData(gameId: string, files: Record<string, Uint8Array>): Promise<void>;
|
|
45
|
-
/** A random id; falls back to time + random when crypto.randomUUID is missing (insecure contexts). */
|
|
46
|
-
export declare function newId(): string;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { GameFiles, type CatalogEntry } from './files.js';
|
|
2
|
-
/**
|
|
3
|
-
* The game's files in the order play first needs them: the .gam, the title and menu, the
|
|
4
|
-
* first level, the rest of the front end, the levels in the order their links reach them,
|
|
5
|
-
* Game Won, and then everything else. Names are the catalog's (`names`), each once.
|
|
6
|
-
*/
|
|
7
|
-
export declare function playOrder(gamName: string, gam: Uint8Array | undefined, names: string[]): string[];
|
|
8
|
-
/**
|
|
9
|
-
* The order of a game's files in its pack (project/gamePack.ts): play order, each file
|
|
10
|
-
* followed by the ones it names (a slide list's pictures, a sound set's samples), so a
|
|
11
|
-
* game read from the start of its pack has what it needs as early as it can.
|
|
12
|
-
*/
|
|
13
|
-
export declare function packOrder(gamName: string | null, names: string[], get: (name: string) => Uint8Array | undefined): string[];
|
|
14
|
-
/** Files a file names in turn, wanted right after it: a slide list's pictures, a backdrop's GIF, a sound set's samples. */
|
|
15
|
-
export declare function filesNamedBy(name: string, bytes: Uint8Array): string[];
|
|
16
|
-
/** What a demo preview reads before it starts: the title demo, and the first level's character (attract mode). */
|
|
17
|
-
export declare function demoNeeds(gam: Uint8Array | undefined): string[];
|
|
18
|
-
interface StreamedGame {
|
|
19
|
-
files: GameFiles;
|
|
20
|
-
/** The .gam is in: the game can be shown (its other files keep coming). */
|
|
21
|
-
started: Promise<void>;
|
|
22
|
-
/** Every file is in (or failed). */
|
|
23
|
-
done: Promise<void>;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Starts fetching a hosted game's files: its pack (project/gamePack.ts), which brings them in
|
|
27
|
-
* play order, or, without one, a few files at a time, most needed first. `files` fills
|
|
28
|
-
* as they arrive; until the last is in, `files.stream` lets the engine wait for one.
|
|
29
|
-
*
|
|
30
|
-
* `aheadBytes` limits what is fetched before it is asked for (a demo on the home page needs a
|
|
31
|
-
* few of a game's files, not its every picture): files the engine asks for (need, want) always
|
|
32
|
-
* come; others, in play order, only until that many bytes have been fetched ahead. Unlimited
|
|
33
|
-
* by default, so a game being played has everything by the time it gets there; `done` then
|
|
34
|
-
* waits for files that may never be asked for. A pack read past that budget, with nothing
|
|
35
|
-
* asked for still on its way, is stopped; what is asked for later comes file by file.
|
|
36
|
-
*/
|
|
37
|
-
export declare function streamHostedGame(entry: CatalogEntry, base?: string, concurrency?: number, aheadBytes?: number): StreamedGame;
|
|
38
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export interface ZipEntry {
|
|
2
|
-
name: string;
|
|
3
|
-
data: Uint8Array;
|
|
4
|
-
/** Unix file mode (e.g. 0o100755 for a program); stored so unzipping keeps it executable. */
|
|
5
|
-
mode?: number;
|
|
6
|
-
/** Kept uncompressed (stored), as an ePub's first file, `mimetype`, must be. */
|
|
7
|
-
store?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare function crc32(data: Uint8Array): number;
|
|
10
|
-
export declare function createZip(entries: ZipEntry[], date?: Date): Promise<Uint8Array>;
|
|
11
|
-
/** Limits for a zip from somewhere untrusted (linkIn/): more entries or bytes than these throw. */
|
|
12
|
-
interface ZipLimits {
|
|
13
|
-
maxEntries: number;
|
|
14
|
-
/** Unpacked bytes in all, as the directory says and as actually inflated. */
|
|
15
|
-
maxBytes: number;
|
|
16
|
-
}
|
|
17
|
-
/** An entry of a zip's directory, read only when asked (listZip). */
|
|
18
|
-
export interface ZipListing {
|
|
19
|
-
name: string;
|
|
20
|
-
/** Unpacked bytes, as the directory says. */
|
|
21
|
-
size: number;
|
|
22
|
-
/** Inflates it (stored and deflated entries; others give undefined). */
|
|
23
|
-
read: () => Promise<Uint8Array | undefined>;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* A zip's files from its central directory, without inflating any (a self-extracting .EXE's
|
|
27
|
-
* too, which is never run): an import looks for the
|
|
28
|
-
* .gam files first and reads the rest only for the games picked (project/importScan.ts).
|
|
29
|
-
*/
|
|
30
|
-
export declare function listZip(bytes: Uint8Array, limits?: ZipLimits): ZipListing[];
|
|
31
|
-
export declare function readZip(bytes: Uint8Array, limits?: ZipLimits): Promise<ZipEntry[]>;
|
|
32
|
-
export declare function isZip(bytes: Uint8Array): boolean;
|
|
33
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type CatalogEntry, GameFiles } from '../../project/files.js';
|
|
2
|
-
export declare const FLOPPY_BYTES = 1457664;
|
|
3
|
-
/** original: the games made for this project, on professionally printed labels. */
|
|
4
|
-
type DiskKind = 'rsd' | 'gameware' | 'original' | 'project' | 'blank';
|
|
5
|
-
export interface Disk {
|
|
6
|
-
id: string;
|
|
7
|
-
kind: DiskKind;
|
|
8
|
-
title: string;
|
|
9
|
-
/** Hand-written label text. */
|
|
10
|
-
label: string;
|
|
11
|
-
/** Plastic color of the disk: the same for every disk from one author or company. */
|
|
12
|
-
color: string;
|
|
13
|
-
/** The label's printed band across the top. */
|
|
14
|
-
stripe: string;
|
|
15
|
-
/** Something written on the label later in red marker, if anything. */
|
|
16
|
-
note?: string;
|
|
17
|
-
/** HD disks have a second hole, opposite the write-protect tab. */
|
|
18
|
-
density: 'HD' | 'DD';
|
|
19
|
-
/** .gam file on the disk (none for blank disks and asset libraries). */
|
|
20
|
-
gam?: string;
|
|
21
|
-
/** Bytes used, for the "1 of 2" disk count. */
|
|
22
|
-
bytes: number;
|
|
23
|
-
/** The write-protect tab: originals are protected, so editing makes a copy. */
|
|
24
|
-
writeProtected: boolean;
|
|
25
|
-
projectId?: string;
|
|
26
|
-
/** The user's disks: when the game was last saved (Date.now()). */
|
|
27
|
-
updated?: number;
|
|
28
|
-
catalog?: CatalogEntry;
|
|
29
|
-
load: () => Promise<GameFiles>;
|
|
30
|
-
}
|
|
31
|
-
export declare function diskCount(bytes: number): number;
|
|
32
|
-
export declare function loadDisks(): Promise<Disk[]>;
|
|
33
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/** Converts a string written with Unicode symbols, accents and box characters to CP437 byte codes. */
|
|
2
|
-
export declare function toCp437(s: string): string;
|
|
3
|
-
/** Converts CP437 byte codes to the Unicode characters a PC showed for them. */
|
|
4
|
-
export declare function fromCp437(s: string): string;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/** Mulberry32, the generator games/kit/pixels.ts seeds the simulators with: numbers in [0, 1). */
|
|
2
|
-
export declare function mulberry32(seed: number): () => number;
|
|
3
|
-
/** Xorshift32: numbers in [0, 1); a seed of 0 counts as 1. */
|
|
4
|
-
export declare function xorshift32(seed: number): () => number;
|
|
5
|
-
/** FNV-1a over the string's UTF-16 code units, as an unsigned 32-bit number: a seed from text. */
|
|
6
|
-
export declare function fnv1a(s: string): number;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/** The clock heart's id among the hunt's hearts (no game has this id). */
|
|
2
|
-
export declare const CLOCK_HEART = "desk-clock";
|
|
3
|
-
/** The room's hearts, as the hunt lists them (EGG.EXE's ledger, after the games). */
|
|
4
|
-
export declare const DESK_HEARTS: readonly {
|
|
5
|
-
id: string;
|
|
6
|
-
title: string;
|
|
7
|
-
}[];
|
|
8
|
-
/** When the clock heart was taken (an ISO date). */
|
|
9
|
-
export declare const CLOCK_FOUND_KEY = "gm-clock-heart";
|
|
10
|
-
/**
|
|
11
|
-
* The chicken comes out this many times before the heart comes with it: enough that the visitor
|
|
12
|
-
* has met the chicken and knows the clock does something, few enough (every third press, so a
|
|
13
|
-
* dozen presses, over any number of visits) that someone poking at the clock finds it.
|
|
14
|
-
*/
|
|
15
|
-
export declare const POPS_BEFORE_HEART = 3;
|
|
16
|
-
/** Fired on window when a heart is found, or EGG.EXE changes one (tinHearts.ts listens). */
|
|
17
|
-
export declare const TIN_HEARTS_CHANGED = "gm-tin-hearts-changed";
|
|
18
|
-
/** How many times the chicken has come out so far. */
|
|
19
|
-
export declare function clockPops(): number;
|
|
20
|
-
/** When the clock heart was taken, if it was. */
|
|
21
|
-
export declare function clockHeartTaken(): string | undefined;
|
|
22
|
-
/**
|
|
23
|
-
* The chicken has popped out once more. `found`: whether the clock heart counts as found now
|
|
24
|
-
* (taken, or added in EGG.EXE). True when the heart comes out with it this time.
|
|
25
|
-
*/
|
|
26
|
-
export declare function chickenPopped(found: boolean): boolean;
|
|
27
|
-
/** The visitor took the clock heart: kept once (the first date stays). */
|
|
28
|
-
export declare function takeClockHeart(when?: Date): void;
|
|
29
|
-
/**
|
|
30
|
-
* Whether every game's heart was found before the clock heart joined the hunt. Decided the first
|
|
31
|
-
* time it is asked (`gamesDone`: whether every game's heart counts as found now), then kept.
|
|
32
|
-
*/
|
|
33
|
-
export declare function grandfathered(gamesDone: boolean): boolean;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export interface HeartPlace {
|
|
2
|
-
/** The map file the heart's block is on (lower case, as on the disk). */
|
|
3
|
-
map: string;
|
|
4
|
-
/** Its cell on that map: column, row. */
|
|
5
|
-
at: [number, number];
|
|
6
|
-
}
|
|
7
|
-
export interface HeartManifest {
|
|
8
|
-
hearts: Record<string, HeartPlace>;
|
|
9
|
-
pending: string[];
|
|
10
|
-
}
|
|
11
|
-
/** The about.json fields the manifest is made from. */
|
|
12
|
-
export interface AboutForHearts {
|
|
13
|
-
company?: string;
|
|
14
|
-
series?: string;
|
|
15
|
-
secret?: boolean;
|
|
16
|
-
tinHeart?: {
|
|
17
|
-
map?: unknown;
|
|
18
|
-
at?: unknown;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
/** Does a game count toward the tin hearts at all (a Sandbox or Bard of Bizarre game, not secret)? */
|
|
22
|
-
export declare const heartsCount: (a: AboutForHearts) => boolean;
|
|
23
|
-
/** The about.json "tinHeart" field checked, or an error saying what is wrong with it. */
|
|
24
|
-
export declare function heartPlace(a: AboutForHearts): HeartPlace | string | undefined;
|
|
25
|
-
/** The manifest for a set of games (id -> about.json), ids in order. Throws on a bad entry. */
|
|
26
|
-
export declare function buildManifest(abouts: Record<string, AboutForHearts>): HeartManifest;
|
|
27
|
-
/** hearts.json as the generator writes it: one game a line. */
|
|
28
|
-
export declare function manifestText(m: HeartManifest): string;
|
|
29
|
-
/** Is a touch at cell (x, y) of map file `map` the heart at `place`? */
|
|
30
|
-
export declare const isHeartAt: (place: HeartPlace, map: string | undefined, x: number, y: number) => boolean;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { type HeartManifest, type HeartPlace } from './manifest.js';
|
|
2
|
-
import type { Session } from '../engine/scene.js';
|
|
3
|
-
export declare const MANIFEST: HeartManifest;
|
|
4
|
-
export declare const FOUND_FILE = "tinheart.dat";
|
|
5
|
-
export declare const OVERRIDES_KEY = "gm-tin-hearts";
|
|
6
|
-
type HeartOverride = 'added' | 'broken';
|
|
7
|
-
type HeartStatus = 'saved' | 'added' | 'broken' | 'none';
|
|
8
|
-
/** The heart a game hides, if it declares one. */
|
|
9
|
-
export declare const heartOf: (gameId: string) => HeartPlace | undefined;
|
|
10
|
-
/** What FOUND_FILE holds. */
|
|
11
|
-
interface FoundNote {
|
|
12
|
-
/** When it was found (ISO date). */
|
|
13
|
-
found: string;
|
|
14
|
-
scene: number;
|
|
15
|
-
at: [number, number];
|
|
16
|
-
}
|
|
17
|
-
/** FOUND_FILE read back; undefined when it is missing or not a find. */
|
|
18
|
-
export declare function parseFound(bytes: Uint8Array | undefined): FoundNote | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* What the player passes the engine for a game played under `saveId` ('game:<id>'): it listens
|
|
21
|
-
* for the touch at the heart's place and keeps the find. Undefined for a game with no heart.
|
|
22
|
-
*/
|
|
23
|
-
export declare function heartHook(saveId: string | undefined): {
|
|
24
|
-
onSession: (s: Session) => void;
|
|
25
|
-
onTouched: NonNullable<Session['onTouched']>;
|
|
26
|
-
} | undefined;
|
|
27
|
-
export declare function readOverrides(): Record<string, HeartOverride>;
|
|
28
|
-
export declare function setOverride(game: string, value: HeartOverride | undefined): void;
|
|
29
|
-
/** EGG.EXE's Set all / Clear all: every listed heart found (or not), whatever the saves say. */
|
|
30
|
-
export declare function setAllOverrides(states: Pick<HeartState, 'id' | 'inSave'>[], found: boolean): void;
|
|
31
|
-
/** EGG.EXE's X Reset all (and R): every heart back to what the saves say. */
|
|
32
|
-
export declare const resetAllOverrides: () => void;
|
|
33
|
-
/** Where a heart stands: found = (in the save OR added by hand) AND not taken away. */
|
|
34
|
-
export declare function statusOf(inSave: boolean, override: HeartOverride | undefined): {
|
|
35
|
-
status: HeartStatus;
|
|
36
|
-
found: boolean;
|
|
37
|
-
};
|
|
38
|
-
export interface HeartState {
|
|
39
|
-
id: string;
|
|
40
|
-
title: string;
|
|
41
|
-
inSave: boolean;
|
|
42
|
-
/** When the save says it was found. */
|
|
43
|
-
when?: string;
|
|
44
|
-
status: HeartStatus;
|
|
45
|
-
found: boolean;
|
|
46
|
-
}
|
|
47
|
-
/** A catalog entry, as much as counting needs. */
|
|
48
|
-
interface CountedGame {
|
|
49
|
-
id: string;
|
|
50
|
-
title: string;
|
|
51
|
-
}
|
|
52
|
-
/** The games that count, from a catalog list: Sandbox or Bard of Bizarre, with a heart declared. */
|
|
53
|
-
export declare function countedOf<T extends {
|
|
54
|
-
id: string;
|
|
55
|
-
title: string;
|
|
56
|
-
company?: string;
|
|
57
|
-
series?: string;
|
|
58
|
-
original?: unknown;
|
|
59
|
-
}>(catalog: T[]): CountedGame[];
|
|
60
|
-
/** Development only: the catalog's games that count but hide no heart yet. */
|
|
61
|
-
export declare function pendingOf<T extends {
|
|
62
|
-
id: string;
|
|
63
|
-
title: string;
|
|
64
|
-
}>(catalog: T[]): CountedGame[];
|
|
65
|
-
/** Where every counted heart stands. */
|
|
66
|
-
export declare function heartStates(games?: CountedGame[]): Promise<HeartState[]>;
|
|
67
|
-
/** Where the room's hearts stand (the clock's): taken in the room, or changed in EGG.EXE. */
|
|
68
|
-
export declare function deskHeartStates(): HeartState[];
|
|
69
|
-
/** Every heart in the hunt: the counted games' (`games`, or the live catalog's), then the room's. */
|
|
70
|
-
export declare function huntStates(games?: CountedGame[]): Promise<HeartState[]>;
|
|
71
|
-
/**
|
|
72
|
-
* Whether the hunt is won, from `states` (huntStates): every heart found, or every game's heart
|
|
73
|
-
* found by someone who had found them all before the room's hearts joined (deskHearts.ts).
|
|
74
|
-
*/
|
|
75
|
-
export declare function huntComplete(states: Pick<HeartState, 'id' | 'found'>[]): boolean;
|
|
76
|
-
/** How many of the hunt's hearts are found, and whether it is won (huntComplete). */
|
|
77
|
-
export declare function heartCount(): Promise<{
|
|
78
|
-
found: number;
|
|
79
|
-
total: number;
|
|
80
|
-
complete: boolean;
|
|
81
|
-
}>;
|
|
82
|
-
/** Calls `f` whenever a find may have changed (here, a save written, EGG.EXE in another tab). */
|
|
83
|
-
export declare function watchHearts(f: () => void): () => void;
|
|
84
|
-
export {};
|