excalibur 0.32.0-alpha.1561 → 0.32.0-alpha.1563

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -38,6 +38,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
38
38
 
39
39
  ### Fixed
40
40
 
41
+ - Fixed issue where clearSchedule during a scheduled callback could cause a cb to be skipped
41
42
  - Fixed issue where the Loader could run twice even if already loaded when included in the scene loader.
42
43
  - Fixed issue where pixel ratio was accidentally doubled during load if the loader was included in the scene loader.
43
44
  - Fixed issue where Slide trasition did not work properly when DisplayMode was FitScreenAndFill
@@ -301,7 +301,7 @@ export declare class Entity<TKnownComponents extends Component = any> implements
301
301
  */
302
302
  onAdd(engine: Engine): void;
303
303
  /**
304
- * `onRemove` is called when Actor is added to scene. This method is meant to be
304
+ * `onRemove` is called when Actor is removed from a scene. This method is meant to be
305
305
  * overridden.
306
306
  *
307
307
  * Synonymous with the event handler `.on('remove', (evt) => {...})`
@@ -63,6 +63,7 @@ export declare abstract class Clock {
63
63
  * @returns A unique identifier that can be used to clear the scheduled callback with {@apilink clearSchedule}
64
64
  */
65
65
  schedule(cb: (elapsed: number) => any, timeoutMs?: number, timing?: ScheduledCallbackTiming): ScheduleId;
66
+ private _idsToRemove;
66
67
  /**
67
68
  * Clears a scheduled callback using the ID returned from {@apilink schedule}
68
69
  * @param id The ID of the scheduled callback to clear
@@ -1,4 +1,4 @@
1
- /*! excalibur - 0.32.0-alpha.1561+0fa0a62 - 2025-11-13
1
+ /*! excalibur - 0.32.0-alpha.1563+eadef91 - 2025-11-24
2
2
  https://github.com/excaliburjs/Excalibur
3
3
  Copyright (c) 2025 Excalibur.js <https://github.com/excaliburjs/Excalibur/graphs/contributors>
4
4
  Licensed BSD-2-Clause
@@ -5296,7 +5296,7 @@ mask: ${(this.mask >>> 0).toString(2).padStart(32, "0")}
5296
5296
  onAdd(engine) {
5297
5297
  }
5298
5298
  /**
5299
- * `onRemove` is called when Actor is added to scene. This method is meant to be
5299
+ * `onRemove` is called when Actor is removed from a scene. This method is meant to be
5300
5300
  * overridden.
5301
5301
  *
5302
5302
  * Synonymous with the event handler `.on('remove', (evt) => {...})`
@@ -29173,6 +29173,7 @@ If you want to do custom drawing, use Actor.graphics, or any onPreDraw or onPost
29173
29173
  this._scheduledCbs = [];
29174
29174
  this._totalElapsed = 0;
29175
29175
  this._nextScheduleId = 0;
29176
+ this._idsToRemove = [];
29176
29177
  var _a, _b, _c;
29177
29178
  this._options = options;
29178
29179
  this.tick = options.tick;
@@ -29234,10 +29235,7 @@ If you want to do custom drawing, use Actor.graphics, or any onPreDraw or onPost
29234
29235
  * @param id The ID of the scheduled callback to clear
29235
29236
  */
29236
29237
  clearSchedule(id) {
29237
- const index = this._scheduledCbs.findIndex(([scheduleId]) => scheduleId === id);
29238
- if (index !== -1) {
29239
- this._scheduledCbs.splice(index, 1);
29240
- }
29238
+ this._idsToRemove.push(id);
29241
29239
  }
29242
29240
  /**
29243
29241
  * Called internally to trigger scheduled callbacks in the clock
@@ -29246,12 +29244,21 @@ If you want to do custom drawing, use Actor.graphics, or any onPreDraw or onPost
29246
29244
  */
29247
29245
  __runScheduledCbs(timing = "preframe") {
29248
29246
  for (let i = this._scheduledCbs.length - 1; i > -1; i--) {
29249
- const [_, callback, scheduledTime, callbackTiming] = this._scheduledCbs[i];
29247
+ const [scheduleId, callback, scheduledTime, callbackTiming] = this._scheduledCbs[i];
29248
+ if (this._idsToRemove.includes(scheduleId)) {
29249
+ continue;
29250
+ }
29250
29251
  if (timing === callbackTiming && scheduledTime <= this._totalElapsed) {
29251
29252
  callback(this._elapsed);
29252
29253
  this._scheduledCbs.splice(i, 1);
29253
29254
  }
29254
29255
  }
29256
+ for (const id of this._idsToRemove) {
29257
+ const index = this._scheduledCbs.findIndex(([scheduleId]) => scheduleId === id);
29258
+ if (index !== -1) {
29259
+ this._scheduledCbs.splice(index, 1);
29260
+ }
29261
+ }
29255
29262
  }
29256
29263
  update(overrideUpdateMs) {
29257
29264
  try {
@@ -33036,7 +33043,7 @@ Read more about this issue at https://excaliburjs.com/docs/performance`
33036
33043
  this._count += count;
33037
33044
  }
33038
33045
  }
33039
- const EX_VERSION = "0.32.0-alpha.1561+0fa0a62";
33046
+ const EX_VERSION = "0.32.0-alpha.1563+eadef91";
33040
33047
  polyfill();
33041
33048
  exports2.ActionCompleteEvent = ActionCompleteEvent;
33042
33049
  exports2.ActionContext = ActionContext;
@@ -1,4 +1,4 @@
1
- /*! excalibur - 0.32.0-alpha.1561+0fa0a62 - 2025-11-13
1
+ /*! excalibur - 0.32.0-alpha.1563+eadef91 - 2025-11-24
2
2
  https://github.com/excaliburjs/Excalibur
3
3
  Copyright (c) 2025 Excalibur.js <https://github.com/excaliburjs/Excalibur/graphs/contributors>
4
4
  Licensed BSD-2-Clause
@@ -5296,7 +5296,7 @@ mask: ${(this.mask >>> 0).toString(2).padStart(32, "0")}
5296
5296
  onAdd(engine) {
5297
5297
  }
5298
5298
  /**
5299
- * `onRemove` is called when Actor is added to scene. This method is meant to be
5299
+ * `onRemove` is called when Actor is removed from a scene. This method is meant to be
5300
5300
  * overridden.
5301
5301
  *
5302
5302
  * Synonymous with the event handler `.on('remove', (evt) => {...})`
@@ -29173,6 +29173,7 @@ If you want to do custom drawing, use Actor.graphics, or any onPreDraw or onPost
29173
29173
  this._scheduledCbs = [];
29174
29174
  this._totalElapsed = 0;
29175
29175
  this._nextScheduleId = 0;
29176
+ this._idsToRemove = [];
29176
29177
  var _a, _b, _c;
29177
29178
  this._options = options;
29178
29179
  this.tick = options.tick;
@@ -29234,10 +29235,7 @@ If you want to do custom drawing, use Actor.graphics, or any onPreDraw or onPost
29234
29235
  * @param id The ID of the scheduled callback to clear
29235
29236
  */
29236
29237
  clearSchedule(id) {
29237
- const index = this._scheduledCbs.findIndex(([scheduleId]) => scheduleId === id);
29238
- if (index !== -1) {
29239
- this._scheduledCbs.splice(index, 1);
29240
- }
29238
+ this._idsToRemove.push(id);
29241
29239
  }
29242
29240
  /**
29243
29241
  * Called internally to trigger scheduled callbacks in the clock
@@ -29246,12 +29244,21 @@ If you want to do custom drawing, use Actor.graphics, or any onPreDraw or onPost
29246
29244
  */
29247
29245
  __runScheduledCbs(timing = "preframe") {
29248
29246
  for (let i = this._scheduledCbs.length - 1; i > -1; i--) {
29249
- const [_, callback, scheduledTime, callbackTiming] = this._scheduledCbs[i];
29247
+ const [scheduleId, callback, scheduledTime, callbackTiming] = this._scheduledCbs[i];
29248
+ if (this._idsToRemove.includes(scheduleId)) {
29249
+ continue;
29250
+ }
29250
29251
  if (timing === callbackTiming && scheduledTime <= this._totalElapsed) {
29251
29252
  callback(this._elapsed);
29252
29253
  this._scheduledCbs.splice(i, 1);
29253
29254
  }
29254
29255
  }
29256
+ for (const id of this._idsToRemove) {
29257
+ const index = this._scheduledCbs.findIndex(([scheduleId]) => scheduleId === id);
29258
+ if (index !== -1) {
29259
+ this._scheduledCbs.splice(index, 1);
29260
+ }
29261
+ }
29255
29262
  }
29256
29263
  update(overrideUpdateMs) {
29257
29264
  try {
@@ -33036,7 +33043,7 @@ Read more about this issue at https://excaliburjs.com/docs/performance`
33036
33043
  this._count += count;
33037
33044
  }
33038
33045
  }
33039
- const EX_VERSION = "0.32.0-alpha.1561+0fa0a62";
33046
+ const EX_VERSION = "0.32.0-alpha.1563+eadef91";
33040
33047
  polyfill();
33041
33048
  exports2.ActionCompleteEvent = ActionCompleteEvent;
33042
33049
  exports2.ActionContext = ActionContext;