Adds some support for "less giant" level screenshots.
* In the Editor, the Level->Take Screenshot menu will render a cropped screen
shot of just the level viewport on screen. Note: it is not an SDL2 screen
copy but generated from scratch from the level data.
* In levels themselves, screenshots can be stored inside the level data in
three different sizes: large (1280x720), medium and small (each a halved
size of the previous).
* The first screenshot is created when the level is saved, starting from
wherever the scroll position in the editor is at, and recording the 720p
view of the level from there.
* The level screenshot can be previewed and updated in the Level Properties
window of the editor: so you can scroll the editor to just the right position
and take a good screenshot to represent your level.
* In the future: these embedded level screenshots will be displayed on the
Story Mode and other screens to see a preview of each level.
Other tweaks:
* When taking a Giant Screenshot: a confirm modal will warn the player that
it may take a while. And during the screenshot, show the new Wait Modal to
block player interaction until the screenshot has finished.
Updates the savegame.json file format:
* Levels now have a UUID value assigned at first save.
* The savegame.json will now track level completion/score based on UUID,
making it robust to filename changes in either levels or levelpacks.
* The savegame file is auto-migrated on startup - for any levels not
found or have no UUID, no change is made, it's backwards compatible.
* Level Properties window adds an "Advanced" tab to show/re-roll UUID.
New JavaScript API for doodad scripts:
* `Actors.CameraFollowPlayer()` tells the camera to return focus to the
player character. Useful for "cutscene" doodads that freeze the player,
call `Self.CameraFollowMe()` and do a thing before unfreezing and sending the
camera back to the player. (Or it will follow them at their next directional
input control).
* `Self.MoveBy(Point(x, y int))` to move the current actor a bit.
New option for the `doodad` command-line tool:
* `doodad resave <.level or .doodad>` will load and re-save a drawing, to
migrate it to the newest file format versions.
Small tweaks:
* On bounded levels, allow the camera to still follow the player if the player
finds themselves WELL far out of bounds (40 pixels margin). So on bounded
levels you can create "interior rooms" out-of-bounds to Warp Door into.
* New wallpaper: "Atmosphere" has a black starscape pattern that fades into a
solid blue atmosphere.
* Camera strictly follows the player the first 20 ticks, not 60 of level start
* If player is frozen, directional inputs do not take the camera focus back.
Add the ability for the free version of the game to allow loading levels that
use embedded custom doodads if those levels are signed.
* Uses the same signing keys as the JWT token for license registrations.
* Levels and Levelpacks can both be signed. So individual levels with embedded
doodads can work in free versions of the game.
* Levelpacks now support embedded doodads properly: the individual levels in
the pack don't need to embed a custom doodad, but if the doodad exists in
the levelpack's doodads/ folder it will load from there instead - for full
versions of the game OR when the levelpack is signed.
Signatures are computed by getting a listing of embedded assets inside the
zipfile (the assets/ folder in levels, and the doodads/ + levels/ folders
in levelpacks). Thus for individual signed levels, the level geometry and
metadata may be changed without breaking the signature but if custom doodads
are changed the signature will break.
The doodle-admin command adds subcommands to `sign-level` and `verify-level`
to manage signatures on levels and levelpacks.
When using the `doodad levelpack create` command, any custom doodads the
levels mention that are found in your profile directory get embedded into
the zipfile by default (with --doodads custom).
* The level.FileSystem type has updated to support ZIP files too.
* Legacy levels loaded from gz/json have their old FileSystem as a
simple map[filename]data and this parses from JSON OK.
* On save to zip, the legacy loaded file data gets exported to ZIP.
* Going forward: newly added or deleted files during runtime are kept in
the legacy file map until the next save when the filemap is again
flushed out to ZIP.
* For regular read-access, the FileSystem reads from the ZIP file if the
data is not in the hot map (legacy file or recently modified
attachment).
* Bugfix: be sure to Inflate() the Level/Doodad after loading from
zipfile - it used to be that directly after a save, trying to play the
level failed because the Level.Actors struct was missing their IDs,
and similarly recently written chunks would error out (become black
voids) on levels/doodads so we Inflate() both after save/replacing
their zip handle.
* magicform is a helper package that may eventually be part of the go/ui
library, for easily creating structured form layouts.
* The Level Publisher UI is the first to utilize magicform.
Refactor how level publishing works:
* Level data now stores SaveDoodads and SaveBuiltins (bools) and when
the level editor saves the file, it will attach custom and/or builtin
doodads just before save.
* Move the menu item from the File menu to Level->Publish
* The Publisher UI just shows the checkboxes to toggle the level
settings and a convenient Save button along with descriptive text.
* Free versions get the "Register" window popping up if they click the
Save Now button from within the publisher window.
Note: free versions can still toggle the booleans on/off but their game
will not attach any new doodads on save.
* Free games which open a level w/ embedded doodads will get a pop-up
warning that the doodads aren't available.
* If they DON'T turn off the SaveDoodads option, they can still edit and
save the level and keep the existing doodads attached.
* If they UNCHECK the option and save, all attached doodads are removed
from the level.
In the Level Editor, the "Level->Attached files" menu opens the
FileSystem Window, which shows a paginated list of attached files and a
"Delete" button to remove them.
- Custom doodads which also exist locally can be deleted from the
level's filesystem at any time.
- If a custom doodad does NOT exist locally, and one of them is still
placed somewhere within the level, you can not delete it.
- You can't delete the custom wallpaper image IF the level is still
using it. Change to a default wallpaper and then you can delete the
custom wallpaper image.
* The Publisher is all hooked up. No native Save File dialogs yet, so
uses the dev shell Prompt() to ask for output filename.
* Custom-only or builtin doodads too can be stored in the level's file
data, at "assets/doodads/*.doodad"
* When loading the embedded level in the Editor: it gets its custom
doodads out of its file, and you can drag and drop them elsehwere,
link them, Play Mode can use them, etc. but they won't appear in the
Doodad Dropper if they are not installed in your local doodads
directory.
* Fleshed out serialization API for the Doodad files:
- LoadFromEmbeddable() looks to load a doodad from embeddable file
data in addition to the usual places.
- Serialize() returns the doodad in bytes, for easy access to embed
into level data.
- Deserialize() to parse and return from bytes.
* When loading a level that references doodads not found in its embedded
data or the filesystem: an Alert modal appears listing the missing
doodads. The rest of the level loads fine, but the actors referenced
by these doodads don't load.
* You can now browse for a custom wallpaper image to use with your
levels. A platform-native file picker dialog is used (no WASM support)
* In the New/Edit Level Properties dialog, the Wallpaper drop-down
includes an option to browse for a custom map.
* When editing an existing level: the wallpaper takes effect immediately
in your level once the file is picked. For NEW levels, the wallpaper
will appear once the "Continue" button is pressed.
* All common image types supported: png, jpeg, gif.
* The wallpaper is embedded in the level using the filepath
"assets/wallpapers/custom.b64img" as a Base64-encoded blob of the
image data.
* The `doodad show` command will list the names and sizes of files
embedded in levels. `doodad show --attachment <name>` will get an
attachment and print it to the console window.
* To extract a wallpaper image from a level:
`doodad show -a assets/wallpapers/custom.b64img | base64 -d > out.png`