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

1177 Commits

Author SHA1 Message Date
Даниїл Григор'єв
82dae1158e
Re-implement compression workers and abstraction
Implement DefaultCompression class along with a generic interface to
facilitate easy to use compression in a background thread, and make use
of this class in Storage implementation by default.
2025-06-10 16:46:28 +03:00
Даниїл Григор'єв
3c331b8214
Fix main menu not waiting for savegame import
Does not fix the savegame list bugs. Note that savegame index
serialization happens a few times for some reason, this is out of scope
for this commit though.
2025-06-10 16:45:21 +03:00
Даниїл Григор'єв
3abfa9c35d
Fix unhandled savegame error not being displayed
Move the file loading code into the try/catch block, as it can and will
produce errors eventually.
2025-05-04 03:19:22 +03:00
Даниїл Григор'єв
2b890466b0
Merge pull request #69 from tobspr-games/dengr1065/new-savegame-storage
Implement gzipped MessagePack savegame storage
2025-05-03 00:47:29 +03:00
Даниїл Григор'єв
6e81afd372
Remove some compression leftovers
Remove the CRC dependency and "binary file salt" in globalConfig.
2025-04-18 11:09:45 +03:00
Даниїл Григор'єв
f25c1db611
Enable Arabic language
As per author's request. The translation was already good enough, and
now the author wrote to me about this.
2025-04-16 16:46:34 +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
Даниїл Григор'єв
6b7cfa1b1b
Pass storage object to ReadWriteProxy
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.
2025-04-14 17:48:35 +03:00
Даниїл Григор'єв
c61825e8b3
Remove savegame object compression
Preparation for further changes. Savegames that are not compressed are
much bigger, but this is a rather complex algorithm that shouldn't
exist.
2025-04-14 03:17:08 +03:00
Даниїл Григор'єв
2b8709dd3e
Fix savegame load error on missing mod website
Not a proper fix, but this thing needs a huge refactor anyway. Goodbye,
a bug that existed ever since the first version of mod support!
2025-04-13 04:15:55 +03:00
Даниїл Григор'єв
d95fce7033
Fix broken mods state appearance
Not a complete rework. This is just a temporary improvement.
2025-04-13 03:44:30 +03:00
Даниїл Григор'єв
c9d2a16ada
Create ModInterfaceV2 for cool stuff
For now it only includes a helper function to resolve file URLs and a
method that adds a CSS stylesheet to the document.
2025-04-13 02:58:41 +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
Даниїл Григор'єв
321f517593
Remove game version check
Doesn't make much sense with how experimental CE is right now. A
different logic for checking whether a mod is compatible will be used
later.
2025-04-11 00:04:14 +03:00
Даниїл Григор'єв
0ba90b7b43
Remove externalModUrl
Remove the debug option and code that used it. It is redundant due to
existence of --load-mod in the Electron wrapper.
2025-04-11 00:01:57 +03:00
Даниїл Григор'єв
c4e9d417b3
Re-use global app variable in ModLoader
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.
2025-04-11 00:01:57 +03:00
Даниїл Григор'єв
412221c4b8
Remove leftover callback check
Was removed completely along with the preloader script.
2025-04-11 00:01:57 +03:00
Даниїл Григор'єв
f9ad135fe3
Merge pull request #63 from tobspr-games/dengr1065/remove-achievements
Remove support for achievements
2025-04-08 17:26:06 +03:00
Даниїл Григор'єв
519128a70a
Remove savegame stats (achievements data)
No longer used as achievements are gone.

Also, avoid copying the old savegame dump object. This is possible
thanks to this change.
2025-04-08 16:59:40 +03:00
Даниїл Григор'єв
7ca3bf9664
Remove achievement support
Suggested by @SkimnerPhi. If needed, mods should provide their own
support for achievements. For vanilla this is dead code.
2025-04-08 15:39:14 +03:00
Даниїл Григор'єв
c265145c19
Clean up SCSS stylesheets
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.
2025-04-08 14:17:16 +03:00
Даниїл Григор'єв
b26a43c57c
Remove changelog skins
The feature wasn't used in the last 2 years anyway.
2025-04-08 14:15:20 +03:00
Даниїл Григор'єв
b057382328
Mass-rename rotater -> rotator (#51)
Rename all references of rotater to rotator, including code, styles,
assets and translation files.
2025-04-04 22:55:24 +03: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
Даниїл Григор'єв
7882533daf
Fix TextualGameState HTML string fallback
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.
2024-09-23 23:39:07 +03:00
Даниїл Григор'єв
7dac0baa6b
Merge pull request #39 from tobspr-games/dengr1065/textual-game-state-work
Basic support for JSX/TSX in GameStates
2024-09-22 11:21:26 +03:00
Даниїл Григор'єв
8955e37c78
Simplify GameState legacy HTML string support
Move the getInnerHTML fallback to the default implementation of
getContentLayout; this allows for code reuse in TextualGameState too.
2024-09-21 21:41:12 +03:00
Даниїл Григор'єв
ad6e3c3b92
Fix Vector#equalsEpsilon ignoring parameter
Provided epsilon parameter was used for Y axis but ignored for X axis.
Some useless return statements are also removed.
2024-07-26 18:59:55 +03:00
Даниїл Григор'єв
67f7babd09
Drop support for SHA1 checksums
Also remove an unused function and switch to crypto.randomUUID() for
savegame ID generation.
2024-07-26 18:01:38 +03:00
Даниїл Григор'єв
bbde68df23
Remove some polyfills
The Math polyfills might still be needed (even though they are polluting
the Math object) and I'm not sure about DOM polyfills yet.
2024-07-26 17:48:52 +03:00
Даниїл Григор'єв
ed44ff1ebe
Remove prefixed imageSmoothingEnabled
webkitImageSmoothingEnabled got deprecated back in 2016.
globalConfig.smoothing.quality is now properly typed as well.
2024-07-26 17:39:38 +03:00
Даниїл Григор'єв
79c4f3b9b0
[TS] Rename globalConfig 2024-07-26 17:36:31 +03:00
Даниїл Григор'єв
e618776013
Minor globalConfig and unused code cleanup
Remove secrets that are no longer used and fetchDiscounts preload step.
2024-07-26 17:01:57 +03:00
Даниїл Григор'єв
bf0e3f7949
Remove compression prefix fallback
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.
2024-07-26 16:27:31 +03:00
Даниїл Григор'єв
89ca498613
Remove some legacy browser support code
Includes prefixed document.hidden property with respective
visibilitychanged event and redundant support for navigator.language /
lack of navigator.languages check.
2024-07-26 16:24:20 +03:00
Даниїл Григор'єв
a3d82cc46a
Remove accessNestedPropertyReverse
Obfuscation is useless in an open source game.
2024-07-26 16:15:41 +03:00
Даниїл Григор'єв
ec8a6dec18
Rewrite mods state
Most existing mods aren't going to work in CE and the system will be
reworked some time later, so this will work for now.
2024-07-21 03:56:50 +03:00
Даниїл Григор'єв
0fe28a7cd1
[TS] Rename ModsState 2024-07-21 03:08:17 +03:00
Даниїл Григор'єв
69ce8ffc17
Basic JSX support in states
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.
2024-07-21 02:46:48 +03:00
Даниїл Григор'єв
a2b21cc6dd
Fix all instances of "reciever" typo 2024-07-21 02:27:06 +03:00
Даниїл Григор'єв
178744e065
[TS] Rename TextualGameState
This time with .tsx extension.
2024-07-21 01:48:43 +03:00
Даниїл Григор'єв
3a20244e38
Use @ exclusively for root imports
Remove "root" resolve alias and now-redundant jsx-runtime alias.
2024-07-21 01:38:08 +03:00
Даниїл Григор'єв
78b9ab49f1
Allow Node in JSX runtime
The typings are not consistent, but they seem to work. I'll leave the
rest as-is and just hope that someone fixes them later.
2024-07-20 13:35:11 +03:00
Даниїл Григор'єв
400a4cae37
[TS] Rename GameState 2024-07-20 13:34:13 +03:00
Даниїл Григор'єв
26e854f983
[TS] Rename TextualGameState 2024-07-11 11:13:57 +03:00
Даниїл Григор'єв
ad8eccef55
Avoid direct HubGoals#storedShapes access
Use getShapesStored and getShapesStoredByKey when possible instead. Only
covers usages outside of hub goals.
2024-07-11 10:36:44 +03:00
Даниїл Григор'єв
318baaa42d
Fix shapez exports not being exposed in production
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.
2024-07-02 15:09:51 +03:00
Даниїл Григор'єв
4bf8011b88
Remove unused typehints block 2024-06-25 21:15:50 +03:00
Даниїл Григор'єв
1e24b11834
Fix external link handling 2024-06-20 19:46:26 +03:00
Даниїл Григор'єв
0e7082dbbd
Get rid of more Steam leftovers 2024-06-20 18:31:52 +03:00