isaacscript-common 30.2.0 → 30.4.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,15 @@ export declare function isRoomInsideGrid(roomGridIndex?: int): boolean;
8303
8303
  */
8304
8304
  export declare function isRoomShapeDoubleCharge(roomShape: RoomShape): boolean;
8305
8305
 
8306
+ /**
8307
+ * Helper function to check if a given room is visible on the minimap.
8308
+ *
8309
+ * @param roomGridIndex The room to check.
8310
+ * @param minimapAPI Optional. Whether or not MinimapAPI should be used, if present. Default is
8311
+ * true.
8312
+ */
8313
+ export declare function isRoomVisible(roomGridIndex: int, minimapAPI?: boolean): boolean;
8314
+
8306
8315
  /** Returns true for cards that have `CardType.RUNE`. */
8307
8316
  export declare function isRune(cardType: CardType): boolean;
8308
8317
 
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 30.2.0
3
+ isaacscript-common 30.4.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -53300,6 +53300,13 @@ function ____exports.hideRoomOnMinimap(self, roomGridIndex)
53300
53300
  minimapAPIRoomDescriptor.Hidden = true
53301
53301
  end
53302
53302
  end
53303
+ function ____exports.isRoomVisible(self, roomGridIndex, minimapAPI)
53304
+ if minimapAPI == nil then
53305
+ minimapAPI = true
53306
+ end
53307
+ local roomDisplayFlags = ____exports.getRoomDisplayFlags(nil, roomGridIndex, minimapAPI)
53308
+ return roomDisplayFlags ~= DisplayFlagZero
53309
+ end
53303
53310
  function ____exports.setFloorDisplayFlags(self, displayFlagsMap)
53304
53311
  for ____, ____value in __TS__Iterator(displayFlagsMap) do
53305
53312
  local roomGridIndex = ____value[1]
@@ -64,6 +64,14 @@ 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
+ /**
68
+ * Helper function to check if a given room is visible on the minimap.
69
+ *
70
+ * @param roomGridIndex The room to check.
71
+ * @param minimapAPI Optional. Whether or not MinimapAPI should be used, if present. Default is
72
+ * true.
73
+ */
74
+ export declare function isRoomVisible(roomGridIndex: int, minimapAPI?: boolean): boolean;
67
75
  /**
68
76
  * Helper function to set the minimap `DisplayFlag` value for every room on the floor at once.
69
77
  *
@@ -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,GAAG,IAAI,CAW5E;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,WAAW,CAAC,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AAE,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,18 @@ 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
+ --
167
+ -- @param roomGridIndex The room to check.
168
+ -- @param minimapAPI Optional. Whether or not MinimapAPI should be used, if present. Default is
169
+ -- true.
170
+ function ____exports.isRoomVisible(self, roomGridIndex, minimapAPI)
171
+ if minimapAPI == nil then
172
+ minimapAPI = true
173
+ end
174
+ local roomDisplayFlags = ____exports.getRoomDisplayFlags(nil, roomGridIndex, minimapAPI)
175
+ return roomDisplayFlags ~= DisplayFlagZero
176
+ end
165
177
  --- Helper function to set the minimap `DisplayFlag` value for multiple rooms at once.
166
178
  --
167
179
  -- 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.2.0",
3
+ "version": "30.4.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -134,6 +134,18 @@ export function hideRoomOnMinimap(roomGridIndex: int): void {
134
134
  }
135
135
  }
136
136
 
137
+ /**
138
+ * Helper function to check if a given room is visible on the minimap.
139
+ *
140
+ * @param roomGridIndex The room to check.
141
+ * @param minimapAPI Optional. Whether or not MinimapAPI should be used, if present. Default is
142
+ * true.
143
+ */
144
+ export function isRoomVisible(roomGridIndex: int, minimapAPI = true): boolean {
145
+ const roomDisplayFlags = getRoomDisplayFlags(roomGridIndex, minimapAPI);
146
+ return roomDisplayFlags !== DisplayFlagZero;
147
+ }
148
+
137
149
  /**
138
150
  * Helper function to set the minimap `DisplayFlag` value for every room on the floor at once.
139
151
  *