Logo FSBarV1_Archived

PreviewSession Module

Offline preview and playback via SkiaViewer.

Functions and values

Function or value Description

advanceCycleIndex n direction current

Full Usage: advanceCycleIndex n direction current

Parameters:
    n : int
    direction : int
    current : int

Returns: int

Pure helper exposed for unit testing: advance a cycling index by direction (+1 forward, -1 backward), wrapping at the ends of an n-element list. current must satisfy 0 <= current < n.

n : int
direction : int
current : int
Returns: int

startPlayback frames gameFps

Full Usage: startPlayback frames gameFps

Parameters:
Returns: IDisposable

Opens a viewer playing back a sequence of snapshots at the given game FPS, looping.

frames : GameSnapshot seq
gameFps : int
Returns: IDisposable

startWithCachedMaps supportedMaps initialMapName

Full Usage: startWithCachedMaps supportedMaps initialMapName

Parameters:
    supportedMaps : SupportedMap list
    initialMapName : string option

Returns: IDisposable

Opens a viewer on the first map in supportedMaps (or initialMapName when provided and found in the list) loaded via MapCacheFile.read. Installs in-viewer next/prev keybindings (]/. to advance, [/, to retreat) that cycle through supportedMaps in the order supplied, wrapping at the ends. On a MapCacheFile.LoadError for any map, the viewer displays a formatted error banner (via MapCacheFile.formatLoadError) over the last successfully-loaded scene and does not advance the index; it never crashes or shows a blank window. supportedMaps must be non-empty — otherwise raises System.ArgumentException.

supportedMaps : SupportedMap list
initialMapName : string option
Returns: IDisposable

startWithMap grid

Full Usage: startWithMap grid

Parameters:
Returns: IDisposable

Opens a viewer showing the given map grid with the default layer.

grid : MapGrid
Returns: IDisposable

startWithSnapshot snapshot

Full Usage: startWithSnapshot snapshot

Parameters:
Returns: IDisposable

Opens a viewer showing a single static snapshot.

snapshot : GameSnapshot
Returns: IDisposable

stop ()

Full Usage: stop ()

Parameters:
    () : unit

Stops the current preview session.

() : unit

Type something to start searching.