1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-16 03:31:52 +00:00

Add variables for shape-percentages

- Add `fullShapePercentage` and `wierdShapePercentage` to `BaseMap`
- added migration for `fullShapePercentage` and `wierdShapePercentage` in `savegame/1010.js`

Signed-off-by: Daan Breur <git@daanbreur.systems>
This commit is contained in:
Daan Breur 2021-11-27 15:12:53 +01:00
parent 564085466d
commit 3897b41d45
No known key found for this signature in database
GPG Key ID: FAD44580052ECA57
2 changed files with 12 additions and 0 deletions

View File

@ -16,6 +16,8 @@ export class BaseMap extends BasicSerializableObject {
return {
seed: types.uint,
allowNonPrimaryColors: types.bool,
fullShapePercentage: types.uint,
wierdShapePercentage: types.uint,
};
}
@ -29,6 +31,8 @@ export class BaseMap extends BasicSerializableObject {
this.seed = 0;
this.allowNonPrimaryColors = false;
this.fullShapePercentage = 0;
this.wierdShapePercentage = 0;
/**
* Mapping of 'X|Y' to chunk

View File

@ -26,5 +26,13 @@ export class SavegameInterface_V1010 extends SavegameInterface_V1009 {
if (!dump.map.hasOwnProperty("allowNonPrimaryColors")) {
dump.map.allowNonPrimaryColors = false;
}
if (!dump.map.hasOwnProperty("fullShapePercentage")) {
dump.map.fullShapePercentage = 0;
}
if (!dump.map.hasOwnProperty("wierdShapePercentage")) {
dump.map.wierdShapePercentage = 0;
}
}
}