1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00
This commit is contained in:
Thomas (DJ1TJOO) 2025-01-27 02:57:11 +00:00 committed by GitHub
commit 245ee31bc1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 10 deletions

View File

@ -52,7 +52,7 @@ export class AchievementProxy {
}
initialize() {
this.root.signals.achievementCheck.dispatch(ACHIEVEMENTS.darkMode, null);
this.root.signals.achievementCheck.dispatch(ACHIEVEMENTS.darkMode);
if (this.has(ACHIEVEMENTS.mam)) {
this.root.signals.entityAdded.add(this.onMamFailure, this);
@ -142,7 +142,7 @@ export class AchievementProxy {
this.root.signals.entityDestroyed.add(this.onMamFailure, this);
}
this.root.signals.achievementCheck.dispatch(ACHIEVEMENTS.mam, null);
this.root.signals.achievementCheck.dispatch(ACHIEVEMENTS.mam);
// reset on every level
this.root.savegame.currentData.stats.failedMam = false;

View File

@ -187,7 +187,7 @@ export class GameRoot {
freeEntityAreaBeforeBuild: /** @type {TypedSignal<[Entity]>} */ (new Signal()),
// Called with an achievement key and necessary args to validate it can be unlocked.
achievementCheck: /** @type {TypedSignal<[string, any]>} */ (new Signal()),
achievementCheck: /** @type {TypedSignal<[string, ...(any)[]]>} */ (new Signal()),
bulkAchievementCheck: /** @type {TypedSignal<(string|any)[]>} */ (new Signal()),
// Puzzle mode

View File

@ -97,7 +97,7 @@ export class ShapeDefinitionManager extends BasicSerializableObject {
const rightSide = definition.cloneFilteredByQuadrants([2, 3]);
const leftSide = definition.cloneFilteredByQuadrants([0, 1]);
this.root.signals.achievementCheck.dispatch(ACHIEVEMENTS.cutShape, null);
this.root.signals.achievementCheck.dispatch(ACHIEVEMENTS.cutShape);
return /** @type {[ShapeDefinition, ShapeDefinition]} */ (this.operationCache[key] = [
this.registerOrReturnHandle(rightSide),
@ -140,7 +140,7 @@ export class ShapeDefinitionManager extends BasicSerializableObject {
const rotated = definition.cloneRotateCW();
this.root.signals.achievementCheck.dispatch(ACHIEVEMENTS.rotateShape, null);
this.root.signals.achievementCheck.dispatch(ACHIEVEMENTS.rotateShape);
return /** @type {ShapeDefinition} */ (this.operationCache[key] = this.registerOrReturnHandle(
rotated
@ -195,7 +195,7 @@ export class ShapeDefinitionManager extends BasicSerializableObject {
return /** @type {ShapeDefinition} */ (this.operationCache[key]);
}
this.root.signals.achievementCheck.dispatch(ACHIEVEMENTS.stackShape, null);
this.root.signals.achievementCheck.dispatch(ACHIEVEMENTS.stackShape);
const stacked = lowerDefinition.cloneAndStackWith(upperDefinition);
return /** @type {ShapeDefinition} */ (this.operationCache[key] = this.registerOrReturnHandle(
@ -215,7 +215,7 @@ export class ShapeDefinitionManager extends BasicSerializableObject {
return /** @type {ShapeDefinition} */ (this.operationCache[key]);
}
this.root.signals.achievementCheck.dispatch(ACHIEVEMENTS.paintShape, null);
this.root.signals.achievementCheck.dispatch(ACHIEVEMENTS.paintShape);
const colorized = definition.cloneAndPaintWith(color);
return /** @type {ShapeDefinition} */ (this.operationCache[key] = this.registerOrReturnHandle(

View File

@ -328,7 +328,7 @@ export class AchievementCollection {
* @param {string} key - Maps to an Achievement
* @param {any} data - Data received from signal dispatches for validation
*/
unlock(key, data) {
unlock(key, data = null) {
if (!this.map.has(key)) {
return;
}
@ -597,7 +597,7 @@ export class AchievementCollection {
/** @param {Achievement} achievement */
initStore100Unique({ key }) {
this.unlock(key, null);
this.unlock(key);
}
/** @returns {boolean} */
@ -607,7 +607,7 @@ export class AchievementCollection {
/** @param {Achievement} achievement */
initStoreShape({ key }) {
this.unlock(key, null);
this.unlock(key);
}
/** @returns {boolean} */