From 424bf6fcd65ff41915cf27cac56ac8ce70687c8e Mon Sep 17 00:00:00 2001 From: meleki Date: Thu, 24 Sep 2026 11:38:29 +0200 Subject: [PATCH] Keep play start and game view scale in the project (#226) --- Architecture.md | 17 ++++++++++------- Concepts.md | 4 ++-- Scenes.md | 7 +++---- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Architecture.md b/Architecture.md index 32fe2ec..e250f98 100644 --- a/Architecture.md +++ b/Architecture.md @@ -373,13 +373,16 @@ the `SharedState` handed to the next `BehaviorSystem` through `carryOver` — wh line between "belongs to the run" and "belongs to the scene". Carrying it over also suppresses the entry event of the global machines, because standing where you already stand is not a move. -**Where a run begins is a project field, which of the two questions Play asks is a browser -setting.** `project.startSceneId` is content — it travels with the project, and a dangling id reads -as none rather than being cleaned up, so undoing a deletion brings it back. The switch next to Play -lives in `editor/settings.ts` (`localStorage`, best effort: a browser that refuses it gets the -defaults and keeps working), because "I am working on level 4 this afternoon" is not something the -project should carry into anyone else's checkout. The new field needed no format bump: a document -without it reads as "none named", which is precisely what older projects meant. +**Where a run begins and which of the two questions Play asks are both project fields.** +`project.startSceneId` is content — it travels with the project, and a dangling id reads as none +rather than being cleaned up, so undoing a deletion brings it back. `project.playFrom` (the switch) +and `project.gameScale` (the game view's scale) live in the project too since #226, read by +`core/model/playSettings.ts`; anything unknown reads as the default. The switch is an undo step +like every project setting. The scale is saved but never pushed on the undo stack +(`EditorState.setGameScale`), and one picked while playing is written into the saved model as well, +so Stop does not throw it away. None of these fields needed a format bump: a document without them +reads as the defaults, which is precisely what older projects meant. The only thing still kept in +the browser is the save of a persistent Variables asset (`editor/saves.ts`). **A predicate named after what a thing looks like will be asked what a thing *is*.** `isSymbolType` reads as "draws an icon", but four callers use it for "is editor decoration": the running world, the diff --git a/Concepts.md b/Concepts.md index c0dd075..2ec6feb 100644 --- a/Concepts.md +++ b/Concepts.md @@ -54,8 +54,8 @@ units, and at 100% still fills 640x360 screen pixels. Auto and Fit name the fact the view is cut to it, the camera stays in the middle. Fixed steps start on a whole screen pixel, so pixel art at 100% stays sharp. The steps count **device** pixels: with Windows display scaling at 125%, 100% is still one screen pixel per camera -pixel, and Fit then names the factor in screen pixels (`Fit · 156%`). The choice belongs -to this browser, like *Play starts*, and is not saved in the project. +pixel, and Fit then names the factor in screen pixels (`Fit · 156%`). The choice is saved with +the project, like *Play starts*, but it is no undo step: Ctrl+Z undoes edits, not a look at the game. **Toolbar and panels.** The toolbar carries five **icon buttons** and no captions (#183): the **menu** (three bars) on the left with *New project*, *Open project…* and *Project settings…*, diff --git a/Scenes.md b/Scenes.md index 1f39206..fe5fa30 100644 --- a/Scenes.md +++ b/Scenes.md @@ -23,10 +23,9 @@ Which of the two Play uses is the **Play starts** switch in **menu → Project s | **Start scene** (default) | The named start scene; the active one while none is named. | | **Active scene** | Whatever scene is open in the editor, whatever the project says. | -The switch is remembered in the **browser**, not in the project: it says how *you* are working -this afternoon, not what the game does, and it must never turn up in a diff of the project file. -It stands in the settings dialog beside the project name and the collision layers, which *do* -belong to the project — the dialog is the one place these are edited, not the split it says. +The switch is saved with the **project** (#226), so whoever opens it gets the same answer, and +changing it is an undo step like every other project setting. It stands in the settings dialog +beside the project name, the symbol scale and the collision layers. It is captioned with the mode it stands in — *Start scene* or *Active scene*, worded exactly like the entries of its own menu, so that what you picked and what you read back are the same words. The start scene is marked with the play triangle in the Assets panel, the active one with a dot.