LiminaliaLiminalia
Technical docs: How Studio works: Timeline, comments, voice and trash

Timeline, comments, voice and trash

Open in Claude (new tab)

Timeline is the standard screen for editing the effects of the script cursor’s page (one line of text) as bars on a time axis (timeline-view.ts; the data and rewriting are in model/timeline.ts). Open it from the “More screens” menu in the top bar, or with “Open” in the timeline heading in the right panel. When the script cursor isn’t on a text line (for example, on a comment at the top of the file), it shows the first page after the cursor (or the last page if there is none), and moves the cursor there too. At the top are buttons to move to the previous and next page, the file and line, “Open in script” (opens this page in the script), zoom in, zoom out, fit, and “Play”; below them, the preview and the details of the selected bar; and at the bottom, the bars. The bars are the effect commands placed before that page (@bg, @chara, @camera, @quake, @mask, @wait, plugin commands and so on), the way the text appears, click waits and commands inside the text, calculated the same way as the timeline in the right panel (lengths from time and fade; whether to wait from the wait written, or else from waits in the command’s spec). Every action on the screen rewrites that line of the .lim (it goes in as an editor change, so ⌘Z undoes and ⇧⌘Z redoes it both on the Timeline screen and back in the script; it is saved by automatic saving; see “Undo on screens” below).

  • Drag the right end of a bar to change its length (time= or fade=) in steps of 50ms. If it becomes the same as the default, the parameter is removed
  • Drag a bar to change when it starts. If the effect command just before it is @wait, that wait’s length changes (and the line is deleted if it reaches 0); if not, an @wait line is added before it only when moving it later. @wait also delays every command after it (as it means in .lim). A bar can move earlier only by as much as the @wait just before it
  • Click a bar to select it, and the preview shows the screen right after that command runs. In the details, you can change the length (1.5s, 800ms) and “Wait until done” (only for commands with a wait parameter; not written if it is the same as the default). For the selected bar, ←→ change the start and Shift+←→ change the length in steps of 50ms, and Enter or a double-click goes to that line in the script
  • Commands inside the text (such as {@quake}) are display only (edit them in the script). Nothing can be changed in read-only files
  • “Play” saves, then runs the commands in the real player from the screen just before the page’s first effect command (the state of the line before it) and shows the page (a red line moves across the bars). The preview uses a different player from the script’s preview, with the same mute setting

Comments is the standard screen for review comments attached to lines of the script (they can be replied to and resolved) (reviews-view.ts).

  • Adding: the speech-bubble button above the script or ⌘⌥M shows a field for writing about the cursor line under “Comments” in the right panel (⌘Enter saves, Esc cancels; in the block view, “Add comment” in a line’s right-click menu works too). Lines with comments get a speech-bubble mark to the left of the line number (in the block view, to the left of the line) (violet if open, gray if all are resolved); click it to show that line’s thread in the right panel. The right panel shows the thread of the cursor line, where you can reply, resolve (and reopen) and delete comments. Your own comments (those whose name matches your current name) can be edited with the pencil button, and show “(edited)” next to the time (ReviewComment.edited). If two or more lines are selected in the code view, the comment applies to that range (“Comment on lines 12–15”; ReviewThread.end holds the last line). A speech bubble is placed on the first line of the range and a thin line mark on the following lines, and with the cursor on any line of the range, the right panel shows that thread
  • The screen: for each file, lists the line (the current line number and the line’s content), the comments and a reply field. Filter with “Open,” “Resolved” and “All,” and click a line to go to that line in the script. The badge on the “More screens” button in the top bar is the number of open comments (the Comments screen opens from this menu). “Name” at the top right sets the name attached to your comments (reviewer in .liminalia/studio.json; if empty, the OS user name)
  • Where they are saved: reviews/<id>.json in the project (one per thread; they can be shared with git, and different people adding different threads don’t conflict). Export (lim build) reads only the script, data and asset folders, so they aren’t included in the game. When reviews/ changes outside Studio (such as when you bring in changes with git), the dev server sends reviews-changed and the client reloads them
  • How lines are tracked: a thread holds the line number, the content of that line (without leading and trailing spaces) and its hash (textHash in @liminalia/lang). On opening and on saving, it looks for a line with the same content (the one nearest the original line if there are several), or else a line with similar content (an overlap of character pairs of 0.6 or more) (model/reviews.ts). If it was found by similarity, it is reattached to that line on each save (so next time it can be found by content). While you type, the mark moves with the line. Threads whose line can’t be found show “Line not found” on the screen. The last line of a range is found by the same rule, and if it isn’t found after the first line, the range extends as many lines after it as it had when added
  • Importing feedback from a test build: “Import feedback…” in the heading row lets you choose .liminalia-feedback.json files left in a test build (docs/distribution.md, “Test builds”; any number of them). Each piece of feedback becomes a thread on its script line. The line is found again in the current script by its page key (pageKeys), so it lands on the same page even if lines were added after the feedback (otherwise the line it was left on). The name, time and text are kept as they are, the screenshot is placed in reviews/shots/<id>.jpg and attached to the comment (click to enlarge), and the test build it came from is shown next to the name. The same feedback isn’t imported twice, and feedback for another project, for a missing script, or in a file of another form is skipped with the reason (importFeedback in server/reviews.ts). Feedback received at the URL (build.feedback.url) has the same JSON form, so it can be imported as a file too

Voices is the standard screen for assigning a voice to each line of dialogue (voice-view.ts, voice-drop.ts; the logic is in model/voice-assign.ts). Open it from the “More screens” menu in the top bar.

  • The list: filter dialogue by speaker and file, and split it into “All,” “Not set,” “File missing” and “Set” (200 lines at a time). Each row shows the speaker, the line, the current voice file and the status. The file follows the same rules as lim voice-script (@voice before the line, or the locked numbers and the @voice-auto pattern; it shares voiceScriptRows in @liminalia/lang). Even for an @voice-auto speaker, a line whose number isn’t locked yet is not set. A second @voice played at the same time on the same line of dialogue (who=, channel=) is a row of its own too; its speaker is that voice’s speaker, and next to the position the speaker of the dialogue is shown, such as “with Yui” (rows are told apart by voiceRowKey)
  • “Listen” on a row plays the voice, and clicking the row goes to that line in the script
  • “Choose” picks from the voice assets (Enter in the search field takes the first one; “Add from file” works too). While filtered to Not set, assigning one opens the choice for the next unset line, so you can fill them in order
  • Drop one file on a row to place and assign it. For a line decided by its number, the file is placed under that number’s file name (no @voice is written)
  • Dropping several at once opens a confirmation screen. Files are matched to lines by the file names in the recording script (without folders; case is ignored), and files that don’t match (not in the recording script, the same name appearing two or more times, not audio) are listed. For those, choose a line, or use “Assign to unset lines in name order” (unset lines have no file name in the recording script, so they can’t match by name). If a file with the same name exists, you choose whether to overwrite it. Nothing is saved until you confirm
  • Writing: as an @voice line before the dialogue (above any // note directly above the dialogue), through PUT /file, so it is kept in the change history (the open file receives an editor change; script-writer.ts). Press ⌘Z on the Voices screen to undo an assignment and ⇧⌘Z to redo it (files that aren’t open too; see “Undo on screens” below). If there is an @voice line, its value is replaced. Choosing the same file for a line decided by @voice-auto and its number writes nothing (choosing a different file writes @voice and replaces just that line’s voice). If the file changed after it was loaded, nothing is saved, and it reloads and tells you so (also when it changes while a dialog or file picker is open: the line’s text is compared with the text when loaded, and it isn’t saved)

Trash is the standard screen for script files, assets and themes that were moved to the trash (.liminalia/trash/, up to 100 entries) (trash-view.ts). Open it from the “More screens” menu in the top bar. Everything moved at once is one row; rows are listed newest first with the kind, the names (up to 20; if there are more, “N more”), the date and time it was moved, and “Restore.” “Restore” puts it back where it was (clearing any notice with “Undo” still showing), and if something with the same name is already there, it isn’t restored and you are told so. What was moved is saved in <id>/.items.json at that time; for older entries without it, the topmost files and folders inside are shown.

Undo on screens: on the Timeline, Voices, Assets (BGM loops, renaming, trash, adding), Characters, Flowchart, Game settings (including command defaults), Project (Basics, Export, Extras, Translation) and Variables screens, ⌘Z undoes the changes made on that screen one at a time, newest first, and ⇧⌘Z (also Ctrl+Y except on the Mac) redoes them (edit-undo.ts; if one action rewrote two files, they are undone together). While you are typing in an input field, it undoes in that field. Changes made in the script aren’t undone from these screens (so that changes you can’t see aren’t lost; if there is nothing to undo, you are told so). To stay consistent with the script’s undo history (CodeMirror), rewrites to the open file go in as editor changes, and when undoing from the screen, if that change is at the top of the history, CodeMirror’s undo and redo are used (going back to the script and pressing ⌘Z or ⇧⌘Z follows the same history). If the content has changed since, because you typed in the script or already undid it there, it isn’t undone and you are told so. In the desktop app, Edit → Undo and Redo in the menu do the same (when the app isn’t in front, they act on the window that was last in front; while typing in a field they undo the typing, and on the Script screen they undo the script; editHistory in main/menu.ts and __liminaliaStudio.undo on the screen). For files that aren’t open (saved directly through the write API), if the content on disk is still what was saved, the content from before the save is saved through the write API (and kept in the change history). If it changed elsewhere, nothing is saved. After undoing, Studio saves and reloads the screen. The settings screens deal with liminalia.json and the translation files (lang/<language>.json). The functions that write them (setUi, setSettings, setExtra, writeTranslation and so on in Api) read and remember the content before and after writing, and to undo, if the current content is still what was written, they save the content from before through PUT /part-file (part is @config or @lang/<language>) (the earlier content is kept in the change history as @config and @lang/<language>; if an item that needs a restart to take effect changed, the notice says so with “Restart”). Applying a theme, “Reset everything to default,” and saving and deleting initial values of variables remember several writes as one action (Api.undoGroup), and “Undo” in the notice undoes them too. “Change history” in the heading of the Game settings, Project and Variables screens shows the change history of liminalia.json (.liminalia/history/@config/) in the same panel as the characters’ change history, compared with the current content, and restores the chosen version (restoring can also be undone with ⌘Z on that screen). Actions that move files (applying a theme, adding, renaming and trashing assets, renaming characters) make a record on the dev server for each action (undo in the reply; server/file-undo.ts), and the screen remembers it as one change (@files/<id>). To undo, Studio checks that things are still as the action left them (GET /undo/state) and undoes with POST /undo/apply, bringing back not only the settings and references but also the asset files, to the same places with the same content (for a theme, the copied assets are removed and the previous theme’s assets moved to the trash come back). Removed and overwritten files are kept in .liminalia/undo/ (they are no longer used when the dev server changes, and are deleted the next time the project opens). If something changed after the action, or the dev server was restarted, nothing is undone and you are told so. On the Characters screen, rewrites of cast.json are remembered by the content before and after (@cast), like the positions on the Game settings screen, and become one action together with the added images. The dev server’s write routes and how ⌘Z undoes each are listed in server/undo-routes.ts (test/file-undo.test.ts fails for a route that isn’t listed and for a route that isn’t checked by undoing).