mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Fix serialization errors and implement hub deserialization
This commit is contained in:
@@ -35,7 +35,24 @@ export class HubGoals extends BasicSerializableObject {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
console.error("TODO: HubGoals deserialize() properly");
|
||||
// Compute gained rewards
|
||||
for (let i = 0; i < this.level; ++i) {
|
||||
if (i < tutorialGoals.length) {
|
||||
const reward = tutorialGoals[i].reward;
|
||||
this.gainedRewards[reward] = (this.gainedRewards[reward] || 0) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Compute upgrade improvements
|
||||
for (const upgradeId in UPGRADES) {
|
||||
const upgradeHandle = UPGRADES[upgradeId];
|
||||
const level = this.upgradeLevels[upgradeId] || 0;
|
||||
let totalImprovement = upgradeHandle.baseValue || 1;
|
||||
for (let i = 0; i < level; ++i) {
|
||||
totalImprovement += upgradeHandle.tiers[i].improvement;
|
||||
}
|
||||
this.upgradeImprovements[upgradeId] = totalImprovement;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -80,7 +80,6 @@ export class HUDGameMenu extends BaseHUDPart {
|
||||
}
|
||||
|
||||
onGameSaved() {
|
||||
console.log("ON GAME SAVED");
|
||||
this.saveButton.classList.toggle("animEven");
|
||||
this.saveButton.classList.toggle("animOdd");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user