Keep track of the storage ID in each renderer Storage instance and pass
it to the IPC bridge. Jobs are dispatched to the relevant handler (only
saves/ for now) and all (de)compression is handled there.
Add dedicated fs-job types to read or write and (de)compress data
from/to the file picked by the user. Remove redundant utility functions
that used web APIs instead.
Make it slightly easier to replace the storage interface used for
app_settings.bin and savegames.bin in case it's ever needed. Savegames
always use app.storage for now, but this should be easier to change as
well.
Also fix a few issues in Electron code. This is not as polished yet, UI
from old mod support was reused for now and is likely broken. Mods can
be loaded, but there isn't much QoL around the support for now.
Only load the mod with highest priority for now. Proper behavior would
be to keep metadata for all duplicates and load the first that isn't
disabled. This allows easy mod source switching (for example, user mods
and development mods)
The linkApp method is removed as it was unused. A getter is used to
ensure best development experience. It can be further improved by adding
a guard for cases where GLOBAL_APP is not set yet.
* Switch to npm in electron/
May change resolved package versions.
* Remove redundant electron-notarize dependency
The number of dependencies stays the same. Only direct mention in
package.json is removed.
* Assume Node.js 22.x and clean up dependencies
Targeting Node.js 22.x allows using the new fs.glob* functions, which
can replace the glob module. It is still downloaded as there are other
packages using it, but is no longer included in devDependencies.
Also remove @types/filesystem, as this API is not used anywhere in the
code, it is non-standard and some of it was removed from Chromium. Was
likely used with Cordova for YORG.io 3 mobile support.
* Update linting stack
Install the latest versions of the following packages:
- @eslint/js (^9.24.0)
- eslint (^9.24.0)
- typescript-eslint (^8.29.1)
and remove packages that are no longer used:
- @types/eslint__js
- yarn
Config files were not modified.
* Switch root package to npm
npm is able to resolve packages using yarn.lock as a resolution hint.
Note that files other than those included in this commit are
intentionally kept outdated, as they may need a bigger change.
Keep some that are either still used but shouldn't be or those that may
be used in the future. Files other than base-en.yaml are first synced
with the sync-translations.js script, then formatted with prettier-all.
Can have minor effect on game appearance, most importantly the removal
of letter-spacing by default. Styles are now much lighter though.
Changes all keybinding code to use kbd instead of code as well.
Yarn seems to complain due to my hand-edited package.json, but
TypeScript packages are out of sync if I let it update the electron one.
To avoid these issues, update both packages.
Re-use the same openExternalUrl logic meant for frame navigation to
handle window.open calls as well. Possibly a partial solution, as the
ability to open new windows might be useful for mods.
When the game attempts to create the settings file but its directory
does not exist yet, an early error occurs. In reality, there is no way
for the directory to be created without user intervention. This change
makes sure the directory is created before any attempt to write a file
is done. Errors related to directory creation and/or file writes are
still reported as usual.
Unfortunately we have to keep a second copy for now. The lockfile
specifies the same version as used in the root package to avoid issues.
This may be replaced with Node.js type stripping in the future.
README.md is updated to include the correct command for testing the
Electron wrapper.
* Migrate Electron wrapper to ESM
Use ESM syntax for main process, move some fs usages to fs.promises,
switch to import.meta.url/import.meta.dirname to handle file paths;
clean up redundant code.
* Add TypeScript support to Electron wrapper
The support is very basic, tsc is used to transpile code. Build scripts
are modified to not copy any Electron code other than preload.cjs and
use an extremely cursed setup to call the TypeScript compiler.
* [TS] Rename platform/storage
* Rewrite Electron wrapper
MVP, missing some features from the old wrapper and most planned
features. Some of the functionality hasn't been verified.
* Updated steamPage AR Translation
* Updated global AR Translation
* Updated demoBanners AR Translation
* Updated mainMenu AR Translation
* Updated dialogs AR Translation
* Updated ingame AR Translation
* Updated shopUpgrades AR Translation
* Updated buildings AR Translation
* Updated storyRewards AR Translation
* Updated Settings AR Translation
* Updated keybindings AR Translation
* Updated about AR Translation
* Updated changelog AR Translation
* Updated demo AR Translation
* Updated tips AR Translation
* Updated puzzleMenu AR Translation
* Updated backendErrors AR Translation
* Updated game name to be more cosistent
* Updated dialogs to be less than the 200 char limit
* Rewrote the storyRewards to be less than the 200 char limit
* Fixed syntax errors
Move the additional wrapping for getMainContentHTML into getInnerHTML
and call it from GameState super method. Also apply the same wrapping to
getInitialContent (if not null) to ensure equal treatment of legacy HTML
strings and modern JSX/TSX methods.
Adds 'await' to ensure the download will be complete.
Without this the download might never complete. This issue occurred on a Linux OS (which seem to handle file streams a bit different than some other OSs).
Effects of not fixing this are that the java execution following this download fails for funny "corrupted jar" and other reasons - depending on the size and content of the incomplete jar file.
Minimal set of changes, not a refactor yet. Make shapez store all of
its data in a single directory whose path is provided by Electron APIs.
Useless checks and web preferences are removed and app.isPackaged is
used to detect whether the app should try to load a localhost URL.