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.
All modern browsers should support \1 as the compression prefix, even
outside of Electron or recent Chromium versions. Local storage /
IndexedDB platform wrappers were removed a while ago.
Includes prefixed document.hidden property with respective
visibilitychanged event and redundant support for navigator.language /
lack of navigator.languages check.
Quite hacky considering the complex indirection and minor differences in
the appearance of each state, as well as legacy code and need to support
HTML strings for now. Some methods could be improved, refactored or
deleted, but no major changes were made.
Mods and puzzles menu states are broken in this commit.
A previous commit has mistakenly changed the behavior of a condition
checking for standalone version. Instead of always being true, shapez
exports were only exposed if the game was built in development mode.