isaacscript-common 29.8.0 → 29.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.
@@ -5106,8 +5106,11 @@ export declare function getFlagName<T extends BitFlag | BitFlag128>(flag: BitFla
5106
5106
  * that is indexed by the room's safe grid index.
5107
5107
  *
5108
5108
  * This function automatically accounts for whether or not MinimapAPI is being used.
5109
+ *
5110
+ * @param minimapAPI Optional. Whether or not MinimapAPI should be used, if present. Default is
5111
+ * true.
5109
5112
  */
5110
- export declare function getFloorDisplayFlags(): Map<int, BitFlags<DisplayFlag>>;
5113
+ export declare function getFloorDisplayFlags(minimapAPI?: boolean): Map<int, BitFlags<DisplayFlag>>;
5111
5114
 
5112
5115
  /**
5113
5116
  * Helper function to get the corresponding golden trinket type from a normal trinket type.
@@ -6312,8 +6315,10 @@ export declare function getRoomDescriptorsForType(...roomTypes: RoomType[]): Roo
6312
6315
  * This function automatically accounts for whether or not MinimapAPI is being used.
6313
6316
  *
6314
6317
  * @param roomGridIndex Optional. Default is the current room index.
6318
+ * @param minimapAPI Optional. Whether or not MinimapAPI should be used, if present. Default is
6319
+ * true.
6315
6320
  */
6316
- export declare function getRoomDisplayFlags(roomGridIndex?: int): BitFlags<DisplayFlag>;
6321
+ export declare function getRoomDisplayFlags(roomGridIndex?: int, minimapAPI?: boolean): BitFlags<DisplayFlag>;
6317
6322
 
6318
6323
  /**
6319
6324
  * Helper function to get the grid index of the current room.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 29.8.0
3
+ isaacscript-common 29.9.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -53196,11 +53196,14 @@ local getRoomDescriptor = ____roomData.getRoomDescriptor
53196
53196
  local getRoomGridIndex = ____roomData.getRoomGridIndex
53197
53197
  local ____rooms = require("src.functions.rooms")
53198
53198
  local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
53199
- function ____exports.getRoomDisplayFlags(self, roomGridIndex)
53199
+ function ____exports.getRoomDisplayFlags(self, roomGridIndex, minimapAPI)
53200
+ if minimapAPI == nil then
53201
+ minimapAPI = true
53202
+ end
53200
53203
  if roomGridIndex == nil then
53201
53204
  roomGridIndex = getRoomGridIndex(nil)
53202
53205
  end
53203
- if MinimapAPI == nil then
53206
+ if MinimapAPI == nil or not minimapAPI then
53204
53207
  local roomDescriptor = getRoomDescriptor(nil, roomGridIndex)
53205
53208
  return roomDescriptor.DisplayFlags
53206
53209
  end
@@ -53255,11 +53258,14 @@ end
53255
53258
  function ____exports.clearRoomDisplayFlags(self, roomGridIndex)
53256
53259
  ____exports.setRoomDisplayFlags(nil, roomGridIndex, DisplayFlagZero)
53257
53260
  end
53258
- function ____exports.getFloorDisplayFlags(self)
53261
+ function ____exports.getFloorDisplayFlags(self, minimapAPI)
53262
+ if minimapAPI == nil then
53263
+ minimapAPI = true
53264
+ end
53259
53265
  local displayFlagsMap = __TS__New(Map)
53260
53266
  for ____, roomDescriptor in ipairs(getRoomsInsideGrid(nil)) do
53261
53267
  local roomGridIndex = roomDescriptor.SafeGridIndex
53262
- local displayFlags = ____exports.getRoomDisplayFlags(nil, roomGridIndex)
53268
+ local displayFlags = ____exports.getRoomDisplayFlags(nil, roomGridIndex, minimapAPI)
53263
53269
  displayFlagsMap:set(roomGridIndex, displayFlags)
53264
53270
  end
53265
53271
  return displayFlagsMap
@@ -38,8 +38,11 @@ export declare function clearRoomDisplayFlags(roomGridIndex: int): void;
38
38
  * that is indexed by the room's safe grid index.
39
39
  *
40
40
  * This function automatically accounts for whether or not MinimapAPI is being used.
41
+ *
42
+ * @param minimapAPI Optional. Whether or not MinimapAPI should be used, if present. Default is
43
+ * true.
41
44
  */
42
- export declare function getFloorDisplayFlags(): Map<int, BitFlags<DisplayFlag>>;
45
+ export declare function getFloorDisplayFlags(minimapAPI?: boolean): Map<int, BitFlags<DisplayFlag>>;
43
46
  /**
44
47
  * Helper function to get a particular room's minimap display flags (e.g. whether or not it is
45
48
  * visible and so on).
@@ -47,8 +50,10 @@ export declare function getFloorDisplayFlags(): Map<int, BitFlags<DisplayFlag>>;
47
50
  * This function automatically accounts for whether or not MinimapAPI is being used.
48
51
  *
49
52
  * @param roomGridIndex Optional. Default is the current room index.
53
+ * @param minimapAPI Optional. Whether or not MinimapAPI should be used, if present. Default is
54
+ * true.
50
55
  */
51
- export declare function getRoomDisplayFlags(roomGridIndex?: int): BitFlags<DisplayFlag>;
56
+ export declare function getRoomDisplayFlags(roomGridIndex?: int, minimapAPI?: boolean): BitFlags<DisplayFlag>;
52
57
  /**
53
58
  * Helper function to hide a specific room on the minimap.
54
59
  *
@@ -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;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAUtE;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,CAAC,EAAE,GAAG,GAClB,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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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"}
@@ -20,11 +20,16 @@ local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
20
20
  -- This function automatically accounts for whether or not MinimapAPI is being used.
21
21
  --
22
22
  -- @param roomGridIndex Optional. Default is the current room index.
23
- function ____exports.getRoomDisplayFlags(self, roomGridIndex)
23
+ -- @param minimapAPI Optional. Whether or not MinimapAPI should be used, if present. Default is
24
+ -- true.
25
+ function ____exports.getRoomDisplayFlags(self, roomGridIndex, minimapAPI)
26
+ if minimapAPI == nil then
27
+ minimapAPI = true
28
+ end
24
29
  if roomGridIndex == nil then
25
30
  roomGridIndex = getRoomGridIndex(nil)
26
31
  end
27
- if MinimapAPI == nil then
32
+ if MinimapAPI == nil or not minimapAPI then
28
33
  local roomDescriptor = getRoomDescriptor(nil, roomGridIndex)
29
34
  return roomDescriptor.DisplayFlags
30
35
  end
@@ -125,11 +130,17 @@ end
125
130
  -- that is indexed by the room's safe grid index.
126
131
  --
127
132
  -- This function automatically accounts for whether or not MinimapAPI is being used.
128
- function ____exports.getFloorDisplayFlags(self)
133
+ --
134
+ -- @param minimapAPI Optional. Whether or not MinimapAPI should be used, if present. Default is
135
+ -- true.
136
+ function ____exports.getFloorDisplayFlags(self, minimapAPI)
137
+ if minimapAPI == nil then
138
+ minimapAPI = true
139
+ end
129
140
  local displayFlagsMap = __TS__New(Map)
130
141
  for ____, roomDescriptor in ipairs(getRoomsInsideGrid(nil)) do
131
142
  local roomGridIndex = roomDescriptor.SafeGridIndex
132
- local displayFlags = ____exports.getRoomDisplayFlags(nil, roomGridIndex)
143
+ local displayFlags = ____exports.getRoomDisplayFlags(nil, roomGridIndex, minimapAPI)
133
144
  displayFlagsMap:set(roomGridIndex, displayFlags)
134
145
  end
135
146
  return displayFlagsMap
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "29.8.0",
3
+ "version": "29.9.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -58,13 +58,18 @@ export function clearRoomDisplayFlags(roomGridIndex: int): void {
58
58
  * that is indexed by the room's safe grid index.
59
59
  *
60
60
  * This function automatically accounts for whether or not MinimapAPI is being used.
61
+ *
62
+ * @param minimapAPI Optional. Whether or not MinimapAPI should be used, if present. Default is
63
+ * true.
61
64
  */
62
- export function getFloorDisplayFlags(): Map<int, BitFlags<DisplayFlag>> {
65
+ export function getFloorDisplayFlags(
66
+ minimapAPI = true,
67
+ ): Map<int, BitFlags<DisplayFlag>> {
63
68
  const displayFlagsMap = new Map<int, BitFlags<DisplayFlag>>();
64
69
 
65
70
  for (const roomDescriptor of getRoomsInsideGrid()) {
66
71
  const roomGridIndex = roomDescriptor.SafeGridIndex;
67
- const displayFlags = getRoomDisplayFlags(roomGridIndex);
72
+ const displayFlags = getRoomDisplayFlags(roomGridIndex, minimapAPI);
68
73
  displayFlagsMap.set(roomGridIndex, displayFlags);
69
74
  }
70
75
 
@@ -78,15 +83,18 @@ export function getFloorDisplayFlags(): Map<int, BitFlags<DisplayFlag>> {
78
83
  * This function automatically accounts for whether or not MinimapAPI is being used.
79
84
  *
80
85
  * @param roomGridIndex Optional. Default is the current room index.
86
+ * @param minimapAPI Optional. Whether or not MinimapAPI should be used, if present. Default is
87
+ * true.
81
88
  */
82
89
  export function getRoomDisplayFlags(
83
90
  roomGridIndex?: int,
91
+ minimapAPI = true,
84
92
  ): BitFlags<DisplayFlag> {
85
93
  if (roomGridIndex === undefined) {
86
94
  roomGridIndex = getRoomGridIndex();
87
95
  }
88
96
 
89
- if (MinimapAPI === undefined) {
97
+ if (MinimapAPI === undefined || !minimapAPI) {
90
98
  const roomDescriptor = getRoomDescriptor(roomGridIndex);
91
99
  return roomDescriptor.DisplayFlags;
92
100
  }