isaacscript-common 3.4.1 → 3.4.2

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.
@@ -1,3 +1,4 @@
1
1
  export declare type PostRoomClearChangedRegisterParameters = [
2
- callback: (roomClear: boolean) => void
2
+ callback: (roomClear: boolean) => void,
3
+ roomClear?: boolean
3
4
  ];
@@ -16,7 +16,14 @@ end
16
16
  function ____exports.postRoomClearChangedFire(self, roomClear)
17
17
  for ____, ____value in ipairs(subscriptions) do
18
18
  local callback = ____value[1]
19
- callback(nil, roomClear)
19
+ local callbackRoomClear = ____value[2]
20
+ do
21
+ if callbackRoomClear ~= nil and callbackRoomClear ~= roomClear then
22
+ goto __continue5
23
+ end
24
+ callback(nil, roomClear)
25
+ end
26
+ ::__continue5::
20
27
  end
21
28
  end
22
29
  return ____exports
@@ -880,6 +880,9 @@ export declare enum ModCallbackCustom {
880
880
  /**
881
881
  * Fires from the `POST_UPDATE` callback when the clear state of a room changes.
882
882
  *
883
+ * When registering the callback, takes an optional second argument that will make the callback
884
+ * only fire if the room clear state matches the boolean provided.
885
+ *
883
886
  * ```ts
884
887
  * function postRoomClearChanged(roomClear: boolean): void {}
885
888
  * ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "3.4.1",
3
+ "version": "3.4.2",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",