isaacscript-common 9.17.0 → 9.17.1

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 +1 @@
1
- {"version":3,"file":"postPurchase.d.ts","sourceRoot":"","sources":["../../../src/callbacks/subscriptions/postPurchase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,oBAAY,8BAA8B,GAAG;IAC3C,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,KAAK,IAAI;IAC9D,aAAa,CAAC,EAAE,aAAa;IAC7B,aAAa,CAAC,EAAE,GAAG;CACpB,CAAC;AAIF,wBAAgB,4BAA4B,IAAI,OAAO,CAEtD;AAED,wBAAgB,oBAAoB,CAClC,GAAG,IAAI,EAAE,8BAA8B,GACtC,IAAI,CAEN;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,YAAY,GACnB,IAAI,CAIN"}
1
+ {"version":3,"file":"postPurchase.d.ts","sourceRoot":"","sources":["../../../src/callbacks/subscriptions/postPurchase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,oBAAY,8BAA8B,GAAG;IAC3C,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,KAAK,IAAI;IAC9D,aAAa,CAAC,EAAE,aAAa;IAC7B,aAAa,CAAC,EAAE,GAAG;CACpB,CAAC;AAIF,wBAAgB,4BAA4B,IAAI,OAAO,CAEtD;AAED,wBAAgB,oBAAoB,CAClC,GAAG,IAAI,EAAE,8BAA8B,GACtC,IAAI,CAEN;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,YAAY,GACnB,IAAI,CAwBN"}
@@ -10,7 +10,18 @@ end
10
10
  function ____exports.postPurchaseFire(self, player, pickup)
11
11
  for ____, ____value in ipairs(subscriptions) do
12
12
  local callback = ____value[1]
13
- callback(nil, player, pickup)
13
+ local callbackPickupVariant = ____value[2]
14
+ local callbackPickupSubType = ____value[3]
15
+ do
16
+ if callbackPickupVariant ~= nil and callbackPickupVariant ~= pickup.Variant then
17
+ goto __continue5
18
+ end
19
+ if callbackPickupSubType ~= nil and callbackPickupSubType ~= pickup.SubType then
20
+ goto __continue5
21
+ end
22
+ callback(nil, player, pickup)
23
+ end
24
+ ::__continue5::
14
25
  end
15
26
  end
16
27
  return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "9.17.0",
3
+ "version": "9.17.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -22,7 +22,27 @@ export function postPurchaseFire(
22
22
  player: EntityPlayer,
23
23
  pickup: EntityPickup,
24
24
  ): void {
25
- for (const [callback] of subscriptions) {
25
+ for (const [
26
+ callback,
27
+ callbackPickupVariant,
28
+ callbackPickupSubType,
29
+ ] of subscriptions) {
30
+ // Handle the optional 2nd callback argument.
31
+ if (
32
+ callbackPickupVariant !== undefined &&
33
+ callbackPickupVariant !== pickup.Variant
34
+ ) {
35
+ continue;
36
+ }
37
+
38
+ // Handle the optional 3rd callback argument.
39
+ if (
40
+ callbackPickupSubType !== undefined &&
41
+ callbackPickupSubType !== pickup.SubType
42
+ ) {
43
+ continue;
44
+ }
45
+
26
46
  callback(player, pickup);
27
47
  }
28
48
  }