1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-15 19:21:49 +00:00
Commit Graph

14 Commits

Author SHA1 Message Date
Даниїл Григор'єв
b3d0e30c07
Manually debounce force reload event
Remove chokidar built-in event debouncing/aggregating and replace it
with a basic custom implementation with a 250ms settle delay.
2025-06-14 22:54:06 +03:00
Даниїл Григор'єв
6c3f91e587
Basic FS watcher for --load-mod mods
Add a --watch command line flag to be used in tandem with --load-mod.
Chokidar is used to detect file updates, and a page reload is triggered
when there are any changes to watched mod files. Only mods loaded via
--load-mod are affected.

This implementation has a minor issue with how cache is cleared -
removing disk cache is a bit too aggressive - but the only alternative I
could find is to use a non-persistent Electron session, which would get
rid of disk cache entirely (this is not a concern).
2025-06-12 15:22:15 +03:00
Даниїл Григор'єв
45e99d47b8
Clean up Electron wrapper code
Remove a temporary console.log statement as well as now-unused msgpack
module.
2025-06-10 16:43:56 +03:00
Даниїл Григор'єв
efb9eee286
Remove main process compression
To be simplified and replaced with renderer-side web workers.
2025-06-10 12:15:38 +03:00
Даниїл Григор'єв
fc33cc2fbf
Add dedicated saves storage, new fs job types
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.
2025-04-15 01:57:00 +03:00
Даниїл Григор'єв
7b4cb25d5d
Respect --safe-mode once again
The new mod locator system now respects the --safe-mode command line
switch, ignoring the user and distro mod directories.
2025-04-13 01:42:06 +03:00
Даниїл Григор'єв
ad8e39bdf4
WIP: Basic ASAR modding in renderer
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.
2025-04-12 20:06:03 +03:00
Даниїл Григор'єв
499dbd269a
Basic ignore of duplicate mods
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)
2025-04-11 00:01:57 +03:00
Даниїл Григор'єв
f7d2ccccff
Preliminary ASAR mods support in main process
Consider mods broken in this commit. Many areas are unfinished and use
weird or missing types.
2025-04-11 00:01:52 +03:00
Даниїл Григор'єв
6695aa0fa0
Remove most of "preloader" code (#60)
Make the build process less complicated and reduce scatter
of renderer source code.
2025-04-06 23:13:13 +03:00
Даниїл Григор'єв
1e19a5e40d
Check fullscreen state before modifying it
Workaround for an Electron bug which causes menus to disappear when
using BrowserWindow#setFullscreen(false).
2025-04-06 01:41:56 +03:00
Даниїл Григор'єв
2997cf8daf
Handle window.open calls with external browser
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.
2025-03-27 23:02:45 +02:00
Даниїл Григор'єв
ae1cd71d3b
Fix file writes to non-existent directories
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.
2025-03-26 22:46:14 +02:00
Даниїл Григор'єв
c836589d9b
Rewrite the Electron wrapper (#47)
* 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.
2025-03-21 16:30:13 +02:00