isaacscript-common 4.8.2 → 4.9.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.
@@ -1,4 +1,11 @@
1
1
  import { DisplayFlag } from "isaac-typescript-definitions";
2
+ /**
3
+ * Helper function to set the value of `DisplayFlag` for every room on the floor to 0.
4
+ *
5
+ * This function automatically calls the `Level.UpdateVisibility` after setting the flags so that
6
+ * the changes will be immediately visible.
7
+ */
8
+ export declare function clearFloorDisplayFlags(): void;
2
9
  /**
3
10
  * Helper function to get the minimap `DisplayFlag` value for every room on the floor. Returns a map
4
11
  * that is indexed by the room's safe grid index.
@@ -3,6 +3,8 @@ local Map = ____lualib.Map
3
3
  local __TS__New = ____lualib.__TS__New
4
4
  local __TS__Iterator = ____lualib.__TS__Iterator
5
5
  local ____exports = {}
6
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
+ local DisplayFlagZero = ____isaac_2Dtypescript_2Ddefinitions.DisplayFlagZero
6
8
  local ____cachedClasses = require("cachedClasses")
7
9
  local game = ____cachedClasses.game
8
10
  local ____roomData = require("functions.roomData")
@@ -18,6 +20,17 @@ function ____exports.setRoomDisplayFlags(self, roomGridIndex, displayFlags)
18
20
  local roomDescriptor = getRoomDescriptor(nil, roomGridIndex)
19
21
  roomDescriptor.DisplayFlags = displayFlags
20
22
  end
23
+ --- Helper function to set the value of `DisplayFlag` for every room on the floor to 0.
24
+ --
25
+ -- This function automatically calls the `Level.UpdateVisibility` after setting the flags so that
26
+ -- the changes will be immediately visible.
27
+ function ____exports.clearFloorDisplayFlags(self)
28
+ local level = game:GetLevel()
29
+ for ____, room in ipairs(getRoomsInGrid(nil)) do
30
+ room.DisplayFlags = DisplayFlagZero
31
+ end
32
+ level:UpdateVisibility()
33
+ end
21
34
  --- Helper function to get the minimap `DisplayFlag` value for every room on the floor. Returns a map
22
35
  -- that is indexed by the room's safe grid index.
23
36
  function ____exports.getFloorDisplayFlags(self)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "4.8.2",
3
+ "version": "4.9.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",