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

2473 Commits

Author SHA1 Message Date
Даниїл Григор'єв
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
Даниїл Григор'єв
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
Даниїл Григор'єв
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
Даниїл Григор'єв
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
Даниїл Григор'єв
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
Даниїл Григор'єв
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
Даниїл Григор'єв
75e306ec59
Migrate from Yarn Classic to npm (#65)
* 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.
2025-04-10 23:22:03 +03:00
Даниїл Григор'єв
3624cf2f65
Remove some unused translation strings
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.
2025-04-10 03:10:47 +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
Даниїл Григор'єв
5bbbcceb18
Remove unused build pipeline code 2025-04-08 14:18:20 +03:00
Даниїл Григор'єв
257df8b319
Remove some unused resources
There might be more that I haven't noticed yet.
2025-04-08 14:17:16 +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
Даниїл Григор'єв
0f7201c232
Remove unused build variants
Only remove a small amount of code, other changes to build variants are
pending.
2025-04-08 14:15:20 +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
Даниїл Григор'єв
d998f5a625
Merge pull request #59 from tobspr-games/dengr1065/fullscreen-menu-bug
Fix disappearing window menu on Linux
2025-04-06 01:47:32 +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
Даниїл Григор'єв
e56732431a
Merge pull request #49 from tobspr-games/dengr1065/electron-fixup
Fix some issues with the Electron wrapper refactor
2025-04-06 00:00:54 +03:00
Даниїл Григор'єв
d8389af2b5
Merge pull request #55 from tobspr-games/dengr1065/remove-short-theme
Remove unused theme-short.mp3
2025-04-05 23:41:13 +03:00
Даниїл Григор'єв
a9aab92bbb
Remove theme-short.mp3
Not used anywhere. Reduces size of each uncompressed bundle by 6 MB.
2025-04-05 22:52:25 +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
Даниїл Григор'єв
8e87398c3c
Update TypeScript packages
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.
2025-03-29 20:11:07 +02: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
Даниїл Григор'єв
03bf14f10a
Add missing TypeScript package and update readme
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.
2025-03-26 22:23:17 +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
Mohamed A. Abdallah
17a18fce41
Adding full Arabic Translation (#46)
* 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
2025-03-15 22:11:42 +02:00
Даниїл Григор'єв
7814c3a15a
Merge pull request #44 from tobspr-games/fix/tgs-fallback
Fix TextualGameState HTML string fallback
2024-09-23 23:48:10 +03: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
Даниїл Григор'єв
4e2694922d
Merge pull request #43 from ozgurozbek/patch-1
Update base-tr.yaml
2024-09-16 21:38:44 +03:00
Даниїл Григор'єв
ef2591d0f8
Merge pull request #42 from Ecconia/fix-texturepacker-download
Fix runnable-textpacker.jar download
2024-08-29 23:24:17 +03:00
Ecconia
241f166989
Fix runnable-textpacker.jar download
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.
2024-08-29 22:16:51 +02:00
Даниїл Григор'єв
6ff5cc26d2
Merge pull request #41 from tobspr-games/dengr1065/electron-updates
Update the Electron wrapper
2024-08-13 12:12:22 +03:00
Даниїл Григор'єв
a2e192f610
Modify Electron wrapper
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.
2024-07-27 23:08:57 +03:00