isaacscript-common 30.1.0 → 30.3.0

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.
@@ -8303,6 +8303,9 @@ export declare function isRoomInsideGrid(roomGridIndex?: int): boolean;
8303
8303
  */
8304
8304
  export declare function isRoomShapeDoubleCharge(roomShape: RoomShape): boolean;
8305
8305
 
8306
+ /** Helper function to check if a given room is visible on the minimap. */
8307
+ export declare function isRoomVisible(roomGridIndex: int): boolean;
8308
+
8306
8309
  /** Returns true for cards that have `CardType.RUNE`. */
8307
8310
  export declare function isRune(cardType: CardType): boolean;
8308
8311
 
@@ -16632,6 +16635,13 @@ export declare const VectorOne: Readonly<Vector>;
16632
16635
  /** Helper function for finding out which way a vector is pointing. */
16633
16636
  export declare function vectorToDirection(vector: Vector): Direction;
16634
16637
 
16638
+ /**
16639
+ * Helper function to convert a room grid index expressed as a vector back into an integer.
16640
+ *
16641
+ * Also see the `roomGridIndexToVector` helper function.
16642
+ */
16643
+ export declare function vectorToRoomGridIndex(roomVector: Vector): int;
16644
+
16635
16645
  /**
16636
16646
  * Helper function to convert a vector to a string.
16637
16647
  *
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 30.1.0
3
+ isaacscript-common 30.3.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -47434,6 +47434,9 @@ function ____exports.roomGridIndexToVector(self, roomGridIndex)
47434
47434
  local y = math.floor(roomGridIndex / LEVEL_GRID_ROW_WIDTH)
47435
47435
  return Vector(x, y)
47436
47436
  end
47437
+ function ____exports.vectorToRoomGridIndex(self, roomVector)
47438
+ return roomVector.Y * LEVEL_GRID_ROW_WIDTH + roomVector.X
47439
+ end
47437
47440
  return ____exports
47438
47441
  end,
47439
47442
  ["src.functions.mergeTests"] = function(...)
@@ -53297,6 +53300,10 @@ function ____exports.hideRoomOnMinimap(self, roomGridIndex)
53297
53300
  minimapAPIRoomDescriptor.Hidden = true
53298
53301
  end
53299
53302
  end
53303
+ function ____exports.isRoomVisible(self, roomGridIndex)
53304
+ local roomDisplayFlags = ____exports.getRoomDisplayFlags(nil, roomGridIndex)
53305
+ return roomDisplayFlags ~= DisplayFlagZero
53306
+ end
53300
53307
  function ____exports.setFloorDisplayFlags(self, displayFlagsMap)
53301
53308
  for ____, ____value in __TS__Iterator(displayFlagsMap) do
53302
53309
  local roomGridIndex = ____value[1]
@@ -200,4 +200,10 @@ export declare function roomExists(roomGridIndex: int): boolean;
200
200
  * - The bottom-right grid index of 168 is equal to coordinates of: (12, 12)
201
201
  */
202
202
  export declare function roomGridIndexToVector(roomGridIndex: int): Vector;
203
+ /**
204
+ * Helper function to convert a room grid index expressed as a vector back into an integer.
205
+ *
206
+ * Also see the `roomGridIndexToVector` helper function.
207
+ */
208
+ export declare function vectorToRoomGridIndex(roomVector: Vector): int;
203
209
  //# sourceMappingURL=levelGrid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"levelGrid.d.ts","sourceRoot":"","sources":["../../../src/functions/levelGrid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,QAAQ,EAKR,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AA+BtC;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,EAAE,CAK7E;AAED;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACnD,aAAa,CAAC,EAAE,GAAG,GAClB,GAAG,EAAE,CAKP;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,EAAE,CAerE;AAED,0FAA0F;AAC1F,wBAAgB,qBAAqB,IAAI,GAAG,EAAE,CAG7C;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,GAAE,IAAI,GAAG,GAAqB,GAErC,CAAC,qBAAqB,EA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E,SAAS,GACnB,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,CAa5B;AAED;;;;;;GAMG;AACH,wBAAgB,0CAA0C,CACxD,iBAAiB,EAAE,GAAG,EACtB,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,CAa5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAKtD;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,GAAG,GACjB,OAAO,CAGT;AAED,wBAAgB,oCAAoC,CAClD,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,GAAG,GACjB,OAAO,CAqBT;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAGzD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAM7D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,SAAS,CAkD/D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,OAAO,CAGtD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,GAAG,GAAG,MAAM,CAKhE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAE7D"}
@@ -420,4 +420,10 @@ function ____exports.roomGridIndexToVector(self, roomGridIndex)
420
420
  local y = math.floor(roomGridIndex / LEVEL_GRID_ROW_WIDTH)
421
421
  return Vector(x, y)
422
422
  end
423
+ --- Helper function to convert a room grid index expressed as a vector back into an integer.
424
+ --
425
+ -- Also see the `roomGridIndexToVector` helper function.
426
+ function ____exports.vectorToRoomGridIndex(self, roomVector)
427
+ return roomVector.Y * LEVEL_GRID_ROW_WIDTH + roomVector.X
428
+ end
423
429
  return ____exports
@@ -64,6 +64,8 @@ export declare function getRoomDisplayFlags(roomGridIndex?: int, minimapAPI?: bo
64
64
  * This function automatically accounts for whether or not MinimapAPI is being used.
65
65
  */
66
66
  export declare function hideRoomOnMinimap(roomGridIndex: int): void;
67
+ /** Helper function to check if a given room is visible on the minimap. */
68
+ export declare function isRoomVisible(roomGridIndex: int): boolean;
67
69
  /**
68
70
  * Helper function to set the minimap `DisplayFlag` value for every room on the floor at once.
69
71
  *
@@ -1 +1 @@
1
- {"version":3,"file":"minimap.d.ts","sourceRoot":"","sources":["../../../src/functions/minimap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAmB,MAAM,8BAA8B,CAAC;AAM5E;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,GAAG,GAAG,SAAS,EAC9B,WAAW,EAAE,WAAW,EACxB,gBAAgB,UAAO,GACtB,IAAI,CAIN;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAE9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,UAAO,GAChB,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAUjC;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,CAAC,EAAE,GAAG,EACnB,UAAU,UAAO,GAChB,QAAQ,CAAC,WAAW,CAAC,CAiBvB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAe1D;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,QAAQ,CAAC,WAAW,CAAC,GA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W,CAAC,GAAG,IAAI,CAW5E;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,GAC/C,IAAI,CAWN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,GAAG,GAAG,SAAS,EAC9B,YAAY,EAAE,QAAQ,CAAC,WAAW,CAAC,EACnC,gBAAgB,UAAO,GACtB,IAAI,CAsBN"}
@@ -162,6 +162,11 @@ function ____exports.hideRoomOnMinimap(self, roomGridIndex)
162
162
  minimapAPIRoomDescriptor.Hidden = true
163
163
  end
164
164
  end
165
+ --- Helper function to check if a given room is visible on the minimap.
166
+ function ____exports.isRoomVisible(self, roomGridIndex)
167
+ local roomDisplayFlags = ____exports.getRoomDisplayFlags(nil, roomGridIndex)
168
+ return roomDisplayFlags ~= DisplayFlagZero
169
+ end
165
170
  --- Helper function to set the minimap `DisplayFlag` value for multiple rooms at once.
166
171
  --
167
172
  -- This function automatically calls the `Level.UpdateVisibility` after setting the flags so that
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "30.1.0",
3
+ "version": "30.3.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -558,3 +558,12 @@ export function roomGridIndexToVector(roomGridIndex: int): Vector {
558
558
 
559
559
  return Vector(x, y);
560
560
  }
561
+
562
+ /**
563
+ * Helper function to convert a room grid index expressed as a vector back into an integer.
564
+ *
565
+ * Also see the `roomGridIndexToVector` helper function.
566
+ */
567
+ export function vectorToRoomGridIndex(roomVector: Vector): int {
568
+ return roomVector.Y * LEVEL_GRID_ROW_WIDTH + roomVector.X;
569
+ }
@@ -134,6 +134,12 @@ export function hideRoomOnMinimap(roomGridIndex: int): void {
134
134
  }
135
135
  }
136
136
 
137
+ /** Helper function to check if a given room is visible on the minimap. */
138
+ export function isRoomVisible(roomGridIndex: int): boolean {
139
+ const roomDisplayFlags = getRoomDisplayFlags(roomGridIndex);
140
+ return roomDisplayFlags !== DisplayFlagZero;
141
+ }
142
+
137
143
  /**
138
144
  * Helper function to set the minimap `DisplayFlag` value for every room on the floor at once.
139
145
  *